From cbede41ae2ecc4822f7b4ca9d0c2d330b207a5bd Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 5 Dec 2025 15:14:48 +0000 Subject: [PATCH 1/2] Initial plan From 0d80e9e217e789ce986055f7eda45b54074867d1 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 5 Dec 2025 15:24:46 +0000 Subject: [PATCH 2/2] Changes before error encountered Co-authored-by: BupycHuk <2506513+BupycHuk@users.noreply.github.com> --- api/accesscontrol/v1beta1/accesscontrol.pb.go | 894 - .../v1beta1/accesscontrol.pb.gw.go | 603 - .../v1beta1/accesscontrol.pb.validate.go | 1705 - .../v1beta1/accesscontrol_grpc.pb.go | 374 - .../access_control_service_client.go | 385 - .../assign_roles_parameters.go | 144 - .../assign_roles_responses.go | 454 - .../create_role_parameters.go | 144 - .../create_role_responses.go | 496 - .../delete_role_parameters.go | 184 - .../delete_role_responses.go | 414 - .../get_role_parameters.go | 149 - .../get_role_responses.go | 462 - .../list_roles_parameters.go | 127 - .../list_roles_responses.go | 573 - .../set_default_role_parameters.go | 144 - .../set_default_role_responses.go | 451 - .../update_role_parameters.go | 166 - .../update_role_responses.go | 457 - .../json/client/pmm_roles_api_client.go | 112 - api/accesscontrol/v1beta1/json/v1beta1.json | 540 - api/actions/v1/actions.pb.go | 2744 -- api/actions/v1/actions.pb.gw.go | 367 - api/actions/v1/actions.pb.validate.go | 4657 --- api/actions/v1/actions_grpc.pb.go | 251 - .../actions_service/actions_service_client.go | 247 - .../cancel_action_parameters.go | 144 - .../cancel_action_responses.go | 451 - .../actions_service/get_action_parameters.go | 149 - .../actions_service/get_action_responses.go | 465 - .../start_pt_summary_action_parameters.go | 144 - .../start_pt_summary_action_responses.go | 496 - .../start_service_action_parameters.go | 144 - .../start_service_action_responses.go | 2916 -- .../v1/json/client/pmm_actions_api_client.go | 112 - api/actions/v1/json/v1.json | 820 - api/advisors/v1/advisors.pb.go | 1449 - api/advisors/v1/advisors.pb.gw.go | 477 - api/advisors/v1/advisors.pb.validate.go | 2183 -- api/advisors/v1/advisors_grpc.pb.go | 333 - .../advisor_service/advisor_service_client.go | 339 - .../change_advisor_checks_parameters.go | 144 - .../change_advisor_checks_responses.go | 627 - .../get_failed_checks_parameters.go | 231 - .../get_failed_checks_responses.go | 668 - .../list_advisor_checks_parameters.go | 127 - .../list_advisor_checks_responses.go | 691 - .../list_advisors_parameters.go | 127 - .../list_advisors_responses.go | 817 - .../list_failed_services_parameters.go | 127 - .../list_failed_services_responses.go | 591 - .../start_advisor_checks_parameters.go | 144 - .../start_advisor_checks_responses.go | 451 - .../v1/json/client/pmm_advisor_api_client.go | 112 - api/advisors/v1/json/v1.json | 699 - api/agent/pb/agent.pb.go | 72 - api/agent/pb/agent.pb.validate.go | 36 - api/agent/pb/agent_grpc.pb.go | 124 - api/agent/v1/agent.pb.go | 7452 ---- api/agent/v1/agent.pb.validate.go | 14101 ------- api/agent/v1/agent_grpc.pb.go | 122 - api/agent/v1/collector.pb.go | 2813 -- api/agent/v1/collector.pb.validate.go | 1294 - api/agentlocal/v1/agentlocal.pb.go | 529 - api/agentlocal/v1/agentlocal.pb.gw.go | 297 - api/agentlocal/v1/agentlocal.pb.validate.go | 791 - api/agentlocal/v1/agentlocal_grpc.pb.go | 169 - .../agent_local_service_client.go | 195 - .../agent_local_service/reload_parameters.go | 146 - .../agent_local_service/reload_responses.go | 414 - .../agent_local_service/status2_parameters.go | 161 - .../agent_local_service/status2_responses.go | 882 - .../agent_local_service/status_parameters.go | 144 - .../agent_local_service/status_responses.go | 919 - .../json/client/pmm_agent_local_api_client.go | 112 - api/agentlocal/v1/json/v1.json | 472 - api/alerting/v1/alerting.pb.go | 1540 - api/alerting/v1/alerting.pb.gw.go | 459 - api/alerting/v1/alerting.pb.validate.go | 2352 -- api/alerting/v1/alerting_grpc.pb.go | 292 - .../alerting_service_client.go | 283 - .../create_rule_parameters.go | 144 - .../alerting_service/create_rule_responses.go | 890 - .../create_template_parameters.go | 144 - .../create_template_responses.go | 451 - .../delete_template_parameters.go | 146 - .../delete_template_responses.go | 414 - .../list_templates_parameters.go | 231 - .../list_templates_responses.go | 1275 - .../update_template_parameters.go | 166 - .../update_template_responses.go | 451 - .../v1/json/client/pmm_alerting_api_client.go | 112 - api/alerting/v1/json/v1.json | 671 - api/alerting/v1/params.pb.go | 197 - api/alerting/v1/params.pb.validate.go | 36 - api/backup/v1/artifacts.pb.go | 701 - api/backup/v1/artifacts.pb.validate.go | 1084 - api/backup/v1/backup.pb.go | 1351 - api/backup/v1/backup.pb.gw.go | 827 - api/backup/v1/backup.pb.validate.go | 2159 -- api/backup/v1/backup_grpc.pb.go | 497 - api/backup/v1/common.pb.go | 464 - api/backup/v1/common.pb.validate.go | 559 - api/backup/v1/errors.pb.go | 205 - api/backup/v1/errors.pb.validate.go | 136 - .../backup_service/backup_service_client.go | 527 - .../change_scheduled_backup_parameters.go | 144 - .../change_scheduled_backup_responses.go | 498 - .../delete_artifact_parameters.go | 183 - .../delete_artifact_responses.go | 414 - .../backup_service/get_logs_parameters.go | 211 - .../backup_service/get_logs_responses.go | 570 - ...artifact_compatible_services_parameters.go | 149 - ..._artifact_compatible_services_responses.go | 737 - .../list_artifacts_parameters.go | 127 - .../list_artifacts_responses.go | 1132 - .../list_pitr_timeranges_parameters.go | 149 - .../list_pitr_timeranges_responses.go | 607 - .../list_scheduled_backups_parameters.go | 127 - .../list_scheduled_backups_responses.go | 778 - .../remove_scheduled_backup_parameters.go | 146 - .../remove_scheduled_backup_responses.go | 414 - .../schedule_backup_parameters.go | 144 - .../schedule_backup_responses.go | 653 - .../backup_service/start_backup_parameters.go | 144 - .../backup_service/start_backup_responses.go | 567 - .../add_location_parameters.go | 144 - .../add_location_responses.go | 702 - .../change_location_parameters.go | 166 - .../change_location_responses.go | 663 - .../list_locations_parameters.go | 127 - .../list_locations_responses.go | 779 - .../locations_service_client.go | 293 - .../remove_location_parameters.go | 183 - .../remove_location_responses.go | 414 - .../test_location_config_parameters.go | 144 - .../test_location_config_responses.go | 657 - .../pmm_backup_management_api_client.go | 122 - .../get_logs_mixin5_parameters.go | 211 - .../get_logs_mixin5_responses.go | 570 - .../list_restores_parameters.go | 127 - .../list_restores_responses.go | 760 - .../restore_backup_parameters.go | 144 - .../restore_backup_responses.go | 519 - .../restore_service/restore_service_client.go | 206 - api/backup/v1/json/v1.json | 2088 -- api/backup/v1/locations.pb.go | 888 - api/backup/v1/locations.pb.gw.go | 459 - api/backup/v1/locations.pb.validate.go | 1747 - api/backup/v1/locations_grpc.pb.go | 292 - api/backup/v1/restores.pb.go | 675 - api/backup/v1/restores.pb.gw.go | 309 - api/backup/v1/restores.pb.validate.go | 997 - api/backup/v1/restores_grpc.pb.go | 210 - api/common/common.pb.go | 182 - api/common/common.pb.validate.go | 236 - api/common/metrics_resolutions.pb.go | 155 - api/common/metrics_resolutions.pb.validate.go | 225 - api/dump/v1beta1/dump.pb.go | 919 - api/dump/v1beta1/dump.pb.gw.go | 441 - api/dump/v1beta1/dump.pb.validate.go | 1732 - api/dump/v1beta1/dump_grpc.pb.go | 288 - .../dump_service/delete_dump_parameters.go | 144 - .../dump_service/delete_dump_responses.go | 451 - .../dump_service/dump_service_client.go | 293 - .../dump_service/get_dump_logs_parameters.go | 211 - .../dump_service/get_dump_logs_responses.go | 570 - .../dump_service/list_dumps_parameters.go | 127 - .../dump_service/list_dumps_responses.go | 689 - .../dump_service/start_dump_parameters.go | 144 - .../dump_service/start_dump_responses.go | 542 - .../dump_service/upload_dump_parameters.go | 144 - .../dump_service/upload_dump_responses.go | 565 - .../json/client/pmm_dump_api_client.go | 112 - api/dump/v1beta1/json/v1beta1.json | 465 - api/inventory/v1/agent_status.pb.go | 162 - api/inventory/v1/agent_status.pb.validate.go | 36 - api/inventory/v1/agents.pb.go | 10345 ----- api/inventory/v1/agents.pb.gw.go | 577 - api/inventory/v1/agents.pb.validate.go | 13129 ------- api/inventory/v1/agents_grpc.pb.go | 333 - .../agents_service/add_agent_parameters.go | 144 - .../agents_service/add_agent_responses.go | 8496 ----- .../agents_service/agents_service_client.go | 339 - .../agents_service/change_agent_parameters.go | 163 - .../agents_service/change_agent_responses.go | 10244 ----- .../get_agent_logs_parameters.go | 185 - .../get_agent_logs_responses.go | 456 - .../agents_service/get_agent_parameters.go | 149 - .../agents_service/get_agent_responses.go | 5839 --- .../agents_service/list_agents_parameters.go | 273 - .../agents_service/list_agents_responses.go | 6001 --- .../agents_service/remove_agent_parameters.go | 180 - .../agents_service/remove_agent_responses.go | 414 - .../nodes_service/add_node_parameters.go | 144 - .../nodes_service/add_node_responses.go | 1652 - .../nodes_service/get_node_parameters.go | 149 - .../nodes_service/get_node_responses.go | 1043 - .../nodes_service/list_nodes_parameters.go | 171 - .../nodes_service/list_nodes_responses.go | 1088 - .../nodes_service/nodes_service_client.go | 247 - .../nodes_service/remove_node_parameters.go | 183 - .../nodes_service/remove_node_responses.go | 414 - .../json/client/pmm_inventory_api_client.go | 122 - .../add_service_parameters.go | 144 - .../services_service/add_service_responses.go | 2221 -- .../change_service_parameters.go | 163 - .../change_service_responses.go | 1489 - .../get_service_parameters.go | 149 - .../services_service/get_service_responses.go | 1338 - .../list_active_service_types_parameters.go | 146 - .../list_active_service_types_responses.go | 502 - .../list_services_parameters.go | 237 - .../list_services_responses.go | 1401 - .../remove_service_parameters.go | 183 - .../remove_service_responses.go | 414 - .../services_service_client.go | 339 - api/inventory/v1/json/v1.json | 14144 ------- api/inventory/v1/log_level.pb.go | 148 - api/inventory/v1/log_level.pb.validate.go | 36 - api/inventory/v1/nodes.pb.go | 2117 -- api/inventory/v1/nodes.pb.gw.go | 401 - api/inventory/v1/nodes.pb.validate.go | 2938 -- api/inventory/v1/nodes_grpc.pb.go | 251 - api/inventory/v1/services.pb.go | 3451 -- api/inventory/v1/services.pb.gw.go | 551 - api/inventory/v1/services.pb.validate.go | 4563 --- api/inventory/v1/services_grpc.pb.go | 333 - api/management/v1/agent.pb.go | 1264 - api/management/v1/agent.pb.validate.go | 1546 - api/management/v1/annotation.pb.go | 198 - api/management/v1/annotation.pb.validate.go | 253 - api/management/v1/azure.pb.go | 751 - api/management/v1/azure.pb.validate.go | 787 - api/management/v1/external.pb.go | 395 - api/management/v1/external.pb.validate.go | 381 - api/management/v1/haproxy.pb.go | 373 - api/management/v1/haproxy.pb.validate.go | 377 - .../add_annotation_parameters.go | 147 - .../add_annotation_responses.go | 460 - .../add_azure_database_parameters.go | 144 - .../add_azure_database_responses.go | 585 - .../add_service_parameters.go | 144 - .../add_service_responses.go | 11884 ------ .../discover_azure_database_parameters.go | 147 - .../discover_azure_database_responses.go | 697 - .../discover_rds_parameters.go | 144 - .../discover_rds_responses.go | 681 - .../management_service/get_node_parameters.go | 149 - .../management_service/get_node_responses.go | 926 - .../list_agent_versions_parameters.go | 127 - .../list_agent_versions_responses.go | 638 - .../list_agents_parameters.go | 193 - .../list_agents_responses.go | 1199 - .../list_nodes_parameters.go | 171 - .../list_nodes_responses.go | 935 - .../list_services_parameters.go | 237 - .../list_services_responses.go | 1459 - .../management_service_client.go | 661 - .../register_node_parameters.go | 144 - .../register_node_responses.go | 1017 - .../remove_service_parameters.go | 193 - .../remove_service_responses.go | 414 - .../unregister_node_parameters.go | 183 - .../unregister_node_responses.go | 453 - .../json/client/pmm_management_api_client.go | 112 - api/management/v1/json/v1.json | 7226 ---- api/management/v1/metrics.pb.go | 137 - api/management/v1/metrics.pb.validate.go | 36 - api/management/v1/mongodb.pb.go | 559 - api/management/v1/mongodb.pb.validate.go | 467 - api/management/v1/mysql.pb.go | 577 - api/management/v1/mysql.pb.validate.go | 480 - api/management/v1/node.pb.go | 1297 - api/management/v1/node.pb.validate.go | 1674 - api/management/v1/postgresql.pb.go | 566 - api/management/v1/postgresql.pb.validate.go | 480 - api/management/v1/proxysql.pb.go | 424 - api/management/v1/proxysql.pb.validate.go | 398 - api/management/v1/rds.pb.go | 890 - api/management/v1/rds.pb.validate.go | 943 - api/management/v1/service.pb.go | 1122 - api/management/v1/service.pb.gw.go | 1031 - api/management/v1/service.pb.validate.go | 1586 - api/management/v1/service_grpc.pb.go | 620 - api/management/v1/severity.pb.go | 159 - api/management/v1/severity.pb.validate.go | 36 - api/management/v1/valkey.pb.go | 446 - api/management/v1/valkey.pb.validate.go | 417 - .../platform_service/connect_parameters.go | 144 - .../platform_service/connect_responses.go | 454 - .../platform_service/disconnect_parameters.go | 144 - .../platform_service/disconnect_responses.go | 451 - .../get_contact_information_parameters.go | 127 - .../get_contact_information_responses.go | 561 - .../platform_service_client.go | 385 - ...ch_organization_entitlements_parameters.go | 127 - ...rch_organization_entitlements_responses.go | 736 - .../search_organization_tickets_parameters.go | 127 - .../search_organization_tickets_responses.go | 611 - .../server_info_parameters.go | 127 - .../platform_service/server_info_responses.go | 462 - .../user_status_parameters.go | 127 - .../platform_service/user_status_responses.go | 453 - .../v1/json/client/pmm_platform_api_client.go | 112 - api/platform/v1/json/v1.json | 601 - api/platform/v1/platform.pb.go | 1174 - api/platform/v1/platform.pb.gw.go | 523 - api/platform/v1/platform.pb.validate.go | 2183 -- api/platform/v1/platform_grpc.pb.go | 374 - api/qan/v1/collector.pb.go | 2742 -- api/qan/v1/collector.pb.validate.go | 898 - api/qan/v1/collector_grpc.pb.go | 128 - api/qan/v1/filters.pb.go | 334 - api/qan/v1/filters.pb.validate.go | 619 - api/qan/v1/json/client/pmm_qan_api_client.go | 112 - ...lain_fingerprint_by_query_id_parameters.go | 147 - ...plain_fingerprint_by_query_id_responses.go | 496 - .../get_filtered_metrics_names_parameters.go | 147 - .../get_filtered_metrics_names_responses.go | 863 - .../qan_service/get_histogram_parameters.go | 147 - .../qan_service/get_histogram_responses.go | 762 - .../qan_service/get_labels_parameters.go | 148 - .../qan_service/get_labels_responses.go | 637 - .../get_metrics_names_parameters.go | 149 - .../get_metrics_names_responses.go | 455 - .../qan_service/get_metrics_parameters.go | 147 - .../qan_service/get_metrics_responses.go | 1350 - .../get_query_example_parameters.go | 148 - .../get_query_example_responses.go | 857 - .../qan_service/get_query_plan_parameters.go | 146 - .../qan_service/get_query_plan_responses.go | 456 - .../qan_service/get_report_parameters.go | 147 - .../qan_service/get_report_responses.go | 1357 - .../client/qan_service/qan_service_client.go | 569 - .../qan_service/query_exists_parameters.go | 147 - .../qan_service/query_exists_responses.go | 493 - .../schema_by_query_id_parameters.go | 147 - .../schema_by_query_id_responses.go | 493 - api/qan/v1/json/v1.json | 2399 -- api/qan/v1/object_details.pb.go | 1701 - api/qan/v1/object_details.pb.validate.go | 2988 -- api/qan/v1/profile.pb.go | 641 - api/qan/v1/profile.pb.validate.go | 919 - api/qan/v1/qan.pb.go | 1005 - api/qan/v1/qan.pb.validate.go | 388 - api/qan/v1/service.pb.go | 239 - api/qan/v1/service.pb.gw.go | 829 - api/qan/v1/service.pb.validate.go | 242 - api/qan/v1/service_grpc.pb.go | 538 - api/server/v1/httperror.pb.go | 162 - api/server/v1/httperror.pb.validate.go | 175 - .../v1/json/client/pmm_server_api_client.go | 112 - .../change_settings_parameters.go | 144 - .../change_settings_responses.go | 1357 - .../check_updates_parameters.go | 194 - .../server_service/check_updates_responses.go | 904 - .../get_read_only_settings_parameters.go | 127 - .../get_read_only_settings_responses.go | 741 - .../server_service/get_settings_parameters.go | 127 - .../server_service/get_settings_responses.go | 980 - .../leader_health_check_parameters.go | 127 - .../leader_health_check_responses.go | 579 - .../list_change_logs_parameters.go | 127 - .../list_change_logs_responses.go | 784 - .../client/server_service/logs_parameters.go | 161 - .../client/server_service/logs_responses.go | 228 - .../server_service/readiness_parameters.go | 127 - .../server_service/readiness_responses.go | 579 - .../server_service/server_service_client.go | 595 - .../server_service/start_update_parameters.go | 144 - .../server_service/start_update_responses.go | 658 - .../update_status_parameters.go | 144 - .../server_service/update_status_responses.go | 664 - .../server_service/version_parameters.go | 160 - .../server_service/version_responses.go | 937 - api/server/v1/json/v1.json | 1332 - api/server/v1/server.pb.go | 2031 - api/server/v1/server.pb.gw.go | 737 - api/server/v1/server.pb.validate.go | 3587 -- api/server/v1/server_grpc.pb.go | 499 - api/swagger/swagger-dev.json | 31067 ---------------- api/swagger/swagger.json | 30104 --------------- api/uievents/v1/server.pb.go | 521 - api/uievents/v1/server.pb.gw.go | 153 - api/uievents/v1/server.pb.validate.go | 809 - api/uievents/v1/server_grpc.pb.go | 128 - .../v1/json/client/pmm_user_api_client.go | 112 - .../user_service/get_user_parameters.go | 127 - .../client/user_service/get_user_responses.go | 491 - .../user_service/list_users_parameters.go | 127 - .../user_service/list_users_responses.go | 567 - .../user_service/update_user_parameters.go | 144 - .../user_service/update_user_responses.go | 534 - .../user_service/user_service_client.go | 201 - api/user/v1/json/v1.json | 294 - api/user/v1/user.pb.go | 551 - api/user/v1/user.pb.gw.go | 277 - api/user/v1/user.pb.validate.go | 871 - api/user/v1/user_grpc.pb.go | 204 - 400 files changed, 390671 deletions(-) delete mode 100644 api/accesscontrol/v1beta1/accesscontrol.pb.go delete mode 100644 api/accesscontrol/v1beta1/accesscontrol.pb.gw.go delete mode 100644 api/accesscontrol/v1beta1/accesscontrol.pb.validate.go delete mode 100644 api/accesscontrol/v1beta1/accesscontrol_grpc.pb.go delete mode 100644 api/accesscontrol/v1beta1/json/client/access_control_service/access_control_service_client.go delete mode 100644 api/accesscontrol/v1beta1/json/client/access_control_service/assign_roles_parameters.go delete mode 100644 api/accesscontrol/v1beta1/json/client/access_control_service/assign_roles_responses.go delete mode 100644 api/accesscontrol/v1beta1/json/client/access_control_service/create_role_parameters.go delete mode 100644 api/accesscontrol/v1beta1/json/client/access_control_service/create_role_responses.go delete mode 100644 api/accesscontrol/v1beta1/json/client/access_control_service/delete_role_parameters.go delete mode 100644 api/accesscontrol/v1beta1/json/client/access_control_service/delete_role_responses.go delete mode 100644 api/accesscontrol/v1beta1/json/client/access_control_service/get_role_parameters.go delete mode 100644 api/accesscontrol/v1beta1/json/client/access_control_service/get_role_responses.go delete mode 100644 api/accesscontrol/v1beta1/json/client/access_control_service/list_roles_parameters.go delete mode 100644 api/accesscontrol/v1beta1/json/client/access_control_service/list_roles_responses.go delete mode 100644 api/accesscontrol/v1beta1/json/client/access_control_service/set_default_role_parameters.go delete mode 100644 api/accesscontrol/v1beta1/json/client/access_control_service/set_default_role_responses.go delete mode 100644 api/accesscontrol/v1beta1/json/client/access_control_service/update_role_parameters.go delete mode 100644 api/accesscontrol/v1beta1/json/client/access_control_service/update_role_responses.go delete mode 100644 api/accesscontrol/v1beta1/json/client/pmm_roles_api_client.go delete mode 100644 api/accesscontrol/v1beta1/json/v1beta1.json delete mode 100644 api/actions/v1/actions.pb.go delete mode 100644 api/actions/v1/actions.pb.gw.go delete mode 100644 api/actions/v1/actions.pb.validate.go delete mode 100644 api/actions/v1/actions_grpc.pb.go delete mode 100644 api/actions/v1/json/client/actions_service/actions_service_client.go delete mode 100644 api/actions/v1/json/client/actions_service/cancel_action_parameters.go delete mode 100644 api/actions/v1/json/client/actions_service/cancel_action_responses.go delete mode 100644 api/actions/v1/json/client/actions_service/get_action_parameters.go delete mode 100644 api/actions/v1/json/client/actions_service/get_action_responses.go delete mode 100644 api/actions/v1/json/client/actions_service/start_pt_summary_action_parameters.go delete mode 100644 api/actions/v1/json/client/actions_service/start_pt_summary_action_responses.go delete mode 100644 api/actions/v1/json/client/actions_service/start_service_action_parameters.go delete mode 100644 api/actions/v1/json/client/actions_service/start_service_action_responses.go delete mode 100644 api/actions/v1/json/client/pmm_actions_api_client.go delete mode 100644 api/actions/v1/json/v1.json delete mode 100644 api/advisors/v1/advisors.pb.go delete mode 100644 api/advisors/v1/advisors.pb.gw.go delete mode 100644 api/advisors/v1/advisors.pb.validate.go delete mode 100644 api/advisors/v1/advisors_grpc.pb.go delete mode 100644 api/advisors/v1/json/client/advisor_service/advisor_service_client.go delete mode 100644 api/advisors/v1/json/client/advisor_service/change_advisor_checks_parameters.go delete mode 100644 api/advisors/v1/json/client/advisor_service/change_advisor_checks_responses.go delete mode 100644 api/advisors/v1/json/client/advisor_service/get_failed_checks_parameters.go delete mode 100644 api/advisors/v1/json/client/advisor_service/get_failed_checks_responses.go delete mode 100644 api/advisors/v1/json/client/advisor_service/list_advisor_checks_parameters.go delete mode 100644 api/advisors/v1/json/client/advisor_service/list_advisor_checks_responses.go delete mode 100644 api/advisors/v1/json/client/advisor_service/list_advisors_parameters.go delete mode 100644 api/advisors/v1/json/client/advisor_service/list_advisors_responses.go delete mode 100644 api/advisors/v1/json/client/advisor_service/list_failed_services_parameters.go delete mode 100644 api/advisors/v1/json/client/advisor_service/list_failed_services_responses.go delete mode 100644 api/advisors/v1/json/client/advisor_service/start_advisor_checks_parameters.go delete mode 100644 api/advisors/v1/json/client/advisor_service/start_advisor_checks_responses.go delete mode 100644 api/advisors/v1/json/client/pmm_advisor_api_client.go delete mode 100644 api/advisors/v1/json/v1.json delete mode 100644 api/agent/pb/agent.pb.go delete mode 100644 api/agent/pb/agent.pb.validate.go delete mode 100644 api/agent/pb/agent_grpc.pb.go delete mode 100644 api/agent/v1/agent.pb.go delete mode 100644 api/agent/v1/agent.pb.validate.go delete mode 100644 api/agent/v1/agent_grpc.pb.go delete mode 100644 api/agent/v1/collector.pb.go delete mode 100644 api/agent/v1/collector.pb.validate.go delete mode 100644 api/agentlocal/v1/agentlocal.pb.go delete mode 100644 api/agentlocal/v1/agentlocal.pb.gw.go delete mode 100644 api/agentlocal/v1/agentlocal.pb.validate.go delete mode 100644 api/agentlocal/v1/agentlocal_grpc.pb.go delete mode 100644 api/agentlocal/v1/json/client/agent_local_service/agent_local_service_client.go delete mode 100644 api/agentlocal/v1/json/client/agent_local_service/reload_parameters.go delete mode 100644 api/agentlocal/v1/json/client/agent_local_service/reload_responses.go delete mode 100644 api/agentlocal/v1/json/client/agent_local_service/status2_parameters.go delete mode 100644 api/agentlocal/v1/json/client/agent_local_service/status2_responses.go delete mode 100644 api/agentlocal/v1/json/client/agent_local_service/status_parameters.go delete mode 100644 api/agentlocal/v1/json/client/agent_local_service/status_responses.go delete mode 100644 api/agentlocal/v1/json/client/pmm_agent_local_api_client.go delete mode 100644 api/agentlocal/v1/json/v1.json delete mode 100644 api/alerting/v1/alerting.pb.go delete mode 100644 api/alerting/v1/alerting.pb.gw.go delete mode 100644 api/alerting/v1/alerting.pb.validate.go delete mode 100644 api/alerting/v1/alerting_grpc.pb.go delete mode 100644 api/alerting/v1/json/client/alerting_service/alerting_service_client.go delete mode 100644 api/alerting/v1/json/client/alerting_service/create_rule_parameters.go delete mode 100644 api/alerting/v1/json/client/alerting_service/create_rule_responses.go delete mode 100644 api/alerting/v1/json/client/alerting_service/create_template_parameters.go delete mode 100644 api/alerting/v1/json/client/alerting_service/create_template_responses.go delete mode 100644 api/alerting/v1/json/client/alerting_service/delete_template_parameters.go delete mode 100644 api/alerting/v1/json/client/alerting_service/delete_template_responses.go delete mode 100644 api/alerting/v1/json/client/alerting_service/list_templates_parameters.go delete mode 100644 api/alerting/v1/json/client/alerting_service/list_templates_responses.go delete mode 100644 api/alerting/v1/json/client/alerting_service/update_template_parameters.go delete mode 100644 api/alerting/v1/json/client/alerting_service/update_template_responses.go delete mode 100644 api/alerting/v1/json/client/pmm_alerting_api_client.go delete mode 100644 api/alerting/v1/json/v1.json delete mode 100644 api/alerting/v1/params.pb.go delete mode 100644 api/alerting/v1/params.pb.validate.go delete mode 100644 api/backup/v1/artifacts.pb.go delete mode 100644 api/backup/v1/artifacts.pb.validate.go delete mode 100644 api/backup/v1/backup.pb.go delete mode 100644 api/backup/v1/backup.pb.gw.go delete mode 100644 api/backup/v1/backup.pb.validate.go delete mode 100644 api/backup/v1/backup_grpc.pb.go delete mode 100644 api/backup/v1/common.pb.go delete mode 100644 api/backup/v1/common.pb.validate.go delete mode 100644 api/backup/v1/errors.pb.go delete mode 100644 api/backup/v1/errors.pb.validate.go delete mode 100644 api/backup/v1/json/client/backup_service/backup_service_client.go delete mode 100644 api/backup/v1/json/client/backup_service/change_scheduled_backup_parameters.go delete mode 100644 api/backup/v1/json/client/backup_service/change_scheduled_backup_responses.go delete mode 100644 api/backup/v1/json/client/backup_service/delete_artifact_parameters.go delete mode 100644 api/backup/v1/json/client/backup_service/delete_artifact_responses.go delete mode 100644 api/backup/v1/json/client/backup_service/get_logs_parameters.go delete mode 100644 api/backup/v1/json/client/backup_service/get_logs_responses.go delete mode 100644 api/backup/v1/json/client/backup_service/list_artifact_compatible_services_parameters.go delete mode 100644 api/backup/v1/json/client/backup_service/list_artifact_compatible_services_responses.go delete mode 100644 api/backup/v1/json/client/backup_service/list_artifacts_parameters.go delete mode 100644 api/backup/v1/json/client/backup_service/list_artifacts_responses.go delete mode 100644 api/backup/v1/json/client/backup_service/list_pitr_timeranges_parameters.go delete mode 100644 api/backup/v1/json/client/backup_service/list_pitr_timeranges_responses.go delete mode 100644 api/backup/v1/json/client/backup_service/list_scheduled_backups_parameters.go delete mode 100644 api/backup/v1/json/client/backup_service/list_scheduled_backups_responses.go delete mode 100644 api/backup/v1/json/client/backup_service/remove_scheduled_backup_parameters.go delete mode 100644 api/backup/v1/json/client/backup_service/remove_scheduled_backup_responses.go delete mode 100644 api/backup/v1/json/client/backup_service/schedule_backup_parameters.go delete mode 100644 api/backup/v1/json/client/backup_service/schedule_backup_responses.go delete mode 100644 api/backup/v1/json/client/backup_service/start_backup_parameters.go delete mode 100644 api/backup/v1/json/client/backup_service/start_backup_responses.go delete mode 100644 api/backup/v1/json/client/locations_service/add_location_parameters.go delete mode 100644 api/backup/v1/json/client/locations_service/add_location_responses.go delete mode 100644 api/backup/v1/json/client/locations_service/change_location_parameters.go delete mode 100644 api/backup/v1/json/client/locations_service/change_location_responses.go delete mode 100644 api/backup/v1/json/client/locations_service/list_locations_parameters.go delete mode 100644 api/backup/v1/json/client/locations_service/list_locations_responses.go delete mode 100644 api/backup/v1/json/client/locations_service/locations_service_client.go delete mode 100644 api/backup/v1/json/client/locations_service/remove_location_parameters.go delete mode 100644 api/backup/v1/json/client/locations_service/remove_location_responses.go delete mode 100644 api/backup/v1/json/client/locations_service/test_location_config_parameters.go delete mode 100644 api/backup/v1/json/client/locations_service/test_location_config_responses.go delete mode 100644 api/backup/v1/json/client/pmm_backup_management_api_client.go delete mode 100644 api/backup/v1/json/client/restore_service/get_logs_mixin5_parameters.go delete mode 100644 api/backup/v1/json/client/restore_service/get_logs_mixin5_responses.go delete mode 100644 api/backup/v1/json/client/restore_service/list_restores_parameters.go delete mode 100644 api/backup/v1/json/client/restore_service/list_restores_responses.go delete mode 100644 api/backup/v1/json/client/restore_service/restore_backup_parameters.go delete mode 100644 api/backup/v1/json/client/restore_service/restore_backup_responses.go delete mode 100644 api/backup/v1/json/client/restore_service/restore_service_client.go delete mode 100644 api/backup/v1/json/v1.json delete mode 100644 api/backup/v1/locations.pb.go delete mode 100644 api/backup/v1/locations.pb.gw.go delete mode 100644 api/backup/v1/locations.pb.validate.go delete mode 100644 api/backup/v1/locations_grpc.pb.go delete mode 100644 api/backup/v1/restores.pb.go delete mode 100644 api/backup/v1/restores.pb.gw.go delete mode 100644 api/backup/v1/restores.pb.validate.go delete mode 100644 api/backup/v1/restores_grpc.pb.go delete mode 100644 api/common/common.pb.go delete mode 100644 api/common/common.pb.validate.go delete mode 100644 api/common/metrics_resolutions.pb.go delete mode 100644 api/common/metrics_resolutions.pb.validate.go delete mode 100644 api/dump/v1beta1/dump.pb.go delete mode 100644 api/dump/v1beta1/dump.pb.gw.go delete mode 100644 api/dump/v1beta1/dump.pb.validate.go delete mode 100644 api/dump/v1beta1/dump_grpc.pb.go delete mode 100644 api/dump/v1beta1/json/client/dump_service/delete_dump_parameters.go delete mode 100644 api/dump/v1beta1/json/client/dump_service/delete_dump_responses.go delete mode 100644 api/dump/v1beta1/json/client/dump_service/dump_service_client.go delete mode 100644 api/dump/v1beta1/json/client/dump_service/get_dump_logs_parameters.go delete mode 100644 api/dump/v1beta1/json/client/dump_service/get_dump_logs_responses.go delete mode 100644 api/dump/v1beta1/json/client/dump_service/list_dumps_parameters.go delete mode 100644 api/dump/v1beta1/json/client/dump_service/list_dumps_responses.go delete mode 100644 api/dump/v1beta1/json/client/dump_service/start_dump_parameters.go delete mode 100644 api/dump/v1beta1/json/client/dump_service/start_dump_responses.go delete mode 100644 api/dump/v1beta1/json/client/dump_service/upload_dump_parameters.go delete mode 100644 api/dump/v1beta1/json/client/dump_service/upload_dump_responses.go delete mode 100644 api/dump/v1beta1/json/client/pmm_dump_api_client.go delete mode 100644 api/dump/v1beta1/json/v1beta1.json delete mode 100644 api/inventory/v1/agent_status.pb.go delete mode 100644 api/inventory/v1/agent_status.pb.validate.go delete mode 100644 api/inventory/v1/agents.pb.go delete mode 100644 api/inventory/v1/agents.pb.gw.go delete mode 100644 api/inventory/v1/agents.pb.validate.go delete mode 100644 api/inventory/v1/agents_grpc.pb.go delete mode 100644 api/inventory/v1/json/client/agents_service/add_agent_parameters.go delete mode 100644 api/inventory/v1/json/client/agents_service/add_agent_responses.go delete mode 100644 api/inventory/v1/json/client/agents_service/agents_service_client.go delete mode 100644 api/inventory/v1/json/client/agents_service/change_agent_parameters.go delete mode 100644 api/inventory/v1/json/client/agents_service/change_agent_responses.go delete mode 100644 api/inventory/v1/json/client/agents_service/get_agent_logs_parameters.go delete mode 100644 api/inventory/v1/json/client/agents_service/get_agent_logs_responses.go delete mode 100644 api/inventory/v1/json/client/agents_service/get_agent_parameters.go delete mode 100644 api/inventory/v1/json/client/agents_service/get_agent_responses.go delete mode 100644 api/inventory/v1/json/client/agents_service/list_agents_parameters.go delete mode 100644 api/inventory/v1/json/client/agents_service/list_agents_responses.go delete mode 100644 api/inventory/v1/json/client/agents_service/remove_agent_parameters.go delete mode 100644 api/inventory/v1/json/client/agents_service/remove_agent_responses.go delete mode 100644 api/inventory/v1/json/client/nodes_service/add_node_parameters.go delete mode 100644 api/inventory/v1/json/client/nodes_service/add_node_responses.go delete mode 100644 api/inventory/v1/json/client/nodes_service/get_node_parameters.go delete mode 100644 api/inventory/v1/json/client/nodes_service/get_node_responses.go delete mode 100644 api/inventory/v1/json/client/nodes_service/list_nodes_parameters.go delete mode 100644 api/inventory/v1/json/client/nodes_service/list_nodes_responses.go delete mode 100644 api/inventory/v1/json/client/nodes_service/nodes_service_client.go delete mode 100644 api/inventory/v1/json/client/nodes_service/remove_node_parameters.go delete mode 100644 api/inventory/v1/json/client/nodes_service/remove_node_responses.go delete mode 100644 api/inventory/v1/json/client/pmm_inventory_api_client.go delete mode 100644 api/inventory/v1/json/client/services_service/add_service_parameters.go delete mode 100644 api/inventory/v1/json/client/services_service/add_service_responses.go delete mode 100644 api/inventory/v1/json/client/services_service/change_service_parameters.go delete mode 100644 api/inventory/v1/json/client/services_service/change_service_responses.go delete mode 100644 api/inventory/v1/json/client/services_service/get_service_parameters.go delete mode 100644 api/inventory/v1/json/client/services_service/get_service_responses.go delete mode 100644 api/inventory/v1/json/client/services_service/list_active_service_types_parameters.go delete mode 100644 api/inventory/v1/json/client/services_service/list_active_service_types_responses.go delete mode 100644 api/inventory/v1/json/client/services_service/list_services_parameters.go delete mode 100644 api/inventory/v1/json/client/services_service/list_services_responses.go delete mode 100644 api/inventory/v1/json/client/services_service/remove_service_parameters.go delete mode 100644 api/inventory/v1/json/client/services_service/remove_service_responses.go delete mode 100644 api/inventory/v1/json/client/services_service/services_service_client.go delete mode 100644 api/inventory/v1/json/v1.json delete mode 100644 api/inventory/v1/log_level.pb.go delete mode 100644 api/inventory/v1/log_level.pb.validate.go delete mode 100644 api/inventory/v1/nodes.pb.go delete mode 100644 api/inventory/v1/nodes.pb.gw.go delete mode 100644 api/inventory/v1/nodes.pb.validate.go delete mode 100644 api/inventory/v1/nodes_grpc.pb.go delete mode 100644 api/inventory/v1/services.pb.go delete mode 100644 api/inventory/v1/services.pb.gw.go delete mode 100644 api/inventory/v1/services.pb.validate.go delete mode 100644 api/inventory/v1/services_grpc.pb.go delete mode 100644 api/management/v1/agent.pb.go delete mode 100644 api/management/v1/agent.pb.validate.go delete mode 100644 api/management/v1/annotation.pb.go delete mode 100644 api/management/v1/annotation.pb.validate.go delete mode 100644 api/management/v1/azure.pb.go delete mode 100644 api/management/v1/azure.pb.validate.go delete mode 100644 api/management/v1/external.pb.go delete mode 100644 api/management/v1/external.pb.validate.go delete mode 100644 api/management/v1/haproxy.pb.go delete mode 100644 api/management/v1/haproxy.pb.validate.go delete mode 100644 api/management/v1/json/client/management_service/add_annotation_parameters.go delete mode 100644 api/management/v1/json/client/management_service/add_annotation_responses.go delete mode 100644 api/management/v1/json/client/management_service/add_azure_database_parameters.go delete mode 100644 api/management/v1/json/client/management_service/add_azure_database_responses.go delete mode 100644 api/management/v1/json/client/management_service/add_service_parameters.go delete mode 100644 api/management/v1/json/client/management_service/add_service_responses.go delete mode 100644 api/management/v1/json/client/management_service/discover_azure_database_parameters.go delete mode 100644 api/management/v1/json/client/management_service/discover_azure_database_responses.go delete mode 100644 api/management/v1/json/client/management_service/discover_rds_parameters.go delete mode 100644 api/management/v1/json/client/management_service/discover_rds_responses.go delete mode 100644 api/management/v1/json/client/management_service/get_node_parameters.go delete mode 100644 api/management/v1/json/client/management_service/get_node_responses.go delete mode 100644 api/management/v1/json/client/management_service/list_agent_versions_parameters.go delete mode 100644 api/management/v1/json/client/management_service/list_agent_versions_responses.go delete mode 100644 api/management/v1/json/client/management_service/list_agents_parameters.go delete mode 100644 api/management/v1/json/client/management_service/list_agents_responses.go delete mode 100644 api/management/v1/json/client/management_service/list_nodes_parameters.go delete mode 100644 api/management/v1/json/client/management_service/list_nodes_responses.go delete mode 100644 api/management/v1/json/client/management_service/list_services_parameters.go delete mode 100644 api/management/v1/json/client/management_service/list_services_responses.go delete mode 100644 api/management/v1/json/client/management_service/management_service_client.go delete mode 100644 api/management/v1/json/client/management_service/register_node_parameters.go delete mode 100644 api/management/v1/json/client/management_service/register_node_responses.go delete mode 100644 api/management/v1/json/client/management_service/remove_service_parameters.go delete mode 100644 api/management/v1/json/client/management_service/remove_service_responses.go delete mode 100644 api/management/v1/json/client/management_service/unregister_node_parameters.go delete mode 100644 api/management/v1/json/client/management_service/unregister_node_responses.go delete mode 100644 api/management/v1/json/client/pmm_management_api_client.go delete mode 100644 api/management/v1/json/v1.json delete mode 100644 api/management/v1/metrics.pb.go delete mode 100644 api/management/v1/metrics.pb.validate.go delete mode 100644 api/management/v1/mongodb.pb.go delete mode 100644 api/management/v1/mongodb.pb.validate.go delete mode 100644 api/management/v1/mysql.pb.go delete mode 100644 api/management/v1/mysql.pb.validate.go delete mode 100644 api/management/v1/node.pb.go delete mode 100644 api/management/v1/node.pb.validate.go delete mode 100644 api/management/v1/postgresql.pb.go delete mode 100644 api/management/v1/postgresql.pb.validate.go delete mode 100644 api/management/v1/proxysql.pb.go delete mode 100644 api/management/v1/proxysql.pb.validate.go delete mode 100644 api/management/v1/rds.pb.go delete mode 100644 api/management/v1/rds.pb.validate.go delete mode 100644 api/management/v1/service.pb.go delete mode 100644 api/management/v1/service.pb.gw.go delete mode 100644 api/management/v1/service.pb.validate.go delete mode 100644 api/management/v1/service_grpc.pb.go delete mode 100644 api/management/v1/severity.pb.go delete mode 100644 api/management/v1/severity.pb.validate.go delete mode 100644 api/management/v1/valkey.pb.go delete mode 100644 api/management/v1/valkey.pb.validate.go delete mode 100644 api/platform/v1/json/client/platform_service/connect_parameters.go delete mode 100644 api/platform/v1/json/client/platform_service/connect_responses.go delete mode 100644 api/platform/v1/json/client/platform_service/disconnect_parameters.go delete mode 100644 api/platform/v1/json/client/platform_service/disconnect_responses.go delete mode 100644 api/platform/v1/json/client/platform_service/get_contact_information_parameters.go delete mode 100644 api/platform/v1/json/client/platform_service/get_contact_information_responses.go delete mode 100644 api/platform/v1/json/client/platform_service/platform_service_client.go delete mode 100644 api/platform/v1/json/client/platform_service/search_organization_entitlements_parameters.go delete mode 100644 api/platform/v1/json/client/platform_service/search_organization_entitlements_responses.go delete mode 100644 api/platform/v1/json/client/platform_service/search_organization_tickets_parameters.go delete mode 100644 api/platform/v1/json/client/platform_service/search_organization_tickets_responses.go delete mode 100644 api/platform/v1/json/client/platform_service/server_info_parameters.go delete mode 100644 api/platform/v1/json/client/platform_service/server_info_responses.go delete mode 100644 api/platform/v1/json/client/platform_service/user_status_parameters.go delete mode 100644 api/platform/v1/json/client/platform_service/user_status_responses.go delete mode 100644 api/platform/v1/json/client/pmm_platform_api_client.go delete mode 100644 api/platform/v1/json/v1.json delete mode 100644 api/platform/v1/platform.pb.go delete mode 100644 api/platform/v1/platform.pb.gw.go delete mode 100644 api/platform/v1/platform.pb.validate.go delete mode 100644 api/platform/v1/platform_grpc.pb.go delete mode 100644 api/qan/v1/collector.pb.go delete mode 100644 api/qan/v1/collector.pb.validate.go delete mode 100644 api/qan/v1/collector_grpc.pb.go delete mode 100644 api/qan/v1/filters.pb.go delete mode 100644 api/qan/v1/filters.pb.validate.go delete mode 100644 api/qan/v1/json/client/pmm_qan_api_client.go delete mode 100644 api/qan/v1/json/client/qan_service/explain_fingerprint_by_query_id_parameters.go delete mode 100644 api/qan/v1/json/client/qan_service/explain_fingerprint_by_query_id_responses.go delete mode 100644 api/qan/v1/json/client/qan_service/get_filtered_metrics_names_parameters.go delete mode 100644 api/qan/v1/json/client/qan_service/get_filtered_metrics_names_responses.go delete mode 100644 api/qan/v1/json/client/qan_service/get_histogram_parameters.go delete mode 100644 api/qan/v1/json/client/qan_service/get_histogram_responses.go delete mode 100644 api/qan/v1/json/client/qan_service/get_labels_parameters.go delete mode 100644 api/qan/v1/json/client/qan_service/get_labels_responses.go delete mode 100644 api/qan/v1/json/client/qan_service/get_metrics_names_parameters.go delete mode 100644 api/qan/v1/json/client/qan_service/get_metrics_names_responses.go delete mode 100644 api/qan/v1/json/client/qan_service/get_metrics_parameters.go delete mode 100644 api/qan/v1/json/client/qan_service/get_metrics_responses.go delete mode 100644 api/qan/v1/json/client/qan_service/get_query_example_parameters.go delete mode 100644 api/qan/v1/json/client/qan_service/get_query_example_responses.go delete mode 100644 api/qan/v1/json/client/qan_service/get_query_plan_parameters.go delete mode 100644 api/qan/v1/json/client/qan_service/get_query_plan_responses.go delete mode 100644 api/qan/v1/json/client/qan_service/get_report_parameters.go delete mode 100644 api/qan/v1/json/client/qan_service/get_report_responses.go delete mode 100644 api/qan/v1/json/client/qan_service/qan_service_client.go delete mode 100644 api/qan/v1/json/client/qan_service/query_exists_parameters.go delete mode 100644 api/qan/v1/json/client/qan_service/query_exists_responses.go delete mode 100644 api/qan/v1/json/client/qan_service/schema_by_query_id_parameters.go delete mode 100644 api/qan/v1/json/client/qan_service/schema_by_query_id_responses.go delete mode 100644 api/qan/v1/json/v1.json delete mode 100644 api/qan/v1/object_details.pb.go delete mode 100644 api/qan/v1/object_details.pb.validate.go delete mode 100644 api/qan/v1/profile.pb.go delete mode 100644 api/qan/v1/profile.pb.validate.go delete mode 100644 api/qan/v1/qan.pb.go delete mode 100644 api/qan/v1/qan.pb.validate.go delete mode 100644 api/qan/v1/service.pb.go delete mode 100644 api/qan/v1/service.pb.gw.go delete mode 100644 api/qan/v1/service.pb.validate.go delete mode 100644 api/qan/v1/service_grpc.pb.go delete mode 100644 api/server/v1/httperror.pb.go delete mode 100644 api/server/v1/httperror.pb.validate.go delete mode 100644 api/server/v1/json/client/pmm_server_api_client.go delete mode 100644 api/server/v1/json/client/server_service/change_settings_parameters.go delete mode 100644 api/server/v1/json/client/server_service/change_settings_responses.go delete mode 100644 api/server/v1/json/client/server_service/check_updates_parameters.go delete mode 100644 api/server/v1/json/client/server_service/check_updates_responses.go delete mode 100644 api/server/v1/json/client/server_service/get_read_only_settings_parameters.go delete mode 100644 api/server/v1/json/client/server_service/get_read_only_settings_responses.go delete mode 100644 api/server/v1/json/client/server_service/get_settings_parameters.go delete mode 100644 api/server/v1/json/client/server_service/get_settings_responses.go delete mode 100644 api/server/v1/json/client/server_service/leader_health_check_parameters.go delete mode 100644 api/server/v1/json/client/server_service/leader_health_check_responses.go delete mode 100644 api/server/v1/json/client/server_service/list_change_logs_parameters.go delete mode 100644 api/server/v1/json/client/server_service/list_change_logs_responses.go delete mode 100644 api/server/v1/json/client/server_service/logs_parameters.go delete mode 100644 api/server/v1/json/client/server_service/logs_responses.go delete mode 100644 api/server/v1/json/client/server_service/readiness_parameters.go delete mode 100644 api/server/v1/json/client/server_service/readiness_responses.go delete mode 100644 api/server/v1/json/client/server_service/server_service_client.go delete mode 100644 api/server/v1/json/client/server_service/start_update_parameters.go delete mode 100644 api/server/v1/json/client/server_service/start_update_responses.go delete mode 100644 api/server/v1/json/client/server_service/update_status_parameters.go delete mode 100644 api/server/v1/json/client/server_service/update_status_responses.go delete mode 100644 api/server/v1/json/client/server_service/version_parameters.go delete mode 100644 api/server/v1/json/client/server_service/version_responses.go delete mode 100644 api/server/v1/json/v1.json delete mode 100644 api/server/v1/server.pb.go delete mode 100644 api/server/v1/server.pb.gw.go delete mode 100644 api/server/v1/server.pb.validate.go delete mode 100644 api/server/v1/server_grpc.pb.go delete mode 100644 api/swagger/swagger-dev.json delete mode 100644 api/swagger/swagger.json delete mode 100644 api/uievents/v1/server.pb.go delete mode 100644 api/uievents/v1/server.pb.gw.go delete mode 100644 api/uievents/v1/server.pb.validate.go delete mode 100644 api/uievents/v1/server_grpc.pb.go delete mode 100644 api/user/v1/json/client/pmm_user_api_client.go delete mode 100644 api/user/v1/json/client/user_service/get_user_parameters.go delete mode 100644 api/user/v1/json/client/user_service/get_user_responses.go delete mode 100644 api/user/v1/json/client/user_service/list_users_parameters.go delete mode 100644 api/user/v1/json/client/user_service/list_users_responses.go delete mode 100644 api/user/v1/json/client/user_service/update_user_parameters.go delete mode 100644 api/user/v1/json/client/user_service/update_user_responses.go delete mode 100644 api/user/v1/json/client/user_service/user_service_client.go delete mode 100644 api/user/v1/json/v1.json delete mode 100644 api/user/v1/user.pb.go delete mode 100644 api/user/v1/user.pb.gw.go delete mode 100644 api/user/v1/user.pb.validate.go delete mode 100644 api/user/v1/user_grpc.pb.go diff --git a/api/accesscontrol/v1beta1/accesscontrol.pb.go b/api/accesscontrol/v1beta1/accesscontrol.pb.go deleted file mode 100644 index 4e592b26919..00000000000 --- a/api/accesscontrol/v1beta1/accesscontrol.pb.go +++ /dev/null @@ -1,894 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.10 -// protoc (unknown) -// source: accesscontrol/v1beta1/accesscontrol.proto - -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" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type CreateRoleRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` - Filter string `protobuf:"bytes,2,opt,name=filter,proto3" json:"filter,omitempty"` - Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CreateRoleRequest) Reset() { - *x = CreateRoleRequest{} - mi := &file_accesscontrol_v1beta1_accesscontrol_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CreateRoleRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateRoleRequest) ProtoMessage() {} - -func (x *CreateRoleRequest) ProtoReflect() protoreflect.Message { - mi := &file_accesscontrol_v1beta1_accesscontrol_proto_msgTypes[0] - 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 CreateRoleRequest.ProtoReflect.Descriptor instead. -func (*CreateRoleRequest) Descriptor() ([]byte, []int) { - return file_accesscontrol_v1beta1_accesscontrol_proto_rawDescGZIP(), []int{0} -} - -func (x *CreateRoleRequest) GetTitle() string { - if x != nil { - return x.Title - } - return "" -} - -func (x *CreateRoleRequest) GetFilter() string { - if x != nil { - return x.Filter - } - return "" -} - -func (x *CreateRoleRequest) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -type CreateRoleResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - RoleId uint32 `protobuf:"varint,1,opt,name=role_id,json=roleId,proto3" json:"role_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CreateRoleResponse) Reset() { - *x = CreateRoleResponse{} - mi := &file_accesscontrol_v1beta1_accesscontrol_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CreateRoleResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateRoleResponse) ProtoMessage() {} - -func (x *CreateRoleResponse) ProtoReflect() protoreflect.Message { - mi := &file_accesscontrol_v1beta1_accesscontrol_proto_msgTypes[1] - 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 CreateRoleResponse.ProtoReflect.Descriptor instead. -func (*CreateRoleResponse) Descriptor() ([]byte, []int) { - return file_accesscontrol_v1beta1_accesscontrol_proto_rawDescGZIP(), []int{1} -} - -func (x *CreateRoleResponse) GetRoleId() uint32 { - if x != nil { - return x.RoleId - } - return 0 -} - -type UpdateRoleRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - RoleId uint32 `protobuf:"varint,1,opt,name=role_id,json=roleId,proto3" json:"role_id,omitempty"` - Title *string `protobuf:"bytes,2,opt,name=title,proto3,oneof" json:"title,omitempty"` - Filter *string `protobuf:"bytes,3,opt,name=filter,proto3,oneof" json:"filter,omitempty"` - Description *string `protobuf:"bytes,4,opt,name=description,proto3,oneof" json:"description,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *UpdateRoleRequest) Reset() { - *x = UpdateRoleRequest{} - mi := &file_accesscontrol_v1beta1_accesscontrol_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *UpdateRoleRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateRoleRequest) ProtoMessage() {} - -func (x *UpdateRoleRequest) ProtoReflect() protoreflect.Message { - mi := &file_accesscontrol_v1beta1_accesscontrol_proto_msgTypes[2] - 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 UpdateRoleRequest.ProtoReflect.Descriptor instead. -func (*UpdateRoleRequest) Descriptor() ([]byte, []int) { - return file_accesscontrol_v1beta1_accesscontrol_proto_rawDescGZIP(), []int{2} -} - -func (x *UpdateRoleRequest) GetRoleId() uint32 { - if x != nil { - return x.RoleId - } - return 0 -} - -func (x *UpdateRoleRequest) GetTitle() string { - if x != nil && x.Title != nil { - return *x.Title - } - return "" -} - -func (x *UpdateRoleRequest) GetFilter() string { - if x != nil && x.Filter != nil { - return *x.Filter - } - return "" -} - -func (x *UpdateRoleRequest) GetDescription() string { - if x != nil && x.Description != nil { - return *x.Description - } - return "" -} - -type UpdateRoleResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *UpdateRoleResponse) Reset() { - *x = UpdateRoleResponse{} - mi := &file_accesscontrol_v1beta1_accesscontrol_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *UpdateRoleResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateRoleResponse) ProtoMessage() {} - -func (x *UpdateRoleResponse) ProtoReflect() protoreflect.Message { - mi := &file_accesscontrol_v1beta1_accesscontrol_proto_msgTypes[3] - 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 UpdateRoleResponse.ProtoReflect.Descriptor instead. -func (*UpdateRoleResponse) Descriptor() ([]byte, []int) { - return file_accesscontrol_v1beta1_accesscontrol_proto_rawDescGZIP(), []int{3} -} - -type DeleteRoleRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - RoleId uint32 `protobuf:"varint,1,opt,name=role_id,json=roleId,proto3" json:"role_id,omitempty"` - // Role ID to be used as a replacement for the role. Additional logic applies. - ReplacementRoleId uint32 `protobuf:"varint,2,opt,name=replacement_role_id,json=replacementRoleId,proto3" json:"replacement_role_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DeleteRoleRequest) Reset() { - *x = DeleteRoleRequest{} - mi := &file_accesscontrol_v1beta1_accesscontrol_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DeleteRoleRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteRoleRequest) ProtoMessage() {} - -func (x *DeleteRoleRequest) ProtoReflect() protoreflect.Message { - mi := &file_accesscontrol_v1beta1_accesscontrol_proto_msgTypes[4] - 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 DeleteRoleRequest.ProtoReflect.Descriptor instead. -func (*DeleteRoleRequest) Descriptor() ([]byte, []int) { - return file_accesscontrol_v1beta1_accesscontrol_proto_rawDescGZIP(), []int{4} -} - -func (x *DeleteRoleRequest) GetRoleId() uint32 { - if x != nil { - return x.RoleId - } - return 0 -} - -func (x *DeleteRoleRequest) GetReplacementRoleId() uint32 { - if x != nil { - return x.ReplacementRoleId - } - return 0 -} - -type DeleteRoleResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DeleteRoleResponse) Reset() { - *x = DeleteRoleResponse{} - mi := &file_accesscontrol_v1beta1_accesscontrol_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DeleteRoleResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteRoleResponse) ProtoMessage() {} - -func (x *DeleteRoleResponse) ProtoReflect() protoreflect.Message { - mi := &file_accesscontrol_v1beta1_accesscontrol_proto_msgTypes[5] - 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 DeleteRoleResponse.ProtoReflect.Descriptor instead. -func (*DeleteRoleResponse) Descriptor() ([]byte, []int) { - return file_accesscontrol_v1beta1_accesscontrol_proto_rawDescGZIP(), []int{5} -} - -type GetRoleRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - RoleId uint32 `protobuf:"varint,1,opt,name=role_id,json=roleId,proto3" json:"role_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetRoleRequest) Reset() { - *x = GetRoleRequest{} - mi := &file_accesscontrol_v1beta1_accesscontrol_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetRoleRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetRoleRequest) ProtoMessage() {} - -func (x *GetRoleRequest) ProtoReflect() protoreflect.Message { - mi := &file_accesscontrol_v1beta1_accesscontrol_proto_msgTypes[6] - 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 GetRoleRequest.ProtoReflect.Descriptor instead. -func (*GetRoleRequest) Descriptor() ([]byte, []int) { - return file_accesscontrol_v1beta1_accesscontrol_proto_rawDescGZIP(), []int{6} -} - -func (x *GetRoleRequest) GetRoleId() uint32 { - if x != nil { - return x.RoleId - } - return 0 -} - -type GetRoleResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - RoleId uint32 `protobuf:"varint,1,opt,name=role_id,json=roleId,proto3" json:"role_id,omitempty"` - Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` - Filter string `protobuf:"bytes,3,opt,name=filter,proto3" json:"filter,omitempty"` - Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetRoleResponse) Reset() { - *x = GetRoleResponse{} - mi := &file_accesscontrol_v1beta1_accesscontrol_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetRoleResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetRoleResponse) ProtoMessage() {} - -func (x *GetRoleResponse) ProtoReflect() protoreflect.Message { - mi := &file_accesscontrol_v1beta1_accesscontrol_proto_msgTypes[7] - 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 GetRoleResponse.ProtoReflect.Descriptor instead. -func (*GetRoleResponse) Descriptor() ([]byte, []int) { - return file_accesscontrol_v1beta1_accesscontrol_proto_rawDescGZIP(), []int{7} -} - -func (x *GetRoleResponse) GetRoleId() uint32 { - if x != nil { - return x.RoleId - } - return 0 -} - -func (x *GetRoleResponse) GetTitle() string { - if x != nil { - return x.Title - } - return "" -} - -func (x *GetRoleResponse) GetFilter() string { - if x != nil { - return x.Filter - } - return "" -} - -func (x *GetRoleResponse) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -type SetDefaultRoleRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - RoleId uint32 `protobuf:"varint,1,opt,name=role_id,json=roleId,proto3" json:"role_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SetDefaultRoleRequest) Reset() { - *x = SetDefaultRoleRequest{} - mi := &file_accesscontrol_v1beta1_accesscontrol_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SetDefaultRoleRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SetDefaultRoleRequest) ProtoMessage() {} - -func (x *SetDefaultRoleRequest) ProtoReflect() protoreflect.Message { - mi := &file_accesscontrol_v1beta1_accesscontrol_proto_msgTypes[8] - 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 SetDefaultRoleRequest.ProtoReflect.Descriptor instead. -func (*SetDefaultRoleRequest) Descriptor() ([]byte, []int) { - return file_accesscontrol_v1beta1_accesscontrol_proto_rawDescGZIP(), []int{8} -} - -func (x *SetDefaultRoleRequest) GetRoleId() uint32 { - if x != nil { - return x.RoleId - } - return 0 -} - -type SetDefaultRoleResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SetDefaultRoleResponse) Reset() { - *x = SetDefaultRoleResponse{} - mi := &file_accesscontrol_v1beta1_accesscontrol_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SetDefaultRoleResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SetDefaultRoleResponse) ProtoMessage() {} - -func (x *SetDefaultRoleResponse) ProtoReflect() protoreflect.Message { - mi := &file_accesscontrol_v1beta1_accesscontrol_proto_msgTypes[9] - 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 SetDefaultRoleResponse.ProtoReflect.Descriptor instead. -func (*SetDefaultRoleResponse) Descriptor() ([]byte, []int) { - return file_accesscontrol_v1beta1_accesscontrol_proto_rawDescGZIP(), []int{9} -} - -type AssignRolesRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - RoleIds []uint32 `protobuf:"varint,1,rep,packed,name=role_ids,json=roleIds,proto3" json:"role_ids,omitempty"` - UserId uint32 `protobuf:"varint,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AssignRolesRequest) Reset() { - *x = AssignRolesRequest{} - mi := &file_accesscontrol_v1beta1_accesscontrol_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AssignRolesRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AssignRolesRequest) ProtoMessage() {} - -func (x *AssignRolesRequest) ProtoReflect() protoreflect.Message { - mi := &file_accesscontrol_v1beta1_accesscontrol_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 AssignRolesRequest.ProtoReflect.Descriptor instead. -func (*AssignRolesRequest) Descriptor() ([]byte, []int) { - return file_accesscontrol_v1beta1_accesscontrol_proto_rawDescGZIP(), []int{10} -} - -func (x *AssignRolesRequest) GetRoleIds() []uint32 { - if x != nil { - return x.RoleIds - } - return nil -} - -func (x *AssignRolesRequest) GetUserId() uint32 { - if x != nil { - return x.UserId - } - return 0 -} - -type AssignRolesResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AssignRolesResponse) Reset() { - *x = AssignRolesResponse{} - mi := &file_accesscontrol_v1beta1_accesscontrol_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AssignRolesResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AssignRolesResponse) ProtoMessage() {} - -func (x *AssignRolesResponse) ProtoReflect() protoreflect.Message { - mi := &file_accesscontrol_v1beta1_accesscontrol_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 AssignRolesResponse.ProtoReflect.Descriptor instead. -func (*AssignRolesResponse) Descriptor() ([]byte, []int) { - return file_accesscontrol_v1beta1_accesscontrol_proto_rawDescGZIP(), []int{11} -} - -type ListRolesRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ListRolesRequest) Reset() { - *x = ListRolesRequest{} - mi := &file_accesscontrol_v1beta1_accesscontrol_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ListRolesRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListRolesRequest) ProtoMessage() {} - -func (x *ListRolesRequest) ProtoReflect() protoreflect.Message { - mi := &file_accesscontrol_v1beta1_accesscontrol_proto_msgTypes[12] - 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 ListRolesRequest.ProtoReflect.Descriptor instead. -func (*ListRolesRequest) Descriptor() ([]byte, []int) { - return file_accesscontrol_v1beta1_accesscontrol_proto_rawDescGZIP(), []int{12} -} - -type ListRolesResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Roles []*ListRolesResponse_RoleData `protobuf:"bytes,1,rep,name=roles,proto3" json:"roles,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ListRolesResponse) Reset() { - *x = ListRolesResponse{} - mi := &file_accesscontrol_v1beta1_accesscontrol_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ListRolesResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListRolesResponse) ProtoMessage() {} - -func (x *ListRolesResponse) ProtoReflect() protoreflect.Message { - mi := &file_accesscontrol_v1beta1_accesscontrol_proto_msgTypes[13] - 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 ListRolesResponse.ProtoReflect.Descriptor instead. -func (*ListRolesResponse) Descriptor() ([]byte, []int) { - return file_accesscontrol_v1beta1_accesscontrol_proto_rawDescGZIP(), []int{13} -} - -func (x *ListRolesResponse) GetRoles() []*ListRolesResponse_RoleData { - if x != nil { - return x.Roles - } - return nil -} - -type ListRolesResponse_RoleData struct { - state protoimpl.MessageState `protogen:"open.v1"` - RoleId uint32 `protobuf:"varint,1,opt,name=role_id,json=roleId,proto3" json:"role_id,omitempty"` - Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` - Filter string `protobuf:"bytes,3,opt,name=filter,proto3" json:"filter,omitempty"` - Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ListRolesResponse_RoleData) Reset() { - *x = ListRolesResponse_RoleData{} - mi := &file_accesscontrol_v1beta1_accesscontrol_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ListRolesResponse_RoleData) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListRolesResponse_RoleData) ProtoMessage() {} - -func (x *ListRolesResponse_RoleData) ProtoReflect() protoreflect.Message { - mi := &file_accesscontrol_v1beta1_accesscontrol_proto_msgTypes[14] - 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 ListRolesResponse_RoleData.ProtoReflect.Descriptor instead. -func (*ListRolesResponse_RoleData) Descriptor() ([]byte, []int) { - return file_accesscontrol_v1beta1_accesscontrol_proto_rawDescGZIP(), []int{13, 0} -} - -func (x *ListRolesResponse_RoleData) GetRoleId() uint32 { - if x != nil { - return x.RoleId - } - return 0 -} - -func (x *ListRolesResponse_RoleData) GetTitle() string { - if x != nil { - return x.Title - } - return "" -} - -func (x *ListRolesResponse_RoleData) GetFilter() string { - if x != nil { - return x.Filter - } - return "" -} - -func (x *ListRolesResponse_RoleData) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -var File_accesscontrol_v1beta1_accesscontrol_proto protoreflect.FileDescriptor - -const file_accesscontrol_v1beta1_accesscontrol_proto_rawDesc = "" + - "\n" + - ")accesscontrol/v1beta1/accesscontrol.proto\x12\x15accesscontrol.v1beta1\x1a\x1cgoogle/api/annotations.proto\x1a.protoc-gen-openapiv2/options/annotations.proto\x1a\x17validate/validate.proto\"l\n" + - "\x11CreateRoleRequest\x12\x1d\n" + - "\x05title\x18\x01 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\x05title\x12\x16\n" + - "\x06filter\x18\x02 \x01(\tR\x06filter\x12 \n" + - "\vdescription\x18\x03 \x01(\tR\vdescription\"-\n" + - "\x12CreateRoleResponse\x12\x17\n" + - "\arole_id\x18\x01 \x01(\rR\x06roleId\"\xc2\x01\n" + - "\x11UpdateRoleRequest\x12 \n" + - "\arole_id\x18\x01 \x01(\rB\a\xfaB\x04*\x02 \x00R\x06roleId\x12\"\n" + - "\x05title\x18\x02 \x01(\tB\a\xfaB\x04r\x02\x10\x01H\x00R\x05title\x88\x01\x01\x12\x1b\n" + - "\x06filter\x18\x03 \x01(\tH\x01R\x06filter\x88\x01\x01\x12%\n" + - "\vdescription\x18\x04 \x01(\tH\x02R\vdescription\x88\x01\x01B\b\n" + - "\x06_titleB\t\n" + - "\a_filterB\x0e\n" + - "\f_description\"\x14\n" + - "\x12UpdateRoleResponse\"e\n" + - "\x11DeleteRoleRequest\x12 \n" + - "\arole_id\x18\x01 \x01(\rB\a\xfaB\x04*\x02 \x00R\x06roleId\x12.\n" + - "\x13replacement_role_id\x18\x02 \x01(\rR\x11replacementRoleId\"\x14\n" + - "\x12DeleteRoleResponse\"2\n" + - "\x0eGetRoleRequest\x12 \n" + - "\arole_id\x18\x01 \x01(\rB\a\xfaB\x04*\x02 \x00R\x06roleId\"z\n" + - "\x0fGetRoleResponse\x12\x17\n" + - "\arole_id\x18\x01 \x01(\rR\x06roleId\x12\x14\n" + - "\x05title\x18\x02 \x01(\tR\x05title\x12\x16\n" + - "\x06filter\x18\x03 \x01(\tR\x06filter\x12 \n" + - "\vdescription\x18\x04 \x01(\tR\vdescription\"9\n" + - "\x15SetDefaultRoleRequest\x12 \n" + - "\arole_id\x18\x01 \x01(\rB\a\xfaB\x04*\x02 \x00R\x06roleId\"\x18\n" + - "\x16SetDefaultRoleResponse\"Q\n" + - "\x12AssignRolesRequest\x12\x19\n" + - "\brole_ids\x18\x01 \x03(\rR\aroleIds\x12 \n" + - "\auser_id\x18\x02 \x01(\rB\a\xfaB\x04*\x02 \x00R\x06userId\"\x15\n" + - "\x13AssignRolesResponse\"\x12\n" + - "\x10ListRolesRequest\"\xd1\x01\n" + - "\x11ListRolesResponse\x12G\n" + - "\x05roles\x18\x01 \x03(\v21.accesscontrol.v1beta1.ListRolesResponse.RoleDataR\x05roles\x1as\n" + - "\bRoleData\x12\x17\n" + - "\arole_id\x18\x01 \x01(\rR\x06roleId\x12\x14\n" + - "\x05title\x18\x02 \x01(\tR\x05title\x12\x16\n" + - "\x06filter\x18\x03 \x01(\tR\x06filter\x12 \n" + - "\vdescription\x18\x04 \x01(\tR\vdescription2\xc1\n" + - "\n" + - "\x14AccessControlService\x12\xac\x01\n" + - "\n" + - "CreateRole\x12(.accesscontrol.v1beta1.CreateRoleRequest\x1a).accesscontrol.v1beta1.CreateRoleResponse\"I\x92A$\x12\rCreate a Role\x1a\x13Creates a new role.\x82\xd3\xe4\x93\x02\x1c:\x01*\"\x17/v1/accesscontrol/roles\x12\xbc\x01\n" + - "\n" + - "UpdateRole\x12(.accesscontrol.v1beta1.UpdateRoleRequest\x1a).accesscontrol.v1beta1.UpdateRoleResponse\"Y\x92A*\x12\rUpdate a Role\x1a\x19Updates an existing role.\x82\xd3\xe4\x93\x02&:\x01*\x1a!/v1/accesscontrol/roles/{role_id}\x12\xaf\x01\n" + - "\n" + - "DeleteRole\x12(.accesscontrol.v1beta1.DeleteRoleRequest\x1a).accesscontrol.v1beta1.DeleteRoleResponse\"L\x92A \x12\rDelete a Role\x1a\x0fDeletes a role.\x82\xd3\xe4\x93\x02#*!/v1/accesscontrol/roles/{role_id}\x12\xab\x01\n" + - "\aGetRole\x12%.accesscontrol.v1beta1.GetRoleRequest\x1a&.accesscontrol.v1beta1.GetRoleResponse\"Q\x92A%\x12\n" + - "Get a Role\x1a\x17Retrieves a role by ID.\x82\xd3\xe4\x93\x02#\x12!/v1/accesscontrol/roles/{role_id}\x12\xa0\x01\n" + - "\tListRoles\x12'.accesscontrol.v1beta1.ListRolesRequest\x1a(.accesscontrol.v1beta1.ListRolesResponse\"@\x92A\x1e\x12\n" + - "List Roles\x1a\x10Lists all roles.\x82\xd3\xe4\x93\x02\x19\x12\x17/v1/accesscontrol/roles\x12\xd3\x01\n" + - "\vAssignRoles\x12).accesscontrol.v1beta1.AssignRolesRequest\x1a*.accesscontrol.v1beta1.AssignRolesResponse\"m\x92AA\x12\x16Assign Roles to a User\x1a'Replaces all existing roles for a user.\x82\xd3\xe4\x93\x02#:\x01*\"\x1e/v1/accesscontrol/roles:assign\x12\xe1\x01\n" + - "\x0eSetDefaultRole\x12,.accesscontrol.v1beta1.SetDefaultRoleRequest\x1a-.accesscontrol.v1beta1.SetDefaultRoleResponse\"r\x92AB\x12\x12Set a Default Role\x1a,Configures a default role assigned to users.\x82\xd3\xe4\x93\x02':\x01*\"\"/v1/accesscontrol/roles:setDefaultB\xeb\x01\n" + - "\x19com.accesscontrol.v1beta1B\x12AccesscontrolProtoP\x01ZEgithub.com/percona/pmm/api/accesscontrol/v1beta1;accesscontrolv1beta1\xa2\x02\x03AXX\xaa\x02\x15Accesscontrol.V1beta1\xca\x02\x15Accesscontrol\\V1beta1\xe2\x02!Accesscontrol\\V1beta1\\GPBMetadata\xea\x02\x16Accesscontrol::V1beta1b\x06proto3" - -var ( - file_accesscontrol_v1beta1_accesscontrol_proto_rawDescOnce sync.Once - file_accesscontrol_v1beta1_accesscontrol_proto_rawDescData []byte -) - -func file_accesscontrol_v1beta1_accesscontrol_proto_rawDescGZIP() []byte { - file_accesscontrol_v1beta1_accesscontrol_proto_rawDescOnce.Do(func() { - file_accesscontrol_v1beta1_accesscontrol_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_accesscontrol_v1beta1_accesscontrol_proto_rawDesc), len(file_accesscontrol_v1beta1_accesscontrol_proto_rawDesc))) - }) - 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_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 - 2, // 2: accesscontrol.v1beta1.AccessControlService.UpdateRole:input_type -> accesscontrol.v1beta1.UpdateRoleRequest - 4, // 3: accesscontrol.v1beta1.AccessControlService.DeleteRole:input_type -> accesscontrol.v1beta1.DeleteRoleRequest - 6, // 4: accesscontrol.v1beta1.AccessControlService.GetRole:input_type -> accesscontrol.v1beta1.GetRoleRequest - 12, // 5: accesscontrol.v1beta1.AccessControlService.ListRoles:input_type -> accesscontrol.v1beta1.ListRolesRequest - 10, // 6: accesscontrol.v1beta1.AccessControlService.AssignRoles:input_type -> accesscontrol.v1beta1.AssignRolesRequest - 8, // 7: accesscontrol.v1beta1.AccessControlService.SetDefaultRole:input_type -> accesscontrol.v1beta1.SetDefaultRoleRequest - 1, // 8: accesscontrol.v1beta1.AccessControlService.CreateRole:output_type -> accesscontrol.v1beta1.CreateRoleResponse - 3, // 9: accesscontrol.v1beta1.AccessControlService.UpdateRole:output_type -> accesscontrol.v1beta1.UpdateRoleResponse - 5, // 10: accesscontrol.v1beta1.AccessControlService.DeleteRole:output_type -> accesscontrol.v1beta1.DeleteRoleResponse - 7, // 11: accesscontrol.v1beta1.AccessControlService.GetRole:output_type -> accesscontrol.v1beta1.GetRoleResponse - 13, // 12: accesscontrol.v1beta1.AccessControlService.ListRoles:output_type -> accesscontrol.v1beta1.ListRolesResponse - 11, // 13: accesscontrol.v1beta1.AccessControlService.AssignRoles:output_type -> accesscontrol.v1beta1.AssignRolesResponse - 9, // 14: accesscontrol.v1beta1.AccessControlService.SetDefaultRole:output_type -> accesscontrol.v1beta1.SetDefaultRoleResponse - 8, // [8:15] is the sub-list for method output_type - 1, // [1:8] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name -} - -func init() { file_accesscontrol_v1beta1_accesscontrol_proto_init() } -func file_accesscontrol_v1beta1_accesscontrol_proto_init() { - if File_accesscontrol_v1beta1_accesscontrol_proto != nil { - return - } - file_accesscontrol_v1beta1_accesscontrol_proto_msgTypes[2].OneofWrappers = []any{} - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_accesscontrol_v1beta1_accesscontrol_proto_rawDesc), len(file_accesscontrol_v1beta1_accesscontrol_proto_rawDesc)), - NumEnums: 0, - NumMessages: 15, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_accesscontrol_v1beta1_accesscontrol_proto_goTypes, - DependencyIndexes: file_accesscontrol_v1beta1_accesscontrol_proto_depIdxs, - MessageInfos: file_accesscontrol_v1beta1_accesscontrol_proto_msgTypes, - }.Build() - File_accesscontrol_v1beta1_accesscontrol_proto = out.File - file_accesscontrol_v1beta1_accesscontrol_proto_goTypes = nil - file_accesscontrol_v1beta1_accesscontrol_proto_depIdxs = nil -} diff --git a/api/accesscontrol/v1beta1/accesscontrol.pb.gw.go b/api/accesscontrol/v1beta1/accesscontrol.pb.gw.go deleted file mode 100644 index f34e073c55d..00000000000 --- a/api/accesscontrol/v1beta1/accesscontrol.pb.gw.go +++ /dev/null @@ -1,603 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: accesscontrol/v1beta1/accesscontrol.proto - -/* -Package accesscontrolv1beta1 is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package accesscontrolv1beta1 - -import ( - "context" - "errors" - "io" - "net/http" - - "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" - "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" - "google.golang.org/protobuf/proto" -) - -// Suppress "imported and not used" errors -var ( - _ codes.Code - _ io.Reader - _ status.Status - _ = errors.New - _ = runtime.String - _ = utilities.NewDoubleArray - _ = metadata.Join -) - -func request_AccessControlService_CreateRole_0(ctx context.Context, marshaler runtime.Marshaler, client AccessControlServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq CreateRoleRequest - 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.CreateRole(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_AccessControlService_CreateRole_0(ctx context.Context, marshaler runtime.Marshaler, server AccessControlServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq CreateRoleRequest - 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.CreateRole(ctx, &protoReq) - return msg, metadata, err -} - -func request_AccessControlService_UpdateRole_0(ctx context.Context, marshaler runtime.Marshaler, client AccessControlServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq UpdateRoleRequest - metadata runtime.ServerMetadata - err error - ) - 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) - } - val, ok := pathParams["role_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "role_id") - } - protoReq.RoleId, err = runtime.Uint32(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "role_id", err) - } - msg, err := client.UpdateRole(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_AccessControlService_UpdateRole_0(ctx context.Context, marshaler runtime.Marshaler, server AccessControlServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq UpdateRoleRequest - metadata runtime.ServerMetadata - err error - ) - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - val, ok := pathParams["role_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "role_id") - } - protoReq.RoleId, err = runtime.Uint32(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "role_id", err) - } - msg, err := server.UpdateRole(ctx, &protoReq) - return msg, metadata, err -} - -var filter_AccessControlService_DeleteRole_0 = &utilities.DoubleArray{Encoding: map[string]int{"role_id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} - -func request_AccessControlService_DeleteRole_0(ctx context.Context, marshaler runtime.Marshaler, client AccessControlServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq DeleteRoleRequest - metadata runtime.ServerMetadata - err error - ) - if req.Body != nil { - _, _ = io.Copy(io.Discard, req.Body) - } - val, ok := pathParams["role_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "role_id") - } - protoReq.RoleId, err = runtime.Uint32(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "role_id", err) - } - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_AccessControlService_DeleteRole_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - msg, err := client.DeleteRole(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_AccessControlService_DeleteRole_0(ctx context.Context, marshaler runtime.Marshaler, server AccessControlServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq DeleteRoleRequest - metadata runtime.ServerMetadata - err error - ) - val, ok := pathParams["role_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "role_id") - } - protoReq.RoleId, err = runtime.Uint32(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "role_id", err) - } - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_AccessControlService_DeleteRole_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - msg, err := server.DeleteRole(ctx, &protoReq) - return msg, metadata, err -} - -func request_AccessControlService_GetRole_0(ctx context.Context, marshaler runtime.Marshaler, client AccessControlServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq GetRoleRequest - metadata runtime.ServerMetadata - err error - ) - if req.Body != nil { - _, _ = io.Copy(io.Discard, req.Body) - } - val, ok := pathParams["role_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "role_id") - } - protoReq.RoleId, err = runtime.Uint32(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "role_id", err) - } - msg, err := client.GetRole(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_AccessControlService_GetRole_0(ctx context.Context, marshaler runtime.Marshaler, server AccessControlServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq GetRoleRequest - metadata runtime.ServerMetadata - err error - ) - val, ok := pathParams["role_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "role_id") - } - protoReq.RoleId, err = runtime.Uint32(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "role_id", err) - } - msg, err := server.GetRole(ctx, &protoReq) - return msg, metadata, err -} - -func request_AccessControlService_ListRoles_0(ctx context.Context, marshaler runtime.Marshaler, client AccessControlServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq ListRolesRequest - metadata runtime.ServerMetadata - ) - if req.Body != nil { - _, _ = io.Copy(io.Discard, req.Body) - } - msg, err := client.ListRoles(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_AccessControlService_ListRoles_0(ctx context.Context, marshaler runtime.Marshaler, server AccessControlServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq ListRolesRequest - metadata runtime.ServerMetadata - ) - msg, err := server.ListRoles(ctx, &protoReq) - return msg, metadata, err -} - -func request_AccessControlService_AssignRoles_0(ctx context.Context, marshaler runtime.Marshaler, client AccessControlServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq AssignRolesRequest - 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.AssignRoles(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_AccessControlService_AssignRoles_0(ctx context.Context, marshaler runtime.Marshaler, server AccessControlServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq AssignRolesRequest - 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.AssignRoles(ctx, &protoReq) - return msg, metadata, err -} - -func request_AccessControlService_SetDefaultRole_0(ctx context.Context, marshaler runtime.Marshaler, client AccessControlServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq SetDefaultRoleRequest - 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.SetDefaultRole(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_AccessControlService_SetDefaultRole_0(ctx context.Context, marshaler runtime.Marshaler, server AccessControlServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq SetDefaultRoleRequest - 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.SetDefaultRole(ctx, &protoReq) - return msg, metadata, err -} - -// RegisterAccessControlServiceHandlerServer registers the http handlers for service AccessControlService to "mux". -// UnaryRPC :call AccessControlServiceServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterAccessControlServiceHandlerFromEndpoint instead. -// GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call. -func RegisterAccessControlServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AccessControlServiceServer) error { - mux.Handle(http.MethodPost, pattern_AccessControlService_CreateRole_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, "/accesscontrol.v1beta1.AccessControlService/CreateRole", runtime.WithHTTPPathPattern("/v1/accesscontrol/roles")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AccessControlService_CreateRole_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_AccessControlService_CreateRole_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPut, pattern_AccessControlService_UpdateRole_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, "/accesscontrol.v1beta1.AccessControlService/UpdateRole", runtime.WithHTTPPathPattern("/v1/accesscontrol/roles/{role_id}")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AccessControlService_UpdateRole_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_AccessControlService_UpdateRole_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodDelete, pattern_AccessControlService_DeleteRole_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, "/accesscontrol.v1beta1.AccessControlService/DeleteRole", runtime.WithHTTPPathPattern("/v1/accesscontrol/roles/{role_id}")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AccessControlService_DeleteRole_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_AccessControlService_DeleteRole_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodGet, pattern_AccessControlService_GetRole_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, "/accesscontrol.v1beta1.AccessControlService/GetRole", runtime.WithHTTPPathPattern("/v1/accesscontrol/roles/{role_id}")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AccessControlService_GetRole_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_AccessControlService_GetRole_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodGet, pattern_AccessControlService_ListRoles_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, "/accesscontrol.v1beta1.AccessControlService/ListRoles", runtime.WithHTTPPathPattern("/v1/accesscontrol/roles")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AccessControlService_ListRoles_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_AccessControlService_ListRoles_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPost, pattern_AccessControlService_AssignRoles_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, "/accesscontrol.v1beta1.AccessControlService/AssignRoles", runtime.WithHTTPPathPattern("/v1/accesscontrol/roles:assign")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AccessControlService_AssignRoles_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_AccessControlService_AssignRoles_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPost, pattern_AccessControlService_SetDefaultRole_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, "/accesscontrol.v1beta1.AccessControlService/SetDefaultRole", runtime.WithHTTPPathPattern("/v1/accesscontrol/roles:setDefault")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AccessControlService_SetDefaultRole_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_AccessControlService_SetDefaultRole_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - return nil -} - -// RegisterAccessControlServiceHandlerFromEndpoint is same as RegisterAccessControlServiceHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterAccessControlServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.NewClient(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - return RegisterAccessControlServiceHandler(ctx, mux, conn) -} - -// RegisterAccessControlServiceHandler registers the http handlers for service AccessControlService to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterAccessControlServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterAccessControlServiceHandlerClient(ctx, mux, NewAccessControlServiceClient(conn)) -} - -// RegisterAccessControlServiceHandlerClient registers the http handlers for service AccessControlService -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "AccessControlServiceClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "AccessControlServiceClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "AccessControlServiceClient" to call the correct interceptors. This client ignores the HTTP middlewares. -func RegisterAccessControlServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AccessControlServiceClient) error { - mux.Handle(http.MethodPost, pattern_AccessControlService_CreateRole_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, "/accesscontrol.v1beta1.AccessControlService/CreateRole", runtime.WithHTTPPathPattern("/v1/accesscontrol/roles")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AccessControlService_CreateRole_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_AccessControlService_CreateRole_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPut, pattern_AccessControlService_UpdateRole_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, "/accesscontrol.v1beta1.AccessControlService/UpdateRole", runtime.WithHTTPPathPattern("/v1/accesscontrol/roles/{role_id}")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AccessControlService_UpdateRole_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_AccessControlService_UpdateRole_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodDelete, pattern_AccessControlService_DeleteRole_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, "/accesscontrol.v1beta1.AccessControlService/DeleteRole", runtime.WithHTTPPathPattern("/v1/accesscontrol/roles/{role_id}")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AccessControlService_DeleteRole_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_AccessControlService_DeleteRole_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodGet, pattern_AccessControlService_GetRole_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, "/accesscontrol.v1beta1.AccessControlService/GetRole", runtime.WithHTTPPathPattern("/v1/accesscontrol/roles/{role_id}")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AccessControlService_GetRole_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_AccessControlService_GetRole_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodGet, pattern_AccessControlService_ListRoles_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, "/accesscontrol.v1beta1.AccessControlService/ListRoles", runtime.WithHTTPPathPattern("/v1/accesscontrol/roles")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AccessControlService_ListRoles_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_AccessControlService_ListRoles_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPost, pattern_AccessControlService_AssignRoles_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, "/accesscontrol.v1beta1.AccessControlService/AssignRoles", runtime.WithHTTPPathPattern("/v1/accesscontrol/roles:assign")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AccessControlService_AssignRoles_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_AccessControlService_AssignRoles_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPost, pattern_AccessControlService_SetDefaultRole_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, "/accesscontrol.v1beta1.AccessControlService/SetDefaultRole", runtime.WithHTTPPathPattern("/v1/accesscontrol/roles:setDefault")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AccessControlService_SetDefaultRole_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_AccessControlService_SetDefaultRole_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - return nil -} - -var ( - pattern_AccessControlService_CreateRole_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "accesscontrol", "roles"}, "")) - pattern_AccessControlService_UpdateRole_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "accesscontrol", "roles", "role_id"}, "")) - pattern_AccessControlService_DeleteRole_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "accesscontrol", "roles", "role_id"}, "")) - pattern_AccessControlService_GetRole_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "accesscontrol", "roles", "role_id"}, "")) - pattern_AccessControlService_ListRoles_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "accesscontrol", "roles"}, "")) - pattern_AccessControlService_AssignRoles_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "accesscontrol", "roles"}, "assign")) - pattern_AccessControlService_SetDefaultRole_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "accesscontrol", "roles"}, "setDefault")) -) - -var ( - forward_AccessControlService_CreateRole_0 = runtime.ForwardResponseMessage - forward_AccessControlService_UpdateRole_0 = runtime.ForwardResponseMessage - forward_AccessControlService_DeleteRole_0 = runtime.ForwardResponseMessage - forward_AccessControlService_GetRole_0 = runtime.ForwardResponseMessage - forward_AccessControlService_ListRoles_0 = runtime.ForwardResponseMessage - forward_AccessControlService_AssignRoles_0 = runtime.ForwardResponseMessage - forward_AccessControlService_SetDefaultRole_0 = runtime.ForwardResponseMessage -) diff --git a/api/accesscontrol/v1beta1/accesscontrol.pb.validate.go b/api/accesscontrol/v1beta1/accesscontrol.pb.validate.go deleted file mode 100644 index a055badfff2..00000000000 --- a/api/accesscontrol/v1beta1/accesscontrol.pb.validate.go +++ /dev/null @@ -1,1705 +0,0 @@ -// Code generated by protoc-gen-validate. DO NOT EDIT. -// source: accesscontrol/v1beta1/accesscontrol.proto - -package accesscontrolv1beta1 - -import ( - "bytes" - "errors" - "fmt" - "net" - "net/mail" - "net/url" - "regexp" - "sort" - "strings" - "time" - "unicode/utf8" - - "google.golang.org/protobuf/types/known/anypb" -) - -// ensure the imports are used -var ( - _ = bytes.MinRead - _ = errors.New("") - _ = fmt.Print - _ = utf8.UTFMax - _ = (*regexp.Regexp)(nil) - _ = (*strings.Reader)(nil) - _ = net.IPv4len - _ = time.Duration(0) - _ = (*url.URL)(nil) - _ = (*mail.Address)(nil) - _ = anypb.Any{} - _ = sort.Sort -) - -// Validate checks the field values on CreateRoleRequest 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 *CreateRoleRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on CreateRoleRequest 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 -// CreateRoleRequestMultiError, or nil if none found. -func (m *CreateRoleRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *CreateRoleRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetTitle()) < 1 { - err := CreateRoleRequestValidationError{ - field: "Title", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for Filter - - // no validation rules for Description - - if len(errors) > 0 { - return CreateRoleRequestMultiError(errors) - } - - return nil -} - -// CreateRoleRequestMultiError is an error wrapping multiple validation errors -// returned by CreateRoleRequest.ValidateAll() if the designated constraints -// aren't met. -type CreateRoleRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m CreateRoleRequestMultiError) 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 CreateRoleRequestMultiError) AllErrors() []error { return m } - -// CreateRoleRequestValidationError is the validation error returned by -// CreateRoleRequest.Validate if the designated constraints aren't met. -type CreateRoleRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e CreateRoleRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e CreateRoleRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e CreateRoleRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e CreateRoleRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e CreateRoleRequestValidationError) ErrorName() string { - return "CreateRoleRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e CreateRoleRequestValidationError) 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 %sCreateRoleRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = CreateRoleRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = CreateRoleRequestValidationError{} - -// Validate checks the field values on CreateRoleResponse 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 *CreateRoleResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on CreateRoleResponse 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 -// CreateRoleResponseMultiError, or nil if none found. -func (m *CreateRoleResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *CreateRoleResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for RoleId - - if len(errors) > 0 { - return CreateRoleResponseMultiError(errors) - } - - return nil -} - -// CreateRoleResponseMultiError is an error wrapping multiple validation errors -// returned by CreateRoleResponse.ValidateAll() if the designated constraints -// aren't met. -type CreateRoleResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m CreateRoleResponseMultiError) 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 CreateRoleResponseMultiError) AllErrors() []error { return m } - -// CreateRoleResponseValidationError is the validation error returned by -// CreateRoleResponse.Validate if the designated constraints aren't met. -type CreateRoleResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e CreateRoleResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e CreateRoleResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e CreateRoleResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e CreateRoleResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e CreateRoleResponseValidationError) ErrorName() string { - return "CreateRoleResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e CreateRoleResponseValidationError) 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 %sCreateRoleResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = CreateRoleResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = CreateRoleResponseValidationError{} - -// Validate checks the field values on UpdateRoleRequest 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 *UpdateRoleRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on UpdateRoleRequest 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 -// UpdateRoleRequestMultiError, or nil if none found. -func (m *UpdateRoleRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *UpdateRoleRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if m.GetRoleId() <= 0 { - err := UpdateRoleRequestValidationError{ - field: "RoleId", - reason: "value must be greater than 0", - } - if !all { - return err - } - errors = append(errors, err) - } - - if m.Title != nil { - if utf8.RuneCountInString(m.GetTitle()) < 1 { - err := UpdateRoleRequestValidationError{ - field: "Title", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - } - - if m.Filter != nil { - // no validation rules for Filter - } - - if m.Description != nil { - // no validation rules for Description - } - - if len(errors) > 0 { - return UpdateRoleRequestMultiError(errors) - } - - return nil -} - -// UpdateRoleRequestMultiError is an error wrapping multiple validation errors -// returned by UpdateRoleRequest.ValidateAll() if the designated constraints -// aren't met. -type UpdateRoleRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m UpdateRoleRequestMultiError) 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 UpdateRoleRequestMultiError) AllErrors() []error { return m } - -// UpdateRoleRequestValidationError is the validation error returned by -// UpdateRoleRequest.Validate if the designated constraints aren't met. -type UpdateRoleRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e UpdateRoleRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e UpdateRoleRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e UpdateRoleRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e UpdateRoleRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e UpdateRoleRequestValidationError) ErrorName() string { - return "UpdateRoleRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e UpdateRoleRequestValidationError) 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 %sUpdateRoleRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = UpdateRoleRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = UpdateRoleRequestValidationError{} - -// Validate checks the field values on UpdateRoleResponse 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 *UpdateRoleResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on UpdateRoleResponse 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 -// UpdateRoleResponseMultiError, or nil if none found. -func (m *UpdateRoleResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *UpdateRoleResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return UpdateRoleResponseMultiError(errors) - } - - return nil -} - -// UpdateRoleResponseMultiError is an error wrapping multiple validation errors -// returned by UpdateRoleResponse.ValidateAll() if the designated constraints -// aren't met. -type UpdateRoleResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m UpdateRoleResponseMultiError) 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 UpdateRoleResponseMultiError) AllErrors() []error { return m } - -// UpdateRoleResponseValidationError is the validation error returned by -// UpdateRoleResponse.Validate if the designated constraints aren't met. -type UpdateRoleResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e UpdateRoleResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e UpdateRoleResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e UpdateRoleResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e UpdateRoleResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e UpdateRoleResponseValidationError) ErrorName() string { - return "UpdateRoleResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e UpdateRoleResponseValidationError) 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 %sUpdateRoleResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = UpdateRoleResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = UpdateRoleResponseValidationError{} - -// Validate checks the field values on DeleteRoleRequest 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 *DeleteRoleRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on DeleteRoleRequest 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 -// DeleteRoleRequestMultiError, or nil if none found. -func (m *DeleteRoleRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *DeleteRoleRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if m.GetRoleId() <= 0 { - err := DeleteRoleRequestValidationError{ - field: "RoleId", - reason: "value must be greater than 0", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for ReplacementRoleId - - if len(errors) > 0 { - return DeleteRoleRequestMultiError(errors) - } - - return nil -} - -// DeleteRoleRequestMultiError is an error wrapping multiple validation errors -// returned by DeleteRoleRequest.ValidateAll() if the designated constraints -// aren't met. -type DeleteRoleRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m DeleteRoleRequestMultiError) 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 DeleteRoleRequestMultiError) AllErrors() []error { return m } - -// DeleteRoleRequestValidationError is the validation error returned by -// DeleteRoleRequest.Validate if the designated constraints aren't met. -type DeleteRoleRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e DeleteRoleRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e DeleteRoleRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e DeleteRoleRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e DeleteRoleRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e DeleteRoleRequestValidationError) ErrorName() string { - return "DeleteRoleRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e DeleteRoleRequestValidationError) 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 %sDeleteRoleRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = DeleteRoleRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = DeleteRoleRequestValidationError{} - -// Validate checks the field values on DeleteRoleResponse 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 *DeleteRoleResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on DeleteRoleResponse 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 -// DeleteRoleResponseMultiError, or nil if none found. -func (m *DeleteRoleResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *DeleteRoleResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return DeleteRoleResponseMultiError(errors) - } - - return nil -} - -// DeleteRoleResponseMultiError is an error wrapping multiple validation errors -// returned by DeleteRoleResponse.ValidateAll() if the designated constraints -// aren't met. -type DeleteRoleResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m DeleteRoleResponseMultiError) 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 DeleteRoleResponseMultiError) AllErrors() []error { return m } - -// DeleteRoleResponseValidationError is the validation error returned by -// DeleteRoleResponse.Validate if the designated constraints aren't met. -type DeleteRoleResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e DeleteRoleResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e DeleteRoleResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e DeleteRoleResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e DeleteRoleResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e DeleteRoleResponseValidationError) ErrorName() string { - return "DeleteRoleResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e DeleteRoleResponseValidationError) 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 %sDeleteRoleResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = DeleteRoleResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = DeleteRoleResponseValidationError{} - -// Validate checks the field values on GetRoleRequest 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 *GetRoleRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on GetRoleRequest 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 GetRoleRequestMultiError, -// or nil if none found. -func (m *GetRoleRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *GetRoleRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if m.GetRoleId() <= 0 { - err := GetRoleRequestValidationError{ - field: "RoleId", - reason: "value must be greater than 0", - } - if !all { - return err - } - errors = append(errors, err) - } - - if len(errors) > 0 { - return GetRoleRequestMultiError(errors) - } - - return nil -} - -// GetRoleRequestMultiError is an error wrapping multiple validation errors -// returned by GetRoleRequest.ValidateAll() if the designated constraints -// aren't met. -type GetRoleRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m GetRoleRequestMultiError) 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 GetRoleRequestMultiError) AllErrors() []error { return m } - -// GetRoleRequestValidationError is the validation error returned by -// GetRoleRequest.Validate if the designated constraints aren't met. -type GetRoleRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e GetRoleRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e GetRoleRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e GetRoleRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e GetRoleRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e GetRoleRequestValidationError) ErrorName() string { return "GetRoleRequestValidationError" } - -// Error satisfies the builtin error interface -func (e GetRoleRequestValidationError) 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 %sGetRoleRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = GetRoleRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = GetRoleRequestValidationError{} - -// Validate checks the field values on GetRoleResponse 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 *GetRoleResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on GetRoleResponse 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 -// GetRoleResponseMultiError, or nil if none found. -func (m *GetRoleResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *GetRoleResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for RoleId - - // no validation rules for Title - - // no validation rules for Filter - - // no validation rules for Description - - if len(errors) > 0 { - return GetRoleResponseMultiError(errors) - } - - return nil -} - -// GetRoleResponseMultiError is an error wrapping multiple validation errors -// returned by GetRoleResponse.ValidateAll() if the designated constraints -// aren't met. -type GetRoleResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m GetRoleResponseMultiError) 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 GetRoleResponseMultiError) AllErrors() []error { return m } - -// GetRoleResponseValidationError is the validation error returned by -// GetRoleResponse.Validate if the designated constraints aren't met. -type GetRoleResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e GetRoleResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e GetRoleResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e GetRoleResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e GetRoleResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e GetRoleResponseValidationError) ErrorName() string { return "GetRoleResponseValidationError" } - -// Error satisfies the builtin error interface -func (e GetRoleResponseValidationError) 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 %sGetRoleResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = GetRoleResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = GetRoleResponseValidationError{} - -// Validate checks the field values on SetDefaultRoleRequest 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 *SetDefaultRoleRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on SetDefaultRoleRequest 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 -// SetDefaultRoleRequestMultiError, or nil if none found. -func (m *SetDefaultRoleRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *SetDefaultRoleRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if m.GetRoleId() <= 0 { - err := SetDefaultRoleRequestValidationError{ - field: "RoleId", - reason: "value must be greater than 0", - } - if !all { - return err - } - errors = append(errors, err) - } - - if len(errors) > 0 { - return SetDefaultRoleRequestMultiError(errors) - } - - return nil -} - -// SetDefaultRoleRequestMultiError is an error wrapping multiple validation -// errors returned by SetDefaultRoleRequest.ValidateAll() if the designated -// constraints aren't met. -type SetDefaultRoleRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m SetDefaultRoleRequestMultiError) 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 SetDefaultRoleRequestMultiError) AllErrors() []error { return m } - -// SetDefaultRoleRequestValidationError is the validation error returned by -// SetDefaultRoleRequest.Validate if the designated constraints aren't met. -type SetDefaultRoleRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e SetDefaultRoleRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e SetDefaultRoleRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e SetDefaultRoleRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e SetDefaultRoleRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e SetDefaultRoleRequestValidationError) ErrorName() string { - return "SetDefaultRoleRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e SetDefaultRoleRequestValidationError) 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 %sSetDefaultRoleRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = SetDefaultRoleRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = SetDefaultRoleRequestValidationError{} - -// Validate checks the field values on SetDefaultRoleResponse 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 *SetDefaultRoleResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on SetDefaultRoleResponse 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 -// SetDefaultRoleResponseMultiError, or nil if none found. -func (m *SetDefaultRoleResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *SetDefaultRoleResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return SetDefaultRoleResponseMultiError(errors) - } - - return nil -} - -// SetDefaultRoleResponseMultiError is an error wrapping multiple validation -// errors returned by SetDefaultRoleResponse.ValidateAll() if the designated -// constraints aren't met. -type SetDefaultRoleResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m SetDefaultRoleResponseMultiError) 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 SetDefaultRoleResponseMultiError) AllErrors() []error { return m } - -// SetDefaultRoleResponseValidationError is the validation error returned by -// SetDefaultRoleResponse.Validate if the designated constraints aren't met. -type SetDefaultRoleResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e SetDefaultRoleResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e SetDefaultRoleResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e SetDefaultRoleResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e SetDefaultRoleResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e SetDefaultRoleResponseValidationError) ErrorName() string { - return "SetDefaultRoleResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e SetDefaultRoleResponseValidationError) 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 %sSetDefaultRoleResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = SetDefaultRoleResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = SetDefaultRoleResponseValidationError{} - -// Validate checks the field values on AssignRolesRequest 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 *AssignRolesRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on AssignRolesRequest 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 -// AssignRolesRequestMultiError, or nil if none found. -func (m *AssignRolesRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *AssignRolesRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if m.GetUserId() <= 0 { - err := AssignRolesRequestValidationError{ - field: "UserId", - reason: "value must be greater than 0", - } - if !all { - return err - } - errors = append(errors, err) - } - - if len(errors) > 0 { - return AssignRolesRequestMultiError(errors) - } - - return nil -} - -// AssignRolesRequestMultiError is an error wrapping multiple validation errors -// returned by AssignRolesRequest.ValidateAll() if the designated constraints -// aren't met. -type AssignRolesRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m AssignRolesRequestMultiError) 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 AssignRolesRequestMultiError) AllErrors() []error { return m } - -// AssignRolesRequestValidationError is the validation error returned by -// AssignRolesRequest.Validate if the designated constraints aren't met. -type AssignRolesRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e AssignRolesRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e AssignRolesRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e AssignRolesRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e AssignRolesRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e AssignRolesRequestValidationError) ErrorName() string { - return "AssignRolesRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e AssignRolesRequestValidationError) 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 %sAssignRolesRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = AssignRolesRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = AssignRolesRequestValidationError{} - -// Validate checks the field values on AssignRolesResponse 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 *AssignRolesResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on AssignRolesResponse 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 -// AssignRolesResponseMultiError, or nil if none found. -func (m *AssignRolesResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *AssignRolesResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return AssignRolesResponseMultiError(errors) - } - - return nil -} - -// AssignRolesResponseMultiError is an error wrapping multiple validation -// errors returned by AssignRolesResponse.ValidateAll() if the designated -// constraints aren't met. -type AssignRolesResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m AssignRolesResponseMultiError) 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 AssignRolesResponseMultiError) AllErrors() []error { return m } - -// AssignRolesResponseValidationError is the validation error returned by -// AssignRolesResponse.Validate if the designated constraints aren't met. -type AssignRolesResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e AssignRolesResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e AssignRolesResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e AssignRolesResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e AssignRolesResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e AssignRolesResponseValidationError) ErrorName() string { - return "AssignRolesResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e AssignRolesResponseValidationError) 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 %sAssignRolesResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = AssignRolesResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = AssignRolesResponseValidationError{} - -// Validate checks the field values on ListRolesRequest 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 *ListRolesRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ListRolesRequest 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 -// ListRolesRequestMultiError, or nil if none found. -func (m *ListRolesRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *ListRolesRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return ListRolesRequestMultiError(errors) - } - - return nil -} - -// ListRolesRequestMultiError is an error wrapping multiple validation errors -// returned by ListRolesRequest.ValidateAll() if the designated constraints -// aren't met. -type ListRolesRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ListRolesRequestMultiError) 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 ListRolesRequestMultiError) AllErrors() []error { return m } - -// ListRolesRequestValidationError is the validation error returned by -// ListRolesRequest.Validate if the designated constraints aren't met. -type ListRolesRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ListRolesRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ListRolesRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ListRolesRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ListRolesRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ListRolesRequestValidationError) ErrorName() string { return "ListRolesRequestValidationError" } - -// Error satisfies the builtin error interface -func (e ListRolesRequestValidationError) 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 %sListRolesRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ListRolesRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ListRolesRequestValidationError{} - -// Validate checks the field values on ListRolesResponse 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 *ListRolesResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ListRolesResponse 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 -// ListRolesResponseMultiError, or nil if none found. -func (m *ListRolesResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *ListRolesResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - for idx, item := range m.GetRoles() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ListRolesResponseValidationError{ - field: fmt.Sprintf("Roles[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ListRolesResponseValidationError{ - field: fmt.Sprintf("Roles[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ListRolesResponseValidationError{ - field: fmt.Sprintf("Roles[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - if len(errors) > 0 { - return ListRolesResponseMultiError(errors) - } - - return nil -} - -// ListRolesResponseMultiError is an error wrapping multiple validation errors -// returned by ListRolesResponse.ValidateAll() if the designated constraints -// aren't met. -type ListRolesResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ListRolesResponseMultiError) 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 ListRolesResponseMultiError) AllErrors() []error { return m } - -// ListRolesResponseValidationError is the validation error returned by -// ListRolesResponse.Validate if the designated constraints aren't met. -type ListRolesResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ListRolesResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ListRolesResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ListRolesResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ListRolesResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ListRolesResponseValidationError) ErrorName() string { - return "ListRolesResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e ListRolesResponseValidationError) 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 %sListRolesResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ListRolesResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ListRolesResponseValidationError{} - -// Validate checks the field values on ListRolesResponse_RoleData 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 *ListRolesResponse_RoleData) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ListRolesResponse_RoleData 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 -// ListRolesResponse_RoleDataMultiError, or nil if none found. -func (m *ListRolesResponse_RoleData) ValidateAll() error { - return m.validate(true) -} - -func (m *ListRolesResponse_RoleData) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for RoleId - - // no validation rules for Title - - // no validation rules for Filter - - // no validation rules for Description - - if len(errors) > 0 { - return ListRolesResponse_RoleDataMultiError(errors) - } - - return nil -} - -// ListRolesResponse_RoleDataMultiError is an error wrapping multiple -// validation errors returned by ListRolesResponse_RoleData.ValidateAll() if -// the designated constraints aren't met. -type ListRolesResponse_RoleDataMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ListRolesResponse_RoleDataMultiError) 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 ListRolesResponse_RoleDataMultiError) AllErrors() []error { return m } - -// ListRolesResponse_RoleDataValidationError is the validation error returned -// by ListRolesResponse_RoleData.Validate if the designated constraints aren't met. -type ListRolesResponse_RoleDataValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ListRolesResponse_RoleDataValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ListRolesResponse_RoleDataValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ListRolesResponse_RoleDataValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ListRolesResponse_RoleDataValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ListRolesResponse_RoleDataValidationError) ErrorName() string { - return "ListRolesResponse_RoleDataValidationError" -} - -// Error satisfies the builtin error interface -func (e ListRolesResponse_RoleDataValidationError) 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 %sListRolesResponse_RoleData.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ListRolesResponse_RoleDataValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ListRolesResponse_RoleDataValidationError{} diff --git a/api/accesscontrol/v1beta1/accesscontrol_grpc.pb.go b/api/accesscontrol/v1beta1/accesscontrol_grpc.pb.go deleted file mode 100644 index 27f509ee6f5..00000000000 --- a/api/accesscontrol/v1beta1/accesscontrol_grpc.pb.go +++ /dev/null @@ -1,374 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.6.0 -// - protoc (unknown) -// source: accesscontrol/v1beta1/accesscontrol.proto - -package accesscontrolv1beta1 - -import ( - context "context" - - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.64.0 or later. -const _ = grpc.SupportPackageIsVersion9 - -const ( - AccessControlService_CreateRole_FullMethodName = "/accesscontrol.v1beta1.AccessControlService/CreateRole" - AccessControlService_UpdateRole_FullMethodName = "/accesscontrol.v1beta1.AccessControlService/UpdateRole" - AccessControlService_DeleteRole_FullMethodName = "/accesscontrol.v1beta1.AccessControlService/DeleteRole" - AccessControlService_GetRole_FullMethodName = "/accesscontrol.v1beta1.AccessControlService/GetRole" - AccessControlService_ListRoles_FullMethodName = "/accesscontrol.v1beta1.AccessControlService/ListRoles" - AccessControlService_AssignRoles_FullMethodName = "/accesscontrol.v1beta1.AccessControlService/AssignRoles" - AccessControlService_SetDefaultRole_FullMethodName = "/accesscontrol.v1beta1.AccessControlService/SetDefaultRole" -) - -// AccessControlServiceClient is the client API for AccessControlService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -// -// Service Role provides public methods for managing Roles. -type AccessControlServiceClient interface { - // CreateRole creates a new role. - CreateRole(ctx context.Context, in *CreateRoleRequest, opts ...grpc.CallOption) (*CreateRoleResponse, error) - // UpdateRole creates a new role. - UpdateRole(ctx context.Context, in *UpdateRoleRequest, opts ...grpc.CallOption) (*UpdateRoleResponse, error) - // DeleteRole creates a new role. - DeleteRole(ctx context.Context, in *DeleteRoleRequest, opts ...grpc.CallOption) (*DeleteRoleResponse, error) - // GetRole retrieves a single role. - GetRole(ctx context.Context, in *GetRoleRequest, opts ...grpc.CallOption) (*GetRoleResponse, error) - // ListRoles retrieves a roles. - ListRoles(ctx context.Context, in *ListRolesRequest, opts ...grpc.CallOption) (*ListRolesResponse, error) - // AssignRoles replaces all assigned roles for a user. - AssignRoles(ctx context.Context, in *AssignRolesRequest, opts ...grpc.CallOption) (*AssignRolesResponse, error) - // SetDefaultRole configures default role assigned to users. - SetDefaultRole(ctx context.Context, in *SetDefaultRoleRequest, opts ...grpc.CallOption) (*SetDefaultRoleResponse, error) -} - -type accessControlServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewAccessControlServiceClient(cc grpc.ClientConnInterface) AccessControlServiceClient { - return &accessControlServiceClient{cc} -} - -func (c *accessControlServiceClient) CreateRole(ctx context.Context, in *CreateRoleRequest, opts ...grpc.CallOption) (*CreateRoleResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(CreateRoleResponse) - err := c.cc.Invoke(ctx, AccessControlService_CreateRole_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *accessControlServiceClient) UpdateRole(ctx context.Context, in *UpdateRoleRequest, opts ...grpc.CallOption) (*UpdateRoleResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(UpdateRoleResponse) - err := c.cc.Invoke(ctx, AccessControlService_UpdateRole_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *accessControlServiceClient) DeleteRole(ctx context.Context, in *DeleteRoleRequest, opts ...grpc.CallOption) (*DeleteRoleResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(DeleteRoleResponse) - err := c.cc.Invoke(ctx, AccessControlService_DeleteRole_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *accessControlServiceClient) GetRole(ctx context.Context, in *GetRoleRequest, opts ...grpc.CallOption) (*GetRoleResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetRoleResponse) - err := c.cc.Invoke(ctx, AccessControlService_GetRole_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *accessControlServiceClient) ListRoles(ctx context.Context, in *ListRolesRequest, opts ...grpc.CallOption) (*ListRolesResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(ListRolesResponse) - err := c.cc.Invoke(ctx, AccessControlService_ListRoles_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *accessControlServiceClient) AssignRoles(ctx context.Context, in *AssignRolesRequest, opts ...grpc.CallOption) (*AssignRolesResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(AssignRolesResponse) - err := c.cc.Invoke(ctx, AccessControlService_AssignRoles_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *accessControlServiceClient) SetDefaultRole(ctx context.Context, in *SetDefaultRoleRequest, opts ...grpc.CallOption) (*SetDefaultRoleResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(SetDefaultRoleResponse) - err := c.cc.Invoke(ctx, AccessControlService_SetDefaultRole_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -// AccessControlServiceServer is the server API for AccessControlService service. -// All implementations must embed UnimplementedAccessControlServiceServer -// for forward compatibility. -// -// Service Role provides public methods for managing Roles. -type AccessControlServiceServer interface { - // CreateRole creates a new role. - CreateRole(context.Context, *CreateRoleRequest) (*CreateRoleResponse, error) - // UpdateRole creates a new role. - UpdateRole(context.Context, *UpdateRoleRequest) (*UpdateRoleResponse, error) - // DeleteRole creates a new role. - DeleteRole(context.Context, *DeleteRoleRequest) (*DeleteRoleResponse, error) - // GetRole retrieves a single role. - GetRole(context.Context, *GetRoleRequest) (*GetRoleResponse, error) - // ListRoles retrieves a roles. - ListRoles(context.Context, *ListRolesRequest) (*ListRolesResponse, error) - // AssignRoles replaces all assigned roles for a user. - AssignRoles(context.Context, *AssignRolesRequest) (*AssignRolesResponse, error) - // SetDefaultRole configures default role assigned to users. - SetDefaultRole(context.Context, *SetDefaultRoleRequest) (*SetDefaultRoleResponse, error) - mustEmbedUnimplementedAccessControlServiceServer() -} - -// UnimplementedAccessControlServiceServer must be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -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") -} -func (UnimplementedAccessControlServiceServer) mustEmbedUnimplementedAccessControlServiceServer() {} -func (UnimplementedAccessControlServiceServer) testEmbeddedByValue() {} - -// UnsafeAccessControlServiceServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to AccessControlServiceServer will -// result in compilation errors. -type UnsafeAccessControlServiceServer interface { - mustEmbedUnimplementedAccessControlServiceServer() -} - -func RegisterAccessControlServiceServer(s grpc.ServiceRegistrar, srv AccessControlServiceServer) { - // If the following call panics, it indicates UnimplementedAccessControlServiceServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } - s.RegisterService(&AccessControlService_ServiceDesc, srv) -} - -func _AccessControlService_CreateRole_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateRoleRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AccessControlServiceServer).CreateRole(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: AccessControlService_CreateRole_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AccessControlServiceServer).CreateRole(ctx, req.(*CreateRoleRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AccessControlService_UpdateRole_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdateRoleRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AccessControlServiceServer).UpdateRole(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: AccessControlService_UpdateRole_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AccessControlServiceServer).UpdateRole(ctx, req.(*UpdateRoleRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AccessControlService_DeleteRole_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteRoleRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AccessControlServiceServer).DeleteRole(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: AccessControlService_DeleteRole_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AccessControlServiceServer).DeleteRole(ctx, req.(*DeleteRoleRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AccessControlService_GetRole_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetRoleRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AccessControlServiceServer).GetRole(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: AccessControlService_GetRole_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AccessControlServiceServer).GetRole(ctx, req.(*GetRoleRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AccessControlService_ListRoles_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListRolesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AccessControlServiceServer).ListRoles(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: AccessControlService_ListRoles_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AccessControlServiceServer).ListRoles(ctx, req.(*ListRolesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AccessControlService_AssignRoles_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AssignRolesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AccessControlServiceServer).AssignRoles(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: AccessControlService_AssignRoles_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AccessControlServiceServer).AssignRoles(ctx, req.(*AssignRolesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AccessControlService_SetDefaultRole_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SetDefaultRoleRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AccessControlServiceServer).SetDefaultRole(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: AccessControlService_SetDefaultRole_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AccessControlServiceServer).SetDefaultRole(ctx, req.(*SetDefaultRoleRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// AccessControlService_ServiceDesc is the grpc.ServiceDesc for AccessControlService service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var AccessControlService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "accesscontrol.v1beta1.AccessControlService", - HandlerType: (*AccessControlServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "CreateRole", - Handler: _AccessControlService_CreateRole_Handler, - }, - { - MethodName: "UpdateRole", - Handler: _AccessControlService_UpdateRole_Handler, - }, - { - MethodName: "DeleteRole", - Handler: _AccessControlService_DeleteRole_Handler, - }, - { - MethodName: "GetRole", - Handler: _AccessControlService_GetRole_Handler, - }, - { - MethodName: "ListRoles", - Handler: _AccessControlService_ListRoles_Handler, - }, - { - MethodName: "AssignRoles", - Handler: _AccessControlService_AssignRoles_Handler, - }, - { - MethodName: "SetDefaultRole", - Handler: _AccessControlService_SetDefaultRole_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "accesscontrol/v1beta1/accesscontrol.proto", -} diff --git a/api/accesscontrol/v1beta1/json/client/access_control_service/access_control_service_client.go b/api/accesscontrol/v1beta1/json/client/access_control_service/access_control_service_client.go deleted file mode 100644 index 9aaaf4ab2ce..00000000000 --- a/api/accesscontrol/v1beta1/json/client/access_control_service/access_control_service_client.go +++ /dev/null @@ -1,385 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package access_control_service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// New creates a new access control service API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -// New creates a new access control service API client with basic auth credentials. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - user: user for basic authentication header. -// - password: password for basic authentication header. -func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BasicAuth(user, password) - return &Client{transport: transport, formats: strfmt.Default} -} - -// New creates a new access control service API client with a bearer token for authentication. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - bearerToken: bearer token for Bearer authentication header. -func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BearerToken(bearerToken) - return &Client{transport: transport, formats: strfmt.Default} -} - -/* -Client for access control service API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption may be used to customize the behavior of Client methods. -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - AssignRoles(params *AssignRolesParams, opts ...ClientOption) (*AssignRolesOK, error) - - CreateRole(params *CreateRoleParams, opts ...ClientOption) (*CreateRoleOK, error) - - DeleteRole(params *DeleteRoleParams, opts ...ClientOption) (*DeleteRoleOK, error) - - GetRole(params *GetRoleParams, opts ...ClientOption) (*GetRoleOK, error) - - ListRoles(params *ListRolesParams, opts ...ClientOption) (*ListRolesOK, error) - - SetDefaultRole(params *SetDefaultRoleParams, opts ...ClientOption) (*SetDefaultRoleOK, error) - - UpdateRole(params *UpdateRoleParams, opts ...ClientOption) (*UpdateRoleOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -AssignRoles assigns roles to a user - -Replaces all existing roles for a user. -*/ -func (a *Client) AssignRoles(params *AssignRolesParams, opts ...ClientOption) (*AssignRolesOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewAssignRolesParams() - } - op := &runtime.ClientOperation{ - ID: "AssignRoles", - Method: "POST", - PathPattern: "/v1/accesscontrol/roles:assign", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &AssignRolesReader{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.(*AssignRolesOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*AssignRolesDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -CreateRole creates a role - -Creates a new role. -*/ -func (a *Client) CreateRole(params *CreateRoleParams, opts ...ClientOption) (*CreateRoleOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewCreateRoleParams() - } - op := &runtime.ClientOperation{ - ID: "CreateRole", - Method: "POST", - PathPattern: "/v1/accesscontrol/roles", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &CreateRoleReader{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.(*CreateRoleOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*CreateRoleDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -DeleteRole deletes a role - -Deletes a role. -*/ -func (a *Client) DeleteRole(params *DeleteRoleParams, opts ...ClientOption) (*DeleteRoleOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewDeleteRoleParams() - } - op := &runtime.ClientOperation{ - ID: "DeleteRole", - Method: "DELETE", - PathPattern: "/v1/accesscontrol/roles/{role_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &DeleteRoleReader{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.(*DeleteRoleOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*DeleteRoleDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -GetRole gets a role - -Retrieves a role by ID. -*/ -func (a *Client) GetRole(params *GetRoleParams, opts ...ClientOption) (*GetRoleOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewGetRoleParams() - } - op := &runtime.ClientOperation{ - ID: "GetRole", - Method: "GET", - PathPattern: "/v1/accesscontrol/roles/{role_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &GetRoleReader{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.(*GetRoleOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*GetRoleDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -ListRoles lists roles - -Lists all roles. -*/ -func (a *Client) ListRoles(params *ListRolesParams, opts ...ClientOption) (*ListRolesOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewListRolesParams() - } - op := &runtime.ClientOperation{ - ID: "ListRoles", - Method: "GET", - PathPattern: "/v1/accesscontrol/roles", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &ListRolesReader{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.(*ListRolesOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*ListRolesDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -SetDefaultRole sets a default role - -Configures a default role assigned to users. -*/ -func (a *Client) SetDefaultRole(params *SetDefaultRoleParams, opts ...ClientOption) (*SetDefaultRoleOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewSetDefaultRoleParams() - } - op := &runtime.ClientOperation{ - ID: "SetDefaultRole", - Method: "POST", - PathPattern: "/v1/accesscontrol/roles:setDefault", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &SetDefaultRoleReader{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.(*SetDefaultRoleOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*SetDefaultRoleDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -UpdateRole updates a role - -Updates an existing role. -*/ -func (a *Client) UpdateRole(params *UpdateRoleParams, opts ...ClientOption) (*UpdateRoleOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewUpdateRoleParams() - } - op := &runtime.ClientOperation{ - ID: "UpdateRole", - Method: "PUT", - PathPattern: "/v1/accesscontrol/roles/{role_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &UpdateRoleReader{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.(*UpdateRoleOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*UpdateRoleDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/api/accesscontrol/v1beta1/json/client/access_control_service/assign_roles_parameters.go b/api/accesscontrol/v1beta1/json/client/access_control_service/assign_roles_parameters.go deleted file mode 100644 index 382f7922a2d..00000000000 --- a/api/accesscontrol/v1beta1/json/client/access_control_service/assign_roles_parameters.go +++ /dev/null @@ -1,144 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package access_control_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" -) - -// NewAssignRolesParams creates a new AssignRolesParams 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 NewAssignRolesParams() *AssignRolesParams { - return &AssignRolesParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewAssignRolesParamsWithTimeout creates a new AssignRolesParams object -// with the ability to set a timeout on a request. -func NewAssignRolesParamsWithTimeout(timeout time.Duration) *AssignRolesParams { - return &AssignRolesParams{ - timeout: timeout, - } -} - -// NewAssignRolesParamsWithContext creates a new AssignRolesParams object -// with the ability to set a context for a request. -func NewAssignRolesParamsWithContext(ctx context.Context) *AssignRolesParams { - return &AssignRolesParams{ - Context: ctx, - } -} - -// NewAssignRolesParamsWithHTTPClient creates a new AssignRolesParams object -// with the ability to set a custom HTTPClient for a request. -func NewAssignRolesParamsWithHTTPClient(client *http.Client) *AssignRolesParams { - return &AssignRolesParams{ - HTTPClient: client, - } -} - -/* -AssignRolesParams contains all the parameters to send to the API endpoint - - for the assign roles operation. - - Typically these are written to a http.Request. -*/ -type AssignRolesParams struct { - // Body. - Body AssignRolesBody - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the assign roles params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *AssignRolesParams) WithDefaults() *AssignRolesParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the assign roles params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *AssignRolesParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the assign roles params -func (o *AssignRolesParams) WithTimeout(timeout time.Duration) *AssignRolesParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the assign roles params -func (o *AssignRolesParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the assign roles params -func (o *AssignRolesParams) WithContext(ctx context.Context) *AssignRolesParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the assign roles params -func (o *AssignRolesParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the assign roles params -func (o *AssignRolesParams) WithHTTPClient(client *http.Client) *AssignRolesParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the assign roles params -func (o *AssignRolesParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the assign roles params -func (o *AssignRolesParams) WithBody(body AssignRolesBody) *AssignRolesParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the assign roles params -func (o *AssignRolesParams) SetBody(body AssignRolesBody) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *AssignRolesParams) 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/accesscontrol/v1beta1/json/client/access_control_service/assign_roles_responses.go b/api/accesscontrol/v1beta1/json/client/access_control_service/assign_roles_responses.go deleted file mode 100644 index e8da90c3536..00000000000 --- a/api/accesscontrol/v1beta1/json/client/access_control_service/assign_roles_responses.go +++ /dev/null @@ -1,454 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package access_control_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" -) - -// AssignRolesReader is a Reader for the AssignRoles structure. -type AssignRolesReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *AssignRolesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewAssignRolesOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewAssignRolesDefault(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 - } -} - -// NewAssignRolesOK creates a AssignRolesOK with default headers values -func NewAssignRolesOK() *AssignRolesOK { - return &AssignRolesOK{} -} - -/* -AssignRolesOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type AssignRolesOK struct { - Payload any -} - -// IsSuccess returns true when this assign roles Ok response has a 2xx status code -func (o *AssignRolesOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this assign roles Ok response has a 3xx status code -func (o *AssignRolesOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this assign roles Ok response has a 4xx status code -func (o *AssignRolesOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this assign roles Ok response has a 5xx status code -func (o *AssignRolesOK) IsServerError() bool { - return false -} - -// IsCode returns true when this assign roles Ok response a status code equal to that given -func (o *AssignRolesOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the assign roles Ok response -func (o *AssignRolesOK) Code() int { - return 200 -} - -func (o *AssignRolesOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/accesscontrol/roles:assign][%d] assignRolesOk %s", 200, payload) -} - -func (o *AssignRolesOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/accesscontrol/roles:assign][%d] assignRolesOk %s", 200, payload) -} - -func (o *AssignRolesOK) GetPayload() any { - return o.Payload -} - -func (o *AssignRolesOK) 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) { - return err - } - - return nil -} - -// NewAssignRolesDefault creates a AssignRolesDefault with default headers values -func NewAssignRolesDefault(code int) *AssignRolesDefault { - return &AssignRolesDefault{ - _statusCode: code, - } -} - -/* -AssignRolesDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type AssignRolesDefault struct { - _statusCode int - - Payload *AssignRolesDefaultBody -} - -// IsSuccess returns true when this assign roles default response has a 2xx status code -func (o *AssignRolesDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this assign roles default response has a 3xx status code -func (o *AssignRolesDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this assign roles default response has a 4xx status code -func (o *AssignRolesDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this assign roles default response has a 5xx status code -func (o *AssignRolesDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this assign roles default response a status code equal to that given -func (o *AssignRolesDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the assign roles default response -func (o *AssignRolesDefault) Code() int { - return o._statusCode -} - -func (o *AssignRolesDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/accesscontrol/roles:assign][%d] AssignRoles default %s", o._statusCode, payload) -} - -func (o *AssignRolesDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/accesscontrol/roles:assign][%d] AssignRoles default %s", o._statusCode, payload) -} - -func (o *AssignRolesDefault) GetPayload() *AssignRolesDefaultBody { - return o.Payload -} - -func (o *AssignRolesDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(AssignRolesDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -AssignRolesBody assign roles body -swagger:model AssignRolesBody -*/ -type AssignRolesBody struct { - // role ids - RoleIds []int64 `json:"role_ids"` - - // user id - UserID int64 `json:"user_id,omitempty"` -} - -// Validate validates this assign roles body -func (o *AssignRolesBody) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this assign roles body based on context it is used -func (o *AssignRolesBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AssignRolesBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AssignRolesBody) UnmarshalBinary(b []byte) error { - var res AssignRolesBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AssignRolesDefaultBody assign roles default body -swagger:model AssignRolesDefaultBody -*/ -type AssignRolesDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*AssignRolesDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this assign roles default body -func (o *AssignRolesDefaultBody) 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 *AssignRolesDefaultBody) 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("AssignRoles default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("AssignRoles default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this assign roles default body based on the context it is used -func (o *AssignRolesDefaultBody) 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 *AssignRolesDefaultBody) 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("AssignRoles default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("AssignRoles default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *AssignRolesDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AssignRolesDefaultBody) UnmarshalBinary(b []byte) error { - var res AssignRolesDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AssignRolesDefaultBodyDetailsItems0 assign roles default body details items0 -swagger:model AssignRolesDefaultBodyDetailsItems0 -*/ -type AssignRolesDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` - - // assign roles default body details items0 - AssignRolesDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *AssignRolesDefaultBodyDetailsItems0) 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 AssignRolesDefaultBodyDetailsItems0 - - 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.AssignRolesDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o AssignRolesDefaultBodyDetailsItems0) 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.AssignRolesDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.AssignRolesDefaultBodyDetailsItems0) - 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 assign roles default body details items0 -func (o *AssignRolesDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this assign roles default body details items0 based on context it is used -func (o *AssignRolesDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AssignRolesDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AssignRolesDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res AssignRolesDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/accesscontrol/v1beta1/json/client/access_control_service/create_role_parameters.go b/api/accesscontrol/v1beta1/json/client/access_control_service/create_role_parameters.go deleted file mode 100644 index b938a079586..00000000000 --- a/api/accesscontrol/v1beta1/json/client/access_control_service/create_role_parameters.go +++ /dev/null @@ -1,144 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package access_control_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" -) - -// NewCreateRoleParams creates a new CreateRoleParams 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 NewCreateRoleParams() *CreateRoleParams { - return &CreateRoleParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewCreateRoleParamsWithTimeout creates a new CreateRoleParams object -// with the ability to set a timeout on a request. -func NewCreateRoleParamsWithTimeout(timeout time.Duration) *CreateRoleParams { - return &CreateRoleParams{ - timeout: timeout, - } -} - -// NewCreateRoleParamsWithContext creates a new CreateRoleParams object -// with the ability to set a context for a request. -func NewCreateRoleParamsWithContext(ctx context.Context) *CreateRoleParams { - return &CreateRoleParams{ - Context: ctx, - } -} - -// NewCreateRoleParamsWithHTTPClient creates a new CreateRoleParams object -// with the ability to set a custom HTTPClient for a request. -func NewCreateRoleParamsWithHTTPClient(client *http.Client) *CreateRoleParams { - return &CreateRoleParams{ - HTTPClient: client, - } -} - -/* -CreateRoleParams contains all the parameters to send to the API endpoint - - for the create role operation. - - Typically these are written to a http.Request. -*/ -type CreateRoleParams struct { - // Body. - Body CreateRoleBody - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the create role params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateRoleParams) WithDefaults() *CreateRoleParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the create role params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateRoleParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the create role params -func (o *CreateRoleParams) WithTimeout(timeout time.Duration) *CreateRoleParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the create role params -func (o *CreateRoleParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the create role params -func (o *CreateRoleParams) WithContext(ctx context.Context) *CreateRoleParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the create role params -func (o *CreateRoleParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the create role params -func (o *CreateRoleParams) WithHTTPClient(client *http.Client) *CreateRoleParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the create role params -func (o *CreateRoleParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the create role params -func (o *CreateRoleParams) WithBody(body CreateRoleBody) *CreateRoleParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the create role params -func (o *CreateRoleParams) SetBody(body CreateRoleBody) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *CreateRoleParams) 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/accesscontrol/v1beta1/json/client/access_control_service/create_role_responses.go b/api/accesscontrol/v1beta1/json/client/access_control_service/create_role_responses.go deleted file mode 100644 index b03fdb96075..00000000000 --- a/api/accesscontrol/v1beta1/json/client/access_control_service/create_role_responses.go +++ /dev/null @@ -1,496 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package access_control_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" -) - -// CreateRoleReader is a Reader for the CreateRole structure. -type CreateRoleReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *CreateRoleReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewCreateRoleOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewCreateRoleDefault(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 - } -} - -// NewCreateRoleOK creates a CreateRoleOK with default headers values -func NewCreateRoleOK() *CreateRoleOK { - return &CreateRoleOK{} -} - -/* -CreateRoleOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type CreateRoleOK struct { - Payload *CreateRoleOKBody -} - -// IsSuccess returns true when this create role Ok response has a 2xx status code -func (o *CreateRoleOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this create role Ok response has a 3xx status code -func (o *CreateRoleOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create role Ok response has a 4xx status code -func (o *CreateRoleOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this create role Ok response has a 5xx status code -func (o *CreateRoleOK) IsServerError() bool { - return false -} - -// IsCode returns true when this create role Ok response a status code equal to that given -func (o *CreateRoleOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the create role Ok response -func (o *CreateRoleOK) Code() int { - return 200 -} - -func (o *CreateRoleOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/accesscontrol/roles][%d] createRoleOk %s", 200, payload) -} - -func (o *CreateRoleOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/accesscontrol/roles][%d] createRoleOk %s", 200, payload) -} - -func (o *CreateRoleOK) GetPayload() *CreateRoleOKBody { - return o.Payload -} - -func (o *CreateRoleOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(CreateRoleOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -// NewCreateRoleDefault creates a CreateRoleDefault with default headers values -func NewCreateRoleDefault(code int) *CreateRoleDefault { - return &CreateRoleDefault{ - _statusCode: code, - } -} - -/* -CreateRoleDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type CreateRoleDefault struct { - _statusCode int - - Payload *CreateRoleDefaultBody -} - -// IsSuccess returns true when this create role default response has a 2xx status code -func (o *CreateRoleDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this create role default response has a 3xx status code -func (o *CreateRoleDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this create role default response has a 4xx status code -func (o *CreateRoleDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this create role default response has a 5xx status code -func (o *CreateRoleDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this create role default response a status code equal to that given -func (o *CreateRoleDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the create role default response -func (o *CreateRoleDefault) Code() int { - return o._statusCode -} - -func (o *CreateRoleDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/accesscontrol/roles][%d] CreateRole default %s", o._statusCode, payload) -} - -func (o *CreateRoleDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/accesscontrol/roles][%d] CreateRole default %s", o._statusCode, payload) -} - -func (o *CreateRoleDefault) GetPayload() *CreateRoleDefaultBody { - return o.Payload -} - -func (o *CreateRoleDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(CreateRoleDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -CreateRoleBody create role body -swagger:model CreateRoleBody -*/ -type CreateRoleBody struct { - // title - Title string `json:"title,omitempty"` - - // filter - Filter string `json:"filter,omitempty"` - - // description - Description string `json:"description,omitempty"` -} - -// Validate validates this create role body -func (o *CreateRoleBody) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this create role body based on context it is used -func (o *CreateRoleBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *CreateRoleBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *CreateRoleBody) UnmarshalBinary(b []byte) error { - var res CreateRoleBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -CreateRoleDefaultBody create role default body -swagger:model CreateRoleDefaultBody -*/ -type CreateRoleDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*CreateRoleDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this create role default body -func (o *CreateRoleDefaultBody) 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 *CreateRoleDefaultBody) 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("CreateRole default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("CreateRole default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this create role default body based on the context it is used -func (o *CreateRoleDefaultBody) 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 *CreateRoleDefaultBody) 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("CreateRole default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("CreateRole default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *CreateRoleDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *CreateRoleDefaultBody) UnmarshalBinary(b []byte) error { - var res CreateRoleDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -CreateRoleDefaultBodyDetailsItems0 create role default body details items0 -swagger:model CreateRoleDefaultBodyDetailsItems0 -*/ -type CreateRoleDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` - - // create role default body details items0 - CreateRoleDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *CreateRoleDefaultBodyDetailsItems0) 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 CreateRoleDefaultBodyDetailsItems0 - - 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.CreateRoleDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o CreateRoleDefaultBodyDetailsItems0) 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.CreateRoleDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.CreateRoleDefaultBodyDetailsItems0) - 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 role default body details items0 -func (o *CreateRoleDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this create role default body details items0 based on context it is used -func (o *CreateRoleDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *CreateRoleDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *CreateRoleDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res CreateRoleDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -CreateRoleOKBody create role OK body -swagger:model CreateRoleOKBody -*/ -type CreateRoleOKBody struct { - // role id - RoleID int64 `json:"role_id,omitempty"` -} - -// Validate validates this create role OK body -func (o *CreateRoleOKBody) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this create role OK body based on context it is used -func (o *CreateRoleOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *CreateRoleOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *CreateRoleOKBody) UnmarshalBinary(b []byte) error { - var res CreateRoleOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/accesscontrol/v1beta1/json/client/access_control_service/delete_role_parameters.go b/api/accesscontrol/v1beta1/json/client/access_control_service/delete_role_parameters.go deleted file mode 100644 index 7e502e8dcd7..00000000000 --- a/api/accesscontrol/v1beta1/json/client/access_control_service/delete_role_parameters.go +++ /dev/null @@ -1,184 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package access_control_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" - "github.com/go-openapi/swag" -) - -// NewDeleteRoleParams creates a new DeleteRoleParams 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 NewDeleteRoleParams() *DeleteRoleParams { - return &DeleteRoleParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDeleteRoleParamsWithTimeout creates a new DeleteRoleParams object -// with the ability to set a timeout on a request. -func NewDeleteRoleParamsWithTimeout(timeout time.Duration) *DeleteRoleParams { - return &DeleteRoleParams{ - timeout: timeout, - } -} - -// NewDeleteRoleParamsWithContext creates a new DeleteRoleParams object -// with the ability to set a context for a request. -func NewDeleteRoleParamsWithContext(ctx context.Context) *DeleteRoleParams { - return &DeleteRoleParams{ - Context: ctx, - } -} - -// NewDeleteRoleParamsWithHTTPClient creates a new DeleteRoleParams object -// with the ability to set a custom HTTPClient for a request. -func NewDeleteRoleParamsWithHTTPClient(client *http.Client) *DeleteRoleParams { - return &DeleteRoleParams{ - HTTPClient: client, - } -} - -/* -DeleteRoleParams contains all the parameters to send to the API endpoint - - for the delete role operation. - - Typically these are written to a http.Request. -*/ -type DeleteRoleParams struct { - /* ReplacementRoleID. - - Role ID to be used as a replacement for the role. Additional logic applies. - - Format: int64 - */ - ReplacementRoleID *int64 - - // RoleID. - // - // Format: int64 - RoleID int64 - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the delete role params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteRoleParams) WithDefaults() *DeleteRoleParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the delete role params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteRoleParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the delete role params -func (o *DeleteRoleParams) WithTimeout(timeout time.Duration) *DeleteRoleParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the delete role params -func (o *DeleteRoleParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the delete role params -func (o *DeleteRoleParams) WithContext(ctx context.Context) *DeleteRoleParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the delete role params -func (o *DeleteRoleParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the delete role params -func (o *DeleteRoleParams) WithHTTPClient(client *http.Client) *DeleteRoleParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the delete role params -func (o *DeleteRoleParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithReplacementRoleID adds the replacementRoleID to the delete role params -func (o *DeleteRoleParams) WithReplacementRoleID(replacementRoleID *int64) *DeleteRoleParams { - o.SetReplacementRoleID(replacementRoleID) - return o -} - -// SetReplacementRoleID adds the replacementRoleId to the delete role params -func (o *DeleteRoleParams) SetReplacementRoleID(replacementRoleID *int64) { - o.ReplacementRoleID = replacementRoleID -} - -// WithRoleID adds the roleID to the delete role params -func (o *DeleteRoleParams) WithRoleID(roleID int64) *DeleteRoleParams { - o.SetRoleID(roleID) - return o -} - -// SetRoleID adds the roleId to the delete role params -func (o *DeleteRoleParams) SetRoleID(roleID int64) { - o.RoleID = roleID -} - -// WriteToRequest writes these params to a swagger request -func (o *DeleteRoleParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.ReplacementRoleID != nil { - - // query param replacement_role_id - var qrReplacementRoleID int64 - - if o.ReplacementRoleID != nil { - qrReplacementRoleID = *o.ReplacementRoleID - } - qReplacementRoleID := swag.FormatInt64(qrReplacementRoleID) - if qReplacementRoleID != "" { - if err := r.SetQueryParam("replacement_role_id", qReplacementRoleID); err != nil { - return err - } - } - } - - // path param role_id - if err := r.SetPathParam("role_id", swag.FormatInt64(o.RoleID)); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/api/accesscontrol/v1beta1/json/client/access_control_service/delete_role_responses.go b/api/accesscontrol/v1beta1/json/client/access_control_service/delete_role_responses.go deleted file mode 100644 index 84cb3699513..00000000000 --- a/api/accesscontrol/v1beta1/json/client/access_control_service/delete_role_responses.go +++ /dev/null @@ -1,414 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package access_control_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" -) - -// DeleteRoleReader is a Reader for the DeleteRole structure. -type DeleteRoleReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DeleteRoleReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewDeleteRoleOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewDeleteRoleDefault(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 - } -} - -// NewDeleteRoleOK creates a DeleteRoleOK with default headers values -func NewDeleteRoleOK() *DeleteRoleOK { - return &DeleteRoleOK{} -} - -/* -DeleteRoleOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type DeleteRoleOK struct { - Payload any -} - -// IsSuccess returns true when this delete role Ok response has a 2xx status code -func (o *DeleteRoleOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this delete role Ok response has a 3xx status code -func (o *DeleteRoleOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this delete role Ok response has a 4xx status code -func (o *DeleteRoleOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this delete role Ok response has a 5xx status code -func (o *DeleteRoleOK) IsServerError() bool { - return false -} - -// IsCode returns true when this delete role Ok response a status code equal to that given -func (o *DeleteRoleOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the delete role Ok response -func (o *DeleteRoleOK) Code() int { - return 200 -} - -func (o *DeleteRoleOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/accesscontrol/roles/{role_id}][%d] deleteRoleOk %s", 200, payload) -} - -func (o *DeleteRoleOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/accesscontrol/roles/{role_id}][%d] deleteRoleOk %s", 200, payload) -} - -func (o *DeleteRoleOK) GetPayload() any { - return o.Payload -} - -func (o *DeleteRoleOK) 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) { - return err - } - - return nil -} - -// NewDeleteRoleDefault creates a DeleteRoleDefault with default headers values -func NewDeleteRoleDefault(code int) *DeleteRoleDefault { - return &DeleteRoleDefault{ - _statusCode: code, - } -} - -/* -DeleteRoleDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type DeleteRoleDefault struct { - _statusCode int - - Payload *DeleteRoleDefaultBody -} - -// IsSuccess returns true when this delete role default response has a 2xx status code -func (o *DeleteRoleDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this delete role default response has a 3xx status code -func (o *DeleteRoleDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this delete role default response has a 4xx status code -func (o *DeleteRoleDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this delete role default response has a 5xx status code -func (o *DeleteRoleDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this delete role default response a status code equal to that given -func (o *DeleteRoleDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the delete role default response -func (o *DeleteRoleDefault) Code() int { - return o._statusCode -} - -func (o *DeleteRoleDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/accesscontrol/roles/{role_id}][%d] DeleteRole default %s", o._statusCode, payload) -} - -func (o *DeleteRoleDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/accesscontrol/roles/{role_id}][%d] DeleteRole default %s", o._statusCode, payload) -} - -func (o *DeleteRoleDefault) GetPayload() *DeleteRoleDefaultBody { - return o.Payload -} - -func (o *DeleteRoleDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(DeleteRoleDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -DeleteRoleDefaultBody delete role default body -swagger:model DeleteRoleDefaultBody -*/ -type DeleteRoleDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*DeleteRoleDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this delete role default body -func (o *DeleteRoleDefaultBody) 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 *DeleteRoleDefaultBody) 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("DeleteRole default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("DeleteRole default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this delete role default body based on the context it is used -func (o *DeleteRoleDefaultBody) 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 *DeleteRoleDefaultBody) 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("DeleteRole default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("DeleteRole default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *DeleteRoleDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *DeleteRoleDefaultBody) UnmarshalBinary(b []byte) error { - var res DeleteRoleDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -DeleteRoleDefaultBodyDetailsItems0 delete role default body details items0 -swagger:model DeleteRoleDefaultBodyDetailsItems0 -*/ -type DeleteRoleDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` - - // delete role default body details items0 - DeleteRoleDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *DeleteRoleDefaultBodyDetailsItems0) 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 DeleteRoleDefaultBodyDetailsItems0 - - 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.DeleteRoleDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o DeleteRoleDefaultBodyDetailsItems0) 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.DeleteRoleDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.DeleteRoleDefaultBodyDetailsItems0) - 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 delete role default body details items0 -func (o *DeleteRoleDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this delete role default body details items0 based on context it is used -func (o *DeleteRoleDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *DeleteRoleDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *DeleteRoleDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res DeleteRoleDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/accesscontrol/v1beta1/json/client/access_control_service/get_role_parameters.go b/api/accesscontrol/v1beta1/json/client/access_control_service/get_role_parameters.go deleted file mode 100644 index 31a018c004a..00000000000 --- a/api/accesscontrol/v1beta1/json/client/access_control_service/get_role_parameters.go +++ /dev/null @@ -1,149 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package access_control_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" - "github.com/go-openapi/swag" -) - -// NewGetRoleParams creates a new GetRoleParams 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 NewGetRoleParams() *GetRoleParams { - return &GetRoleParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetRoleParamsWithTimeout creates a new GetRoleParams object -// with the ability to set a timeout on a request. -func NewGetRoleParamsWithTimeout(timeout time.Duration) *GetRoleParams { - return &GetRoleParams{ - timeout: timeout, - } -} - -// NewGetRoleParamsWithContext creates a new GetRoleParams object -// with the ability to set a context for a request. -func NewGetRoleParamsWithContext(ctx context.Context) *GetRoleParams { - return &GetRoleParams{ - Context: ctx, - } -} - -// NewGetRoleParamsWithHTTPClient creates a new GetRoleParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetRoleParamsWithHTTPClient(client *http.Client) *GetRoleParams { - return &GetRoleParams{ - HTTPClient: client, - } -} - -/* -GetRoleParams contains all the parameters to send to the API endpoint - - for the get role operation. - - Typically these are written to a http.Request. -*/ -type GetRoleParams struct { - // RoleID. - // - // Format: int64 - RoleID int64 - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get role params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetRoleParams) WithDefaults() *GetRoleParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get role params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetRoleParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the get role params -func (o *GetRoleParams) WithTimeout(timeout time.Duration) *GetRoleParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get role params -func (o *GetRoleParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get role params -func (o *GetRoleParams) WithContext(ctx context.Context) *GetRoleParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get role params -func (o *GetRoleParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get role params -func (o *GetRoleParams) WithHTTPClient(client *http.Client) *GetRoleParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get role params -func (o *GetRoleParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithRoleID adds the roleID to the get role params -func (o *GetRoleParams) WithRoleID(roleID int64) *GetRoleParams { - o.SetRoleID(roleID) - return o -} - -// SetRoleID adds the roleId to the get role params -func (o *GetRoleParams) SetRoleID(roleID int64) { - o.RoleID = roleID -} - -// WriteToRequest writes these params to a swagger request -func (o *GetRoleParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param role_id - if err := r.SetPathParam("role_id", swag.FormatInt64(o.RoleID)); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/api/accesscontrol/v1beta1/json/client/access_control_service/get_role_responses.go b/api/accesscontrol/v1beta1/json/client/access_control_service/get_role_responses.go deleted file mode 100644 index f731e38c4d1..00000000000 --- a/api/accesscontrol/v1beta1/json/client/access_control_service/get_role_responses.go +++ /dev/null @@ -1,462 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package access_control_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" -) - -// GetRoleReader is a Reader for the GetRole structure. -type GetRoleReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetRoleReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewGetRoleOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewGetRoleDefault(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 - } -} - -// NewGetRoleOK creates a GetRoleOK with default headers values -func NewGetRoleOK() *GetRoleOK { - return &GetRoleOK{} -} - -/* -GetRoleOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type GetRoleOK struct { - Payload *GetRoleOKBody -} - -// IsSuccess returns true when this get role Ok response has a 2xx status code -func (o *GetRoleOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this get role Ok response has a 3xx status code -func (o *GetRoleOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this get role Ok response has a 4xx status code -func (o *GetRoleOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this get role Ok response has a 5xx status code -func (o *GetRoleOK) IsServerError() bool { - return false -} - -// IsCode returns true when this get role Ok response a status code equal to that given -func (o *GetRoleOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the get role Ok response -func (o *GetRoleOK) Code() int { - return 200 -} - -func (o *GetRoleOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/accesscontrol/roles/{role_id}][%d] getRoleOk %s", 200, payload) -} - -func (o *GetRoleOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/accesscontrol/roles/{role_id}][%d] getRoleOk %s", 200, payload) -} - -func (o *GetRoleOK) GetPayload() *GetRoleOKBody { - return o.Payload -} - -func (o *GetRoleOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(GetRoleOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -// NewGetRoleDefault creates a GetRoleDefault with default headers values -func NewGetRoleDefault(code int) *GetRoleDefault { - return &GetRoleDefault{ - _statusCode: code, - } -} - -/* -GetRoleDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type GetRoleDefault struct { - _statusCode int - - Payload *GetRoleDefaultBody -} - -// IsSuccess returns true when this get role default response has a 2xx status code -func (o *GetRoleDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this get role default response has a 3xx status code -func (o *GetRoleDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this get role default response has a 4xx status code -func (o *GetRoleDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this get role default response has a 5xx status code -func (o *GetRoleDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this get role default response a status code equal to that given -func (o *GetRoleDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the get role default response -func (o *GetRoleDefault) Code() int { - return o._statusCode -} - -func (o *GetRoleDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/accesscontrol/roles/{role_id}][%d] GetRole default %s", o._statusCode, payload) -} - -func (o *GetRoleDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/accesscontrol/roles/{role_id}][%d] GetRole default %s", o._statusCode, payload) -} - -func (o *GetRoleDefault) GetPayload() *GetRoleDefaultBody { - return o.Payload -} - -func (o *GetRoleDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(GetRoleDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -GetRoleDefaultBody get role default body -swagger:model GetRoleDefaultBody -*/ -type GetRoleDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*GetRoleDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this get role default body -func (o *GetRoleDefaultBody) 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 *GetRoleDefaultBody) 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("GetRole default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("GetRole default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this get role default body based on the context it is used -func (o *GetRoleDefaultBody) 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 *GetRoleDefaultBody) 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("GetRole default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("GetRole default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetRoleDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetRoleDefaultBody) UnmarshalBinary(b []byte) error { - var res GetRoleDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetRoleDefaultBodyDetailsItems0 get role default body details items0 -swagger:model GetRoleDefaultBodyDetailsItems0 -*/ -type GetRoleDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` - - // get role default body details items0 - GetRoleDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *GetRoleDefaultBodyDetailsItems0) 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 GetRoleDefaultBodyDetailsItems0 - - 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.GetRoleDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o GetRoleDefaultBodyDetailsItems0) 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.GetRoleDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.GetRoleDefaultBodyDetailsItems0) - 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 get role default body details items0 -func (o *GetRoleDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get role default body details items0 based on context it is used -func (o *GetRoleDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetRoleDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetRoleDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res GetRoleDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetRoleOKBody get role OK body -swagger:model GetRoleOKBody -*/ -type GetRoleOKBody struct { - // role id - RoleID int64 `json:"role_id,omitempty"` - - // title - Title string `json:"title,omitempty"` - - // filter - Filter string `json:"filter,omitempty"` - - // description - Description string `json:"description,omitempty"` -} - -// Validate validates this get role OK body -func (o *GetRoleOKBody) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get role OK body based on context it is used -func (o *GetRoleOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetRoleOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetRoleOKBody) UnmarshalBinary(b []byte) error { - var res GetRoleOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/accesscontrol/v1beta1/json/client/access_control_service/list_roles_parameters.go b/api/accesscontrol/v1beta1/json/client/access_control_service/list_roles_parameters.go deleted file mode 100644 index 0fb513e0af3..00000000000 --- a/api/accesscontrol/v1beta1/json/client/access_control_service/list_roles_parameters.go +++ /dev/null @@ -1,127 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package access_control_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" -) - -// NewListRolesParams creates a new ListRolesParams 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 NewListRolesParams() *ListRolesParams { - return &ListRolesParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListRolesParamsWithTimeout creates a new ListRolesParams object -// with the ability to set a timeout on a request. -func NewListRolesParamsWithTimeout(timeout time.Duration) *ListRolesParams { - return &ListRolesParams{ - timeout: timeout, - } -} - -// NewListRolesParamsWithContext creates a new ListRolesParams object -// with the ability to set a context for a request. -func NewListRolesParamsWithContext(ctx context.Context) *ListRolesParams { - return &ListRolesParams{ - Context: ctx, - } -} - -// NewListRolesParamsWithHTTPClient creates a new ListRolesParams object -// with the ability to set a custom HTTPClient for a request. -func NewListRolesParamsWithHTTPClient(client *http.Client) *ListRolesParams { - return &ListRolesParams{ - HTTPClient: client, - } -} - -/* -ListRolesParams contains all the parameters to send to the API endpoint - - for the list roles operation. - - Typically these are written to a http.Request. -*/ -type ListRolesParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list roles params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListRolesParams) WithDefaults() *ListRolesParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list roles params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListRolesParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list roles params -func (o *ListRolesParams) WithTimeout(timeout time.Duration) *ListRolesParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list roles params -func (o *ListRolesParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list roles params -func (o *ListRolesParams) WithContext(ctx context.Context) *ListRolesParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list roles params -func (o *ListRolesParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list roles params -func (o *ListRolesParams) WithHTTPClient(client *http.Client) *ListRolesParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list roles params -func (o *ListRolesParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *ListRolesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/api/accesscontrol/v1beta1/json/client/access_control_service/list_roles_responses.go b/api/accesscontrol/v1beta1/json/client/access_control_service/list_roles_responses.go deleted file mode 100644 index 62d47cc68b2..00000000000 --- a/api/accesscontrol/v1beta1/json/client/access_control_service/list_roles_responses.go +++ /dev/null @@ -1,573 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package access_control_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" -) - -// ListRolesReader is a Reader for the ListRoles structure. -type ListRolesReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListRolesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewListRolesOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewListRolesDefault(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 - } -} - -// NewListRolesOK creates a ListRolesOK with default headers values -func NewListRolesOK() *ListRolesOK { - return &ListRolesOK{} -} - -/* -ListRolesOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type ListRolesOK struct { - Payload *ListRolesOKBody -} - -// IsSuccess returns true when this list roles Ok response has a 2xx status code -func (o *ListRolesOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this list roles Ok response has a 3xx status code -func (o *ListRolesOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this list roles Ok response has a 4xx status code -func (o *ListRolesOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this list roles Ok response has a 5xx status code -func (o *ListRolesOK) IsServerError() bool { - return false -} - -// IsCode returns true when this list roles Ok response a status code equal to that given -func (o *ListRolesOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the list roles Ok response -func (o *ListRolesOK) Code() int { - return 200 -} - -func (o *ListRolesOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/accesscontrol/roles][%d] listRolesOk %s", 200, payload) -} - -func (o *ListRolesOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/accesscontrol/roles][%d] listRolesOk %s", 200, payload) -} - -func (o *ListRolesOK) GetPayload() *ListRolesOKBody { - return o.Payload -} - -func (o *ListRolesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(ListRolesOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -// NewListRolesDefault creates a ListRolesDefault with default headers values -func NewListRolesDefault(code int) *ListRolesDefault { - return &ListRolesDefault{ - _statusCode: code, - } -} - -/* -ListRolesDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type ListRolesDefault struct { - _statusCode int - - Payload *ListRolesDefaultBody -} - -// IsSuccess returns true when this list roles default response has a 2xx status code -func (o *ListRolesDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this list roles default response has a 3xx status code -func (o *ListRolesDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this list roles default response has a 4xx status code -func (o *ListRolesDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this list roles default response has a 5xx status code -func (o *ListRolesDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this list roles default response a status code equal to that given -func (o *ListRolesDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the list roles default response -func (o *ListRolesDefault) Code() int { - return o._statusCode -} - -func (o *ListRolesDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/accesscontrol/roles][%d] ListRoles default %s", o._statusCode, payload) -} - -func (o *ListRolesDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/accesscontrol/roles][%d] ListRoles default %s", o._statusCode, payload) -} - -func (o *ListRolesDefault) GetPayload() *ListRolesDefaultBody { - return o.Payload -} - -func (o *ListRolesDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(ListRolesDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -ListRolesDefaultBody list roles default body -swagger:model ListRolesDefaultBody -*/ -type ListRolesDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*ListRolesDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this list roles default body -func (o *ListRolesDefaultBody) 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 *ListRolesDefaultBody) 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("ListRoles default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("ListRoles default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this list roles default body based on the context it is used -func (o *ListRolesDefaultBody) 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 *ListRolesDefaultBody) 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("ListRoles default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("ListRoles default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListRolesDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListRolesDefaultBody) UnmarshalBinary(b []byte) error { - var res ListRolesDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListRolesDefaultBodyDetailsItems0 list roles default body details items0 -swagger:model ListRolesDefaultBodyDetailsItems0 -*/ -type ListRolesDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` - - // list roles default body details items0 - ListRolesDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *ListRolesDefaultBodyDetailsItems0) 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 ListRolesDefaultBodyDetailsItems0 - - 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.ListRolesDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o ListRolesDefaultBodyDetailsItems0) 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.ListRolesDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.ListRolesDefaultBodyDetailsItems0) - 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 list roles default body details items0 -func (o *ListRolesDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list roles default body details items0 based on context it is used -func (o *ListRolesDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListRolesDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListRolesDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res ListRolesDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListRolesOKBody list roles OK body -swagger:model ListRolesOKBody -*/ -type ListRolesOKBody struct { - // roles - Roles []*ListRolesOKBodyRolesItems0 `json:"roles"` -} - -// Validate validates this list roles OK body -func (o *ListRolesOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateRoles(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListRolesOKBody) validateRoles(formats strfmt.Registry) error { - if swag.IsZero(o.Roles) { // not required - return nil - } - - for i := 0; i < len(o.Roles); i++ { - if swag.IsZero(o.Roles[i]) { // not required - continue - } - - if o.Roles[i] != nil { - if err := o.Roles[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listRolesOk" + "." + "roles" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listRolesOk" + "." + "roles" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this list roles OK body based on the context it is used -func (o *ListRolesOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateRoles(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListRolesOKBody) contextValidateRoles(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Roles); i++ { - if o.Roles[i] != nil { - - if swag.IsZero(o.Roles[i]) { // not required - return nil - } - - if err := o.Roles[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listRolesOk" + "." + "roles" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listRolesOk" + "." + "roles" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListRolesOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListRolesOKBody) UnmarshalBinary(b []byte) error { - var res ListRolesOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListRolesOKBodyRolesItems0 list roles OK body roles items0 -swagger:model ListRolesOKBodyRolesItems0 -*/ -type ListRolesOKBodyRolesItems0 struct { - // role id - RoleID int64 `json:"role_id,omitempty"` - - // title - Title string `json:"title,omitempty"` - - // filter - Filter string `json:"filter,omitempty"` - - // description - Description string `json:"description,omitempty"` -} - -// Validate validates this list roles OK body roles items0 -func (o *ListRolesOKBodyRolesItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list roles OK body roles items0 based on context it is used -func (o *ListRolesOKBodyRolesItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListRolesOKBodyRolesItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListRolesOKBodyRolesItems0) UnmarshalBinary(b []byte) error { - var res ListRolesOKBodyRolesItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/accesscontrol/v1beta1/json/client/access_control_service/set_default_role_parameters.go b/api/accesscontrol/v1beta1/json/client/access_control_service/set_default_role_parameters.go deleted file mode 100644 index 516a1543b14..00000000000 --- a/api/accesscontrol/v1beta1/json/client/access_control_service/set_default_role_parameters.go +++ /dev/null @@ -1,144 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package access_control_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" -) - -// NewSetDefaultRoleParams creates a new SetDefaultRoleParams 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 NewSetDefaultRoleParams() *SetDefaultRoleParams { - return &SetDefaultRoleParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewSetDefaultRoleParamsWithTimeout creates a new SetDefaultRoleParams object -// with the ability to set a timeout on a request. -func NewSetDefaultRoleParamsWithTimeout(timeout time.Duration) *SetDefaultRoleParams { - return &SetDefaultRoleParams{ - timeout: timeout, - } -} - -// NewSetDefaultRoleParamsWithContext creates a new SetDefaultRoleParams object -// with the ability to set a context for a request. -func NewSetDefaultRoleParamsWithContext(ctx context.Context) *SetDefaultRoleParams { - return &SetDefaultRoleParams{ - Context: ctx, - } -} - -// NewSetDefaultRoleParamsWithHTTPClient creates a new SetDefaultRoleParams object -// with the ability to set a custom HTTPClient for a request. -func NewSetDefaultRoleParamsWithHTTPClient(client *http.Client) *SetDefaultRoleParams { - return &SetDefaultRoleParams{ - HTTPClient: client, - } -} - -/* -SetDefaultRoleParams contains all the parameters to send to the API endpoint - - for the set default role operation. - - Typically these are written to a http.Request. -*/ -type SetDefaultRoleParams struct { - // Body. - Body SetDefaultRoleBody - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the set default role params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *SetDefaultRoleParams) WithDefaults() *SetDefaultRoleParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the set default role params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *SetDefaultRoleParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the set default role params -func (o *SetDefaultRoleParams) WithTimeout(timeout time.Duration) *SetDefaultRoleParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the set default role params -func (o *SetDefaultRoleParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the set default role params -func (o *SetDefaultRoleParams) WithContext(ctx context.Context) *SetDefaultRoleParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the set default role params -func (o *SetDefaultRoleParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the set default role params -func (o *SetDefaultRoleParams) WithHTTPClient(client *http.Client) *SetDefaultRoleParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the set default role params -func (o *SetDefaultRoleParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the set default role params -func (o *SetDefaultRoleParams) WithBody(body SetDefaultRoleBody) *SetDefaultRoleParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the set default role params -func (o *SetDefaultRoleParams) SetBody(body SetDefaultRoleBody) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *SetDefaultRoleParams) 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/accesscontrol/v1beta1/json/client/access_control_service/set_default_role_responses.go b/api/accesscontrol/v1beta1/json/client/access_control_service/set_default_role_responses.go deleted file mode 100644 index 101b2683e30..00000000000 --- a/api/accesscontrol/v1beta1/json/client/access_control_service/set_default_role_responses.go +++ /dev/null @@ -1,451 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package access_control_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" -) - -// SetDefaultRoleReader is a Reader for the SetDefaultRole structure. -type SetDefaultRoleReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *SetDefaultRoleReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewSetDefaultRoleOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewSetDefaultRoleDefault(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 - } -} - -// NewSetDefaultRoleOK creates a SetDefaultRoleOK with default headers values -func NewSetDefaultRoleOK() *SetDefaultRoleOK { - return &SetDefaultRoleOK{} -} - -/* -SetDefaultRoleOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type SetDefaultRoleOK struct { - Payload any -} - -// IsSuccess returns true when this set default role Ok response has a 2xx status code -func (o *SetDefaultRoleOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this set default role Ok response has a 3xx status code -func (o *SetDefaultRoleOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this set default role Ok response has a 4xx status code -func (o *SetDefaultRoleOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this set default role Ok response has a 5xx status code -func (o *SetDefaultRoleOK) IsServerError() bool { - return false -} - -// IsCode returns true when this set default role Ok response a status code equal to that given -func (o *SetDefaultRoleOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the set default role Ok response -func (o *SetDefaultRoleOK) Code() int { - return 200 -} - -func (o *SetDefaultRoleOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/accesscontrol/roles:setDefault][%d] setDefaultRoleOk %s", 200, payload) -} - -func (o *SetDefaultRoleOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/accesscontrol/roles:setDefault][%d] setDefaultRoleOk %s", 200, payload) -} - -func (o *SetDefaultRoleOK) GetPayload() any { - return o.Payload -} - -func (o *SetDefaultRoleOK) 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) { - return err - } - - return nil -} - -// NewSetDefaultRoleDefault creates a SetDefaultRoleDefault with default headers values -func NewSetDefaultRoleDefault(code int) *SetDefaultRoleDefault { - return &SetDefaultRoleDefault{ - _statusCode: code, - } -} - -/* -SetDefaultRoleDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type SetDefaultRoleDefault struct { - _statusCode int - - Payload *SetDefaultRoleDefaultBody -} - -// IsSuccess returns true when this set default role default response has a 2xx status code -func (o *SetDefaultRoleDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this set default role default response has a 3xx status code -func (o *SetDefaultRoleDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this set default role default response has a 4xx status code -func (o *SetDefaultRoleDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this set default role default response has a 5xx status code -func (o *SetDefaultRoleDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this set default role default response a status code equal to that given -func (o *SetDefaultRoleDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the set default role default response -func (o *SetDefaultRoleDefault) Code() int { - return o._statusCode -} - -func (o *SetDefaultRoleDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/accesscontrol/roles:setDefault][%d] SetDefaultRole default %s", o._statusCode, payload) -} - -func (o *SetDefaultRoleDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/accesscontrol/roles:setDefault][%d] SetDefaultRole default %s", o._statusCode, payload) -} - -func (o *SetDefaultRoleDefault) GetPayload() *SetDefaultRoleDefaultBody { - return o.Payload -} - -func (o *SetDefaultRoleDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(SetDefaultRoleDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -SetDefaultRoleBody set default role body -swagger:model SetDefaultRoleBody -*/ -type SetDefaultRoleBody struct { - // role id - RoleID int64 `json:"role_id,omitempty"` -} - -// Validate validates this set default role body -func (o *SetDefaultRoleBody) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this set default role body based on context it is used -func (o *SetDefaultRoleBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *SetDefaultRoleBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *SetDefaultRoleBody) UnmarshalBinary(b []byte) error { - var res SetDefaultRoleBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -SetDefaultRoleDefaultBody set default role default body -swagger:model SetDefaultRoleDefaultBody -*/ -type SetDefaultRoleDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*SetDefaultRoleDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this set default role default body -func (o *SetDefaultRoleDefaultBody) 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 *SetDefaultRoleDefaultBody) 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("SetDefaultRole default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("SetDefaultRole default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this set default role default body based on the context it is used -func (o *SetDefaultRoleDefaultBody) 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 *SetDefaultRoleDefaultBody) 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("SetDefaultRole default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("SetDefaultRole default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *SetDefaultRoleDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *SetDefaultRoleDefaultBody) UnmarshalBinary(b []byte) error { - var res SetDefaultRoleDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -SetDefaultRoleDefaultBodyDetailsItems0 set default role default body details items0 -swagger:model SetDefaultRoleDefaultBodyDetailsItems0 -*/ -type SetDefaultRoleDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` - - // set default role default body details items0 - SetDefaultRoleDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *SetDefaultRoleDefaultBodyDetailsItems0) 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 SetDefaultRoleDefaultBodyDetailsItems0 - - 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.SetDefaultRoleDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o SetDefaultRoleDefaultBodyDetailsItems0) 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.SetDefaultRoleDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.SetDefaultRoleDefaultBodyDetailsItems0) - 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 set default role default body details items0 -func (o *SetDefaultRoleDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this set default role default body details items0 based on context it is used -func (o *SetDefaultRoleDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *SetDefaultRoleDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *SetDefaultRoleDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res SetDefaultRoleDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/accesscontrol/v1beta1/json/client/access_control_service/update_role_parameters.go b/api/accesscontrol/v1beta1/json/client/access_control_service/update_role_parameters.go deleted file mode 100644 index c5724145e12..00000000000 --- a/api/accesscontrol/v1beta1/json/client/access_control_service/update_role_parameters.go +++ /dev/null @@ -1,166 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package access_control_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" - "github.com/go-openapi/swag" -) - -// NewUpdateRoleParams creates a new UpdateRoleParams 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 NewUpdateRoleParams() *UpdateRoleParams { - return &UpdateRoleParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewUpdateRoleParamsWithTimeout creates a new UpdateRoleParams object -// with the ability to set a timeout on a request. -func NewUpdateRoleParamsWithTimeout(timeout time.Duration) *UpdateRoleParams { - return &UpdateRoleParams{ - timeout: timeout, - } -} - -// NewUpdateRoleParamsWithContext creates a new UpdateRoleParams object -// with the ability to set a context for a request. -func NewUpdateRoleParamsWithContext(ctx context.Context) *UpdateRoleParams { - return &UpdateRoleParams{ - Context: ctx, - } -} - -// NewUpdateRoleParamsWithHTTPClient creates a new UpdateRoleParams object -// with the ability to set a custom HTTPClient for a request. -func NewUpdateRoleParamsWithHTTPClient(client *http.Client) *UpdateRoleParams { - return &UpdateRoleParams{ - HTTPClient: client, - } -} - -/* -UpdateRoleParams contains all the parameters to send to the API endpoint - - for the update role operation. - - Typically these are written to a http.Request. -*/ -type UpdateRoleParams struct { - // Body. - Body UpdateRoleBody - - // RoleID. - // - // Format: int64 - RoleID int64 - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the update role params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateRoleParams) WithDefaults() *UpdateRoleParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the update role params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateRoleParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the update role params -func (o *UpdateRoleParams) WithTimeout(timeout time.Duration) *UpdateRoleParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the update role params -func (o *UpdateRoleParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the update role params -func (o *UpdateRoleParams) WithContext(ctx context.Context) *UpdateRoleParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the update role params -func (o *UpdateRoleParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the update role params -func (o *UpdateRoleParams) WithHTTPClient(client *http.Client) *UpdateRoleParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the update role params -func (o *UpdateRoleParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the update role params -func (o *UpdateRoleParams) WithBody(body UpdateRoleBody) *UpdateRoleParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the update role params -func (o *UpdateRoleParams) SetBody(body UpdateRoleBody) { - o.Body = body -} - -// WithRoleID adds the roleID to the update role params -func (o *UpdateRoleParams) WithRoleID(roleID int64) *UpdateRoleParams { - o.SetRoleID(roleID) - return o -} - -// SetRoleID adds the roleId to the update role params -func (o *UpdateRoleParams) SetRoleID(roleID int64) { - o.RoleID = roleID -} - -// WriteToRequest writes these params to a swagger request -func (o *UpdateRoleParams) 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 - } - - // path param role_id - if err := r.SetPathParam("role_id", swag.FormatInt64(o.RoleID)); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/api/accesscontrol/v1beta1/json/client/access_control_service/update_role_responses.go b/api/accesscontrol/v1beta1/json/client/access_control_service/update_role_responses.go deleted file mode 100644 index 0fd4a4964f6..00000000000 --- a/api/accesscontrol/v1beta1/json/client/access_control_service/update_role_responses.go +++ /dev/null @@ -1,457 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package access_control_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" -) - -// UpdateRoleReader is a Reader for the UpdateRole structure. -type UpdateRoleReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *UpdateRoleReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewUpdateRoleOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewUpdateRoleDefault(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 - } -} - -// NewUpdateRoleOK creates a UpdateRoleOK with default headers values -func NewUpdateRoleOK() *UpdateRoleOK { - return &UpdateRoleOK{} -} - -/* -UpdateRoleOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type UpdateRoleOK struct { - Payload any -} - -// IsSuccess returns true when this update role Ok response has a 2xx status code -func (o *UpdateRoleOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this update role Ok response has a 3xx status code -func (o *UpdateRoleOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update role Ok response has a 4xx status code -func (o *UpdateRoleOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this update role Ok response has a 5xx status code -func (o *UpdateRoleOK) IsServerError() bool { - return false -} - -// IsCode returns true when this update role Ok response a status code equal to that given -func (o *UpdateRoleOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the update role Ok response -func (o *UpdateRoleOK) Code() int { - return 200 -} - -func (o *UpdateRoleOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/accesscontrol/roles/{role_id}][%d] updateRoleOk %s", 200, payload) -} - -func (o *UpdateRoleOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/accesscontrol/roles/{role_id}][%d] updateRoleOk %s", 200, payload) -} - -func (o *UpdateRoleOK) GetPayload() any { - return o.Payload -} - -func (o *UpdateRoleOK) 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) { - return err - } - - return nil -} - -// NewUpdateRoleDefault creates a UpdateRoleDefault with default headers values -func NewUpdateRoleDefault(code int) *UpdateRoleDefault { - return &UpdateRoleDefault{ - _statusCode: code, - } -} - -/* -UpdateRoleDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type UpdateRoleDefault struct { - _statusCode int - - Payload *UpdateRoleDefaultBody -} - -// IsSuccess returns true when this update role default response has a 2xx status code -func (o *UpdateRoleDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this update role default response has a 3xx status code -func (o *UpdateRoleDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this update role default response has a 4xx status code -func (o *UpdateRoleDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this update role default response has a 5xx status code -func (o *UpdateRoleDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this update role default response a status code equal to that given -func (o *UpdateRoleDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the update role default response -func (o *UpdateRoleDefault) Code() int { - return o._statusCode -} - -func (o *UpdateRoleDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/accesscontrol/roles/{role_id}][%d] UpdateRole default %s", o._statusCode, payload) -} - -func (o *UpdateRoleDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/accesscontrol/roles/{role_id}][%d] UpdateRole default %s", o._statusCode, payload) -} - -func (o *UpdateRoleDefault) GetPayload() *UpdateRoleDefaultBody { - return o.Payload -} - -func (o *UpdateRoleDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(UpdateRoleDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -UpdateRoleBody update role body -swagger:model UpdateRoleBody -*/ -type UpdateRoleBody struct { - // title - Title *string `json:"title,omitempty"` - - // filter - Filter *string `json:"filter,omitempty"` - - // description - Description *string `json:"description,omitempty"` -} - -// Validate validates this update role body -func (o *UpdateRoleBody) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this update role body based on context it is used -func (o *UpdateRoleBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *UpdateRoleBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *UpdateRoleBody) UnmarshalBinary(b []byte) error { - var res UpdateRoleBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -UpdateRoleDefaultBody update role default body -swagger:model UpdateRoleDefaultBody -*/ -type UpdateRoleDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*UpdateRoleDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this update role default body -func (o *UpdateRoleDefaultBody) 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 *UpdateRoleDefaultBody) 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("UpdateRole default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("UpdateRole default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this update role default body based on the context it is used -func (o *UpdateRoleDefaultBody) 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 *UpdateRoleDefaultBody) 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("UpdateRole default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("UpdateRole default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *UpdateRoleDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *UpdateRoleDefaultBody) UnmarshalBinary(b []byte) error { - var res UpdateRoleDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -UpdateRoleDefaultBodyDetailsItems0 update role default body details items0 -swagger:model UpdateRoleDefaultBodyDetailsItems0 -*/ -type UpdateRoleDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` - - // update role default body details items0 - UpdateRoleDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *UpdateRoleDefaultBodyDetailsItems0) 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 UpdateRoleDefaultBodyDetailsItems0 - - 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.UpdateRoleDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o UpdateRoleDefaultBodyDetailsItems0) 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.UpdateRoleDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.UpdateRoleDefaultBodyDetailsItems0) - 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 update role default body details items0 -func (o *UpdateRoleDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this update role default body details items0 based on context it is used -func (o *UpdateRoleDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *UpdateRoleDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *UpdateRoleDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res UpdateRoleDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/accesscontrol/v1beta1/json/client/pmm_roles_api_client.go b/api/accesscontrol/v1beta1/json/client/pmm_roles_api_client.go deleted file mode 100644 index 31277787428..00000000000 --- a/api/accesscontrol/v1beta1/json/client/pmm_roles_api_client.go +++ /dev/null @@ -1,112 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package client - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/percona/pmm/api/accesscontrol/v1beta1/json/client/access_control_service" -) - -// Default PMM roles API HTTP client. -var Default = NewHTTPClient(nil) - -const ( - // DefaultHost is the default Host - // found in Meta (info) section of spec file - DefaultHost string = "localhost" - // DefaultBasePath is the default BasePath - // found in Meta (info) section of spec file - DefaultBasePath string = "/" -) - -// DefaultSchemes are the default schemes found in Meta (info) section of spec file -var DefaultSchemes = []string{"http", "https"} - -// NewHTTPClient creates a new PMM roles API HTTP client. -func NewHTTPClient(formats strfmt.Registry) *PMMRolesAPI { - return NewHTTPClientWithConfig(formats, nil) -} - -// NewHTTPClientWithConfig creates a new PMM roles API HTTP client, -// using a customizable transport config. -func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *PMMRolesAPI { - // ensure nullable parameters have default - if cfg == nil { - cfg = DefaultTransportConfig() - } - - // create transport and client - transport := httptransport.New(cfg.Host, cfg.BasePath, cfg.Schemes) - return New(transport, formats) -} - -// New creates a new PMM roles API client -func New(transport runtime.ClientTransport, formats strfmt.Registry) *PMMRolesAPI { - // ensure nullable parameters have default - if formats == nil { - formats = strfmt.Default - } - - cli := new(PMMRolesAPI) - cli.Transport = transport - cli.AccessControlService = access_control_service.New(transport, formats) - return cli -} - -// DefaultTransportConfig creates a TransportConfig with the -// default settings taken from the meta section of the spec file. -func DefaultTransportConfig() *TransportConfig { - return &TransportConfig{ - Host: DefaultHost, - BasePath: DefaultBasePath, - Schemes: DefaultSchemes, - } -} - -// TransportConfig contains the transport related info, -// found in the meta section of the spec file. -type TransportConfig struct { - Host string - BasePath string - Schemes []string -} - -// WithHost overrides the default host, -// provided by the meta section of the spec file. -func (cfg *TransportConfig) WithHost(host string) *TransportConfig { - cfg.Host = host - return cfg -} - -// WithBasePath overrides the default basePath, -// provided by the meta section of the spec file. -func (cfg *TransportConfig) WithBasePath(basePath string) *TransportConfig { - cfg.BasePath = basePath - return cfg -} - -// WithSchemes overrides the default schemes, -// provided by the meta section of the spec file. -func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig { - cfg.Schemes = schemes - return cfg -} - -// PMMRolesAPI is a client for PMM roles API -type PMMRolesAPI struct { - AccessControlService access_control_service.ClientService - - Transport runtime.ClientTransport -} - -// SetTransport changes the transport on the client and all its subresources -func (c *PMMRolesAPI) SetTransport(transport runtime.ClientTransport) { - c.Transport = transport - c.AccessControlService.SetTransport(transport) -} diff --git a/api/accesscontrol/v1beta1/json/v1beta1.json b/api/accesscontrol/v1beta1/json/v1beta1.json deleted file mode 100644 index d257d6cdf34..00000000000 --- a/api/accesscontrol/v1beta1/json/v1beta1.json +++ /dev/null @@ -1,540 +0,0 @@ -{ - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "schemes": [ - "https", - "http" - ], - "swagger": "2.0", - "info": { - "title": "PMM Roles API", - "version": "v1beta1" - }, - "paths": { - "/v1/accesscontrol/roles": { - "get": { - "description": "Lists all roles.", - "tags": [ - "AccessControlService" - ], - "summary": "List Roles", - "operationId": "ListRoles", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "roles": { - "type": "array", - "items": { - "type": "object", - "properties": { - "role_id": { - "type": "integer", - "format": "int64", - "x-order": 0 - }, - "title": { - "type": "string", - "x-order": 1 - }, - "filter": { - "type": "string", - "x-order": 2 - }, - "description": { - "type": "string", - "x-order": 3 - } - } - }, - "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 - } - } - } - } - } - }, - "post": { - "description": "Creates a new role.", - "tags": [ - "AccessControlService" - ], - "summary": "Create a Role", - "operationId": "CreateRole", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "title": { - "type": "string", - "x-order": 0 - }, - "filter": { - "type": "string", - "x-order": 1 - }, - "description": { - "type": "string", - "x-order": 2 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "role_id": { - "type": "integer", - "format": "int64", - "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/accesscontrol/roles/{role_id}": { - "get": { - "description": "Retrieves a role by ID.", - "tags": [ - "AccessControlService" - ], - "summary": "Get a Role", - "operationId": "GetRole", - "parameters": [ - { - "type": "integer", - "format": "int64", - "name": "role_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "role_id": { - "type": "integer", - "format": "int64", - "x-order": 0 - }, - "title": { - "type": "string", - "x-order": 1 - }, - "filter": { - "type": "string", - "x-order": 2 - }, - "description": { - "type": "string", - "x-order": 3 - } - } - } - }, - "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 - } - } - } - } - } - }, - "put": { - "description": "Updates an existing role.", - "tags": [ - "AccessControlService" - ], - "summary": "Update a Role", - "operationId": "UpdateRole", - "parameters": [ - { - "type": "integer", - "format": "int64", - "name": "role_id", - "in": "path", - "required": true - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "title": { - "type": "string", - "x-nullable": true, - "x-order": 0 - }, - "filter": { - "type": "string", - "x-nullable": true, - "x-order": 1 - }, - "description": { - "type": "string", - "x-nullable": true, - "x-order": 2 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - }, - "delete": { - "description": "Deletes a role.", - "tags": [ - "AccessControlService" - ], - "summary": "Delete a Role", - "operationId": "DeleteRole", - "parameters": [ - { - "type": "integer", - "format": "int64", - "name": "role_id", - "in": "path", - "required": true - }, - { - "type": "integer", - "format": "int64", - "description": "Role ID to be used as a replacement for the role. Additional logic applies.", - "name": "replacement_role_id", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/accesscontrol/roles:assign": { - "post": { - "description": "Replaces all existing roles for a user.", - "tags": [ - "AccessControlService" - ], - "summary": "Assign Roles to a User", - "operationId": "AssignRoles", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "role_ids": { - "type": "array", - "items": { - "type": "integer", - "format": "int64" - }, - "x-order": 0 - }, - "user_id": { - "type": "integer", - "format": "int64", - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/accesscontrol/roles:setDefault": { - "post": { - "description": "Configures a default role assigned to users.", - "tags": [ - "AccessControlService" - ], - "summary": "Set a Default Role", - "operationId": "SetDefaultRole", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "role_id": { - "type": "integer", - "format": "int64", - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - } - }, - "tags": [ - { - "name": "AccessControlService" - } - ] -} \ No newline at end of file diff --git a/api/actions/v1/actions.pb.go b/api/actions/v1/actions.pb.go deleted file mode 100644 index 9e106746717..00000000000 --- a/api/actions/v1/actions.pb.go +++ /dev/null @@ -1,2744 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.10 -// protoc (unknown) -// source: actions/v1/actions.proto - -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" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// ActionType represents Action type. -type ActionType int32 - -const ( - ActionType_ACTION_TYPE_UNSPECIFIED ActionType = 0 - ActionType_ACTION_TYPE_MYSQL_EXPLAIN ActionType = 1 - ActionType_ACTION_TYPE_MYSQL_SHOW_CREATE_TABLE ActionType = 2 - ActionType_ACTION_TYPE_MYSQL_SHOW_TABLE_STATUS ActionType = 3 - ActionType_ACTION_TYPE_MYSQL_SHOW_INDEX ActionType = 4 - ActionType_ACTION_TYPE_POSTGRESQL_SHOW_CREATE_TABLE ActionType = 5 - ActionType_ACTION_TYPE_POSTGRESQL_SHOW_INDEX ActionType = 6 - ActionType_ACTION_TYPE_MONGODB_EXPLAIN ActionType = 7 - ActionType_ACTION_TYPE_PT_SUMMARY ActionType = 8 - ActionType_ACTION_TYPE_PT_MYSQL_SUMMARY ActionType = 9 - ActionType_ACTION_TYPE_PT_PG_SUMMARY ActionType = 10 - ActionType_ACTION_TYPE_PT_MONGODB_SUMMARY ActionType = 11 -) - -// Enum value maps for ActionType. -var ( - ActionType_name = map[int32]string{ - 0: "ACTION_TYPE_UNSPECIFIED", - 1: "ACTION_TYPE_MYSQL_EXPLAIN", - 2: "ACTION_TYPE_MYSQL_SHOW_CREATE_TABLE", - 3: "ACTION_TYPE_MYSQL_SHOW_TABLE_STATUS", - 4: "ACTION_TYPE_MYSQL_SHOW_INDEX", - 5: "ACTION_TYPE_POSTGRESQL_SHOW_CREATE_TABLE", - 6: "ACTION_TYPE_POSTGRESQL_SHOW_INDEX", - 7: "ACTION_TYPE_MONGODB_EXPLAIN", - 8: "ACTION_TYPE_PT_SUMMARY", - 9: "ACTION_TYPE_PT_MYSQL_SUMMARY", - 10: "ACTION_TYPE_PT_PG_SUMMARY", - 11: "ACTION_TYPE_PT_MONGODB_SUMMARY", - } - ActionType_value = map[string]int32{ - "ACTION_TYPE_UNSPECIFIED": 0, - "ACTION_TYPE_MYSQL_EXPLAIN": 1, - "ACTION_TYPE_MYSQL_SHOW_CREATE_TABLE": 2, - "ACTION_TYPE_MYSQL_SHOW_TABLE_STATUS": 3, - "ACTION_TYPE_MYSQL_SHOW_INDEX": 4, - "ACTION_TYPE_POSTGRESQL_SHOW_CREATE_TABLE": 5, - "ACTION_TYPE_POSTGRESQL_SHOW_INDEX": 6, - "ACTION_TYPE_MONGODB_EXPLAIN": 7, - "ACTION_TYPE_PT_SUMMARY": 8, - "ACTION_TYPE_PT_MYSQL_SUMMARY": 9, - "ACTION_TYPE_PT_PG_SUMMARY": 10, - "ACTION_TYPE_PT_MONGODB_SUMMARY": 11, - } -) - -func (x ActionType) Enum() *ActionType { - p := new(ActionType) - *p = x - return p -} - -func (x ActionType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (ActionType) Descriptor() protoreflect.EnumDescriptor { - return file_actions_v1_actions_proto_enumTypes[0].Descriptor() -} - -func (ActionType) Type() protoreflect.EnumType { - return &file_actions_v1_actions_proto_enumTypes[0] -} - -func (x ActionType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use ActionType.Descriptor instead. -func (ActionType) EnumDescriptor() ([]byte, []int) { - return file_actions_v1_actions_proto_rawDescGZIP(), []int{0} -} - -type GetActionRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Unique Action ID. - ActionId string `protobuf:"bytes,1,opt,name=action_id,json=actionId,proto3" json:"action_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetActionRequest) Reset() { - *x = GetActionRequest{} - mi := &file_actions_v1_actions_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetActionRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetActionRequest) ProtoMessage() {} - -func (x *GetActionRequest) ProtoReflect() protoreflect.Message { - mi := &file_actions_v1_actions_proto_msgTypes[0] - 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 GetActionRequest.ProtoReflect.Descriptor instead. -func (*GetActionRequest) Descriptor() ([]byte, []int) { - return file_actions_v1_actions_proto_rawDescGZIP(), []int{0} -} - -func (x *GetActionRequest) GetActionId() string { - if x != nil { - return x.ActionId - } - return "" -} - -type GetActionResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Unique Action ID. - ActionId string `protobuf:"bytes,1,opt,name=action_id,json=actionId,proto3" json:"action_id,omitempty"` - // pmm-agent ID where this Action is running / was run. - PmmAgentId string `protobuf:"bytes,2,opt,name=pmm_agent_id,json=pmmAgentId,proto3" json:"pmm_agent_id,omitempty"` - // Current Action output; may be partial if Action is still running. - Output string `protobuf:"bytes,3,opt,name=output,proto3" json:"output,omitempty"` - // True if Action is finished. - Done bool `protobuf:"varint,4,opt,name=done,proto3" json:"done,omitempty"` - // Error message if Action failed. - Error string `protobuf:"bytes,5,opt,name=error,proto3" json:"error,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetActionResponse) Reset() { - *x = GetActionResponse{} - mi := &file_actions_v1_actions_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetActionResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetActionResponse) ProtoMessage() {} - -func (x *GetActionResponse) ProtoReflect() protoreflect.Message { - mi := &file_actions_v1_actions_proto_msgTypes[1] - 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 GetActionResponse.ProtoReflect.Descriptor instead. -func (*GetActionResponse) Descriptor() ([]byte, []int) { - return file_actions_v1_actions_proto_rawDescGZIP(), []int{1} -} - -func (x *GetActionResponse) GetActionId() string { - if x != nil { - return x.ActionId - } - return "" -} - -func (x *GetActionResponse) GetPmmAgentId() string { - if x != nil { - return x.PmmAgentId - } - return "" -} - -func (x *GetActionResponse) GetOutput() string { - if x != nil { - return x.Output - } - return "" -} - -func (x *GetActionResponse) GetDone() bool { - if x != nil { - return x.Done - } - return false -} - -func (x *GetActionResponse) GetError() string { - if x != nil { - return x.Error - } - return "" -} - -type StartMySQLExplainActionParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - // pmm-agent ID where to run this Action. - PmmAgentId string `protobuf:"bytes,1,opt,name=pmm_agent_id,json=pmmAgentId,proto3" json:"pmm_agent_id,omitempty"` - // Service ID for this Action. Required. - ServiceId string `protobuf:"bytes,2,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` - // Query ID of query. - QueryId string `protobuf:"bytes,4,opt,name=query_id,json=queryId,proto3" json:"query_id,omitempty"` - // Array of placeholder values - Placeholders []string `protobuf:"bytes,5,rep,name=placeholders,proto3" json:"placeholders,omitempty"` - // Database name. Required if it can't be deduced from the query ID. - Database string `protobuf:"bytes,6,opt,name=database,proto3" json:"database,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StartMySQLExplainActionParams) Reset() { - *x = StartMySQLExplainActionParams{} - mi := &file_actions_v1_actions_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StartMySQLExplainActionParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StartMySQLExplainActionParams) ProtoMessage() {} - -func (x *StartMySQLExplainActionParams) ProtoReflect() protoreflect.Message { - mi := &file_actions_v1_actions_proto_msgTypes[2] - 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 StartMySQLExplainActionParams.ProtoReflect.Descriptor instead. -func (*StartMySQLExplainActionParams) Descriptor() ([]byte, []int) { - return file_actions_v1_actions_proto_rawDescGZIP(), []int{2} -} - -func (x *StartMySQLExplainActionParams) GetPmmAgentId() string { - if x != nil { - return x.PmmAgentId - } - return "" -} - -func (x *StartMySQLExplainActionParams) GetServiceId() string { - if x != nil { - return x.ServiceId - } - return "" -} - -func (x *StartMySQLExplainActionParams) GetQueryId() string { - if x != nil { - return x.QueryId - } - return "" -} - -func (x *StartMySQLExplainActionParams) GetPlaceholders() []string { - if x != nil { - return x.Placeholders - } - return nil -} - -func (x *StartMySQLExplainActionParams) GetDatabase() string { - if x != nil { - return x.Database - } - return "" -} - -type StartMySQLExplainActionResult struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Unique Action ID. - ActionId string `protobuf:"bytes,1,opt,name=action_id,json=actionId,proto3" json:"action_id,omitempty"` - // pmm-agent ID where to this Action was started. - PmmAgentId string `protobuf:"bytes,2,opt,name=pmm_agent_id,json=pmmAgentId,proto3" json:"pmm_agent_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StartMySQLExplainActionResult) Reset() { - *x = StartMySQLExplainActionResult{} - mi := &file_actions_v1_actions_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StartMySQLExplainActionResult) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StartMySQLExplainActionResult) ProtoMessage() {} - -func (x *StartMySQLExplainActionResult) ProtoReflect() protoreflect.Message { - mi := &file_actions_v1_actions_proto_msgTypes[3] - 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 StartMySQLExplainActionResult.ProtoReflect.Descriptor instead. -func (*StartMySQLExplainActionResult) Descriptor() ([]byte, []int) { - return file_actions_v1_actions_proto_rawDescGZIP(), []int{3} -} - -func (x *StartMySQLExplainActionResult) GetActionId() string { - if x != nil { - return x.ActionId - } - return "" -} - -func (x *StartMySQLExplainActionResult) GetPmmAgentId() string { - if x != nil { - return x.PmmAgentId - } - return "" -} - -type StartMySQLExplainJSONActionParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - // pmm-agent ID where to run this Action. - PmmAgentId string `protobuf:"bytes,1,opt,name=pmm_agent_id,json=pmmAgentId,proto3" json:"pmm_agent_id,omitempty"` - // Service ID for this Action. Required. - ServiceId string `protobuf:"bytes,2,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` - // Query ID of query. - QueryId string `protobuf:"bytes,4,opt,name=query_id,json=queryId,proto3" json:"query_id,omitempty"` - // Array of placeholder values - Placeholders []string `protobuf:"bytes,5,rep,name=placeholders,proto3" json:"placeholders,omitempty"` - // Database name. Required if it can't be deduced from the query ID. - Database string `protobuf:"bytes,6,opt,name=database,proto3" json:"database,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StartMySQLExplainJSONActionParams) Reset() { - *x = StartMySQLExplainJSONActionParams{} - mi := &file_actions_v1_actions_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StartMySQLExplainJSONActionParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StartMySQLExplainJSONActionParams) ProtoMessage() {} - -func (x *StartMySQLExplainJSONActionParams) ProtoReflect() protoreflect.Message { - mi := &file_actions_v1_actions_proto_msgTypes[4] - 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 StartMySQLExplainJSONActionParams.ProtoReflect.Descriptor instead. -func (*StartMySQLExplainJSONActionParams) Descriptor() ([]byte, []int) { - return file_actions_v1_actions_proto_rawDescGZIP(), []int{4} -} - -func (x *StartMySQLExplainJSONActionParams) GetPmmAgentId() string { - if x != nil { - return x.PmmAgentId - } - return "" -} - -func (x *StartMySQLExplainJSONActionParams) GetServiceId() string { - if x != nil { - return x.ServiceId - } - return "" -} - -func (x *StartMySQLExplainJSONActionParams) GetQueryId() string { - if x != nil { - return x.QueryId - } - return "" -} - -func (x *StartMySQLExplainJSONActionParams) GetPlaceholders() []string { - if x != nil { - return x.Placeholders - } - return nil -} - -func (x *StartMySQLExplainJSONActionParams) GetDatabase() string { - if x != nil { - return x.Database - } - return "" -} - -type StartMySQLExplainJSONActionResult struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Unique Action ID. - ActionId string `protobuf:"bytes,1,opt,name=action_id,json=actionId,proto3" json:"action_id,omitempty"` - // pmm-agent ID where to this Action was started. - PmmAgentId string `protobuf:"bytes,2,opt,name=pmm_agent_id,json=pmmAgentId,proto3" json:"pmm_agent_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StartMySQLExplainJSONActionResult) Reset() { - *x = StartMySQLExplainJSONActionResult{} - mi := &file_actions_v1_actions_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StartMySQLExplainJSONActionResult) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StartMySQLExplainJSONActionResult) ProtoMessage() {} - -func (x *StartMySQLExplainJSONActionResult) ProtoReflect() protoreflect.Message { - mi := &file_actions_v1_actions_proto_msgTypes[5] - 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 StartMySQLExplainJSONActionResult.ProtoReflect.Descriptor instead. -func (*StartMySQLExplainJSONActionResult) Descriptor() ([]byte, []int) { - return file_actions_v1_actions_proto_rawDescGZIP(), []int{5} -} - -func (x *StartMySQLExplainJSONActionResult) GetActionId() string { - if x != nil { - return x.ActionId - } - return "" -} - -func (x *StartMySQLExplainJSONActionResult) GetPmmAgentId() string { - if x != nil { - return x.PmmAgentId - } - return "" -} - -type StartMySQLExplainTraditionalJSONActionParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - // pmm-agent ID where to run this Action. - PmmAgentId string `protobuf:"bytes,1,opt,name=pmm_agent_id,json=pmmAgentId,proto3" json:"pmm_agent_id,omitempty"` - // Service ID for this Action. Required. - ServiceId string `protobuf:"bytes,2,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` - // Query ID of query. - QueryId string `protobuf:"bytes,4,opt,name=query_id,json=queryId,proto3" json:"query_id,omitempty"` - // Array of placeholder values - Placeholders []string `protobuf:"bytes,5,rep,name=placeholders,proto3" json:"placeholders,omitempty"` - // Database name. Required if it can't be deduced from the query ID. - Database string `protobuf:"bytes,6,opt,name=database,proto3" json:"database,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StartMySQLExplainTraditionalJSONActionParams) Reset() { - *x = StartMySQLExplainTraditionalJSONActionParams{} - mi := &file_actions_v1_actions_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StartMySQLExplainTraditionalJSONActionParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StartMySQLExplainTraditionalJSONActionParams) ProtoMessage() {} - -func (x *StartMySQLExplainTraditionalJSONActionParams) ProtoReflect() protoreflect.Message { - mi := &file_actions_v1_actions_proto_msgTypes[6] - 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 StartMySQLExplainTraditionalJSONActionParams.ProtoReflect.Descriptor instead. -func (*StartMySQLExplainTraditionalJSONActionParams) Descriptor() ([]byte, []int) { - return file_actions_v1_actions_proto_rawDescGZIP(), []int{6} -} - -func (x *StartMySQLExplainTraditionalJSONActionParams) GetPmmAgentId() string { - if x != nil { - return x.PmmAgentId - } - return "" -} - -func (x *StartMySQLExplainTraditionalJSONActionParams) GetServiceId() string { - if x != nil { - return x.ServiceId - } - return "" -} - -func (x *StartMySQLExplainTraditionalJSONActionParams) GetQueryId() string { - if x != nil { - return x.QueryId - } - return "" -} - -func (x *StartMySQLExplainTraditionalJSONActionParams) GetPlaceholders() []string { - if x != nil { - return x.Placeholders - } - return nil -} - -func (x *StartMySQLExplainTraditionalJSONActionParams) GetDatabase() string { - if x != nil { - return x.Database - } - return "" -} - -type StartMySQLExplainTraditionalJSONActionResult struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Unique Action ID. - ActionId string `protobuf:"bytes,1,opt,name=action_id,json=actionId,proto3" json:"action_id,omitempty"` - // pmm-agent ID where to this Action was started. - PmmAgentId string `protobuf:"bytes,2,opt,name=pmm_agent_id,json=pmmAgentId,proto3" json:"pmm_agent_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StartMySQLExplainTraditionalJSONActionResult) Reset() { - *x = StartMySQLExplainTraditionalJSONActionResult{} - mi := &file_actions_v1_actions_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StartMySQLExplainTraditionalJSONActionResult) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StartMySQLExplainTraditionalJSONActionResult) ProtoMessage() {} - -func (x *StartMySQLExplainTraditionalJSONActionResult) ProtoReflect() protoreflect.Message { - mi := &file_actions_v1_actions_proto_msgTypes[7] - 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 StartMySQLExplainTraditionalJSONActionResult.ProtoReflect.Descriptor instead. -func (*StartMySQLExplainTraditionalJSONActionResult) Descriptor() ([]byte, []int) { - return file_actions_v1_actions_proto_rawDescGZIP(), []int{7} -} - -func (x *StartMySQLExplainTraditionalJSONActionResult) GetActionId() string { - if x != nil { - return x.ActionId - } - return "" -} - -func (x *StartMySQLExplainTraditionalJSONActionResult) GetPmmAgentId() string { - if x != nil { - return x.PmmAgentId - } - return "" -} - -type StartMySQLShowCreateTableActionParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - // pmm-agent ID where to run this Action. - PmmAgentId string `protobuf:"bytes,1,opt,name=pmm_agent_id,json=pmmAgentId,proto3" json:"pmm_agent_id,omitempty"` - // Service ID for this Action. Required. - ServiceId string `protobuf:"bytes,2,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` - // Table name. Required. May additionally contain a database name. - TableName string `protobuf:"bytes,3,opt,name=table_name,json=tableName,proto3" json:"table_name,omitempty"` - // Database name. Required if not given in the table_name field. - Database string `protobuf:"bytes,4,opt,name=database,proto3" json:"database,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StartMySQLShowCreateTableActionParams) Reset() { - *x = StartMySQLShowCreateTableActionParams{} - mi := &file_actions_v1_actions_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StartMySQLShowCreateTableActionParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StartMySQLShowCreateTableActionParams) ProtoMessage() {} - -func (x *StartMySQLShowCreateTableActionParams) ProtoReflect() protoreflect.Message { - mi := &file_actions_v1_actions_proto_msgTypes[8] - 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 StartMySQLShowCreateTableActionParams.ProtoReflect.Descriptor instead. -func (*StartMySQLShowCreateTableActionParams) Descriptor() ([]byte, []int) { - return file_actions_v1_actions_proto_rawDescGZIP(), []int{8} -} - -func (x *StartMySQLShowCreateTableActionParams) GetPmmAgentId() string { - if x != nil { - return x.PmmAgentId - } - return "" -} - -func (x *StartMySQLShowCreateTableActionParams) GetServiceId() string { - if x != nil { - return x.ServiceId - } - return "" -} - -func (x *StartMySQLShowCreateTableActionParams) GetTableName() string { - if x != nil { - return x.TableName - } - return "" -} - -func (x *StartMySQLShowCreateTableActionParams) GetDatabase() string { - if x != nil { - return x.Database - } - return "" -} - -type StartMySQLShowCreateTableActionResult struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Unique Action ID. - ActionId string `protobuf:"bytes,1,opt,name=action_id,json=actionId,proto3" json:"action_id,omitempty"` - // pmm-agent ID where to this Action was started. - PmmAgentId string `protobuf:"bytes,2,opt,name=pmm_agent_id,json=pmmAgentId,proto3" json:"pmm_agent_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StartMySQLShowCreateTableActionResult) Reset() { - *x = StartMySQLShowCreateTableActionResult{} - mi := &file_actions_v1_actions_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StartMySQLShowCreateTableActionResult) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StartMySQLShowCreateTableActionResult) ProtoMessage() {} - -func (x *StartMySQLShowCreateTableActionResult) ProtoReflect() protoreflect.Message { - mi := &file_actions_v1_actions_proto_msgTypes[9] - 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 StartMySQLShowCreateTableActionResult.ProtoReflect.Descriptor instead. -func (*StartMySQLShowCreateTableActionResult) Descriptor() ([]byte, []int) { - return file_actions_v1_actions_proto_rawDescGZIP(), []int{9} -} - -func (x *StartMySQLShowCreateTableActionResult) GetActionId() string { - if x != nil { - return x.ActionId - } - return "" -} - -func (x *StartMySQLShowCreateTableActionResult) GetPmmAgentId() string { - if x != nil { - return x.PmmAgentId - } - return "" -} - -type StartMySQLShowTableStatusActionParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - // pmm-agent ID where to run this Action. - PmmAgentId string `protobuf:"bytes,1,opt,name=pmm_agent_id,json=pmmAgentId,proto3" json:"pmm_agent_id,omitempty"` - // Service ID for this Action. Required. - ServiceId string `protobuf:"bytes,2,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` - // Table name. Required. May additionally contain a database name. - TableName string `protobuf:"bytes,3,opt,name=table_name,json=tableName,proto3" json:"table_name,omitempty"` - // Database name. Required if not given in the table_name field. - Database string `protobuf:"bytes,4,opt,name=database,proto3" json:"database,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StartMySQLShowTableStatusActionParams) Reset() { - *x = StartMySQLShowTableStatusActionParams{} - mi := &file_actions_v1_actions_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StartMySQLShowTableStatusActionParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StartMySQLShowTableStatusActionParams) ProtoMessage() {} - -func (x *StartMySQLShowTableStatusActionParams) ProtoReflect() protoreflect.Message { - mi := &file_actions_v1_actions_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 StartMySQLShowTableStatusActionParams.ProtoReflect.Descriptor instead. -func (*StartMySQLShowTableStatusActionParams) Descriptor() ([]byte, []int) { - return file_actions_v1_actions_proto_rawDescGZIP(), []int{10} -} - -func (x *StartMySQLShowTableStatusActionParams) GetPmmAgentId() string { - if x != nil { - return x.PmmAgentId - } - return "" -} - -func (x *StartMySQLShowTableStatusActionParams) GetServiceId() string { - if x != nil { - return x.ServiceId - } - return "" -} - -func (x *StartMySQLShowTableStatusActionParams) GetTableName() string { - if x != nil { - return x.TableName - } - return "" -} - -func (x *StartMySQLShowTableStatusActionParams) GetDatabase() string { - if x != nil { - return x.Database - } - return "" -} - -type StartMySQLShowTableStatusActionResult struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Unique Action ID. - ActionId string `protobuf:"bytes,1,opt,name=action_id,json=actionId,proto3" json:"action_id,omitempty"` - // pmm-agent ID where to this Action was started. - PmmAgentId string `protobuf:"bytes,2,opt,name=pmm_agent_id,json=pmmAgentId,proto3" json:"pmm_agent_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StartMySQLShowTableStatusActionResult) Reset() { - *x = StartMySQLShowTableStatusActionResult{} - mi := &file_actions_v1_actions_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StartMySQLShowTableStatusActionResult) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StartMySQLShowTableStatusActionResult) ProtoMessage() {} - -func (x *StartMySQLShowTableStatusActionResult) ProtoReflect() protoreflect.Message { - mi := &file_actions_v1_actions_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 StartMySQLShowTableStatusActionResult.ProtoReflect.Descriptor instead. -func (*StartMySQLShowTableStatusActionResult) Descriptor() ([]byte, []int) { - return file_actions_v1_actions_proto_rawDescGZIP(), []int{11} -} - -func (x *StartMySQLShowTableStatusActionResult) GetActionId() string { - if x != nil { - return x.ActionId - } - return "" -} - -func (x *StartMySQLShowTableStatusActionResult) GetPmmAgentId() string { - if x != nil { - return x.PmmAgentId - } - return "" -} - -type StartMySQLShowIndexActionParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - // pmm-agent ID where to run this Action. - PmmAgentId string `protobuf:"bytes,1,opt,name=pmm_agent_id,json=pmmAgentId,proto3" json:"pmm_agent_id,omitempty"` - // Service ID for this Action. Required. - ServiceId string `protobuf:"bytes,2,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` - // Table name. Required. May additionally contain a database name. - TableName string `protobuf:"bytes,3,opt,name=table_name,json=tableName,proto3" json:"table_name,omitempty"` - // Database name. Required if not given in the table_name field. - Database string `protobuf:"bytes,4,opt,name=database,proto3" json:"database,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StartMySQLShowIndexActionParams) Reset() { - *x = StartMySQLShowIndexActionParams{} - mi := &file_actions_v1_actions_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StartMySQLShowIndexActionParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StartMySQLShowIndexActionParams) ProtoMessage() {} - -func (x *StartMySQLShowIndexActionParams) ProtoReflect() protoreflect.Message { - mi := &file_actions_v1_actions_proto_msgTypes[12] - 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 StartMySQLShowIndexActionParams.ProtoReflect.Descriptor instead. -func (*StartMySQLShowIndexActionParams) Descriptor() ([]byte, []int) { - return file_actions_v1_actions_proto_rawDescGZIP(), []int{12} -} - -func (x *StartMySQLShowIndexActionParams) GetPmmAgentId() string { - if x != nil { - return x.PmmAgentId - } - return "" -} - -func (x *StartMySQLShowIndexActionParams) GetServiceId() string { - if x != nil { - return x.ServiceId - } - return "" -} - -func (x *StartMySQLShowIndexActionParams) GetTableName() string { - if x != nil { - return x.TableName - } - return "" -} - -func (x *StartMySQLShowIndexActionParams) GetDatabase() string { - if x != nil { - return x.Database - } - return "" -} - -type StartMySQLShowIndexActionResult struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Unique Action ID. - ActionId string `protobuf:"bytes,1,opt,name=action_id,json=actionId,proto3" json:"action_id,omitempty"` - // pmm-agent ID where to this Action was started. - PmmAgentId string `protobuf:"bytes,2,opt,name=pmm_agent_id,json=pmmAgentId,proto3" json:"pmm_agent_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StartMySQLShowIndexActionResult) Reset() { - *x = StartMySQLShowIndexActionResult{} - mi := &file_actions_v1_actions_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StartMySQLShowIndexActionResult) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StartMySQLShowIndexActionResult) ProtoMessage() {} - -func (x *StartMySQLShowIndexActionResult) ProtoReflect() protoreflect.Message { - mi := &file_actions_v1_actions_proto_msgTypes[13] - 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 StartMySQLShowIndexActionResult.ProtoReflect.Descriptor instead. -func (*StartMySQLShowIndexActionResult) Descriptor() ([]byte, []int) { - return file_actions_v1_actions_proto_rawDescGZIP(), []int{13} -} - -func (x *StartMySQLShowIndexActionResult) GetActionId() string { - if x != nil { - return x.ActionId - } - return "" -} - -func (x *StartMySQLShowIndexActionResult) GetPmmAgentId() string { - if x != nil { - return x.PmmAgentId - } - return "" -} - -type StartPostgreSQLShowCreateTableActionParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - // pmm-agent ID where to run this Action. - PmmAgentId string `protobuf:"bytes,1,opt,name=pmm_agent_id,json=pmmAgentId,proto3" json:"pmm_agent_id,omitempty"` - // Service ID for this Action. Required. - ServiceId string `protobuf:"bytes,2,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` - // Table name. Required. May additionally contain a database name. - TableName string `protobuf:"bytes,3,opt,name=table_name,json=tableName,proto3" json:"table_name,omitempty"` - // Database name. Required if not given in the table_name field. - Database string `protobuf:"bytes,4,opt,name=database,proto3" json:"database,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StartPostgreSQLShowCreateTableActionParams) Reset() { - *x = StartPostgreSQLShowCreateTableActionParams{} - mi := &file_actions_v1_actions_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StartPostgreSQLShowCreateTableActionParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StartPostgreSQLShowCreateTableActionParams) ProtoMessage() {} - -func (x *StartPostgreSQLShowCreateTableActionParams) ProtoReflect() protoreflect.Message { - mi := &file_actions_v1_actions_proto_msgTypes[14] - 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 StartPostgreSQLShowCreateTableActionParams.ProtoReflect.Descriptor instead. -func (*StartPostgreSQLShowCreateTableActionParams) Descriptor() ([]byte, []int) { - return file_actions_v1_actions_proto_rawDescGZIP(), []int{14} -} - -func (x *StartPostgreSQLShowCreateTableActionParams) GetPmmAgentId() string { - if x != nil { - return x.PmmAgentId - } - return "" -} - -func (x *StartPostgreSQLShowCreateTableActionParams) GetServiceId() string { - if x != nil { - return x.ServiceId - } - return "" -} - -func (x *StartPostgreSQLShowCreateTableActionParams) GetTableName() string { - if x != nil { - return x.TableName - } - return "" -} - -func (x *StartPostgreSQLShowCreateTableActionParams) GetDatabase() string { - if x != nil { - return x.Database - } - return "" -} - -type StartPostgreSQLShowCreateTableActionResult struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Unique Action ID. - ActionId string `protobuf:"bytes,1,opt,name=action_id,json=actionId,proto3" json:"action_id,omitempty"` - // pmm-agent ID where to this Action was started. - PmmAgentId string `protobuf:"bytes,2,opt,name=pmm_agent_id,json=pmmAgentId,proto3" json:"pmm_agent_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StartPostgreSQLShowCreateTableActionResult) Reset() { - *x = StartPostgreSQLShowCreateTableActionResult{} - mi := &file_actions_v1_actions_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StartPostgreSQLShowCreateTableActionResult) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StartPostgreSQLShowCreateTableActionResult) ProtoMessage() {} - -func (x *StartPostgreSQLShowCreateTableActionResult) ProtoReflect() protoreflect.Message { - mi := &file_actions_v1_actions_proto_msgTypes[15] - 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 StartPostgreSQLShowCreateTableActionResult.ProtoReflect.Descriptor instead. -func (*StartPostgreSQLShowCreateTableActionResult) Descriptor() ([]byte, []int) { - return file_actions_v1_actions_proto_rawDescGZIP(), []int{15} -} - -func (x *StartPostgreSQLShowCreateTableActionResult) GetActionId() string { - if x != nil { - return x.ActionId - } - return "" -} - -func (x *StartPostgreSQLShowCreateTableActionResult) GetPmmAgentId() string { - if x != nil { - return x.PmmAgentId - } - return "" -} - -type StartPostgreSQLShowIndexActionParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - // pmm-agent ID where to run this Action. - PmmAgentId string `protobuf:"bytes,1,opt,name=pmm_agent_id,json=pmmAgentId,proto3" json:"pmm_agent_id,omitempty"` - // Service ID for this Action. Required. - ServiceId string `protobuf:"bytes,2,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` - // Table name. Required. May additionally contain a database name. - TableName string `protobuf:"bytes,3,opt,name=table_name,json=tableName,proto3" json:"table_name,omitempty"` - // Database name. Required if not given in the table_name field. - Database string `protobuf:"bytes,4,opt,name=database,proto3" json:"database,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StartPostgreSQLShowIndexActionParams) Reset() { - *x = StartPostgreSQLShowIndexActionParams{} - mi := &file_actions_v1_actions_proto_msgTypes[16] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StartPostgreSQLShowIndexActionParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StartPostgreSQLShowIndexActionParams) ProtoMessage() {} - -func (x *StartPostgreSQLShowIndexActionParams) ProtoReflect() protoreflect.Message { - mi := &file_actions_v1_actions_proto_msgTypes[16] - 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 StartPostgreSQLShowIndexActionParams.ProtoReflect.Descriptor instead. -func (*StartPostgreSQLShowIndexActionParams) Descriptor() ([]byte, []int) { - return file_actions_v1_actions_proto_rawDescGZIP(), []int{16} -} - -func (x *StartPostgreSQLShowIndexActionParams) GetPmmAgentId() string { - if x != nil { - return x.PmmAgentId - } - return "" -} - -func (x *StartPostgreSQLShowIndexActionParams) GetServiceId() string { - if x != nil { - return x.ServiceId - } - return "" -} - -func (x *StartPostgreSQLShowIndexActionParams) GetTableName() string { - if x != nil { - return x.TableName - } - return "" -} - -func (x *StartPostgreSQLShowIndexActionParams) GetDatabase() string { - if x != nil { - return x.Database - } - return "" -} - -type StartPostgreSQLShowIndexActionResult struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Unique Action ID. - ActionId string `protobuf:"bytes,1,opt,name=action_id,json=actionId,proto3" json:"action_id,omitempty"` - // pmm-agent ID where to this Action was started. - PmmAgentId string `protobuf:"bytes,2,opt,name=pmm_agent_id,json=pmmAgentId,proto3" json:"pmm_agent_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StartPostgreSQLShowIndexActionResult) Reset() { - *x = StartPostgreSQLShowIndexActionResult{} - mi := &file_actions_v1_actions_proto_msgTypes[17] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StartPostgreSQLShowIndexActionResult) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StartPostgreSQLShowIndexActionResult) ProtoMessage() {} - -func (x *StartPostgreSQLShowIndexActionResult) ProtoReflect() protoreflect.Message { - mi := &file_actions_v1_actions_proto_msgTypes[17] - 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 StartPostgreSQLShowIndexActionResult.ProtoReflect.Descriptor instead. -func (*StartPostgreSQLShowIndexActionResult) Descriptor() ([]byte, []int) { - return file_actions_v1_actions_proto_rawDescGZIP(), []int{17} -} - -func (x *StartPostgreSQLShowIndexActionResult) GetActionId() string { - if x != nil { - return x.ActionId - } - return "" -} - -func (x *StartPostgreSQLShowIndexActionResult) GetPmmAgentId() string { - if x != nil { - return x.PmmAgentId - } - return "" -} - -type StartMongoDBExplainActionParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - // pmm-agent ID where to run this Action. - PmmAgentId string `protobuf:"bytes,1,opt,name=pmm_agent_id,json=pmmAgentId,proto3" json:"pmm_agent_id,omitempty"` - // Service ID for this Action. Required. - ServiceId string `protobuf:"bytes,2,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` - // Query. Required. - Query string `protobuf:"bytes,3,opt,name=query,proto3" json:"query,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StartMongoDBExplainActionParams) Reset() { - *x = StartMongoDBExplainActionParams{} - mi := &file_actions_v1_actions_proto_msgTypes[18] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StartMongoDBExplainActionParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StartMongoDBExplainActionParams) ProtoMessage() {} - -func (x *StartMongoDBExplainActionParams) ProtoReflect() protoreflect.Message { - mi := &file_actions_v1_actions_proto_msgTypes[18] - 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 StartMongoDBExplainActionParams.ProtoReflect.Descriptor instead. -func (*StartMongoDBExplainActionParams) Descriptor() ([]byte, []int) { - return file_actions_v1_actions_proto_rawDescGZIP(), []int{18} -} - -func (x *StartMongoDBExplainActionParams) GetPmmAgentId() string { - if x != nil { - return x.PmmAgentId - } - return "" -} - -func (x *StartMongoDBExplainActionParams) GetServiceId() string { - if x != nil { - return x.ServiceId - } - return "" -} - -func (x *StartMongoDBExplainActionParams) GetQuery() string { - if x != nil { - return x.Query - } - return "" -} - -type StartMongoDBExplainActionResult struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Unique Action ID. - ActionId string `protobuf:"bytes,1,opt,name=action_id,json=actionId,proto3" json:"action_id,omitempty"` - // pmm-agent ID where to this Action was started. - PmmAgentId string `protobuf:"bytes,2,opt,name=pmm_agent_id,json=pmmAgentId,proto3" json:"pmm_agent_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StartMongoDBExplainActionResult) Reset() { - *x = StartMongoDBExplainActionResult{} - mi := &file_actions_v1_actions_proto_msgTypes[19] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StartMongoDBExplainActionResult) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StartMongoDBExplainActionResult) ProtoMessage() {} - -func (x *StartMongoDBExplainActionResult) ProtoReflect() protoreflect.Message { - mi := &file_actions_v1_actions_proto_msgTypes[19] - 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 StartMongoDBExplainActionResult.ProtoReflect.Descriptor instead. -func (*StartMongoDBExplainActionResult) Descriptor() ([]byte, []int) { - return file_actions_v1_actions_proto_rawDescGZIP(), []int{19} -} - -func (x *StartMongoDBExplainActionResult) GetActionId() string { - if x != nil { - return x.ActionId - } - return "" -} - -func (x *StartMongoDBExplainActionResult) GetPmmAgentId() string { - if x != nil { - return x.PmmAgentId - } - return "" -} - -// Message to prepare pt-pg-summary data -type StartPTPgSummaryActionParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - // pmm-agent ID where to run this Action. - PmmAgentId string `protobuf:"bytes,1,opt,name=pmm_agent_id,json=pmmAgentId,proto3" json:"pmm_agent_id,omitempty"` - // Service ID for this Action. - ServiceId string `protobuf:"bytes,2,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StartPTPgSummaryActionParams) Reset() { - *x = StartPTPgSummaryActionParams{} - mi := &file_actions_v1_actions_proto_msgTypes[20] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StartPTPgSummaryActionParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StartPTPgSummaryActionParams) ProtoMessage() {} - -func (x *StartPTPgSummaryActionParams) ProtoReflect() protoreflect.Message { - mi := &file_actions_v1_actions_proto_msgTypes[20] - 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 StartPTPgSummaryActionParams.ProtoReflect.Descriptor instead. -func (*StartPTPgSummaryActionParams) Descriptor() ([]byte, []int) { - return file_actions_v1_actions_proto_rawDescGZIP(), []int{20} -} - -func (x *StartPTPgSummaryActionParams) GetPmmAgentId() string { - if x != nil { - return x.PmmAgentId - } - return "" -} - -func (x *StartPTPgSummaryActionParams) GetServiceId() string { - if x != nil { - return x.ServiceId - } - return "" -} - -// Message to retrieve the prepared pt-pg-summary data -type StartPTPgSummaryActionResult struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Unique Action ID. - ActionId string `protobuf:"bytes,1,opt,name=action_id,json=actionId,proto3" json:"action_id,omitempty"` - // pmm-agent ID where to this Action was started. - PmmAgentId string `protobuf:"bytes,2,opt,name=pmm_agent_id,json=pmmAgentId,proto3" json:"pmm_agent_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StartPTPgSummaryActionResult) Reset() { - *x = StartPTPgSummaryActionResult{} - mi := &file_actions_v1_actions_proto_msgTypes[21] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StartPTPgSummaryActionResult) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StartPTPgSummaryActionResult) ProtoMessage() {} - -func (x *StartPTPgSummaryActionResult) ProtoReflect() protoreflect.Message { - mi := &file_actions_v1_actions_proto_msgTypes[21] - 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 StartPTPgSummaryActionResult.ProtoReflect.Descriptor instead. -func (*StartPTPgSummaryActionResult) Descriptor() ([]byte, []int) { - return file_actions_v1_actions_proto_rawDescGZIP(), []int{21} -} - -func (x *StartPTPgSummaryActionResult) GetActionId() string { - if x != nil { - return x.ActionId - } - return "" -} - -func (x *StartPTPgSummaryActionResult) GetPmmAgentId() string { - if x != nil { - return x.PmmAgentId - } - return "" -} - -// Message to prepare pt-mongodb-summary data -type StartPTMongoDBSummaryActionParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - // pmm-agent ID where to run this Action. - PmmAgentId string `protobuf:"bytes,1,opt,name=pmm_agent_id,json=pmmAgentId,proto3" json:"pmm_agent_id,omitempty"` - // Service ID for this Action. - ServiceId string `protobuf:"bytes,2,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StartPTMongoDBSummaryActionParams) Reset() { - *x = StartPTMongoDBSummaryActionParams{} - mi := &file_actions_v1_actions_proto_msgTypes[22] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StartPTMongoDBSummaryActionParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StartPTMongoDBSummaryActionParams) ProtoMessage() {} - -func (x *StartPTMongoDBSummaryActionParams) ProtoReflect() protoreflect.Message { - mi := &file_actions_v1_actions_proto_msgTypes[22] - 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 StartPTMongoDBSummaryActionParams.ProtoReflect.Descriptor instead. -func (*StartPTMongoDBSummaryActionParams) Descriptor() ([]byte, []int) { - return file_actions_v1_actions_proto_rawDescGZIP(), []int{22} -} - -func (x *StartPTMongoDBSummaryActionParams) GetPmmAgentId() string { - if x != nil { - return x.PmmAgentId - } - return "" -} - -func (x *StartPTMongoDBSummaryActionParams) GetServiceId() string { - if x != nil { - return x.ServiceId - } - return "" -} - -// Message to retrieve the prepared pt-mongodb-summary data -type StartPTMongoDBSummaryActionResult struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Unique Action ID. - ActionId string `protobuf:"bytes,1,opt,name=action_id,json=actionId,proto3" json:"action_id,omitempty"` - // pmm-agent ID where to this Action was started. - PmmAgentId string `protobuf:"bytes,2,opt,name=pmm_agent_id,json=pmmAgentId,proto3" json:"pmm_agent_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StartPTMongoDBSummaryActionResult) Reset() { - *x = StartPTMongoDBSummaryActionResult{} - mi := &file_actions_v1_actions_proto_msgTypes[23] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StartPTMongoDBSummaryActionResult) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StartPTMongoDBSummaryActionResult) ProtoMessage() {} - -func (x *StartPTMongoDBSummaryActionResult) ProtoReflect() protoreflect.Message { - mi := &file_actions_v1_actions_proto_msgTypes[23] - 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 StartPTMongoDBSummaryActionResult.ProtoReflect.Descriptor instead. -func (*StartPTMongoDBSummaryActionResult) Descriptor() ([]byte, []int) { - return file_actions_v1_actions_proto_rawDescGZIP(), []int{23} -} - -func (x *StartPTMongoDBSummaryActionResult) GetActionId() string { - if x != nil { - return x.ActionId - } - return "" -} - -func (x *StartPTMongoDBSummaryActionResult) GetPmmAgentId() string { - if x != nil { - return x.PmmAgentId - } - return "" -} - -// Message to prepare pt-mysql-summary data -type StartPTMySQLSummaryActionParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - // pmm-agent ID where to run this Action. - PmmAgentId string `protobuf:"bytes,1,opt,name=pmm_agent_id,json=pmmAgentId,proto3" json:"pmm_agent_id,omitempty"` - // Service ID for this Action. - ServiceId string `protobuf:"bytes,2,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StartPTMySQLSummaryActionParams) Reset() { - *x = StartPTMySQLSummaryActionParams{} - mi := &file_actions_v1_actions_proto_msgTypes[24] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StartPTMySQLSummaryActionParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StartPTMySQLSummaryActionParams) ProtoMessage() {} - -func (x *StartPTMySQLSummaryActionParams) ProtoReflect() protoreflect.Message { - mi := &file_actions_v1_actions_proto_msgTypes[24] - 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 StartPTMySQLSummaryActionParams.ProtoReflect.Descriptor instead. -func (*StartPTMySQLSummaryActionParams) Descriptor() ([]byte, []int) { - return file_actions_v1_actions_proto_rawDescGZIP(), []int{24} -} - -func (x *StartPTMySQLSummaryActionParams) GetPmmAgentId() string { - if x != nil { - return x.PmmAgentId - } - return "" -} - -func (x *StartPTMySQLSummaryActionParams) GetServiceId() string { - if x != nil { - return x.ServiceId - } - return "" -} - -// Message to retrieve the prepared pt-mysql-summary data -type StartPTMySQLSummaryActionResult struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Unique Action ID. - ActionId string `protobuf:"bytes,1,opt,name=action_id,json=actionId,proto3" json:"action_id,omitempty"` - // pmm-agent ID where to this Action was started. - PmmAgentId string `protobuf:"bytes,2,opt,name=pmm_agent_id,json=pmmAgentId,proto3" json:"pmm_agent_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StartPTMySQLSummaryActionResult) Reset() { - *x = StartPTMySQLSummaryActionResult{} - mi := &file_actions_v1_actions_proto_msgTypes[25] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StartPTMySQLSummaryActionResult) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StartPTMySQLSummaryActionResult) ProtoMessage() {} - -func (x *StartPTMySQLSummaryActionResult) ProtoReflect() protoreflect.Message { - mi := &file_actions_v1_actions_proto_msgTypes[25] - 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 StartPTMySQLSummaryActionResult.ProtoReflect.Descriptor instead. -func (*StartPTMySQLSummaryActionResult) Descriptor() ([]byte, []int) { - return file_actions_v1_actions_proto_rawDescGZIP(), []int{25} -} - -func (x *StartPTMySQLSummaryActionResult) GetActionId() string { - if x != nil { - return x.ActionId - } - return "" -} - -func (x *StartPTMySQLSummaryActionResult) GetPmmAgentId() string { - if x != nil { - return x.PmmAgentId - } - return "" -} - -type StartPTSummaryActionRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // pmm-agent ID where to run this Action. - PmmAgentId string `protobuf:"bytes,1,opt,name=pmm_agent_id,json=pmmAgentId,proto3" json:"pmm_agent_id,omitempty"` - // Node ID for this Action. - NodeId string `protobuf:"bytes,2,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StartPTSummaryActionRequest) Reset() { - *x = StartPTSummaryActionRequest{} - mi := &file_actions_v1_actions_proto_msgTypes[26] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StartPTSummaryActionRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StartPTSummaryActionRequest) ProtoMessage() {} - -func (x *StartPTSummaryActionRequest) ProtoReflect() protoreflect.Message { - mi := &file_actions_v1_actions_proto_msgTypes[26] - 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 StartPTSummaryActionRequest.ProtoReflect.Descriptor instead. -func (*StartPTSummaryActionRequest) Descriptor() ([]byte, []int) { - return file_actions_v1_actions_proto_rawDescGZIP(), []int{26} -} - -func (x *StartPTSummaryActionRequest) GetPmmAgentId() string { - if x != nil { - return x.PmmAgentId - } - return "" -} - -func (x *StartPTSummaryActionRequest) GetNodeId() string { - if x != nil { - return x.NodeId - } - return "" -} - -type StartPTSummaryActionResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Unique Action ID. - ActionId string `protobuf:"bytes,1,opt,name=action_id,json=actionId,proto3" json:"action_id,omitempty"` - // pmm-agent ID where to this Action was started. - PmmAgentId string `protobuf:"bytes,2,opt,name=pmm_agent_id,json=pmmAgentId,proto3" json:"pmm_agent_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StartPTSummaryActionResponse) Reset() { - *x = StartPTSummaryActionResponse{} - mi := &file_actions_v1_actions_proto_msgTypes[27] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StartPTSummaryActionResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StartPTSummaryActionResponse) ProtoMessage() {} - -func (x *StartPTSummaryActionResponse) ProtoReflect() protoreflect.Message { - mi := &file_actions_v1_actions_proto_msgTypes[27] - 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 StartPTSummaryActionResponse.ProtoReflect.Descriptor instead. -func (*StartPTSummaryActionResponse) Descriptor() ([]byte, []int) { - return file_actions_v1_actions_proto_rawDescGZIP(), []int{27} -} - -func (x *StartPTSummaryActionResponse) GetActionId() string { - if x != nil { - return x.ActionId - } - return "" -} - -func (x *StartPTSummaryActionResponse) GetPmmAgentId() string { - if x != nil { - return x.PmmAgentId - } - return "" -} - -type CancelActionRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Unique Action ID. Required. - ActionId string `protobuf:"bytes,1,opt,name=action_id,json=actionId,proto3" json:"action_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CancelActionRequest) Reset() { - *x = CancelActionRequest{} - mi := &file_actions_v1_actions_proto_msgTypes[28] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CancelActionRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CancelActionRequest) ProtoMessage() {} - -func (x *CancelActionRequest) ProtoReflect() protoreflect.Message { - mi := &file_actions_v1_actions_proto_msgTypes[28] - 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 CancelActionRequest.ProtoReflect.Descriptor instead. -func (*CancelActionRequest) Descriptor() ([]byte, []int) { - return file_actions_v1_actions_proto_rawDescGZIP(), []int{28} -} - -func (x *CancelActionRequest) GetActionId() string { - if x != nil { - return x.ActionId - } - return "" -} - -type CancelActionResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CancelActionResponse) Reset() { - *x = CancelActionResponse{} - mi := &file_actions_v1_actions_proto_msgTypes[29] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CancelActionResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CancelActionResponse) ProtoMessage() {} - -func (x *CancelActionResponse) ProtoReflect() protoreflect.Message { - mi := &file_actions_v1_actions_proto_msgTypes[29] - 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 CancelActionResponse.ProtoReflect.Descriptor instead. -func (*CancelActionResponse) Descriptor() ([]byte, []int) { - return file_actions_v1_actions_proto_rawDescGZIP(), []int{29} -} - -type StartServiceActionRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Action: - // - // *StartServiceActionRequest_MysqlExplain - // *StartServiceActionRequest_MysqlExplainJson - // *StartServiceActionRequest_MysqlExplainTraditionalJson - // *StartServiceActionRequest_MysqlShowIndex - // *StartServiceActionRequest_MysqlShowCreateTable - // *StartServiceActionRequest_MysqlShowTableStatus - // *StartServiceActionRequest_PostgresShowCreateTable - // *StartServiceActionRequest_PostgresShowIndex - // *StartServiceActionRequest_MongodbExplain - // *StartServiceActionRequest_PtMongodbSummary - // *StartServiceActionRequest_PtMysqlSummary - // *StartServiceActionRequest_PtPostgresSummary - Action isStartServiceActionRequest_Action `protobuf_oneof:"action"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StartServiceActionRequest) Reset() { - *x = StartServiceActionRequest{} - mi := &file_actions_v1_actions_proto_msgTypes[30] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StartServiceActionRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StartServiceActionRequest) ProtoMessage() {} - -func (x *StartServiceActionRequest) ProtoReflect() protoreflect.Message { - mi := &file_actions_v1_actions_proto_msgTypes[30] - 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 StartServiceActionRequest.ProtoReflect.Descriptor instead. -func (*StartServiceActionRequest) Descriptor() ([]byte, []int) { - return file_actions_v1_actions_proto_rawDescGZIP(), []int{30} -} - -func (x *StartServiceActionRequest) GetAction() isStartServiceActionRequest_Action { - if x != nil { - return x.Action - } - return nil -} - -func (x *StartServiceActionRequest) GetMysqlExplain() *StartMySQLExplainActionParams { - if x != nil { - if x, ok := x.Action.(*StartServiceActionRequest_MysqlExplain); ok { - return x.MysqlExplain - } - } - return nil -} - -func (x *StartServiceActionRequest) GetMysqlExplainJson() *StartMySQLExplainJSONActionParams { - if x != nil { - if x, ok := x.Action.(*StartServiceActionRequest_MysqlExplainJson); ok { - return x.MysqlExplainJson - } - } - return nil -} - -func (x *StartServiceActionRequest) GetMysqlExplainTraditionalJson() *StartMySQLExplainTraditionalJSONActionParams { - if x != nil { - if x, ok := x.Action.(*StartServiceActionRequest_MysqlExplainTraditionalJson); ok { - return x.MysqlExplainTraditionalJson - } - } - return nil -} - -func (x *StartServiceActionRequest) GetMysqlShowIndex() *StartMySQLShowIndexActionParams { - if x != nil { - if x, ok := x.Action.(*StartServiceActionRequest_MysqlShowIndex); ok { - return x.MysqlShowIndex - } - } - return nil -} - -func (x *StartServiceActionRequest) GetMysqlShowCreateTable() *StartMySQLShowCreateTableActionParams { - if x != nil { - if x, ok := x.Action.(*StartServiceActionRequest_MysqlShowCreateTable); ok { - return x.MysqlShowCreateTable - } - } - return nil -} - -func (x *StartServiceActionRequest) GetMysqlShowTableStatus() *StartMySQLShowTableStatusActionParams { - if x != nil { - if x, ok := x.Action.(*StartServiceActionRequest_MysqlShowTableStatus); ok { - return x.MysqlShowTableStatus - } - } - return nil -} - -func (x *StartServiceActionRequest) GetPostgresShowCreateTable() *StartPostgreSQLShowCreateTableActionParams { - if x != nil { - if x, ok := x.Action.(*StartServiceActionRequest_PostgresShowCreateTable); ok { - return x.PostgresShowCreateTable - } - } - return nil -} - -func (x *StartServiceActionRequest) GetPostgresShowIndex() *StartPostgreSQLShowIndexActionParams { - if x != nil { - if x, ok := x.Action.(*StartServiceActionRequest_PostgresShowIndex); ok { - return x.PostgresShowIndex - } - } - return nil -} - -func (x *StartServiceActionRequest) GetMongodbExplain() *StartMongoDBExplainActionParams { - if x != nil { - if x, ok := x.Action.(*StartServiceActionRequest_MongodbExplain); ok { - return x.MongodbExplain - } - } - return nil -} - -func (x *StartServiceActionRequest) GetPtMongodbSummary() *StartPTMongoDBSummaryActionParams { - if x != nil { - if x, ok := x.Action.(*StartServiceActionRequest_PtMongodbSummary); ok { - return x.PtMongodbSummary - } - } - return nil -} - -func (x *StartServiceActionRequest) GetPtMysqlSummary() *StartPTMySQLSummaryActionParams { - if x != nil { - if x, ok := x.Action.(*StartServiceActionRequest_PtMysqlSummary); ok { - return x.PtMysqlSummary - } - } - return nil -} - -func (x *StartServiceActionRequest) GetPtPostgresSummary() *StartPTPgSummaryActionParams { - if x != nil { - if x, ok := x.Action.(*StartServiceActionRequest_PtPostgresSummary); ok { - return x.PtPostgresSummary - } - } - return nil -} - -type isStartServiceActionRequest_Action interface { - isStartServiceActionRequest_Action() -} - -type StartServiceActionRequest_MysqlExplain struct { - MysqlExplain *StartMySQLExplainActionParams `protobuf:"bytes,1,opt,name=mysql_explain,json=mysqlExplain,proto3,oneof"` -} - -type StartServiceActionRequest_MysqlExplainJson struct { - MysqlExplainJson *StartMySQLExplainJSONActionParams `protobuf:"bytes,2,opt,name=mysql_explain_json,json=mysqlExplainJson,proto3,oneof"` -} - -type StartServiceActionRequest_MysqlExplainTraditionalJson struct { - MysqlExplainTraditionalJson *StartMySQLExplainTraditionalJSONActionParams `protobuf:"bytes,3,opt,name=mysql_explain_traditional_json,json=mysqlExplainTraditionalJson,proto3,oneof"` -} - -type StartServiceActionRequest_MysqlShowIndex struct { - MysqlShowIndex *StartMySQLShowIndexActionParams `protobuf:"bytes,4,opt,name=mysql_show_index,json=mysqlShowIndex,proto3,oneof"` -} - -type StartServiceActionRequest_MysqlShowCreateTable struct { - MysqlShowCreateTable *StartMySQLShowCreateTableActionParams `protobuf:"bytes,5,opt,name=mysql_show_create_table,json=mysqlShowCreateTable,proto3,oneof"` -} - -type StartServiceActionRequest_MysqlShowTableStatus struct { - MysqlShowTableStatus *StartMySQLShowTableStatusActionParams `protobuf:"bytes,6,opt,name=mysql_show_table_status,json=mysqlShowTableStatus,proto3,oneof"` -} - -type StartServiceActionRequest_PostgresShowCreateTable struct { - PostgresShowCreateTable *StartPostgreSQLShowCreateTableActionParams `protobuf:"bytes,7,opt,name=postgres_show_create_table,json=postgresShowCreateTable,proto3,oneof"` -} - -type StartServiceActionRequest_PostgresShowIndex struct { - PostgresShowIndex *StartPostgreSQLShowIndexActionParams `protobuf:"bytes,8,opt,name=postgres_show_index,json=postgresShowIndex,proto3,oneof"` -} - -type StartServiceActionRequest_MongodbExplain struct { - MongodbExplain *StartMongoDBExplainActionParams `protobuf:"bytes,9,opt,name=mongodb_explain,json=mongodbExplain,proto3,oneof"` -} - -type StartServiceActionRequest_PtMongodbSummary struct { - PtMongodbSummary *StartPTMongoDBSummaryActionParams `protobuf:"bytes,10,opt,name=pt_mongodb_summary,json=ptMongodbSummary,proto3,oneof"` -} - -type StartServiceActionRequest_PtMysqlSummary struct { - PtMysqlSummary *StartPTMySQLSummaryActionParams `protobuf:"bytes,11,opt,name=pt_mysql_summary,json=ptMysqlSummary,proto3,oneof"` -} - -type StartServiceActionRequest_PtPostgresSummary struct { - PtPostgresSummary *StartPTPgSummaryActionParams `protobuf:"bytes,12,opt,name=pt_postgres_summary,json=ptPostgresSummary,proto3,oneof"` -} - -func (*StartServiceActionRequest_MysqlExplain) isStartServiceActionRequest_Action() {} - -func (*StartServiceActionRequest_MysqlExplainJson) isStartServiceActionRequest_Action() {} - -func (*StartServiceActionRequest_MysqlExplainTraditionalJson) isStartServiceActionRequest_Action() {} - -func (*StartServiceActionRequest_MysqlShowIndex) isStartServiceActionRequest_Action() {} - -func (*StartServiceActionRequest_MysqlShowCreateTable) isStartServiceActionRequest_Action() {} - -func (*StartServiceActionRequest_MysqlShowTableStatus) isStartServiceActionRequest_Action() {} - -func (*StartServiceActionRequest_PostgresShowCreateTable) isStartServiceActionRequest_Action() {} - -func (*StartServiceActionRequest_PostgresShowIndex) isStartServiceActionRequest_Action() {} - -func (*StartServiceActionRequest_MongodbExplain) isStartServiceActionRequest_Action() {} - -func (*StartServiceActionRequest_PtMongodbSummary) isStartServiceActionRequest_Action() {} - -func (*StartServiceActionRequest_PtMysqlSummary) isStartServiceActionRequest_Action() {} - -func (*StartServiceActionRequest_PtPostgresSummary) isStartServiceActionRequest_Action() {} - -type StartServiceActionResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Action: - // - // *StartServiceActionResponse_MysqlExplain - // *StartServiceActionResponse_MysqlExplainJson - // *StartServiceActionResponse_MysqlExplainTraditionalJson - // *StartServiceActionResponse_MysqlShowIndex - // *StartServiceActionResponse_MysqlShowCreateTable - // *StartServiceActionResponse_MysqlShowTableStatus - // *StartServiceActionResponse_PostgresqlShowCreateTable - // *StartServiceActionResponse_PostgresqlShowIndex - // *StartServiceActionResponse_MongodbExplain - // *StartServiceActionResponse_PtMongodbSummary - // *StartServiceActionResponse_PtMysqlSummary - // *StartServiceActionResponse_PtPostgresSummary - Action isStartServiceActionResponse_Action `protobuf_oneof:"action"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StartServiceActionResponse) Reset() { - *x = StartServiceActionResponse{} - mi := &file_actions_v1_actions_proto_msgTypes[31] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StartServiceActionResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StartServiceActionResponse) ProtoMessage() {} - -func (x *StartServiceActionResponse) ProtoReflect() protoreflect.Message { - mi := &file_actions_v1_actions_proto_msgTypes[31] - 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 StartServiceActionResponse.ProtoReflect.Descriptor instead. -func (*StartServiceActionResponse) Descriptor() ([]byte, []int) { - return file_actions_v1_actions_proto_rawDescGZIP(), []int{31} -} - -func (x *StartServiceActionResponse) GetAction() isStartServiceActionResponse_Action { - if x != nil { - return x.Action - } - return nil -} - -func (x *StartServiceActionResponse) GetMysqlExplain() *StartMySQLExplainActionResult { - if x != nil { - if x, ok := x.Action.(*StartServiceActionResponse_MysqlExplain); ok { - return x.MysqlExplain - } - } - return nil -} - -func (x *StartServiceActionResponse) GetMysqlExplainJson() *StartMySQLExplainJSONActionResult { - if x != nil { - if x, ok := x.Action.(*StartServiceActionResponse_MysqlExplainJson); ok { - return x.MysqlExplainJson - } - } - return nil -} - -func (x *StartServiceActionResponse) GetMysqlExplainTraditionalJson() *StartMySQLExplainTraditionalJSONActionResult { - if x != nil { - if x, ok := x.Action.(*StartServiceActionResponse_MysqlExplainTraditionalJson); ok { - return x.MysqlExplainTraditionalJson - } - } - return nil -} - -func (x *StartServiceActionResponse) GetMysqlShowIndex() *StartMySQLShowIndexActionResult { - if x != nil { - if x, ok := x.Action.(*StartServiceActionResponse_MysqlShowIndex); ok { - return x.MysqlShowIndex - } - } - return nil -} - -func (x *StartServiceActionResponse) GetMysqlShowCreateTable() *StartMySQLShowCreateTableActionResult { - if x != nil { - if x, ok := x.Action.(*StartServiceActionResponse_MysqlShowCreateTable); ok { - return x.MysqlShowCreateTable - } - } - return nil -} - -func (x *StartServiceActionResponse) GetMysqlShowTableStatus() *StartMySQLShowTableStatusActionResult { - if x != nil { - if x, ok := x.Action.(*StartServiceActionResponse_MysqlShowTableStatus); ok { - return x.MysqlShowTableStatus - } - } - return nil -} - -func (x *StartServiceActionResponse) GetPostgresqlShowCreateTable() *StartPostgreSQLShowCreateTableActionResult { - if x != nil { - if x, ok := x.Action.(*StartServiceActionResponse_PostgresqlShowCreateTable); ok { - return x.PostgresqlShowCreateTable - } - } - return nil -} - -func (x *StartServiceActionResponse) GetPostgresqlShowIndex() *StartPostgreSQLShowIndexActionResult { - if x != nil { - if x, ok := x.Action.(*StartServiceActionResponse_PostgresqlShowIndex); ok { - return x.PostgresqlShowIndex - } - } - return nil -} - -func (x *StartServiceActionResponse) GetMongodbExplain() *StartMongoDBExplainActionResult { - if x != nil { - if x, ok := x.Action.(*StartServiceActionResponse_MongodbExplain); ok { - return x.MongodbExplain - } - } - return nil -} - -func (x *StartServiceActionResponse) GetPtMongodbSummary() *StartPTMongoDBSummaryActionResult { - if x != nil { - if x, ok := x.Action.(*StartServiceActionResponse_PtMongodbSummary); ok { - return x.PtMongodbSummary - } - } - return nil -} - -func (x *StartServiceActionResponse) GetPtMysqlSummary() *StartPTMySQLSummaryActionResult { - if x != nil { - if x, ok := x.Action.(*StartServiceActionResponse_PtMysqlSummary); ok { - return x.PtMysqlSummary - } - } - return nil -} - -func (x *StartServiceActionResponse) GetPtPostgresSummary() *StartPTPgSummaryActionResult { - if x != nil { - if x, ok := x.Action.(*StartServiceActionResponse_PtPostgresSummary); ok { - return x.PtPostgresSummary - } - } - return nil -} - -type isStartServiceActionResponse_Action interface { - isStartServiceActionResponse_Action() -} - -type StartServiceActionResponse_MysqlExplain struct { - MysqlExplain *StartMySQLExplainActionResult `protobuf:"bytes,1,opt,name=mysql_explain,json=mysqlExplain,proto3,oneof"` -} - -type StartServiceActionResponse_MysqlExplainJson struct { - MysqlExplainJson *StartMySQLExplainJSONActionResult `protobuf:"bytes,2,opt,name=mysql_explain_json,json=mysqlExplainJson,proto3,oneof"` -} - -type StartServiceActionResponse_MysqlExplainTraditionalJson struct { - MysqlExplainTraditionalJson *StartMySQLExplainTraditionalJSONActionResult `protobuf:"bytes,3,opt,name=mysql_explain_traditional_json,json=mysqlExplainTraditionalJson,proto3,oneof"` -} - -type StartServiceActionResponse_MysqlShowIndex struct { - MysqlShowIndex *StartMySQLShowIndexActionResult `protobuf:"bytes,4,opt,name=mysql_show_index,json=mysqlShowIndex,proto3,oneof"` -} - -type StartServiceActionResponse_MysqlShowCreateTable struct { - MysqlShowCreateTable *StartMySQLShowCreateTableActionResult `protobuf:"bytes,5,opt,name=mysql_show_create_table,json=mysqlShowCreateTable,proto3,oneof"` -} - -type StartServiceActionResponse_MysqlShowTableStatus struct { - MysqlShowTableStatus *StartMySQLShowTableStatusActionResult `protobuf:"bytes,6,opt,name=mysql_show_table_status,json=mysqlShowTableStatus,proto3,oneof"` -} - -type StartServiceActionResponse_PostgresqlShowCreateTable struct { - PostgresqlShowCreateTable *StartPostgreSQLShowCreateTableActionResult `protobuf:"bytes,7,opt,name=postgresql_show_create_table,json=postgresqlShowCreateTable,proto3,oneof"` -} - -type StartServiceActionResponse_PostgresqlShowIndex struct { - PostgresqlShowIndex *StartPostgreSQLShowIndexActionResult `protobuf:"bytes,8,opt,name=postgresql_show_index,json=postgresqlShowIndex,proto3,oneof"` -} - -type StartServiceActionResponse_MongodbExplain struct { - MongodbExplain *StartMongoDBExplainActionResult `protobuf:"bytes,9,opt,name=mongodb_explain,json=mongodbExplain,proto3,oneof"` -} - -type StartServiceActionResponse_PtMongodbSummary struct { - PtMongodbSummary *StartPTMongoDBSummaryActionResult `protobuf:"bytes,10,opt,name=pt_mongodb_summary,json=ptMongodbSummary,proto3,oneof"` -} - -type StartServiceActionResponse_PtMysqlSummary struct { - PtMysqlSummary *StartPTMySQLSummaryActionResult `protobuf:"bytes,11,opt,name=pt_mysql_summary,json=ptMysqlSummary,proto3,oneof"` -} - -type StartServiceActionResponse_PtPostgresSummary struct { - PtPostgresSummary *StartPTPgSummaryActionResult `protobuf:"bytes,12,opt,name=pt_postgres_summary,json=ptPostgresSummary,proto3,oneof"` -} - -func (*StartServiceActionResponse_MysqlExplain) isStartServiceActionResponse_Action() {} - -func (*StartServiceActionResponse_MysqlExplainJson) isStartServiceActionResponse_Action() {} - -func (*StartServiceActionResponse_MysqlExplainTraditionalJson) isStartServiceActionResponse_Action() { -} - -func (*StartServiceActionResponse_MysqlShowIndex) isStartServiceActionResponse_Action() {} - -func (*StartServiceActionResponse_MysqlShowCreateTable) isStartServiceActionResponse_Action() {} - -func (*StartServiceActionResponse_MysqlShowTableStatus) isStartServiceActionResponse_Action() {} - -func (*StartServiceActionResponse_PostgresqlShowCreateTable) isStartServiceActionResponse_Action() {} - -func (*StartServiceActionResponse_PostgresqlShowIndex) isStartServiceActionResponse_Action() {} - -func (*StartServiceActionResponse_MongodbExplain) isStartServiceActionResponse_Action() {} - -func (*StartServiceActionResponse_PtMongodbSummary) isStartServiceActionResponse_Action() {} - -func (*StartServiceActionResponse_PtMysqlSummary) isStartServiceActionResponse_Action() {} - -func (*StartServiceActionResponse_PtPostgresSummary) isStartServiceActionResponse_Action() {} - -var File_actions_v1_actions_proto protoreflect.FileDescriptor - -const file_actions_v1_actions_proto_rawDesc = "" + - "\n" + - "\x18actions/v1/actions.proto\x12\n" + - "actions.v1\x1a\x1cgoogle/api/annotations.proto\x1a.protoc-gen-openapiv2/options/annotations.proto\x1a\x17validate/validate.proto\"8\n" + - "\x10GetActionRequest\x12$\n" + - "\taction_id\x18\x01 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\bactionId\"\x94\x01\n" + - "\x11GetActionResponse\x12\x1b\n" + - "\taction_id\x18\x01 \x01(\tR\bactionId\x12 \n" + - "\fpmm_agent_id\x18\x02 \x01(\tR\n" + - "pmmAgentId\x12\x16\n" + - "\x06output\x18\x03 \x01(\tR\x06output\x12\x12\n" + - "\x04done\x18\x04 \x01(\bR\x04done\x12\x14\n" + - "\x05error\x18\x05 \x01(\tR\x05error\"\xc4\x01\n" + - "\x1dStartMySQLExplainActionParams\x12 \n" + - "\fpmm_agent_id\x18\x01 \x01(\tR\n" + - "pmmAgentId\x12&\n" + - "\n" + - "service_id\x18\x02 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\tserviceId\x12\x19\n" + - "\bquery_id\x18\x04 \x01(\tR\aqueryId\x12\"\n" + - "\fplaceholders\x18\x05 \x03(\tR\fplaceholders\x12\x1a\n" + - "\bdatabase\x18\x06 \x01(\tR\bdatabase\"^\n" + - "\x1dStartMySQLExplainActionResult\x12\x1b\n" + - "\taction_id\x18\x01 \x01(\tR\bactionId\x12 \n" + - "\fpmm_agent_id\x18\x02 \x01(\tR\n" + - "pmmAgentId\"\xc8\x01\n" + - "!StartMySQLExplainJSONActionParams\x12 \n" + - "\fpmm_agent_id\x18\x01 \x01(\tR\n" + - "pmmAgentId\x12&\n" + - "\n" + - "service_id\x18\x02 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\tserviceId\x12\x19\n" + - "\bquery_id\x18\x04 \x01(\tR\aqueryId\x12\"\n" + - "\fplaceholders\x18\x05 \x03(\tR\fplaceholders\x12\x1a\n" + - "\bdatabase\x18\x06 \x01(\tR\bdatabase\"b\n" + - "!StartMySQLExplainJSONActionResult\x12\x1b\n" + - "\taction_id\x18\x01 \x01(\tR\bactionId\x12 \n" + - "\fpmm_agent_id\x18\x02 \x01(\tR\n" + - "pmmAgentId\"\xd3\x01\n" + - ",StartMySQLExplainTraditionalJSONActionParams\x12 \n" + - "\fpmm_agent_id\x18\x01 \x01(\tR\n" + - "pmmAgentId\x12&\n" + - "\n" + - "service_id\x18\x02 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\tserviceId\x12\x19\n" + - "\bquery_id\x18\x04 \x01(\tR\aqueryId\x12\"\n" + - "\fplaceholders\x18\x05 \x03(\tR\fplaceholders\x12\x1a\n" + - "\bdatabase\x18\x06 \x01(\tR\bdatabase\"m\n" + - ",StartMySQLExplainTraditionalJSONActionResult\x12\x1b\n" + - "\taction_id\x18\x01 \x01(\tR\bactionId\x12 \n" + - "\fpmm_agent_id\x18\x02 \x01(\tR\n" + - "pmmAgentId\"\xb5\x01\n" + - "%StartMySQLShowCreateTableActionParams\x12 \n" + - "\fpmm_agent_id\x18\x01 \x01(\tR\n" + - "pmmAgentId\x12&\n" + - "\n" + - "service_id\x18\x02 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\tserviceId\x12&\n" + - "\n" + - "table_name\x18\x03 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\ttableName\x12\x1a\n" + - "\bdatabase\x18\x04 \x01(\tR\bdatabase\"f\n" + - "%StartMySQLShowCreateTableActionResult\x12\x1b\n" + - "\taction_id\x18\x01 \x01(\tR\bactionId\x12 \n" + - "\fpmm_agent_id\x18\x02 \x01(\tR\n" + - "pmmAgentId\"\xb5\x01\n" + - "%StartMySQLShowTableStatusActionParams\x12 \n" + - "\fpmm_agent_id\x18\x01 \x01(\tR\n" + - "pmmAgentId\x12&\n" + - "\n" + - "service_id\x18\x02 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\tserviceId\x12&\n" + - "\n" + - "table_name\x18\x03 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\ttableName\x12\x1a\n" + - "\bdatabase\x18\x04 \x01(\tR\bdatabase\"f\n" + - "%StartMySQLShowTableStatusActionResult\x12\x1b\n" + - "\taction_id\x18\x01 \x01(\tR\bactionId\x12 \n" + - "\fpmm_agent_id\x18\x02 \x01(\tR\n" + - "pmmAgentId\"\xaf\x01\n" + - "\x1fStartMySQLShowIndexActionParams\x12 \n" + - "\fpmm_agent_id\x18\x01 \x01(\tR\n" + - "pmmAgentId\x12&\n" + - "\n" + - "service_id\x18\x02 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\tserviceId\x12&\n" + - "\n" + - "table_name\x18\x03 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\ttableName\x12\x1a\n" + - "\bdatabase\x18\x04 \x01(\tR\bdatabase\"`\n" + - "\x1fStartMySQLShowIndexActionResult\x12\x1b\n" + - "\taction_id\x18\x01 \x01(\tR\bactionId\x12 \n" + - "\fpmm_agent_id\x18\x02 \x01(\tR\n" + - "pmmAgentId\"\xba\x01\n" + - "*StartPostgreSQLShowCreateTableActionParams\x12 \n" + - "\fpmm_agent_id\x18\x01 \x01(\tR\n" + - "pmmAgentId\x12&\n" + - "\n" + - "service_id\x18\x02 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\tserviceId\x12&\n" + - "\n" + - "table_name\x18\x03 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\ttableName\x12\x1a\n" + - "\bdatabase\x18\x04 \x01(\tR\bdatabase\"k\n" + - "*StartPostgreSQLShowCreateTableActionResult\x12\x1b\n" + - "\taction_id\x18\x01 \x01(\tR\bactionId\x12 \n" + - "\fpmm_agent_id\x18\x02 \x01(\tR\n" + - "pmmAgentId\"\xb4\x01\n" + - "$StartPostgreSQLShowIndexActionParams\x12 \n" + - "\fpmm_agent_id\x18\x01 \x01(\tR\n" + - "pmmAgentId\x12&\n" + - "\n" + - "service_id\x18\x02 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\tserviceId\x12&\n" + - "\n" + - "table_name\x18\x03 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\ttableName\x12\x1a\n" + - "\bdatabase\x18\x04 \x01(\tR\bdatabase\"e\n" + - "$StartPostgreSQLShowIndexActionResult\x12\x1b\n" + - "\taction_id\x18\x01 \x01(\tR\bactionId\x12 \n" + - "\fpmm_agent_id\x18\x02 \x01(\tR\n" + - "pmmAgentId\"\x8a\x01\n" + - "\x1fStartMongoDBExplainActionParams\x12 \n" + - "\fpmm_agent_id\x18\x01 \x01(\tR\n" + - "pmmAgentId\x12&\n" + - "\n" + - "service_id\x18\x02 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\tserviceId\x12\x1d\n" + - "\x05query\x18\x03 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\x05query\"`\n" + - "\x1fStartMongoDBExplainActionResult\x12\x1b\n" + - "\taction_id\x18\x01 \x01(\tR\bactionId\x12 \n" + - "\fpmm_agent_id\x18\x02 \x01(\tR\n" + - "pmmAgentId\"_\n" + - "\x1cStartPTPgSummaryActionParams\x12 \n" + - "\fpmm_agent_id\x18\x01 \x01(\tR\n" + - "pmmAgentId\x12\x1d\n" + - "\n" + - "service_id\x18\x02 \x01(\tR\tserviceId\"]\n" + - "\x1cStartPTPgSummaryActionResult\x12\x1b\n" + - "\taction_id\x18\x01 \x01(\tR\bactionId\x12 \n" + - "\fpmm_agent_id\x18\x02 \x01(\tR\n" + - "pmmAgentId\"d\n" + - "!StartPTMongoDBSummaryActionParams\x12 \n" + - "\fpmm_agent_id\x18\x01 \x01(\tR\n" + - "pmmAgentId\x12\x1d\n" + - "\n" + - "service_id\x18\x02 \x01(\tR\tserviceId\"b\n" + - "!StartPTMongoDBSummaryActionResult\x12\x1b\n" + - "\taction_id\x18\x01 \x01(\tR\bactionId\x12 \n" + - "\fpmm_agent_id\x18\x02 \x01(\tR\n" + - "pmmAgentId\"b\n" + - "\x1fStartPTMySQLSummaryActionParams\x12 \n" + - "\fpmm_agent_id\x18\x01 \x01(\tR\n" + - "pmmAgentId\x12\x1d\n" + - "\n" + - "service_id\x18\x02 \x01(\tR\tserviceId\"`\n" + - "\x1fStartPTMySQLSummaryActionResult\x12\x1b\n" + - "\taction_id\x18\x01 \x01(\tR\bactionId\x12 \n" + - "\fpmm_agent_id\x18\x02 \x01(\tR\n" + - "pmmAgentId\"X\n" + - "\x1bStartPTSummaryActionRequest\x12 \n" + - "\fpmm_agent_id\x18\x01 \x01(\tR\n" + - "pmmAgentId\x12\x17\n" + - "\anode_id\x18\x02 \x01(\tR\x06nodeId\"]\n" + - "\x1cStartPTSummaryActionResponse\x12\x1b\n" + - "\taction_id\x18\x01 \x01(\tR\bactionId\x12 \n" + - "\fpmm_agent_id\x18\x02 \x01(\tR\n" + - "pmmAgentId\";\n" + - "\x13CancelActionRequest\x12$\n" + - "\taction_id\x18\x01 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\bactionId\"\x16\n" + - "\x14CancelActionResponse\"\xcf\t\n" + - "\x19StartServiceActionRequest\x12P\n" + - "\rmysql_explain\x18\x01 \x01(\v2).actions.v1.StartMySQLExplainActionParamsH\x00R\fmysqlExplain\x12]\n" + - "\x12mysql_explain_json\x18\x02 \x01(\v2-.actions.v1.StartMySQLExplainJSONActionParamsH\x00R\x10mysqlExplainJson\x12\x7f\n" + - "\x1emysql_explain_traditional_json\x18\x03 \x01(\v28.actions.v1.StartMySQLExplainTraditionalJSONActionParamsH\x00R\x1bmysqlExplainTraditionalJson\x12W\n" + - "\x10mysql_show_index\x18\x04 \x01(\v2+.actions.v1.StartMySQLShowIndexActionParamsH\x00R\x0emysqlShowIndex\x12j\n" + - "\x17mysql_show_create_table\x18\x05 \x01(\v21.actions.v1.StartMySQLShowCreateTableActionParamsH\x00R\x14mysqlShowCreateTable\x12j\n" + - "\x17mysql_show_table_status\x18\x06 \x01(\v21.actions.v1.StartMySQLShowTableStatusActionParamsH\x00R\x14mysqlShowTableStatus\x12u\n" + - "\x1apostgres_show_create_table\x18\a \x01(\v26.actions.v1.StartPostgreSQLShowCreateTableActionParamsH\x00R\x17postgresShowCreateTable\x12b\n" + - "\x13postgres_show_index\x18\b \x01(\v20.actions.v1.StartPostgreSQLShowIndexActionParamsH\x00R\x11postgresShowIndex\x12V\n" + - "\x0fmongodb_explain\x18\t \x01(\v2+.actions.v1.StartMongoDBExplainActionParamsH\x00R\x0emongodbExplain\x12]\n" + - "\x12pt_mongodb_summary\x18\n" + - " \x01(\v2-.actions.v1.StartPTMongoDBSummaryActionParamsH\x00R\x10ptMongodbSummary\x12W\n" + - "\x10pt_mysql_summary\x18\v \x01(\v2+.actions.v1.StartPTMySQLSummaryActionParamsH\x00R\x0eptMysqlSummary\x12Z\n" + - "\x13pt_postgres_summary\x18\f \x01(\v2(.actions.v1.StartPTPgSummaryActionParamsH\x00R\x11ptPostgresSummaryB\b\n" + - "\x06action\"\xd8\t\n" + - "\x1aStartServiceActionResponse\x12P\n" + - "\rmysql_explain\x18\x01 \x01(\v2).actions.v1.StartMySQLExplainActionResultH\x00R\fmysqlExplain\x12]\n" + - "\x12mysql_explain_json\x18\x02 \x01(\v2-.actions.v1.StartMySQLExplainJSONActionResultH\x00R\x10mysqlExplainJson\x12\x7f\n" + - "\x1emysql_explain_traditional_json\x18\x03 \x01(\v28.actions.v1.StartMySQLExplainTraditionalJSONActionResultH\x00R\x1bmysqlExplainTraditionalJson\x12W\n" + - "\x10mysql_show_index\x18\x04 \x01(\v2+.actions.v1.StartMySQLShowIndexActionResultH\x00R\x0emysqlShowIndex\x12j\n" + - "\x17mysql_show_create_table\x18\x05 \x01(\v21.actions.v1.StartMySQLShowCreateTableActionResultH\x00R\x14mysqlShowCreateTable\x12j\n" + - "\x17mysql_show_table_status\x18\x06 \x01(\v21.actions.v1.StartMySQLShowTableStatusActionResultH\x00R\x14mysqlShowTableStatus\x12y\n" + - "\x1cpostgresql_show_create_table\x18\a \x01(\v26.actions.v1.StartPostgreSQLShowCreateTableActionResultH\x00R\x19postgresqlShowCreateTable\x12f\n" + - "\x15postgresql_show_index\x18\b \x01(\v20.actions.v1.StartPostgreSQLShowIndexActionResultH\x00R\x13postgresqlShowIndex\x12V\n" + - "\x0fmongodb_explain\x18\t \x01(\v2+.actions.v1.StartMongoDBExplainActionResultH\x00R\x0emongodbExplain\x12]\n" + - "\x12pt_mongodb_summary\x18\n" + - " \x01(\v2-.actions.v1.StartPTMongoDBSummaryActionResultH\x00R\x10ptMongodbSummary\x12W\n" + - "\x10pt_mysql_summary\x18\v \x01(\v2+.actions.v1.StartPTMySQLSummaryActionResultH\x00R\x0eptMysqlSummary\x12Z\n" + - "\x13pt_postgres_summary\x18\f \x01(\v2(.actions.v1.StartPTPgSummaryActionResultH\x00R\x11ptPostgresSummaryB\b\n" + - "\x06action*\xb3\x03\n" + - "\n" + - "ActionType\x12\x1b\n" + - "\x17ACTION_TYPE_UNSPECIFIED\x10\x00\x12\x1d\n" + - "\x19ACTION_TYPE_MYSQL_EXPLAIN\x10\x01\x12'\n" + - "#ACTION_TYPE_MYSQL_SHOW_CREATE_TABLE\x10\x02\x12'\n" + - "#ACTION_TYPE_MYSQL_SHOW_TABLE_STATUS\x10\x03\x12 \n" + - "\x1cACTION_TYPE_MYSQL_SHOW_INDEX\x10\x04\x12,\n" + - "(ACTION_TYPE_POSTGRESQL_SHOW_CREATE_TABLE\x10\x05\x12%\n" + - "!ACTION_TYPE_POSTGRESQL_SHOW_INDEX\x10\x06\x12\x1f\n" + - "\x1bACTION_TYPE_MONGODB_EXPLAIN\x10\a\x12\x1a\n" + - "\x16ACTION_TYPE_PT_SUMMARY\x10\b\x12 \n" + - "\x1cACTION_TYPE_PT_MYSQL_SUMMARY\x10\t\x12\x1d\n" + - "\x19ACTION_TYPE_PT_PG_SUMMARY\x10\n" + - "\x12\"\n" + - "\x1eACTION_TYPE_PT_MONGODB_SUMMARY\x10\v2\xf1\x05\n" + - "\x0eActionsService\x12\x9c\x01\n" + - "\tGetAction\x12\x1c.actions.v1.GetActionRequest\x1a\x1d.actions.v1.GetActionResponse\"R\x92A0\x12\n" + - "Get Action\x1a\"Gets the result of a given Action.\x82\xd3\xe4\x93\x02\x19\x12\x17/v1/actions/{action_id}\x12\xc3\x01\n" + - "\x12StartServiceAction\x12%.actions.v1.StartServiceActionRequest\x1a&.actions.v1.StartServiceActionResponse\"^\x92A2\x12\x16Start a Service Action\x1a\x18Starts a Service Action.\x82\xd3\xe4\x93\x02#:\x01*\"\x1e/v1/actions:startServiceAction\x12\xd9\x01\n" + - "\x14StartPTSummaryAction\x12'.actions.v1.StartPTSummaryActionRequest\x1a(.actions.v1.StartPTSummaryActionResponse\"n\x92AE\x12\x19Start 'PT Summary' Action\x1a(Starts 'Percona Toolkit Summary' Action.\x82\xd3\xe4\x93\x02 :\x01*\"\x1b/v1/actions:startNodeAction\x12\x9d\x01\n" + - "\fCancelAction\x12\x1f.actions.v1.CancelActionRequest\x1a .actions.v1.CancelActionResponse\"J\x92A$\x12\x10Cancel an Action\x1a\x10Stops an Action.\x82\xd3\xe4\x93\x02\x1d:\x01*\"\x18/v1/actions:cancelActionB\x98\x01\n" + - "\x0ecom.actions.v1B\fActionsProtoP\x01Z/github.com/percona/pmm/api/actions/v1;actionsv1\xa2\x02\x03AXX\xaa\x02\n" + - "Actions.V1\xca\x02\n" + - "Actions\\V1\xe2\x02\x16Actions\\V1\\GPBMetadata\xea\x02\vActions::V1b\x06proto3" - -var ( - file_actions_v1_actions_proto_rawDescOnce sync.Once - file_actions_v1_actions_proto_rawDescData []byte -) - -func file_actions_v1_actions_proto_rawDescGZIP() []byte { - file_actions_v1_actions_proto_rawDescOnce.Do(func() { - file_actions_v1_actions_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_actions_v1_actions_proto_rawDesc), len(file_actions_v1_actions_proto_rawDesc))) - }) - 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_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 - 7, // 2: actions.v1.StartServiceActionRequest.mysql_explain_traditional_json:type_name -> actions.v1.StartMySQLExplainTraditionalJSONActionParams - 13, // 3: actions.v1.StartServiceActionRequest.mysql_show_index:type_name -> actions.v1.StartMySQLShowIndexActionParams - 9, // 4: actions.v1.StartServiceActionRequest.mysql_show_create_table:type_name -> actions.v1.StartMySQLShowCreateTableActionParams - 11, // 5: actions.v1.StartServiceActionRequest.mysql_show_table_status:type_name -> actions.v1.StartMySQLShowTableStatusActionParams - 15, // 6: actions.v1.StartServiceActionRequest.postgres_show_create_table:type_name -> actions.v1.StartPostgreSQLShowCreateTableActionParams - 17, // 7: actions.v1.StartServiceActionRequest.postgres_show_index:type_name -> actions.v1.StartPostgreSQLShowIndexActionParams - 19, // 8: actions.v1.StartServiceActionRequest.mongodb_explain:type_name -> actions.v1.StartMongoDBExplainActionParams - 23, // 9: actions.v1.StartServiceActionRequest.pt_mongodb_summary:type_name -> actions.v1.StartPTMongoDBSummaryActionParams - 25, // 10: actions.v1.StartServiceActionRequest.pt_mysql_summary:type_name -> actions.v1.StartPTMySQLSummaryActionParams - 21, // 11: actions.v1.StartServiceActionRequest.pt_postgres_summary:type_name -> actions.v1.StartPTPgSummaryActionParams - 4, // 12: actions.v1.StartServiceActionResponse.mysql_explain:type_name -> actions.v1.StartMySQLExplainActionResult - 6, // 13: actions.v1.StartServiceActionResponse.mysql_explain_json:type_name -> actions.v1.StartMySQLExplainJSONActionResult - 8, // 14: actions.v1.StartServiceActionResponse.mysql_explain_traditional_json:type_name -> actions.v1.StartMySQLExplainTraditionalJSONActionResult - 14, // 15: actions.v1.StartServiceActionResponse.mysql_show_index:type_name -> actions.v1.StartMySQLShowIndexActionResult - 10, // 16: actions.v1.StartServiceActionResponse.mysql_show_create_table:type_name -> actions.v1.StartMySQLShowCreateTableActionResult - 12, // 17: actions.v1.StartServiceActionResponse.mysql_show_table_status:type_name -> actions.v1.StartMySQLShowTableStatusActionResult - 16, // 18: actions.v1.StartServiceActionResponse.postgresql_show_create_table:type_name -> actions.v1.StartPostgreSQLShowCreateTableActionResult - 18, // 19: actions.v1.StartServiceActionResponse.postgresql_show_index:type_name -> actions.v1.StartPostgreSQLShowIndexActionResult - 20, // 20: actions.v1.StartServiceActionResponse.mongodb_explain:type_name -> actions.v1.StartMongoDBExplainActionResult - 24, // 21: actions.v1.StartServiceActionResponse.pt_mongodb_summary:type_name -> actions.v1.StartPTMongoDBSummaryActionResult - 26, // 22: actions.v1.StartServiceActionResponse.pt_mysql_summary:type_name -> actions.v1.StartPTMySQLSummaryActionResult - 22, // 23: actions.v1.StartServiceActionResponse.pt_postgres_summary:type_name -> actions.v1.StartPTPgSummaryActionResult - 1, // 24: actions.v1.ActionsService.GetAction:input_type -> actions.v1.GetActionRequest - 31, // 25: actions.v1.ActionsService.StartServiceAction:input_type -> actions.v1.StartServiceActionRequest - 27, // 26: actions.v1.ActionsService.StartPTSummaryAction:input_type -> actions.v1.StartPTSummaryActionRequest - 29, // 27: actions.v1.ActionsService.CancelAction:input_type -> actions.v1.CancelActionRequest - 2, // 28: actions.v1.ActionsService.GetAction:output_type -> actions.v1.GetActionResponse - 32, // 29: actions.v1.ActionsService.StartServiceAction:output_type -> actions.v1.StartServiceActionResponse - 28, // 30: actions.v1.ActionsService.StartPTSummaryAction:output_type -> actions.v1.StartPTSummaryActionResponse - 30, // 31: actions.v1.ActionsService.CancelAction:output_type -> actions.v1.CancelActionResponse - 28, // [28:32] is the sub-list for method output_type - 24, // [24:28] 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 -} - -func init() { file_actions_v1_actions_proto_init() } -func file_actions_v1_actions_proto_init() { - if File_actions_v1_actions_proto != nil { - return - } - file_actions_v1_actions_proto_msgTypes[30].OneofWrappers = []any{ - (*StartServiceActionRequest_MysqlExplain)(nil), - (*StartServiceActionRequest_MysqlExplainJson)(nil), - (*StartServiceActionRequest_MysqlExplainTraditionalJson)(nil), - (*StartServiceActionRequest_MysqlShowIndex)(nil), - (*StartServiceActionRequest_MysqlShowCreateTable)(nil), - (*StartServiceActionRequest_MysqlShowTableStatus)(nil), - (*StartServiceActionRequest_PostgresShowCreateTable)(nil), - (*StartServiceActionRequest_PostgresShowIndex)(nil), - (*StartServiceActionRequest_MongodbExplain)(nil), - (*StartServiceActionRequest_PtMongodbSummary)(nil), - (*StartServiceActionRequest_PtMysqlSummary)(nil), - (*StartServiceActionRequest_PtPostgresSummary)(nil), - } - file_actions_v1_actions_proto_msgTypes[31].OneofWrappers = []any{ - (*StartServiceActionResponse_MysqlExplain)(nil), - (*StartServiceActionResponse_MysqlExplainJson)(nil), - (*StartServiceActionResponse_MysqlExplainTraditionalJson)(nil), - (*StartServiceActionResponse_MysqlShowIndex)(nil), - (*StartServiceActionResponse_MysqlShowCreateTable)(nil), - (*StartServiceActionResponse_MysqlShowTableStatus)(nil), - (*StartServiceActionResponse_PostgresqlShowCreateTable)(nil), - (*StartServiceActionResponse_PostgresqlShowIndex)(nil), - (*StartServiceActionResponse_MongodbExplain)(nil), - (*StartServiceActionResponse_PtMongodbSummary)(nil), - (*StartServiceActionResponse_PtMysqlSummary)(nil), - (*StartServiceActionResponse_PtPostgresSummary)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_actions_v1_actions_proto_rawDesc), len(file_actions_v1_actions_proto_rawDesc)), - NumEnums: 1, - NumMessages: 32, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_actions_v1_actions_proto_goTypes, - DependencyIndexes: file_actions_v1_actions_proto_depIdxs, - EnumInfos: file_actions_v1_actions_proto_enumTypes, - MessageInfos: file_actions_v1_actions_proto_msgTypes, - }.Build() - File_actions_v1_actions_proto = out.File - file_actions_v1_actions_proto_goTypes = nil - file_actions_v1_actions_proto_depIdxs = nil -} diff --git a/api/actions/v1/actions.pb.gw.go b/api/actions/v1/actions.pb.gw.go deleted file mode 100644 index df17f599bdb..00000000000 --- a/api/actions/v1/actions.pb.gw.go +++ /dev/null @@ -1,367 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: actions/v1/actions.proto - -/* -Package actionsv1 is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package actionsv1 - -import ( - "context" - "errors" - "io" - "net/http" - - "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" - "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" - "google.golang.org/protobuf/proto" -) - -// Suppress "imported and not used" errors -var ( - _ codes.Code - _ io.Reader - _ status.Status - _ = errors.New - _ = runtime.String - _ = utilities.NewDoubleArray - _ = metadata.Join -) - -func request_ActionsService_GetAction_0(ctx context.Context, marshaler runtime.Marshaler, client ActionsServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq GetActionRequest - metadata runtime.ServerMetadata - err error - ) - if req.Body != nil { - _, _ = io.Copy(io.Discard, req.Body) - } - val, ok := pathParams["action_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "action_id") - } - protoReq.ActionId, err = runtime.String(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "action_id", err) - } - msg, err := client.GetAction(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_ActionsService_GetAction_0(ctx context.Context, marshaler runtime.Marshaler, server ActionsServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq GetActionRequest - metadata runtime.ServerMetadata - err error - ) - val, ok := pathParams["action_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "action_id") - } - protoReq.ActionId, err = runtime.String(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "action_id", err) - } - msg, err := server.GetAction(ctx, &protoReq) - return msg, metadata, err -} - -func request_ActionsService_StartServiceAction_0(ctx context.Context, marshaler runtime.Marshaler, client ActionsServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq StartServiceActionRequest - 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.StartServiceAction(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_ActionsService_StartServiceAction_0(ctx context.Context, marshaler runtime.Marshaler, server ActionsServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq StartServiceActionRequest - 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.StartServiceAction(ctx, &protoReq) - return msg, metadata, err -} - -func request_ActionsService_StartPTSummaryAction_0(ctx context.Context, marshaler runtime.Marshaler, client ActionsServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq StartPTSummaryActionRequest - 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.StartPTSummaryAction(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_ActionsService_StartPTSummaryAction_0(ctx context.Context, marshaler runtime.Marshaler, server ActionsServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq StartPTSummaryActionRequest - 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.StartPTSummaryAction(ctx, &protoReq) - return msg, metadata, err -} - -func request_ActionsService_CancelAction_0(ctx context.Context, marshaler runtime.Marshaler, client ActionsServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq CancelActionRequest - 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.CancelAction(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_ActionsService_CancelAction_0(ctx context.Context, marshaler runtime.Marshaler, server ActionsServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq CancelActionRequest - 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.CancelAction(ctx, &protoReq) - return msg, metadata, err -} - -// RegisterActionsServiceHandlerServer registers the http handlers for service ActionsService to "mux". -// UnaryRPC :call ActionsServiceServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterActionsServiceHandlerFromEndpoint instead. -// GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call. -func RegisterActionsServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ActionsServiceServer) error { - mux.Handle(http.MethodGet, pattern_ActionsService_GetAction_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, "/actions.v1.ActionsService/GetAction", runtime.WithHTTPPathPattern("/v1/actions/{action_id}")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_ActionsService_GetAction_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_ActionsService_GetAction_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPost, pattern_ActionsService_StartServiceAction_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, "/actions.v1.ActionsService/StartServiceAction", runtime.WithHTTPPathPattern("/v1/actions:startServiceAction")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_ActionsService_StartServiceAction_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_ActionsService_StartServiceAction_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPost, pattern_ActionsService_StartPTSummaryAction_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, "/actions.v1.ActionsService/StartPTSummaryAction", runtime.WithHTTPPathPattern("/v1/actions:startNodeAction")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_ActionsService_StartPTSummaryAction_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_ActionsService_StartPTSummaryAction_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPost, pattern_ActionsService_CancelAction_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, "/actions.v1.ActionsService/CancelAction", runtime.WithHTTPPathPattern("/v1/actions:cancelAction")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_ActionsService_CancelAction_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_ActionsService_CancelAction_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - return nil -} - -// RegisterActionsServiceHandlerFromEndpoint is same as RegisterActionsServiceHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterActionsServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.NewClient(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - return RegisterActionsServiceHandler(ctx, mux, conn) -} - -// RegisterActionsServiceHandler registers the http handlers for service ActionsService to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterActionsServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterActionsServiceHandlerClient(ctx, mux, NewActionsServiceClient(conn)) -} - -// RegisterActionsServiceHandlerClient registers the http handlers for service ActionsService -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ActionsServiceClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ActionsServiceClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "ActionsServiceClient" to call the correct interceptors. This client ignores the HTTP middlewares. -func RegisterActionsServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ActionsServiceClient) error { - mux.Handle(http.MethodGet, pattern_ActionsService_GetAction_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, "/actions.v1.ActionsService/GetAction", runtime.WithHTTPPathPattern("/v1/actions/{action_id}")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_ActionsService_GetAction_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_ActionsService_GetAction_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPost, pattern_ActionsService_StartServiceAction_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, "/actions.v1.ActionsService/StartServiceAction", runtime.WithHTTPPathPattern("/v1/actions:startServiceAction")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_ActionsService_StartServiceAction_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_ActionsService_StartServiceAction_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPost, pattern_ActionsService_StartPTSummaryAction_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, "/actions.v1.ActionsService/StartPTSummaryAction", runtime.WithHTTPPathPattern("/v1/actions:startNodeAction")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_ActionsService_StartPTSummaryAction_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_ActionsService_StartPTSummaryAction_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPost, pattern_ActionsService_CancelAction_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, "/actions.v1.ActionsService/CancelAction", runtime.WithHTTPPathPattern("/v1/actions:cancelAction")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_ActionsService_CancelAction_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_ActionsService_CancelAction_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - return nil -} - -var ( - pattern_ActionsService_GetAction_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"v1", "actions", "action_id"}, "")) - pattern_ActionsService_StartServiceAction_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "actions"}, "startServiceAction")) - pattern_ActionsService_StartPTSummaryAction_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "actions"}, "startNodeAction")) - pattern_ActionsService_CancelAction_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "actions"}, "cancelAction")) -) - -var ( - forward_ActionsService_GetAction_0 = runtime.ForwardResponseMessage - forward_ActionsService_StartServiceAction_0 = runtime.ForwardResponseMessage - forward_ActionsService_StartPTSummaryAction_0 = runtime.ForwardResponseMessage - forward_ActionsService_CancelAction_0 = runtime.ForwardResponseMessage -) diff --git a/api/actions/v1/actions.pb.validate.go b/api/actions/v1/actions.pb.validate.go deleted file mode 100644 index 3c8feb7b777..00000000000 --- a/api/actions/v1/actions.pb.validate.go +++ /dev/null @@ -1,4657 +0,0 @@ -// Code generated by protoc-gen-validate. DO NOT EDIT. -// source: actions/v1/actions.proto - -package actionsv1 - -import ( - "bytes" - "errors" - "fmt" - "net" - "net/mail" - "net/url" - "regexp" - "sort" - "strings" - "time" - "unicode/utf8" - - "google.golang.org/protobuf/types/known/anypb" -) - -// ensure the imports are used -var ( - _ = bytes.MinRead - _ = errors.New("") - _ = fmt.Print - _ = utf8.UTFMax - _ = (*regexp.Regexp)(nil) - _ = (*strings.Reader)(nil) - _ = net.IPv4len - _ = time.Duration(0) - _ = (*url.URL)(nil) - _ = (*mail.Address)(nil) - _ = anypb.Any{} - _ = sort.Sort -) - -// Validate checks the field values on GetActionRequest 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 *GetActionRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on GetActionRequest 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 -// GetActionRequestMultiError, or nil if none found. -func (m *GetActionRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *GetActionRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetActionId()) < 1 { - err := GetActionRequestValidationError{ - field: "ActionId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if len(errors) > 0 { - return GetActionRequestMultiError(errors) - } - - return nil -} - -// GetActionRequestMultiError is an error wrapping multiple validation errors -// returned by GetActionRequest.ValidateAll() if the designated constraints -// aren't met. -type GetActionRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m GetActionRequestMultiError) 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 GetActionRequestMultiError) AllErrors() []error { return m } - -// GetActionRequestValidationError is the validation error returned by -// GetActionRequest.Validate if the designated constraints aren't met. -type GetActionRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e GetActionRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e GetActionRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e GetActionRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e GetActionRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e GetActionRequestValidationError) ErrorName() string { return "GetActionRequestValidationError" } - -// Error satisfies the builtin error interface -func (e GetActionRequestValidationError) 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 %sGetActionRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = GetActionRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = GetActionRequestValidationError{} - -// Validate checks the field values on GetActionResponse 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 *GetActionResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on GetActionResponse 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 -// GetActionResponseMultiError, or nil if none found. -func (m *GetActionResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *GetActionResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for ActionId - - // no validation rules for PmmAgentId - - // no validation rules for Output - - // no validation rules for Done - - // no validation rules for Error - - if len(errors) > 0 { - return GetActionResponseMultiError(errors) - } - - return nil -} - -// GetActionResponseMultiError is an error wrapping multiple validation errors -// returned by GetActionResponse.ValidateAll() if the designated constraints -// aren't met. -type GetActionResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m GetActionResponseMultiError) 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 GetActionResponseMultiError) AllErrors() []error { return m } - -// GetActionResponseValidationError is the validation error returned by -// GetActionResponse.Validate if the designated constraints aren't met. -type GetActionResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e GetActionResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e GetActionResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e GetActionResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e GetActionResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e GetActionResponseValidationError) ErrorName() string { - return "GetActionResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e GetActionResponseValidationError) 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 %sGetActionResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = GetActionResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = GetActionResponseValidationError{} - -// Validate checks the field values on StartMySQLExplainActionParams 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 *StartMySQLExplainActionParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on StartMySQLExplainActionParams 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 -// StartMySQLExplainActionParamsMultiError, or nil if none found. -func (m *StartMySQLExplainActionParams) ValidateAll() error { - return m.validate(true) -} - -func (m *StartMySQLExplainActionParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for PmmAgentId - - if utf8.RuneCountInString(m.GetServiceId()) < 1 { - err := StartMySQLExplainActionParamsValidationError{ - field: "ServiceId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for QueryId - - // no validation rules for Database - - if len(errors) > 0 { - return StartMySQLExplainActionParamsMultiError(errors) - } - - return nil -} - -// StartMySQLExplainActionParamsMultiError is an error wrapping multiple -// validation errors returned by StartMySQLExplainActionParams.ValidateAll() -// if the designated constraints aren't met. -type StartMySQLExplainActionParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m StartMySQLExplainActionParamsMultiError) 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 StartMySQLExplainActionParamsMultiError) AllErrors() []error { return m } - -// StartMySQLExplainActionParamsValidationError is the validation error -// returned by StartMySQLExplainActionParams.Validate if the designated -// constraints aren't met. -type StartMySQLExplainActionParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e StartMySQLExplainActionParamsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e StartMySQLExplainActionParamsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e StartMySQLExplainActionParamsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e StartMySQLExplainActionParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e StartMySQLExplainActionParamsValidationError) ErrorName() string { - return "StartMySQLExplainActionParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e StartMySQLExplainActionParamsValidationError) 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 %sStartMySQLExplainActionParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = StartMySQLExplainActionParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = StartMySQLExplainActionParamsValidationError{} - -// Validate checks the field values on StartMySQLExplainActionResult 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 *StartMySQLExplainActionResult) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on StartMySQLExplainActionResult 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 -// StartMySQLExplainActionResultMultiError, or nil if none found. -func (m *StartMySQLExplainActionResult) ValidateAll() error { - return m.validate(true) -} - -func (m *StartMySQLExplainActionResult) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for ActionId - - // no validation rules for PmmAgentId - - if len(errors) > 0 { - return StartMySQLExplainActionResultMultiError(errors) - } - - return nil -} - -// StartMySQLExplainActionResultMultiError is an error wrapping multiple -// validation errors returned by StartMySQLExplainActionResult.ValidateAll() -// if the designated constraints aren't met. -type StartMySQLExplainActionResultMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m StartMySQLExplainActionResultMultiError) 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 StartMySQLExplainActionResultMultiError) AllErrors() []error { return m } - -// StartMySQLExplainActionResultValidationError is the validation error -// returned by StartMySQLExplainActionResult.Validate if the designated -// constraints aren't met. -type StartMySQLExplainActionResultValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e StartMySQLExplainActionResultValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e StartMySQLExplainActionResultValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e StartMySQLExplainActionResultValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e StartMySQLExplainActionResultValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e StartMySQLExplainActionResultValidationError) ErrorName() string { - return "StartMySQLExplainActionResultValidationError" -} - -// Error satisfies the builtin error interface -func (e StartMySQLExplainActionResultValidationError) 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 %sStartMySQLExplainActionResult.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = StartMySQLExplainActionResultValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = StartMySQLExplainActionResultValidationError{} - -// Validate checks the field values on StartMySQLExplainJSONActionParams 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 *StartMySQLExplainJSONActionParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on StartMySQLExplainJSONActionParams -// 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 -// StartMySQLExplainJSONActionParamsMultiError, or nil if none found. -func (m *StartMySQLExplainJSONActionParams) ValidateAll() error { - return m.validate(true) -} - -func (m *StartMySQLExplainJSONActionParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for PmmAgentId - - if utf8.RuneCountInString(m.GetServiceId()) < 1 { - err := StartMySQLExplainJSONActionParamsValidationError{ - field: "ServiceId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for QueryId - - // no validation rules for Database - - if len(errors) > 0 { - return StartMySQLExplainJSONActionParamsMultiError(errors) - } - - return nil -} - -// StartMySQLExplainJSONActionParamsMultiError is an error wrapping multiple -// validation errors returned by -// StartMySQLExplainJSONActionParams.ValidateAll() if the designated -// constraints aren't met. -type StartMySQLExplainJSONActionParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m StartMySQLExplainJSONActionParamsMultiError) 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 StartMySQLExplainJSONActionParamsMultiError) AllErrors() []error { return m } - -// StartMySQLExplainJSONActionParamsValidationError is the validation error -// returned by StartMySQLExplainJSONActionParams.Validate if the designated -// constraints aren't met. -type StartMySQLExplainJSONActionParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e StartMySQLExplainJSONActionParamsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e StartMySQLExplainJSONActionParamsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e StartMySQLExplainJSONActionParamsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e StartMySQLExplainJSONActionParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e StartMySQLExplainJSONActionParamsValidationError) ErrorName() string { - return "StartMySQLExplainJSONActionParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e StartMySQLExplainJSONActionParamsValidationError) 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 %sStartMySQLExplainJSONActionParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = StartMySQLExplainJSONActionParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = StartMySQLExplainJSONActionParamsValidationError{} - -// Validate checks the field values on StartMySQLExplainJSONActionResult 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 *StartMySQLExplainJSONActionResult) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on StartMySQLExplainJSONActionResult -// 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 -// StartMySQLExplainJSONActionResultMultiError, or nil if none found. -func (m *StartMySQLExplainJSONActionResult) ValidateAll() error { - return m.validate(true) -} - -func (m *StartMySQLExplainJSONActionResult) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for ActionId - - // no validation rules for PmmAgentId - - if len(errors) > 0 { - return StartMySQLExplainJSONActionResultMultiError(errors) - } - - return nil -} - -// StartMySQLExplainJSONActionResultMultiError is an error wrapping multiple -// validation errors returned by -// StartMySQLExplainJSONActionResult.ValidateAll() if the designated -// constraints aren't met. -type StartMySQLExplainJSONActionResultMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m StartMySQLExplainJSONActionResultMultiError) 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 StartMySQLExplainJSONActionResultMultiError) AllErrors() []error { return m } - -// StartMySQLExplainJSONActionResultValidationError is the validation error -// returned by StartMySQLExplainJSONActionResult.Validate if the designated -// constraints aren't met. -type StartMySQLExplainJSONActionResultValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e StartMySQLExplainJSONActionResultValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e StartMySQLExplainJSONActionResultValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e StartMySQLExplainJSONActionResultValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e StartMySQLExplainJSONActionResultValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e StartMySQLExplainJSONActionResultValidationError) ErrorName() string { - return "StartMySQLExplainJSONActionResultValidationError" -} - -// Error satisfies the builtin error interface -func (e StartMySQLExplainJSONActionResultValidationError) 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 %sStartMySQLExplainJSONActionResult.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = StartMySQLExplainJSONActionResultValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = StartMySQLExplainJSONActionResultValidationError{} - -// Validate checks the field values on -// StartMySQLExplainTraditionalJSONActionParams 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 *StartMySQLExplainTraditionalJSONActionParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on -// StartMySQLExplainTraditionalJSONActionParams 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 -// StartMySQLExplainTraditionalJSONActionParamsMultiError, or nil if none found. -func (m *StartMySQLExplainTraditionalJSONActionParams) ValidateAll() error { - return m.validate(true) -} - -func (m *StartMySQLExplainTraditionalJSONActionParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for PmmAgentId - - if utf8.RuneCountInString(m.GetServiceId()) < 1 { - err := StartMySQLExplainTraditionalJSONActionParamsValidationError{ - field: "ServiceId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for QueryId - - // no validation rules for Database - - if len(errors) > 0 { - return StartMySQLExplainTraditionalJSONActionParamsMultiError(errors) - } - - return nil -} - -// StartMySQLExplainTraditionalJSONActionParamsMultiError is an error wrapping -// multiple validation errors returned by -// StartMySQLExplainTraditionalJSONActionParams.ValidateAll() if the -// designated constraints aren't met. -type StartMySQLExplainTraditionalJSONActionParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m StartMySQLExplainTraditionalJSONActionParamsMultiError) 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 StartMySQLExplainTraditionalJSONActionParamsMultiError) AllErrors() []error { return m } - -// StartMySQLExplainTraditionalJSONActionParamsValidationError is the -// validation error returned by -// StartMySQLExplainTraditionalJSONActionParams.Validate if the designated -// constraints aren't met. -type StartMySQLExplainTraditionalJSONActionParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e StartMySQLExplainTraditionalJSONActionParamsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e StartMySQLExplainTraditionalJSONActionParamsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e StartMySQLExplainTraditionalJSONActionParamsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e StartMySQLExplainTraditionalJSONActionParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e StartMySQLExplainTraditionalJSONActionParamsValidationError) ErrorName() string { - return "StartMySQLExplainTraditionalJSONActionParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e StartMySQLExplainTraditionalJSONActionParamsValidationError) 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 %sStartMySQLExplainTraditionalJSONActionParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = StartMySQLExplainTraditionalJSONActionParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = StartMySQLExplainTraditionalJSONActionParamsValidationError{} - -// Validate checks the field values on -// StartMySQLExplainTraditionalJSONActionResult 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 *StartMySQLExplainTraditionalJSONActionResult) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on -// StartMySQLExplainTraditionalJSONActionResult 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 -// StartMySQLExplainTraditionalJSONActionResultMultiError, or nil if none found. -func (m *StartMySQLExplainTraditionalJSONActionResult) ValidateAll() error { - return m.validate(true) -} - -func (m *StartMySQLExplainTraditionalJSONActionResult) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for ActionId - - // no validation rules for PmmAgentId - - if len(errors) > 0 { - return StartMySQLExplainTraditionalJSONActionResultMultiError(errors) - } - - return nil -} - -// StartMySQLExplainTraditionalJSONActionResultMultiError is an error wrapping -// multiple validation errors returned by -// StartMySQLExplainTraditionalJSONActionResult.ValidateAll() if the -// designated constraints aren't met. -type StartMySQLExplainTraditionalJSONActionResultMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m StartMySQLExplainTraditionalJSONActionResultMultiError) 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 StartMySQLExplainTraditionalJSONActionResultMultiError) AllErrors() []error { return m } - -// StartMySQLExplainTraditionalJSONActionResultValidationError is the -// validation error returned by -// StartMySQLExplainTraditionalJSONActionResult.Validate if the designated -// constraints aren't met. -type StartMySQLExplainTraditionalJSONActionResultValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e StartMySQLExplainTraditionalJSONActionResultValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e StartMySQLExplainTraditionalJSONActionResultValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e StartMySQLExplainTraditionalJSONActionResultValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e StartMySQLExplainTraditionalJSONActionResultValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e StartMySQLExplainTraditionalJSONActionResultValidationError) ErrorName() string { - return "StartMySQLExplainTraditionalJSONActionResultValidationError" -} - -// Error satisfies the builtin error interface -func (e StartMySQLExplainTraditionalJSONActionResultValidationError) 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 %sStartMySQLExplainTraditionalJSONActionResult.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = StartMySQLExplainTraditionalJSONActionResultValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = StartMySQLExplainTraditionalJSONActionResultValidationError{} - -// Validate checks the field values on StartMySQLShowCreateTableActionParams -// 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 *StartMySQLShowCreateTableActionParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on StartMySQLShowCreateTableActionParams -// 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 -// StartMySQLShowCreateTableActionParamsMultiError, or nil if none found. -func (m *StartMySQLShowCreateTableActionParams) ValidateAll() error { - return m.validate(true) -} - -func (m *StartMySQLShowCreateTableActionParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for PmmAgentId - - if utf8.RuneCountInString(m.GetServiceId()) < 1 { - err := StartMySQLShowCreateTableActionParamsValidationError{ - field: "ServiceId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if utf8.RuneCountInString(m.GetTableName()) < 1 { - err := StartMySQLShowCreateTableActionParamsValidationError{ - field: "TableName", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for Database - - if len(errors) > 0 { - return StartMySQLShowCreateTableActionParamsMultiError(errors) - } - - return nil -} - -// StartMySQLShowCreateTableActionParamsMultiError is an error wrapping -// multiple validation errors returned by -// StartMySQLShowCreateTableActionParams.ValidateAll() if the designated -// constraints aren't met. -type StartMySQLShowCreateTableActionParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m StartMySQLShowCreateTableActionParamsMultiError) 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 StartMySQLShowCreateTableActionParamsMultiError) AllErrors() []error { return m } - -// StartMySQLShowCreateTableActionParamsValidationError is the validation error -// returned by StartMySQLShowCreateTableActionParams.Validate if the -// designated constraints aren't met. -type StartMySQLShowCreateTableActionParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e StartMySQLShowCreateTableActionParamsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e StartMySQLShowCreateTableActionParamsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e StartMySQLShowCreateTableActionParamsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e StartMySQLShowCreateTableActionParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e StartMySQLShowCreateTableActionParamsValidationError) ErrorName() string { - return "StartMySQLShowCreateTableActionParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e StartMySQLShowCreateTableActionParamsValidationError) 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 %sStartMySQLShowCreateTableActionParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = StartMySQLShowCreateTableActionParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = StartMySQLShowCreateTableActionParamsValidationError{} - -// Validate checks the field values on StartMySQLShowCreateTableActionResult -// 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 *StartMySQLShowCreateTableActionResult) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on StartMySQLShowCreateTableActionResult -// 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 -// StartMySQLShowCreateTableActionResultMultiError, or nil if none found. -func (m *StartMySQLShowCreateTableActionResult) ValidateAll() error { - return m.validate(true) -} - -func (m *StartMySQLShowCreateTableActionResult) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for ActionId - - // no validation rules for PmmAgentId - - if len(errors) > 0 { - return StartMySQLShowCreateTableActionResultMultiError(errors) - } - - return nil -} - -// StartMySQLShowCreateTableActionResultMultiError is an error wrapping -// multiple validation errors returned by -// StartMySQLShowCreateTableActionResult.ValidateAll() if the designated -// constraints aren't met. -type StartMySQLShowCreateTableActionResultMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m StartMySQLShowCreateTableActionResultMultiError) 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 StartMySQLShowCreateTableActionResultMultiError) AllErrors() []error { return m } - -// StartMySQLShowCreateTableActionResultValidationError is the validation error -// returned by StartMySQLShowCreateTableActionResult.Validate if the -// designated constraints aren't met. -type StartMySQLShowCreateTableActionResultValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e StartMySQLShowCreateTableActionResultValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e StartMySQLShowCreateTableActionResultValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e StartMySQLShowCreateTableActionResultValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e StartMySQLShowCreateTableActionResultValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e StartMySQLShowCreateTableActionResultValidationError) ErrorName() string { - return "StartMySQLShowCreateTableActionResultValidationError" -} - -// Error satisfies the builtin error interface -func (e StartMySQLShowCreateTableActionResultValidationError) 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 %sStartMySQLShowCreateTableActionResult.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = StartMySQLShowCreateTableActionResultValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = StartMySQLShowCreateTableActionResultValidationError{} - -// Validate checks the field values on StartMySQLShowTableStatusActionParams -// 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 *StartMySQLShowTableStatusActionParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on StartMySQLShowTableStatusActionParams -// 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 -// StartMySQLShowTableStatusActionParamsMultiError, or nil if none found. -func (m *StartMySQLShowTableStatusActionParams) ValidateAll() error { - return m.validate(true) -} - -func (m *StartMySQLShowTableStatusActionParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for PmmAgentId - - if utf8.RuneCountInString(m.GetServiceId()) < 1 { - err := StartMySQLShowTableStatusActionParamsValidationError{ - field: "ServiceId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if utf8.RuneCountInString(m.GetTableName()) < 1 { - err := StartMySQLShowTableStatusActionParamsValidationError{ - field: "TableName", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for Database - - if len(errors) > 0 { - return StartMySQLShowTableStatusActionParamsMultiError(errors) - } - - return nil -} - -// StartMySQLShowTableStatusActionParamsMultiError is an error wrapping -// multiple validation errors returned by -// StartMySQLShowTableStatusActionParams.ValidateAll() if the designated -// constraints aren't met. -type StartMySQLShowTableStatusActionParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m StartMySQLShowTableStatusActionParamsMultiError) 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 StartMySQLShowTableStatusActionParamsMultiError) AllErrors() []error { return m } - -// StartMySQLShowTableStatusActionParamsValidationError is the validation error -// returned by StartMySQLShowTableStatusActionParams.Validate if the -// designated constraints aren't met. -type StartMySQLShowTableStatusActionParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e StartMySQLShowTableStatusActionParamsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e StartMySQLShowTableStatusActionParamsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e StartMySQLShowTableStatusActionParamsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e StartMySQLShowTableStatusActionParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e StartMySQLShowTableStatusActionParamsValidationError) ErrorName() string { - return "StartMySQLShowTableStatusActionParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e StartMySQLShowTableStatusActionParamsValidationError) 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 %sStartMySQLShowTableStatusActionParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = StartMySQLShowTableStatusActionParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = StartMySQLShowTableStatusActionParamsValidationError{} - -// Validate checks the field values on StartMySQLShowTableStatusActionResult -// 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 *StartMySQLShowTableStatusActionResult) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on StartMySQLShowTableStatusActionResult -// 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 -// StartMySQLShowTableStatusActionResultMultiError, or nil if none found. -func (m *StartMySQLShowTableStatusActionResult) ValidateAll() error { - return m.validate(true) -} - -func (m *StartMySQLShowTableStatusActionResult) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for ActionId - - // no validation rules for PmmAgentId - - if len(errors) > 0 { - return StartMySQLShowTableStatusActionResultMultiError(errors) - } - - return nil -} - -// StartMySQLShowTableStatusActionResultMultiError is an error wrapping -// multiple validation errors returned by -// StartMySQLShowTableStatusActionResult.ValidateAll() if the designated -// constraints aren't met. -type StartMySQLShowTableStatusActionResultMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m StartMySQLShowTableStatusActionResultMultiError) 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 StartMySQLShowTableStatusActionResultMultiError) AllErrors() []error { return m } - -// StartMySQLShowTableStatusActionResultValidationError is the validation error -// returned by StartMySQLShowTableStatusActionResult.Validate if the -// designated constraints aren't met. -type StartMySQLShowTableStatusActionResultValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e StartMySQLShowTableStatusActionResultValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e StartMySQLShowTableStatusActionResultValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e StartMySQLShowTableStatusActionResultValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e StartMySQLShowTableStatusActionResultValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e StartMySQLShowTableStatusActionResultValidationError) ErrorName() string { - return "StartMySQLShowTableStatusActionResultValidationError" -} - -// Error satisfies the builtin error interface -func (e StartMySQLShowTableStatusActionResultValidationError) 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 %sStartMySQLShowTableStatusActionResult.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = StartMySQLShowTableStatusActionResultValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = StartMySQLShowTableStatusActionResultValidationError{} - -// Validate checks the field values on StartMySQLShowIndexActionParams 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 *StartMySQLShowIndexActionParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on StartMySQLShowIndexActionParams 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 -// StartMySQLShowIndexActionParamsMultiError, or nil if none found. -func (m *StartMySQLShowIndexActionParams) ValidateAll() error { - return m.validate(true) -} - -func (m *StartMySQLShowIndexActionParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for PmmAgentId - - if utf8.RuneCountInString(m.GetServiceId()) < 1 { - err := StartMySQLShowIndexActionParamsValidationError{ - field: "ServiceId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if utf8.RuneCountInString(m.GetTableName()) < 1 { - err := StartMySQLShowIndexActionParamsValidationError{ - field: "TableName", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for Database - - if len(errors) > 0 { - return StartMySQLShowIndexActionParamsMultiError(errors) - } - - return nil -} - -// StartMySQLShowIndexActionParamsMultiError is an error wrapping multiple -// validation errors returned by StartMySQLShowIndexActionParams.ValidateAll() -// if the designated constraints aren't met. -type StartMySQLShowIndexActionParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m StartMySQLShowIndexActionParamsMultiError) 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 StartMySQLShowIndexActionParamsMultiError) AllErrors() []error { return m } - -// StartMySQLShowIndexActionParamsValidationError is the validation error -// returned by StartMySQLShowIndexActionParams.Validate if the designated -// constraints aren't met. -type StartMySQLShowIndexActionParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e StartMySQLShowIndexActionParamsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e StartMySQLShowIndexActionParamsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e StartMySQLShowIndexActionParamsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e StartMySQLShowIndexActionParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e StartMySQLShowIndexActionParamsValidationError) ErrorName() string { - return "StartMySQLShowIndexActionParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e StartMySQLShowIndexActionParamsValidationError) 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 %sStartMySQLShowIndexActionParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = StartMySQLShowIndexActionParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = StartMySQLShowIndexActionParamsValidationError{} - -// Validate checks the field values on StartMySQLShowIndexActionResult 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 *StartMySQLShowIndexActionResult) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on StartMySQLShowIndexActionResult 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 -// StartMySQLShowIndexActionResultMultiError, or nil if none found. -func (m *StartMySQLShowIndexActionResult) ValidateAll() error { - return m.validate(true) -} - -func (m *StartMySQLShowIndexActionResult) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for ActionId - - // no validation rules for PmmAgentId - - if len(errors) > 0 { - return StartMySQLShowIndexActionResultMultiError(errors) - } - - return nil -} - -// StartMySQLShowIndexActionResultMultiError is an error wrapping multiple -// validation errors returned by StartMySQLShowIndexActionResult.ValidateAll() -// if the designated constraints aren't met. -type StartMySQLShowIndexActionResultMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m StartMySQLShowIndexActionResultMultiError) 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 StartMySQLShowIndexActionResultMultiError) AllErrors() []error { return m } - -// StartMySQLShowIndexActionResultValidationError is the validation error -// returned by StartMySQLShowIndexActionResult.Validate if the designated -// constraints aren't met. -type StartMySQLShowIndexActionResultValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e StartMySQLShowIndexActionResultValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e StartMySQLShowIndexActionResultValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e StartMySQLShowIndexActionResultValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e StartMySQLShowIndexActionResultValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e StartMySQLShowIndexActionResultValidationError) ErrorName() string { - return "StartMySQLShowIndexActionResultValidationError" -} - -// Error satisfies the builtin error interface -func (e StartMySQLShowIndexActionResultValidationError) 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 %sStartMySQLShowIndexActionResult.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = StartMySQLShowIndexActionResultValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = StartMySQLShowIndexActionResultValidationError{} - -// Validate checks the field values on -// StartPostgreSQLShowCreateTableActionParams 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 *StartPostgreSQLShowCreateTableActionParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on -// StartPostgreSQLShowCreateTableActionParams 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 -// StartPostgreSQLShowCreateTableActionParamsMultiError, or nil if none found. -func (m *StartPostgreSQLShowCreateTableActionParams) ValidateAll() error { - return m.validate(true) -} - -func (m *StartPostgreSQLShowCreateTableActionParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for PmmAgentId - - if utf8.RuneCountInString(m.GetServiceId()) < 1 { - err := StartPostgreSQLShowCreateTableActionParamsValidationError{ - field: "ServiceId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if utf8.RuneCountInString(m.GetTableName()) < 1 { - err := StartPostgreSQLShowCreateTableActionParamsValidationError{ - field: "TableName", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for Database - - if len(errors) > 0 { - return StartPostgreSQLShowCreateTableActionParamsMultiError(errors) - } - - return nil -} - -// StartPostgreSQLShowCreateTableActionParamsMultiError is an error wrapping -// multiple validation errors returned by -// StartPostgreSQLShowCreateTableActionParams.ValidateAll() if the designated -// constraints aren't met. -type StartPostgreSQLShowCreateTableActionParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m StartPostgreSQLShowCreateTableActionParamsMultiError) 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 StartPostgreSQLShowCreateTableActionParamsMultiError) AllErrors() []error { return m } - -// StartPostgreSQLShowCreateTableActionParamsValidationError is the validation -// error returned by StartPostgreSQLShowCreateTableActionParams.Validate if -// the designated constraints aren't met. -type StartPostgreSQLShowCreateTableActionParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e StartPostgreSQLShowCreateTableActionParamsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e StartPostgreSQLShowCreateTableActionParamsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e StartPostgreSQLShowCreateTableActionParamsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e StartPostgreSQLShowCreateTableActionParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e StartPostgreSQLShowCreateTableActionParamsValidationError) ErrorName() string { - return "StartPostgreSQLShowCreateTableActionParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e StartPostgreSQLShowCreateTableActionParamsValidationError) 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 %sStartPostgreSQLShowCreateTableActionParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = StartPostgreSQLShowCreateTableActionParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = StartPostgreSQLShowCreateTableActionParamsValidationError{} - -// Validate checks the field values on -// StartPostgreSQLShowCreateTableActionResult 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 *StartPostgreSQLShowCreateTableActionResult) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on -// StartPostgreSQLShowCreateTableActionResult 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 -// StartPostgreSQLShowCreateTableActionResultMultiError, or nil if none found. -func (m *StartPostgreSQLShowCreateTableActionResult) ValidateAll() error { - return m.validate(true) -} - -func (m *StartPostgreSQLShowCreateTableActionResult) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for ActionId - - // no validation rules for PmmAgentId - - if len(errors) > 0 { - return StartPostgreSQLShowCreateTableActionResultMultiError(errors) - } - - return nil -} - -// StartPostgreSQLShowCreateTableActionResultMultiError is an error wrapping -// multiple validation errors returned by -// StartPostgreSQLShowCreateTableActionResult.ValidateAll() if the designated -// constraints aren't met. -type StartPostgreSQLShowCreateTableActionResultMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m StartPostgreSQLShowCreateTableActionResultMultiError) 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 StartPostgreSQLShowCreateTableActionResultMultiError) AllErrors() []error { return m } - -// StartPostgreSQLShowCreateTableActionResultValidationError is the validation -// error returned by StartPostgreSQLShowCreateTableActionResult.Validate if -// the designated constraints aren't met. -type StartPostgreSQLShowCreateTableActionResultValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e StartPostgreSQLShowCreateTableActionResultValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e StartPostgreSQLShowCreateTableActionResultValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e StartPostgreSQLShowCreateTableActionResultValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e StartPostgreSQLShowCreateTableActionResultValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e StartPostgreSQLShowCreateTableActionResultValidationError) ErrorName() string { - return "StartPostgreSQLShowCreateTableActionResultValidationError" -} - -// Error satisfies the builtin error interface -func (e StartPostgreSQLShowCreateTableActionResultValidationError) 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 %sStartPostgreSQLShowCreateTableActionResult.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = StartPostgreSQLShowCreateTableActionResultValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = StartPostgreSQLShowCreateTableActionResultValidationError{} - -// Validate checks the field values on StartPostgreSQLShowIndexActionParams -// 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 *StartPostgreSQLShowIndexActionParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on StartPostgreSQLShowIndexActionParams -// 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 -// StartPostgreSQLShowIndexActionParamsMultiError, or nil if none found. -func (m *StartPostgreSQLShowIndexActionParams) ValidateAll() error { - return m.validate(true) -} - -func (m *StartPostgreSQLShowIndexActionParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for PmmAgentId - - if utf8.RuneCountInString(m.GetServiceId()) < 1 { - err := StartPostgreSQLShowIndexActionParamsValidationError{ - field: "ServiceId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if utf8.RuneCountInString(m.GetTableName()) < 1 { - err := StartPostgreSQLShowIndexActionParamsValidationError{ - field: "TableName", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for Database - - if len(errors) > 0 { - return StartPostgreSQLShowIndexActionParamsMultiError(errors) - } - - return nil -} - -// StartPostgreSQLShowIndexActionParamsMultiError is an error wrapping multiple -// validation errors returned by -// StartPostgreSQLShowIndexActionParams.ValidateAll() if the designated -// constraints aren't met. -type StartPostgreSQLShowIndexActionParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m StartPostgreSQLShowIndexActionParamsMultiError) 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 StartPostgreSQLShowIndexActionParamsMultiError) AllErrors() []error { return m } - -// StartPostgreSQLShowIndexActionParamsValidationError is the validation error -// returned by StartPostgreSQLShowIndexActionParams.Validate if the designated -// constraints aren't met. -type StartPostgreSQLShowIndexActionParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e StartPostgreSQLShowIndexActionParamsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e StartPostgreSQLShowIndexActionParamsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e StartPostgreSQLShowIndexActionParamsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e StartPostgreSQLShowIndexActionParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e StartPostgreSQLShowIndexActionParamsValidationError) ErrorName() string { - return "StartPostgreSQLShowIndexActionParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e StartPostgreSQLShowIndexActionParamsValidationError) 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 %sStartPostgreSQLShowIndexActionParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = StartPostgreSQLShowIndexActionParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = StartPostgreSQLShowIndexActionParamsValidationError{} - -// Validate checks the field values on StartPostgreSQLShowIndexActionResult -// 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 *StartPostgreSQLShowIndexActionResult) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on StartPostgreSQLShowIndexActionResult -// 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 -// StartPostgreSQLShowIndexActionResultMultiError, or nil if none found. -func (m *StartPostgreSQLShowIndexActionResult) ValidateAll() error { - return m.validate(true) -} - -func (m *StartPostgreSQLShowIndexActionResult) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for ActionId - - // no validation rules for PmmAgentId - - if len(errors) > 0 { - return StartPostgreSQLShowIndexActionResultMultiError(errors) - } - - return nil -} - -// StartPostgreSQLShowIndexActionResultMultiError is an error wrapping multiple -// validation errors returned by -// StartPostgreSQLShowIndexActionResult.ValidateAll() if the designated -// constraints aren't met. -type StartPostgreSQLShowIndexActionResultMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m StartPostgreSQLShowIndexActionResultMultiError) 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 StartPostgreSQLShowIndexActionResultMultiError) AllErrors() []error { return m } - -// StartPostgreSQLShowIndexActionResultValidationError is the validation error -// returned by StartPostgreSQLShowIndexActionResult.Validate if the designated -// constraints aren't met. -type StartPostgreSQLShowIndexActionResultValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e StartPostgreSQLShowIndexActionResultValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e StartPostgreSQLShowIndexActionResultValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e StartPostgreSQLShowIndexActionResultValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e StartPostgreSQLShowIndexActionResultValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e StartPostgreSQLShowIndexActionResultValidationError) ErrorName() string { - return "StartPostgreSQLShowIndexActionResultValidationError" -} - -// Error satisfies the builtin error interface -func (e StartPostgreSQLShowIndexActionResultValidationError) 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 %sStartPostgreSQLShowIndexActionResult.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = StartPostgreSQLShowIndexActionResultValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = StartPostgreSQLShowIndexActionResultValidationError{} - -// Validate checks the field values on StartMongoDBExplainActionParams 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 *StartMongoDBExplainActionParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on StartMongoDBExplainActionParams 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 -// StartMongoDBExplainActionParamsMultiError, or nil if none found. -func (m *StartMongoDBExplainActionParams) ValidateAll() error { - return m.validate(true) -} - -func (m *StartMongoDBExplainActionParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for PmmAgentId - - if utf8.RuneCountInString(m.GetServiceId()) < 1 { - err := StartMongoDBExplainActionParamsValidationError{ - field: "ServiceId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if utf8.RuneCountInString(m.GetQuery()) < 1 { - err := StartMongoDBExplainActionParamsValidationError{ - field: "Query", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if len(errors) > 0 { - return StartMongoDBExplainActionParamsMultiError(errors) - } - - return nil -} - -// StartMongoDBExplainActionParamsMultiError is an error wrapping multiple -// validation errors returned by StartMongoDBExplainActionParams.ValidateAll() -// if the designated constraints aren't met. -type StartMongoDBExplainActionParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m StartMongoDBExplainActionParamsMultiError) 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 StartMongoDBExplainActionParamsMultiError) AllErrors() []error { return m } - -// StartMongoDBExplainActionParamsValidationError is the validation error -// returned by StartMongoDBExplainActionParams.Validate if the designated -// constraints aren't met. -type StartMongoDBExplainActionParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e StartMongoDBExplainActionParamsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e StartMongoDBExplainActionParamsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e StartMongoDBExplainActionParamsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e StartMongoDBExplainActionParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e StartMongoDBExplainActionParamsValidationError) ErrorName() string { - return "StartMongoDBExplainActionParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e StartMongoDBExplainActionParamsValidationError) 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 %sStartMongoDBExplainActionParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = StartMongoDBExplainActionParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = StartMongoDBExplainActionParamsValidationError{} - -// Validate checks the field values on StartMongoDBExplainActionResult 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 *StartMongoDBExplainActionResult) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on StartMongoDBExplainActionResult 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 -// StartMongoDBExplainActionResultMultiError, or nil if none found. -func (m *StartMongoDBExplainActionResult) ValidateAll() error { - return m.validate(true) -} - -func (m *StartMongoDBExplainActionResult) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for ActionId - - // no validation rules for PmmAgentId - - if len(errors) > 0 { - return StartMongoDBExplainActionResultMultiError(errors) - } - - return nil -} - -// StartMongoDBExplainActionResultMultiError is an error wrapping multiple -// validation errors returned by StartMongoDBExplainActionResult.ValidateAll() -// if the designated constraints aren't met. -type StartMongoDBExplainActionResultMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m StartMongoDBExplainActionResultMultiError) 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 StartMongoDBExplainActionResultMultiError) AllErrors() []error { return m } - -// StartMongoDBExplainActionResultValidationError is the validation error -// returned by StartMongoDBExplainActionResult.Validate if the designated -// constraints aren't met. -type StartMongoDBExplainActionResultValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e StartMongoDBExplainActionResultValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e StartMongoDBExplainActionResultValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e StartMongoDBExplainActionResultValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e StartMongoDBExplainActionResultValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e StartMongoDBExplainActionResultValidationError) ErrorName() string { - return "StartMongoDBExplainActionResultValidationError" -} - -// Error satisfies the builtin error interface -func (e StartMongoDBExplainActionResultValidationError) 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 %sStartMongoDBExplainActionResult.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = StartMongoDBExplainActionResultValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = StartMongoDBExplainActionResultValidationError{} - -// Validate checks the field values on StartPTPgSummaryActionParams 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 *StartPTPgSummaryActionParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on StartPTPgSummaryActionParams 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 -// StartPTPgSummaryActionParamsMultiError, or nil if none found. -func (m *StartPTPgSummaryActionParams) ValidateAll() error { - return m.validate(true) -} - -func (m *StartPTPgSummaryActionParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for PmmAgentId - - // no validation rules for ServiceId - - if len(errors) > 0 { - return StartPTPgSummaryActionParamsMultiError(errors) - } - - return nil -} - -// StartPTPgSummaryActionParamsMultiError is an error wrapping multiple -// validation errors returned by StartPTPgSummaryActionParams.ValidateAll() if -// the designated constraints aren't met. -type StartPTPgSummaryActionParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m StartPTPgSummaryActionParamsMultiError) 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 StartPTPgSummaryActionParamsMultiError) AllErrors() []error { return m } - -// StartPTPgSummaryActionParamsValidationError is the validation error returned -// by StartPTPgSummaryActionParams.Validate if the designated constraints -// aren't met. -type StartPTPgSummaryActionParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e StartPTPgSummaryActionParamsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e StartPTPgSummaryActionParamsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e StartPTPgSummaryActionParamsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e StartPTPgSummaryActionParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e StartPTPgSummaryActionParamsValidationError) ErrorName() string { - return "StartPTPgSummaryActionParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e StartPTPgSummaryActionParamsValidationError) 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 %sStartPTPgSummaryActionParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = StartPTPgSummaryActionParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = StartPTPgSummaryActionParamsValidationError{} - -// Validate checks the field values on StartPTPgSummaryActionResult 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 *StartPTPgSummaryActionResult) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on StartPTPgSummaryActionResult 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 -// StartPTPgSummaryActionResultMultiError, or nil if none found. -func (m *StartPTPgSummaryActionResult) ValidateAll() error { - return m.validate(true) -} - -func (m *StartPTPgSummaryActionResult) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for ActionId - - // no validation rules for PmmAgentId - - if len(errors) > 0 { - return StartPTPgSummaryActionResultMultiError(errors) - } - - return nil -} - -// StartPTPgSummaryActionResultMultiError is an error wrapping multiple -// validation errors returned by StartPTPgSummaryActionResult.ValidateAll() if -// the designated constraints aren't met. -type StartPTPgSummaryActionResultMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m StartPTPgSummaryActionResultMultiError) 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 StartPTPgSummaryActionResultMultiError) AllErrors() []error { return m } - -// StartPTPgSummaryActionResultValidationError is the validation error returned -// by StartPTPgSummaryActionResult.Validate if the designated constraints -// aren't met. -type StartPTPgSummaryActionResultValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e StartPTPgSummaryActionResultValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e StartPTPgSummaryActionResultValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e StartPTPgSummaryActionResultValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e StartPTPgSummaryActionResultValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e StartPTPgSummaryActionResultValidationError) ErrorName() string { - return "StartPTPgSummaryActionResultValidationError" -} - -// Error satisfies the builtin error interface -func (e StartPTPgSummaryActionResultValidationError) 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 %sStartPTPgSummaryActionResult.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = StartPTPgSummaryActionResultValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = StartPTPgSummaryActionResultValidationError{} - -// Validate checks the field values on StartPTMongoDBSummaryActionParams 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 *StartPTMongoDBSummaryActionParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on StartPTMongoDBSummaryActionParams -// 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 -// StartPTMongoDBSummaryActionParamsMultiError, or nil if none found. -func (m *StartPTMongoDBSummaryActionParams) ValidateAll() error { - return m.validate(true) -} - -func (m *StartPTMongoDBSummaryActionParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for PmmAgentId - - // no validation rules for ServiceId - - if len(errors) > 0 { - return StartPTMongoDBSummaryActionParamsMultiError(errors) - } - - return nil -} - -// StartPTMongoDBSummaryActionParamsMultiError is an error wrapping multiple -// validation errors returned by -// StartPTMongoDBSummaryActionParams.ValidateAll() if the designated -// constraints aren't met. -type StartPTMongoDBSummaryActionParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m StartPTMongoDBSummaryActionParamsMultiError) 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 StartPTMongoDBSummaryActionParamsMultiError) AllErrors() []error { return m } - -// StartPTMongoDBSummaryActionParamsValidationError is the validation error -// returned by StartPTMongoDBSummaryActionParams.Validate if the designated -// constraints aren't met. -type StartPTMongoDBSummaryActionParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e StartPTMongoDBSummaryActionParamsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e StartPTMongoDBSummaryActionParamsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e StartPTMongoDBSummaryActionParamsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e StartPTMongoDBSummaryActionParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e StartPTMongoDBSummaryActionParamsValidationError) ErrorName() string { - return "StartPTMongoDBSummaryActionParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e StartPTMongoDBSummaryActionParamsValidationError) 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 %sStartPTMongoDBSummaryActionParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = StartPTMongoDBSummaryActionParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = StartPTMongoDBSummaryActionParamsValidationError{} - -// Validate checks the field values on StartPTMongoDBSummaryActionResult 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 *StartPTMongoDBSummaryActionResult) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on StartPTMongoDBSummaryActionResult -// 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 -// StartPTMongoDBSummaryActionResultMultiError, or nil if none found. -func (m *StartPTMongoDBSummaryActionResult) ValidateAll() error { - return m.validate(true) -} - -func (m *StartPTMongoDBSummaryActionResult) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for ActionId - - // no validation rules for PmmAgentId - - if len(errors) > 0 { - return StartPTMongoDBSummaryActionResultMultiError(errors) - } - - return nil -} - -// StartPTMongoDBSummaryActionResultMultiError is an error wrapping multiple -// validation errors returned by -// StartPTMongoDBSummaryActionResult.ValidateAll() if the designated -// constraints aren't met. -type StartPTMongoDBSummaryActionResultMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m StartPTMongoDBSummaryActionResultMultiError) 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 StartPTMongoDBSummaryActionResultMultiError) AllErrors() []error { return m } - -// StartPTMongoDBSummaryActionResultValidationError is the validation error -// returned by StartPTMongoDBSummaryActionResult.Validate if the designated -// constraints aren't met. -type StartPTMongoDBSummaryActionResultValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e StartPTMongoDBSummaryActionResultValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e StartPTMongoDBSummaryActionResultValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e StartPTMongoDBSummaryActionResultValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e StartPTMongoDBSummaryActionResultValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e StartPTMongoDBSummaryActionResultValidationError) ErrorName() string { - return "StartPTMongoDBSummaryActionResultValidationError" -} - -// Error satisfies the builtin error interface -func (e StartPTMongoDBSummaryActionResultValidationError) 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 %sStartPTMongoDBSummaryActionResult.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = StartPTMongoDBSummaryActionResultValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = StartPTMongoDBSummaryActionResultValidationError{} - -// Validate checks the field values on StartPTMySQLSummaryActionParams 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 *StartPTMySQLSummaryActionParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on StartPTMySQLSummaryActionParams 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 -// StartPTMySQLSummaryActionParamsMultiError, or nil if none found. -func (m *StartPTMySQLSummaryActionParams) ValidateAll() error { - return m.validate(true) -} - -func (m *StartPTMySQLSummaryActionParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for PmmAgentId - - // no validation rules for ServiceId - - if len(errors) > 0 { - return StartPTMySQLSummaryActionParamsMultiError(errors) - } - - return nil -} - -// StartPTMySQLSummaryActionParamsMultiError is an error wrapping multiple -// validation errors returned by StartPTMySQLSummaryActionParams.ValidateAll() -// if the designated constraints aren't met. -type StartPTMySQLSummaryActionParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m StartPTMySQLSummaryActionParamsMultiError) 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 StartPTMySQLSummaryActionParamsMultiError) AllErrors() []error { return m } - -// StartPTMySQLSummaryActionParamsValidationError is the validation error -// returned by StartPTMySQLSummaryActionParams.Validate if the designated -// constraints aren't met. -type StartPTMySQLSummaryActionParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e StartPTMySQLSummaryActionParamsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e StartPTMySQLSummaryActionParamsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e StartPTMySQLSummaryActionParamsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e StartPTMySQLSummaryActionParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e StartPTMySQLSummaryActionParamsValidationError) ErrorName() string { - return "StartPTMySQLSummaryActionParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e StartPTMySQLSummaryActionParamsValidationError) 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 %sStartPTMySQLSummaryActionParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = StartPTMySQLSummaryActionParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = StartPTMySQLSummaryActionParamsValidationError{} - -// Validate checks the field values on StartPTMySQLSummaryActionResult 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 *StartPTMySQLSummaryActionResult) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on StartPTMySQLSummaryActionResult 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 -// StartPTMySQLSummaryActionResultMultiError, or nil if none found. -func (m *StartPTMySQLSummaryActionResult) ValidateAll() error { - return m.validate(true) -} - -func (m *StartPTMySQLSummaryActionResult) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for ActionId - - // no validation rules for PmmAgentId - - if len(errors) > 0 { - return StartPTMySQLSummaryActionResultMultiError(errors) - } - - return nil -} - -// StartPTMySQLSummaryActionResultMultiError is an error wrapping multiple -// validation errors returned by StartPTMySQLSummaryActionResult.ValidateAll() -// if the designated constraints aren't met. -type StartPTMySQLSummaryActionResultMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m StartPTMySQLSummaryActionResultMultiError) 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 StartPTMySQLSummaryActionResultMultiError) AllErrors() []error { return m } - -// StartPTMySQLSummaryActionResultValidationError is the validation error -// returned by StartPTMySQLSummaryActionResult.Validate if the designated -// constraints aren't met. -type StartPTMySQLSummaryActionResultValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e StartPTMySQLSummaryActionResultValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e StartPTMySQLSummaryActionResultValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e StartPTMySQLSummaryActionResultValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e StartPTMySQLSummaryActionResultValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e StartPTMySQLSummaryActionResultValidationError) ErrorName() string { - return "StartPTMySQLSummaryActionResultValidationError" -} - -// Error satisfies the builtin error interface -func (e StartPTMySQLSummaryActionResultValidationError) 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 %sStartPTMySQLSummaryActionResult.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = StartPTMySQLSummaryActionResultValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = StartPTMySQLSummaryActionResultValidationError{} - -// Validate checks the field values on StartPTSummaryActionRequest 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 *StartPTSummaryActionRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on StartPTSummaryActionRequest 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 -// StartPTSummaryActionRequestMultiError, or nil if none found. -func (m *StartPTSummaryActionRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *StartPTSummaryActionRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for PmmAgentId - - // no validation rules for NodeId - - if len(errors) > 0 { - return StartPTSummaryActionRequestMultiError(errors) - } - - return nil -} - -// StartPTSummaryActionRequestMultiError is an error wrapping multiple -// validation errors returned by StartPTSummaryActionRequest.ValidateAll() if -// the designated constraints aren't met. -type StartPTSummaryActionRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m StartPTSummaryActionRequestMultiError) 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 StartPTSummaryActionRequestMultiError) AllErrors() []error { return m } - -// StartPTSummaryActionRequestValidationError is the validation error returned -// by StartPTSummaryActionRequest.Validate if the designated constraints -// aren't met. -type StartPTSummaryActionRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e StartPTSummaryActionRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e StartPTSummaryActionRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e StartPTSummaryActionRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e StartPTSummaryActionRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e StartPTSummaryActionRequestValidationError) ErrorName() string { - return "StartPTSummaryActionRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e StartPTSummaryActionRequestValidationError) 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 %sStartPTSummaryActionRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = StartPTSummaryActionRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = StartPTSummaryActionRequestValidationError{} - -// Validate checks the field values on StartPTSummaryActionResponse 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 *StartPTSummaryActionResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on StartPTSummaryActionResponse 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 -// StartPTSummaryActionResponseMultiError, or nil if none found. -func (m *StartPTSummaryActionResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *StartPTSummaryActionResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for ActionId - - // no validation rules for PmmAgentId - - if len(errors) > 0 { - return StartPTSummaryActionResponseMultiError(errors) - } - - return nil -} - -// StartPTSummaryActionResponseMultiError is an error wrapping multiple -// validation errors returned by StartPTSummaryActionResponse.ValidateAll() if -// the designated constraints aren't met. -type StartPTSummaryActionResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m StartPTSummaryActionResponseMultiError) 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 StartPTSummaryActionResponseMultiError) AllErrors() []error { return m } - -// StartPTSummaryActionResponseValidationError is the validation error returned -// by StartPTSummaryActionResponse.Validate if the designated constraints -// aren't met. -type StartPTSummaryActionResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e StartPTSummaryActionResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e StartPTSummaryActionResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e StartPTSummaryActionResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e StartPTSummaryActionResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e StartPTSummaryActionResponseValidationError) ErrorName() string { - return "StartPTSummaryActionResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e StartPTSummaryActionResponseValidationError) 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 %sStartPTSummaryActionResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = StartPTSummaryActionResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = StartPTSummaryActionResponseValidationError{} - -// Validate checks the field values on CancelActionRequest 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 *CancelActionRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on CancelActionRequest 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 -// CancelActionRequestMultiError, or nil if none found. -func (m *CancelActionRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *CancelActionRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetActionId()) < 1 { - err := CancelActionRequestValidationError{ - field: "ActionId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if len(errors) > 0 { - return CancelActionRequestMultiError(errors) - } - - return nil -} - -// CancelActionRequestMultiError is an error wrapping multiple validation -// errors returned by CancelActionRequest.ValidateAll() if the designated -// constraints aren't met. -type CancelActionRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m CancelActionRequestMultiError) 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 CancelActionRequestMultiError) AllErrors() []error { return m } - -// CancelActionRequestValidationError is the validation error returned by -// CancelActionRequest.Validate if the designated constraints aren't met. -type CancelActionRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e CancelActionRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e CancelActionRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e CancelActionRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e CancelActionRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e CancelActionRequestValidationError) ErrorName() string { - return "CancelActionRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e CancelActionRequestValidationError) 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 %sCancelActionRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = CancelActionRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = CancelActionRequestValidationError{} - -// Validate checks the field values on CancelActionResponse 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 *CancelActionResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on CancelActionResponse 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 -// CancelActionResponseMultiError, or nil if none found. -func (m *CancelActionResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *CancelActionResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return CancelActionResponseMultiError(errors) - } - - return nil -} - -// CancelActionResponseMultiError is an error wrapping multiple validation -// errors returned by CancelActionResponse.ValidateAll() if the designated -// constraints aren't met. -type CancelActionResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m CancelActionResponseMultiError) 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 CancelActionResponseMultiError) AllErrors() []error { return m } - -// CancelActionResponseValidationError is the validation error returned by -// CancelActionResponse.Validate if the designated constraints aren't met. -type CancelActionResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e CancelActionResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e CancelActionResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e CancelActionResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e CancelActionResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e CancelActionResponseValidationError) ErrorName() string { - return "CancelActionResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e CancelActionResponseValidationError) 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 %sCancelActionResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = CancelActionResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = CancelActionResponseValidationError{} - -// Validate checks the field values on StartServiceActionRequest 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 *StartServiceActionRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on StartServiceActionRequest 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 -// StartServiceActionRequestMultiError, or nil if none found. -func (m *StartServiceActionRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *StartServiceActionRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - switch v := m.Action.(type) { - case *StartServiceActionRequest_MysqlExplain: - if v == nil { - err := StartServiceActionRequestValidationError{ - field: "Action", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetMysqlExplain()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, StartServiceActionRequestValidationError{ - field: "MysqlExplain", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, StartServiceActionRequestValidationError{ - field: "MysqlExplain", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMysqlExplain()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return StartServiceActionRequestValidationError{ - field: "MysqlExplain", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *StartServiceActionRequest_MysqlExplainJson: - if v == nil { - err := StartServiceActionRequestValidationError{ - field: "Action", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetMysqlExplainJson()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, StartServiceActionRequestValidationError{ - field: "MysqlExplainJson", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, StartServiceActionRequestValidationError{ - field: "MysqlExplainJson", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMysqlExplainJson()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return StartServiceActionRequestValidationError{ - field: "MysqlExplainJson", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *StartServiceActionRequest_MysqlExplainTraditionalJson: - if v == nil { - err := StartServiceActionRequestValidationError{ - field: "Action", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetMysqlExplainTraditionalJson()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, StartServiceActionRequestValidationError{ - field: "MysqlExplainTraditionalJson", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, StartServiceActionRequestValidationError{ - field: "MysqlExplainTraditionalJson", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMysqlExplainTraditionalJson()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return StartServiceActionRequestValidationError{ - field: "MysqlExplainTraditionalJson", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *StartServiceActionRequest_MysqlShowIndex: - if v == nil { - err := StartServiceActionRequestValidationError{ - field: "Action", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetMysqlShowIndex()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, StartServiceActionRequestValidationError{ - field: "MysqlShowIndex", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, StartServiceActionRequestValidationError{ - field: "MysqlShowIndex", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMysqlShowIndex()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return StartServiceActionRequestValidationError{ - field: "MysqlShowIndex", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *StartServiceActionRequest_MysqlShowCreateTable: - if v == nil { - err := StartServiceActionRequestValidationError{ - field: "Action", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetMysqlShowCreateTable()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, StartServiceActionRequestValidationError{ - field: "MysqlShowCreateTable", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, StartServiceActionRequestValidationError{ - field: "MysqlShowCreateTable", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMysqlShowCreateTable()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return StartServiceActionRequestValidationError{ - field: "MysqlShowCreateTable", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *StartServiceActionRequest_MysqlShowTableStatus: - if v == nil { - err := StartServiceActionRequestValidationError{ - field: "Action", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetMysqlShowTableStatus()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, StartServiceActionRequestValidationError{ - field: "MysqlShowTableStatus", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, StartServiceActionRequestValidationError{ - field: "MysqlShowTableStatus", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMysqlShowTableStatus()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return StartServiceActionRequestValidationError{ - field: "MysqlShowTableStatus", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *StartServiceActionRequest_PostgresShowCreateTable: - if v == nil { - err := StartServiceActionRequestValidationError{ - field: "Action", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetPostgresShowCreateTable()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, StartServiceActionRequestValidationError{ - field: "PostgresShowCreateTable", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, StartServiceActionRequestValidationError{ - field: "PostgresShowCreateTable", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetPostgresShowCreateTable()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return StartServiceActionRequestValidationError{ - field: "PostgresShowCreateTable", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *StartServiceActionRequest_PostgresShowIndex: - if v == nil { - err := StartServiceActionRequestValidationError{ - field: "Action", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetPostgresShowIndex()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, StartServiceActionRequestValidationError{ - field: "PostgresShowIndex", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, StartServiceActionRequestValidationError{ - field: "PostgresShowIndex", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetPostgresShowIndex()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return StartServiceActionRequestValidationError{ - field: "PostgresShowIndex", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *StartServiceActionRequest_MongodbExplain: - if v == nil { - err := StartServiceActionRequestValidationError{ - field: "Action", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetMongodbExplain()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, StartServiceActionRequestValidationError{ - field: "MongodbExplain", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, StartServiceActionRequestValidationError{ - field: "MongodbExplain", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMongodbExplain()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return StartServiceActionRequestValidationError{ - field: "MongodbExplain", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *StartServiceActionRequest_PtMongodbSummary: - if v == nil { - err := StartServiceActionRequestValidationError{ - field: "Action", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetPtMongodbSummary()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, StartServiceActionRequestValidationError{ - field: "PtMongodbSummary", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, StartServiceActionRequestValidationError{ - field: "PtMongodbSummary", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetPtMongodbSummary()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return StartServiceActionRequestValidationError{ - field: "PtMongodbSummary", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *StartServiceActionRequest_PtMysqlSummary: - if v == nil { - err := StartServiceActionRequestValidationError{ - field: "Action", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetPtMysqlSummary()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, StartServiceActionRequestValidationError{ - field: "PtMysqlSummary", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, StartServiceActionRequestValidationError{ - field: "PtMysqlSummary", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetPtMysqlSummary()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return StartServiceActionRequestValidationError{ - field: "PtMysqlSummary", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *StartServiceActionRequest_PtPostgresSummary: - if v == nil { - err := StartServiceActionRequestValidationError{ - field: "Action", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetPtPostgresSummary()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, StartServiceActionRequestValidationError{ - field: "PtPostgresSummary", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, StartServiceActionRequestValidationError{ - field: "PtPostgresSummary", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetPtPostgresSummary()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return StartServiceActionRequestValidationError{ - field: "PtPostgresSummary", - reason: "embedded message failed validation", - cause: err, - } - } - } - - default: - _ = v // ensures v is used - } - - if len(errors) > 0 { - return StartServiceActionRequestMultiError(errors) - } - - return nil -} - -// StartServiceActionRequestMultiError is an error wrapping multiple validation -// errors returned by StartServiceActionRequest.ValidateAll() if the -// designated constraints aren't met. -type StartServiceActionRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m StartServiceActionRequestMultiError) 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 StartServiceActionRequestMultiError) AllErrors() []error { return m } - -// StartServiceActionRequestValidationError is the validation error returned by -// StartServiceActionRequest.Validate if the designated constraints aren't met. -type StartServiceActionRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e StartServiceActionRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e StartServiceActionRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e StartServiceActionRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e StartServiceActionRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e StartServiceActionRequestValidationError) ErrorName() string { - return "StartServiceActionRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e StartServiceActionRequestValidationError) 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 %sStartServiceActionRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = StartServiceActionRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = StartServiceActionRequestValidationError{} - -// Validate checks the field values on StartServiceActionResponse 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 *StartServiceActionResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on StartServiceActionResponse 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 -// StartServiceActionResponseMultiError, or nil if none found. -func (m *StartServiceActionResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *StartServiceActionResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - switch v := m.Action.(type) { - case *StartServiceActionResponse_MysqlExplain: - if v == nil { - err := StartServiceActionResponseValidationError{ - field: "Action", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetMysqlExplain()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, StartServiceActionResponseValidationError{ - field: "MysqlExplain", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, StartServiceActionResponseValidationError{ - field: "MysqlExplain", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMysqlExplain()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return StartServiceActionResponseValidationError{ - field: "MysqlExplain", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *StartServiceActionResponse_MysqlExplainJson: - if v == nil { - err := StartServiceActionResponseValidationError{ - field: "Action", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetMysqlExplainJson()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, StartServiceActionResponseValidationError{ - field: "MysqlExplainJson", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, StartServiceActionResponseValidationError{ - field: "MysqlExplainJson", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMysqlExplainJson()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return StartServiceActionResponseValidationError{ - field: "MysqlExplainJson", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *StartServiceActionResponse_MysqlExplainTraditionalJson: - if v == nil { - err := StartServiceActionResponseValidationError{ - field: "Action", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetMysqlExplainTraditionalJson()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, StartServiceActionResponseValidationError{ - field: "MysqlExplainTraditionalJson", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, StartServiceActionResponseValidationError{ - field: "MysqlExplainTraditionalJson", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMysqlExplainTraditionalJson()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return StartServiceActionResponseValidationError{ - field: "MysqlExplainTraditionalJson", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *StartServiceActionResponse_MysqlShowIndex: - if v == nil { - err := StartServiceActionResponseValidationError{ - field: "Action", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetMysqlShowIndex()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, StartServiceActionResponseValidationError{ - field: "MysqlShowIndex", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, StartServiceActionResponseValidationError{ - field: "MysqlShowIndex", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMysqlShowIndex()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return StartServiceActionResponseValidationError{ - field: "MysqlShowIndex", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *StartServiceActionResponse_MysqlShowCreateTable: - if v == nil { - err := StartServiceActionResponseValidationError{ - field: "Action", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetMysqlShowCreateTable()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, StartServiceActionResponseValidationError{ - field: "MysqlShowCreateTable", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, StartServiceActionResponseValidationError{ - field: "MysqlShowCreateTable", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMysqlShowCreateTable()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return StartServiceActionResponseValidationError{ - field: "MysqlShowCreateTable", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *StartServiceActionResponse_MysqlShowTableStatus: - if v == nil { - err := StartServiceActionResponseValidationError{ - field: "Action", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetMysqlShowTableStatus()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, StartServiceActionResponseValidationError{ - field: "MysqlShowTableStatus", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, StartServiceActionResponseValidationError{ - field: "MysqlShowTableStatus", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMysqlShowTableStatus()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return StartServiceActionResponseValidationError{ - field: "MysqlShowTableStatus", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *StartServiceActionResponse_PostgresqlShowCreateTable: - if v == nil { - err := StartServiceActionResponseValidationError{ - field: "Action", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetPostgresqlShowCreateTable()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, StartServiceActionResponseValidationError{ - field: "PostgresqlShowCreateTable", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, StartServiceActionResponseValidationError{ - field: "PostgresqlShowCreateTable", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetPostgresqlShowCreateTable()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return StartServiceActionResponseValidationError{ - field: "PostgresqlShowCreateTable", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *StartServiceActionResponse_PostgresqlShowIndex: - if v == nil { - err := StartServiceActionResponseValidationError{ - field: "Action", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetPostgresqlShowIndex()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, StartServiceActionResponseValidationError{ - field: "PostgresqlShowIndex", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, StartServiceActionResponseValidationError{ - field: "PostgresqlShowIndex", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetPostgresqlShowIndex()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return StartServiceActionResponseValidationError{ - field: "PostgresqlShowIndex", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *StartServiceActionResponse_MongodbExplain: - if v == nil { - err := StartServiceActionResponseValidationError{ - field: "Action", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetMongodbExplain()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, StartServiceActionResponseValidationError{ - field: "MongodbExplain", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, StartServiceActionResponseValidationError{ - field: "MongodbExplain", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMongodbExplain()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return StartServiceActionResponseValidationError{ - field: "MongodbExplain", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *StartServiceActionResponse_PtMongodbSummary: - if v == nil { - err := StartServiceActionResponseValidationError{ - field: "Action", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetPtMongodbSummary()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, StartServiceActionResponseValidationError{ - field: "PtMongodbSummary", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, StartServiceActionResponseValidationError{ - field: "PtMongodbSummary", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetPtMongodbSummary()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return StartServiceActionResponseValidationError{ - field: "PtMongodbSummary", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *StartServiceActionResponse_PtMysqlSummary: - if v == nil { - err := StartServiceActionResponseValidationError{ - field: "Action", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetPtMysqlSummary()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, StartServiceActionResponseValidationError{ - field: "PtMysqlSummary", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, StartServiceActionResponseValidationError{ - field: "PtMysqlSummary", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetPtMysqlSummary()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return StartServiceActionResponseValidationError{ - field: "PtMysqlSummary", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *StartServiceActionResponse_PtPostgresSummary: - if v == nil { - err := StartServiceActionResponseValidationError{ - field: "Action", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetPtPostgresSummary()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, StartServiceActionResponseValidationError{ - field: "PtPostgresSummary", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, StartServiceActionResponseValidationError{ - field: "PtPostgresSummary", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetPtPostgresSummary()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return StartServiceActionResponseValidationError{ - field: "PtPostgresSummary", - reason: "embedded message failed validation", - cause: err, - } - } - } - - default: - _ = v // ensures v is used - } - - if len(errors) > 0 { - return StartServiceActionResponseMultiError(errors) - } - - return nil -} - -// StartServiceActionResponseMultiError is an error wrapping multiple -// validation errors returned by StartServiceActionResponse.ValidateAll() if -// the designated constraints aren't met. -type StartServiceActionResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m StartServiceActionResponseMultiError) 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 StartServiceActionResponseMultiError) AllErrors() []error { return m } - -// StartServiceActionResponseValidationError is the validation error returned -// by StartServiceActionResponse.Validate if the designated constraints aren't met. -type StartServiceActionResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e StartServiceActionResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e StartServiceActionResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e StartServiceActionResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e StartServiceActionResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e StartServiceActionResponseValidationError) ErrorName() string { - return "StartServiceActionResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e StartServiceActionResponseValidationError) 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 %sStartServiceActionResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = StartServiceActionResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = StartServiceActionResponseValidationError{} diff --git a/api/actions/v1/actions_grpc.pb.go b/api/actions/v1/actions_grpc.pb.go deleted file mode 100644 index cfe06386498..00000000000 --- a/api/actions/v1/actions_grpc.pb.go +++ /dev/null @@ -1,251 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.6.0 -// - protoc (unknown) -// source: actions/v1/actions.proto - -package actionsv1 - -import ( - context "context" - - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.64.0 or later. -const _ = grpc.SupportPackageIsVersion9 - -const ( - ActionsService_GetAction_FullMethodName = "/actions.v1.ActionsService/GetAction" - ActionsService_StartServiceAction_FullMethodName = "/actions.v1.ActionsService/StartServiceAction" - ActionsService_StartPTSummaryAction_FullMethodName = "/actions.v1.ActionsService/StartPTSummaryAction" - ActionsService_CancelAction_FullMethodName = "/actions.v1.ActionsService/CancelAction" -) - -// ActionsServiceClient is the client API for ActionsService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -// -// Actions service provides public Management API methods for Actions. -type ActionsServiceClient interface { - // GetAction gets result of a given Action. - GetAction(ctx context.Context, in *GetActionRequest, opts ...grpc.CallOption) (*GetActionResponse, error) - // StartServiceAction starts a Service Action. - StartServiceAction(ctx context.Context, in *StartServiceActionRequest, opts ...grpc.CallOption) (*StartServiceActionResponse, error) - // StartPTSummaryAction starts pt-summary Node Action. - StartPTSummaryAction(ctx context.Context, in *StartPTSummaryActionRequest, opts ...grpc.CallOption) (*StartPTSummaryActionResponse, error) - // CancelAction stops an Action. - CancelAction(ctx context.Context, in *CancelActionRequest, opts ...grpc.CallOption) (*CancelActionResponse, error) -} - -type actionsServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewActionsServiceClient(cc grpc.ClientConnInterface) ActionsServiceClient { - return &actionsServiceClient{cc} -} - -func (c *actionsServiceClient) GetAction(ctx context.Context, in *GetActionRequest, opts ...grpc.CallOption) (*GetActionResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetActionResponse) - err := c.cc.Invoke(ctx, ActionsService_GetAction_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *actionsServiceClient) StartServiceAction(ctx context.Context, in *StartServiceActionRequest, opts ...grpc.CallOption) (*StartServiceActionResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(StartServiceActionResponse) - err := c.cc.Invoke(ctx, ActionsService_StartServiceAction_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *actionsServiceClient) StartPTSummaryAction(ctx context.Context, in *StartPTSummaryActionRequest, opts ...grpc.CallOption) (*StartPTSummaryActionResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(StartPTSummaryActionResponse) - err := c.cc.Invoke(ctx, ActionsService_StartPTSummaryAction_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *actionsServiceClient) CancelAction(ctx context.Context, in *CancelActionRequest, opts ...grpc.CallOption) (*CancelActionResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(CancelActionResponse) - err := c.cc.Invoke(ctx, ActionsService_CancelAction_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -// ActionsServiceServer is the server API for ActionsService service. -// All implementations must embed UnimplementedActionsServiceServer -// for forward compatibility. -// -// Actions service provides public Management API methods for Actions. -type ActionsServiceServer interface { - // GetAction gets result of a given Action. - GetAction(context.Context, *GetActionRequest) (*GetActionResponse, error) - // StartServiceAction starts a Service Action. - StartServiceAction(context.Context, *StartServiceActionRequest) (*StartServiceActionResponse, error) - // StartPTSummaryAction starts pt-summary Node Action. - StartPTSummaryAction(context.Context, *StartPTSummaryActionRequest) (*StartPTSummaryActionResponse, error) - // CancelAction stops an Action. - CancelAction(context.Context, *CancelActionRequest) (*CancelActionResponse, error) - mustEmbedUnimplementedActionsServiceServer() -} - -// UnimplementedActionsServiceServer must be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -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") -} -func (UnimplementedActionsServiceServer) mustEmbedUnimplementedActionsServiceServer() {} -func (UnimplementedActionsServiceServer) testEmbeddedByValue() {} - -// UnsafeActionsServiceServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to ActionsServiceServer will -// result in compilation errors. -type UnsafeActionsServiceServer interface { - mustEmbedUnimplementedActionsServiceServer() -} - -func RegisterActionsServiceServer(s grpc.ServiceRegistrar, srv ActionsServiceServer) { - // If the following call panics, it indicates UnimplementedActionsServiceServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } - s.RegisterService(&ActionsService_ServiceDesc, srv) -} - -func _ActionsService_GetAction_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetActionRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ActionsServiceServer).GetAction(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: ActionsService_GetAction_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ActionsServiceServer).GetAction(ctx, req.(*GetActionRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ActionsService_StartServiceAction_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(StartServiceActionRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ActionsServiceServer).StartServiceAction(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: ActionsService_StartServiceAction_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ActionsServiceServer).StartServiceAction(ctx, req.(*StartServiceActionRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ActionsService_StartPTSummaryAction_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(StartPTSummaryActionRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ActionsServiceServer).StartPTSummaryAction(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: ActionsService_StartPTSummaryAction_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ActionsServiceServer).StartPTSummaryAction(ctx, req.(*StartPTSummaryActionRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ActionsService_CancelAction_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CancelActionRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ActionsServiceServer).CancelAction(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: ActionsService_CancelAction_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ActionsServiceServer).CancelAction(ctx, req.(*CancelActionRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// ActionsService_ServiceDesc is the grpc.ServiceDesc for ActionsService service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var ActionsService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "actions.v1.ActionsService", - HandlerType: (*ActionsServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "GetAction", - Handler: _ActionsService_GetAction_Handler, - }, - { - MethodName: "StartServiceAction", - Handler: _ActionsService_StartServiceAction_Handler, - }, - { - MethodName: "StartPTSummaryAction", - Handler: _ActionsService_StartPTSummaryAction_Handler, - }, - { - MethodName: "CancelAction", - Handler: _ActionsService_CancelAction_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "actions/v1/actions.proto", -} diff --git a/api/actions/v1/json/client/actions_service/actions_service_client.go b/api/actions/v1/json/client/actions_service/actions_service_client.go deleted file mode 100644 index a44e4704c8e..00000000000 --- a/api/actions/v1/json/client/actions_service/actions_service_client.go +++ /dev/null @@ -1,247 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package actions_service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// New creates a new actions service API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -// New creates a new actions service API client with basic auth credentials. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - user: user for basic authentication header. -// - password: password for basic authentication header. -func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BasicAuth(user, password) - return &Client{transport: transport, formats: strfmt.Default} -} - -// New creates a new actions service API client with a bearer token for authentication. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - bearerToken: bearer token for Bearer authentication header. -func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BearerToken(bearerToken) - return &Client{transport: transport, formats: strfmt.Default} -} - -/* -Client for actions service API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption may be used to customize the behavior of Client methods. -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - CancelAction(params *CancelActionParams, opts ...ClientOption) (*CancelActionOK, error) - - GetAction(params *GetActionParams, opts ...ClientOption) (*GetActionOK, error) - - StartPTSummaryAction(params *StartPTSummaryActionParams, opts ...ClientOption) (*StartPTSummaryActionOK, error) - - StartServiceAction(params *StartServiceActionParams, opts ...ClientOption) (*StartServiceActionOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -CancelAction cancels an action - -Stops an Action. -*/ -func (a *Client) CancelAction(params *CancelActionParams, opts ...ClientOption) (*CancelActionOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewCancelActionParams() - } - op := &runtime.ClientOperation{ - ID: "CancelAction", - Method: "POST", - PathPattern: "/v1/actions:cancelAction", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &CancelActionReader{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.(*CancelActionOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*CancelActionDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -GetAction gets action - -Gets the result of a given Action. -*/ -func (a *Client) GetAction(params *GetActionParams, opts ...ClientOption) (*GetActionOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewGetActionParams() - } - op := &runtime.ClientOperation{ - ID: "GetAction", - Method: "GET", - PathPattern: "/v1/actions/{action_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &GetActionReader{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.(*GetActionOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*GetActionDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -StartPTSummaryAction starts PT summary action - -Starts 'Percona Toolkit Summary' Action. -*/ -func (a *Client) StartPTSummaryAction(params *StartPTSummaryActionParams, opts ...ClientOption) (*StartPTSummaryActionOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewStartPTSummaryActionParams() - } - op := &runtime.ClientOperation{ - ID: "StartPTSummaryAction", - Method: "POST", - PathPattern: "/v1/actions:startNodeAction", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &StartPTSummaryActionReader{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.(*StartPTSummaryActionOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*StartPTSummaryActionDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -StartServiceAction starts a service action - -Starts a Service Action. -*/ -func (a *Client) StartServiceAction(params *StartServiceActionParams, opts ...ClientOption) (*StartServiceActionOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewStartServiceActionParams() - } - op := &runtime.ClientOperation{ - ID: "StartServiceAction", - Method: "POST", - PathPattern: "/v1/actions:startServiceAction", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &StartServiceActionReader{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.(*StartServiceActionOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*StartServiceActionDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/api/actions/v1/json/client/actions_service/cancel_action_parameters.go b/api/actions/v1/json/client/actions_service/cancel_action_parameters.go deleted file mode 100644 index 6348e7d94eb..00000000000 --- a/api/actions/v1/json/client/actions_service/cancel_action_parameters.go +++ /dev/null @@ -1,144 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package actions_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" -) - -// NewCancelActionParams creates a new CancelActionParams 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 NewCancelActionParams() *CancelActionParams { - return &CancelActionParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewCancelActionParamsWithTimeout creates a new CancelActionParams object -// with the ability to set a timeout on a request. -func NewCancelActionParamsWithTimeout(timeout time.Duration) *CancelActionParams { - return &CancelActionParams{ - timeout: timeout, - } -} - -// NewCancelActionParamsWithContext creates a new CancelActionParams object -// with the ability to set a context for a request. -func NewCancelActionParamsWithContext(ctx context.Context) *CancelActionParams { - return &CancelActionParams{ - Context: ctx, - } -} - -// NewCancelActionParamsWithHTTPClient creates a new CancelActionParams object -// with the ability to set a custom HTTPClient for a request. -func NewCancelActionParamsWithHTTPClient(client *http.Client) *CancelActionParams { - return &CancelActionParams{ - HTTPClient: client, - } -} - -/* -CancelActionParams contains all the parameters to send to the API endpoint - - for the cancel action operation. - - Typically these are written to a http.Request. -*/ -type CancelActionParams struct { - // Body. - Body CancelActionBody - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the cancel action params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CancelActionParams) WithDefaults() *CancelActionParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the cancel action params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CancelActionParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the cancel action params -func (o *CancelActionParams) WithTimeout(timeout time.Duration) *CancelActionParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the cancel action params -func (o *CancelActionParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the cancel action params -func (o *CancelActionParams) WithContext(ctx context.Context) *CancelActionParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the cancel action params -func (o *CancelActionParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the cancel action params -func (o *CancelActionParams) WithHTTPClient(client *http.Client) *CancelActionParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the cancel action params -func (o *CancelActionParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the cancel action params -func (o *CancelActionParams) WithBody(body CancelActionBody) *CancelActionParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the cancel action params -func (o *CancelActionParams) SetBody(body CancelActionBody) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *CancelActionParams) 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/actions/v1/json/client/actions_service/cancel_action_responses.go b/api/actions/v1/json/client/actions_service/cancel_action_responses.go deleted file mode 100644 index 0e13c7ab307..00000000000 --- a/api/actions/v1/json/client/actions_service/cancel_action_responses.go +++ /dev/null @@ -1,451 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package actions_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" -) - -// CancelActionReader is a Reader for the CancelAction structure. -type CancelActionReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *CancelActionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewCancelActionOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewCancelActionDefault(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 - } -} - -// NewCancelActionOK creates a CancelActionOK with default headers values -func NewCancelActionOK() *CancelActionOK { - return &CancelActionOK{} -} - -/* -CancelActionOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type CancelActionOK struct { - Payload any -} - -// IsSuccess returns true when this cancel action Ok response has a 2xx status code -func (o *CancelActionOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this cancel action Ok response has a 3xx status code -func (o *CancelActionOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this cancel action Ok response has a 4xx status code -func (o *CancelActionOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this cancel action Ok response has a 5xx status code -func (o *CancelActionOK) IsServerError() bool { - return false -} - -// IsCode returns true when this cancel action Ok response a status code equal to that given -func (o *CancelActionOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the cancel action Ok response -func (o *CancelActionOK) Code() int { - return 200 -} - -func (o *CancelActionOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/actions:cancelAction][%d] cancelActionOk %s", 200, payload) -} - -func (o *CancelActionOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/actions:cancelAction][%d] cancelActionOk %s", 200, payload) -} - -func (o *CancelActionOK) GetPayload() any { - return o.Payload -} - -func (o *CancelActionOK) 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) { - return err - } - - return nil -} - -// NewCancelActionDefault creates a CancelActionDefault with default headers values -func NewCancelActionDefault(code int) *CancelActionDefault { - return &CancelActionDefault{ - _statusCode: code, - } -} - -/* -CancelActionDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type CancelActionDefault struct { - _statusCode int - - Payload *CancelActionDefaultBody -} - -// IsSuccess returns true when this cancel action default response has a 2xx status code -func (o *CancelActionDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this cancel action default response has a 3xx status code -func (o *CancelActionDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this cancel action default response has a 4xx status code -func (o *CancelActionDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this cancel action default response has a 5xx status code -func (o *CancelActionDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this cancel action default response a status code equal to that given -func (o *CancelActionDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the cancel action default response -func (o *CancelActionDefault) Code() int { - return o._statusCode -} - -func (o *CancelActionDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/actions:cancelAction][%d] CancelAction default %s", o._statusCode, payload) -} - -func (o *CancelActionDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/actions:cancelAction][%d] CancelAction default %s", o._statusCode, payload) -} - -func (o *CancelActionDefault) GetPayload() *CancelActionDefaultBody { - return o.Payload -} - -func (o *CancelActionDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(CancelActionDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -CancelActionBody cancel action body -swagger:model CancelActionBody -*/ -type CancelActionBody struct { - // Unique Action ID. Required. - ActionID string `json:"action_id,omitempty"` -} - -// Validate validates this cancel action body -func (o *CancelActionBody) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this cancel action body based on context it is used -func (o *CancelActionBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *CancelActionBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *CancelActionBody) UnmarshalBinary(b []byte) error { - var res CancelActionBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -CancelActionDefaultBody cancel action default body -swagger:model CancelActionDefaultBody -*/ -type CancelActionDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*CancelActionDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this cancel action default body -func (o *CancelActionDefaultBody) 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 *CancelActionDefaultBody) 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("CancelAction default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("CancelAction default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this cancel action default body based on the context it is used -func (o *CancelActionDefaultBody) 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 *CancelActionDefaultBody) 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("CancelAction default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("CancelAction default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *CancelActionDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *CancelActionDefaultBody) UnmarshalBinary(b []byte) error { - var res CancelActionDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -CancelActionDefaultBodyDetailsItems0 cancel action default body details items0 -swagger:model CancelActionDefaultBodyDetailsItems0 -*/ -type CancelActionDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` - - // cancel action default body details items0 - CancelActionDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *CancelActionDefaultBodyDetailsItems0) 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 CancelActionDefaultBodyDetailsItems0 - - 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.CancelActionDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o CancelActionDefaultBodyDetailsItems0) 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.CancelActionDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.CancelActionDefaultBodyDetailsItems0) - 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 cancel action default body details items0 -func (o *CancelActionDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this cancel action default body details items0 based on context it is used -func (o *CancelActionDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *CancelActionDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *CancelActionDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res CancelActionDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/actions/v1/json/client/actions_service/get_action_parameters.go b/api/actions/v1/json/client/actions_service/get_action_parameters.go deleted file mode 100644 index 260fc6822b1..00000000000 --- a/api/actions/v1/json/client/actions_service/get_action_parameters.go +++ /dev/null @@ -1,149 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package actions_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" -) - -// NewGetActionParams creates a new GetActionParams 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 NewGetActionParams() *GetActionParams { - return &GetActionParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetActionParamsWithTimeout creates a new GetActionParams object -// with the ability to set a timeout on a request. -func NewGetActionParamsWithTimeout(timeout time.Duration) *GetActionParams { - return &GetActionParams{ - timeout: timeout, - } -} - -// NewGetActionParamsWithContext creates a new GetActionParams object -// with the ability to set a context for a request. -func NewGetActionParamsWithContext(ctx context.Context) *GetActionParams { - return &GetActionParams{ - Context: ctx, - } -} - -// NewGetActionParamsWithHTTPClient creates a new GetActionParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetActionParamsWithHTTPClient(client *http.Client) *GetActionParams { - return &GetActionParams{ - HTTPClient: client, - } -} - -/* -GetActionParams contains all the parameters to send to the API endpoint - - for the get action operation. - - Typically these are written to a http.Request. -*/ -type GetActionParams struct { - /* ActionID. - - Unique Action ID. - */ - ActionID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get action params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetActionParams) WithDefaults() *GetActionParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get action params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetActionParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the get action params -func (o *GetActionParams) WithTimeout(timeout time.Duration) *GetActionParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get action params -func (o *GetActionParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get action params -func (o *GetActionParams) WithContext(ctx context.Context) *GetActionParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get action params -func (o *GetActionParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get action params -func (o *GetActionParams) WithHTTPClient(client *http.Client) *GetActionParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get action params -func (o *GetActionParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithActionID adds the actionID to the get action params -func (o *GetActionParams) WithActionID(actionID string) *GetActionParams { - o.SetActionID(actionID) - return o -} - -// SetActionID adds the actionId to the get action params -func (o *GetActionParams) SetActionID(actionID string) { - o.ActionID = actionID -} - -// WriteToRequest writes these params to a swagger request -func (o *GetActionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param action_id - if err := r.SetPathParam("action_id", o.ActionID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/api/actions/v1/json/client/actions_service/get_action_responses.go b/api/actions/v1/json/client/actions_service/get_action_responses.go deleted file mode 100644 index 9b33b0d5d9e..00000000000 --- a/api/actions/v1/json/client/actions_service/get_action_responses.go +++ /dev/null @@ -1,465 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package actions_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" -) - -// GetActionReader is a Reader for the GetAction structure. -type GetActionReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetActionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewGetActionOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewGetActionDefault(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 - } -} - -// NewGetActionOK creates a GetActionOK with default headers values -func NewGetActionOK() *GetActionOK { - return &GetActionOK{} -} - -/* -GetActionOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type GetActionOK struct { - Payload *GetActionOKBody -} - -// IsSuccess returns true when this get action Ok response has a 2xx status code -func (o *GetActionOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this get action Ok response has a 3xx status code -func (o *GetActionOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this get action Ok response has a 4xx status code -func (o *GetActionOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this get action Ok response has a 5xx status code -func (o *GetActionOK) IsServerError() bool { - return false -} - -// IsCode returns true when this get action Ok response a status code equal to that given -func (o *GetActionOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the get action Ok response -func (o *GetActionOK) Code() int { - return 200 -} - -func (o *GetActionOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/actions/{action_id}][%d] getActionOk %s", 200, payload) -} - -func (o *GetActionOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/actions/{action_id}][%d] getActionOk %s", 200, payload) -} - -func (o *GetActionOK) GetPayload() *GetActionOKBody { - return o.Payload -} - -func (o *GetActionOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(GetActionOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -// NewGetActionDefault creates a GetActionDefault with default headers values -func NewGetActionDefault(code int) *GetActionDefault { - return &GetActionDefault{ - _statusCode: code, - } -} - -/* -GetActionDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type GetActionDefault struct { - _statusCode int - - Payload *GetActionDefaultBody -} - -// IsSuccess returns true when this get action default response has a 2xx status code -func (o *GetActionDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this get action default response has a 3xx status code -func (o *GetActionDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this get action default response has a 4xx status code -func (o *GetActionDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this get action default response has a 5xx status code -func (o *GetActionDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this get action default response a status code equal to that given -func (o *GetActionDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the get action default response -func (o *GetActionDefault) Code() int { - return o._statusCode -} - -func (o *GetActionDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/actions/{action_id}][%d] GetAction default %s", o._statusCode, payload) -} - -func (o *GetActionDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/actions/{action_id}][%d] GetAction default %s", o._statusCode, payload) -} - -func (o *GetActionDefault) GetPayload() *GetActionDefaultBody { - return o.Payload -} - -func (o *GetActionDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(GetActionDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -GetActionDefaultBody get action default body -swagger:model GetActionDefaultBody -*/ -type GetActionDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*GetActionDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this get action default body -func (o *GetActionDefaultBody) 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 *GetActionDefaultBody) 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("GetAction default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("GetAction default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this get action default body based on the context it is used -func (o *GetActionDefaultBody) 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 *GetActionDefaultBody) 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("GetAction default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("GetAction default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetActionDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetActionDefaultBody) UnmarshalBinary(b []byte) error { - var res GetActionDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetActionDefaultBodyDetailsItems0 get action default body details items0 -swagger:model GetActionDefaultBodyDetailsItems0 -*/ -type GetActionDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` - - // get action default body details items0 - GetActionDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *GetActionDefaultBodyDetailsItems0) 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 GetActionDefaultBodyDetailsItems0 - - 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.GetActionDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o GetActionDefaultBodyDetailsItems0) 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.GetActionDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.GetActionDefaultBodyDetailsItems0) - 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 get action default body details items0 -func (o *GetActionDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get action default body details items0 based on context it is used -func (o *GetActionDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetActionDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetActionDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res GetActionDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetActionOKBody get action OK body -swagger:model GetActionOKBody -*/ -type GetActionOKBody struct { - // Unique Action ID. - ActionID string `json:"action_id,omitempty"` - - // pmm-agent ID where this Action is running / was run. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Current Action output; may be partial if Action is still running. - Output string `json:"output,omitempty"` - - // True if Action is finished. - Done bool `json:"done,omitempty"` - - // Error message if Action failed. - Error string `json:"error,omitempty"` -} - -// Validate validates this get action OK body -func (o *GetActionOKBody) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get action OK body based on context it is used -func (o *GetActionOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetActionOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetActionOKBody) UnmarshalBinary(b []byte) error { - var res GetActionOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/actions/v1/json/client/actions_service/start_pt_summary_action_parameters.go b/api/actions/v1/json/client/actions_service/start_pt_summary_action_parameters.go deleted file mode 100644 index 968ef894f1e..00000000000 --- a/api/actions/v1/json/client/actions_service/start_pt_summary_action_parameters.go +++ /dev/null @@ -1,144 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package actions_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" -) - -// NewStartPTSummaryActionParams creates a new StartPTSummaryActionParams 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 NewStartPTSummaryActionParams() *StartPTSummaryActionParams { - return &StartPTSummaryActionParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewStartPTSummaryActionParamsWithTimeout creates a new StartPTSummaryActionParams object -// with the ability to set a timeout on a request. -func NewStartPTSummaryActionParamsWithTimeout(timeout time.Duration) *StartPTSummaryActionParams { - return &StartPTSummaryActionParams{ - timeout: timeout, - } -} - -// NewStartPTSummaryActionParamsWithContext creates a new StartPTSummaryActionParams object -// with the ability to set a context for a request. -func NewStartPTSummaryActionParamsWithContext(ctx context.Context) *StartPTSummaryActionParams { - return &StartPTSummaryActionParams{ - Context: ctx, - } -} - -// NewStartPTSummaryActionParamsWithHTTPClient creates a new StartPTSummaryActionParams object -// with the ability to set a custom HTTPClient for a request. -func NewStartPTSummaryActionParamsWithHTTPClient(client *http.Client) *StartPTSummaryActionParams { - return &StartPTSummaryActionParams{ - HTTPClient: client, - } -} - -/* -StartPTSummaryActionParams contains all the parameters to send to the API endpoint - - for the start PT summary action operation. - - Typically these are written to a http.Request. -*/ -type StartPTSummaryActionParams struct { - // Body. - Body StartPTSummaryActionBody - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the start PT summary action params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *StartPTSummaryActionParams) WithDefaults() *StartPTSummaryActionParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the start PT summary action params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *StartPTSummaryActionParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the start PT summary action params -func (o *StartPTSummaryActionParams) WithTimeout(timeout time.Duration) *StartPTSummaryActionParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the start PT summary action params -func (o *StartPTSummaryActionParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the start PT summary action params -func (o *StartPTSummaryActionParams) WithContext(ctx context.Context) *StartPTSummaryActionParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the start PT summary action params -func (o *StartPTSummaryActionParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the start PT summary action params -func (o *StartPTSummaryActionParams) WithHTTPClient(client *http.Client) *StartPTSummaryActionParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the start PT summary action params -func (o *StartPTSummaryActionParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the start PT summary action params -func (o *StartPTSummaryActionParams) WithBody(body StartPTSummaryActionBody) *StartPTSummaryActionParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the start PT summary action params -func (o *StartPTSummaryActionParams) SetBody(body StartPTSummaryActionBody) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *StartPTSummaryActionParams) 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/actions/v1/json/client/actions_service/start_pt_summary_action_responses.go b/api/actions/v1/json/client/actions_service/start_pt_summary_action_responses.go deleted file mode 100644 index 8cafc764bc5..00000000000 --- a/api/actions/v1/json/client/actions_service/start_pt_summary_action_responses.go +++ /dev/null @@ -1,496 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package actions_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" -) - -// StartPTSummaryActionReader is a Reader for the StartPTSummaryAction structure. -type StartPTSummaryActionReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *StartPTSummaryActionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewStartPTSummaryActionOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewStartPTSummaryActionDefault(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 - } -} - -// NewStartPTSummaryActionOK creates a StartPTSummaryActionOK with default headers values -func NewStartPTSummaryActionOK() *StartPTSummaryActionOK { - return &StartPTSummaryActionOK{} -} - -/* -StartPTSummaryActionOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type StartPTSummaryActionOK struct { - Payload *StartPTSummaryActionOKBody -} - -// IsSuccess returns true when this start Pt summary action Ok response has a 2xx status code -func (o *StartPTSummaryActionOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this start Pt summary action Ok response has a 3xx status code -func (o *StartPTSummaryActionOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this start Pt summary action Ok response has a 4xx status code -func (o *StartPTSummaryActionOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this start Pt summary action Ok response has a 5xx status code -func (o *StartPTSummaryActionOK) IsServerError() bool { - return false -} - -// IsCode returns true when this start Pt summary action Ok response a status code equal to that given -func (o *StartPTSummaryActionOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the start Pt summary action Ok response -func (o *StartPTSummaryActionOK) Code() int { - return 200 -} - -func (o *StartPTSummaryActionOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/actions:startNodeAction][%d] startPtSummaryActionOk %s", 200, payload) -} - -func (o *StartPTSummaryActionOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/actions:startNodeAction][%d] startPtSummaryActionOk %s", 200, payload) -} - -func (o *StartPTSummaryActionOK) GetPayload() *StartPTSummaryActionOKBody { - return o.Payload -} - -func (o *StartPTSummaryActionOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(StartPTSummaryActionOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -// NewStartPTSummaryActionDefault creates a StartPTSummaryActionDefault with default headers values -func NewStartPTSummaryActionDefault(code int) *StartPTSummaryActionDefault { - return &StartPTSummaryActionDefault{ - _statusCode: code, - } -} - -/* -StartPTSummaryActionDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type StartPTSummaryActionDefault struct { - _statusCode int - - Payload *StartPTSummaryActionDefaultBody -} - -// IsSuccess returns true when this start PT summary action default response has a 2xx status code -func (o *StartPTSummaryActionDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this start PT summary action default response has a 3xx status code -func (o *StartPTSummaryActionDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this start PT summary action default response has a 4xx status code -func (o *StartPTSummaryActionDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this start PT summary action default response has a 5xx status code -func (o *StartPTSummaryActionDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this start PT summary action default response a status code equal to that given -func (o *StartPTSummaryActionDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the start PT summary action default response -func (o *StartPTSummaryActionDefault) Code() int { - return o._statusCode -} - -func (o *StartPTSummaryActionDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/actions:startNodeAction][%d] StartPTSummaryAction default %s", o._statusCode, payload) -} - -func (o *StartPTSummaryActionDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/actions:startNodeAction][%d] StartPTSummaryAction default %s", o._statusCode, payload) -} - -func (o *StartPTSummaryActionDefault) GetPayload() *StartPTSummaryActionDefaultBody { - return o.Payload -} - -func (o *StartPTSummaryActionDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(StartPTSummaryActionDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -StartPTSummaryActionBody start PT summary action body -swagger:model StartPTSummaryActionBody -*/ -type StartPTSummaryActionBody struct { - // pmm-agent ID where to run this Action. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Node ID for this Action. - NodeID string `json:"node_id,omitempty"` -} - -// Validate validates this start PT summary action body -func (o *StartPTSummaryActionBody) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this start PT summary action body based on context it is used -func (o *StartPTSummaryActionBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *StartPTSummaryActionBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *StartPTSummaryActionBody) UnmarshalBinary(b []byte) error { - var res StartPTSummaryActionBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -StartPTSummaryActionDefaultBody start PT summary action default body -swagger:model StartPTSummaryActionDefaultBody -*/ -type StartPTSummaryActionDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*StartPTSummaryActionDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this start PT summary action default body -func (o *StartPTSummaryActionDefaultBody) 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 *StartPTSummaryActionDefaultBody) 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("StartPTSummaryAction default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("StartPTSummaryAction default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this start PT summary action default body based on the context it is used -func (o *StartPTSummaryActionDefaultBody) 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 *StartPTSummaryActionDefaultBody) 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("StartPTSummaryAction default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("StartPTSummaryAction default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *StartPTSummaryActionDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *StartPTSummaryActionDefaultBody) UnmarshalBinary(b []byte) error { - var res StartPTSummaryActionDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -StartPTSummaryActionDefaultBodyDetailsItems0 start PT summary action default body details items0 -swagger:model StartPTSummaryActionDefaultBodyDetailsItems0 -*/ -type StartPTSummaryActionDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` - - // start PT summary action default body details items0 - StartPTSummaryActionDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *StartPTSummaryActionDefaultBodyDetailsItems0) 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 StartPTSummaryActionDefaultBodyDetailsItems0 - - 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.StartPTSummaryActionDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o StartPTSummaryActionDefaultBodyDetailsItems0) 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.StartPTSummaryActionDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.StartPTSummaryActionDefaultBodyDetailsItems0) - 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 start PT summary action default body details items0 -func (o *StartPTSummaryActionDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this start PT summary action default body details items0 based on context it is used -func (o *StartPTSummaryActionDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *StartPTSummaryActionDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *StartPTSummaryActionDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res StartPTSummaryActionDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -StartPTSummaryActionOKBody start PT summary action OK body -swagger:model StartPTSummaryActionOKBody -*/ -type StartPTSummaryActionOKBody struct { - // Unique Action ID. - ActionID string `json:"action_id,omitempty"` - - // pmm-agent ID where to this Action was started. - PMMAgentID string `json:"pmm_agent_id,omitempty"` -} - -// Validate validates this start PT summary action OK body -func (o *StartPTSummaryActionOKBody) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this start PT summary action OK body based on context it is used -func (o *StartPTSummaryActionOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *StartPTSummaryActionOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *StartPTSummaryActionOKBody) UnmarshalBinary(b []byte) error { - var res StartPTSummaryActionOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/actions/v1/json/client/actions_service/start_service_action_parameters.go b/api/actions/v1/json/client/actions_service/start_service_action_parameters.go deleted file mode 100644 index efc1acb5ebf..00000000000 --- a/api/actions/v1/json/client/actions_service/start_service_action_parameters.go +++ /dev/null @@ -1,144 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package actions_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" -) - -// NewStartServiceActionParams creates a new StartServiceActionParams 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 NewStartServiceActionParams() *StartServiceActionParams { - return &StartServiceActionParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewStartServiceActionParamsWithTimeout creates a new StartServiceActionParams object -// with the ability to set a timeout on a request. -func NewStartServiceActionParamsWithTimeout(timeout time.Duration) *StartServiceActionParams { - return &StartServiceActionParams{ - timeout: timeout, - } -} - -// NewStartServiceActionParamsWithContext creates a new StartServiceActionParams object -// with the ability to set a context for a request. -func NewStartServiceActionParamsWithContext(ctx context.Context) *StartServiceActionParams { - return &StartServiceActionParams{ - Context: ctx, - } -} - -// NewStartServiceActionParamsWithHTTPClient creates a new StartServiceActionParams object -// with the ability to set a custom HTTPClient for a request. -func NewStartServiceActionParamsWithHTTPClient(client *http.Client) *StartServiceActionParams { - return &StartServiceActionParams{ - HTTPClient: client, - } -} - -/* -StartServiceActionParams contains all the parameters to send to the API endpoint - - for the start service action operation. - - Typically these are written to a http.Request. -*/ -type StartServiceActionParams struct { - // Body. - Body StartServiceActionBody - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the start service action params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *StartServiceActionParams) WithDefaults() *StartServiceActionParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the start service action params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *StartServiceActionParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the start service action params -func (o *StartServiceActionParams) WithTimeout(timeout time.Duration) *StartServiceActionParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the start service action params -func (o *StartServiceActionParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the start service action params -func (o *StartServiceActionParams) WithContext(ctx context.Context) *StartServiceActionParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the start service action params -func (o *StartServiceActionParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the start service action params -func (o *StartServiceActionParams) WithHTTPClient(client *http.Client) *StartServiceActionParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the start service action params -func (o *StartServiceActionParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the start service action params -func (o *StartServiceActionParams) WithBody(body StartServiceActionBody) *StartServiceActionParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the start service action params -func (o *StartServiceActionParams) SetBody(body StartServiceActionBody) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *StartServiceActionParams) 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/actions/v1/json/client/actions_service/start_service_action_responses.go b/api/actions/v1/json/client/actions_service/start_service_action_responses.go deleted file mode 100644 index ffe544f60ab..00000000000 --- a/api/actions/v1/json/client/actions_service/start_service_action_responses.go +++ /dev/null @@ -1,2916 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package actions_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" -) - -// StartServiceActionReader is a Reader for the StartServiceAction structure. -type StartServiceActionReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *StartServiceActionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewStartServiceActionOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewStartServiceActionDefault(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 - } -} - -// NewStartServiceActionOK creates a StartServiceActionOK with default headers values -func NewStartServiceActionOK() *StartServiceActionOK { - return &StartServiceActionOK{} -} - -/* -StartServiceActionOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type StartServiceActionOK struct { - Payload *StartServiceActionOKBody -} - -// IsSuccess returns true when this start service action Ok response has a 2xx status code -func (o *StartServiceActionOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this start service action Ok response has a 3xx status code -func (o *StartServiceActionOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this start service action Ok response has a 4xx status code -func (o *StartServiceActionOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this start service action Ok response has a 5xx status code -func (o *StartServiceActionOK) IsServerError() bool { - return false -} - -// IsCode returns true when this start service action Ok response a status code equal to that given -func (o *StartServiceActionOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the start service action Ok response -func (o *StartServiceActionOK) Code() int { - return 200 -} - -func (o *StartServiceActionOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/actions:startServiceAction][%d] startServiceActionOk %s", 200, payload) -} - -func (o *StartServiceActionOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/actions:startServiceAction][%d] startServiceActionOk %s", 200, payload) -} - -func (o *StartServiceActionOK) GetPayload() *StartServiceActionOKBody { - return o.Payload -} - -func (o *StartServiceActionOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(StartServiceActionOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -// NewStartServiceActionDefault creates a StartServiceActionDefault with default headers values -func NewStartServiceActionDefault(code int) *StartServiceActionDefault { - return &StartServiceActionDefault{ - _statusCode: code, - } -} - -/* -StartServiceActionDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type StartServiceActionDefault struct { - _statusCode int - - Payload *StartServiceActionDefaultBody -} - -// IsSuccess returns true when this start service action default response has a 2xx status code -func (o *StartServiceActionDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this start service action default response has a 3xx status code -func (o *StartServiceActionDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this start service action default response has a 4xx status code -func (o *StartServiceActionDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this start service action default response has a 5xx status code -func (o *StartServiceActionDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this start service action default response a status code equal to that given -func (o *StartServiceActionDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the start service action default response -func (o *StartServiceActionDefault) Code() int { - return o._statusCode -} - -func (o *StartServiceActionDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/actions:startServiceAction][%d] StartServiceAction default %s", o._statusCode, payload) -} - -func (o *StartServiceActionDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/actions:startServiceAction][%d] StartServiceAction default %s", o._statusCode, payload) -} - -func (o *StartServiceActionDefault) GetPayload() *StartServiceActionDefaultBody { - return o.Payload -} - -func (o *StartServiceActionDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(StartServiceActionDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -StartServiceActionBody start service action body -swagger:model StartServiceActionBody -*/ -type StartServiceActionBody struct { - // mongodb explain - MongodbExplain *StartServiceActionParamsBodyMongodbExplain `json:"mongodb_explain,omitempty"` - - // mysql explain - MysqlExplain *StartServiceActionParamsBodyMysqlExplain `json:"mysql_explain,omitempty"` - - // mysql explain json - MysqlExplainJSON *StartServiceActionParamsBodyMysqlExplainJSON `json:"mysql_explain_json,omitempty"` - - // mysql explain traditional json - MysqlExplainTraditionalJSON *StartServiceActionParamsBodyMysqlExplainTraditionalJSON `json:"mysql_explain_traditional_json,omitempty"` - - // mysql show create table - MysqlShowCreateTable *StartServiceActionParamsBodyMysqlShowCreateTable `json:"mysql_show_create_table,omitempty"` - - // mysql show index - MysqlShowIndex *StartServiceActionParamsBodyMysqlShowIndex `json:"mysql_show_index,omitempty"` - - // mysql show table status - MysqlShowTableStatus *StartServiceActionParamsBodyMysqlShowTableStatus `json:"mysql_show_table_status,omitempty"` - - // postgres show create table - PostgresShowCreateTable *StartServiceActionParamsBodyPostgresShowCreateTable `json:"postgres_show_create_table,omitempty"` - - // postgres show index - PostgresShowIndex *StartServiceActionParamsBodyPostgresShowIndex `json:"postgres_show_index,omitempty"` - - // pt mongodb summary - PTMongodbSummary *StartServiceActionParamsBodyPTMongodbSummary `json:"pt_mongodb_summary,omitempty"` - - // pt mysql summary - PTMysqlSummary *StartServiceActionParamsBodyPTMysqlSummary `json:"pt_mysql_summary,omitempty"` - - // pt postgres summary - PTPostgresSummary *StartServiceActionParamsBodyPTPostgresSummary `json:"pt_postgres_summary,omitempty"` -} - -// Validate validates this start service action body -func (o *StartServiceActionBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateMongodbExplain(formats); err != nil { - res = append(res, err) - } - - if err := o.validateMysqlExplain(formats); err != nil { - res = append(res, err) - } - - if err := o.validateMysqlExplainJSON(formats); err != nil { - res = append(res, err) - } - - if err := o.validateMysqlExplainTraditionalJSON(formats); err != nil { - res = append(res, err) - } - - if err := o.validateMysqlShowCreateTable(formats); err != nil { - res = append(res, err) - } - - if err := o.validateMysqlShowIndex(formats); err != nil { - res = append(res, err) - } - - if err := o.validateMysqlShowTableStatus(formats); err != nil { - res = append(res, err) - } - - if err := o.validatePostgresShowCreateTable(formats); err != nil { - res = append(res, err) - } - - if err := o.validatePostgresShowIndex(formats); err != nil { - res = append(res, err) - } - - if err := o.validatePTMongodbSummary(formats); err != nil { - res = append(res, err) - } - - if err := o.validatePTMysqlSummary(formats); err != nil { - res = append(res, err) - } - - if err := o.validatePTPostgresSummary(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *StartServiceActionBody) validateMongodbExplain(formats strfmt.Registry) error { - if swag.IsZero(o.MongodbExplain) { // not required - return nil - } - - if o.MongodbExplain != nil { - if err := o.MongodbExplain.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "mongodb_explain") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "mongodb_explain") - } - - return err - } - } - - return nil -} - -func (o *StartServiceActionBody) validateMysqlExplain(formats strfmt.Registry) error { - if swag.IsZero(o.MysqlExplain) { // not required - return nil - } - - if o.MysqlExplain != nil { - if err := o.MysqlExplain.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "mysql_explain") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "mysql_explain") - } - - return err - } - } - - return nil -} - -func (o *StartServiceActionBody) validateMysqlExplainJSON(formats strfmt.Registry) error { - if swag.IsZero(o.MysqlExplainJSON) { // not required - return nil - } - - if o.MysqlExplainJSON != nil { - if err := o.MysqlExplainJSON.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "mysql_explain_json") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "mysql_explain_json") - } - - return err - } - } - - return nil -} - -func (o *StartServiceActionBody) validateMysqlExplainTraditionalJSON(formats strfmt.Registry) error { - if swag.IsZero(o.MysqlExplainTraditionalJSON) { // not required - return nil - } - - if o.MysqlExplainTraditionalJSON != nil { - if err := o.MysqlExplainTraditionalJSON.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "mysql_explain_traditional_json") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "mysql_explain_traditional_json") - } - - return err - } - } - - return nil -} - -func (o *StartServiceActionBody) validateMysqlShowCreateTable(formats strfmt.Registry) error { - if swag.IsZero(o.MysqlShowCreateTable) { // not required - return nil - } - - if o.MysqlShowCreateTable != nil { - if err := o.MysqlShowCreateTable.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "mysql_show_create_table") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "mysql_show_create_table") - } - - return err - } - } - - return nil -} - -func (o *StartServiceActionBody) validateMysqlShowIndex(formats strfmt.Registry) error { - if swag.IsZero(o.MysqlShowIndex) { // not required - return nil - } - - if o.MysqlShowIndex != nil { - if err := o.MysqlShowIndex.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "mysql_show_index") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "mysql_show_index") - } - - return err - } - } - - return nil -} - -func (o *StartServiceActionBody) validateMysqlShowTableStatus(formats strfmt.Registry) error { - if swag.IsZero(o.MysqlShowTableStatus) { // not required - return nil - } - - if o.MysqlShowTableStatus != nil { - if err := o.MysqlShowTableStatus.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "mysql_show_table_status") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "mysql_show_table_status") - } - - return err - } - } - - return nil -} - -func (o *StartServiceActionBody) validatePostgresShowCreateTable(formats strfmt.Registry) error { - if swag.IsZero(o.PostgresShowCreateTable) { // not required - return nil - } - - if o.PostgresShowCreateTable != nil { - if err := o.PostgresShowCreateTable.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "postgres_show_create_table") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "postgres_show_create_table") - } - - return err - } - } - - return nil -} - -func (o *StartServiceActionBody) validatePostgresShowIndex(formats strfmt.Registry) error { - if swag.IsZero(o.PostgresShowIndex) { // not required - return nil - } - - if o.PostgresShowIndex != nil { - if err := o.PostgresShowIndex.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "postgres_show_index") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "postgres_show_index") - } - - return err - } - } - - return nil -} - -func (o *StartServiceActionBody) validatePTMongodbSummary(formats strfmt.Registry) error { - if swag.IsZero(o.PTMongodbSummary) { // not required - return nil - } - - if o.PTMongodbSummary != nil { - if err := o.PTMongodbSummary.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "pt_mongodb_summary") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "pt_mongodb_summary") - } - - return err - } - } - - return nil -} - -func (o *StartServiceActionBody) validatePTMysqlSummary(formats strfmt.Registry) error { - if swag.IsZero(o.PTMysqlSummary) { // not required - return nil - } - - if o.PTMysqlSummary != nil { - if err := o.PTMysqlSummary.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "pt_mysql_summary") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "pt_mysql_summary") - } - - return err - } - } - - return nil -} - -func (o *StartServiceActionBody) validatePTPostgresSummary(formats strfmt.Registry) error { - if swag.IsZero(o.PTPostgresSummary) { // not required - return nil - } - - if o.PTPostgresSummary != nil { - if err := o.PTPostgresSummary.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "pt_postgres_summary") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "pt_postgres_summary") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this start service action body based on the context it is used -func (o *StartServiceActionBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateMongodbExplain(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateMysqlExplain(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateMysqlExplainJSON(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateMysqlExplainTraditionalJSON(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateMysqlShowCreateTable(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateMysqlShowIndex(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateMysqlShowTableStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidatePostgresShowCreateTable(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidatePostgresShowIndex(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidatePTMongodbSummary(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidatePTMysqlSummary(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidatePTPostgresSummary(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *StartServiceActionBody) contextValidateMongodbExplain(ctx context.Context, formats strfmt.Registry) error { - if o.MongodbExplain != nil { - - if swag.IsZero(o.MongodbExplain) { // not required - return nil - } - - if err := o.MongodbExplain.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "mongodb_explain") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "mongodb_explain") - } - - return err - } - } - - return nil -} - -func (o *StartServiceActionBody) contextValidateMysqlExplain(ctx context.Context, formats strfmt.Registry) error { - if o.MysqlExplain != nil { - - if swag.IsZero(o.MysqlExplain) { // not required - return nil - } - - if err := o.MysqlExplain.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "mysql_explain") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "mysql_explain") - } - - return err - } - } - - return nil -} - -func (o *StartServiceActionBody) contextValidateMysqlExplainJSON(ctx context.Context, formats strfmt.Registry) error { - if o.MysqlExplainJSON != nil { - - if swag.IsZero(o.MysqlExplainJSON) { // not required - return nil - } - - if err := o.MysqlExplainJSON.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "mysql_explain_json") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "mysql_explain_json") - } - - return err - } - } - - return nil -} - -func (o *StartServiceActionBody) contextValidateMysqlExplainTraditionalJSON(ctx context.Context, formats strfmt.Registry) error { - if o.MysqlExplainTraditionalJSON != nil { - - if swag.IsZero(o.MysqlExplainTraditionalJSON) { // not required - return nil - } - - if err := o.MysqlExplainTraditionalJSON.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "mysql_explain_traditional_json") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "mysql_explain_traditional_json") - } - - return err - } - } - - return nil -} - -func (o *StartServiceActionBody) contextValidateMysqlShowCreateTable(ctx context.Context, formats strfmt.Registry) error { - if o.MysqlShowCreateTable != nil { - - if swag.IsZero(o.MysqlShowCreateTable) { // not required - return nil - } - - if err := o.MysqlShowCreateTable.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "mysql_show_create_table") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "mysql_show_create_table") - } - - return err - } - } - - return nil -} - -func (o *StartServiceActionBody) contextValidateMysqlShowIndex(ctx context.Context, formats strfmt.Registry) error { - if o.MysqlShowIndex != nil { - - if swag.IsZero(o.MysqlShowIndex) { // not required - return nil - } - - if err := o.MysqlShowIndex.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "mysql_show_index") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "mysql_show_index") - } - - return err - } - } - - return nil -} - -func (o *StartServiceActionBody) contextValidateMysqlShowTableStatus(ctx context.Context, formats strfmt.Registry) error { - if o.MysqlShowTableStatus != nil { - - if swag.IsZero(o.MysqlShowTableStatus) { // not required - return nil - } - - if err := o.MysqlShowTableStatus.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "mysql_show_table_status") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "mysql_show_table_status") - } - - return err - } - } - - return nil -} - -func (o *StartServiceActionBody) contextValidatePostgresShowCreateTable(ctx context.Context, formats strfmt.Registry) error { - if o.PostgresShowCreateTable != nil { - - if swag.IsZero(o.PostgresShowCreateTable) { // not required - return nil - } - - if err := o.PostgresShowCreateTable.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "postgres_show_create_table") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "postgres_show_create_table") - } - - return err - } - } - - return nil -} - -func (o *StartServiceActionBody) contextValidatePostgresShowIndex(ctx context.Context, formats strfmt.Registry) error { - if o.PostgresShowIndex != nil { - - if swag.IsZero(o.PostgresShowIndex) { // not required - return nil - } - - if err := o.PostgresShowIndex.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "postgres_show_index") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "postgres_show_index") - } - - return err - } - } - - return nil -} - -func (o *StartServiceActionBody) contextValidatePTMongodbSummary(ctx context.Context, formats strfmt.Registry) error { - if o.PTMongodbSummary != nil { - - if swag.IsZero(o.PTMongodbSummary) { // not required - return nil - } - - if err := o.PTMongodbSummary.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "pt_mongodb_summary") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "pt_mongodb_summary") - } - - return err - } - } - - return nil -} - -func (o *StartServiceActionBody) contextValidatePTMysqlSummary(ctx context.Context, formats strfmt.Registry) error { - if o.PTMysqlSummary != nil { - - if swag.IsZero(o.PTMysqlSummary) { // not required - return nil - } - - if err := o.PTMysqlSummary.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "pt_mysql_summary") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "pt_mysql_summary") - } - - return err - } - } - - return nil -} - -func (o *StartServiceActionBody) contextValidatePTPostgresSummary(ctx context.Context, formats strfmt.Registry) error { - if o.PTPostgresSummary != nil { - - if swag.IsZero(o.PTPostgresSummary) { // not required - return nil - } - - if err := o.PTPostgresSummary.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "pt_postgres_summary") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "pt_postgres_summary") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *StartServiceActionBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *StartServiceActionBody) UnmarshalBinary(b []byte) error { - var res StartServiceActionBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -StartServiceActionDefaultBody start service action default body -swagger:model StartServiceActionDefaultBody -*/ -type StartServiceActionDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*StartServiceActionDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this start service action default body -func (o *StartServiceActionDefaultBody) 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 *StartServiceActionDefaultBody) 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("StartServiceAction default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("StartServiceAction default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this start service action default body based on the context it is used -func (o *StartServiceActionDefaultBody) 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 *StartServiceActionDefaultBody) 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("StartServiceAction default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("StartServiceAction default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *StartServiceActionDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *StartServiceActionDefaultBody) UnmarshalBinary(b []byte) error { - var res StartServiceActionDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -StartServiceActionDefaultBodyDetailsItems0 start service action default body details items0 -swagger:model StartServiceActionDefaultBodyDetailsItems0 -*/ -type StartServiceActionDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` - - // start service action default body details items0 - StartServiceActionDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *StartServiceActionDefaultBodyDetailsItems0) 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 StartServiceActionDefaultBodyDetailsItems0 - - 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.StartServiceActionDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o StartServiceActionDefaultBodyDetailsItems0) 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.StartServiceActionDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.StartServiceActionDefaultBodyDetailsItems0) - 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 start service action default body details items0 -func (o *StartServiceActionDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this start service action default body details items0 based on context it is used -func (o *StartServiceActionDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *StartServiceActionDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *StartServiceActionDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res StartServiceActionDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -StartServiceActionOKBody start service action OK body -swagger:model StartServiceActionOKBody -*/ -type StartServiceActionOKBody struct { - // mongodb explain - MongodbExplain *StartServiceActionOKBodyMongodbExplain `json:"mongodb_explain,omitempty"` - - // mysql explain - MysqlExplain *StartServiceActionOKBodyMysqlExplain `json:"mysql_explain,omitempty"` - - // mysql explain json - MysqlExplainJSON *StartServiceActionOKBodyMysqlExplainJSON `json:"mysql_explain_json,omitempty"` - - // mysql explain traditional json - MysqlExplainTraditionalJSON *StartServiceActionOKBodyMysqlExplainTraditionalJSON `json:"mysql_explain_traditional_json,omitempty"` - - // mysql show create table - MysqlShowCreateTable *StartServiceActionOKBodyMysqlShowCreateTable `json:"mysql_show_create_table,omitempty"` - - // mysql show index - MysqlShowIndex *StartServiceActionOKBodyMysqlShowIndex `json:"mysql_show_index,omitempty"` - - // mysql show table status - MysqlShowTableStatus *StartServiceActionOKBodyMysqlShowTableStatus `json:"mysql_show_table_status,omitempty"` - - // postgresql show create table - PostgresqlShowCreateTable *StartServiceActionOKBodyPostgresqlShowCreateTable `json:"postgresql_show_create_table,omitempty"` - - // postgresql show index - PostgresqlShowIndex *StartServiceActionOKBodyPostgresqlShowIndex `json:"postgresql_show_index,omitempty"` - - // pt mongodb summary - PTMongodbSummary *StartServiceActionOKBodyPTMongodbSummary `json:"pt_mongodb_summary,omitempty"` - - // pt mysql summary - PTMysqlSummary *StartServiceActionOKBodyPTMysqlSummary `json:"pt_mysql_summary,omitempty"` - - // pt postgres summary - PTPostgresSummary *StartServiceActionOKBodyPTPostgresSummary `json:"pt_postgres_summary,omitempty"` -} - -// Validate validates this start service action OK body -func (o *StartServiceActionOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateMongodbExplain(formats); err != nil { - res = append(res, err) - } - - if err := o.validateMysqlExplain(formats); err != nil { - res = append(res, err) - } - - if err := o.validateMysqlExplainJSON(formats); err != nil { - res = append(res, err) - } - - if err := o.validateMysqlExplainTraditionalJSON(formats); err != nil { - res = append(res, err) - } - - if err := o.validateMysqlShowCreateTable(formats); err != nil { - res = append(res, err) - } - - if err := o.validateMysqlShowIndex(formats); err != nil { - res = append(res, err) - } - - if err := o.validateMysqlShowTableStatus(formats); err != nil { - res = append(res, err) - } - - if err := o.validatePostgresqlShowCreateTable(formats); err != nil { - res = append(res, err) - } - - if err := o.validatePostgresqlShowIndex(formats); err != nil { - res = append(res, err) - } - - if err := o.validatePTMongodbSummary(formats); err != nil { - res = append(res, err) - } - - if err := o.validatePTMysqlSummary(formats); err != nil { - res = append(res, err) - } - - if err := o.validatePTPostgresSummary(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *StartServiceActionOKBody) validateMongodbExplain(formats strfmt.Registry) error { - if swag.IsZero(o.MongodbExplain) { // not required - return nil - } - - if o.MongodbExplain != nil { - if err := o.MongodbExplain.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("startServiceActionOk" + "." + "mongodb_explain") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("startServiceActionOk" + "." + "mongodb_explain") - } - - return err - } - } - - return nil -} - -func (o *StartServiceActionOKBody) validateMysqlExplain(formats strfmt.Registry) error { - if swag.IsZero(o.MysqlExplain) { // not required - return nil - } - - if o.MysqlExplain != nil { - if err := o.MysqlExplain.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("startServiceActionOk" + "." + "mysql_explain") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("startServiceActionOk" + "." + "mysql_explain") - } - - return err - } - } - - return nil -} - -func (o *StartServiceActionOKBody) validateMysqlExplainJSON(formats strfmt.Registry) error { - if swag.IsZero(o.MysqlExplainJSON) { // not required - return nil - } - - if o.MysqlExplainJSON != nil { - if err := o.MysqlExplainJSON.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("startServiceActionOk" + "." + "mysql_explain_json") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("startServiceActionOk" + "." + "mysql_explain_json") - } - - return err - } - } - - return nil -} - -func (o *StartServiceActionOKBody) validateMysqlExplainTraditionalJSON(formats strfmt.Registry) error { - if swag.IsZero(o.MysqlExplainTraditionalJSON) { // not required - return nil - } - - if o.MysqlExplainTraditionalJSON != nil { - if err := o.MysqlExplainTraditionalJSON.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("startServiceActionOk" + "." + "mysql_explain_traditional_json") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("startServiceActionOk" + "." + "mysql_explain_traditional_json") - } - - return err - } - } - - return nil -} - -func (o *StartServiceActionOKBody) validateMysqlShowCreateTable(formats strfmt.Registry) error { - if swag.IsZero(o.MysqlShowCreateTable) { // not required - return nil - } - - if o.MysqlShowCreateTable != nil { - if err := o.MysqlShowCreateTable.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("startServiceActionOk" + "." + "mysql_show_create_table") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("startServiceActionOk" + "." + "mysql_show_create_table") - } - - return err - } - } - - return nil -} - -func (o *StartServiceActionOKBody) validateMysqlShowIndex(formats strfmt.Registry) error { - if swag.IsZero(o.MysqlShowIndex) { // not required - return nil - } - - if o.MysqlShowIndex != nil { - if err := o.MysqlShowIndex.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("startServiceActionOk" + "." + "mysql_show_index") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("startServiceActionOk" + "." + "mysql_show_index") - } - - return err - } - } - - return nil -} - -func (o *StartServiceActionOKBody) validateMysqlShowTableStatus(formats strfmt.Registry) error { - if swag.IsZero(o.MysqlShowTableStatus) { // not required - return nil - } - - if o.MysqlShowTableStatus != nil { - if err := o.MysqlShowTableStatus.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("startServiceActionOk" + "." + "mysql_show_table_status") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("startServiceActionOk" + "." + "mysql_show_table_status") - } - - return err - } - } - - return nil -} - -func (o *StartServiceActionOKBody) validatePostgresqlShowCreateTable(formats strfmt.Registry) error { - if swag.IsZero(o.PostgresqlShowCreateTable) { // not required - return nil - } - - if o.PostgresqlShowCreateTable != nil { - if err := o.PostgresqlShowCreateTable.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("startServiceActionOk" + "." + "postgresql_show_create_table") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("startServiceActionOk" + "." + "postgresql_show_create_table") - } - - return err - } - } - - return nil -} - -func (o *StartServiceActionOKBody) validatePostgresqlShowIndex(formats strfmt.Registry) error { - if swag.IsZero(o.PostgresqlShowIndex) { // not required - return nil - } - - if o.PostgresqlShowIndex != nil { - if err := o.PostgresqlShowIndex.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("startServiceActionOk" + "." + "postgresql_show_index") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("startServiceActionOk" + "." + "postgresql_show_index") - } - - return err - } - } - - return nil -} - -func (o *StartServiceActionOKBody) validatePTMongodbSummary(formats strfmt.Registry) error { - if swag.IsZero(o.PTMongodbSummary) { // not required - return nil - } - - if o.PTMongodbSummary != nil { - if err := o.PTMongodbSummary.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("startServiceActionOk" + "." + "pt_mongodb_summary") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("startServiceActionOk" + "." + "pt_mongodb_summary") - } - - return err - } - } - - return nil -} - -func (o *StartServiceActionOKBody) validatePTMysqlSummary(formats strfmt.Registry) error { - if swag.IsZero(o.PTMysqlSummary) { // not required - return nil - } - - if o.PTMysqlSummary != nil { - if err := o.PTMysqlSummary.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("startServiceActionOk" + "." + "pt_mysql_summary") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("startServiceActionOk" + "." + "pt_mysql_summary") - } - - return err - } - } - - return nil -} - -func (o *StartServiceActionOKBody) validatePTPostgresSummary(formats strfmt.Registry) error { - if swag.IsZero(o.PTPostgresSummary) { // not required - return nil - } - - if o.PTPostgresSummary != nil { - if err := o.PTPostgresSummary.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("startServiceActionOk" + "." + "pt_postgres_summary") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("startServiceActionOk" + "." + "pt_postgres_summary") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this start service action OK body based on the context it is used -func (o *StartServiceActionOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateMongodbExplain(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateMysqlExplain(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateMysqlExplainJSON(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateMysqlExplainTraditionalJSON(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateMysqlShowCreateTable(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateMysqlShowIndex(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateMysqlShowTableStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidatePostgresqlShowCreateTable(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidatePostgresqlShowIndex(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidatePTMongodbSummary(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidatePTMysqlSummary(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidatePTPostgresSummary(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *StartServiceActionOKBody) contextValidateMongodbExplain(ctx context.Context, formats strfmt.Registry) error { - if o.MongodbExplain != nil { - - if swag.IsZero(o.MongodbExplain) { // not required - return nil - } - - if err := o.MongodbExplain.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("startServiceActionOk" + "." + "mongodb_explain") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("startServiceActionOk" + "." + "mongodb_explain") - } - - return err - } - } - - return nil -} - -func (o *StartServiceActionOKBody) contextValidateMysqlExplain(ctx context.Context, formats strfmt.Registry) error { - if o.MysqlExplain != nil { - - if swag.IsZero(o.MysqlExplain) { // not required - return nil - } - - if err := o.MysqlExplain.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("startServiceActionOk" + "." + "mysql_explain") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("startServiceActionOk" + "." + "mysql_explain") - } - - return err - } - } - - return nil -} - -func (o *StartServiceActionOKBody) contextValidateMysqlExplainJSON(ctx context.Context, formats strfmt.Registry) error { - if o.MysqlExplainJSON != nil { - - if swag.IsZero(o.MysqlExplainJSON) { // not required - return nil - } - - if err := o.MysqlExplainJSON.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("startServiceActionOk" + "." + "mysql_explain_json") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("startServiceActionOk" + "." + "mysql_explain_json") - } - - return err - } - } - - return nil -} - -func (o *StartServiceActionOKBody) contextValidateMysqlExplainTraditionalJSON(ctx context.Context, formats strfmt.Registry) error { - if o.MysqlExplainTraditionalJSON != nil { - - if swag.IsZero(o.MysqlExplainTraditionalJSON) { // not required - return nil - } - - if err := o.MysqlExplainTraditionalJSON.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("startServiceActionOk" + "." + "mysql_explain_traditional_json") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("startServiceActionOk" + "." + "mysql_explain_traditional_json") - } - - return err - } - } - - return nil -} - -func (o *StartServiceActionOKBody) contextValidateMysqlShowCreateTable(ctx context.Context, formats strfmt.Registry) error { - if o.MysqlShowCreateTable != nil { - - if swag.IsZero(o.MysqlShowCreateTable) { // not required - return nil - } - - if err := o.MysqlShowCreateTable.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("startServiceActionOk" + "." + "mysql_show_create_table") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("startServiceActionOk" + "." + "mysql_show_create_table") - } - - return err - } - } - - return nil -} - -func (o *StartServiceActionOKBody) contextValidateMysqlShowIndex(ctx context.Context, formats strfmt.Registry) error { - if o.MysqlShowIndex != nil { - - if swag.IsZero(o.MysqlShowIndex) { // not required - return nil - } - - if err := o.MysqlShowIndex.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("startServiceActionOk" + "." + "mysql_show_index") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("startServiceActionOk" + "." + "mysql_show_index") - } - - return err - } - } - - return nil -} - -func (o *StartServiceActionOKBody) contextValidateMysqlShowTableStatus(ctx context.Context, formats strfmt.Registry) error { - if o.MysqlShowTableStatus != nil { - - if swag.IsZero(o.MysqlShowTableStatus) { // not required - return nil - } - - if err := o.MysqlShowTableStatus.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("startServiceActionOk" + "." + "mysql_show_table_status") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("startServiceActionOk" + "." + "mysql_show_table_status") - } - - return err - } - } - - return nil -} - -func (o *StartServiceActionOKBody) contextValidatePostgresqlShowCreateTable(ctx context.Context, formats strfmt.Registry) error { - if o.PostgresqlShowCreateTable != nil { - - if swag.IsZero(o.PostgresqlShowCreateTable) { // not required - return nil - } - - if err := o.PostgresqlShowCreateTable.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("startServiceActionOk" + "." + "postgresql_show_create_table") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("startServiceActionOk" + "." + "postgresql_show_create_table") - } - - return err - } - } - - return nil -} - -func (o *StartServiceActionOKBody) contextValidatePostgresqlShowIndex(ctx context.Context, formats strfmt.Registry) error { - if o.PostgresqlShowIndex != nil { - - if swag.IsZero(o.PostgresqlShowIndex) { // not required - return nil - } - - if err := o.PostgresqlShowIndex.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("startServiceActionOk" + "." + "postgresql_show_index") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("startServiceActionOk" + "." + "postgresql_show_index") - } - - return err - } - } - - return nil -} - -func (o *StartServiceActionOKBody) contextValidatePTMongodbSummary(ctx context.Context, formats strfmt.Registry) error { - if o.PTMongodbSummary != nil { - - if swag.IsZero(o.PTMongodbSummary) { // not required - return nil - } - - if err := o.PTMongodbSummary.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("startServiceActionOk" + "." + "pt_mongodb_summary") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("startServiceActionOk" + "." + "pt_mongodb_summary") - } - - return err - } - } - - return nil -} - -func (o *StartServiceActionOKBody) contextValidatePTMysqlSummary(ctx context.Context, formats strfmt.Registry) error { - if o.PTMysqlSummary != nil { - - if swag.IsZero(o.PTMysqlSummary) { // not required - return nil - } - - if err := o.PTMysqlSummary.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("startServiceActionOk" + "." + "pt_mysql_summary") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("startServiceActionOk" + "." + "pt_mysql_summary") - } - - return err - } - } - - return nil -} - -func (o *StartServiceActionOKBody) contextValidatePTPostgresSummary(ctx context.Context, formats strfmt.Registry) error { - if o.PTPostgresSummary != nil { - - if swag.IsZero(o.PTPostgresSummary) { // not required - return nil - } - - if err := o.PTPostgresSummary.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("startServiceActionOk" + "." + "pt_postgres_summary") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("startServiceActionOk" + "." + "pt_postgres_summary") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *StartServiceActionOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *StartServiceActionOKBody) UnmarshalBinary(b []byte) error { - var res StartServiceActionOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -StartServiceActionOKBodyMongodbExplain start service action OK body mongodb explain -swagger:model StartServiceActionOKBodyMongodbExplain -*/ -type StartServiceActionOKBodyMongodbExplain struct { - // Unique Action ID. - ActionID string `json:"action_id,omitempty"` - - // pmm-agent ID where to this Action was started. - PMMAgentID string `json:"pmm_agent_id,omitempty"` -} - -// Validate validates this start service action OK body mongodb explain -func (o *StartServiceActionOKBodyMongodbExplain) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this start service action OK body mongodb explain based on context it is used -func (o *StartServiceActionOKBodyMongodbExplain) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *StartServiceActionOKBodyMongodbExplain) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *StartServiceActionOKBodyMongodbExplain) UnmarshalBinary(b []byte) error { - var res StartServiceActionOKBodyMongodbExplain - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -StartServiceActionOKBodyMysqlExplain start service action OK body mysql explain -swagger:model StartServiceActionOKBodyMysqlExplain -*/ -type StartServiceActionOKBodyMysqlExplain struct { - // Unique Action ID. - ActionID string `json:"action_id,omitempty"` - - // pmm-agent ID where to this Action was started. - PMMAgentID string `json:"pmm_agent_id,omitempty"` -} - -// Validate validates this start service action OK body mysql explain -func (o *StartServiceActionOKBodyMysqlExplain) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this start service action OK body mysql explain based on context it is used -func (o *StartServiceActionOKBodyMysqlExplain) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *StartServiceActionOKBodyMysqlExplain) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *StartServiceActionOKBodyMysqlExplain) UnmarshalBinary(b []byte) error { - var res StartServiceActionOKBodyMysqlExplain - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -StartServiceActionOKBodyMysqlExplainJSON start service action OK body mysql explain JSON -swagger:model StartServiceActionOKBodyMysqlExplainJSON -*/ -type StartServiceActionOKBodyMysqlExplainJSON struct { - // Unique Action ID. - ActionID string `json:"action_id,omitempty"` - - // pmm-agent ID where to this Action was started. - PMMAgentID string `json:"pmm_agent_id,omitempty"` -} - -// Validate validates this start service action OK body mysql explain JSON -func (o *StartServiceActionOKBodyMysqlExplainJSON) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this start service action OK body mysql explain JSON based on context it is used -func (o *StartServiceActionOKBodyMysqlExplainJSON) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *StartServiceActionOKBodyMysqlExplainJSON) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *StartServiceActionOKBodyMysqlExplainJSON) UnmarshalBinary(b []byte) error { - var res StartServiceActionOKBodyMysqlExplainJSON - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -StartServiceActionOKBodyMysqlExplainTraditionalJSON start service action OK body mysql explain traditional JSON -swagger:model StartServiceActionOKBodyMysqlExplainTraditionalJSON -*/ -type StartServiceActionOKBodyMysqlExplainTraditionalJSON struct { - // Unique Action ID. - ActionID string `json:"action_id,omitempty"` - - // pmm-agent ID where to this Action was started. - PMMAgentID string `json:"pmm_agent_id,omitempty"` -} - -// Validate validates this start service action OK body mysql explain traditional JSON -func (o *StartServiceActionOKBodyMysqlExplainTraditionalJSON) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this start service action OK body mysql explain traditional JSON based on context it is used -func (o *StartServiceActionOKBodyMysqlExplainTraditionalJSON) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *StartServiceActionOKBodyMysqlExplainTraditionalJSON) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *StartServiceActionOKBodyMysqlExplainTraditionalJSON) UnmarshalBinary(b []byte) error { - var res StartServiceActionOKBodyMysqlExplainTraditionalJSON - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -StartServiceActionOKBodyMysqlShowCreateTable start service action OK body mysql show create table -swagger:model StartServiceActionOKBodyMysqlShowCreateTable -*/ -type StartServiceActionOKBodyMysqlShowCreateTable struct { - // Unique Action ID. - ActionID string `json:"action_id,omitempty"` - - // pmm-agent ID where to this Action was started. - PMMAgentID string `json:"pmm_agent_id,omitempty"` -} - -// Validate validates this start service action OK body mysql show create table -func (o *StartServiceActionOKBodyMysqlShowCreateTable) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this start service action OK body mysql show create table based on context it is used -func (o *StartServiceActionOKBodyMysqlShowCreateTable) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *StartServiceActionOKBodyMysqlShowCreateTable) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *StartServiceActionOKBodyMysqlShowCreateTable) UnmarshalBinary(b []byte) error { - var res StartServiceActionOKBodyMysqlShowCreateTable - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -StartServiceActionOKBodyMysqlShowIndex start service action OK body mysql show index -swagger:model StartServiceActionOKBodyMysqlShowIndex -*/ -type StartServiceActionOKBodyMysqlShowIndex struct { - // Unique Action ID. - ActionID string `json:"action_id,omitempty"` - - // pmm-agent ID where to this Action was started. - PMMAgentID string `json:"pmm_agent_id,omitempty"` -} - -// Validate validates this start service action OK body mysql show index -func (o *StartServiceActionOKBodyMysqlShowIndex) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this start service action OK body mysql show index based on context it is used -func (o *StartServiceActionOKBodyMysqlShowIndex) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *StartServiceActionOKBodyMysqlShowIndex) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *StartServiceActionOKBodyMysqlShowIndex) UnmarshalBinary(b []byte) error { - var res StartServiceActionOKBodyMysqlShowIndex - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -StartServiceActionOKBodyMysqlShowTableStatus start service action OK body mysql show table status -swagger:model StartServiceActionOKBodyMysqlShowTableStatus -*/ -type StartServiceActionOKBodyMysqlShowTableStatus struct { - // Unique Action ID. - ActionID string `json:"action_id,omitempty"` - - // pmm-agent ID where to this Action was started. - PMMAgentID string `json:"pmm_agent_id,omitempty"` -} - -// Validate validates this start service action OK body mysql show table status -func (o *StartServiceActionOKBodyMysqlShowTableStatus) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this start service action OK body mysql show table status based on context it is used -func (o *StartServiceActionOKBodyMysqlShowTableStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *StartServiceActionOKBodyMysqlShowTableStatus) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *StartServiceActionOKBodyMysqlShowTableStatus) UnmarshalBinary(b []byte) error { - var res StartServiceActionOKBodyMysqlShowTableStatus - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -StartServiceActionOKBodyPTMongodbSummary Message to retrieve the prepared pt-mongodb-summary data -swagger:model StartServiceActionOKBodyPTMongodbSummary -*/ -type StartServiceActionOKBodyPTMongodbSummary struct { - // Unique Action ID. - ActionID string `json:"action_id,omitempty"` - - // pmm-agent ID where to this Action was started. - PMMAgentID string `json:"pmm_agent_id,omitempty"` -} - -// Validate validates this start service action OK body PT mongodb summary -func (o *StartServiceActionOKBodyPTMongodbSummary) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this start service action OK body PT mongodb summary based on context it is used -func (o *StartServiceActionOKBodyPTMongodbSummary) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *StartServiceActionOKBodyPTMongodbSummary) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *StartServiceActionOKBodyPTMongodbSummary) UnmarshalBinary(b []byte) error { - var res StartServiceActionOKBodyPTMongodbSummary - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -StartServiceActionOKBodyPTMysqlSummary Message to retrieve the prepared pt-mysql-summary data -swagger:model StartServiceActionOKBodyPTMysqlSummary -*/ -type StartServiceActionOKBodyPTMysqlSummary struct { - // Unique Action ID. - ActionID string `json:"action_id,omitempty"` - - // pmm-agent ID where to this Action was started. - PMMAgentID string `json:"pmm_agent_id,omitempty"` -} - -// Validate validates this start service action OK body PT mysql summary -func (o *StartServiceActionOKBodyPTMysqlSummary) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this start service action OK body PT mysql summary based on context it is used -func (o *StartServiceActionOKBodyPTMysqlSummary) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *StartServiceActionOKBodyPTMysqlSummary) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *StartServiceActionOKBodyPTMysqlSummary) UnmarshalBinary(b []byte) error { - var res StartServiceActionOKBodyPTMysqlSummary - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -StartServiceActionOKBodyPTPostgresSummary Message to retrieve the prepared pt-pg-summary data -swagger:model StartServiceActionOKBodyPTPostgresSummary -*/ -type StartServiceActionOKBodyPTPostgresSummary struct { - // Unique Action ID. - ActionID string `json:"action_id,omitempty"` - - // pmm-agent ID where to this Action was started. - PMMAgentID string `json:"pmm_agent_id,omitempty"` -} - -// Validate validates this start service action OK body PT postgres summary -func (o *StartServiceActionOKBodyPTPostgresSummary) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this start service action OK body PT postgres summary based on context it is used -func (o *StartServiceActionOKBodyPTPostgresSummary) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *StartServiceActionOKBodyPTPostgresSummary) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *StartServiceActionOKBodyPTPostgresSummary) UnmarshalBinary(b []byte) error { - var res StartServiceActionOKBodyPTPostgresSummary - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -StartServiceActionOKBodyPostgresqlShowCreateTable start service action OK body postgresql show create table -swagger:model StartServiceActionOKBodyPostgresqlShowCreateTable -*/ -type StartServiceActionOKBodyPostgresqlShowCreateTable struct { - // Unique Action ID. - ActionID string `json:"action_id,omitempty"` - - // pmm-agent ID where to this Action was started. - PMMAgentID string `json:"pmm_agent_id,omitempty"` -} - -// Validate validates this start service action OK body postgresql show create table -func (o *StartServiceActionOKBodyPostgresqlShowCreateTable) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this start service action OK body postgresql show create table based on context it is used -func (o *StartServiceActionOKBodyPostgresqlShowCreateTable) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *StartServiceActionOKBodyPostgresqlShowCreateTable) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *StartServiceActionOKBodyPostgresqlShowCreateTable) UnmarshalBinary(b []byte) error { - var res StartServiceActionOKBodyPostgresqlShowCreateTable - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -StartServiceActionOKBodyPostgresqlShowIndex start service action OK body postgresql show index -swagger:model StartServiceActionOKBodyPostgresqlShowIndex -*/ -type StartServiceActionOKBodyPostgresqlShowIndex struct { - // Unique Action ID. - ActionID string `json:"action_id,omitempty"` - - // pmm-agent ID where to this Action was started. - PMMAgentID string `json:"pmm_agent_id,omitempty"` -} - -// Validate validates this start service action OK body postgresql show index -func (o *StartServiceActionOKBodyPostgresqlShowIndex) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this start service action OK body postgresql show index based on context it is used -func (o *StartServiceActionOKBodyPostgresqlShowIndex) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *StartServiceActionOKBodyPostgresqlShowIndex) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *StartServiceActionOKBodyPostgresqlShowIndex) UnmarshalBinary(b []byte) error { - var res StartServiceActionOKBodyPostgresqlShowIndex - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -StartServiceActionParamsBodyMongodbExplain start service action params body mongodb explain -swagger:model StartServiceActionParamsBodyMongodbExplain -*/ -type StartServiceActionParamsBodyMongodbExplain struct { - // pmm-agent ID where to run this Action. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Service ID for this Action. Required. - ServiceID string `json:"service_id,omitempty"` - - // Query. Required. - Query string `json:"query,omitempty"` -} - -// Validate validates this start service action params body mongodb explain -func (o *StartServiceActionParamsBodyMongodbExplain) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this start service action params body mongodb explain based on context it is used -func (o *StartServiceActionParamsBodyMongodbExplain) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *StartServiceActionParamsBodyMongodbExplain) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *StartServiceActionParamsBodyMongodbExplain) UnmarshalBinary(b []byte) error { - var res StartServiceActionParamsBodyMongodbExplain - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -StartServiceActionParamsBodyMysqlExplain start service action params body mysql explain -swagger:model StartServiceActionParamsBodyMysqlExplain -*/ -type StartServiceActionParamsBodyMysqlExplain struct { - // pmm-agent ID where to run this Action. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Service ID for this Action. Required. - ServiceID string `json:"service_id,omitempty"` - - // Query ID of query. - QueryID string `json:"query_id,omitempty"` - - // Array of placeholder values - Placeholders []string `json:"placeholders"` - - // Database name. Required if it can't be deduced from the query ID. - Database string `json:"database,omitempty"` -} - -// Validate validates this start service action params body mysql explain -func (o *StartServiceActionParamsBodyMysqlExplain) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this start service action params body mysql explain based on context it is used -func (o *StartServiceActionParamsBodyMysqlExplain) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *StartServiceActionParamsBodyMysqlExplain) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *StartServiceActionParamsBodyMysqlExplain) UnmarshalBinary(b []byte) error { - var res StartServiceActionParamsBodyMysqlExplain - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -StartServiceActionParamsBodyMysqlExplainJSON start service action params body mysql explain JSON -swagger:model StartServiceActionParamsBodyMysqlExplainJSON -*/ -type StartServiceActionParamsBodyMysqlExplainJSON struct { - // pmm-agent ID where to run this Action. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Service ID for this Action. Required. - ServiceID string `json:"service_id,omitempty"` - - // Query ID of query. - QueryID string `json:"query_id,omitempty"` - - // Array of placeholder values - Placeholders []string `json:"placeholders"` - - // Database name. Required if it can't be deduced from the query ID. - Database string `json:"database,omitempty"` -} - -// Validate validates this start service action params body mysql explain JSON -func (o *StartServiceActionParamsBodyMysqlExplainJSON) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this start service action params body mysql explain JSON based on context it is used -func (o *StartServiceActionParamsBodyMysqlExplainJSON) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *StartServiceActionParamsBodyMysqlExplainJSON) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *StartServiceActionParamsBodyMysqlExplainJSON) UnmarshalBinary(b []byte) error { - var res StartServiceActionParamsBodyMysqlExplainJSON - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -StartServiceActionParamsBodyMysqlExplainTraditionalJSON start service action params body mysql explain traditional JSON -swagger:model StartServiceActionParamsBodyMysqlExplainTraditionalJSON -*/ -type StartServiceActionParamsBodyMysqlExplainTraditionalJSON struct { - // pmm-agent ID where to run this Action. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Service ID for this Action. Required. - ServiceID string `json:"service_id,omitempty"` - - // Query ID of query. - QueryID string `json:"query_id,omitempty"` - - // Array of placeholder values - Placeholders []string `json:"placeholders"` - - // Database name. Required if it can't be deduced from the query ID. - Database string `json:"database,omitempty"` -} - -// Validate validates this start service action params body mysql explain traditional JSON -func (o *StartServiceActionParamsBodyMysqlExplainTraditionalJSON) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this start service action params body mysql explain traditional JSON based on context it is used -func (o *StartServiceActionParamsBodyMysqlExplainTraditionalJSON) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *StartServiceActionParamsBodyMysqlExplainTraditionalJSON) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *StartServiceActionParamsBodyMysqlExplainTraditionalJSON) UnmarshalBinary(b []byte) error { - var res StartServiceActionParamsBodyMysqlExplainTraditionalJSON - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -StartServiceActionParamsBodyMysqlShowCreateTable start service action params body mysql show create table -swagger:model StartServiceActionParamsBodyMysqlShowCreateTable -*/ -type StartServiceActionParamsBodyMysqlShowCreateTable struct { - // pmm-agent ID where to run this Action. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Service ID for this Action. Required. - ServiceID string `json:"service_id,omitempty"` - - // Table name. Required. May additionally contain a database name. - TableName string `json:"table_name,omitempty"` - - // Database name. Required if not given in the table_name field. - Database string `json:"database,omitempty"` -} - -// Validate validates this start service action params body mysql show create table -func (o *StartServiceActionParamsBodyMysqlShowCreateTable) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this start service action params body mysql show create table based on context it is used -func (o *StartServiceActionParamsBodyMysqlShowCreateTable) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *StartServiceActionParamsBodyMysqlShowCreateTable) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *StartServiceActionParamsBodyMysqlShowCreateTable) UnmarshalBinary(b []byte) error { - var res StartServiceActionParamsBodyMysqlShowCreateTable - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -StartServiceActionParamsBodyMysqlShowIndex start service action params body mysql show index -swagger:model StartServiceActionParamsBodyMysqlShowIndex -*/ -type StartServiceActionParamsBodyMysqlShowIndex struct { - // pmm-agent ID where to run this Action. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Service ID for this Action. Required. - ServiceID string `json:"service_id,omitempty"` - - // Table name. Required. May additionally contain a database name. - TableName string `json:"table_name,omitempty"` - - // Database name. Required if not given in the table_name field. - Database string `json:"database,omitempty"` -} - -// Validate validates this start service action params body mysql show index -func (o *StartServiceActionParamsBodyMysqlShowIndex) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this start service action params body mysql show index based on context it is used -func (o *StartServiceActionParamsBodyMysqlShowIndex) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *StartServiceActionParamsBodyMysqlShowIndex) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *StartServiceActionParamsBodyMysqlShowIndex) UnmarshalBinary(b []byte) error { - var res StartServiceActionParamsBodyMysqlShowIndex - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -StartServiceActionParamsBodyMysqlShowTableStatus start service action params body mysql show table status -swagger:model StartServiceActionParamsBodyMysqlShowTableStatus -*/ -type StartServiceActionParamsBodyMysqlShowTableStatus struct { - // pmm-agent ID where to run this Action. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Service ID for this Action. Required. - ServiceID string `json:"service_id,omitempty"` - - // Table name. Required. May additionally contain a database name. - TableName string `json:"table_name,omitempty"` - - // Database name. Required if not given in the table_name field. - Database string `json:"database,omitempty"` -} - -// Validate validates this start service action params body mysql show table status -func (o *StartServiceActionParamsBodyMysqlShowTableStatus) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this start service action params body mysql show table status based on context it is used -func (o *StartServiceActionParamsBodyMysqlShowTableStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *StartServiceActionParamsBodyMysqlShowTableStatus) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *StartServiceActionParamsBodyMysqlShowTableStatus) UnmarshalBinary(b []byte) error { - var res StartServiceActionParamsBodyMysqlShowTableStatus - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -StartServiceActionParamsBodyPTMongodbSummary Message to prepare pt-mongodb-summary data -swagger:model StartServiceActionParamsBodyPTMongodbSummary -*/ -type StartServiceActionParamsBodyPTMongodbSummary struct { - // pmm-agent ID where to run this Action. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Service ID for this Action. - ServiceID string `json:"service_id,omitempty"` -} - -// Validate validates this start service action params body PT mongodb summary -func (o *StartServiceActionParamsBodyPTMongodbSummary) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this start service action params body PT mongodb summary based on context it is used -func (o *StartServiceActionParamsBodyPTMongodbSummary) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *StartServiceActionParamsBodyPTMongodbSummary) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *StartServiceActionParamsBodyPTMongodbSummary) UnmarshalBinary(b []byte) error { - var res StartServiceActionParamsBodyPTMongodbSummary - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -StartServiceActionParamsBodyPTMysqlSummary Message to prepare pt-mysql-summary data -swagger:model StartServiceActionParamsBodyPTMysqlSummary -*/ -type StartServiceActionParamsBodyPTMysqlSummary struct { - // pmm-agent ID where to run this Action. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Service ID for this Action. - ServiceID string `json:"service_id,omitempty"` -} - -// Validate validates this start service action params body PT mysql summary -func (o *StartServiceActionParamsBodyPTMysqlSummary) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this start service action params body PT mysql summary based on context it is used -func (o *StartServiceActionParamsBodyPTMysqlSummary) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *StartServiceActionParamsBodyPTMysqlSummary) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *StartServiceActionParamsBodyPTMysqlSummary) UnmarshalBinary(b []byte) error { - var res StartServiceActionParamsBodyPTMysqlSummary - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -StartServiceActionParamsBodyPTPostgresSummary Message to prepare pt-pg-summary data -swagger:model StartServiceActionParamsBodyPTPostgresSummary -*/ -type StartServiceActionParamsBodyPTPostgresSummary struct { - // pmm-agent ID where to run this Action. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Service ID for this Action. - ServiceID string `json:"service_id,omitempty"` -} - -// Validate validates this start service action params body PT postgres summary -func (o *StartServiceActionParamsBodyPTPostgresSummary) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this start service action params body PT postgres summary based on context it is used -func (o *StartServiceActionParamsBodyPTPostgresSummary) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *StartServiceActionParamsBodyPTPostgresSummary) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *StartServiceActionParamsBodyPTPostgresSummary) UnmarshalBinary(b []byte) error { - var res StartServiceActionParamsBodyPTPostgresSummary - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -StartServiceActionParamsBodyPostgresShowCreateTable start service action params body postgres show create table -swagger:model StartServiceActionParamsBodyPostgresShowCreateTable -*/ -type StartServiceActionParamsBodyPostgresShowCreateTable struct { - // pmm-agent ID where to run this Action. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Service ID for this Action. Required. - ServiceID string `json:"service_id,omitempty"` - - // Table name. Required. May additionally contain a database name. - TableName string `json:"table_name,omitempty"` - - // Database name. Required if not given in the table_name field. - Database string `json:"database,omitempty"` -} - -// Validate validates this start service action params body postgres show create table -func (o *StartServiceActionParamsBodyPostgresShowCreateTable) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this start service action params body postgres show create table based on context it is used -func (o *StartServiceActionParamsBodyPostgresShowCreateTable) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *StartServiceActionParamsBodyPostgresShowCreateTable) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *StartServiceActionParamsBodyPostgresShowCreateTable) UnmarshalBinary(b []byte) error { - var res StartServiceActionParamsBodyPostgresShowCreateTable - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -StartServiceActionParamsBodyPostgresShowIndex start service action params body postgres show index -swagger:model StartServiceActionParamsBodyPostgresShowIndex -*/ -type StartServiceActionParamsBodyPostgresShowIndex struct { - // pmm-agent ID where to run this Action. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Service ID for this Action. Required. - ServiceID string `json:"service_id,omitempty"` - - // Table name. Required. May additionally contain a database name. - TableName string `json:"table_name,omitempty"` - - // Database name. Required if not given in the table_name field. - Database string `json:"database,omitempty"` -} - -// Validate validates this start service action params body postgres show index -func (o *StartServiceActionParamsBodyPostgresShowIndex) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this start service action params body postgres show index based on context it is used -func (o *StartServiceActionParamsBodyPostgresShowIndex) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *StartServiceActionParamsBodyPostgresShowIndex) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *StartServiceActionParamsBodyPostgresShowIndex) UnmarshalBinary(b []byte) error { - var res StartServiceActionParamsBodyPostgresShowIndex - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/actions/v1/json/client/pmm_actions_api_client.go b/api/actions/v1/json/client/pmm_actions_api_client.go deleted file mode 100644 index 68e452a7eff..00000000000 --- a/api/actions/v1/json/client/pmm_actions_api_client.go +++ /dev/null @@ -1,112 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package client - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/percona/pmm/api/actions/v1/json/client/actions_service" -) - -// Default PMM actions API HTTP client. -var Default = NewHTTPClient(nil) - -const ( - // DefaultHost is the default Host - // found in Meta (info) section of spec file - DefaultHost string = "localhost" - // DefaultBasePath is the default BasePath - // found in Meta (info) section of spec file - DefaultBasePath string = "/" -) - -// DefaultSchemes are the default schemes found in Meta (info) section of spec file -var DefaultSchemes = []string{"http", "https"} - -// NewHTTPClient creates a new PMM actions API HTTP client. -func NewHTTPClient(formats strfmt.Registry) *PMMActionsAPI { - return NewHTTPClientWithConfig(formats, nil) -} - -// NewHTTPClientWithConfig creates a new PMM actions API HTTP client, -// using a customizable transport config. -func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *PMMActionsAPI { - // ensure nullable parameters have default - if cfg == nil { - cfg = DefaultTransportConfig() - } - - // create transport and client - transport := httptransport.New(cfg.Host, cfg.BasePath, cfg.Schemes) - return New(transport, formats) -} - -// New creates a new PMM actions API client -func New(transport runtime.ClientTransport, formats strfmt.Registry) *PMMActionsAPI { - // ensure nullable parameters have default - if formats == nil { - formats = strfmt.Default - } - - cli := new(PMMActionsAPI) - cli.Transport = transport - cli.ActionsService = actions_service.New(transport, formats) - return cli -} - -// DefaultTransportConfig creates a TransportConfig with the -// default settings taken from the meta section of the spec file. -func DefaultTransportConfig() *TransportConfig { - return &TransportConfig{ - Host: DefaultHost, - BasePath: DefaultBasePath, - Schemes: DefaultSchemes, - } -} - -// TransportConfig contains the transport related info, -// found in the meta section of the spec file. -type TransportConfig struct { - Host string - BasePath string - Schemes []string -} - -// WithHost overrides the default host, -// provided by the meta section of the spec file. -func (cfg *TransportConfig) WithHost(host string) *TransportConfig { - cfg.Host = host - return cfg -} - -// WithBasePath overrides the default basePath, -// provided by the meta section of the spec file. -func (cfg *TransportConfig) WithBasePath(basePath string) *TransportConfig { - cfg.BasePath = basePath - return cfg -} - -// WithSchemes overrides the default schemes, -// provided by the meta section of the spec file. -func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig { - cfg.Schemes = schemes - return cfg -} - -// PMMActionsAPI is a client for PMM actions API -type PMMActionsAPI struct { - ActionsService actions_service.ClientService - - Transport runtime.ClientTransport -} - -// SetTransport changes the transport on the client and all its subresources -func (c *PMMActionsAPI) SetTransport(transport runtime.ClientTransport) { - c.Transport = transport - c.ActionsService.SetTransport(transport) -} diff --git a/api/actions/v1/json/v1.json b/api/actions/v1/json/v1.json deleted file mode 100644 index 5c13608b54d..00000000000 --- a/api/actions/v1/json/v1.json +++ /dev/null @@ -1,820 +0,0 @@ -{ - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "schemes": [ - "https", - "http" - ], - "swagger": "2.0", - "info": { - "title": "PMM Actions API", - "version": "v1" - }, - "paths": { - "/v1/actions/{action_id}": { - "get": { - "description": "Gets the result of a given Action.", - "tags": [ - "ActionsService" - ], - "summary": "Get Action", - "operationId": "GetAction", - "parameters": [ - { - "type": "string", - "description": "Unique Action ID.", - "name": "action_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "action_id": { - "description": "Unique Action ID.", - "type": "string", - "x-order": 0 - }, - "pmm_agent_id": { - "description": "pmm-agent ID where this Action is running / was run.", - "type": "string", - "x-order": 1 - }, - "output": { - "description": "Current Action output; may be partial if Action is still running.", - "type": "string", - "x-order": 2 - }, - "done": { - "description": "True if Action is finished.", - "type": "boolean", - "x-order": 3 - }, - "error": { - "description": "Error message if Action failed.", - "type": "string", - "x-order": 4 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/actions:cancelAction": { - "post": { - "description": "Stops an Action.", - "tags": [ - "ActionsService" - ], - "summary": "Cancel an Action", - "operationId": "CancelAction", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "action_id": { - "description": "Unique Action ID. Required.", - "type": "string", - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/actions:startNodeAction": { - "post": { - "description": "Starts 'Percona Toolkit Summary' Action.", - "tags": [ - "ActionsService" - ], - "summary": "Start 'PT Summary' Action", - "operationId": "StartPTSummaryAction", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "pmm_agent_id": { - "description": "pmm-agent ID where to run this Action.", - "type": "string", - "x-order": 0 - }, - "node_id": { - "description": "Node ID for this Action.", - "type": "string", - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "action_id": { - "description": "Unique Action ID.", - "type": "string", - "x-order": 0 - }, - "pmm_agent_id": { - "description": "pmm-agent ID where to this Action was started.", - "type": "string", - "x-order": 1 - } - } - } - }, - "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/actions:startServiceAction": { - "post": { - "description": "Starts a Service Action.", - "tags": [ - "ActionsService" - ], - "summary": "Start a Service Action", - "operationId": "StartServiceAction", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "mysql_explain": { - "type": "object", - "properties": { - "pmm_agent_id": { - "description": "pmm-agent ID where to run this Action.", - "type": "string", - "x-order": 0 - }, - "service_id": { - "description": "Service ID for this Action. Required.", - "type": "string", - "x-order": 1 - }, - "query_id": { - "description": "Query ID of query.", - "type": "string", - "x-order": 2 - }, - "placeholders": { - "type": "array", - "title": "Array of placeholder values", - "items": { - "type": "string" - }, - "x-order": 3 - }, - "database": { - "description": "Database name. Required if it can't be deduced from the query ID.", - "type": "string", - "x-order": 4 - } - }, - "x-order": 0 - }, - "mysql_explain_json": { - "type": "object", - "properties": { - "pmm_agent_id": { - "description": "pmm-agent ID where to run this Action.", - "type": "string", - "x-order": 0 - }, - "service_id": { - "description": "Service ID for this Action. Required.", - "type": "string", - "x-order": 1 - }, - "query_id": { - "description": "Query ID of query.", - "type": "string", - "x-order": 2 - }, - "placeholders": { - "type": "array", - "title": "Array of placeholder values", - "items": { - "type": "string" - }, - "x-order": 3 - }, - "database": { - "description": "Database name. Required if it can't be deduced from the query ID.", - "type": "string", - "x-order": 4 - } - }, - "x-order": 1 - }, - "mysql_explain_traditional_json": { - "type": "object", - "properties": { - "pmm_agent_id": { - "description": "pmm-agent ID where to run this Action.", - "type": "string", - "x-order": 0 - }, - "service_id": { - "description": "Service ID for this Action. Required.", - "type": "string", - "x-order": 1 - }, - "query_id": { - "description": "Query ID of query.", - "type": "string", - "x-order": 2 - }, - "placeholders": { - "type": "array", - "title": "Array of placeholder values", - "items": { - "type": "string" - }, - "x-order": 3 - }, - "database": { - "description": "Database name. Required if it can't be deduced from the query ID.", - "type": "string", - "x-order": 4 - } - }, - "x-order": 2 - }, - "mysql_show_index": { - "type": "object", - "properties": { - "pmm_agent_id": { - "description": "pmm-agent ID where to run this Action.", - "type": "string", - "x-order": 0 - }, - "service_id": { - "description": "Service ID for this Action. Required.", - "type": "string", - "x-order": 1 - }, - "table_name": { - "description": "Table name. Required. May additionally contain a database name.", - "type": "string", - "x-order": 2 - }, - "database": { - "description": "Database name. Required if not given in the table_name field.", - "type": "string", - "x-order": 3 - } - }, - "x-order": 3 - }, - "mysql_show_create_table": { - "type": "object", - "properties": { - "pmm_agent_id": { - "description": "pmm-agent ID where to run this Action.", - "type": "string", - "x-order": 0 - }, - "service_id": { - "description": "Service ID for this Action. Required.", - "type": "string", - "x-order": 1 - }, - "table_name": { - "description": "Table name. Required. May additionally contain a database name.", - "type": "string", - "x-order": 2 - }, - "database": { - "description": "Database name. Required if not given in the table_name field.", - "type": "string", - "x-order": 3 - } - }, - "x-order": 4 - }, - "mysql_show_table_status": { - "type": "object", - "properties": { - "pmm_agent_id": { - "description": "pmm-agent ID where to run this Action.", - "type": "string", - "x-order": 0 - }, - "service_id": { - "description": "Service ID for this Action. Required.", - "type": "string", - "x-order": 1 - }, - "table_name": { - "description": "Table name. Required. May additionally contain a database name.", - "type": "string", - "x-order": 2 - }, - "database": { - "description": "Database name. Required if not given in the table_name field.", - "type": "string", - "x-order": 3 - } - }, - "x-order": 5 - }, - "postgres_show_create_table": { - "type": "object", - "properties": { - "pmm_agent_id": { - "description": "pmm-agent ID where to run this Action.", - "type": "string", - "x-order": 0 - }, - "service_id": { - "description": "Service ID for this Action. Required.", - "type": "string", - "x-order": 1 - }, - "table_name": { - "description": "Table name. Required. May additionally contain a database name.", - "type": "string", - "x-order": 2 - }, - "database": { - "description": "Database name. Required if not given in the table_name field.", - "type": "string", - "x-order": 3 - } - }, - "x-order": 6 - }, - "postgres_show_index": { - "type": "object", - "properties": { - "pmm_agent_id": { - "description": "pmm-agent ID where to run this Action.", - "type": "string", - "x-order": 0 - }, - "service_id": { - "description": "Service ID for this Action. Required.", - "type": "string", - "x-order": 1 - }, - "table_name": { - "description": "Table name. Required. May additionally contain a database name.", - "type": "string", - "x-order": 2 - }, - "database": { - "description": "Database name. Required if not given in the table_name field.", - "type": "string", - "x-order": 3 - } - }, - "x-order": 7 - }, - "mongodb_explain": { - "type": "object", - "properties": { - "pmm_agent_id": { - "description": "pmm-agent ID where to run this Action.", - "type": "string", - "x-order": 0 - }, - "service_id": { - "description": "Service ID for this Action. Required.", - "type": "string", - "x-order": 1 - }, - "query": { - "description": "Query. Required.", - "type": "string", - "x-order": 2 - } - }, - "x-order": 8 - }, - "pt_mongodb_summary": { - "type": "object", - "title": "Message to prepare pt-mongodb-summary data", - "properties": { - "pmm_agent_id": { - "description": "pmm-agent ID where to run this Action.", - "type": "string", - "x-order": 0 - }, - "service_id": { - "description": "Service ID for this Action.", - "type": "string", - "x-order": 1 - } - }, - "x-order": 9 - }, - "pt_mysql_summary": { - "type": "object", - "title": "Message to prepare pt-mysql-summary data", - "properties": { - "pmm_agent_id": { - "description": "pmm-agent ID where to run this Action.", - "type": "string", - "x-order": 0 - }, - "service_id": { - "description": "Service ID for this Action.", - "type": "string", - "x-order": 1 - } - }, - "x-order": 10 - }, - "pt_postgres_summary": { - "type": "object", - "title": "Message to prepare pt-pg-summary data", - "properties": { - "pmm_agent_id": { - "description": "pmm-agent ID where to run this Action.", - "type": "string", - "x-order": 0 - }, - "service_id": { - "description": "Service ID for this Action.", - "type": "string", - "x-order": 1 - } - }, - "x-order": 11 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "mysql_explain": { - "type": "object", - "properties": { - "action_id": { - "description": "Unique Action ID.", - "type": "string", - "x-order": 0 - }, - "pmm_agent_id": { - "description": "pmm-agent ID where to this Action was started.", - "type": "string", - "x-order": 1 - } - }, - "x-order": 0 - }, - "mysql_explain_json": { - "type": "object", - "properties": { - "action_id": { - "description": "Unique Action ID.", - "type": "string", - "x-order": 0 - }, - "pmm_agent_id": { - "description": "pmm-agent ID where to this Action was started.", - "type": "string", - "x-order": 1 - } - }, - "x-order": 1 - }, - "mysql_explain_traditional_json": { - "type": "object", - "properties": { - "action_id": { - "description": "Unique Action ID.", - "type": "string", - "x-order": 0 - }, - "pmm_agent_id": { - "description": "pmm-agent ID where to this Action was started.", - "type": "string", - "x-order": 1 - } - }, - "x-order": 2 - }, - "mysql_show_index": { - "type": "object", - "properties": { - "action_id": { - "description": "Unique Action ID.", - "type": "string", - "x-order": 0 - }, - "pmm_agent_id": { - "description": "pmm-agent ID where to this Action was started.", - "type": "string", - "x-order": 1 - } - }, - "x-order": 3 - }, - "mysql_show_create_table": { - "type": "object", - "properties": { - "action_id": { - "description": "Unique Action ID.", - "type": "string", - "x-order": 0 - }, - "pmm_agent_id": { - "description": "pmm-agent ID where to this Action was started.", - "type": "string", - "x-order": 1 - } - }, - "x-order": 4 - }, - "mysql_show_table_status": { - "type": "object", - "properties": { - "action_id": { - "description": "Unique Action ID.", - "type": "string", - "x-order": 0 - }, - "pmm_agent_id": { - "description": "pmm-agent ID where to this Action was started.", - "type": "string", - "x-order": 1 - } - }, - "x-order": 5 - }, - "postgresql_show_create_table": { - "type": "object", - "properties": { - "action_id": { - "description": "Unique Action ID.", - "type": "string", - "x-order": 0 - }, - "pmm_agent_id": { - "description": "pmm-agent ID where to this Action was started.", - "type": "string", - "x-order": 1 - } - }, - "x-order": 6 - }, - "postgresql_show_index": { - "type": "object", - "properties": { - "action_id": { - "description": "Unique Action ID.", - "type": "string", - "x-order": 0 - }, - "pmm_agent_id": { - "description": "pmm-agent ID where to this Action was started.", - "type": "string", - "x-order": 1 - } - }, - "x-order": 7 - }, - "mongodb_explain": { - "type": "object", - "properties": { - "action_id": { - "description": "Unique Action ID.", - "type": "string", - "x-order": 0 - }, - "pmm_agent_id": { - "description": "pmm-agent ID where to this Action was started.", - "type": "string", - "x-order": 1 - } - }, - "x-order": 8 - }, - "pt_mongodb_summary": { - "type": "object", - "title": "Message to retrieve the prepared pt-mongodb-summary data", - "properties": { - "action_id": { - "description": "Unique Action ID.", - "type": "string", - "x-order": 0 - }, - "pmm_agent_id": { - "description": "pmm-agent ID where to this Action was started.", - "type": "string", - "x-order": 1 - } - }, - "x-order": 9 - }, - "pt_mysql_summary": { - "type": "object", - "title": "Message to retrieve the prepared pt-mysql-summary data", - "properties": { - "action_id": { - "description": "Unique Action ID.", - "type": "string", - "x-order": 0 - }, - "pmm_agent_id": { - "description": "pmm-agent ID where to this Action was started.", - "type": "string", - "x-order": 1 - } - }, - "x-order": 10 - }, - "pt_postgres_summary": { - "type": "object", - "title": "Message to retrieve the prepared pt-pg-summary data", - "properties": { - "action_id": { - "description": "Unique Action ID.", - "type": "string", - "x-order": 0 - }, - "pmm_agent_id": { - "description": "pmm-agent ID where to this Action was started.", - "type": "string", - "x-order": 1 - } - }, - "x-order": 11 - } - } - } - }, - "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 - } - } - } - } - } - } - } - }, - "tags": [ - { - "name": "ActionsService" - } - ] -} \ No newline at end of file diff --git a/api/advisors/v1/advisors.pb.go b/api/advisors/v1/advisors.pb.go deleted file mode 100644 index e0d081ca4a6..00000000000 --- a/api/advisors/v1/advisors.pb.go +++ /dev/null @@ -1,1449 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.10 -// protoc (unknown) -// source: advisors/v1/advisors.proto - -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" - _ "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" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// AdvisorCheckInterval represents possible execution interval values for checks. -type AdvisorCheckInterval int32 - -const ( - AdvisorCheckInterval_ADVISOR_CHECK_INTERVAL_UNSPECIFIED AdvisorCheckInterval = 0 - AdvisorCheckInterval_ADVISOR_CHECK_INTERVAL_STANDARD AdvisorCheckInterval = 1 - AdvisorCheckInterval_ADVISOR_CHECK_INTERVAL_FREQUENT AdvisorCheckInterval = 2 - AdvisorCheckInterval_ADVISOR_CHECK_INTERVAL_RARE AdvisorCheckInterval = 3 -) - -// Enum value maps for AdvisorCheckInterval. -var ( - AdvisorCheckInterval_name = map[int32]string{ - 0: "ADVISOR_CHECK_INTERVAL_UNSPECIFIED", - 1: "ADVISOR_CHECK_INTERVAL_STANDARD", - 2: "ADVISOR_CHECK_INTERVAL_FREQUENT", - 3: "ADVISOR_CHECK_INTERVAL_RARE", - } - AdvisorCheckInterval_value = map[string]int32{ - "ADVISOR_CHECK_INTERVAL_UNSPECIFIED": 0, - "ADVISOR_CHECK_INTERVAL_STANDARD": 1, - "ADVISOR_CHECK_INTERVAL_FREQUENT": 2, - "ADVISOR_CHECK_INTERVAL_RARE": 3, - } -) - -func (x AdvisorCheckInterval) Enum() *AdvisorCheckInterval { - p := new(AdvisorCheckInterval) - *p = x - return p -} - -func (x AdvisorCheckInterval) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (AdvisorCheckInterval) Descriptor() protoreflect.EnumDescriptor { - return file_advisors_v1_advisors_proto_enumTypes[0].Descriptor() -} - -func (AdvisorCheckInterval) Type() protoreflect.EnumType { - return &file_advisors_v1_advisors_proto_enumTypes[0] -} - -func (x AdvisorCheckInterval) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use AdvisorCheckInterval.Descriptor instead. -func (AdvisorCheckInterval) EnumDescriptor() ([]byte, []int) { - return file_advisors_v1_advisors_proto_rawDescGZIP(), []int{0} -} - -type AdvisorCheckFamily int32 - -const ( - AdvisorCheckFamily_ADVISOR_CHECK_FAMILY_UNSPECIFIED AdvisorCheckFamily = 0 - AdvisorCheckFamily_ADVISOR_CHECK_FAMILY_MYSQL AdvisorCheckFamily = 1 - AdvisorCheckFamily_ADVISOR_CHECK_FAMILY_POSTGRESQL AdvisorCheckFamily = 2 - AdvisorCheckFamily_ADVISOR_CHECK_FAMILY_MONGODB AdvisorCheckFamily = 3 -) - -// Enum value maps for AdvisorCheckFamily. -var ( - AdvisorCheckFamily_name = map[int32]string{ - 0: "ADVISOR_CHECK_FAMILY_UNSPECIFIED", - 1: "ADVISOR_CHECK_FAMILY_MYSQL", - 2: "ADVISOR_CHECK_FAMILY_POSTGRESQL", - 3: "ADVISOR_CHECK_FAMILY_MONGODB", - } - AdvisorCheckFamily_value = map[string]int32{ - "ADVISOR_CHECK_FAMILY_UNSPECIFIED": 0, - "ADVISOR_CHECK_FAMILY_MYSQL": 1, - "ADVISOR_CHECK_FAMILY_POSTGRESQL": 2, - "ADVISOR_CHECK_FAMILY_MONGODB": 3, - } -) - -func (x AdvisorCheckFamily) Enum() *AdvisorCheckFamily { - p := new(AdvisorCheckFamily) - *p = x - return p -} - -func (x AdvisorCheckFamily) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (AdvisorCheckFamily) Descriptor() protoreflect.EnumDescriptor { - return file_advisors_v1_advisors_proto_enumTypes[1].Descriptor() -} - -func (AdvisorCheckFamily) Type() protoreflect.EnumType { - return &file_advisors_v1_advisors_proto_enumTypes[1] -} - -func (x AdvisorCheckFamily) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use AdvisorCheckFamily.Descriptor instead. -func (AdvisorCheckFamily) EnumDescriptor() ([]byte, []int) { - return file_advisors_v1_advisors_proto_rawDescGZIP(), []int{1} -} - -// AdvisorCheckResult represents the check result returned from pmm-managed after running the check. -type AdvisorCheckResult struct { - state protoimpl.MessageState `protogen:"open.v1"` - Summary string `protobuf:"bytes,1,opt,name=summary,proto3" json:"summary,omitempty"` - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` - Severity v1.Severity `protobuf:"varint,3,opt,name=severity,proto3,enum=management.v1.Severity" json:"severity,omitempty"` - Labels map[string]string `protobuf:"bytes,4,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - // URL containing information on how to resolve an issue detected by an Advisor check. - ReadMoreUrl string `protobuf:"bytes,5,opt,name=read_more_url,json=readMoreUrl,proto3" json:"read_more_url,omitempty"` - // Name of the monitored service on which the check ran. - ServiceName string `protobuf:"bytes,6,opt,name=service_name,json=serviceName,proto3" json:"service_name,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AdvisorCheckResult) Reset() { - *x = AdvisorCheckResult{} - mi := &file_advisors_v1_advisors_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AdvisorCheckResult) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AdvisorCheckResult) ProtoMessage() {} - -func (x *AdvisorCheckResult) ProtoReflect() protoreflect.Message { - mi := &file_advisors_v1_advisors_proto_msgTypes[0] - 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 AdvisorCheckResult.ProtoReflect.Descriptor instead. -func (*AdvisorCheckResult) Descriptor() ([]byte, []int) { - return file_advisors_v1_advisors_proto_rawDescGZIP(), []int{0} -} - -func (x *AdvisorCheckResult) GetSummary() string { - if x != nil { - return x.Summary - } - return "" -} - -func (x *AdvisorCheckResult) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *AdvisorCheckResult) GetSeverity() v1.Severity { - if x != nil { - return x.Severity - } - return v1.Severity(0) -} - -func (x *AdvisorCheckResult) GetLabels() map[string]string { - if x != nil { - return x.Labels - } - return nil -} - -func (x *AdvisorCheckResult) GetReadMoreUrl() string { - if x != nil { - return x.ReadMoreUrl - } - return "" -} - -func (x *AdvisorCheckResult) GetServiceName() string { - if x != nil { - return x.ServiceName - } - return "" -} - -// CheckResultSummary is a summary of check results. -type CheckResultSummary struct { - state protoimpl.MessageState `protogen:"open.v1"` - ServiceName string `protobuf:"bytes,1,opt,name=service_name,json=serviceName,proto3" json:"service_name,omitempty"` - ServiceId string `protobuf:"bytes,2,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` - // Number of failed checks for this service with severity level "EMERGENCY". - EmergencyCount uint32 `protobuf:"varint,3,opt,name=emergency_count,json=emergencyCount,proto3" json:"emergency_count,omitempty"` - // Number of failed checks for this service with severity level "ALERT". - AlertCount uint32 `protobuf:"varint,4,opt,name=alert_count,json=alertCount,proto3" json:"alert_count,omitempty"` - // Number of failed checks for this service with severity level "CRITICAL". - CriticalCount uint32 `protobuf:"varint,5,opt,name=critical_count,json=criticalCount,proto3" json:"critical_count,omitempty"` - // Number of failed checks for this service with severity level "ERROR". - ErrorCount uint32 `protobuf:"varint,6,opt,name=error_count,json=errorCount,proto3" json:"error_count,omitempty"` - // Number of failed checks for this service with severity level "WARNING". - WarningCount uint32 `protobuf:"varint,7,opt,name=warning_count,json=warningCount,proto3" json:"warning_count,omitempty"` - // Number of failed checks for this service with severity level "NOTICE". - NoticeCount uint32 `protobuf:"varint,8,opt,name=notice_count,json=noticeCount,proto3" json:"notice_count,omitempty"` - // Number of failed checks for this service with severity level "INFO". - InfoCount uint32 `protobuf:"varint,9,opt,name=info_count,json=infoCount,proto3" json:"info_count,omitempty"` - // Number of failed checks for this service with severity level "DEBUG". - DebugCount uint32 `protobuf:"varint,10,opt,name=debug_count,json=debugCount,proto3" json:"debug_count,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CheckResultSummary) Reset() { - *x = CheckResultSummary{} - mi := &file_advisors_v1_advisors_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CheckResultSummary) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CheckResultSummary) ProtoMessage() {} - -func (x *CheckResultSummary) ProtoReflect() protoreflect.Message { - mi := &file_advisors_v1_advisors_proto_msgTypes[1] - 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 CheckResultSummary.ProtoReflect.Descriptor instead. -func (*CheckResultSummary) Descriptor() ([]byte, []int) { - return file_advisors_v1_advisors_proto_rawDescGZIP(), []int{1} -} - -func (x *CheckResultSummary) GetServiceName() string { - if x != nil { - return x.ServiceName - } - return "" -} - -func (x *CheckResultSummary) GetServiceId() string { - if x != nil { - return x.ServiceId - } - return "" -} - -func (x *CheckResultSummary) GetEmergencyCount() uint32 { - if x != nil { - return x.EmergencyCount - } - return 0 -} - -func (x *CheckResultSummary) GetAlertCount() uint32 { - if x != nil { - return x.AlertCount - } - return 0 -} - -func (x *CheckResultSummary) GetCriticalCount() uint32 { - if x != nil { - return x.CriticalCount - } - return 0 -} - -func (x *CheckResultSummary) GetErrorCount() uint32 { - if x != nil { - return x.ErrorCount - } - return 0 -} - -func (x *CheckResultSummary) GetWarningCount() uint32 { - if x != nil { - return x.WarningCount - } - return 0 -} - -func (x *CheckResultSummary) GetNoticeCount() uint32 { - if x != nil { - return x.NoticeCount - } - return 0 -} - -func (x *CheckResultSummary) GetInfoCount() uint32 { - if x != nil { - return x.InfoCount - } - return 0 -} - -func (x *CheckResultSummary) GetDebugCount() uint32 { - if x != nil { - return x.DebugCount - } - return 0 -} - -// CheckResult represents the check results for a given service. -type CheckResult struct { - state protoimpl.MessageState `protogen:"open.v1"` - Summary string `protobuf:"bytes,1,opt,name=summary,proto3" json:"summary,omitempty"` - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` - Severity v1.Severity `protobuf:"varint,3,opt,name=severity,proto3,enum=management.v1.Severity" json:"severity,omitempty"` - Labels map[string]string `protobuf:"bytes,4,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - // URL containing information on how to resolve an issue detected by an Advisor check. - ReadMoreUrl string `protobuf:"bytes,5,opt,name=read_more_url,json=readMoreUrl,proto3" json:"read_more_url,omitempty"` - // Name of the monitored service on which the check ran. - ServiceName string `protobuf:"bytes,6,opt,name=service_name,json=serviceName,proto3" json:"service_name,omitempty"` - // ID of the monitored service on which the check ran. - ServiceId string `protobuf:"bytes,7,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` - // Name of the check that failed - CheckName string `protobuf:"bytes,8,opt,name=check_name,json=checkName,proto3" json:"check_name,omitempty"` - // Silence status of the check result - Silenced bool `protobuf:"varint,10,opt,name=silenced,proto3" json:"silenced,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CheckResult) Reset() { - *x = CheckResult{} - mi := &file_advisors_v1_advisors_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CheckResult) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CheckResult) ProtoMessage() {} - -func (x *CheckResult) ProtoReflect() protoreflect.Message { - mi := &file_advisors_v1_advisors_proto_msgTypes[2] - 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 CheckResult.ProtoReflect.Descriptor instead. -func (*CheckResult) Descriptor() ([]byte, []int) { - return file_advisors_v1_advisors_proto_rawDescGZIP(), []int{2} -} - -func (x *CheckResult) GetSummary() string { - if x != nil { - return x.Summary - } - return "" -} - -func (x *CheckResult) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *CheckResult) GetSeverity() v1.Severity { - if x != nil { - return x.Severity - } - return v1.Severity(0) -} - -func (x *CheckResult) GetLabels() map[string]string { - if x != nil { - return x.Labels - } - return nil -} - -func (x *CheckResult) GetReadMoreUrl() string { - if x != nil { - return x.ReadMoreUrl - } - return "" -} - -func (x *CheckResult) GetServiceName() string { - if x != nil { - return x.ServiceName - } - return "" -} - -func (x *CheckResult) GetServiceId() string { - if x != nil { - return x.ServiceId - } - return "" -} - -func (x *CheckResult) GetCheckName() string { - if x != nil { - return x.CheckName - } - return "" -} - -func (x *CheckResult) GetSilenced() bool { - if x != nil { - return x.Silenced - } - return false -} - -// AdvisorCheck contains check name and status. -type AdvisorCheck struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Machine-readable name (ID) that is used in expression. - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // True if that check is enabled. - Enabled bool `protobuf:"varint,2,opt,name=enabled,proto3" json:"enabled,omitempty"` - // Long human-readable description. - Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` - // Short human-readable summary. - Summary string `protobuf:"bytes,4,opt,name=summary,proto3" json:"summary,omitempty"` - // Check execution interval. - Interval AdvisorCheckInterval `protobuf:"varint,5,opt,name=interval,proto3,enum=advisors.v1.AdvisorCheckInterval" json:"interval,omitempty"` - // DB family. - Family AdvisorCheckFamily `protobuf:"varint,6,opt,name=family,proto3,enum=advisors.v1.AdvisorCheckFamily" json:"family,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AdvisorCheck) Reset() { - *x = AdvisorCheck{} - mi := &file_advisors_v1_advisors_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AdvisorCheck) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AdvisorCheck) ProtoMessage() {} - -func (x *AdvisorCheck) ProtoReflect() protoreflect.Message { - mi := &file_advisors_v1_advisors_proto_msgTypes[3] - 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 AdvisorCheck.ProtoReflect.Descriptor instead. -func (*AdvisorCheck) Descriptor() ([]byte, []int) { - return file_advisors_v1_advisors_proto_rawDescGZIP(), []int{3} -} - -func (x *AdvisorCheck) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *AdvisorCheck) GetEnabled() bool { - if x != nil { - return x.Enabled - } - return false -} - -func (x *AdvisorCheck) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *AdvisorCheck) GetSummary() string { - if x != nil { - return x.Summary - } - return "" -} - -func (x *AdvisorCheck) GetInterval() AdvisorCheckInterval { - if x != nil { - return x.Interval - } - return AdvisorCheckInterval_ADVISOR_CHECK_INTERVAL_UNSPECIFIED -} - -func (x *AdvisorCheck) GetFamily() AdvisorCheckFamily { - if x != nil { - return x.Family - } - return AdvisorCheckFamily_ADVISOR_CHECK_FAMILY_UNSPECIFIED -} - -type Advisor struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Machine-readable name (ID) that is used in expression. - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // Long human-readable description. - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` - // Short human-readable summary. - Summary string `protobuf:"bytes,3,opt,name=summary,proto3" json:"summary,omitempty"` - // Comment. - Comment string `protobuf:"bytes,4,opt,name=comment,proto3" json:"comment,omitempty"` - // Category. - Category string `protobuf:"bytes,5,opt,name=category,proto3" json:"category,omitempty"` - // Advisor checks. - Checks []*AdvisorCheck `protobuf:"bytes,6,rep,name=checks,proto3" json:"checks,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Advisor) Reset() { - *x = Advisor{} - mi := &file_advisors_v1_advisors_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Advisor) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Advisor) ProtoMessage() {} - -func (x *Advisor) ProtoReflect() protoreflect.Message { - mi := &file_advisors_v1_advisors_proto_msgTypes[4] - 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 Advisor.ProtoReflect.Descriptor instead. -func (*Advisor) Descriptor() ([]byte, []int) { - return file_advisors_v1_advisors_proto_rawDescGZIP(), []int{4} -} - -func (x *Advisor) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *Advisor) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *Advisor) GetSummary() string { - if x != nil { - return x.Summary - } - return "" -} - -func (x *Advisor) GetComment() string { - if x != nil { - return x.Comment - } - return "" -} - -func (x *Advisor) GetCategory() string { - if x != nil { - return x.Category - } - return "" -} - -func (x *Advisor) GetChecks() []*AdvisorCheck { - if x != nil { - return x.Checks - } - return nil -} - -// ChangeAdvisorCheckParams specifies a single check parameters. -type ChangeAdvisorCheckParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The name of the check to change. - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Enable *bool `protobuf:"varint,2,opt,name=enable,proto3,oneof" json:"enable,omitempty"` - // check execution interval. - Interval AdvisorCheckInterval `protobuf:"varint,4,opt,name=interval,proto3,enum=advisors.v1.AdvisorCheckInterval" json:"interval,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ChangeAdvisorCheckParams) Reset() { - *x = ChangeAdvisorCheckParams{} - mi := &file_advisors_v1_advisors_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ChangeAdvisorCheckParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ChangeAdvisorCheckParams) ProtoMessage() {} - -func (x *ChangeAdvisorCheckParams) ProtoReflect() protoreflect.Message { - mi := &file_advisors_v1_advisors_proto_msgTypes[5] - 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 ChangeAdvisorCheckParams.ProtoReflect.Descriptor instead. -func (*ChangeAdvisorCheckParams) Descriptor() ([]byte, []int) { - return file_advisors_v1_advisors_proto_rawDescGZIP(), []int{5} -} - -func (x *ChangeAdvisorCheckParams) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *ChangeAdvisorCheckParams) GetEnable() bool { - if x != nil && x.Enable != nil { - return *x.Enable - } - return false -} - -func (x *ChangeAdvisorCheckParams) GetInterval() AdvisorCheckInterval { - if x != nil { - return x.Interval - } - return AdvisorCheckInterval_ADVISOR_CHECK_INTERVAL_UNSPECIFIED -} - -type StartAdvisorChecksRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Names of the checks that should be started. - Names []string `protobuf:"bytes,1,rep,name=names,proto3" json:"names,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StartAdvisorChecksRequest) Reset() { - *x = StartAdvisorChecksRequest{} - mi := &file_advisors_v1_advisors_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StartAdvisorChecksRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StartAdvisorChecksRequest) ProtoMessage() {} - -func (x *StartAdvisorChecksRequest) ProtoReflect() protoreflect.Message { - mi := &file_advisors_v1_advisors_proto_msgTypes[6] - 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 StartAdvisorChecksRequest.ProtoReflect.Descriptor instead. -func (*StartAdvisorChecksRequest) Descriptor() ([]byte, []int) { - return file_advisors_v1_advisors_proto_rawDescGZIP(), []int{6} -} - -func (x *StartAdvisorChecksRequest) GetNames() []string { - if x != nil { - return x.Names - } - return nil -} - -type StartAdvisorChecksResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StartAdvisorChecksResponse) Reset() { - *x = StartAdvisorChecksResponse{} - mi := &file_advisors_v1_advisors_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StartAdvisorChecksResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StartAdvisorChecksResponse) ProtoMessage() {} - -func (x *StartAdvisorChecksResponse) ProtoReflect() protoreflect.Message { - mi := &file_advisors_v1_advisors_proto_msgTypes[7] - 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 StartAdvisorChecksResponse.ProtoReflect.Descriptor instead. -func (*StartAdvisorChecksResponse) Descriptor() ([]byte, []int) { - return file_advisors_v1_advisors_proto_rawDescGZIP(), []int{7} -} - -type ListAdvisorChecksRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ListAdvisorChecksRequest) Reset() { - *x = ListAdvisorChecksRequest{} - mi := &file_advisors_v1_advisors_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ListAdvisorChecksRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListAdvisorChecksRequest) ProtoMessage() {} - -func (x *ListAdvisorChecksRequest) ProtoReflect() protoreflect.Message { - mi := &file_advisors_v1_advisors_proto_msgTypes[8] - 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 ListAdvisorChecksRequest.ProtoReflect.Descriptor instead. -func (*ListAdvisorChecksRequest) Descriptor() ([]byte, []int) { - return file_advisors_v1_advisors_proto_rawDescGZIP(), []int{8} -} - -type ListAdvisorChecksResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Checks []*AdvisorCheck `protobuf:"bytes,1,rep,name=checks,proto3" json:"checks,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ListAdvisorChecksResponse) Reset() { - *x = ListAdvisorChecksResponse{} - mi := &file_advisors_v1_advisors_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ListAdvisorChecksResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListAdvisorChecksResponse) ProtoMessage() {} - -func (x *ListAdvisorChecksResponse) ProtoReflect() protoreflect.Message { - mi := &file_advisors_v1_advisors_proto_msgTypes[9] - 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 ListAdvisorChecksResponse.ProtoReflect.Descriptor instead. -func (*ListAdvisorChecksResponse) Descriptor() ([]byte, []int) { - return file_advisors_v1_advisors_proto_rawDescGZIP(), []int{9} -} - -func (x *ListAdvisorChecksResponse) GetChecks() []*AdvisorCheck { - if x != nil { - return x.Checks - } - return nil -} - -type ListAdvisorsRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ListAdvisorsRequest) Reset() { - *x = ListAdvisorsRequest{} - mi := &file_advisors_v1_advisors_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ListAdvisorsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListAdvisorsRequest) ProtoMessage() {} - -func (x *ListAdvisorsRequest) ProtoReflect() protoreflect.Message { - mi := &file_advisors_v1_advisors_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 ListAdvisorsRequest.ProtoReflect.Descriptor instead. -func (*ListAdvisorsRequest) Descriptor() ([]byte, []int) { - return file_advisors_v1_advisors_proto_rawDescGZIP(), []int{10} -} - -type ListAdvisorsResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Advisors []*Advisor `protobuf:"bytes,1,rep,name=advisors,proto3" json:"advisors,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ListAdvisorsResponse) Reset() { - *x = ListAdvisorsResponse{} - mi := &file_advisors_v1_advisors_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ListAdvisorsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListAdvisorsResponse) ProtoMessage() {} - -func (x *ListAdvisorsResponse) ProtoReflect() protoreflect.Message { - mi := &file_advisors_v1_advisors_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 ListAdvisorsResponse.ProtoReflect.Descriptor instead. -func (*ListAdvisorsResponse) Descriptor() ([]byte, []int) { - return file_advisors_v1_advisors_proto_rawDescGZIP(), []int{11} -} - -func (x *ListAdvisorsResponse) GetAdvisors() []*Advisor { - if x != nil { - return x.Advisors - } - return nil -} - -type ChangeAdvisorChecksRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - Params []*ChangeAdvisorCheckParams `protobuf:"bytes,1,rep,name=params,proto3" json:"params,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ChangeAdvisorChecksRequest) Reset() { - *x = ChangeAdvisorChecksRequest{} - mi := &file_advisors_v1_advisors_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ChangeAdvisorChecksRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ChangeAdvisorChecksRequest) ProtoMessage() {} - -func (x *ChangeAdvisorChecksRequest) ProtoReflect() protoreflect.Message { - mi := &file_advisors_v1_advisors_proto_msgTypes[12] - 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 ChangeAdvisorChecksRequest.ProtoReflect.Descriptor instead. -func (*ChangeAdvisorChecksRequest) Descriptor() ([]byte, []int) { - return file_advisors_v1_advisors_proto_rawDescGZIP(), []int{12} -} - -func (x *ChangeAdvisorChecksRequest) GetParams() []*ChangeAdvisorCheckParams { - if x != nil { - return x.Params - } - return nil -} - -type ChangeAdvisorChecksResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ChangeAdvisorChecksResponse) Reset() { - *x = ChangeAdvisorChecksResponse{} - mi := &file_advisors_v1_advisors_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ChangeAdvisorChecksResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ChangeAdvisorChecksResponse) ProtoMessage() {} - -func (x *ChangeAdvisorChecksResponse) ProtoReflect() protoreflect.Message { - mi := &file_advisors_v1_advisors_proto_msgTypes[13] - 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 ChangeAdvisorChecksResponse.ProtoReflect.Descriptor instead. -func (*ChangeAdvisorChecksResponse) Descriptor() ([]byte, []int) { - return file_advisors_v1_advisors_proto_rawDescGZIP(), []int{13} -} - -type ListFailedServicesRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ListFailedServicesRequest) Reset() { - *x = ListFailedServicesRequest{} - mi := &file_advisors_v1_advisors_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ListFailedServicesRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListFailedServicesRequest) ProtoMessage() {} - -func (x *ListFailedServicesRequest) ProtoReflect() protoreflect.Message { - mi := &file_advisors_v1_advisors_proto_msgTypes[14] - 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 ListFailedServicesRequest.ProtoReflect.Descriptor instead. -func (*ListFailedServicesRequest) Descriptor() ([]byte, []int) { - return file_advisors_v1_advisors_proto_rawDescGZIP(), []int{14} -} - -type ListFailedServicesResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Result []*CheckResultSummary `protobuf:"bytes,1,rep,name=result,proto3" json:"result,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ListFailedServicesResponse) Reset() { - *x = ListFailedServicesResponse{} - mi := &file_advisors_v1_advisors_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ListFailedServicesResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListFailedServicesResponse) ProtoMessage() {} - -func (x *ListFailedServicesResponse) ProtoReflect() protoreflect.Message { - mi := &file_advisors_v1_advisors_proto_msgTypes[15] - 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 ListFailedServicesResponse.ProtoReflect.Descriptor instead. -func (*ListFailedServicesResponse) Descriptor() ([]byte, []int) { - return file_advisors_v1_advisors_proto_rawDescGZIP(), []int{15} -} - -func (x *ListFailedServicesResponse) GetResult() []*CheckResultSummary { - if x != nil { - return x.Result - } - return nil -} - -type GetFailedChecksRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Maximum number of results per page. - PageSize *int32 `protobuf:"varint,1,opt,name=page_size,json=pageSize,proto3,oneof" json:"page_size,omitempty"` - // Index of the requested page, starts from 0. - PageIndex *int32 `protobuf:"varint,2,opt,name=page_index,json=pageIndex,proto3,oneof" json:"page_index,omitempty"` - // Service ID. - ServiceId string `protobuf:"bytes,3,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetFailedChecksRequest) Reset() { - *x = GetFailedChecksRequest{} - mi := &file_advisors_v1_advisors_proto_msgTypes[16] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetFailedChecksRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetFailedChecksRequest) ProtoMessage() {} - -func (x *GetFailedChecksRequest) ProtoReflect() protoreflect.Message { - mi := &file_advisors_v1_advisors_proto_msgTypes[16] - 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 GetFailedChecksRequest.ProtoReflect.Descriptor instead. -func (*GetFailedChecksRequest) Descriptor() ([]byte, []int) { - return file_advisors_v1_advisors_proto_rawDescGZIP(), []int{16} -} - -func (x *GetFailedChecksRequest) GetPageSize() int32 { - if x != nil && x.PageSize != nil { - return *x.PageSize - } - return 0 -} - -func (x *GetFailedChecksRequest) GetPageIndex() int32 { - if x != nil && x.PageIndex != nil { - return *x.PageIndex - } - return 0 -} - -func (x *GetFailedChecksRequest) GetServiceId() string { - if x != nil { - return x.ServiceId - } - return "" -} - -type GetFailedChecksResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Total number of results. - TotalItems int32 `protobuf:"varint,1,opt,name=total_items,json=totalItems,proto3" json:"total_items,omitempty"` - // Total number of pages. - TotalPages int32 `protobuf:"varint,2,opt,name=total_pages,json=totalPages,proto3" json:"total_pages,omitempty"` - // Check results - Results []*CheckResult `protobuf:"bytes,3,rep,name=results,proto3" json:"results,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetFailedChecksResponse) Reset() { - *x = GetFailedChecksResponse{} - mi := &file_advisors_v1_advisors_proto_msgTypes[17] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetFailedChecksResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetFailedChecksResponse) ProtoMessage() {} - -func (x *GetFailedChecksResponse) ProtoReflect() protoreflect.Message { - mi := &file_advisors_v1_advisors_proto_msgTypes[17] - 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 GetFailedChecksResponse.ProtoReflect.Descriptor instead. -func (*GetFailedChecksResponse) Descriptor() ([]byte, []int) { - return file_advisors_v1_advisors_proto_rawDescGZIP(), []int{17} -} - -func (x *GetFailedChecksResponse) GetTotalItems() int32 { - if x != nil { - return x.TotalItems - } - return 0 -} - -func (x *GetFailedChecksResponse) GetTotalPages() int32 { - if x != nil { - return x.TotalPages - } - return 0 -} - -func (x *GetFailedChecksResponse) GetResults() []*CheckResult { - if x != nil { - return x.Results - } - return nil -} - -var File_advisors_v1_advisors_proto protoreflect.FileDescriptor - -const file_advisors_v1_advisors_proto_rawDesc = "" + - "\n" + - "\x1aadvisors/v1/advisors.proto\x12\vadvisors.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x1cmanagement/v1/severity.proto\x1a.protoc-gen-openapiv2/options/annotations.proto\x1a\x17validate/validate.proto\"\xcc\x02\n" + - "\x12AdvisorCheckResult\x12\x18\n" + - "\asummary\x18\x01 \x01(\tR\asummary\x12 \n" + - "\vdescription\x18\x02 \x01(\tR\vdescription\x123\n" + - "\bseverity\x18\x03 \x01(\x0e2\x17.management.v1.SeverityR\bseverity\x12C\n" + - "\x06labels\x18\x04 \x03(\v2+.advisors.v1.AdvisorCheckResult.LabelsEntryR\x06labels\x12\"\n" + - "\rread_more_url\x18\x05 \x01(\tR\vreadMoreUrl\x12!\n" + - "\fservice_name\x18\x06 \x01(\tR\vserviceName\x1a9\n" + - "\vLabelsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\xf0\x02\n" + - "\x12CheckResultSummary\x12!\n" + - "\fservice_name\x18\x01 \x01(\tR\vserviceName\x12\x1d\n" + - "\n" + - "service_id\x18\x02 \x01(\tR\tserviceId\x12'\n" + - "\x0femergency_count\x18\x03 \x01(\rR\x0eemergencyCount\x12\x1f\n" + - "\valert_count\x18\x04 \x01(\rR\n" + - "alertCount\x12%\n" + - "\x0ecritical_count\x18\x05 \x01(\rR\rcriticalCount\x12\x1f\n" + - "\verror_count\x18\x06 \x01(\rR\n" + - "errorCount\x12#\n" + - "\rwarning_count\x18\a \x01(\rR\fwarningCount\x12!\n" + - "\fnotice_count\x18\b \x01(\rR\vnoticeCount\x12\x1d\n" + - "\n" + - "info_count\x18\t \x01(\rR\tinfoCount\x12\x1f\n" + - "\vdebug_count\x18\n" + - " \x01(\rR\n" + - "debugCount\"\x98\x03\n" + - "\vCheckResult\x12\x18\n" + - "\asummary\x18\x01 \x01(\tR\asummary\x12 \n" + - "\vdescription\x18\x02 \x01(\tR\vdescription\x123\n" + - "\bseverity\x18\x03 \x01(\x0e2\x17.management.v1.SeverityR\bseverity\x12<\n" + - "\x06labels\x18\x04 \x03(\v2$.advisors.v1.CheckResult.LabelsEntryR\x06labels\x12\"\n" + - "\rread_more_url\x18\x05 \x01(\tR\vreadMoreUrl\x12!\n" + - "\fservice_name\x18\x06 \x01(\tR\vserviceName\x12\x1d\n" + - "\n" + - "service_id\x18\a \x01(\tR\tserviceId\x12\x1d\n" + - "\n" + - "check_name\x18\b \x01(\tR\tcheckName\x12\x1a\n" + - "\bsilenced\x18\n" + - " \x01(\bR\bsilenced\x1a9\n" + - "\vLabelsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\xf0\x01\n" + - "\fAdvisorCheck\x12\x12\n" + - "\x04name\x18\x01 \x01(\tR\x04name\x12\x18\n" + - "\aenabled\x18\x02 \x01(\bR\aenabled\x12 \n" + - "\vdescription\x18\x03 \x01(\tR\vdescription\x12\x18\n" + - "\asummary\x18\x04 \x01(\tR\asummary\x12=\n" + - "\binterval\x18\x05 \x01(\x0e2!.advisors.v1.AdvisorCheckIntervalR\binterval\x127\n" + - "\x06family\x18\x06 \x01(\x0e2\x1f.advisors.v1.AdvisorCheckFamilyR\x06family\"\xc2\x01\n" + - "\aAdvisor\x12\x12\n" + - "\x04name\x18\x01 \x01(\tR\x04name\x12 \n" + - "\vdescription\x18\x02 \x01(\tR\vdescription\x12\x18\n" + - "\asummary\x18\x03 \x01(\tR\asummary\x12\x18\n" + - "\acomment\x18\x04 \x01(\tR\acomment\x12\x1a\n" + - "\bcategory\x18\x05 \x01(\tR\bcategory\x121\n" + - "\x06checks\x18\x06 \x03(\v2\x19.advisors.v1.AdvisorCheckR\x06checks\"\x95\x01\n" + - "\x18ChangeAdvisorCheckParams\x12\x12\n" + - "\x04name\x18\x01 \x01(\tR\x04name\x12\x1b\n" + - "\x06enable\x18\x02 \x01(\bH\x00R\x06enable\x88\x01\x01\x12=\n" + - "\binterval\x18\x04 \x01(\x0e2!.advisors.v1.AdvisorCheckIntervalR\bintervalB\t\n" + - "\a_enable\"1\n" + - "\x19StartAdvisorChecksRequest\x12\x14\n" + - "\x05names\x18\x01 \x03(\tR\x05names\"\x1c\n" + - "\x1aStartAdvisorChecksResponse\"\x1a\n" + - "\x18ListAdvisorChecksRequest\"N\n" + - "\x19ListAdvisorChecksResponse\x121\n" + - "\x06checks\x18\x01 \x03(\v2\x19.advisors.v1.AdvisorCheckR\x06checks\"\x15\n" + - "\x13ListAdvisorsRequest\"H\n" + - "\x14ListAdvisorsResponse\x120\n" + - "\badvisors\x18\x01 \x03(\v2\x14.advisors.v1.AdvisorR\badvisors\"[\n" + - "\x1aChangeAdvisorChecksRequest\x12=\n" + - "\x06params\x18\x01 \x03(\v2%.advisors.v1.ChangeAdvisorCheckParamsR\x06params\"\x1d\n" + - "\x1bChangeAdvisorChecksResponse\"\x1b\n" + - "\x19ListFailedServicesRequest\"U\n" + - "\x1aListFailedServicesResponse\x127\n" + - "\x06result\x18\x01 \x03(\v2\x1f.advisors.v1.CheckResultSummaryR\x06result\"\xac\x01\n" + - "\x16GetFailedChecksRequest\x12)\n" + - "\tpage_size\x18\x01 \x01(\x05B\a\xfaB\x04\x1a\x02(\x01H\x00R\bpageSize\x88\x01\x01\x12+\n" + - "\n" + - "page_index\x18\x02 \x01(\x05B\a\xfaB\x04\x1a\x02(\x00H\x01R\tpageIndex\x88\x01\x01\x12\x1d\n" + - "\n" + - "service_id\x18\x03 \x01(\tR\tserviceIdB\f\n" + - "\n" + - "_page_sizeB\r\n" + - "\v_page_index\"\x8f\x01\n" + - "\x17GetFailedChecksResponse\x12\x1f\n" + - "\vtotal_items\x18\x01 \x01(\x05R\n" + - "totalItems\x12\x1f\n" + - "\vtotal_pages\x18\x02 \x01(\x05R\n" + - "totalPages\x122\n" + - "\aresults\x18\x03 \x03(\v2\x18.advisors.v1.CheckResultR\aresults*\xa9\x01\n" + - "\x14AdvisorCheckInterval\x12&\n" + - "\"ADVISOR_CHECK_INTERVAL_UNSPECIFIED\x10\x00\x12#\n" + - "\x1fADVISOR_CHECK_INTERVAL_STANDARD\x10\x01\x12#\n" + - "\x1fADVISOR_CHECK_INTERVAL_FREQUENT\x10\x02\x12\x1f\n" + - "\x1bADVISOR_CHECK_INTERVAL_RARE\x10\x03*\xa1\x01\n" + - "\x12AdvisorCheckFamily\x12$\n" + - " ADVISOR_CHECK_FAMILY_UNSPECIFIED\x10\x00\x12\x1e\n" + - "\x1aADVISOR_CHECK_FAMILY_MYSQL\x10\x01\x12#\n" + - "\x1fADVISOR_CHECK_FAMILY_POSTGRESQL\x10\x02\x12 \n" + - "\x1cADVISOR_CHECK_FAMILY_MONGODB\x10\x032\xee\n" + - "\n" + - "\x0eAdvisorService\x12\xf3\x01\n" + - "\x12ListFailedServices\x12&.advisors.v1.ListFailedServicesRequest\x1a'.advisors.v1.ListFailedServicesResponse\"\x8b\x01\x92Ae\x12\x14List Failed Services\x1aMReturns a list of services with failed checks and a summary of check results.\x82\xd3\xe4\x93\x02\x1d\x12\x1b/v1/advisors/failedServices\x12\xd5\x01\n" + - "\x0fGetFailedChecks\x12#.advisors.v1.GetFailedChecksRequest\x1a$.advisors.v1.GetFailedChecksResponse\"w\x92AR\x12\x19Get Failed Advisor Checks\x1a5Returns the latest check results for a given service.\x82\xd3\xe4\x93\x02\x1c\x12\x1a/v1/advisors/checks/failed\x12\xb0\x02\n" + - "\x12StartAdvisorChecks\x12&.advisors.v1.StartAdvisorChecksRequest\x1a'.advisors.v1.StartAdvisorChecksResponse\"\xc8\x01\x92A\xa0\x01\x12\x14Start Advisor Checks\x1a\x87\x01Executes Advisor checks and returns when all checks are executed. All available checks will be started if check names aren't specified.\x82\xd3\xe4\x93\x02\x1e:\x01*\"\x19/v1/advisors/checks:start\x12\xc3\x01\n" + - "\x11ListAdvisorChecks\x12%.advisors.v1.ListAdvisorChecksRequest\x1a&.advisors.v1.ListAdvisorChecksResponse\"_\x92AA\x12\x13List Advisor Checks\x1a*List advisor checks available to the user.\x82\xd3\xe4\x93\x02\x15\x12\x13/v1/advisors/checks\x12\xa1\x01\n" + - "\fListAdvisors\x12 .advisors.v1.ListAdvisorsRequest\x1a!.advisors.v1.ListAdvisorsResponse\"L\x92A5\x12\rList Advisors\x1a$List advisors available to the user.\x82\xd3\xe4\x93\x02\x0e\x12\f/v1/advisors\x12\xf0\x01\n" + - "\x13ChangeAdvisorChecks\x12'.advisors.v1.ChangeAdvisorChecksRequest\x1a(.advisors.v1.ChangeAdvisorChecksResponse\"\x85\x01\x92AX\x12\x15Change Advisor Checks\x1a?Enables/disables advisor checks or changes their exec interval.\x82\xd3\xe4\x93\x02$:\x01*\"\x1f/v1/advisors/checks:batchChangeB\xa0\x01\n" + - "\x0fcom.advisors.v1B\rAdvisorsProtoP\x01Z1github.com/percona/pmm/api/advisors/v1;advisorsv1\xa2\x02\x03AXX\xaa\x02\vAdvisors.V1\xca\x02\vAdvisors\\V1\xe2\x02\x17Advisors\\V1\\GPBMetadata\xea\x02\fAdvisors::V1b\x06proto3" - -var ( - file_advisors_v1_advisors_proto_rawDescOnce sync.Once - file_advisors_v1_advisors_proto_rawDescData []byte -) - -func file_advisors_v1_advisors_proto_rawDescGZIP() []byte { - file_advisors_v1_advisors_proto_rawDescOnce.Do(func() { - file_advisors_v1_advisors_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_advisors_v1_advisors_proto_rawDesc), len(file_advisors_v1_advisors_proto_rawDesc))) - }) - 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_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 - 22, // 2: advisors.v1.CheckResult.severity:type_name -> management.v1.Severity - 21, // 3: advisors.v1.CheckResult.labels:type_name -> advisors.v1.CheckResult.LabelsEntry - 0, // 4: advisors.v1.AdvisorCheck.interval:type_name -> advisors.v1.AdvisorCheckInterval - 1, // 5: advisors.v1.AdvisorCheck.family:type_name -> advisors.v1.AdvisorCheckFamily - 5, // 6: advisors.v1.Advisor.checks:type_name -> advisors.v1.AdvisorCheck - 0, // 7: advisors.v1.ChangeAdvisorCheckParams.interval:type_name -> advisors.v1.AdvisorCheckInterval - 5, // 8: advisors.v1.ListAdvisorChecksResponse.checks:type_name -> advisors.v1.AdvisorCheck - 6, // 9: advisors.v1.ListAdvisorsResponse.advisors:type_name -> advisors.v1.Advisor - 7, // 10: advisors.v1.ChangeAdvisorChecksRequest.params:type_name -> advisors.v1.ChangeAdvisorCheckParams - 3, // 11: advisors.v1.ListFailedServicesResponse.result:type_name -> advisors.v1.CheckResultSummary - 4, // 12: advisors.v1.GetFailedChecksResponse.results:type_name -> advisors.v1.CheckResult - 16, // 13: advisors.v1.AdvisorService.ListFailedServices:input_type -> advisors.v1.ListFailedServicesRequest - 18, // 14: advisors.v1.AdvisorService.GetFailedChecks:input_type -> advisors.v1.GetFailedChecksRequest - 8, // 15: advisors.v1.AdvisorService.StartAdvisorChecks:input_type -> advisors.v1.StartAdvisorChecksRequest - 10, // 16: advisors.v1.AdvisorService.ListAdvisorChecks:input_type -> advisors.v1.ListAdvisorChecksRequest - 12, // 17: advisors.v1.AdvisorService.ListAdvisors:input_type -> advisors.v1.ListAdvisorsRequest - 14, // 18: advisors.v1.AdvisorService.ChangeAdvisorChecks:input_type -> advisors.v1.ChangeAdvisorChecksRequest - 17, // 19: advisors.v1.AdvisorService.ListFailedServices:output_type -> advisors.v1.ListFailedServicesResponse - 19, // 20: advisors.v1.AdvisorService.GetFailedChecks:output_type -> advisors.v1.GetFailedChecksResponse - 9, // 21: advisors.v1.AdvisorService.StartAdvisorChecks:output_type -> advisors.v1.StartAdvisorChecksResponse - 11, // 22: advisors.v1.AdvisorService.ListAdvisorChecks:output_type -> advisors.v1.ListAdvisorChecksResponse - 13, // 23: advisors.v1.AdvisorService.ListAdvisors:output_type -> advisors.v1.ListAdvisorsResponse - 15, // 24: advisors.v1.AdvisorService.ChangeAdvisorChecks:output_type -> advisors.v1.ChangeAdvisorChecksResponse - 19, // [19:25] is the sub-list for method output_type - 13, // [13:19] is the sub-list for method input_type - 13, // [13:13] is the sub-list for extension type_name - 13, // [13:13] is the sub-list for extension extendee - 0, // [0:13] is the sub-list for field type_name -} - -func init() { file_advisors_v1_advisors_proto_init() } -func file_advisors_v1_advisors_proto_init() { - if File_advisors_v1_advisors_proto != nil { - return - } - file_advisors_v1_advisors_proto_msgTypes[5].OneofWrappers = []any{} - file_advisors_v1_advisors_proto_msgTypes[16].OneofWrappers = []any{} - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_advisors_v1_advisors_proto_rawDesc), len(file_advisors_v1_advisors_proto_rawDesc)), - NumEnums: 2, - NumMessages: 20, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_advisors_v1_advisors_proto_goTypes, - DependencyIndexes: file_advisors_v1_advisors_proto_depIdxs, - EnumInfos: file_advisors_v1_advisors_proto_enumTypes, - MessageInfos: file_advisors_v1_advisors_proto_msgTypes, - }.Build() - File_advisors_v1_advisors_proto = out.File - file_advisors_v1_advisors_proto_goTypes = nil - file_advisors_v1_advisors_proto_depIdxs = nil -} diff --git a/api/advisors/v1/advisors.pb.gw.go b/api/advisors/v1/advisors.pb.gw.go deleted file mode 100644 index 3897f4315fd..00000000000 --- a/api/advisors/v1/advisors.pb.gw.go +++ /dev/null @@ -1,477 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: advisors/v1/advisors.proto - -/* -Package advisorsv1 is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package advisorsv1 - -import ( - "context" - "errors" - "io" - "net/http" - - "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" - "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" - "google.golang.org/protobuf/proto" -) - -// Suppress "imported and not used" errors -var ( - _ codes.Code - _ io.Reader - _ status.Status - _ = errors.New - _ = runtime.String - _ = utilities.NewDoubleArray - _ = metadata.Join -) - -func request_AdvisorService_ListFailedServices_0(ctx context.Context, marshaler runtime.Marshaler, client AdvisorServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq ListFailedServicesRequest - metadata runtime.ServerMetadata - ) - if req.Body != nil { - _, _ = io.Copy(io.Discard, req.Body) - } - msg, err := client.ListFailedServices(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_AdvisorService_ListFailedServices_0(ctx context.Context, marshaler runtime.Marshaler, server AdvisorServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq ListFailedServicesRequest - metadata runtime.ServerMetadata - ) - msg, err := server.ListFailedServices(ctx, &protoReq) - return msg, metadata, err -} - -var filter_AdvisorService_GetFailedChecks_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} - -func request_AdvisorService_GetFailedChecks_0(ctx context.Context, marshaler runtime.Marshaler, client AdvisorServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq GetFailedChecksRequest - metadata runtime.ServerMetadata - ) - if req.Body != nil { - _, _ = io.Copy(io.Discard, req.Body) - } - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_AdvisorService_GetFailedChecks_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - msg, err := client.GetFailedChecks(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_AdvisorService_GetFailedChecks_0(ctx context.Context, marshaler runtime.Marshaler, server AdvisorServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq GetFailedChecksRequest - metadata runtime.ServerMetadata - ) - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_AdvisorService_GetFailedChecks_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - msg, err := server.GetFailedChecks(ctx, &protoReq) - return msg, metadata, err -} - -func request_AdvisorService_StartAdvisorChecks_0(ctx context.Context, marshaler runtime.Marshaler, client AdvisorServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq StartAdvisorChecksRequest - 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.StartAdvisorChecks(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_AdvisorService_StartAdvisorChecks_0(ctx context.Context, marshaler runtime.Marshaler, server AdvisorServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq StartAdvisorChecksRequest - 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.StartAdvisorChecks(ctx, &protoReq) - return msg, metadata, err -} - -func request_AdvisorService_ListAdvisorChecks_0(ctx context.Context, marshaler runtime.Marshaler, client AdvisorServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq ListAdvisorChecksRequest - metadata runtime.ServerMetadata - ) - if req.Body != nil { - _, _ = io.Copy(io.Discard, req.Body) - } - msg, err := client.ListAdvisorChecks(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_AdvisorService_ListAdvisorChecks_0(ctx context.Context, marshaler runtime.Marshaler, server AdvisorServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq ListAdvisorChecksRequest - metadata runtime.ServerMetadata - ) - msg, err := server.ListAdvisorChecks(ctx, &protoReq) - return msg, metadata, err -} - -func request_AdvisorService_ListAdvisors_0(ctx context.Context, marshaler runtime.Marshaler, client AdvisorServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq ListAdvisorsRequest - metadata runtime.ServerMetadata - ) - if req.Body != nil { - _, _ = io.Copy(io.Discard, req.Body) - } - msg, err := client.ListAdvisors(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_AdvisorService_ListAdvisors_0(ctx context.Context, marshaler runtime.Marshaler, server AdvisorServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq ListAdvisorsRequest - metadata runtime.ServerMetadata - ) - msg, err := server.ListAdvisors(ctx, &protoReq) - return msg, metadata, err -} - -func request_AdvisorService_ChangeAdvisorChecks_0(ctx context.Context, marshaler runtime.Marshaler, client AdvisorServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq ChangeAdvisorChecksRequest - 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.ChangeAdvisorChecks(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_AdvisorService_ChangeAdvisorChecks_0(ctx context.Context, marshaler runtime.Marshaler, server AdvisorServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq ChangeAdvisorChecksRequest - 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.ChangeAdvisorChecks(ctx, &protoReq) - return msg, metadata, err -} - -// RegisterAdvisorServiceHandlerServer registers the http handlers for service AdvisorService to "mux". -// UnaryRPC :call AdvisorServiceServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterAdvisorServiceHandlerFromEndpoint instead. -// GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call. -func RegisterAdvisorServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AdvisorServiceServer) error { - mux.Handle(http.MethodGet, pattern_AdvisorService_ListFailedServices_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, "/advisors.v1.AdvisorService/ListFailedServices", runtime.WithHTTPPathPattern("/v1/advisors/failedServices")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AdvisorService_ListFailedServices_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_AdvisorService_ListFailedServices_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodGet, pattern_AdvisorService_GetFailedChecks_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, "/advisors.v1.AdvisorService/GetFailedChecks", runtime.WithHTTPPathPattern("/v1/advisors/checks/failed")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AdvisorService_GetFailedChecks_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_AdvisorService_GetFailedChecks_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPost, pattern_AdvisorService_StartAdvisorChecks_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, "/advisors.v1.AdvisorService/StartAdvisorChecks", runtime.WithHTTPPathPattern("/v1/advisors/checks:start")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AdvisorService_StartAdvisorChecks_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_AdvisorService_StartAdvisorChecks_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodGet, pattern_AdvisorService_ListAdvisorChecks_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, "/advisors.v1.AdvisorService/ListAdvisorChecks", runtime.WithHTTPPathPattern("/v1/advisors/checks")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AdvisorService_ListAdvisorChecks_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_AdvisorService_ListAdvisorChecks_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodGet, pattern_AdvisorService_ListAdvisors_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, "/advisors.v1.AdvisorService/ListAdvisors", runtime.WithHTTPPathPattern("/v1/advisors")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AdvisorService_ListAdvisors_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_AdvisorService_ListAdvisors_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPost, pattern_AdvisorService_ChangeAdvisorChecks_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, "/advisors.v1.AdvisorService/ChangeAdvisorChecks", runtime.WithHTTPPathPattern("/v1/advisors/checks:batchChange")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AdvisorService_ChangeAdvisorChecks_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_AdvisorService_ChangeAdvisorChecks_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - return nil -} - -// RegisterAdvisorServiceHandlerFromEndpoint is same as RegisterAdvisorServiceHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterAdvisorServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.NewClient(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - return RegisterAdvisorServiceHandler(ctx, mux, conn) -} - -// RegisterAdvisorServiceHandler registers the http handlers for service AdvisorService to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterAdvisorServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterAdvisorServiceHandlerClient(ctx, mux, NewAdvisorServiceClient(conn)) -} - -// RegisterAdvisorServiceHandlerClient registers the http handlers for service AdvisorService -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "AdvisorServiceClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "AdvisorServiceClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "AdvisorServiceClient" to call the correct interceptors. This client ignores the HTTP middlewares. -func RegisterAdvisorServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AdvisorServiceClient) error { - mux.Handle(http.MethodGet, pattern_AdvisorService_ListFailedServices_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, "/advisors.v1.AdvisorService/ListFailedServices", runtime.WithHTTPPathPattern("/v1/advisors/failedServices")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AdvisorService_ListFailedServices_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_AdvisorService_ListFailedServices_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodGet, pattern_AdvisorService_GetFailedChecks_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, "/advisors.v1.AdvisorService/GetFailedChecks", runtime.WithHTTPPathPattern("/v1/advisors/checks/failed")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AdvisorService_GetFailedChecks_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_AdvisorService_GetFailedChecks_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPost, pattern_AdvisorService_StartAdvisorChecks_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, "/advisors.v1.AdvisorService/StartAdvisorChecks", runtime.WithHTTPPathPattern("/v1/advisors/checks:start")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AdvisorService_StartAdvisorChecks_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_AdvisorService_StartAdvisorChecks_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodGet, pattern_AdvisorService_ListAdvisorChecks_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, "/advisors.v1.AdvisorService/ListAdvisorChecks", runtime.WithHTTPPathPattern("/v1/advisors/checks")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AdvisorService_ListAdvisorChecks_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_AdvisorService_ListAdvisorChecks_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodGet, pattern_AdvisorService_ListAdvisors_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, "/advisors.v1.AdvisorService/ListAdvisors", runtime.WithHTTPPathPattern("/v1/advisors")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AdvisorService_ListAdvisors_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_AdvisorService_ListAdvisors_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPost, pattern_AdvisorService_ChangeAdvisorChecks_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, "/advisors.v1.AdvisorService/ChangeAdvisorChecks", runtime.WithHTTPPathPattern("/v1/advisors/checks:batchChange")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AdvisorService_ChangeAdvisorChecks_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_AdvisorService_ChangeAdvisorChecks_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - return nil -} - -var ( - pattern_AdvisorService_ListFailedServices_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "advisors", "failedServices"}, "")) - pattern_AdvisorService_GetFailedChecks_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "advisors", "checks", "failed"}, "")) - pattern_AdvisorService_StartAdvisorChecks_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "advisors", "checks"}, "start")) - pattern_AdvisorService_ListAdvisorChecks_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "advisors", "checks"}, "")) - pattern_AdvisorService_ListAdvisors_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "advisors"}, "")) - pattern_AdvisorService_ChangeAdvisorChecks_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "advisors", "checks"}, "batchChange")) -) - -var ( - forward_AdvisorService_ListFailedServices_0 = runtime.ForwardResponseMessage - forward_AdvisorService_GetFailedChecks_0 = runtime.ForwardResponseMessage - forward_AdvisorService_StartAdvisorChecks_0 = runtime.ForwardResponseMessage - forward_AdvisorService_ListAdvisorChecks_0 = runtime.ForwardResponseMessage - forward_AdvisorService_ListAdvisors_0 = runtime.ForwardResponseMessage - forward_AdvisorService_ChangeAdvisorChecks_0 = runtime.ForwardResponseMessage -) diff --git a/api/advisors/v1/advisors.pb.validate.go b/api/advisors/v1/advisors.pb.validate.go deleted file mode 100644 index ef8f8500241..00000000000 --- a/api/advisors/v1/advisors.pb.validate.go +++ /dev/null @@ -1,2183 +0,0 @@ -// Code generated by protoc-gen-validate. DO NOT EDIT. -// source: advisors/v1/advisors.proto - -package advisorsv1 - -import ( - "bytes" - "errors" - "fmt" - "net" - "net/mail" - "net/url" - "regexp" - "sort" - "strings" - "time" - "unicode/utf8" - - "google.golang.org/protobuf/types/known/anypb" - - managementv1 "github.com/percona/pmm/api/management/v1" -) - -// ensure the imports are used -var ( - _ = bytes.MinRead - _ = errors.New("") - _ = fmt.Print - _ = utf8.UTFMax - _ = (*regexp.Regexp)(nil) - _ = (*strings.Reader)(nil) - _ = net.IPv4len - _ = time.Duration(0) - _ = (*url.URL)(nil) - _ = (*mail.Address)(nil) - _ = anypb.Any{} - _ = sort.Sort - - _ = managementv1.Severity(0) -) - -// Validate checks the field values on AdvisorCheckResult 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 *AdvisorCheckResult) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on AdvisorCheckResult 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 -// AdvisorCheckResultMultiError, or nil if none found. -func (m *AdvisorCheckResult) ValidateAll() error { - return m.validate(true) -} - -func (m *AdvisorCheckResult) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Summary - - // no validation rules for Description - - // no validation rules for Severity - - // no validation rules for Labels - - // no validation rules for ReadMoreUrl - - // no validation rules for ServiceName - - if len(errors) > 0 { - return AdvisorCheckResultMultiError(errors) - } - - return nil -} - -// AdvisorCheckResultMultiError is an error wrapping multiple validation errors -// returned by AdvisorCheckResult.ValidateAll() if the designated constraints -// aren't met. -type AdvisorCheckResultMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m AdvisorCheckResultMultiError) 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 AdvisorCheckResultMultiError) AllErrors() []error { return m } - -// AdvisorCheckResultValidationError is the validation error returned by -// AdvisorCheckResult.Validate if the designated constraints aren't met. -type AdvisorCheckResultValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e AdvisorCheckResultValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e AdvisorCheckResultValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e AdvisorCheckResultValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e AdvisorCheckResultValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e AdvisorCheckResultValidationError) ErrorName() string { - return "AdvisorCheckResultValidationError" -} - -// Error satisfies the builtin error interface -func (e AdvisorCheckResultValidationError) 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 %sAdvisorCheckResult.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = AdvisorCheckResultValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = AdvisorCheckResultValidationError{} - -// Validate checks the field values on CheckResultSummary 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 *CheckResultSummary) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on CheckResultSummary 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 -// CheckResultSummaryMultiError, or nil if none found. -func (m *CheckResultSummary) ValidateAll() error { - return m.validate(true) -} - -func (m *CheckResultSummary) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for ServiceName - - // no validation rules for ServiceId - - // no validation rules for EmergencyCount - - // no validation rules for AlertCount - - // no validation rules for CriticalCount - - // no validation rules for ErrorCount - - // no validation rules for WarningCount - - // no validation rules for NoticeCount - - // no validation rules for InfoCount - - // no validation rules for DebugCount - - if len(errors) > 0 { - return CheckResultSummaryMultiError(errors) - } - - return nil -} - -// CheckResultSummaryMultiError is an error wrapping multiple validation errors -// returned by CheckResultSummary.ValidateAll() if the designated constraints -// aren't met. -type CheckResultSummaryMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m CheckResultSummaryMultiError) 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 CheckResultSummaryMultiError) AllErrors() []error { return m } - -// CheckResultSummaryValidationError is the validation error returned by -// CheckResultSummary.Validate if the designated constraints aren't met. -type CheckResultSummaryValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e CheckResultSummaryValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e CheckResultSummaryValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e CheckResultSummaryValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e CheckResultSummaryValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e CheckResultSummaryValidationError) ErrorName() string { - return "CheckResultSummaryValidationError" -} - -// Error satisfies the builtin error interface -func (e CheckResultSummaryValidationError) 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 %sCheckResultSummary.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = CheckResultSummaryValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = CheckResultSummaryValidationError{} - -// Validate checks the field values on CheckResult 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 *CheckResult) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on CheckResult 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 CheckResultMultiError, or -// nil if none found. -func (m *CheckResult) ValidateAll() error { - return m.validate(true) -} - -func (m *CheckResult) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Summary - - // no validation rules for Description - - // no validation rules for Severity - - // no validation rules for Labels - - // no validation rules for ReadMoreUrl - - // no validation rules for ServiceName - - // no validation rules for ServiceId - - // no validation rules for CheckName - - // no validation rules for Silenced - - if len(errors) > 0 { - return CheckResultMultiError(errors) - } - - return nil -} - -// CheckResultMultiError is an error wrapping multiple validation errors -// returned by CheckResult.ValidateAll() if the designated constraints aren't met. -type CheckResultMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m CheckResultMultiError) 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 CheckResultMultiError) AllErrors() []error { return m } - -// CheckResultValidationError is the validation error returned by -// CheckResult.Validate if the designated constraints aren't met. -type CheckResultValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e CheckResultValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e CheckResultValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e CheckResultValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e CheckResultValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e CheckResultValidationError) ErrorName() string { return "CheckResultValidationError" } - -// Error satisfies the builtin error interface -func (e CheckResultValidationError) 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 %sCheckResult.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = CheckResultValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = CheckResultValidationError{} - -// Validate checks the field values on AdvisorCheck 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 *AdvisorCheck) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on AdvisorCheck 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 AdvisorCheckMultiError, or -// nil if none found. -func (m *AdvisorCheck) ValidateAll() error { - return m.validate(true) -} - -func (m *AdvisorCheck) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Name - - // no validation rules for Enabled - - // no validation rules for Description - - // no validation rules for Summary - - // no validation rules for Interval - - // no validation rules for Family - - if len(errors) > 0 { - return AdvisorCheckMultiError(errors) - } - - return nil -} - -// AdvisorCheckMultiError is an error wrapping multiple validation errors -// returned by AdvisorCheck.ValidateAll() if the designated constraints aren't met. -type AdvisorCheckMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m AdvisorCheckMultiError) 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 AdvisorCheckMultiError) AllErrors() []error { return m } - -// AdvisorCheckValidationError is the validation error returned by -// AdvisorCheck.Validate if the designated constraints aren't met. -type AdvisorCheckValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e AdvisorCheckValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e AdvisorCheckValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e AdvisorCheckValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e AdvisorCheckValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e AdvisorCheckValidationError) ErrorName() string { return "AdvisorCheckValidationError" } - -// Error satisfies the builtin error interface -func (e AdvisorCheckValidationError) 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 %sAdvisorCheck.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = AdvisorCheckValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = AdvisorCheckValidationError{} - -// Validate checks the field values on Advisor 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 *Advisor) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on Advisor 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 AdvisorMultiError, or nil if none found. -func (m *Advisor) ValidateAll() error { - return m.validate(true) -} - -func (m *Advisor) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Name - - // no validation rules for Description - - // no validation rules for Summary - - // no validation rules for Comment - - // no validation rules for Category - - for idx, item := range m.GetChecks() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AdvisorValidationError{ - field: fmt.Sprintf("Checks[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AdvisorValidationError{ - field: fmt.Sprintf("Checks[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AdvisorValidationError{ - field: fmt.Sprintf("Checks[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - if len(errors) > 0 { - return AdvisorMultiError(errors) - } - - return nil -} - -// AdvisorMultiError is an error wrapping multiple validation errors returned -// by Advisor.ValidateAll() if the designated constraints aren't met. -type AdvisorMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m AdvisorMultiError) 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 AdvisorMultiError) AllErrors() []error { return m } - -// AdvisorValidationError is the validation error returned by Advisor.Validate -// if the designated constraints aren't met. -type AdvisorValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e AdvisorValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e AdvisorValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e AdvisorValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e AdvisorValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e AdvisorValidationError) ErrorName() string { return "AdvisorValidationError" } - -// Error satisfies the builtin error interface -func (e AdvisorValidationError) 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 %sAdvisor.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = AdvisorValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = AdvisorValidationError{} - -// Validate checks the field values on ChangeAdvisorCheckParams 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 *ChangeAdvisorCheckParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ChangeAdvisorCheckParams 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 -// ChangeAdvisorCheckParamsMultiError, or nil if none found. -func (m *ChangeAdvisorCheckParams) ValidateAll() error { - return m.validate(true) -} - -func (m *ChangeAdvisorCheckParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Name - - // no validation rules for Interval - - if m.Enable != nil { - // no validation rules for Enable - } - - if len(errors) > 0 { - return ChangeAdvisorCheckParamsMultiError(errors) - } - - return nil -} - -// ChangeAdvisorCheckParamsMultiError is an error wrapping multiple validation -// errors returned by ChangeAdvisorCheckParams.ValidateAll() if the designated -// constraints aren't met. -type ChangeAdvisorCheckParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ChangeAdvisorCheckParamsMultiError) 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 ChangeAdvisorCheckParamsMultiError) AllErrors() []error { return m } - -// ChangeAdvisorCheckParamsValidationError is the validation error returned by -// ChangeAdvisorCheckParams.Validate if the designated constraints aren't met. -type ChangeAdvisorCheckParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ChangeAdvisorCheckParamsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ChangeAdvisorCheckParamsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ChangeAdvisorCheckParamsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ChangeAdvisorCheckParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ChangeAdvisorCheckParamsValidationError) ErrorName() string { - return "ChangeAdvisorCheckParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e ChangeAdvisorCheckParamsValidationError) 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 %sChangeAdvisorCheckParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ChangeAdvisorCheckParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ChangeAdvisorCheckParamsValidationError{} - -// Validate checks the field values on StartAdvisorChecksRequest 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 *StartAdvisorChecksRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on StartAdvisorChecksRequest 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 -// StartAdvisorChecksRequestMultiError, or nil if none found. -func (m *StartAdvisorChecksRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *StartAdvisorChecksRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return StartAdvisorChecksRequestMultiError(errors) - } - - return nil -} - -// StartAdvisorChecksRequestMultiError is an error wrapping multiple validation -// errors returned by StartAdvisorChecksRequest.ValidateAll() if the -// designated constraints aren't met. -type StartAdvisorChecksRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m StartAdvisorChecksRequestMultiError) 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 StartAdvisorChecksRequestMultiError) AllErrors() []error { return m } - -// StartAdvisorChecksRequestValidationError is the validation error returned by -// StartAdvisorChecksRequest.Validate if the designated constraints aren't met. -type StartAdvisorChecksRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e StartAdvisorChecksRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e StartAdvisorChecksRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e StartAdvisorChecksRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e StartAdvisorChecksRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e StartAdvisorChecksRequestValidationError) ErrorName() string { - return "StartAdvisorChecksRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e StartAdvisorChecksRequestValidationError) 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 %sStartAdvisorChecksRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = StartAdvisorChecksRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = StartAdvisorChecksRequestValidationError{} - -// Validate checks the field values on StartAdvisorChecksResponse 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 *StartAdvisorChecksResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on StartAdvisorChecksResponse 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 -// StartAdvisorChecksResponseMultiError, or nil if none found. -func (m *StartAdvisorChecksResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *StartAdvisorChecksResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return StartAdvisorChecksResponseMultiError(errors) - } - - return nil -} - -// StartAdvisorChecksResponseMultiError is an error wrapping multiple -// validation errors returned by StartAdvisorChecksResponse.ValidateAll() if -// the designated constraints aren't met. -type StartAdvisorChecksResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m StartAdvisorChecksResponseMultiError) 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 StartAdvisorChecksResponseMultiError) AllErrors() []error { return m } - -// StartAdvisorChecksResponseValidationError is the validation error returned -// by StartAdvisorChecksResponse.Validate if the designated constraints aren't met. -type StartAdvisorChecksResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e StartAdvisorChecksResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e StartAdvisorChecksResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e StartAdvisorChecksResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e StartAdvisorChecksResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e StartAdvisorChecksResponseValidationError) ErrorName() string { - return "StartAdvisorChecksResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e StartAdvisorChecksResponseValidationError) 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 %sStartAdvisorChecksResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = StartAdvisorChecksResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = StartAdvisorChecksResponseValidationError{} - -// Validate checks the field values on ListAdvisorChecksRequest 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 *ListAdvisorChecksRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ListAdvisorChecksRequest 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 -// ListAdvisorChecksRequestMultiError, or nil if none found. -func (m *ListAdvisorChecksRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *ListAdvisorChecksRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return ListAdvisorChecksRequestMultiError(errors) - } - - return nil -} - -// ListAdvisorChecksRequestMultiError is an error wrapping multiple validation -// errors returned by ListAdvisorChecksRequest.ValidateAll() if the designated -// constraints aren't met. -type ListAdvisorChecksRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ListAdvisorChecksRequestMultiError) 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 ListAdvisorChecksRequestMultiError) AllErrors() []error { return m } - -// ListAdvisorChecksRequestValidationError is the validation error returned by -// ListAdvisorChecksRequest.Validate if the designated constraints aren't met. -type ListAdvisorChecksRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ListAdvisorChecksRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ListAdvisorChecksRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ListAdvisorChecksRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ListAdvisorChecksRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ListAdvisorChecksRequestValidationError) ErrorName() string { - return "ListAdvisorChecksRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e ListAdvisorChecksRequestValidationError) 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 %sListAdvisorChecksRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ListAdvisorChecksRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ListAdvisorChecksRequestValidationError{} - -// Validate checks the field values on ListAdvisorChecksResponse 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 *ListAdvisorChecksResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ListAdvisorChecksResponse 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 -// ListAdvisorChecksResponseMultiError, or nil if none found. -func (m *ListAdvisorChecksResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *ListAdvisorChecksResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - for idx, item := range m.GetChecks() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ListAdvisorChecksResponseValidationError{ - field: fmt.Sprintf("Checks[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ListAdvisorChecksResponseValidationError{ - field: fmt.Sprintf("Checks[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ListAdvisorChecksResponseValidationError{ - field: fmt.Sprintf("Checks[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - if len(errors) > 0 { - return ListAdvisorChecksResponseMultiError(errors) - } - - return nil -} - -// ListAdvisorChecksResponseMultiError is an error wrapping multiple validation -// errors returned by ListAdvisorChecksResponse.ValidateAll() if the -// designated constraints aren't met. -type ListAdvisorChecksResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ListAdvisorChecksResponseMultiError) 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 ListAdvisorChecksResponseMultiError) AllErrors() []error { return m } - -// ListAdvisorChecksResponseValidationError is the validation error returned by -// ListAdvisorChecksResponse.Validate if the designated constraints aren't met. -type ListAdvisorChecksResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ListAdvisorChecksResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ListAdvisorChecksResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ListAdvisorChecksResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ListAdvisorChecksResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ListAdvisorChecksResponseValidationError) ErrorName() string { - return "ListAdvisorChecksResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e ListAdvisorChecksResponseValidationError) 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 %sListAdvisorChecksResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ListAdvisorChecksResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ListAdvisorChecksResponseValidationError{} - -// Validate checks the field values on ListAdvisorsRequest 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 *ListAdvisorsRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ListAdvisorsRequest 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 -// ListAdvisorsRequestMultiError, or nil if none found. -func (m *ListAdvisorsRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *ListAdvisorsRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return ListAdvisorsRequestMultiError(errors) - } - - return nil -} - -// ListAdvisorsRequestMultiError is an error wrapping multiple validation -// errors returned by ListAdvisorsRequest.ValidateAll() if the designated -// constraints aren't met. -type ListAdvisorsRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ListAdvisorsRequestMultiError) 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 ListAdvisorsRequestMultiError) AllErrors() []error { return m } - -// ListAdvisorsRequestValidationError is the validation error returned by -// ListAdvisorsRequest.Validate if the designated constraints aren't met. -type ListAdvisorsRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ListAdvisorsRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ListAdvisorsRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ListAdvisorsRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ListAdvisorsRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ListAdvisorsRequestValidationError) ErrorName() string { - return "ListAdvisorsRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e ListAdvisorsRequestValidationError) 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 %sListAdvisorsRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ListAdvisorsRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ListAdvisorsRequestValidationError{} - -// Validate checks the field values on ListAdvisorsResponse 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 *ListAdvisorsResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ListAdvisorsResponse 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 -// ListAdvisorsResponseMultiError, or nil if none found. -func (m *ListAdvisorsResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *ListAdvisorsResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - for idx, item := range m.GetAdvisors() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ListAdvisorsResponseValidationError{ - field: fmt.Sprintf("Advisors[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ListAdvisorsResponseValidationError{ - field: fmt.Sprintf("Advisors[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ListAdvisorsResponseValidationError{ - field: fmt.Sprintf("Advisors[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - if len(errors) > 0 { - return ListAdvisorsResponseMultiError(errors) - } - - return nil -} - -// ListAdvisorsResponseMultiError is an error wrapping multiple validation -// errors returned by ListAdvisorsResponse.ValidateAll() if the designated -// constraints aren't met. -type ListAdvisorsResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ListAdvisorsResponseMultiError) 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 ListAdvisorsResponseMultiError) AllErrors() []error { return m } - -// ListAdvisorsResponseValidationError is the validation error returned by -// ListAdvisorsResponse.Validate if the designated constraints aren't met. -type ListAdvisorsResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ListAdvisorsResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ListAdvisorsResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ListAdvisorsResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ListAdvisorsResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ListAdvisorsResponseValidationError) ErrorName() string { - return "ListAdvisorsResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e ListAdvisorsResponseValidationError) 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 %sListAdvisorsResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ListAdvisorsResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ListAdvisorsResponseValidationError{} - -// Validate checks the field values on ChangeAdvisorChecksRequest 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 *ChangeAdvisorChecksRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ChangeAdvisorChecksRequest 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 -// ChangeAdvisorChecksRequestMultiError, or nil if none found. -func (m *ChangeAdvisorChecksRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *ChangeAdvisorChecksRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - for idx, item := range m.GetParams() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeAdvisorChecksRequestValidationError{ - field: fmt.Sprintf("Params[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeAdvisorChecksRequestValidationError{ - field: fmt.Sprintf("Params[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeAdvisorChecksRequestValidationError{ - field: fmt.Sprintf("Params[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - if len(errors) > 0 { - return ChangeAdvisorChecksRequestMultiError(errors) - } - - return nil -} - -// ChangeAdvisorChecksRequestMultiError is an error wrapping multiple -// validation errors returned by ChangeAdvisorChecksRequest.ValidateAll() if -// the designated constraints aren't met. -type ChangeAdvisorChecksRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ChangeAdvisorChecksRequestMultiError) 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 ChangeAdvisorChecksRequestMultiError) AllErrors() []error { return m } - -// ChangeAdvisorChecksRequestValidationError is the validation error returned -// by ChangeAdvisorChecksRequest.Validate if the designated constraints aren't met. -type ChangeAdvisorChecksRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ChangeAdvisorChecksRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ChangeAdvisorChecksRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ChangeAdvisorChecksRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ChangeAdvisorChecksRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ChangeAdvisorChecksRequestValidationError) ErrorName() string { - return "ChangeAdvisorChecksRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e ChangeAdvisorChecksRequestValidationError) 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 %sChangeAdvisorChecksRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ChangeAdvisorChecksRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ChangeAdvisorChecksRequestValidationError{} - -// Validate checks the field values on ChangeAdvisorChecksResponse 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 *ChangeAdvisorChecksResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ChangeAdvisorChecksResponse 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 -// ChangeAdvisorChecksResponseMultiError, or nil if none found. -func (m *ChangeAdvisorChecksResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *ChangeAdvisorChecksResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return ChangeAdvisorChecksResponseMultiError(errors) - } - - return nil -} - -// ChangeAdvisorChecksResponseMultiError is an error wrapping multiple -// validation errors returned by ChangeAdvisorChecksResponse.ValidateAll() if -// the designated constraints aren't met. -type ChangeAdvisorChecksResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ChangeAdvisorChecksResponseMultiError) 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 ChangeAdvisorChecksResponseMultiError) AllErrors() []error { return m } - -// ChangeAdvisorChecksResponseValidationError is the validation error returned -// by ChangeAdvisorChecksResponse.Validate if the designated constraints -// aren't met. -type ChangeAdvisorChecksResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ChangeAdvisorChecksResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ChangeAdvisorChecksResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ChangeAdvisorChecksResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ChangeAdvisorChecksResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ChangeAdvisorChecksResponseValidationError) ErrorName() string { - return "ChangeAdvisorChecksResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e ChangeAdvisorChecksResponseValidationError) 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 %sChangeAdvisorChecksResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ChangeAdvisorChecksResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ChangeAdvisorChecksResponseValidationError{} - -// Validate checks the field values on ListFailedServicesRequest 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 *ListFailedServicesRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ListFailedServicesRequest 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 -// ListFailedServicesRequestMultiError, or nil if none found. -func (m *ListFailedServicesRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *ListFailedServicesRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return ListFailedServicesRequestMultiError(errors) - } - - return nil -} - -// ListFailedServicesRequestMultiError is an error wrapping multiple validation -// errors returned by ListFailedServicesRequest.ValidateAll() if the -// designated constraints aren't met. -type ListFailedServicesRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ListFailedServicesRequestMultiError) 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 ListFailedServicesRequestMultiError) AllErrors() []error { return m } - -// ListFailedServicesRequestValidationError is the validation error returned by -// ListFailedServicesRequest.Validate if the designated constraints aren't met. -type ListFailedServicesRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ListFailedServicesRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ListFailedServicesRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ListFailedServicesRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ListFailedServicesRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ListFailedServicesRequestValidationError) ErrorName() string { - return "ListFailedServicesRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e ListFailedServicesRequestValidationError) 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 %sListFailedServicesRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ListFailedServicesRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ListFailedServicesRequestValidationError{} - -// Validate checks the field values on ListFailedServicesResponse 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 *ListFailedServicesResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ListFailedServicesResponse 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 -// ListFailedServicesResponseMultiError, or nil if none found. -func (m *ListFailedServicesResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *ListFailedServicesResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - for idx, item := range m.GetResult() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ListFailedServicesResponseValidationError{ - field: fmt.Sprintf("Result[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ListFailedServicesResponseValidationError{ - field: fmt.Sprintf("Result[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ListFailedServicesResponseValidationError{ - field: fmt.Sprintf("Result[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - if len(errors) > 0 { - return ListFailedServicesResponseMultiError(errors) - } - - return nil -} - -// ListFailedServicesResponseMultiError is an error wrapping multiple -// validation errors returned by ListFailedServicesResponse.ValidateAll() if -// the designated constraints aren't met. -type ListFailedServicesResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ListFailedServicesResponseMultiError) 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 ListFailedServicesResponseMultiError) AllErrors() []error { return m } - -// ListFailedServicesResponseValidationError is the validation error returned -// by ListFailedServicesResponse.Validate if the designated constraints aren't met. -type ListFailedServicesResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ListFailedServicesResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ListFailedServicesResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ListFailedServicesResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ListFailedServicesResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ListFailedServicesResponseValidationError) ErrorName() string { - return "ListFailedServicesResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e ListFailedServicesResponseValidationError) 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 %sListFailedServicesResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ListFailedServicesResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ListFailedServicesResponseValidationError{} - -// Validate checks the field values on GetFailedChecksRequest 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 *GetFailedChecksRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on GetFailedChecksRequest 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 -// GetFailedChecksRequestMultiError, or nil if none found. -func (m *GetFailedChecksRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *GetFailedChecksRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for ServiceId - - if m.PageSize != nil { - if m.GetPageSize() < 1 { - err := GetFailedChecksRequestValidationError{ - field: "PageSize", - reason: "value must be greater than or equal to 1", - } - if !all { - return err - } - errors = append(errors, err) - } - } - - if m.PageIndex != nil { - if m.GetPageIndex() < 0 { - err := GetFailedChecksRequestValidationError{ - field: "PageIndex", - reason: "value must be greater than or equal to 0", - } - if !all { - return err - } - errors = append(errors, err) - } - } - - if len(errors) > 0 { - return GetFailedChecksRequestMultiError(errors) - } - - return nil -} - -// GetFailedChecksRequestMultiError is an error wrapping multiple validation -// errors returned by GetFailedChecksRequest.ValidateAll() if the designated -// constraints aren't met. -type GetFailedChecksRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m GetFailedChecksRequestMultiError) 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 GetFailedChecksRequestMultiError) AllErrors() []error { return m } - -// GetFailedChecksRequestValidationError is the validation error returned by -// GetFailedChecksRequest.Validate if the designated constraints aren't met. -type GetFailedChecksRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e GetFailedChecksRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e GetFailedChecksRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e GetFailedChecksRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e GetFailedChecksRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e GetFailedChecksRequestValidationError) ErrorName() string { - return "GetFailedChecksRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e GetFailedChecksRequestValidationError) 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 %sGetFailedChecksRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = GetFailedChecksRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = GetFailedChecksRequestValidationError{} - -// Validate checks the field values on GetFailedChecksResponse 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 *GetFailedChecksResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on GetFailedChecksResponse 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 -// GetFailedChecksResponseMultiError, or nil if none found. -func (m *GetFailedChecksResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *GetFailedChecksResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for TotalItems - - // no validation rules for TotalPages - - for idx, item := range m.GetResults() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GetFailedChecksResponseValidationError{ - field: fmt.Sprintf("Results[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GetFailedChecksResponseValidationError{ - field: fmt.Sprintf("Results[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GetFailedChecksResponseValidationError{ - field: fmt.Sprintf("Results[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - if len(errors) > 0 { - return GetFailedChecksResponseMultiError(errors) - } - - return nil -} - -// GetFailedChecksResponseMultiError is an error wrapping multiple validation -// errors returned by GetFailedChecksResponse.ValidateAll() if the designated -// constraints aren't met. -type GetFailedChecksResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m GetFailedChecksResponseMultiError) 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 GetFailedChecksResponseMultiError) AllErrors() []error { return m } - -// GetFailedChecksResponseValidationError is the validation error returned by -// GetFailedChecksResponse.Validate if the designated constraints aren't met. -type GetFailedChecksResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e GetFailedChecksResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e GetFailedChecksResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e GetFailedChecksResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e GetFailedChecksResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e GetFailedChecksResponseValidationError) ErrorName() string { - return "GetFailedChecksResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e GetFailedChecksResponseValidationError) 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 %sGetFailedChecksResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = GetFailedChecksResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = GetFailedChecksResponseValidationError{} diff --git a/api/advisors/v1/advisors_grpc.pb.go b/api/advisors/v1/advisors_grpc.pb.go deleted file mode 100644 index 968dd072fc8..00000000000 --- a/api/advisors/v1/advisors_grpc.pb.go +++ /dev/null @@ -1,333 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.6.0 -// - protoc (unknown) -// source: advisors/v1/advisors.proto - -package advisorsv1 - -import ( - context "context" - - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.64.0 or later. -const _ = grpc.SupportPackageIsVersion9 - -const ( - AdvisorService_ListFailedServices_FullMethodName = "/advisors.v1.AdvisorService/ListFailedServices" - AdvisorService_GetFailedChecks_FullMethodName = "/advisors.v1.AdvisorService/GetFailedChecks" - AdvisorService_StartAdvisorChecks_FullMethodName = "/advisors.v1.AdvisorService/StartAdvisorChecks" - AdvisorService_ListAdvisorChecks_FullMethodName = "/advisors.v1.AdvisorService/ListAdvisorChecks" - AdvisorService_ListAdvisors_FullMethodName = "/advisors.v1.AdvisorService/ListAdvisors" - AdvisorService_ChangeAdvisorChecks_FullMethodName = "/advisors.v1.AdvisorService/ChangeAdvisorChecks" -) - -// AdvisorServiceClient is the client API for AdvisorService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -// -// AdvisorService service provides public Management API methods for Advisor Service. -type AdvisorServiceClient interface { - // ListFailedServices returns a list of services with failed checks. - ListFailedServices(ctx context.Context, in *ListFailedServicesRequest, opts ...grpc.CallOption) (*ListFailedServicesResponse, error) - // GetFailedChecks returns the checks result for a given service. - GetFailedChecks(ctx context.Context, in *GetFailedChecksRequest, opts ...grpc.CallOption) (*GetFailedChecksResponse, error) - // StartAdvisorChecks executes Advisor checks and returns when all checks are executed. - StartAdvisorChecks(ctx context.Context, in *StartAdvisorChecksRequest, opts ...grpc.CallOption) (*StartAdvisorChecksResponse, error) - // ListAdvisorChecks returns a list of advisor checks available to the user.. - ListAdvisorChecks(ctx context.Context, in *ListAdvisorChecksRequest, opts ...grpc.CallOption) (*ListAdvisorChecksResponse, error) - // ListAdvisors returns a list of advisors available for the user. - ListAdvisors(ctx context.Context, in *ListAdvisorsRequest, opts ...grpc.CallOption) (*ListAdvisorsResponse, error) - // ChangeAdvisorChecks enables/disables Advisor checks or changes their exec interval. - ChangeAdvisorChecks(ctx context.Context, in *ChangeAdvisorChecksRequest, opts ...grpc.CallOption) (*ChangeAdvisorChecksResponse, error) -} - -type advisorServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewAdvisorServiceClient(cc grpc.ClientConnInterface) AdvisorServiceClient { - return &advisorServiceClient{cc} -} - -func (c *advisorServiceClient) ListFailedServices(ctx context.Context, in *ListFailedServicesRequest, opts ...grpc.CallOption) (*ListFailedServicesResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(ListFailedServicesResponse) - err := c.cc.Invoke(ctx, AdvisorService_ListFailedServices_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *advisorServiceClient) GetFailedChecks(ctx context.Context, in *GetFailedChecksRequest, opts ...grpc.CallOption) (*GetFailedChecksResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetFailedChecksResponse) - err := c.cc.Invoke(ctx, AdvisorService_GetFailedChecks_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *advisorServiceClient) StartAdvisorChecks(ctx context.Context, in *StartAdvisorChecksRequest, opts ...grpc.CallOption) (*StartAdvisorChecksResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(StartAdvisorChecksResponse) - err := c.cc.Invoke(ctx, AdvisorService_StartAdvisorChecks_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *advisorServiceClient) ListAdvisorChecks(ctx context.Context, in *ListAdvisorChecksRequest, opts ...grpc.CallOption) (*ListAdvisorChecksResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(ListAdvisorChecksResponse) - err := c.cc.Invoke(ctx, AdvisorService_ListAdvisorChecks_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *advisorServiceClient) ListAdvisors(ctx context.Context, in *ListAdvisorsRequest, opts ...grpc.CallOption) (*ListAdvisorsResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(ListAdvisorsResponse) - err := c.cc.Invoke(ctx, AdvisorService_ListAdvisors_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *advisorServiceClient) ChangeAdvisorChecks(ctx context.Context, in *ChangeAdvisorChecksRequest, opts ...grpc.CallOption) (*ChangeAdvisorChecksResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(ChangeAdvisorChecksResponse) - err := c.cc.Invoke(ctx, AdvisorService_ChangeAdvisorChecks_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -// AdvisorServiceServer is the server API for AdvisorService service. -// All implementations must embed UnimplementedAdvisorServiceServer -// for forward compatibility. -// -// AdvisorService service provides public Management API methods for Advisor Service. -type AdvisorServiceServer interface { - // ListFailedServices returns a list of services with failed checks. - ListFailedServices(context.Context, *ListFailedServicesRequest) (*ListFailedServicesResponse, error) - // GetFailedChecks returns the checks result for a given service. - GetFailedChecks(context.Context, *GetFailedChecksRequest) (*GetFailedChecksResponse, error) - // StartAdvisorChecks executes Advisor checks and returns when all checks are executed. - StartAdvisorChecks(context.Context, *StartAdvisorChecksRequest) (*StartAdvisorChecksResponse, error) - // ListAdvisorChecks returns a list of advisor checks available to the user.. - ListAdvisorChecks(context.Context, *ListAdvisorChecksRequest) (*ListAdvisorChecksResponse, error) - // ListAdvisors returns a list of advisors available for the user. - ListAdvisors(context.Context, *ListAdvisorsRequest) (*ListAdvisorsResponse, error) - // ChangeAdvisorChecks enables/disables Advisor checks or changes their exec interval. - ChangeAdvisorChecks(context.Context, *ChangeAdvisorChecksRequest) (*ChangeAdvisorChecksResponse, error) - mustEmbedUnimplementedAdvisorServiceServer() -} - -// UnimplementedAdvisorServiceServer must be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -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") -} -func (UnimplementedAdvisorServiceServer) mustEmbedUnimplementedAdvisorServiceServer() {} -func (UnimplementedAdvisorServiceServer) testEmbeddedByValue() {} - -// UnsafeAdvisorServiceServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to AdvisorServiceServer will -// result in compilation errors. -type UnsafeAdvisorServiceServer interface { - mustEmbedUnimplementedAdvisorServiceServer() -} - -func RegisterAdvisorServiceServer(s grpc.ServiceRegistrar, srv AdvisorServiceServer) { - // If the following call panics, it indicates UnimplementedAdvisorServiceServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } - s.RegisterService(&AdvisorService_ServiceDesc, srv) -} - -func _AdvisorService_ListFailedServices_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListFailedServicesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AdvisorServiceServer).ListFailedServices(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: AdvisorService_ListFailedServices_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AdvisorServiceServer).ListFailedServices(ctx, req.(*ListFailedServicesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AdvisorService_GetFailedChecks_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetFailedChecksRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AdvisorServiceServer).GetFailedChecks(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: AdvisorService_GetFailedChecks_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AdvisorServiceServer).GetFailedChecks(ctx, req.(*GetFailedChecksRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AdvisorService_StartAdvisorChecks_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(StartAdvisorChecksRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AdvisorServiceServer).StartAdvisorChecks(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: AdvisorService_StartAdvisorChecks_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AdvisorServiceServer).StartAdvisorChecks(ctx, req.(*StartAdvisorChecksRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AdvisorService_ListAdvisorChecks_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListAdvisorChecksRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AdvisorServiceServer).ListAdvisorChecks(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: AdvisorService_ListAdvisorChecks_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AdvisorServiceServer).ListAdvisorChecks(ctx, req.(*ListAdvisorChecksRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AdvisorService_ListAdvisors_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListAdvisorsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AdvisorServiceServer).ListAdvisors(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: AdvisorService_ListAdvisors_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AdvisorServiceServer).ListAdvisors(ctx, req.(*ListAdvisorsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AdvisorService_ChangeAdvisorChecks_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ChangeAdvisorChecksRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AdvisorServiceServer).ChangeAdvisorChecks(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: AdvisorService_ChangeAdvisorChecks_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AdvisorServiceServer).ChangeAdvisorChecks(ctx, req.(*ChangeAdvisorChecksRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// AdvisorService_ServiceDesc is the grpc.ServiceDesc for AdvisorService service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var AdvisorService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "advisors.v1.AdvisorService", - HandlerType: (*AdvisorServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "ListFailedServices", - Handler: _AdvisorService_ListFailedServices_Handler, - }, - { - MethodName: "GetFailedChecks", - Handler: _AdvisorService_GetFailedChecks_Handler, - }, - { - MethodName: "StartAdvisorChecks", - Handler: _AdvisorService_StartAdvisorChecks_Handler, - }, - { - MethodName: "ListAdvisorChecks", - Handler: _AdvisorService_ListAdvisorChecks_Handler, - }, - { - MethodName: "ListAdvisors", - Handler: _AdvisorService_ListAdvisors_Handler, - }, - { - MethodName: "ChangeAdvisorChecks", - Handler: _AdvisorService_ChangeAdvisorChecks_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "advisors/v1/advisors.proto", -} diff --git a/api/advisors/v1/json/client/advisor_service/advisor_service_client.go b/api/advisors/v1/json/client/advisor_service/advisor_service_client.go deleted file mode 100644 index 1a1194930df..00000000000 --- a/api/advisors/v1/json/client/advisor_service/advisor_service_client.go +++ /dev/null @@ -1,339 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package advisor_service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// New creates a new advisor service API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -// New creates a new advisor service API client with basic auth credentials. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - user: user for basic authentication header. -// - password: password for basic authentication header. -func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BasicAuth(user, password) - return &Client{transport: transport, formats: strfmt.Default} -} - -// New creates a new advisor service API client with a bearer token for authentication. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - bearerToken: bearer token for Bearer authentication header. -func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BearerToken(bearerToken) - return &Client{transport: transport, formats: strfmt.Default} -} - -/* -Client for advisor service API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption may be used to customize the behavior of Client methods. -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - ChangeAdvisorChecks(params *ChangeAdvisorChecksParams, opts ...ClientOption) (*ChangeAdvisorChecksOK, error) - - GetFailedChecks(params *GetFailedChecksParams, opts ...ClientOption) (*GetFailedChecksOK, error) - - ListAdvisorChecks(params *ListAdvisorChecksParams, opts ...ClientOption) (*ListAdvisorChecksOK, error) - - ListAdvisors(params *ListAdvisorsParams, opts ...ClientOption) (*ListAdvisorsOK, error) - - ListFailedServices(params *ListFailedServicesParams, opts ...ClientOption) (*ListFailedServicesOK, error) - - StartAdvisorChecks(params *StartAdvisorChecksParams, opts ...ClientOption) (*StartAdvisorChecksOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -ChangeAdvisorChecks changes advisor checks - -Enables/disables advisor checks or changes their exec interval. -*/ -func (a *Client) ChangeAdvisorChecks(params *ChangeAdvisorChecksParams, opts ...ClientOption) (*ChangeAdvisorChecksOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewChangeAdvisorChecksParams() - } - op := &runtime.ClientOperation{ - ID: "ChangeAdvisorChecks", - Method: "POST", - PathPattern: "/v1/advisors/checks:batchChange", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &ChangeAdvisorChecksReader{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.(*ChangeAdvisorChecksOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*ChangeAdvisorChecksDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -GetFailedChecks gets failed advisor checks - -Returns the latest check results for a given service. -*/ -func (a *Client) GetFailedChecks(params *GetFailedChecksParams, opts ...ClientOption) (*GetFailedChecksOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewGetFailedChecksParams() - } - op := &runtime.ClientOperation{ - ID: "GetFailedChecks", - Method: "GET", - PathPattern: "/v1/advisors/checks/failed", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &GetFailedChecksReader{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.(*GetFailedChecksOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*GetFailedChecksDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -ListAdvisorChecks lists advisor checks - -List advisor checks available to the user. -*/ -func (a *Client) ListAdvisorChecks(params *ListAdvisorChecksParams, opts ...ClientOption) (*ListAdvisorChecksOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewListAdvisorChecksParams() - } - op := &runtime.ClientOperation{ - ID: "ListAdvisorChecks", - Method: "GET", - PathPattern: "/v1/advisors/checks", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &ListAdvisorChecksReader{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.(*ListAdvisorChecksOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*ListAdvisorChecksDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -ListAdvisors lists advisors - -List advisors available to the user. -*/ -func (a *Client) ListAdvisors(params *ListAdvisorsParams, opts ...ClientOption) (*ListAdvisorsOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewListAdvisorsParams() - } - op := &runtime.ClientOperation{ - ID: "ListAdvisors", - Method: "GET", - PathPattern: "/v1/advisors", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &ListAdvisorsReader{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.(*ListAdvisorsOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*ListAdvisorsDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -ListFailedServices lists failed services - -Returns a list of services with failed checks and a summary of check results. -*/ -func (a *Client) ListFailedServices(params *ListFailedServicesParams, opts ...ClientOption) (*ListFailedServicesOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewListFailedServicesParams() - } - op := &runtime.ClientOperation{ - ID: "ListFailedServices", - Method: "GET", - PathPattern: "/v1/advisors/failedServices", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &ListFailedServicesReader{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.(*ListFailedServicesOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*ListFailedServicesDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -StartAdvisorChecks starts advisor checks - -Executes Advisor checks and returns when all checks are executed. All available checks will be started if check names aren't specified. -*/ -func (a *Client) StartAdvisorChecks(params *StartAdvisorChecksParams, opts ...ClientOption) (*StartAdvisorChecksOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewStartAdvisorChecksParams() - } - op := &runtime.ClientOperation{ - ID: "StartAdvisorChecks", - Method: "POST", - PathPattern: "/v1/advisors/checks:start", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &StartAdvisorChecksReader{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.(*StartAdvisorChecksOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*StartAdvisorChecksDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/api/advisors/v1/json/client/advisor_service/change_advisor_checks_parameters.go b/api/advisors/v1/json/client/advisor_service/change_advisor_checks_parameters.go deleted file mode 100644 index 9f9ee299089..00000000000 --- a/api/advisors/v1/json/client/advisor_service/change_advisor_checks_parameters.go +++ /dev/null @@ -1,144 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package advisor_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" -) - -// NewChangeAdvisorChecksParams creates a new ChangeAdvisorChecksParams 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 NewChangeAdvisorChecksParams() *ChangeAdvisorChecksParams { - return &ChangeAdvisorChecksParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewChangeAdvisorChecksParamsWithTimeout creates a new ChangeAdvisorChecksParams object -// with the ability to set a timeout on a request. -func NewChangeAdvisorChecksParamsWithTimeout(timeout time.Duration) *ChangeAdvisorChecksParams { - return &ChangeAdvisorChecksParams{ - timeout: timeout, - } -} - -// NewChangeAdvisorChecksParamsWithContext creates a new ChangeAdvisorChecksParams object -// with the ability to set a context for a request. -func NewChangeAdvisorChecksParamsWithContext(ctx context.Context) *ChangeAdvisorChecksParams { - return &ChangeAdvisorChecksParams{ - Context: ctx, - } -} - -// NewChangeAdvisorChecksParamsWithHTTPClient creates a new ChangeAdvisorChecksParams object -// with the ability to set a custom HTTPClient for a request. -func NewChangeAdvisorChecksParamsWithHTTPClient(client *http.Client) *ChangeAdvisorChecksParams { - return &ChangeAdvisorChecksParams{ - HTTPClient: client, - } -} - -/* -ChangeAdvisorChecksParams contains all the parameters to send to the API endpoint - - for the change advisor checks operation. - - Typically these are written to a http.Request. -*/ -type ChangeAdvisorChecksParams struct { - // Body. - Body ChangeAdvisorChecksBody - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the change advisor checks params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ChangeAdvisorChecksParams) WithDefaults() *ChangeAdvisorChecksParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the change advisor checks params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ChangeAdvisorChecksParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the change advisor checks params -func (o *ChangeAdvisorChecksParams) WithTimeout(timeout time.Duration) *ChangeAdvisorChecksParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the change advisor checks params -func (o *ChangeAdvisorChecksParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the change advisor checks params -func (o *ChangeAdvisorChecksParams) WithContext(ctx context.Context) *ChangeAdvisorChecksParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the change advisor checks params -func (o *ChangeAdvisorChecksParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the change advisor checks params -func (o *ChangeAdvisorChecksParams) WithHTTPClient(client *http.Client) *ChangeAdvisorChecksParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the change advisor checks params -func (o *ChangeAdvisorChecksParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the change advisor checks params -func (o *ChangeAdvisorChecksParams) WithBody(body ChangeAdvisorChecksBody) *ChangeAdvisorChecksParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the change advisor checks params -func (o *ChangeAdvisorChecksParams) SetBody(body ChangeAdvisorChecksBody) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *ChangeAdvisorChecksParams) 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/advisors/v1/json/client/advisor_service/change_advisor_checks_responses.go b/api/advisors/v1/json/client/advisor_service/change_advisor_checks_responses.go deleted file mode 100644 index 5206e6f500b..00000000000 --- a/api/advisors/v1/json/client/advisor_service/change_advisor_checks_responses.go +++ /dev/null @@ -1,627 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package advisor_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" -) - -// ChangeAdvisorChecksReader is a Reader for the ChangeAdvisorChecks structure. -type ChangeAdvisorChecksReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ChangeAdvisorChecksReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewChangeAdvisorChecksOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewChangeAdvisorChecksDefault(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 - } -} - -// NewChangeAdvisorChecksOK creates a ChangeAdvisorChecksOK with default headers values -func NewChangeAdvisorChecksOK() *ChangeAdvisorChecksOK { - return &ChangeAdvisorChecksOK{} -} - -/* -ChangeAdvisorChecksOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type ChangeAdvisorChecksOK struct { - Payload any -} - -// IsSuccess returns true when this change advisor checks Ok response has a 2xx status code -func (o *ChangeAdvisorChecksOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this change advisor checks Ok response has a 3xx status code -func (o *ChangeAdvisorChecksOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this change advisor checks Ok response has a 4xx status code -func (o *ChangeAdvisorChecksOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this change advisor checks Ok response has a 5xx status code -func (o *ChangeAdvisorChecksOK) IsServerError() bool { - return false -} - -// IsCode returns true when this change advisor checks Ok response a status code equal to that given -func (o *ChangeAdvisorChecksOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the change advisor checks Ok response -func (o *ChangeAdvisorChecksOK) Code() int { - return 200 -} - -func (o *ChangeAdvisorChecksOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/advisors/checks:batchChange][%d] changeAdvisorChecksOk %s", 200, payload) -} - -func (o *ChangeAdvisorChecksOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/advisors/checks:batchChange][%d] changeAdvisorChecksOk %s", 200, payload) -} - -func (o *ChangeAdvisorChecksOK) GetPayload() any { - return o.Payload -} - -func (o *ChangeAdvisorChecksOK) 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) { - return err - } - - return nil -} - -// NewChangeAdvisorChecksDefault creates a ChangeAdvisorChecksDefault with default headers values -func NewChangeAdvisorChecksDefault(code int) *ChangeAdvisorChecksDefault { - return &ChangeAdvisorChecksDefault{ - _statusCode: code, - } -} - -/* -ChangeAdvisorChecksDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type ChangeAdvisorChecksDefault struct { - _statusCode int - - Payload *ChangeAdvisorChecksDefaultBody -} - -// IsSuccess returns true when this change advisor checks default response has a 2xx status code -func (o *ChangeAdvisorChecksDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this change advisor checks default response has a 3xx status code -func (o *ChangeAdvisorChecksDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this change advisor checks default response has a 4xx status code -func (o *ChangeAdvisorChecksDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this change advisor checks default response has a 5xx status code -func (o *ChangeAdvisorChecksDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this change advisor checks default response a status code equal to that given -func (o *ChangeAdvisorChecksDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the change advisor checks default response -func (o *ChangeAdvisorChecksDefault) Code() int { - return o._statusCode -} - -func (o *ChangeAdvisorChecksDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/advisors/checks:batchChange][%d] ChangeAdvisorChecks default %s", o._statusCode, payload) -} - -func (o *ChangeAdvisorChecksDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/advisors/checks:batchChange][%d] ChangeAdvisorChecks default %s", o._statusCode, payload) -} - -func (o *ChangeAdvisorChecksDefault) GetPayload() *ChangeAdvisorChecksDefaultBody { - return o.Payload -} - -func (o *ChangeAdvisorChecksDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(ChangeAdvisorChecksDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -ChangeAdvisorChecksBody change advisor checks body -swagger:model ChangeAdvisorChecksBody -*/ -type ChangeAdvisorChecksBody struct { - // params - Params []*ChangeAdvisorChecksParamsBodyParamsItems0 `json:"params"` -} - -// Validate validates this change advisor checks body -func (o *ChangeAdvisorChecksBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateParams(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ChangeAdvisorChecksBody) validateParams(formats strfmt.Registry) error { - if swag.IsZero(o.Params) { // not required - return nil - } - - for i := 0; i < len(o.Params); i++ { - if swag.IsZero(o.Params[i]) { // not required - continue - } - - if o.Params[i] != nil { - if err := o.Params[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "params" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "params" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this change advisor checks body based on the context it is used -func (o *ChangeAdvisorChecksBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateParams(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ChangeAdvisorChecksBody) contextValidateParams(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Params); i++ { - if o.Params[i] != nil { - - if swag.IsZero(o.Params[i]) { // not required - return nil - } - - if err := o.Params[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "params" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "params" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeAdvisorChecksBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeAdvisorChecksBody) UnmarshalBinary(b []byte) error { - var res ChangeAdvisorChecksBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeAdvisorChecksDefaultBody change advisor checks default body -swagger:model ChangeAdvisorChecksDefaultBody -*/ -type ChangeAdvisorChecksDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*ChangeAdvisorChecksDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this change advisor checks default body -func (o *ChangeAdvisorChecksDefaultBody) 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 *ChangeAdvisorChecksDefaultBody) 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("ChangeAdvisorChecks default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("ChangeAdvisorChecks default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this change advisor checks default body based on the context it is used -func (o *ChangeAdvisorChecksDefaultBody) 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 *ChangeAdvisorChecksDefaultBody) 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("ChangeAdvisorChecks default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("ChangeAdvisorChecks default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeAdvisorChecksDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeAdvisorChecksDefaultBody) UnmarshalBinary(b []byte) error { - var res ChangeAdvisorChecksDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeAdvisorChecksDefaultBodyDetailsItems0 change advisor checks default body details items0 -swagger:model ChangeAdvisorChecksDefaultBodyDetailsItems0 -*/ -type ChangeAdvisorChecksDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` - - // change advisor checks default body details items0 - ChangeAdvisorChecksDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *ChangeAdvisorChecksDefaultBodyDetailsItems0) 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 ChangeAdvisorChecksDefaultBodyDetailsItems0 - - 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.ChangeAdvisorChecksDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o ChangeAdvisorChecksDefaultBodyDetailsItems0) 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.ChangeAdvisorChecksDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.ChangeAdvisorChecksDefaultBodyDetailsItems0) - 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 change advisor checks default body details items0 -func (o *ChangeAdvisorChecksDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this change advisor checks default body details items0 based on context it is used -func (o *ChangeAdvisorChecksDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeAdvisorChecksDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeAdvisorChecksDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res ChangeAdvisorChecksDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeAdvisorChecksParamsBodyParamsItems0 ChangeAdvisorCheckParams specifies a single check parameters. -swagger:model ChangeAdvisorChecksParamsBodyParamsItems0 -*/ -type ChangeAdvisorChecksParamsBodyParamsItems0 struct { - // The name of the check to change. - Name string `json:"name,omitempty"` - - // enable - Enable *bool `json:"enable,omitempty"` - - // AdvisorCheckInterval represents possible execution interval values for checks. - // Enum: ["ADVISOR_CHECK_INTERVAL_UNSPECIFIED","ADVISOR_CHECK_INTERVAL_STANDARD","ADVISOR_CHECK_INTERVAL_FREQUENT","ADVISOR_CHECK_INTERVAL_RARE"] - Interval *string `json:"interval,omitempty"` -} - -// Validate validates this change advisor checks params body params items0 -func (o *ChangeAdvisorChecksParamsBodyParamsItems0) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateInterval(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var changeAdvisorChecksParamsBodyParamsItems0TypeIntervalPropEnum []any - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["ADVISOR_CHECK_INTERVAL_UNSPECIFIED","ADVISOR_CHECK_INTERVAL_STANDARD","ADVISOR_CHECK_INTERVAL_FREQUENT","ADVISOR_CHECK_INTERVAL_RARE"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - changeAdvisorChecksParamsBodyParamsItems0TypeIntervalPropEnum = append(changeAdvisorChecksParamsBodyParamsItems0TypeIntervalPropEnum, v) - } -} - -const ( - - // ChangeAdvisorChecksParamsBodyParamsItems0IntervalADVISORCHECKINTERVALUNSPECIFIED captures enum value "ADVISOR_CHECK_INTERVAL_UNSPECIFIED" - ChangeAdvisorChecksParamsBodyParamsItems0IntervalADVISORCHECKINTERVALUNSPECIFIED string = "ADVISOR_CHECK_INTERVAL_UNSPECIFIED" - - // ChangeAdvisorChecksParamsBodyParamsItems0IntervalADVISORCHECKINTERVALSTANDARD captures enum value "ADVISOR_CHECK_INTERVAL_STANDARD" - ChangeAdvisorChecksParamsBodyParamsItems0IntervalADVISORCHECKINTERVALSTANDARD string = "ADVISOR_CHECK_INTERVAL_STANDARD" - - // ChangeAdvisorChecksParamsBodyParamsItems0IntervalADVISORCHECKINTERVALFREQUENT captures enum value "ADVISOR_CHECK_INTERVAL_FREQUENT" - ChangeAdvisorChecksParamsBodyParamsItems0IntervalADVISORCHECKINTERVALFREQUENT string = "ADVISOR_CHECK_INTERVAL_FREQUENT" - - // ChangeAdvisorChecksParamsBodyParamsItems0IntervalADVISORCHECKINTERVALRARE captures enum value "ADVISOR_CHECK_INTERVAL_RARE" - ChangeAdvisorChecksParamsBodyParamsItems0IntervalADVISORCHECKINTERVALRARE string = "ADVISOR_CHECK_INTERVAL_RARE" -) - -// prop value enum -func (o *ChangeAdvisorChecksParamsBodyParamsItems0) validateIntervalEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, changeAdvisorChecksParamsBodyParamsItems0TypeIntervalPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ChangeAdvisorChecksParamsBodyParamsItems0) validateInterval(formats strfmt.Registry) error { - if swag.IsZero(o.Interval) { // not required - return nil - } - - // value enum - if err := o.validateIntervalEnum("interval", "body", *o.Interval); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this change advisor checks params body params items0 based on context it is used -func (o *ChangeAdvisorChecksParamsBodyParamsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeAdvisorChecksParamsBodyParamsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeAdvisorChecksParamsBodyParamsItems0) UnmarshalBinary(b []byte) error { - var res ChangeAdvisorChecksParamsBodyParamsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/advisors/v1/json/client/advisor_service/get_failed_checks_parameters.go b/api/advisors/v1/json/client/advisor_service/get_failed_checks_parameters.go deleted file mode 100644 index 0248b1355a4..00000000000 --- a/api/advisors/v1/json/client/advisor_service/get_failed_checks_parameters.go +++ /dev/null @@ -1,231 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package advisor_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" - "github.com/go-openapi/swag" -) - -// NewGetFailedChecksParams creates a new GetFailedChecksParams 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 NewGetFailedChecksParams() *GetFailedChecksParams { - return &GetFailedChecksParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetFailedChecksParamsWithTimeout creates a new GetFailedChecksParams object -// with the ability to set a timeout on a request. -func NewGetFailedChecksParamsWithTimeout(timeout time.Duration) *GetFailedChecksParams { - return &GetFailedChecksParams{ - timeout: timeout, - } -} - -// NewGetFailedChecksParamsWithContext creates a new GetFailedChecksParams object -// with the ability to set a context for a request. -func NewGetFailedChecksParamsWithContext(ctx context.Context) *GetFailedChecksParams { - return &GetFailedChecksParams{ - Context: ctx, - } -} - -// NewGetFailedChecksParamsWithHTTPClient creates a new GetFailedChecksParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetFailedChecksParamsWithHTTPClient(client *http.Client) *GetFailedChecksParams { - return &GetFailedChecksParams{ - HTTPClient: client, - } -} - -/* -GetFailedChecksParams contains all the parameters to send to the API endpoint - - for the get failed checks operation. - - Typically these are written to a http.Request. -*/ -type GetFailedChecksParams struct { - /* PageIndex. - - Index of the requested page, starts from 0. - - Format: int32 - */ - PageIndex *int32 - - /* PageSize. - - Maximum number of results per page. - - Format: int32 - */ - PageSize *int32 - - /* ServiceID. - - Service ID. - */ - ServiceID *string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get failed checks params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetFailedChecksParams) WithDefaults() *GetFailedChecksParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get failed checks params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetFailedChecksParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the get failed checks params -func (o *GetFailedChecksParams) WithTimeout(timeout time.Duration) *GetFailedChecksParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get failed checks params -func (o *GetFailedChecksParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get failed checks params -func (o *GetFailedChecksParams) WithContext(ctx context.Context) *GetFailedChecksParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get failed checks params -func (o *GetFailedChecksParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get failed checks params -func (o *GetFailedChecksParams) WithHTTPClient(client *http.Client) *GetFailedChecksParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get failed checks params -func (o *GetFailedChecksParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithPageIndex adds the pageIndex to the get failed checks params -func (o *GetFailedChecksParams) WithPageIndex(pageIndex *int32) *GetFailedChecksParams { - o.SetPageIndex(pageIndex) - return o -} - -// SetPageIndex adds the pageIndex to the get failed checks params -func (o *GetFailedChecksParams) SetPageIndex(pageIndex *int32) { - o.PageIndex = pageIndex -} - -// WithPageSize adds the pageSize to the get failed checks params -func (o *GetFailedChecksParams) WithPageSize(pageSize *int32) *GetFailedChecksParams { - o.SetPageSize(pageSize) - return o -} - -// SetPageSize adds the pageSize to the get failed checks params -func (o *GetFailedChecksParams) SetPageSize(pageSize *int32) { - o.PageSize = pageSize -} - -// WithServiceID adds the serviceID to the get failed checks params -func (o *GetFailedChecksParams) WithServiceID(serviceID *string) *GetFailedChecksParams { - o.SetServiceID(serviceID) - return o -} - -// SetServiceID adds the serviceId to the get failed checks params -func (o *GetFailedChecksParams) SetServiceID(serviceID *string) { - o.ServiceID = serviceID -} - -// WriteToRequest writes these params to a swagger request -func (o *GetFailedChecksParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.PageIndex != nil { - - // query param page_index - var qrPageIndex int32 - - if o.PageIndex != nil { - qrPageIndex = *o.PageIndex - } - qPageIndex := swag.FormatInt32(qrPageIndex) - if qPageIndex != "" { - if err := r.SetQueryParam("page_index", qPageIndex); err != nil { - return err - } - } - } - - if o.PageSize != nil { - - // query param page_size - var qrPageSize int32 - - if o.PageSize != nil { - qrPageSize = *o.PageSize - } - qPageSize := swag.FormatInt32(qrPageSize) - if qPageSize != "" { - if err := r.SetQueryParam("page_size", qPageSize); err != nil { - return err - } - } - } - - if o.ServiceID != nil { - - // query param service_id - var qrServiceID string - - if o.ServiceID != nil { - qrServiceID = *o.ServiceID - } - qServiceID := qrServiceID - if qServiceID != "" { - if err := r.SetQueryParam("service_id", qServiceID); err != nil { - return err - } - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/api/advisors/v1/json/client/advisor_service/get_failed_checks_responses.go b/api/advisors/v1/json/client/advisor_service/get_failed_checks_responses.go deleted file mode 100644 index a74c7943f5a..00000000000 --- a/api/advisors/v1/json/client/advisor_service/get_failed_checks_responses.go +++ /dev/null @@ -1,668 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package advisor_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" -) - -// GetFailedChecksReader is a Reader for the GetFailedChecks structure. -type GetFailedChecksReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetFailedChecksReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewGetFailedChecksOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewGetFailedChecksDefault(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 - } -} - -// NewGetFailedChecksOK creates a GetFailedChecksOK with default headers values -func NewGetFailedChecksOK() *GetFailedChecksOK { - return &GetFailedChecksOK{} -} - -/* -GetFailedChecksOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type GetFailedChecksOK struct { - Payload *GetFailedChecksOKBody -} - -// IsSuccess returns true when this get failed checks Ok response has a 2xx status code -func (o *GetFailedChecksOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this get failed checks Ok response has a 3xx status code -func (o *GetFailedChecksOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this get failed checks Ok response has a 4xx status code -func (o *GetFailedChecksOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this get failed checks Ok response has a 5xx status code -func (o *GetFailedChecksOK) IsServerError() bool { - return false -} - -// IsCode returns true when this get failed checks Ok response a status code equal to that given -func (o *GetFailedChecksOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the get failed checks Ok response -func (o *GetFailedChecksOK) Code() int { - return 200 -} - -func (o *GetFailedChecksOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/advisors/checks/failed][%d] getFailedChecksOk %s", 200, payload) -} - -func (o *GetFailedChecksOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/advisors/checks/failed][%d] getFailedChecksOk %s", 200, payload) -} - -func (o *GetFailedChecksOK) GetPayload() *GetFailedChecksOKBody { - return o.Payload -} - -func (o *GetFailedChecksOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(GetFailedChecksOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -// NewGetFailedChecksDefault creates a GetFailedChecksDefault with default headers values -func NewGetFailedChecksDefault(code int) *GetFailedChecksDefault { - return &GetFailedChecksDefault{ - _statusCode: code, - } -} - -/* -GetFailedChecksDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type GetFailedChecksDefault struct { - _statusCode int - - Payload *GetFailedChecksDefaultBody -} - -// IsSuccess returns true when this get failed checks default response has a 2xx status code -func (o *GetFailedChecksDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this get failed checks default response has a 3xx status code -func (o *GetFailedChecksDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this get failed checks default response has a 4xx status code -func (o *GetFailedChecksDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this get failed checks default response has a 5xx status code -func (o *GetFailedChecksDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this get failed checks default response a status code equal to that given -func (o *GetFailedChecksDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the get failed checks default response -func (o *GetFailedChecksDefault) Code() int { - return o._statusCode -} - -func (o *GetFailedChecksDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/advisors/checks/failed][%d] GetFailedChecks default %s", o._statusCode, payload) -} - -func (o *GetFailedChecksDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/advisors/checks/failed][%d] GetFailedChecks default %s", o._statusCode, payload) -} - -func (o *GetFailedChecksDefault) GetPayload() *GetFailedChecksDefaultBody { - return o.Payload -} - -func (o *GetFailedChecksDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(GetFailedChecksDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -GetFailedChecksDefaultBody get failed checks default body -swagger:model GetFailedChecksDefaultBody -*/ -type GetFailedChecksDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*GetFailedChecksDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this get failed checks default body -func (o *GetFailedChecksDefaultBody) 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 *GetFailedChecksDefaultBody) 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("GetFailedChecks default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("GetFailedChecks default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this get failed checks default body based on the context it is used -func (o *GetFailedChecksDefaultBody) 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 *GetFailedChecksDefaultBody) 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("GetFailedChecks default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("GetFailedChecks default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetFailedChecksDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetFailedChecksDefaultBody) UnmarshalBinary(b []byte) error { - var res GetFailedChecksDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetFailedChecksDefaultBodyDetailsItems0 get failed checks default body details items0 -swagger:model GetFailedChecksDefaultBodyDetailsItems0 -*/ -type GetFailedChecksDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` - - // get failed checks default body details items0 - GetFailedChecksDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *GetFailedChecksDefaultBodyDetailsItems0) 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 GetFailedChecksDefaultBodyDetailsItems0 - - 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.GetFailedChecksDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o GetFailedChecksDefaultBodyDetailsItems0) 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.GetFailedChecksDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.GetFailedChecksDefaultBodyDetailsItems0) - 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 get failed checks default body details items0 -func (o *GetFailedChecksDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get failed checks default body details items0 based on context it is used -func (o *GetFailedChecksDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetFailedChecksDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetFailedChecksDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res GetFailedChecksDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetFailedChecksOKBody get failed checks OK body -swagger:model GetFailedChecksOKBody -*/ -type GetFailedChecksOKBody struct { - // Total number of results. - TotalItems int32 `json:"total_items,omitempty"` - - // Total number of pages. - TotalPages int32 `json:"total_pages,omitempty"` - - // Check results - Results []*GetFailedChecksOKBodyResultsItems0 `json:"results"` -} - -// Validate validates this get failed checks OK body -func (o *GetFailedChecksOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateResults(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetFailedChecksOKBody) validateResults(formats strfmt.Registry) error { - if swag.IsZero(o.Results) { // not required - return nil - } - - for i := 0; i < len(o.Results); i++ { - if swag.IsZero(o.Results[i]) { // not required - continue - } - - if o.Results[i] != nil { - if err := o.Results[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getFailedChecksOk" + "." + "results" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getFailedChecksOk" + "." + "results" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this get failed checks OK body based on the context it is used -func (o *GetFailedChecksOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateResults(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetFailedChecksOKBody) contextValidateResults(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Results); i++ { - if o.Results[i] != nil { - - if swag.IsZero(o.Results[i]) { // not required - return nil - } - - if err := o.Results[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getFailedChecksOk" + "." + "results" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getFailedChecksOk" + "." + "results" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetFailedChecksOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetFailedChecksOKBody) UnmarshalBinary(b []byte) error { - var res GetFailedChecksOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetFailedChecksOKBodyResultsItems0 CheckResult represents the check results for a given service. -swagger:model GetFailedChecksOKBodyResultsItems0 -*/ -type GetFailedChecksOKBodyResultsItems0 struct { - // summary - Summary string `json:"summary,omitempty"` - - // description - Description string `json:"description,omitempty"` - - // Severity represents severity level of the check result or alert. - // Enum: ["SEVERITY_UNSPECIFIED","SEVERITY_EMERGENCY","SEVERITY_ALERT","SEVERITY_CRITICAL","SEVERITY_ERROR","SEVERITY_WARNING","SEVERITY_NOTICE","SEVERITY_INFO","SEVERITY_DEBUG"] - Severity *string `json:"severity,omitempty"` - - // labels - Labels map[string]string `json:"labels,omitempty"` - - // URL containing information on how to resolve an issue detected by an Advisor check. - ReadMoreURL string `json:"read_more_url,omitempty"` - - // Name of the monitored service on which the check ran. - ServiceName string `json:"service_name,omitempty"` - - // ID of the monitored service on which the check ran. - ServiceID string `json:"service_id,omitempty"` - - // Name of the check that failed - CheckName string `json:"check_name,omitempty"` - - // Silence status of the check result - Silenced bool `json:"silenced,omitempty"` -} - -// Validate validates this get failed checks OK body results items0 -func (o *GetFailedChecksOKBodyResultsItems0) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateSeverity(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var getFailedChecksOkBodyResultsItems0TypeSeverityPropEnum []any - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["SEVERITY_UNSPECIFIED","SEVERITY_EMERGENCY","SEVERITY_ALERT","SEVERITY_CRITICAL","SEVERITY_ERROR","SEVERITY_WARNING","SEVERITY_NOTICE","SEVERITY_INFO","SEVERITY_DEBUG"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - getFailedChecksOkBodyResultsItems0TypeSeverityPropEnum = append(getFailedChecksOkBodyResultsItems0TypeSeverityPropEnum, v) - } -} - -const ( - - // GetFailedChecksOKBodyResultsItems0SeveritySEVERITYUNSPECIFIED captures enum value "SEVERITY_UNSPECIFIED" - GetFailedChecksOKBodyResultsItems0SeveritySEVERITYUNSPECIFIED string = "SEVERITY_UNSPECIFIED" - - // GetFailedChecksOKBodyResultsItems0SeveritySEVERITYEMERGENCY captures enum value "SEVERITY_EMERGENCY" - GetFailedChecksOKBodyResultsItems0SeveritySEVERITYEMERGENCY string = "SEVERITY_EMERGENCY" - - // GetFailedChecksOKBodyResultsItems0SeveritySEVERITYALERT captures enum value "SEVERITY_ALERT" - GetFailedChecksOKBodyResultsItems0SeveritySEVERITYALERT string = "SEVERITY_ALERT" - - // GetFailedChecksOKBodyResultsItems0SeveritySEVERITYCRITICAL captures enum value "SEVERITY_CRITICAL" - GetFailedChecksOKBodyResultsItems0SeveritySEVERITYCRITICAL string = "SEVERITY_CRITICAL" - - // GetFailedChecksOKBodyResultsItems0SeveritySEVERITYERROR captures enum value "SEVERITY_ERROR" - GetFailedChecksOKBodyResultsItems0SeveritySEVERITYERROR string = "SEVERITY_ERROR" - - // GetFailedChecksOKBodyResultsItems0SeveritySEVERITYWARNING captures enum value "SEVERITY_WARNING" - GetFailedChecksOKBodyResultsItems0SeveritySEVERITYWARNING string = "SEVERITY_WARNING" - - // GetFailedChecksOKBodyResultsItems0SeveritySEVERITYNOTICE captures enum value "SEVERITY_NOTICE" - GetFailedChecksOKBodyResultsItems0SeveritySEVERITYNOTICE string = "SEVERITY_NOTICE" - - // GetFailedChecksOKBodyResultsItems0SeveritySEVERITYINFO captures enum value "SEVERITY_INFO" - GetFailedChecksOKBodyResultsItems0SeveritySEVERITYINFO string = "SEVERITY_INFO" - - // GetFailedChecksOKBodyResultsItems0SeveritySEVERITYDEBUG captures enum value "SEVERITY_DEBUG" - GetFailedChecksOKBodyResultsItems0SeveritySEVERITYDEBUG string = "SEVERITY_DEBUG" -) - -// prop value enum -func (o *GetFailedChecksOKBodyResultsItems0) validateSeverityEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, getFailedChecksOkBodyResultsItems0TypeSeverityPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *GetFailedChecksOKBodyResultsItems0) validateSeverity(formats strfmt.Registry) error { - if swag.IsZero(o.Severity) { // not required - return nil - } - - // value enum - if err := o.validateSeverityEnum("severity", "body", *o.Severity); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this get failed checks OK body results items0 based on context it is used -func (o *GetFailedChecksOKBodyResultsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetFailedChecksOKBodyResultsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetFailedChecksOKBodyResultsItems0) UnmarshalBinary(b []byte) error { - var res GetFailedChecksOKBodyResultsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/advisors/v1/json/client/advisor_service/list_advisor_checks_parameters.go b/api/advisors/v1/json/client/advisor_service/list_advisor_checks_parameters.go deleted file mode 100644 index 23e2a16e65b..00000000000 --- a/api/advisors/v1/json/client/advisor_service/list_advisor_checks_parameters.go +++ /dev/null @@ -1,127 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package advisor_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" -) - -// NewListAdvisorChecksParams creates a new ListAdvisorChecksParams 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 NewListAdvisorChecksParams() *ListAdvisorChecksParams { - return &ListAdvisorChecksParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListAdvisorChecksParamsWithTimeout creates a new ListAdvisorChecksParams object -// with the ability to set a timeout on a request. -func NewListAdvisorChecksParamsWithTimeout(timeout time.Duration) *ListAdvisorChecksParams { - return &ListAdvisorChecksParams{ - timeout: timeout, - } -} - -// NewListAdvisorChecksParamsWithContext creates a new ListAdvisorChecksParams object -// with the ability to set a context for a request. -func NewListAdvisorChecksParamsWithContext(ctx context.Context) *ListAdvisorChecksParams { - return &ListAdvisorChecksParams{ - Context: ctx, - } -} - -// NewListAdvisorChecksParamsWithHTTPClient creates a new ListAdvisorChecksParams object -// with the ability to set a custom HTTPClient for a request. -func NewListAdvisorChecksParamsWithHTTPClient(client *http.Client) *ListAdvisorChecksParams { - return &ListAdvisorChecksParams{ - HTTPClient: client, - } -} - -/* -ListAdvisorChecksParams contains all the parameters to send to the API endpoint - - for the list advisor checks operation. - - Typically these are written to a http.Request. -*/ -type ListAdvisorChecksParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list advisor checks params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListAdvisorChecksParams) WithDefaults() *ListAdvisorChecksParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list advisor checks params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListAdvisorChecksParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list advisor checks params -func (o *ListAdvisorChecksParams) WithTimeout(timeout time.Duration) *ListAdvisorChecksParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list advisor checks params -func (o *ListAdvisorChecksParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list advisor checks params -func (o *ListAdvisorChecksParams) WithContext(ctx context.Context) *ListAdvisorChecksParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list advisor checks params -func (o *ListAdvisorChecksParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list advisor checks params -func (o *ListAdvisorChecksParams) WithHTTPClient(client *http.Client) *ListAdvisorChecksParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list advisor checks params -func (o *ListAdvisorChecksParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *ListAdvisorChecksParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/api/advisors/v1/json/client/advisor_service/list_advisor_checks_responses.go b/api/advisors/v1/json/client/advisor_service/list_advisor_checks_responses.go deleted file mode 100644 index 1696a05ac3d..00000000000 --- a/api/advisors/v1/json/client/advisor_service/list_advisor_checks_responses.go +++ /dev/null @@ -1,691 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package advisor_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" -) - -// ListAdvisorChecksReader is a Reader for the ListAdvisorChecks structure. -type ListAdvisorChecksReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListAdvisorChecksReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewListAdvisorChecksOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewListAdvisorChecksDefault(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 - } -} - -// NewListAdvisorChecksOK creates a ListAdvisorChecksOK with default headers values -func NewListAdvisorChecksOK() *ListAdvisorChecksOK { - return &ListAdvisorChecksOK{} -} - -/* -ListAdvisorChecksOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type ListAdvisorChecksOK struct { - Payload *ListAdvisorChecksOKBody -} - -// IsSuccess returns true when this list advisor checks Ok response has a 2xx status code -func (o *ListAdvisorChecksOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this list advisor checks Ok response has a 3xx status code -func (o *ListAdvisorChecksOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this list advisor checks Ok response has a 4xx status code -func (o *ListAdvisorChecksOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this list advisor checks Ok response has a 5xx status code -func (o *ListAdvisorChecksOK) IsServerError() bool { - return false -} - -// IsCode returns true when this list advisor checks Ok response a status code equal to that given -func (o *ListAdvisorChecksOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the list advisor checks Ok response -func (o *ListAdvisorChecksOK) Code() int { - return 200 -} - -func (o *ListAdvisorChecksOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/advisors/checks][%d] listAdvisorChecksOk %s", 200, payload) -} - -func (o *ListAdvisorChecksOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/advisors/checks][%d] listAdvisorChecksOk %s", 200, payload) -} - -func (o *ListAdvisorChecksOK) GetPayload() *ListAdvisorChecksOKBody { - return o.Payload -} - -func (o *ListAdvisorChecksOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(ListAdvisorChecksOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -// NewListAdvisorChecksDefault creates a ListAdvisorChecksDefault with default headers values -func NewListAdvisorChecksDefault(code int) *ListAdvisorChecksDefault { - return &ListAdvisorChecksDefault{ - _statusCode: code, - } -} - -/* -ListAdvisorChecksDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type ListAdvisorChecksDefault struct { - _statusCode int - - Payload *ListAdvisorChecksDefaultBody -} - -// IsSuccess returns true when this list advisor checks default response has a 2xx status code -func (o *ListAdvisorChecksDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this list advisor checks default response has a 3xx status code -func (o *ListAdvisorChecksDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this list advisor checks default response has a 4xx status code -func (o *ListAdvisorChecksDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this list advisor checks default response has a 5xx status code -func (o *ListAdvisorChecksDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this list advisor checks default response a status code equal to that given -func (o *ListAdvisorChecksDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the list advisor checks default response -func (o *ListAdvisorChecksDefault) Code() int { - return o._statusCode -} - -func (o *ListAdvisorChecksDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/advisors/checks][%d] ListAdvisorChecks default %s", o._statusCode, payload) -} - -func (o *ListAdvisorChecksDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/advisors/checks][%d] ListAdvisorChecks default %s", o._statusCode, payload) -} - -func (o *ListAdvisorChecksDefault) GetPayload() *ListAdvisorChecksDefaultBody { - return o.Payload -} - -func (o *ListAdvisorChecksDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(ListAdvisorChecksDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -ListAdvisorChecksDefaultBody list advisor checks default body -swagger:model ListAdvisorChecksDefaultBody -*/ -type ListAdvisorChecksDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*ListAdvisorChecksDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this list advisor checks default body -func (o *ListAdvisorChecksDefaultBody) 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 *ListAdvisorChecksDefaultBody) 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("ListAdvisorChecks default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("ListAdvisorChecks default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this list advisor checks default body based on the context it is used -func (o *ListAdvisorChecksDefaultBody) 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 *ListAdvisorChecksDefaultBody) 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("ListAdvisorChecks default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("ListAdvisorChecks default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListAdvisorChecksDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAdvisorChecksDefaultBody) UnmarshalBinary(b []byte) error { - var res ListAdvisorChecksDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListAdvisorChecksDefaultBodyDetailsItems0 list advisor checks default body details items0 -swagger:model ListAdvisorChecksDefaultBodyDetailsItems0 -*/ -type ListAdvisorChecksDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` - - // list advisor checks default body details items0 - ListAdvisorChecksDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *ListAdvisorChecksDefaultBodyDetailsItems0) 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 ListAdvisorChecksDefaultBodyDetailsItems0 - - 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.ListAdvisorChecksDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o ListAdvisorChecksDefaultBodyDetailsItems0) 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.ListAdvisorChecksDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.ListAdvisorChecksDefaultBodyDetailsItems0) - 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 list advisor checks default body details items0 -func (o *ListAdvisorChecksDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list advisor checks default body details items0 based on context it is used -func (o *ListAdvisorChecksDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListAdvisorChecksDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAdvisorChecksDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res ListAdvisorChecksDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListAdvisorChecksOKBody list advisor checks OK body -swagger:model ListAdvisorChecksOKBody -*/ -type ListAdvisorChecksOKBody struct { - // checks - Checks []*ListAdvisorChecksOKBodyChecksItems0 `json:"checks"` -} - -// Validate validates this list advisor checks OK body -func (o *ListAdvisorChecksOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateChecks(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListAdvisorChecksOKBody) validateChecks(formats strfmt.Registry) error { - if swag.IsZero(o.Checks) { // not required - return nil - } - - for i := 0; i < len(o.Checks); i++ { - if swag.IsZero(o.Checks[i]) { // not required - continue - } - - if o.Checks[i] != nil { - if err := o.Checks[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listAdvisorChecksOk" + "." + "checks" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listAdvisorChecksOk" + "." + "checks" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this list advisor checks OK body based on the context it is used -func (o *ListAdvisorChecksOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateChecks(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListAdvisorChecksOKBody) contextValidateChecks(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Checks); i++ { - if o.Checks[i] != nil { - - if swag.IsZero(o.Checks[i]) { // not required - return nil - } - - if err := o.Checks[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listAdvisorChecksOk" + "." + "checks" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listAdvisorChecksOk" + "." + "checks" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListAdvisorChecksOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAdvisorChecksOKBody) UnmarshalBinary(b []byte) error { - var res ListAdvisorChecksOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListAdvisorChecksOKBodyChecksItems0 AdvisorCheck contains check name and status. -swagger:model ListAdvisorChecksOKBodyChecksItems0 -*/ -type ListAdvisorChecksOKBodyChecksItems0 struct { - // Machine-readable name (ID) that is used in expression. - Name string `json:"name,omitempty"` - - // True if that check is enabled. - Enabled bool `json:"enabled,omitempty"` - - // Long human-readable description. - Description string `json:"description,omitempty"` - - // Short human-readable summary. - Summary string `json:"summary,omitempty"` - - // AdvisorCheckInterval represents possible execution interval values for checks. - // Enum: ["ADVISOR_CHECK_INTERVAL_UNSPECIFIED","ADVISOR_CHECK_INTERVAL_STANDARD","ADVISOR_CHECK_INTERVAL_FREQUENT","ADVISOR_CHECK_INTERVAL_RARE"] - Interval *string `json:"interval,omitempty"` - - // family - // Enum: ["ADVISOR_CHECK_FAMILY_UNSPECIFIED","ADVISOR_CHECK_FAMILY_MYSQL","ADVISOR_CHECK_FAMILY_POSTGRESQL","ADVISOR_CHECK_FAMILY_MONGODB"] - Family *string `json:"family,omitempty"` -} - -// Validate validates this list advisor checks OK body checks items0 -func (o *ListAdvisorChecksOKBodyChecksItems0) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateInterval(formats); err != nil { - res = append(res, err) - } - - if err := o.validateFamily(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var listAdvisorChecksOkBodyChecksItems0TypeIntervalPropEnum []any - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["ADVISOR_CHECK_INTERVAL_UNSPECIFIED","ADVISOR_CHECK_INTERVAL_STANDARD","ADVISOR_CHECK_INTERVAL_FREQUENT","ADVISOR_CHECK_INTERVAL_RARE"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - listAdvisorChecksOkBodyChecksItems0TypeIntervalPropEnum = append(listAdvisorChecksOkBodyChecksItems0TypeIntervalPropEnum, v) - } -} - -const ( - - // ListAdvisorChecksOKBodyChecksItems0IntervalADVISORCHECKINTERVALUNSPECIFIED captures enum value "ADVISOR_CHECK_INTERVAL_UNSPECIFIED" - ListAdvisorChecksOKBodyChecksItems0IntervalADVISORCHECKINTERVALUNSPECIFIED string = "ADVISOR_CHECK_INTERVAL_UNSPECIFIED" - - // ListAdvisorChecksOKBodyChecksItems0IntervalADVISORCHECKINTERVALSTANDARD captures enum value "ADVISOR_CHECK_INTERVAL_STANDARD" - ListAdvisorChecksOKBodyChecksItems0IntervalADVISORCHECKINTERVALSTANDARD string = "ADVISOR_CHECK_INTERVAL_STANDARD" - - // ListAdvisorChecksOKBodyChecksItems0IntervalADVISORCHECKINTERVALFREQUENT captures enum value "ADVISOR_CHECK_INTERVAL_FREQUENT" - ListAdvisorChecksOKBodyChecksItems0IntervalADVISORCHECKINTERVALFREQUENT string = "ADVISOR_CHECK_INTERVAL_FREQUENT" - - // ListAdvisorChecksOKBodyChecksItems0IntervalADVISORCHECKINTERVALRARE captures enum value "ADVISOR_CHECK_INTERVAL_RARE" - ListAdvisorChecksOKBodyChecksItems0IntervalADVISORCHECKINTERVALRARE string = "ADVISOR_CHECK_INTERVAL_RARE" -) - -// prop value enum -func (o *ListAdvisorChecksOKBodyChecksItems0) validateIntervalEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, listAdvisorChecksOkBodyChecksItems0TypeIntervalPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ListAdvisorChecksOKBodyChecksItems0) validateInterval(formats strfmt.Registry) error { - if swag.IsZero(o.Interval) { // not required - return nil - } - - // value enum - if err := o.validateIntervalEnum("interval", "body", *o.Interval); err != nil { - return err - } - - return nil -} - -var listAdvisorChecksOkBodyChecksItems0TypeFamilyPropEnum []any - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["ADVISOR_CHECK_FAMILY_UNSPECIFIED","ADVISOR_CHECK_FAMILY_MYSQL","ADVISOR_CHECK_FAMILY_POSTGRESQL","ADVISOR_CHECK_FAMILY_MONGODB"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - listAdvisorChecksOkBodyChecksItems0TypeFamilyPropEnum = append(listAdvisorChecksOkBodyChecksItems0TypeFamilyPropEnum, v) - } -} - -const ( - - // ListAdvisorChecksOKBodyChecksItems0FamilyADVISORCHECKFAMILYUNSPECIFIED captures enum value "ADVISOR_CHECK_FAMILY_UNSPECIFIED" - ListAdvisorChecksOKBodyChecksItems0FamilyADVISORCHECKFAMILYUNSPECIFIED string = "ADVISOR_CHECK_FAMILY_UNSPECIFIED" - - // ListAdvisorChecksOKBodyChecksItems0FamilyADVISORCHECKFAMILYMYSQL captures enum value "ADVISOR_CHECK_FAMILY_MYSQL" - ListAdvisorChecksOKBodyChecksItems0FamilyADVISORCHECKFAMILYMYSQL string = "ADVISOR_CHECK_FAMILY_MYSQL" - - // ListAdvisorChecksOKBodyChecksItems0FamilyADVISORCHECKFAMILYPOSTGRESQL captures enum value "ADVISOR_CHECK_FAMILY_POSTGRESQL" - ListAdvisorChecksOKBodyChecksItems0FamilyADVISORCHECKFAMILYPOSTGRESQL string = "ADVISOR_CHECK_FAMILY_POSTGRESQL" - - // ListAdvisorChecksOKBodyChecksItems0FamilyADVISORCHECKFAMILYMONGODB captures enum value "ADVISOR_CHECK_FAMILY_MONGODB" - ListAdvisorChecksOKBodyChecksItems0FamilyADVISORCHECKFAMILYMONGODB string = "ADVISOR_CHECK_FAMILY_MONGODB" -) - -// prop value enum -func (o *ListAdvisorChecksOKBodyChecksItems0) validateFamilyEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, listAdvisorChecksOkBodyChecksItems0TypeFamilyPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ListAdvisorChecksOKBodyChecksItems0) validateFamily(formats strfmt.Registry) error { - if swag.IsZero(o.Family) { // not required - return nil - } - - // value enum - if err := o.validateFamilyEnum("family", "body", *o.Family); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this list advisor checks OK body checks items0 based on context it is used -func (o *ListAdvisorChecksOKBodyChecksItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListAdvisorChecksOKBodyChecksItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAdvisorChecksOKBodyChecksItems0) UnmarshalBinary(b []byte) error { - var res ListAdvisorChecksOKBodyChecksItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/advisors/v1/json/client/advisor_service/list_advisors_parameters.go b/api/advisors/v1/json/client/advisor_service/list_advisors_parameters.go deleted file mode 100644 index 214b86b0951..00000000000 --- a/api/advisors/v1/json/client/advisor_service/list_advisors_parameters.go +++ /dev/null @@ -1,127 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package advisor_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" -) - -// NewListAdvisorsParams creates a new ListAdvisorsParams 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 NewListAdvisorsParams() *ListAdvisorsParams { - return &ListAdvisorsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListAdvisorsParamsWithTimeout creates a new ListAdvisorsParams object -// with the ability to set a timeout on a request. -func NewListAdvisorsParamsWithTimeout(timeout time.Duration) *ListAdvisorsParams { - return &ListAdvisorsParams{ - timeout: timeout, - } -} - -// NewListAdvisorsParamsWithContext creates a new ListAdvisorsParams object -// with the ability to set a context for a request. -func NewListAdvisorsParamsWithContext(ctx context.Context) *ListAdvisorsParams { - return &ListAdvisorsParams{ - Context: ctx, - } -} - -// NewListAdvisorsParamsWithHTTPClient creates a new ListAdvisorsParams object -// with the ability to set a custom HTTPClient for a request. -func NewListAdvisorsParamsWithHTTPClient(client *http.Client) *ListAdvisorsParams { - return &ListAdvisorsParams{ - HTTPClient: client, - } -} - -/* -ListAdvisorsParams contains all the parameters to send to the API endpoint - - for the list advisors operation. - - Typically these are written to a http.Request. -*/ -type ListAdvisorsParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list advisors params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListAdvisorsParams) WithDefaults() *ListAdvisorsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list advisors params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListAdvisorsParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list advisors params -func (o *ListAdvisorsParams) WithTimeout(timeout time.Duration) *ListAdvisorsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list advisors params -func (o *ListAdvisorsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list advisors params -func (o *ListAdvisorsParams) WithContext(ctx context.Context) *ListAdvisorsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list advisors params -func (o *ListAdvisorsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list advisors params -func (o *ListAdvisorsParams) WithHTTPClient(client *http.Client) *ListAdvisorsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list advisors params -func (o *ListAdvisorsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *ListAdvisorsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/api/advisors/v1/json/client/advisor_service/list_advisors_responses.go b/api/advisors/v1/json/client/advisor_service/list_advisors_responses.go deleted file mode 100644 index 4631a560e62..00000000000 --- a/api/advisors/v1/json/client/advisor_service/list_advisors_responses.go +++ /dev/null @@ -1,817 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package advisor_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" -) - -// ListAdvisorsReader is a Reader for the ListAdvisors structure. -type ListAdvisorsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListAdvisorsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewListAdvisorsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewListAdvisorsDefault(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 - } -} - -// NewListAdvisorsOK creates a ListAdvisorsOK with default headers values -func NewListAdvisorsOK() *ListAdvisorsOK { - return &ListAdvisorsOK{} -} - -/* -ListAdvisorsOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type ListAdvisorsOK struct { - Payload *ListAdvisorsOKBody -} - -// IsSuccess returns true when this list advisors Ok response has a 2xx status code -func (o *ListAdvisorsOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this list advisors Ok response has a 3xx status code -func (o *ListAdvisorsOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this list advisors Ok response has a 4xx status code -func (o *ListAdvisorsOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this list advisors Ok response has a 5xx status code -func (o *ListAdvisorsOK) IsServerError() bool { - return false -} - -// IsCode returns true when this list advisors Ok response a status code equal to that given -func (o *ListAdvisorsOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the list advisors Ok response -func (o *ListAdvisorsOK) Code() int { - return 200 -} - -func (o *ListAdvisorsOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/advisors][%d] listAdvisorsOk %s", 200, payload) -} - -func (o *ListAdvisorsOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/advisors][%d] listAdvisorsOk %s", 200, payload) -} - -func (o *ListAdvisorsOK) GetPayload() *ListAdvisorsOKBody { - return o.Payload -} - -func (o *ListAdvisorsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(ListAdvisorsOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -// NewListAdvisorsDefault creates a ListAdvisorsDefault with default headers values -func NewListAdvisorsDefault(code int) *ListAdvisorsDefault { - return &ListAdvisorsDefault{ - _statusCode: code, - } -} - -/* -ListAdvisorsDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type ListAdvisorsDefault struct { - _statusCode int - - Payload *ListAdvisorsDefaultBody -} - -// IsSuccess returns true when this list advisors default response has a 2xx status code -func (o *ListAdvisorsDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this list advisors default response has a 3xx status code -func (o *ListAdvisorsDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this list advisors default response has a 4xx status code -func (o *ListAdvisorsDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this list advisors default response has a 5xx status code -func (o *ListAdvisorsDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this list advisors default response a status code equal to that given -func (o *ListAdvisorsDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the list advisors default response -func (o *ListAdvisorsDefault) Code() int { - return o._statusCode -} - -func (o *ListAdvisorsDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/advisors][%d] ListAdvisors default %s", o._statusCode, payload) -} - -func (o *ListAdvisorsDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/advisors][%d] ListAdvisors default %s", o._statusCode, payload) -} - -func (o *ListAdvisorsDefault) GetPayload() *ListAdvisorsDefaultBody { - return o.Payload -} - -func (o *ListAdvisorsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(ListAdvisorsDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -ListAdvisorsDefaultBody list advisors default body -swagger:model ListAdvisorsDefaultBody -*/ -type ListAdvisorsDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*ListAdvisorsDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this list advisors default body -func (o *ListAdvisorsDefaultBody) 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 *ListAdvisorsDefaultBody) 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("ListAdvisors default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("ListAdvisors default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this list advisors default body based on the context it is used -func (o *ListAdvisorsDefaultBody) 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 *ListAdvisorsDefaultBody) 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("ListAdvisors default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("ListAdvisors default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListAdvisorsDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAdvisorsDefaultBody) UnmarshalBinary(b []byte) error { - var res ListAdvisorsDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListAdvisorsDefaultBodyDetailsItems0 list advisors default body details items0 -swagger:model ListAdvisorsDefaultBodyDetailsItems0 -*/ -type ListAdvisorsDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` - - // list advisors default body details items0 - ListAdvisorsDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *ListAdvisorsDefaultBodyDetailsItems0) 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 ListAdvisorsDefaultBodyDetailsItems0 - - 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.ListAdvisorsDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o ListAdvisorsDefaultBodyDetailsItems0) 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.ListAdvisorsDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.ListAdvisorsDefaultBodyDetailsItems0) - 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 list advisors default body details items0 -func (o *ListAdvisorsDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list advisors default body details items0 based on context it is used -func (o *ListAdvisorsDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListAdvisorsDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAdvisorsDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res ListAdvisorsDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListAdvisorsOKBody list advisors OK body -swagger:model ListAdvisorsOKBody -*/ -type ListAdvisorsOKBody struct { - // advisors - Advisors []*ListAdvisorsOKBodyAdvisorsItems0 `json:"advisors"` -} - -// Validate validates this list advisors OK body -func (o *ListAdvisorsOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateAdvisors(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListAdvisorsOKBody) validateAdvisors(formats strfmt.Registry) error { - if swag.IsZero(o.Advisors) { // not required - return nil - } - - for i := 0; i < len(o.Advisors); i++ { - if swag.IsZero(o.Advisors[i]) { // not required - continue - } - - if o.Advisors[i] != nil { - if err := o.Advisors[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listAdvisorsOk" + "." + "advisors" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listAdvisorsOk" + "." + "advisors" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this list advisors OK body based on the context it is used -func (o *ListAdvisorsOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateAdvisors(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListAdvisorsOKBody) contextValidateAdvisors(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Advisors); i++ { - if o.Advisors[i] != nil { - - if swag.IsZero(o.Advisors[i]) { // not required - return nil - } - - if err := o.Advisors[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listAdvisorsOk" + "." + "advisors" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listAdvisorsOk" + "." + "advisors" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListAdvisorsOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAdvisorsOKBody) UnmarshalBinary(b []byte) error { - var res ListAdvisorsOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListAdvisorsOKBodyAdvisorsItems0 list advisors OK body advisors items0 -swagger:model ListAdvisorsOKBodyAdvisorsItems0 -*/ -type ListAdvisorsOKBodyAdvisorsItems0 struct { - // Machine-readable name (ID) that is used in expression. - Name string `json:"name,omitempty"` - - // Long human-readable description. - Description string `json:"description,omitempty"` - - // Short human-readable summary. - Summary string `json:"summary,omitempty"` - - // Comment. - Comment string `json:"comment,omitempty"` - - // Category. - Category string `json:"category,omitempty"` - - // Advisor checks. - Checks []*ListAdvisorsOKBodyAdvisorsItems0ChecksItems0 `json:"checks"` -} - -// Validate validates this list advisors OK body advisors items0 -func (o *ListAdvisorsOKBodyAdvisorsItems0) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateChecks(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListAdvisorsOKBodyAdvisorsItems0) validateChecks(formats strfmt.Registry) error { - if swag.IsZero(o.Checks) { // not required - return nil - } - - for i := 0; i < len(o.Checks); i++ { - if swag.IsZero(o.Checks[i]) { // not required - continue - } - - if o.Checks[i] != nil { - if err := o.Checks[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("checks" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("checks" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this list advisors OK body advisors items0 based on the context it is used -func (o *ListAdvisorsOKBodyAdvisorsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateChecks(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListAdvisorsOKBodyAdvisorsItems0) contextValidateChecks(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Checks); i++ { - if o.Checks[i] != nil { - - if swag.IsZero(o.Checks[i]) { // not required - return nil - } - - if err := o.Checks[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("checks" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("checks" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListAdvisorsOKBodyAdvisorsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAdvisorsOKBodyAdvisorsItems0) UnmarshalBinary(b []byte) error { - var res ListAdvisorsOKBodyAdvisorsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListAdvisorsOKBodyAdvisorsItems0ChecksItems0 AdvisorCheck contains check name and status. -swagger:model ListAdvisorsOKBodyAdvisorsItems0ChecksItems0 -*/ -type ListAdvisorsOKBodyAdvisorsItems0ChecksItems0 struct { - // Machine-readable name (ID) that is used in expression. - Name string `json:"name,omitempty"` - - // True if that check is enabled. - Enabled bool `json:"enabled,omitempty"` - - // Long human-readable description. - Description string `json:"description,omitempty"` - - // Short human-readable summary. - Summary string `json:"summary,omitempty"` - - // AdvisorCheckInterval represents possible execution interval values for checks. - // Enum: ["ADVISOR_CHECK_INTERVAL_UNSPECIFIED","ADVISOR_CHECK_INTERVAL_STANDARD","ADVISOR_CHECK_INTERVAL_FREQUENT","ADVISOR_CHECK_INTERVAL_RARE"] - Interval *string `json:"interval,omitempty"` - - // family - // Enum: ["ADVISOR_CHECK_FAMILY_UNSPECIFIED","ADVISOR_CHECK_FAMILY_MYSQL","ADVISOR_CHECK_FAMILY_POSTGRESQL","ADVISOR_CHECK_FAMILY_MONGODB"] - Family *string `json:"family,omitempty"` -} - -// Validate validates this list advisors OK body advisors items0 checks items0 -func (o *ListAdvisorsOKBodyAdvisorsItems0ChecksItems0) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateInterval(formats); err != nil { - res = append(res, err) - } - - if err := o.validateFamily(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var listAdvisorsOkBodyAdvisorsItems0ChecksItems0TypeIntervalPropEnum []any - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["ADVISOR_CHECK_INTERVAL_UNSPECIFIED","ADVISOR_CHECK_INTERVAL_STANDARD","ADVISOR_CHECK_INTERVAL_FREQUENT","ADVISOR_CHECK_INTERVAL_RARE"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - listAdvisorsOkBodyAdvisorsItems0ChecksItems0TypeIntervalPropEnum = append(listAdvisorsOkBodyAdvisorsItems0ChecksItems0TypeIntervalPropEnum, v) - } -} - -const ( - - // ListAdvisorsOKBodyAdvisorsItems0ChecksItems0IntervalADVISORCHECKINTERVALUNSPECIFIED captures enum value "ADVISOR_CHECK_INTERVAL_UNSPECIFIED" - ListAdvisorsOKBodyAdvisorsItems0ChecksItems0IntervalADVISORCHECKINTERVALUNSPECIFIED string = "ADVISOR_CHECK_INTERVAL_UNSPECIFIED" - - // ListAdvisorsOKBodyAdvisorsItems0ChecksItems0IntervalADVISORCHECKINTERVALSTANDARD captures enum value "ADVISOR_CHECK_INTERVAL_STANDARD" - ListAdvisorsOKBodyAdvisorsItems0ChecksItems0IntervalADVISORCHECKINTERVALSTANDARD string = "ADVISOR_CHECK_INTERVAL_STANDARD" - - // ListAdvisorsOKBodyAdvisorsItems0ChecksItems0IntervalADVISORCHECKINTERVALFREQUENT captures enum value "ADVISOR_CHECK_INTERVAL_FREQUENT" - ListAdvisorsOKBodyAdvisorsItems0ChecksItems0IntervalADVISORCHECKINTERVALFREQUENT string = "ADVISOR_CHECK_INTERVAL_FREQUENT" - - // ListAdvisorsOKBodyAdvisorsItems0ChecksItems0IntervalADVISORCHECKINTERVALRARE captures enum value "ADVISOR_CHECK_INTERVAL_RARE" - ListAdvisorsOKBodyAdvisorsItems0ChecksItems0IntervalADVISORCHECKINTERVALRARE string = "ADVISOR_CHECK_INTERVAL_RARE" -) - -// prop value enum -func (o *ListAdvisorsOKBodyAdvisorsItems0ChecksItems0) validateIntervalEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, listAdvisorsOkBodyAdvisorsItems0ChecksItems0TypeIntervalPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ListAdvisorsOKBodyAdvisorsItems0ChecksItems0) validateInterval(formats strfmt.Registry) error { - if swag.IsZero(o.Interval) { // not required - return nil - } - - // value enum - if err := o.validateIntervalEnum("interval", "body", *o.Interval); err != nil { - return err - } - - return nil -} - -var listAdvisorsOkBodyAdvisorsItems0ChecksItems0TypeFamilyPropEnum []any - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["ADVISOR_CHECK_FAMILY_UNSPECIFIED","ADVISOR_CHECK_FAMILY_MYSQL","ADVISOR_CHECK_FAMILY_POSTGRESQL","ADVISOR_CHECK_FAMILY_MONGODB"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - listAdvisorsOkBodyAdvisorsItems0ChecksItems0TypeFamilyPropEnum = append(listAdvisorsOkBodyAdvisorsItems0ChecksItems0TypeFamilyPropEnum, v) - } -} - -const ( - - // ListAdvisorsOKBodyAdvisorsItems0ChecksItems0FamilyADVISORCHECKFAMILYUNSPECIFIED captures enum value "ADVISOR_CHECK_FAMILY_UNSPECIFIED" - ListAdvisorsOKBodyAdvisorsItems0ChecksItems0FamilyADVISORCHECKFAMILYUNSPECIFIED string = "ADVISOR_CHECK_FAMILY_UNSPECIFIED" - - // ListAdvisorsOKBodyAdvisorsItems0ChecksItems0FamilyADVISORCHECKFAMILYMYSQL captures enum value "ADVISOR_CHECK_FAMILY_MYSQL" - ListAdvisorsOKBodyAdvisorsItems0ChecksItems0FamilyADVISORCHECKFAMILYMYSQL string = "ADVISOR_CHECK_FAMILY_MYSQL" - - // ListAdvisorsOKBodyAdvisorsItems0ChecksItems0FamilyADVISORCHECKFAMILYPOSTGRESQL captures enum value "ADVISOR_CHECK_FAMILY_POSTGRESQL" - ListAdvisorsOKBodyAdvisorsItems0ChecksItems0FamilyADVISORCHECKFAMILYPOSTGRESQL string = "ADVISOR_CHECK_FAMILY_POSTGRESQL" - - // ListAdvisorsOKBodyAdvisorsItems0ChecksItems0FamilyADVISORCHECKFAMILYMONGODB captures enum value "ADVISOR_CHECK_FAMILY_MONGODB" - ListAdvisorsOKBodyAdvisorsItems0ChecksItems0FamilyADVISORCHECKFAMILYMONGODB string = "ADVISOR_CHECK_FAMILY_MONGODB" -) - -// prop value enum -func (o *ListAdvisorsOKBodyAdvisorsItems0ChecksItems0) validateFamilyEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, listAdvisorsOkBodyAdvisorsItems0ChecksItems0TypeFamilyPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ListAdvisorsOKBodyAdvisorsItems0ChecksItems0) validateFamily(formats strfmt.Registry) error { - if swag.IsZero(o.Family) { // not required - return nil - } - - // value enum - if err := o.validateFamilyEnum("family", "body", *o.Family); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this list advisors OK body advisors items0 checks items0 based on context it is used -func (o *ListAdvisorsOKBodyAdvisorsItems0ChecksItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListAdvisorsOKBodyAdvisorsItems0ChecksItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAdvisorsOKBodyAdvisorsItems0ChecksItems0) UnmarshalBinary(b []byte) error { - var res ListAdvisorsOKBodyAdvisorsItems0ChecksItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/advisors/v1/json/client/advisor_service/list_failed_services_parameters.go b/api/advisors/v1/json/client/advisor_service/list_failed_services_parameters.go deleted file mode 100644 index 7b386ac01a3..00000000000 --- a/api/advisors/v1/json/client/advisor_service/list_failed_services_parameters.go +++ /dev/null @@ -1,127 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package advisor_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" -) - -// NewListFailedServicesParams creates a new ListFailedServicesParams 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 NewListFailedServicesParams() *ListFailedServicesParams { - return &ListFailedServicesParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListFailedServicesParamsWithTimeout creates a new ListFailedServicesParams object -// with the ability to set a timeout on a request. -func NewListFailedServicesParamsWithTimeout(timeout time.Duration) *ListFailedServicesParams { - return &ListFailedServicesParams{ - timeout: timeout, - } -} - -// NewListFailedServicesParamsWithContext creates a new ListFailedServicesParams object -// with the ability to set a context for a request. -func NewListFailedServicesParamsWithContext(ctx context.Context) *ListFailedServicesParams { - return &ListFailedServicesParams{ - Context: ctx, - } -} - -// NewListFailedServicesParamsWithHTTPClient creates a new ListFailedServicesParams object -// with the ability to set a custom HTTPClient for a request. -func NewListFailedServicesParamsWithHTTPClient(client *http.Client) *ListFailedServicesParams { - return &ListFailedServicesParams{ - HTTPClient: client, - } -} - -/* -ListFailedServicesParams contains all the parameters to send to the API endpoint - - for the list failed services operation. - - Typically these are written to a http.Request. -*/ -type ListFailedServicesParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list failed services params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListFailedServicesParams) WithDefaults() *ListFailedServicesParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list failed services params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListFailedServicesParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list failed services params -func (o *ListFailedServicesParams) WithTimeout(timeout time.Duration) *ListFailedServicesParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list failed services params -func (o *ListFailedServicesParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list failed services params -func (o *ListFailedServicesParams) WithContext(ctx context.Context) *ListFailedServicesParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list failed services params -func (o *ListFailedServicesParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list failed services params -func (o *ListFailedServicesParams) WithHTTPClient(client *http.Client) *ListFailedServicesParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list failed services params -func (o *ListFailedServicesParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *ListFailedServicesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/api/advisors/v1/json/client/advisor_service/list_failed_services_responses.go b/api/advisors/v1/json/client/advisor_service/list_failed_services_responses.go deleted file mode 100644 index f8a8531e45e..00000000000 --- a/api/advisors/v1/json/client/advisor_service/list_failed_services_responses.go +++ /dev/null @@ -1,591 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package advisor_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" -) - -// ListFailedServicesReader is a Reader for the ListFailedServices structure. -type ListFailedServicesReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListFailedServicesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewListFailedServicesOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewListFailedServicesDefault(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 - } -} - -// NewListFailedServicesOK creates a ListFailedServicesOK with default headers values -func NewListFailedServicesOK() *ListFailedServicesOK { - return &ListFailedServicesOK{} -} - -/* -ListFailedServicesOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type ListFailedServicesOK struct { - Payload *ListFailedServicesOKBody -} - -// IsSuccess returns true when this list failed services Ok response has a 2xx status code -func (o *ListFailedServicesOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this list failed services Ok response has a 3xx status code -func (o *ListFailedServicesOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this list failed services Ok response has a 4xx status code -func (o *ListFailedServicesOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this list failed services Ok response has a 5xx status code -func (o *ListFailedServicesOK) IsServerError() bool { - return false -} - -// IsCode returns true when this list failed services Ok response a status code equal to that given -func (o *ListFailedServicesOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the list failed services Ok response -func (o *ListFailedServicesOK) Code() int { - return 200 -} - -func (o *ListFailedServicesOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/advisors/failedServices][%d] listFailedServicesOk %s", 200, payload) -} - -func (o *ListFailedServicesOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/advisors/failedServices][%d] listFailedServicesOk %s", 200, payload) -} - -func (o *ListFailedServicesOK) GetPayload() *ListFailedServicesOKBody { - return o.Payload -} - -func (o *ListFailedServicesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(ListFailedServicesOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -// NewListFailedServicesDefault creates a ListFailedServicesDefault with default headers values -func NewListFailedServicesDefault(code int) *ListFailedServicesDefault { - return &ListFailedServicesDefault{ - _statusCode: code, - } -} - -/* -ListFailedServicesDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type ListFailedServicesDefault struct { - _statusCode int - - Payload *ListFailedServicesDefaultBody -} - -// IsSuccess returns true when this list failed services default response has a 2xx status code -func (o *ListFailedServicesDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this list failed services default response has a 3xx status code -func (o *ListFailedServicesDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this list failed services default response has a 4xx status code -func (o *ListFailedServicesDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this list failed services default response has a 5xx status code -func (o *ListFailedServicesDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this list failed services default response a status code equal to that given -func (o *ListFailedServicesDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the list failed services default response -func (o *ListFailedServicesDefault) Code() int { - return o._statusCode -} - -func (o *ListFailedServicesDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/advisors/failedServices][%d] ListFailedServices default %s", o._statusCode, payload) -} - -func (o *ListFailedServicesDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/advisors/failedServices][%d] ListFailedServices default %s", o._statusCode, payload) -} - -func (o *ListFailedServicesDefault) GetPayload() *ListFailedServicesDefaultBody { - return o.Payload -} - -func (o *ListFailedServicesDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(ListFailedServicesDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -ListFailedServicesDefaultBody list failed services default body -swagger:model ListFailedServicesDefaultBody -*/ -type ListFailedServicesDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*ListFailedServicesDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this list failed services default body -func (o *ListFailedServicesDefaultBody) 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 *ListFailedServicesDefaultBody) 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("ListFailedServices default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("ListFailedServices default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this list failed services default body based on the context it is used -func (o *ListFailedServicesDefaultBody) 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 *ListFailedServicesDefaultBody) 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("ListFailedServices default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("ListFailedServices default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListFailedServicesDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListFailedServicesDefaultBody) UnmarshalBinary(b []byte) error { - var res ListFailedServicesDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListFailedServicesDefaultBodyDetailsItems0 list failed services default body details items0 -swagger:model ListFailedServicesDefaultBodyDetailsItems0 -*/ -type ListFailedServicesDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` - - // list failed services default body details items0 - ListFailedServicesDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *ListFailedServicesDefaultBodyDetailsItems0) 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 ListFailedServicesDefaultBodyDetailsItems0 - - 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.ListFailedServicesDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o ListFailedServicesDefaultBodyDetailsItems0) 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.ListFailedServicesDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.ListFailedServicesDefaultBodyDetailsItems0) - 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 list failed services default body details items0 -func (o *ListFailedServicesDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list failed services default body details items0 based on context it is used -func (o *ListFailedServicesDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListFailedServicesDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListFailedServicesDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res ListFailedServicesDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListFailedServicesOKBody list failed services OK body -swagger:model ListFailedServicesOKBody -*/ -type ListFailedServicesOKBody struct { - // result - Result []*ListFailedServicesOKBodyResultItems0 `json:"result"` -} - -// Validate validates this list failed services OK body -func (o *ListFailedServicesOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateResult(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListFailedServicesOKBody) validateResult(formats strfmt.Registry) error { - if swag.IsZero(o.Result) { // not required - return nil - } - - for i := 0; i < len(o.Result); i++ { - if swag.IsZero(o.Result[i]) { // not required - continue - } - - if o.Result[i] != nil { - if err := o.Result[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listFailedServicesOk" + "." + "result" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listFailedServicesOk" + "." + "result" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this list failed services OK body based on the context it is used -func (o *ListFailedServicesOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateResult(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListFailedServicesOKBody) contextValidateResult(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Result); i++ { - if o.Result[i] != nil { - - if swag.IsZero(o.Result[i]) { // not required - return nil - } - - if err := o.Result[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listFailedServicesOk" + "." + "result" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listFailedServicesOk" + "." + "result" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListFailedServicesOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListFailedServicesOKBody) UnmarshalBinary(b []byte) error { - var res ListFailedServicesOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListFailedServicesOKBodyResultItems0 CheckResultSummary is a summary of check results. -swagger:model ListFailedServicesOKBodyResultItems0 -*/ -type ListFailedServicesOKBodyResultItems0 struct { - // service name - ServiceName string `json:"service_name,omitempty"` - - // service id - ServiceID string `json:"service_id,omitempty"` - - // Number of failed checks for this service with severity level "EMERGENCY". - EmergencyCount int64 `json:"emergency_count,omitempty"` - - // Number of failed checks for this service with severity level "ALERT". - AlertCount int64 `json:"alert_count,omitempty"` - - // Number of failed checks for this service with severity level "CRITICAL". - CriticalCount int64 `json:"critical_count,omitempty"` - - // Number of failed checks for this service with severity level "ERROR". - ErrorCount int64 `json:"error_count,omitempty"` - - // Number of failed checks for this service with severity level "WARNING". - WarningCount int64 `json:"warning_count,omitempty"` - - // Number of failed checks for this service with severity level "NOTICE". - NoticeCount int64 `json:"notice_count,omitempty"` - - // Number of failed checks for this service with severity level "INFO". - InfoCount int64 `json:"info_count,omitempty"` - - // Number of failed checks for this service with severity level "DEBUG". - DebugCount int64 `json:"debug_count,omitempty"` -} - -// Validate validates this list failed services OK body result items0 -func (o *ListFailedServicesOKBodyResultItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list failed services OK body result items0 based on context it is used -func (o *ListFailedServicesOKBodyResultItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListFailedServicesOKBodyResultItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListFailedServicesOKBodyResultItems0) UnmarshalBinary(b []byte) error { - var res ListFailedServicesOKBodyResultItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/advisors/v1/json/client/advisor_service/start_advisor_checks_parameters.go b/api/advisors/v1/json/client/advisor_service/start_advisor_checks_parameters.go deleted file mode 100644 index 879f8418f64..00000000000 --- a/api/advisors/v1/json/client/advisor_service/start_advisor_checks_parameters.go +++ /dev/null @@ -1,144 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package advisor_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" -) - -// NewStartAdvisorChecksParams creates a new StartAdvisorChecksParams 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 NewStartAdvisorChecksParams() *StartAdvisorChecksParams { - return &StartAdvisorChecksParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewStartAdvisorChecksParamsWithTimeout creates a new StartAdvisorChecksParams object -// with the ability to set a timeout on a request. -func NewStartAdvisorChecksParamsWithTimeout(timeout time.Duration) *StartAdvisorChecksParams { - return &StartAdvisorChecksParams{ - timeout: timeout, - } -} - -// NewStartAdvisorChecksParamsWithContext creates a new StartAdvisorChecksParams object -// with the ability to set a context for a request. -func NewStartAdvisorChecksParamsWithContext(ctx context.Context) *StartAdvisorChecksParams { - return &StartAdvisorChecksParams{ - Context: ctx, - } -} - -// NewStartAdvisorChecksParamsWithHTTPClient creates a new StartAdvisorChecksParams object -// with the ability to set a custom HTTPClient for a request. -func NewStartAdvisorChecksParamsWithHTTPClient(client *http.Client) *StartAdvisorChecksParams { - return &StartAdvisorChecksParams{ - HTTPClient: client, - } -} - -/* -StartAdvisorChecksParams contains all the parameters to send to the API endpoint - - for the start advisor checks operation. - - Typically these are written to a http.Request. -*/ -type StartAdvisorChecksParams struct { - // Body. - Body StartAdvisorChecksBody - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the start advisor checks params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *StartAdvisorChecksParams) WithDefaults() *StartAdvisorChecksParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the start advisor checks params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *StartAdvisorChecksParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the start advisor checks params -func (o *StartAdvisorChecksParams) WithTimeout(timeout time.Duration) *StartAdvisorChecksParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the start advisor checks params -func (o *StartAdvisorChecksParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the start advisor checks params -func (o *StartAdvisorChecksParams) WithContext(ctx context.Context) *StartAdvisorChecksParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the start advisor checks params -func (o *StartAdvisorChecksParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the start advisor checks params -func (o *StartAdvisorChecksParams) WithHTTPClient(client *http.Client) *StartAdvisorChecksParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the start advisor checks params -func (o *StartAdvisorChecksParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the start advisor checks params -func (o *StartAdvisorChecksParams) WithBody(body StartAdvisorChecksBody) *StartAdvisorChecksParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the start advisor checks params -func (o *StartAdvisorChecksParams) SetBody(body StartAdvisorChecksBody) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *StartAdvisorChecksParams) 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/advisors/v1/json/client/advisor_service/start_advisor_checks_responses.go b/api/advisors/v1/json/client/advisor_service/start_advisor_checks_responses.go deleted file mode 100644 index 4fd31464244..00000000000 --- a/api/advisors/v1/json/client/advisor_service/start_advisor_checks_responses.go +++ /dev/null @@ -1,451 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package advisor_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" -) - -// StartAdvisorChecksReader is a Reader for the StartAdvisorChecks structure. -type StartAdvisorChecksReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *StartAdvisorChecksReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewStartAdvisorChecksOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewStartAdvisorChecksDefault(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 - } -} - -// NewStartAdvisorChecksOK creates a StartAdvisorChecksOK with default headers values -func NewStartAdvisorChecksOK() *StartAdvisorChecksOK { - return &StartAdvisorChecksOK{} -} - -/* -StartAdvisorChecksOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type StartAdvisorChecksOK struct { - Payload any -} - -// IsSuccess returns true when this start advisor checks Ok response has a 2xx status code -func (o *StartAdvisorChecksOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this start advisor checks Ok response has a 3xx status code -func (o *StartAdvisorChecksOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this start advisor checks Ok response has a 4xx status code -func (o *StartAdvisorChecksOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this start advisor checks Ok response has a 5xx status code -func (o *StartAdvisorChecksOK) IsServerError() bool { - return false -} - -// IsCode returns true when this start advisor checks Ok response a status code equal to that given -func (o *StartAdvisorChecksOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the start advisor checks Ok response -func (o *StartAdvisorChecksOK) Code() int { - return 200 -} - -func (o *StartAdvisorChecksOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/advisors/checks:start][%d] startAdvisorChecksOk %s", 200, payload) -} - -func (o *StartAdvisorChecksOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/advisors/checks:start][%d] startAdvisorChecksOk %s", 200, payload) -} - -func (o *StartAdvisorChecksOK) GetPayload() any { - return o.Payload -} - -func (o *StartAdvisorChecksOK) 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) { - return err - } - - return nil -} - -// NewStartAdvisorChecksDefault creates a StartAdvisorChecksDefault with default headers values -func NewStartAdvisorChecksDefault(code int) *StartAdvisorChecksDefault { - return &StartAdvisorChecksDefault{ - _statusCode: code, - } -} - -/* -StartAdvisorChecksDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type StartAdvisorChecksDefault struct { - _statusCode int - - Payload *StartAdvisorChecksDefaultBody -} - -// IsSuccess returns true when this start advisor checks default response has a 2xx status code -func (o *StartAdvisorChecksDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this start advisor checks default response has a 3xx status code -func (o *StartAdvisorChecksDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this start advisor checks default response has a 4xx status code -func (o *StartAdvisorChecksDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this start advisor checks default response has a 5xx status code -func (o *StartAdvisorChecksDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this start advisor checks default response a status code equal to that given -func (o *StartAdvisorChecksDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the start advisor checks default response -func (o *StartAdvisorChecksDefault) Code() int { - return o._statusCode -} - -func (o *StartAdvisorChecksDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/advisors/checks:start][%d] StartAdvisorChecks default %s", o._statusCode, payload) -} - -func (o *StartAdvisorChecksDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/advisors/checks:start][%d] StartAdvisorChecks default %s", o._statusCode, payload) -} - -func (o *StartAdvisorChecksDefault) GetPayload() *StartAdvisorChecksDefaultBody { - return o.Payload -} - -func (o *StartAdvisorChecksDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(StartAdvisorChecksDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -StartAdvisorChecksBody start advisor checks body -swagger:model StartAdvisorChecksBody -*/ -type StartAdvisorChecksBody struct { - // Names of the checks that should be started. - Names []string `json:"names"` -} - -// Validate validates this start advisor checks body -func (o *StartAdvisorChecksBody) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this start advisor checks body based on context it is used -func (o *StartAdvisorChecksBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *StartAdvisorChecksBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *StartAdvisorChecksBody) UnmarshalBinary(b []byte) error { - var res StartAdvisorChecksBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -StartAdvisorChecksDefaultBody start advisor checks default body -swagger:model StartAdvisorChecksDefaultBody -*/ -type StartAdvisorChecksDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*StartAdvisorChecksDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this start advisor checks default body -func (o *StartAdvisorChecksDefaultBody) 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 *StartAdvisorChecksDefaultBody) 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("StartAdvisorChecks default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("StartAdvisorChecks default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this start advisor checks default body based on the context it is used -func (o *StartAdvisorChecksDefaultBody) 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 *StartAdvisorChecksDefaultBody) 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("StartAdvisorChecks default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("StartAdvisorChecks default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *StartAdvisorChecksDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *StartAdvisorChecksDefaultBody) UnmarshalBinary(b []byte) error { - var res StartAdvisorChecksDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -StartAdvisorChecksDefaultBodyDetailsItems0 start advisor checks default body details items0 -swagger:model StartAdvisorChecksDefaultBodyDetailsItems0 -*/ -type StartAdvisorChecksDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` - - // start advisor checks default body details items0 - StartAdvisorChecksDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *StartAdvisorChecksDefaultBodyDetailsItems0) 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 StartAdvisorChecksDefaultBodyDetailsItems0 - - 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.StartAdvisorChecksDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o StartAdvisorChecksDefaultBodyDetailsItems0) 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.StartAdvisorChecksDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.StartAdvisorChecksDefaultBodyDetailsItems0) - 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 start advisor checks default body details items0 -func (o *StartAdvisorChecksDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this start advisor checks default body details items0 based on context it is used -func (o *StartAdvisorChecksDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *StartAdvisorChecksDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *StartAdvisorChecksDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res StartAdvisorChecksDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/advisors/v1/json/client/pmm_advisor_api_client.go b/api/advisors/v1/json/client/pmm_advisor_api_client.go deleted file mode 100644 index c92ee7940c9..00000000000 --- a/api/advisors/v1/json/client/pmm_advisor_api_client.go +++ /dev/null @@ -1,112 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package client - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/percona/pmm/api/advisors/v1/json/client/advisor_service" -) - -// Default PMM advisor API HTTP client. -var Default = NewHTTPClient(nil) - -const ( - // DefaultHost is the default Host - // found in Meta (info) section of spec file - DefaultHost string = "localhost" - // DefaultBasePath is the default BasePath - // found in Meta (info) section of spec file - DefaultBasePath string = "/" -) - -// DefaultSchemes are the default schemes found in Meta (info) section of spec file -var DefaultSchemes = []string{"http", "https"} - -// NewHTTPClient creates a new PMM advisor API HTTP client. -func NewHTTPClient(formats strfmt.Registry) *PMMAdvisorAPI { - return NewHTTPClientWithConfig(formats, nil) -} - -// NewHTTPClientWithConfig creates a new PMM advisor API HTTP client, -// using a customizable transport config. -func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *PMMAdvisorAPI { - // ensure nullable parameters have default - if cfg == nil { - cfg = DefaultTransportConfig() - } - - // create transport and client - transport := httptransport.New(cfg.Host, cfg.BasePath, cfg.Schemes) - return New(transport, formats) -} - -// New creates a new PMM advisor API client -func New(transport runtime.ClientTransport, formats strfmt.Registry) *PMMAdvisorAPI { - // ensure nullable parameters have default - if formats == nil { - formats = strfmt.Default - } - - cli := new(PMMAdvisorAPI) - cli.Transport = transport - cli.AdvisorService = advisor_service.New(transport, formats) - return cli -} - -// DefaultTransportConfig creates a TransportConfig with the -// default settings taken from the meta section of the spec file. -func DefaultTransportConfig() *TransportConfig { - return &TransportConfig{ - Host: DefaultHost, - BasePath: DefaultBasePath, - Schemes: DefaultSchemes, - } -} - -// TransportConfig contains the transport related info, -// found in the meta section of the spec file. -type TransportConfig struct { - Host string - BasePath string - Schemes []string -} - -// WithHost overrides the default host, -// provided by the meta section of the spec file. -func (cfg *TransportConfig) WithHost(host string) *TransportConfig { - cfg.Host = host - return cfg -} - -// WithBasePath overrides the default basePath, -// provided by the meta section of the spec file. -func (cfg *TransportConfig) WithBasePath(basePath string) *TransportConfig { - cfg.BasePath = basePath - return cfg -} - -// WithSchemes overrides the default schemes, -// provided by the meta section of the spec file. -func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig { - cfg.Schemes = schemes - return cfg -} - -// PMMAdvisorAPI is a client for PMM advisor API -type PMMAdvisorAPI struct { - AdvisorService advisor_service.ClientService - - Transport runtime.ClientTransport -} - -// SetTransport changes the transport on the client and all its subresources -func (c *PMMAdvisorAPI) SetTransport(transport runtime.ClientTransport) { - c.Transport = transport - c.AdvisorService.SetTransport(transport) -} diff --git a/api/advisors/v1/json/v1.json b/api/advisors/v1/json/v1.json deleted file mode 100644 index c14828b864b..00000000000 --- a/api/advisors/v1/json/v1.json +++ /dev/null @@ -1,699 +0,0 @@ -{ - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "schemes": [ - "https", - "http" - ], - "swagger": "2.0", - "info": { - "title": "PMM Advisor API", - "version": "v1" - }, - "paths": { - "/v1/advisors": { - "get": { - "description": "List advisors available to the user.", - "tags": [ - "AdvisorService" - ], - "summary": "List Advisors", - "operationId": "ListAdvisors", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "advisors": { - "type": "array", - "items": { - "type": "object", - "properties": { - "name": { - "description": "Machine-readable name (ID) that is used in expression.", - "type": "string", - "x-order": 0 - }, - "description": { - "description": "Long human-readable description.", - "type": "string", - "x-order": 1 - }, - "summary": { - "description": "Short human-readable summary.", - "type": "string", - "x-order": 2 - }, - "comment": { - "description": "Comment.", - "type": "string", - "x-order": 3 - }, - "category": { - "description": "Category.", - "type": "string", - "x-order": 4 - }, - "checks": { - "description": "Advisor checks.", - "type": "array", - "items": { - "description": "AdvisorCheck contains check name and status.", - "type": "object", - "properties": { - "name": { - "description": "Machine-readable name (ID) that is used in expression.", - "type": "string", - "x-order": 0 - }, - "enabled": { - "description": "True if that check is enabled.", - "type": "boolean", - "x-order": 1 - }, - "description": { - "description": "Long human-readable description.", - "type": "string", - "x-order": 2 - }, - "summary": { - "description": "Short human-readable summary.", - "type": "string", - "x-order": 3 - }, - "interval": { - "description": "AdvisorCheckInterval represents possible execution interval values for checks.", - "type": "string", - "default": "ADVISOR_CHECK_INTERVAL_UNSPECIFIED", - "enum": [ - "ADVISOR_CHECK_INTERVAL_UNSPECIFIED", - "ADVISOR_CHECK_INTERVAL_STANDARD", - "ADVISOR_CHECK_INTERVAL_FREQUENT", - "ADVISOR_CHECK_INTERVAL_RARE" - ], - "x-order": 4 - }, - "family": { - "type": "string", - "default": "ADVISOR_CHECK_FAMILY_UNSPECIFIED", - "enum": [ - "ADVISOR_CHECK_FAMILY_UNSPECIFIED", - "ADVISOR_CHECK_FAMILY_MYSQL", - "ADVISOR_CHECK_FAMILY_POSTGRESQL", - "ADVISOR_CHECK_FAMILY_MONGODB" - ], - "x-order": 5 - } - } - }, - "x-order": 5 - } - } - }, - "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/advisors/checks": { - "get": { - "description": "List advisor checks available to the user.", - "tags": [ - "AdvisorService" - ], - "summary": "List Advisor Checks", - "operationId": "ListAdvisorChecks", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "checks": { - "type": "array", - "items": { - "description": "AdvisorCheck contains check name and status.", - "type": "object", - "properties": { - "name": { - "description": "Machine-readable name (ID) that is used in expression.", - "type": "string", - "x-order": 0 - }, - "enabled": { - "description": "True if that check is enabled.", - "type": "boolean", - "x-order": 1 - }, - "description": { - "description": "Long human-readable description.", - "type": "string", - "x-order": 2 - }, - "summary": { - "description": "Short human-readable summary.", - "type": "string", - "x-order": 3 - }, - "interval": { - "description": "AdvisorCheckInterval represents possible execution interval values for checks.", - "type": "string", - "default": "ADVISOR_CHECK_INTERVAL_UNSPECIFIED", - "enum": [ - "ADVISOR_CHECK_INTERVAL_UNSPECIFIED", - "ADVISOR_CHECK_INTERVAL_STANDARD", - "ADVISOR_CHECK_INTERVAL_FREQUENT", - "ADVISOR_CHECK_INTERVAL_RARE" - ], - "x-order": 4 - }, - "family": { - "type": "string", - "default": "ADVISOR_CHECK_FAMILY_UNSPECIFIED", - "enum": [ - "ADVISOR_CHECK_FAMILY_UNSPECIFIED", - "ADVISOR_CHECK_FAMILY_MYSQL", - "ADVISOR_CHECK_FAMILY_POSTGRESQL", - "ADVISOR_CHECK_FAMILY_MONGODB" - ], - "x-order": 5 - } - } - }, - "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/advisors/checks/failed": { - "get": { - "description": "Returns the latest check results for a given service.", - "tags": [ - "AdvisorService" - ], - "summary": "Get Failed Advisor Checks", - "operationId": "GetFailedChecks", - "parameters": [ - { - "type": "integer", - "format": "int32", - "description": "Maximum number of results per page.", - "name": "page_size", - "in": "query" - }, - { - "type": "integer", - "format": "int32", - "description": "Index of the requested page, starts from 0.", - "name": "page_index", - "in": "query" - }, - { - "type": "string", - "description": "Service ID.", - "name": "service_id", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "total_items": { - "description": "Total number of results.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "total_pages": { - "description": "Total number of pages.", - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "results": { - "type": "array", - "title": "Check results", - "items": { - "description": "CheckResult represents the check results for a given service.", - "type": "object", - "properties": { - "summary": { - "type": "string", - "x-order": 0 - }, - "description": { - "type": "string", - "x-order": 1 - }, - "severity": { - "description": "Severity represents severity level of the check result or alert.", - "type": "string", - "default": "SEVERITY_UNSPECIFIED", - "enum": [ - "SEVERITY_UNSPECIFIED", - "SEVERITY_EMERGENCY", - "SEVERITY_ALERT", - "SEVERITY_CRITICAL", - "SEVERITY_ERROR", - "SEVERITY_WARNING", - "SEVERITY_NOTICE", - "SEVERITY_INFO", - "SEVERITY_DEBUG" - ], - "x-order": 2 - }, - "labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 3 - }, - "read_more_url": { - "description": "URL containing information on how to resolve an issue detected by an Advisor check.", - "type": "string", - "x-order": 4 - }, - "service_name": { - "description": "Name of the monitored service on which the check ran.", - "type": "string", - "x-order": 5 - }, - "service_id": { - "description": "ID of the monitored service on which the check ran.", - "type": "string", - "x-order": 6 - }, - "check_name": { - "type": "string", - "title": "Name of the check that failed", - "x-order": 7 - }, - "silenced": { - "type": "boolean", - "title": "Silence status of the check result", - "x-order": 8 - } - } - }, - "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/advisors/checks:batchChange": { - "post": { - "description": "Enables/disables advisor checks or changes their exec interval.", - "tags": [ - "AdvisorService" - ], - "summary": "Change Advisor Checks", - "operationId": "ChangeAdvisorChecks", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "params": { - "type": "array", - "items": { - "description": "ChangeAdvisorCheckParams specifies a single check parameters.", - "type": "object", - "properties": { - "name": { - "description": "The name of the check to change.", - "type": "string", - "x-order": 0 - }, - "enable": { - "type": "boolean", - "x-nullable": true, - "x-order": 1 - }, - "interval": { - "description": "AdvisorCheckInterval represents possible execution interval values for checks.", - "type": "string", - "default": "ADVISOR_CHECK_INTERVAL_UNSPECIFIED", - "enum": [ - "ADVISOR_CHECK_INTERVAL_UNSPECIFIED", - "ADVISOR_CHECK_INTERVAL_STANDARD", - "ADVISOR_CHECK_INTERVAL_FREQUENT", - "ADVISOR_CHECK_INTERVAL_RARE" - ], - "x-order": 2 - } - } - }, - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/advisors/checks:start": { - "post": { - "description": "Executes Advisor checks and returns when all checks are executed. All available checks will be started if check names aren't specified.", - "tags": [ - "AdvisorService" - ], - "summary": "Start Advisor Checks", - "operationId": "StartAdvisorChecks", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "names": { - "description": "Names of the checks that should be started.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/advisors/failedServices": { - "get": { - "description": "Returns a list of services with failed checks and a summary of check results.", - "tags": [ - "AdvisorService" - ], - "summary": "List Failed Services", - "operationId": "ListFailedServices", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "result": { - "type": "array", - "items": { - "description": "CheckResultSummary is a summary of check results.", - "type": "object", - "properties": { - "service_name": { - "type": "string", - "x-order": 0 - }, - "service_id": { - "type": "string", - "x-order": 1 - }, - "emergency_count": { - "description": "Number of failed checks for this service with severity level \"EMERGENCY\".", - "type": "integer", - "format": "int64", - "x-order": 2 - }, - "alert_count": { - "description": "Number of failed checks for this service with severity level \"ALERT\".", - "type": "integer", - "format": "int64", - "x-order": 3 - }, - "critical_count": { - "description": "Number of failed checks for this service with severity level \"CRITICAL\".", - "type": "integer", - "format": "int64", - "x-order": 4 - }, - "error_count": { - "description": "Number of failed checks for this service with severity level \"ERROR\".", - "type": "integer", - "format": "int64", - "x-order": 5 - }, - "warning_count": { - "description": "Number of failed checks for this service with severity level \"WARNING\".", - "type": "integer", - "format": "int64", - "x-order": 6 - }, - "notice_count": { - "description": "Number of failed checks for this service with severity level \"NOTICE\".", - "type": "integer", - "format": "int64", - "x-order": 7 - }, - "info_count": { - "description": "Number of failed checks for this service with severity level \"INFO\".", - "type": "integer", - "format": "int64", - "x-order": 8 - }, - "debug_count": { - "description": "Number of failed checks for this service with severity level \"DEBUG\".", - "type": "integer", - "format": "int64", - "x-order": 9 - } - } - }, - "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 - } - } - } - } - } - } - } - }, - "tags": [ - { - "name": "AdvisorService" - } - ] -} \ No newline at end of file diff --git a/api/agent/pb/agent.pb.go b/api/agent/pb/agent.pb.go deleted file mode 100644 index a9fe72e238d..00000000000 --- a/api/agent/pb/agent.pb.go +++ /dev/null @@ -1,72 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.10 -// protoc (unknown) -// source: agent/pb/agent.proto - -package pb - -import ( - 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 ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -var File_agent_pb_agent_proto protoreflect.FileDescriptor - -const file_agent_pb_agent_proto_rawDesc = "" + - "\n" + - "\x14agent/pb/agent.proto\x12\x05agent\x1a\x14agent/v1/agent.proto2G\n" + - "\x05Agent\x12>\n" + - "\aConnect\x12\x16.agent.v1.AgentMessage\x1a\x17.agent.v1.ServerMessage(\x010\x01Bp\n" + - "\tcom.agentB\n" + - "AgentProtoP\x01Z#github.com/percona/pmm/api/agent/pb\xa2\x02\x03AXX\xaa\x02\x05Agent\xca\x02\x05Agent\xe2\x02\x11Agent\\GPBMetadata\xea\x02\x05Agentb\x06proto3" - -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 - 1, // [1:2] is the sub-list for method output_type - 0, // [0:1] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_agent_pb_agent_proto_init() } -func file_agent_pb_agent_proto_init() { - if File_agent_pb_agent_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_agent_pb_agent_proto_rawDesc), len(file_agent_pb_agent_proto_rawDesc)), - NumEnums: 0, - NumMessages: 0, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_agent_pb_agent_proto_goTypes, - DependencyIndexes: file_agent_pb_agent_proto_depIdxs, - }.Build() - File_agent_pb_agent_proto = out.File - file_agent_pb_agent_proto_goTypes = nil - file_agent_pb_agent_proto_depIdxs = nil -} diff --git a/api/agent/pb/agent.pb.validate.go b/api/agent/pb/agent.pb.validate.go deleted file mode 100644 index a03b609e6ad..00000000000 --- a/api/agent/pb/agent.pb.validate.go +++ /dev/null @@ -1,36 +0,0 @@ -// Code generated by protoc-gen-validate. DO NOT EDIT. -// source: agent/pb/agent.proto - -package pb - -import ( - "bytes" - "errors" - "fmt" - "net" - "net/mail" - "net/url" - "regexp" - "sort" - "strings" - "time" - "unicode/utf8" - - "google.golang.org/protobuf/types/known/anypb" -) - -// ensure the imports are used -var ( - _ = bytes.MinRead - _ = errors.New("") - _ = fmt.Print - _ = utf8.UTFMax - _ = (*regexp.Regexp)(nil) - _ = (*strings.Reader)(nil) - _ = net.IPv4len - _ = time.Duration(0) - _ = (*url.URL)(nil) - _ = (*mail.Address)(nil) - _ = anypb.Any{} - _ = sort.Sort -) diff --git a/api/agent/pb/agent_grpc.pb.go b/api/agent/pb/agent_grpc.pb.go deleted file mode 100644 index 6755a51892e..00000000000 --- a/api/agent/pb/agent_grpc.pb.go +++ /dev/null @@ -1,124 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.6.0 -// - protoc (unknown) -// source: agent/pb/agent.proto - -package pb - -import ( - context "context" - - 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 -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.64.0 or later. -const _ = grpc.SupportPackageIsVersion9 - -const ( - Agent_Connect_FullMethodName = "/agent.Agent/Connect" -) - -// AgentClient is the client API for Agent service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -// -// Agent service provides private methods for pmm-agent <-> pmm-managed interactions. -type AgentClient interface { - // Connect establishes two-way communication channel between pmm-agent and pmm-managed. - Connect(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[v1.AgentMessage, v1.ServerMessage], error) -} - -type agentClient struct { - cc grpc.ClientConnInterface -} - -func NewAgentClient(cc grpc.ClientConnInterface) AgentClient { - return &agentClient{cc} -} - -func (c *agentClient) Connect(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[v1.AgentMessage, v1.ServerMessage], error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - stream, err := c.cc.NewStream(ctx, &Agent_ServiceDesc.Streams[0], Agent_Connect_FullMethodName, cOpts...) - if err != nil { - return nil, err - } - x := &grpc.GenericClientStream[v1.AgentMessage, v1.ServerMessage]{ClientStream: stream} - return x, nil -} - -// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. -type Agent_ConnectClient = grpc.BidiStreamingClient[v1.AgentMessage, v1.ServerMessage] - -// AgentServer is the server API for Agent service. -// All implementations must embed UnimplementedAgentServer -// for forward compatibility. -// -// Agent service provides private methods for pmm-agent <-> pmm-managed interactions. -type AgentServer interface { - // Connect establishes two-way communication channel between pmm-agent and pmm-managed. - Connect(grpc.BidiStreamingServer[v1.AgentMessage, v1.ServerMessage]) error - mustEmbedUnimplementedAgentServer() -} - -// UnimplementedAgentServer must be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -type UnimplementedAgentServer struct{} - -func (UnimplementedAgentServer) Connect(grpc.BidiStreamingServer[v1.AgentMessage, v1.ServerMessage]) error { - return status.Error(codes.Unimplemented, "method Connect not implemented") -} -func (UnimplementedAgentServer) mustEmbedUnimplementedAgentServer() {} -func (UnimplementedAgentServer) testEmbeddedByValue() {} - -// UnsafeAgentServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to AgentServer will -// result in compilation errors. -type UnsafeAgentServer interface { - mustEmbedUnimplementedAgentServer() -} - -func RegisterAgentServer(s grpc.ServiceRegistrar, srv AgentServer) { - // If the following call panics, it indicates UnimplementedAgentServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } - s.RegisterService(&Agent_ServiceDesc, srv) -} - -func _Agent_Connect_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(AgentServer).Connect(&grpc.GenericServerStream[v1.AgentMessage, v1.ServerMessage]{ServerStream: stream}) -} - -// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. -type Agent_ConnectServer = grpc.BidiStreamingServer[v1.AgentMessage, v1.ServerMessage] - -// Agent_ServiceDesc is the grpc.ServiceDesc for Agent service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var Agent_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "agent.Agent", - HandlerType: (*AgentServer)(nil), - Methods: []grpc.MethodDesc{}, - Streams: []grpc.StreamDesc{ - { - StreamName: "Connect", - Handler: _Agent_Connect_Handler, - ServerStreams: true, - ClientStreams: true, - }, - }, - Metadata: "agent/pb/agent.proto", -} diff --git a/api/agent/v1/agent.pb.go b/api/agent/v1/agent.pb.go deleted file mode 100644 index e6e49e6c279..00000000000 --- a/api/agent/v1/agent.pb.go +++ /dev/null @@ -1,7452 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.10 -// protoc (unknown) -// source: agent/v1/agent.proto - -package agentv1 - -import ( - 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" - - v11 "github.com/percona/pmm/api/backup/v1" - v1 "github.com/percona/pmm/api/inventory/v1" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// MysqlExplainOutputFormat output formats supported by MySQL Explain action. -type MysqlExplainOutputFormat int32 - -const ( - MysqlExplainOutputFormat_MYSQL_EXPLAIN_OUTPUT_FORMAT_UNSPECIFIED MysqlExplainOutputFormat = 0 - // EXPLAIN FORMAT=TRADITIONAL, returns result as text - MysqlExplainOutputFormat_MYSQL_EXPLAIN_OUTPUT_FORMAT_DEFAULT MysqlExplainOutputFormat = 1 - // EXPLAIN FORMAT=JSON - MysqlExplainOutputFormat_MYSQL_EXPLAIN_OUTPUT_FORMAT_JSON MysqlExplainOutputFormat = 2 - // EXPLAIN FORMAT=TRADITIONAL, returns result as JSON - MysqlExplainOutputFormat_MYSQL_EXPLAIN_OUTPUT_FORMAT_TRADITIONAL_JSON MysqlExplainOutputFormat = 3 -) - -// Enum value maps for MysqlExplainOutputFormat. -var ( - MysqlExplainOutputFormat_name = map[int32]string{ - 0: "MYSQL_EXPLAIN_OUTPUT_FORMAT_UNSPECIFIED", - 1: "MYSQL_EXPLAIN_OUTPUT_FORMAT_DEFAULT", - 2: "MYSQL_EXPLAIN_OUTPUT_FORMAT_JSON", - 3: "MYSQL_EXPLAIN_OUTPUT_FORMAT_TRADITIONAL_JSON", - } - MysqlExplainOutputFormat_value = map[string]int32{ - "MYSQL_EXPLAIN_OUTPUT_FORMAT_UNSPECIFIED": 0, - "MYSQL_EXPLAIN_OUTPUT_FORMAT_DEFAULT": 1, - "MYSQL_EXPLAIN_OUTPUT_FORMAT_JSON": 2, - "MYSQL_EXPLAIN_OUTPUT_FORMAT_TRADITIONAL_JSON": 3, - } -) - -func (x MysqlExplainOutputFormat) Enum() *MysqlExplainOutputFormat { - p := new(MysqlExplainOutputFormat) - *p = x - return p -} - -func (x MysqlExplainOutputFormat) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (MysqlExplainOutputFormat) Descriptor() protoreflect.EnumDescriptor { - return file_agent_v1_agent_proto_enumTypes[0].Descriptor() -} - -func (MysqlExplainOutputFormat) Type() protoreflect.EnumType { - return &file_agent_v1_agent_proto_enumTypes[0] -} - -func (x MysqlExplainOutputFormat) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use MysqlExplainOutputFormat.Descriptor instead. -func (MysqlExplainOutputFormat) EnumDescriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{0} -} - -// SystemService is a systemctl service that can be restarted from PMM server -type StartActionRequest_RestartSystemServiceParams_SystemService int32 - -const ( - StartActionRequest_RestartSystemServiceParams_SYSTEM_SERVICE_UNSPECIFIED StartActionRequest_RestartSystemServiceParams_SystemService = 0 - StartActionRequest_RestartSystemServiceParams_SYSTEM_SERVICE_MONGOD StartActionRequest_RestartSystemServiceParams_SystemService = 1 - StartActionRequest_RestartSystemServiceParams_SYSTEM_SERVICE_PBM_AGENT StartActionRequest_RestartSystemServiceParams_SystemService = 2 -) - -// Enum value maps for StartActionRequest_RestartSystemServiceParams_SystemService. -var ( - StartActionRequest_RestartSystemServiceParams_SystemService_name = map[int32]string{ - 0: "SYSTEM_SERVICE_UNSPECIFIED", - 1: "SYSTEM_SERVICE_MONGOD", - 2: "SYSTEM_SERVICE_PBM_AGENT", - } - StartActionRequest_RestartSystemServiceParams_SystemService_value = map[string]int32{ - "SYSTEM_SERVICE_UNSPECIFIED": 0, - "SYSTEM_SERVICE_MONGOD": 1, - "SYSTEM_SERVICE_PBM_AGENT": 2, - } -) - -func (x StartActionRequest_RestartSystemServiceParams_SystemService) Enum() *StartActionRequest_RestartSystemServiceParams_SystemService { - p := new(StartActionRequest_RestartSystemServiceParams_SystemService) - *p = x - return p -} - -func (x StartActionRequest_RestartSystemServiceParams_SystemService) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (StartActionRequest_RestartSystemServiceParams_SystemService) Descriptor() protoreflect.EnumDescriptor { - return file_agent_v1_agent_proto_enumTypes[1].Descriptor() -} - -func (StartActionRequest_RestartSystemServiceParams_SystemService) Type() protoreflect.EnumType { - return &file_agent_v1_agent_proto_enumTypes[1] -} - -func (x StartActionRequest_RestartSystemServiceParams_SystemService) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use StartActionRequest_RestartSystemServiceParams_SystemService.Descriptor instead. -func (StartActionRequest_RestartSystemServiceParams_SystemService) EnumDescriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{14, 20, 0} -} - -// TextFiles contains files which can be used to connect to DB (certificates, keys and etc). -type TextFiles struct { - state protoimpl.MessageState `protogen:"open.v1"` - // files contains files which can be used to connect to DB (certificates, keys and etc). - Files map[string]string `protobuf:"bytes,1,rep,name=files,proto3" json:"files,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - // template_left_delim is used to replace placeholders in templates (DSN and etc.) with paths to files. - TemplateLeftDelim string `protobuf:"bytes,2,opt,name=template_left_delim,json=templateLeftDelim,proto3" json:"template_left_delim,omitempty"` - // template_right_delim is used to replace placeholders in templates (DSN and etc.) with paths to files. - TemplateRightDelim string `protobuf:"bytes,3,opt,name=template_right_delim,json=templateRightDelim,proto3" json:"template_right_delim,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *TextFiles) Reset() { - *x = TextFiles{} - mi := &file_agent_v1_agent_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *TextFiles) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*TextFiles) ProtoMessage() {} - -func (x *TextFiles) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_agent_proto_msgTypes[0] - 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 TextFiles.ProtoReflect.Descriptor instead. -func (*TextFiles) Descriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{0} -} - -func (x *TextFiles) GetFiles() map[string]string { - if x != nil { - return x.Files - } - return nil -} - -func (x *TextFiles) GetTemplateLeftDelim() string { - if x != nil { - return x.TemplateLeftDelim - } - return "" -} - -func (x *TextFiles) GetTemplateRightDelim() string { - if x != nil { - return x.TemplateRightDelim - } - return "" -} - -// Ping is a AgentMessage/ServerMessage for checking connectivity, latency and clock drift. -type Ping struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Ping) Reset() { - *x = Ping{} - mi := &file_agent_v1_agent_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Ping) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Ping) ProtoMessage() {} - -func (x *Ping) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_agent_proto_msgTypes[1] - 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 Ping.ProtoReflect.Descriptor instead. -func (*Ping) Descriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{1} -} - -// Pong is an AgentMessage/ServerMessage with current time for measuring clock drift. -type Pong struct { - state protoimpl.MessageState `protogen:"open.v1"` - CurrentTime *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=current_time,json=currentTime,proto3" json:"current_time,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Pong) Reset() { - *x = Pong{} - mi := &file_agent_v1_agent_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Pong) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Pong) ProtoMessage() {} - -func (x *Pong) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_agent_proto_msgTypes[2] - 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 Pong.ProtoReflect.Descriptor instead. -func (*Pong) Descriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{2} -} - -func (x *Pong) GetCurrentTime() *timestamppb.Timestamp { - if x != nil { - return x.CurrentTime - } - return nil -} - -// QANCollectRequest is an AgentMessage for sending QAN data for qan-api. -type QANCollectRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - MetricsBucket []*MetricsBucket `protobuf:"bytes,1,rep,name=metrics_bucket,json=metricsBucket,proto3" json:"metrics_bucket,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *QANCollectRequest) Reset() { - *x = QANCollectRequest{} - mi := &file_agent_v1_agent_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *QANCollectRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*QANCollectRequest) ProtoMessage() {} - -func (x *QANCollectRequest) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_agent_proto_msgTypes[3] - 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 QANCollectRequest.ProtoReflect.Descriptor instead. -func (*QANCollectRequest) Descriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{3} -} - -func (x *QANCollectRequest) GetMetricsBucket() []*MetricsBucket { - if x != nil { - return x.MetricsBucket - } - return nil -} - -// QANCollectResponse is a ServerMessage for QAN data acceptance. -type QANCollectResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *QANCollectResponse) Reset() { - *x = QANCollectResponse{} - mi := &file_agent_v1_agent_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *QANCollectResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*QANCollectResponse) ProtoMessage() {} - -func (x *QANCollectResponse) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_agent_proto_msgTypes[4] - 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 QANCollectResponse.ProtoReflect.Descriptor instead. -func (*QANCollectResponse) Descriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{4} -} - -// StateChangedRequest is an AgentMessage describing actual agent status. -type StateChangedRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - AgentId string `protobuf:"bytes,1,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"` - Status v1.AgentStatus `protobuf:"varint,2,opt,name=status,proto3,enum=inventory.v1.AgentStatus" json:"status,omitempty"` - ListenPort uint32 `protobuf:"varint,3,opt,name=listen_port,json=listenPort,proto3" json:"listen_port,omitempty"` - ProcessExecPath string `protobuf:"bytes,4,opt,name=process_exec_path,json=processExecPath,proto3" json:"process_exec_path,omitempty"` - Version string `protobuf:"bytes,5,opt,name=version,proto3" json:"version,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StateChangedRequest) Reset() { - *x = StateChangedRequest{} - mi := &file_agent_v1_agent_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StateChangedRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StateChangedRequest) ProtoMessage() {} - -func (x *StateChangedRequest) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_agent_proto_msgTypes[5] - 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 StateChangedRequest.ProtoReflect.Descriptor instead. -func (*StateChangedRequest) Descriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{5} -} - -func (x *StateChangedRequest) GetAgentId() string { - if x != nil { - return x.AgentId - } - return "" -} - -func (x *StateChangedRequest) GetStatus() v1.AgentStatus { - if x != nil { - return x.Status - } - return v1.AgentStatus(0) -} - -func (x *StateChangedRequest) GetListenPort() uint32 { - if x != nil { - return x.ListenPort - } - return 0 -} - -func (x *StateChangedRequest) GetProcessExecPath() string { - if x != nil { - return x.ProcessExecPath - } - return "" -} - -func (x *StateChangedRequest) GetVersion() string { - if x != nil { - return x.Version - } - return "" -} - -// StateChangedResponse is a ServerMessage for StateChangedRequest acceptance. -type StateChangedResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StateChangedResponse) Reset() { - *x = StateChangedResponse{} - mi := &file_agent_v1_agent_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StateChangedResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StateChangedResponse) ProtoMessage() {} - -func (x *StateChangedResponse) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_agent_proto_msgTypes[6] - 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 StateChangedResponse.ProtoReflect.Descriptor instead. -func (*StateChangedResponse) Descriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{6} -} - -// SetStateRequest is a ServerMessage asking pmm-agent to run agents according to desired state. -type SetStateRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - AgentProcesses map[string]*SetStateRequest_AgentProcess `protobuf:"bytes,1,rep,name=agent_processes,json=agentProcesses,proto3" json:"agent_processes,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - BuiltinAgents map[string]*SetStateRequest_BuiltinAgent `protobuf:"bytes,2,rep,name=builtin_agents,json=builtinAgents,proto3" json:"builtin_agents,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SetStateRequest) Reset() { - *x = SetStateRequest{} - mi := &file_agent_v1_agent_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SetStateRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SetStateRequest) ProtoMessage() {} - -func (x *SetStateRequest) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_agent_proto_msgTypes[7] - 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 SetStateRequest.ProtoReflect.Descriptor instead. -func (*SetStateRequest) Descriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{7} -} - -func (x *SetStateRequest) GetAgentProcesses() map[string]*SetStateRequest_AgentProcess { - if x != nil { - return x.AgentProcesses - } - return nil -} - -func (x *SetStateRequest) GetBuiltinAgents() map[string]*SetStateRequest_BuiltinAgent { - if x != nil { - return x.BuiltinAgents - } - return nil -} - -// SetStateResponse is an AgentMessage for SetStateRequest acceptance. -type SetStateResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SetStateResponse) Reset() { - *x = SetStateResponse{} - mi := &file_agent_v1_agent_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SetStateResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SetStateResponse) ProtoMessage() {} - -func (x *SetStateResponse) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_agent_proto_msgTypes[8] - 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 SetStateResponse.ProtoReflect.Descriptor instead. -func (*SetStateResponse) Descriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{8} -} - -// QueryActionValue represents a single value used in query Actions. -type QueryActionValue struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Kind: - // - // *QueryActionValue_Nil - // *QueryActionValue_Bool - // *QueryActionValue_Int64 - // *QueryActionValue_Uint64 - // *QueryActionValue_Double - // *QueryActionValue_Bytes - // *QueryActionValue_Timestamp - // *QueryActionValue_Slice - // *QueryActionValue_Map - // *QueryActionValue_Binary - Kind isQueryActionValue_Kind `protobuf_oneof:"kind"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *QueryActionValue) Reset() { - *x = QueryActionValue{} - mi := &file_agent_v1_agent_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *QueryActionValue) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*QueryActionValue) ProtoMessage() {} - -func (x *QueryActionValue) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_agent_proto_msgTypes[9] - 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 QueryActionValue.ProtoReflect.Descriptor instead. -func (*QueryActionValue) Descriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{9} -} - -func (x *QueryActionValue) GetKind() isQueryActionValue_Kind { - if x != nil { - return x.Kind - } - return nil -} - -func (x *QueryActionValue) GetNil() bool { - if x != nil { - if x, ok := x.Kind.(*QueryActionValue_Nil); ok { - return x.Nil - } - } - return false -} - -func (x *QueryActionValue) GetBool() bool { - if x != nil { - if x, ok := x.Kind.(*QueryActionValue_Bool); ok { - return x.Bool - } - } - return false -} - -func (x *QueryActionValue) GetInt64() int64 { - if x != nil { - if x, ok := x.Kind.(*QueryActionValue_Int64); ok { - return x.Int64 - } - } - return 0 -} - -func (x *QueryActionValue) GetUint64() uint64 { - if x != nil { - if x, ok := x.Kind.(*QueryActionValue_Uint64); ok { - return x.Uint64 - } - } - return 0 -} - -func (x *QueryActionValue) GetDouble() float64 { - if x != nil { - if x, ok := x.Kind.(*QueryActionValue_Double); ok { - return x.Double - } - } - return 0 -} - -func (x *QueryActionValue) GetBytes() []byte { - if x != nil { - if x, ok := x.Kind.(*QueryActionValue_Bytes); ok { - return x.Bytes - } - } - return nil -} - -func (x *QueryActionValue) GetTimestamp() *timestamppb.Timestamp { - if x != nil { - if x, ok := x.Kind.(*QueryActionValue_Timestamp); ok { - return x.Timestamp - } - } - return nil -} - -func (x *QueryActionValue) GetSlice() *QueryActionSlice { - if x != nil { - if x, ok := x.Kind.(*QueryActionValue_Slice); ok { - return x.Slice - } - } - return nil -} - -func (x *QueryActionValue) GetMap() *QueryActionMap { - if x != nil { - if x, ok := x.Kind.(*QueryActionValue_Map); ok { - return x.Map - } - } - return nil -} - -func (x *QueryActionValue) GetBinary() *QueryActionBinary { - if x != nil { - if x, ok := x.Kind.(*QueryActionValue_Binary); ok { - return x.Binary - } - } - return nil -} - -type isQueryActionValue_Kind interface { - isQueryActionValue_Kind() -} - -type QueryActionValue_Nil struct { - Nil bool `protobuf:"varint,1,opt,name=nil,proto3,oneof"` -} - -type QueryActionValue_Bool struct { - Bool bool `protobuf:"varint,2,opt,name=bool,proto3,oneof"` -} - -type QueryActionValue_Int64 struct { - Int64 int64 `protobuf:"varint,3,opt,name=int64,proto3,oneof"` -} - -type QueryActionValue_Uint64 struct { - Uint64 uint64 `protobuf:"varint,4,opt,name=uint64,proto3,oneof"` -} - -type QueryActionValue_Double struct { - Double float64 `protobuf:"fixed64,5,opt,name=double,proto3,oneof"` -} - -type QueryActionValue_Bytes struct { - Bytes []byte `protobuf:"bytes,6,opt,name=bytes,proto3,oneof"` -} - -type QueryActionValue_Timestamp struct { - Timestamp *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=timestamp,proto3,oneof"` -} - -type QueryActionValue_Slice struct { - Slice *QueryActionSlice `protobuf:"bytes,10,opt,name=slice,proto3,oneof"` -} - -type QueryActionValue_Map struct { - Map *QueryActionMap `protobuf:"bytes,11,opt,name=map,proto3,oneof"` -} - -type QueryActionValue_Binary struct { - Binary *QueryActionBinary `protobuf:"bytes,12,opt,name=binary,proto3,oneof"` -} - -func (*QueryActionValue_Nil) isQueryActionValue_Kind() {} - -func (*QueryActionValue_Bool) isQueryActionValue_Kind() {} - -func (*QueryActionValue_Int64) isQueryActionValue_Kind() {} - -func (*QueryActionValue_Uint64) isQueryActionValue_Kind() {} - -func (*QueryActionValue_Double) isQueryActionValue_Kind() {} - -func (*QueryActionValue_Bytes) isQueryActionValue_Kind() {} - -func (*QueryActionValue_Timestamp) isQueryActionValue_Kind() {} - -func (*QueryActionValue_Slice) isQueryActionValue_Kind() {} - -func (*QueryActionValue_Map) isQueryActionValue_Kind() {} - -func (*QueryActionValue_Binary) isQueryActionValue_Kind() {} - -// QueryActionSlice represents a slice of values used in query Actions. -type QueryActionSlice struct { - state protoimpl.MessageState `protogen:"open.v1"` - Slice []*QueryActionValue `protobuf:"bytes,1,rep,name=slice,proto3" json:"slice,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *QueryActionSlice) Reset() { - *x = QueryActionSlice{} - mi := &file_agent_v1_agent_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *QueryActionSlice) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*QueryActionSlice) ProtoMessage() {} - -func (x *QueryActionSlice) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_agent_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 QueryActionSlice.ProtoReflect.Descriptor instead. -func (*QueryActionSlice) Descriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{10} -} - -func (x *QueryActionSlice) GetSlice() []*QueryActionValue { - if x != nil { - return x.Slice - } - return nil -} - -// QueryActionMap represents a map of values used in query Actions. -type QueryActionMap struct { - state protoimpl.MessageState `protogen:"open.v1"` - Map map[string]*QueryActionValue `protobuf:"bytes,1,rep,name=map,proto3" json:"map,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *QueryActionMap) Reset() { - *x = QueryActionMap{} - mi := &file_agent_v1_agent_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *QueryActionMap) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*QueryActionMap) ProtoMessage() {} - -func (x *QueryActionMap) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_agent_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 QueryActionMap.ProtoReflect.Descriptor instead. -func (*QueryActionMap) Descriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{11} -} - -func (x *QueryActionMap) GetMap() map[string]*QueryActionValue { - if x != nil { - return x.Map - } - return nil -} - -// QueryActionBinary represents primitive.Binary used in query Actions. -type QueryActionBinary struct { - state protoimpl.MessageState `protogen:"open.v1"` - Subtype int32 `protobuf:"varint,1,opt,name=subtype,proto3" json:"subtype,omitempty"` - Bytes []byte `protobuf:"bytes,2,opt,name=bytes,proto3" json:"bytes,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *QueryActionBinary) Reset() { - *x = QueryActionBinary{} - mi := &file_agent_v1_agent_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *QueryActionBinary) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*QueryActionBinary) ProtoMessage() {} - -func (x *QueryActionBinary) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_agent_proto_msgTypes[12] - 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 QueryActionBinary.ProtoReflect.Descriptor instead. -func (*QueryActionBinary) Descriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{12} -} - -func (x *QueryActionBinary) GetSubtype() int32 { - if x != nil { - return x.Subtype - } - return 0 -} - -func (x *QueryActionBinary) GetBytes() []byte { - if x != nil { - return x.Bytes - } - return nil -} - -// QueryActionResult represents query Action result. -type QueryActionResult struct { - state protoimpl.MessageState `protogen:"open.v1"` - // SQL result column names. - Columns []string `protobuf:"bytes,1,rep,name=columns,proto3" json:"columns,omitempty"` - // SQL result data rows. - Rows []*QueryActionSlice `protobuf:"bytes,2,rep,name=rows,proto3" json:"rows,omitempty"` - // MongoDB documents. - Docs []*QueryActionMap `protobuf:"bytes,3,rep,name=docs,proto3" json:"docs,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *QueryActionResult) Reset() { - *x = QueryActionResult{} - mi := &file_agent_v1_agent_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *QueryActionResult) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*QueryActionResult) ProtoMessage() {} - -func (x *QueryActionResult) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_agent_proto_msgTypes[13] - 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 QueryActionResult.ProtoReflect.Descriptor instead. -func (*QueryActionResult) Descriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{13} -} - -func (x *QueryActionResult) GetColumns() []string { - if x != nil { - return x.Columns - } - return nil -} - -func (x *QueryActionResult) GetRows() []*QueryActionSlice { - if x != nil { - return x.Rows - } - return nil -} - -func (x *QueryActionResult) GetDocs() []*QueryActionMap { - if x != nil { - return x.Docs - } - return nil -} - -// StartActionRequest is a ServerMessage asking pmm-agent to start action. -type StartActionRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - ActionId string `protobuf:"bytes,1,opt,name=action_id,json=actionId,proto3" json:"action_id,omitempty"` - // Timeout for the whole action. If zero or absent, pmm-agent will pick one itself. - Timeout *durationpb.Duration `protobuf:"bytes,2,opt,name=timeout,proto3" json:"timeout,omitempty"` - // Types that are valid to be assigned to Params: - // - // *StartActionRequest_MysqlExplainParams - // *StartActionRequest_MysqlShowCreateTableParams - // *StartActionRequest_MysqlShowTableStatusParams - // *StartActionRequest_MysqlShowIndexParams - // *StartActionRequest_PostgresqlShowCreateTableParams - // *StartActionRequest_PostgresqlShowIndexParams - // *StartActionRequest_MongodbExplainParams - // *StartActionRequest_PtSummaryParams - // *StartActionRequest_PtPgSummaryParams - // *StartActionRequest_PtMongodbSummaryParams - // *StartActionRequest_PtMysqlSummaryParams - // *StartActionRequest_MysqlQueryShowParams - // *StartActionRequest_MysqlQuerySelectParams - // *StartActionRequest_PostgresqlQueryShowParams - // *StartActionRequest_PostgresqlQuerySelectParams - // *StartActionRequest_MongodbQueryGetparameterParams - // *StartActionRequest_MongodbQueryBuildinfoParams - // *StartActionRequest_MongodbQueryGetcmdlineoptsParams - // *StartActionRequest_MongodbQueryReplsetgetstatusParams - // *StartActionRequest_MongodbQueryGetdiagnosticdataParams - // *StartActionRequest_RestartSysServiceParams - Params isStartActionRequest_Params `protobuf_oneof:"params"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StartActionRequest) Reset() { - *x = StartActionRequest{} - mi := &file_agent_v1_agent_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StartActionRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StartActionRequest) ProtoMessage() {} - -func (x *StartActionRequest) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_agent_proto_msgTypes[14] - 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 StartActionRequest.ProtoReflect.Descriptor instead. -func (*StartActionRequest) Descriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{14} -} - -func (x *StartActionRequest) GetActionId() string { - if x != nil { - return x.ActionId - } - return "" -} - -func (x *StartActionRequest) GetTimeout() *durationpb.Duration { - if x != nil { - return x.Timeout - } - return nil -} - -func (x *StartActionRequest) GetParams() isStartActionRequest_Params { - if x != nil { - return x.Params - } - return nil -} - -func (x *StartActionRequest) GetMysqlExplainParams() *StartActionRequest_MySQLExplainParams { - if x != nil { - if x, ok := x.Params.(*StartActionRequest_MysqlExplainParams); ok { - return x.MysqlExplainParams - } - } - return nil -} - -func (x *StartActionRequest) GetMysqlShowCreateTableParams() *StartActionRequest_MySQLShowCreateTableParams { - if x != nil { - if x, ok := x.Params.(*StartActionRequest_MysqlShowCreateTableParams); ok { - return x.MysqlShowCreateTableParams - } - } - return nil -} - -func (x *StartActionRequest) GetMysqlShowTableStatusParams() *StartActionRequest_MySQLShowTableStatusParams { - if x != nil { - if x, ok := x.Params.(*StartActionRequest_MysqlShowTableStatusParams); ok { - return x.MysqlShowTableStatusParams - } - } - return nil -} - -func (x *StartActionRequest) GetMysqlShowIndexParams() *StartActionRequest_MySQLShowIndexParams { - if x != nil { - if x, ok := x.Params.(*StartActionRequest_MysqlShowIndexParams); ok { - return x.MysqlShowIndexParams - } - } - return nil -} - -func (x *StartActionRequest) GetPostgresqlShowCreateTableParams() *StartActionRequest_PostgreSQLShowCreateTableParams { - if x != nil { - if x, ok := x.Params.(*StartActionRequest_PostgresqlShowCreateTableParams); ok { - return x.PostgresqlShowCreateTableParams - } - } - return nil -} - -func (x *StartActionRequest) GetPostgresqlShowIndexParams() *StartActionRequest_PostgreSQLShowIndexParams { - if x != nil { - if x, ok := x.Params.(*StartActionRequest_PostgresqlShowIndexParams); ok { - return x.PostgresqlShowIndexParams - } - } - return nil -} - -func (x *StartActionRequest) GetMongodbExplainParams() *StartActionRequest_MongoDBExplainParams { - if x != nil { - if x, ok := x.Params.(*StartActionRequest_MongodbExplainParams); ok { - return x.MongodbExplainParams - } - } - return nil -} - -func (x *StartActionRequest) GetPtSummaryParams() *StartActionRequest_PTSummaryParams { - if x != nil { - if x, ok := x.Params.(*StartActionRequest_PtSummaryParams); ok { - return x.PtSummaryParams - } - } - return nil -} - -func (x *StartActionRequest) GetPtPgSummaryParams() *StartActionRequest_PTPgSummaryParams { - if x != nil { - if x, ok := x.Params.(*StartActionRequest_PtPgSummaryParams); ok { - return x.PtPgSummaryParams - } - } - return nil -} - -func (x *StartActionRequest) GetPtMongodbSummaryParams() *StartActionRequest_PTMongoDBSummaryParams { - if x != nil { - if x, ok := x.Params.(*StartActionRequest_PtMongodbSummaryParams); ok { - return x.PtMongodbSummaryParams - } - } - return nil -} - -func (x *StartActionRequest) GetPtMysqlSummaryParams() *StartActionRequest_PTMySQLSummaryParams { - if x != nil { - if x, ok := x.Params.(*StartActionRequest_PtMysqlSummaryParams); ok { - return x.PtMysqlSummaryParams - } - } - return nil -} - -func (x *StartActionRequest) GetMysqlQueryShowParams() *StartActionRequest_MySQLQueryShowParams { - if x != nil { - if x, ok := x.Params.(*StartActionRequest_MysqlQueryShowParams); ok { - return x.MysqlQueryShowParams - } - } - return nil -} - -func (x *StartActionRequest) GetMysqlQuerySelectParams() *StartActionRequest_MySQLQuerySelectParams { - if x != nil { - if x, ok := x.Params.(*StartActionRequest_MysqlQuerySelectParams); ok { - return x.MysqlQuerySelectParams - } - } - return nil -} - -func (x *StartActionRequest) GetPostgresqlQueryShowParams() *StartActionRequest_PostgreSQLQueryShowParams { - if x != nil { - if x, ok := x.Params.(*StartActionRequest_PostgresqlQueryShowParams); ok { - return x.PostgresqlQueryShowParams - } - } - return nil -} - -func (x *StartActionRequest) GetPostgresqlQuerySelectParams() *StartActionRequest_PostgreSQLQuerySelectParams { - if x != nil { - if x, ok := x.Params.(*StartActionRequest_PostgresqlQuerySelectParams); ok { - return x.PostgresqlQuerySelectParams - } - } - return nil -} - -func (x *StartActionRequest) GetMongodbQueryGetparameterParams() *StartActionRequest_MongoDBQueryGetParameterParams { - if x != nil { - if x, ok := x.Params.(*StartActionRequest_MongodbQueryGetparameterParams); ok { - return x.MongodbQueryGetparameterParams - } - } - return nil -} - -func (x *StartActionRequest) GetMongodbQueryBuildinfoParams() *StartActionRequest_MongoDBQueryBuildInfoParams { - if x != nil { - if x, ok := x.Params.(*StartActionRequest_MongodbQueryBuildinfoParams); ok { - return x.MongodbQueryBuildinfoParams - } - } - return nil -} - -func (x *StartActionRequest) GetMongodbQueryGetcmdlineoptsParams() *StartActionRequest_MongoDBQueryGetCmdLineOptsParams { - if x != nil { - if x, ok := x.Params.(*StartActionRequest_MongodbQueryGetcmdlineoptsParams); ok { - return x.MongodbQueryGetcmdlineoptsParams - } - } - return nil -} - -func (x *StartActionRequest) GetMongodbQueryReplsetgetstatusParams() *StartActionRequest_MongoDBQueryReplSetGetStatusParams { - if x != nil { - if x, ok := x.Params.(*StartActionRequest_MongodbQueryReplsetgetstatusParams); ok { - return x.MongodbQueryReplsetgetstatusParams - } - } - return nil -} - -func (x *StartActionRequest) GetMongodbQueryGetdiagnosticdataParams() *StartActionRequest_MongoDBQueryGetDiagnosticDataParams { - if x != nil { - if x, ok := x.Params.(*StartActionRequest_MongodbQueryGetdiagnosticdataParams); ok { - return x.MongodbQueryGetdiagnosticdataParams - } - } - return nil -} - -func (x *StartActionRequest) GetRestartSysServiceParams() *StartActionRequest_RestartSystemServiceParams { - if x != nil { - if x, ok := x.Params.(*StartActionRequest_RestartSysServiceParams); ok { - return x.RestartSysServiceParams - } - } - return nil -} - -type isStartActionRequest_Params interface { - isStartActionRequest_Params() -} - -type StartActionRequest_MysqlExplainParams struct { - MysqlExplainParams *StartActionRequest_MySQLExplainParams `protobuf:"bytes,10,opt,name=mysql_explain_params,json=mysqlExplainParams,proto3,oneof"` -} - -type StartActionRequest_MysqlShowCreateTableParams struct { - MysqlShowCreateTableParams *StartActionRequest_MySQLShowCreateTableParams `protobuf:"bytes,11,opt,name=mysql_show_create_table_params,json=mysqlShowCreateTableParams,proto3,oneof"` -} - -type StartActionRequest_MysqlShowTableStatusParams struct { - MysqlShowTableStatusParams *StartActionRequest_MySQLShowTableStatusParams `protobuf:"bytes,12,opt,name=mysql_show_table_status_params,json=mysqlShowTableStatusParams,proto3,oneof"` -} - -type StartActionRequest_MysqlShowIndexParams struct { - MysqlShowIndexParams *StartActionRequest_MySQLShowIndexParams `protobuf:"bytes,13,opt,name=mysql_show_index_params,json=mysqlShowIndexParams,proto3,oneof"` -} - -type StartActionRequest_PostgresqlShowCreateTableParams struct { - PostgresqlShowCreateTableParams *StartActionRequest_PostgreSQLShowCreateTableParams `protobuf:"bytes,14,opt,name=postgresql_show_create_table_params,json=postgresqlShowCreateTableParams,proto3,oneof"` -} - -type StartActionRequest_PostgresqlShowIndexParams struct { - PostgresqlShowIndexParams *StartActionRequest_PostgreSQLShowIndexParams `protobuf:"bytes,15,opt,name=postgresql_show_index_params,json=postgresqlShowIndexParams,proto3,oneof"` -} - -type StartActionRequest_MongodbExplainParams struct { - MongodbExplainParams *StartActionRequest_MongoDBExplainParams `protobuf:"bytes,16,opt,name=mongodb_explain_params,json=mongodbExplainParams,proto3,oneof"` -} - -type StartActionRequest_PtSummaryParams struct { - PtSummaryParams *StartActionRequest_PTSummaryParams `protobuf:"bytes,17,opt,name=pt_summary_params,json=ptSummaryParams,proto3,oneof"` -} - -type StartActionRequest_PtPgSummaryParams struct { - PtPgSummaryParams *StartActionRequest_PTPgSummaryParams `protobuf:"bytes,18,opt,name=pt_pg_summary_params,json=ptPgSummaryParams,proto3,oneof"` -} - -type StartActionRequest_PtMongodbSummaryParams struct { - PtMongodbSummaryParams *StartActionRequest_PTMongoDBSummaryParams `protobuf:"bytes,19,opt,name=pt_mongodb_summary_params,json=ptMongodbSummaryParams,proto3,oneof"` -} - -type StartActionRequest_PtMysqlSummaryParams struct { - PtMysqlSummaryParams *StartActionRequest_PTMySQLSummaryParams `protobuf:"bytes,20,opt,name=pt_mysql_summary_params,json=ptMysqlSummaryParams,proto3,oneof"` -} - -type StartActionRequest_MysqlQueryShowParams struct { - MysqlQueryShowParams *StartActionRequest_MySQLQueryShowParams `protobuf:"bytes,21,opt,name=mysql_query_show_params,json=mysqlQueryShowParams,proto3,oneof"` -} - -type StartActionRequest_MysqlQuerySelectParams struct { - MysqlQuerySelectParams *StartActionRequest_MySQLQuerySelectParams `protobuf:"bytes,22,opt,name=mysql_query_select_params,json=mysqlQuerySelectParams,proto3,oneof"` -} - -type StartActionRequest_PostgresqlQueryShowParams struct { - PostgresqlQueryShowParams *StartActionRequest_PostgreSQLQueryShowParams `protobuf:"bytes,23,opt,name=postgresql_query_show_params,json=postgresqlQueryShowParams,proto3,oneof"` -} - -type StartActionRequest_PostgresqlQuerySelectParams struct { - PostgresqlQuerySelectParams *StartActionRequest_PostgreSQLQuerySelectParams `protobuf:"bytes,24,opt,name=postgresql_query_select_params,json=postgresqlQuerySelectParams,proto3,oneof"` -} - -type StartActionRequest_MongodbQueryGetparameterParams struct { - MongodbQueryGetparameterParams *StartActionRequest_MongoDBQueryGetParameterParams `protobuf:"bytes,25,opt,name=mongodb_query_getparameter_params,json=mongodbQueryGetparameterParams,proto3,oneof"` -} - -type StartActionRequest_MongodbQueryBuildinfoParams struct { - MongodbQueryBuildinfoParams *StartActionRequest_MongoDBQueryBuildInfoParams `protobuf:"bytes,26,opt,name=mongodb_query_buildinfo_params,json=mongodbQueryBuildinfoParams,proto3,oneof"` -} - -type StartActionRequest_MongodbQueryGetcmdlineoptsParams struct { - MongodbQueryGetcmdlineoptsParams *StartActionRequest_MongoDBQueryGetCmdLineOptsParams `protobuf:"bytes,27,opt,name=mongodb_query_getcmdlineopts_params,json=mongodbQueryGetcmdlineoptsParams,proto3,oneof"` -} - -type StartActionRequest_MongodbQueryReplsetgetstatusParams struct { - MongodbQueryReplsetgetstatusParams *StartActionRequest_MongoDBQueryReplSetGetStatusParams `protobuf:"bytes,28,opt,name=mongodb_query_replsetgetstatus_params,json=mongodbQueryReplsetgetstatusParams,proto3,oneof"` -} - -type StartActionRequest_MongodbQueryGetdiagnosticdataParams struct { - MongodbQueryGetdiagnosticdataParams *StartActionRequest_MongoDBQueryGetDiagnosticDataParams `protobuf:"bytes,29,opt,name=mongodb_query_getdiagnosticdata_params,json=mongodbQueryGetdiagnosticdataParams,proto3,oneof"` -} - -type StartActionRequest_RestartSysServiceParams struct { - RestartSysServiceParams *StartActionRequest_RestartSystemServiceParams `protobuf:"bytes,50,opt,name=restart_sys_service_params,json=restartSysServiceParams,proto3,oneof"` -} - -func (*StartActionRequest_MysqlExplainParams) isStartActionRequest_Params() {} - -func (*StartActionRequest_MysqlShowCreateTableParams) isStartActionRequest_Params() {} - -func (*StartActionRequest_MysqlShowTableStatusParams) isStartActionRequest_Params() {} - -func (*StartActionRequest_MysqlShowIndexParams) isStartActionRequest_Params() {} - -func (*StartActionRequest_PostgresqlShowCreateTableParams) isStartActionRequest_Params() {} - -func (*StartActionRequest_PostgresqlShowIndexParams) isStartActionRequest_Params() {} - -func (*StartActionRequest_MongodbExplainParams) isStartActionRequest_Params() {} - -func (*StartActionRequest_PtSummaryParams) isStartActionRequest_Params() {} - -func (*StartActionRequest_PtPgSummaryParams) isStartActionRequest_Params() {} - -func (*StartActionRequest_PtMongodbSummaryParams) isStartActionRequest_Params() {} - -func (*StartActionRequest_PtMysqlSummaryParams) isStartActionRequest_Params() {} - -func (*StartActionRequest_MysqlQueryShowParams) isStartActionRequest_Params() {} - -func (*StartActionRequest_MysqlQuerySelectParams) isStartActionRequest_Params() {} - -func (*StartActionRequest_PostgresqlQueryShowParams) isStartActionRequest_Params() {} - -func (*StartActionRequest_PostgresqlQuerySelectParams) isStartActionRequest_Params() {} - -func (*StartActionRequest_MongodbQueryGetparameterParams) isStartActionRequest_Params() {} - -func (*StartActionRequest_MongodbQueryBuildinfoParams) isStartActionRequest_Params() {} - -func (*StartActionRequest_MongodbQueryGetcmdlineoptsParams) isStartActionRequest_Params() {} - -func (*StartActionRequest_MongodbQueryReplsetgetstatusParams) isStartActionRequest_Params() {} - -func (*StartActionRequest_MongodbQueryGetdiagnosticdataParams) isStartActionRequest_Params() {} - -func (*StartActionRequest_RestartSysServiceParams) isStartActionRequest_Params() {} - -// StartActionResponse is an AgentMessage for StartActionRequest acceptance. -type StartActionResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StartActionResponse) Reset() { - *x = StartActionResponse{} - mi := &file_agent_v1_agent_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StartActionResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StartActionResponse) ProtoMessage() {} - -func (x *StartActionResponse) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_agent_proto_msgTypes[15] - 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 StartActionResponse.ProtoReflect.Descriptor instead. -func (*StartActionResponse) Descriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{15} -} - -// StopActionRequest is a ServerMessage asking pmm-agent to stop action. -type StopActionRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - ActionId string `protobuf:"bytes,1,opt,name=action_id,json=actionId,proto3" json:"action_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StopActionRequest) Reset() { - *x = StopActionRequest{} - mi := &file_agent_v1_agent_proto_msgTypes[16] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StopActionRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StopActionRequest) ProtoMessage() {} - -func (x *StopActionRequest) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_agent_proto_msgTypes[16] - 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 StopActionRequest.ProtoReflect.Descriptor instead. -func (*StopActionRequest) Descriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{16} -} - -func (x *StopActionRequest) GetActionId() string { - if x != nil { - return x.ActionId - } - return "" -} - -// StopActionResponse is an AgentMessage for StopActionRequest acceptance. -type StopActionResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StopActionResponse) Reset() { - *x = StopActionResponse{} - mi := &file_agent_v1_agent_proto_msgTypes[17] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StopActionResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StopActionResponse) ProtoMessage() {} - -func (x *StopActionResponse) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_agent_proto_msgTypes[17] - 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 StopActionResponse.ProtoReflect.Descriptor instead. -func (*StopActionResponse) Descriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{17} -} - -// ActionResultRequest is an AgentMessage containing action run status and new chunk of output. -type ActionResultRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Unique action ID. - ActionId string `protobuf:"bytes,1,opt,name=action_id,json=actionId,proto3" json:"action_id,omitempty"` - // New chunk of action output. - Output []byte `protobuf:"bytes,3,opt,name=output,proto3" json:"output,omitempty"` - // True if action is finished. - Done bool `protobuf:"varint,4,opt,name=done,proto3" json:"done,omitempty"` - // Error message if action failed. - Error string `protobuf:"bytes,5,opt,name=error,proto3" json:"error,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ActionResultRequest) Reset() { - *x = ActionResultRequest{} - mi := &file_agent_v1_agent_proto_msgTypes[18] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ActionResultRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ActionResultRequest) ProtoMessage() {} - -func (x *ActionResultRequest) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_agent_proto_msgTypes[18] - 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 ActionResultRequest.ProtoReflect.Descriptor instead. -func (*ActionResultRequest) Descriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{18} -} - -func (x *ActionResultRequest) GetActionId() string { - if x != nil { - return x.ActionId - } - return "" -} - -func (x *ActionResultRequest) GetOutput() []byte { - if x != nil { - return x.Output - } - return nil -} - -func (x *ActionResultRequest) GetDone() bool { - if x != nil { - return x.Done - } - return false -} - -func (x *ActionResultRequest) GetError() string { - if x != nil { - return x.Error - } - return "" -} - -// ActionResultResponse is an ServerMessage for ActionResultRequest acceptance. -type ActionResultResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ActionResultResponse) Reset() { - *x = ActionResultResponse{} - mi := &file_agent_v1_agent_proto_msgTypes[19] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ActionResultResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ActionResultResponse) ProtoMessage() {} - -func (x *ActionResultResponse) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_agent_proto_msgTypes[19] - 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 ActionResultResponse.ProtoReflect.Descriptor instead. -func (*ActionResultResponse) Descriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{19} -} - -// PBMSwitchPITRRequest is a ServerMessage asking pmm-agent to switch PITR pbm feature. -type PBMSwitchPITRRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // DSN for the MongoDB service. May contain connection (dial) timeout. - // May contain placeholders for file paths in DSN. - Dsn string `protobuf:"bytes,1,opt,name=dsn,proto3" json:"dsn,omitempty"` - // Contains files and their contents which can be used in DSN. - TextFiles *TextFiles `protobuf:"bytes,2,opt,name=text_files,json=textFiles,proto3" json:"text_files,omitempty"` - // Specifies if PITR should be enabled or disabled. - Enabled bool `protobuf:"varint,3,opt,name=enabled,proto3" json:"enabled,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *PBMSwitchPITRRequest) Reset() { - *x = PBMSwitchPITRRequest{} - mi := &file_agent_v1_agent_proto_msgTypes[20] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *PBMSwitchPITRRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PBMSwitchPITRRequest) ProtoMessage() {} - -func (x *PBMSwitchPITRRequest) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_agent_proto_msgTypes[20] - 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 PBMSwitchPITRRequest.ProtoReflect.Descriptor instead. -func (*PBMSwitchPITRRequest) Descriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{20} -} - -func (x *PBMSwitchPITRRequest) GetDsn() string { - if x != nil { - return x.Dsn - } - return "" -} - -func (x *PBMSwitchPITRRequest) GetTextFiles() *TextFiles { - if x != nil { - return x.TextFiles - } - return nil -} - -func (x *PBMSwitchPITRRequest) GetEnabled() bool { - if x != nil { - return x.Enabled - } - return false -} - -// PBMSwitchPITRResponse is an AgentMessage for PBMSwitchPITRRequest success result. -type PBMSwitchPITRResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Error message. - Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *PBMSwitchPITRResponse) Reset() { - *x = PBMSwitchPITRResponse{} - mi := &file_agent_v1_agent_proto_msgTypes[21] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *PBMSwitchPITRResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PBMSwitchPITRResponse) ProtoMessage() {} - -func (x *PBMSwitchPITRResponse) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_agent_proto_msgTypes[21] - 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 PBMSwitchPITRResponse.ProtoReflect.Descriptor instead. -func (*PBMSwitchPITRResponse) Descriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{21} -} - -func (x *PBMSwitchPITRResponse) GetError() string { - if x != nil { - return x.Error - } - return "" -} - -// AgentLogsRequest is an ServerMessage asking logs by Agent ID. -type AgentLogsRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - AgentId string `protobuf:"bytes,1,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"` - Limit uint32 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AgentLogsRequest) Reset() { - *x = AgentLogsRequest{} - mi := &file_agent_v1_agent_proto_msgTypes[22] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AgentLogsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AgentLogsRequest) ProtoMessage() {} - -func (x *AgentLogsRequest) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_agent_proto_msgTypes[22] - 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 AgentLogsRequest.ProtoReflect.Descriptor instead. -func (*AgentLogsRequest) Descriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{22} -} - -func (x *AgentLogsRequest) GetAgentId() string { - if x != nil { - return x.AgentId - } - return "" -} - -func (x *AgentLogsRequest) GetLimit() uint32 { - if x != nil { - return x.Limit - } - return 0 -} - -// AgentLogsResponse is an AgentMessage containing logs by Agent ID. -type AgentLogsResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Logs []string `protobuf:"bytes,1,rep,name=logs,proto3" json:"logs,omitempty"` - AgentConfigLogLinesCount uint32 `protobuf:"varint,2,opt,name=agent_config_log_lines_count,json=agentConfigLogLinesCount,proto3" json:"agent_config_log_lines_count,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AgentLogsResponse) Reset() { - *x = AgentLogsResponse{} - mi := &file_agent_v1_agent_proto_msgTypes[23] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AgentLogsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AgentLogsResponse) ProtoMessage() {} - -func (x *AgentLogsResponse) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_agent_proto_msgTypes[23] - 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 AgentLogsResponse.ProtoReflect.Descriptor instead. -func (*AgentLogsResponse) Descriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{23} -} - -func (x *AgentLogsResponse) GetLogs() []string { - if x != nil { - return x.Logs - } - return nil -} - -func (x *AgentLogsResponse) GetAgentConfigLogLinesCount() uint32 { - if x != nil { - return x.AgentConfigLogLinesCount - } - return 0 -} - -// CheckConnectionRequest is a ServerMessage asking pmm-agent to check connection with Service. -type CheckConnectionRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Service type. - Type v1.ServiceType `protobuf:"varint,1,opt,name=type,proto3,enum=inventory.v1.ServiceType" json:"type,omitempty"` - // DSN for the service. May contain connection (dial) timeout. - Dsn string `protobuf:"bytes,2,opt,name=dsn,proto3" json:"dsn,omitempty"` - // Timeout for the whole request. - Timeout *durationpb.Duration `protobuf:"bytes,3,opt,name=timeout,proto3" json:"timeout,omitempty"` - // Contains files and their contents which can be used in DSN. - TextFiles *TextFiles `protobuf:"bytes,4,opt,name=text_files,json=textFiles,proto3" json:"text_files,omitempty"` - // TLS certificate wont be verified. - TlsSkipVerify bool `protobuf:"varint,5,opt,name=tls_skip_verify,json=tlsSkipVerify,proto3" json:"tls_skip_verify,omitempty"` - // If true, use TLS for database connections. - Tls bool `protobuf:"varint,6,opt,name=tls,proto3" json:"tls,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CheckConnectionRequest) Reset() { - *x = CheckConnectionRequest{} - mi := &file_agent_v1_agent_proto_msgTypes[24] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CheckConnectionRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CheckConnectionRequest) ProtoMessage() {} - -func (x *CheckConnectionRequest) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_agent_proto_msgTypes[24] - 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 CheckConnectionRequest.ProtoReflect.Descriptor instead. -func (*CheckConnectionRequest) Descriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{24} -} - -func (x *CheckConnectionRequest) GetType() v1.ServiceType { - if x != nil { - return x.Type - } - return v1.ServiceType(0) -} - -func (x *CheckConnectionRequest) GetDsn() string { - if x != nil { - return x.Dsn - } - return "" -} - -func (x *CheckConnectionRequest) GetTimeout() *durationpb.Duration { - if x != nil { - return x.Timeout - } - return nil -} - -func (x *CheckConnectionRequest) GetTextFiles() *TextFiles { - if x != nil { - return x.TextFiles - } - return nil -} - -func (x *CheckConnectionRequest) GetTlsSkipVerify() bool { - if x != nil { - return x.TlsSkipVerify - } - return false -} - -func (x *CheckConnectionRequest) GetTls() bool { - if x != nil { - return x.Tls - } - return false -} - -// CheckConnectionResponse is an AgentMessage containing the result of a connection check. -type CheckConnectionResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Error message if connection check failed. - Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CheckConnectionResponse) Reset() { - *x = CheckConnectionResponse{} - mi := &file_agent_v1_agent_proto_msgTypes[25] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CheckConnectionResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CheckConnectionResponse) ProtoMessage() {} - -func (x *CheckConnectionResponse) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_agent_proto_msgTypes[25] - 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 CheckConnectionResponse.ProtoReflect.Descriptor instead. -func (*CheckConnectionResponse) Descriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{25} -} - -func (x *CheckConnectionResponse) GetError() string { - if x != nil { - return x.Error - } - return "" -} - -// ServiceInfoRequest is a ServerMessage that queries pmm-agent for database information. -type ServiceInfoRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Service type. - Type v1.ServiceType `protobuf:"varint,1,opt,name=type,proto3,enum=inventory.v1.ServiceType" json:"type,omitempty"` - // DSN for the service. May contain connection (dial) timeout. - Dsn string `protobuf:"bytes,2,opt,name=dsn,proto3" json:"dsn,omitempty"` - // Timeout for the whole request. - Timeout *durationpb.Duration `protobuf:"bytes,3,opt,name=timeout,proto3" json:"timeout,omitempty"` - // Contains files and their contents which can be used in DSN. - TextFiles *TextFiles `protobuf:"bytes,4,opt,name=text_files,json=textFiles,proto3" json:"text_files,omitempty"` - // TLS certificate wont be verified. - TlsSkipVerify bool `protobuf:"varint,5,opt,name=tls_skip_verify,json=tlsSkipVerify,proto3" json:"tls_skip_verify,omitempty"` - // If true, use TLS for database connections. - Tls bool `protobuf:"varint,6,opt,name=tls,proto3" json:"tls,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ServiceInfoRequest) Reset() { - *x = ServiceInfoRequest{} - mi := &file_agent_v1_agent_proto_msgTypes[26] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ServiceInfoRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ServiceInfoRequest) ProtoMessage() {} - -func (x *ServiceInfoRequest) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_agent_proto_msgTypes[26] - 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 ServiceInfoRequest.ProtoReflect.Descriptor instead. -func (*ServiceInfoRequest) Descriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{26} -} - -func (x *ServiceInfoRequest) GetType() v1.ServiceType { - if x != nil { - return x.Type - } - return v1.ServiceType(0) -} - -func (x *ServiceInfoRequest) GetDsn() string { - if x != nil { - return x.Dsn - } - return "" -} - -func (x *ServiceInfoRequest) GetTimeout() *durationpb.Duration { - if x != nil { - return x.Timeout - } - return nil -} - -func (x *ServiceInfoRequest) GetTextFiles() *TextFiles { - if x != nil { - return x.TextFiles - } - return nil -} - -func (x *ServiceInfoRequest) GetTlsSkipVerify() bool { - if x != nil { - return x.TlsSkipVerify - } - return false -} - -func (x *ServiceInfoRequest) GetTls() bool { - if x != nil { - return x.Tls - } - return false -} - -// ServiceInfoResponse is an AgentMessage containing information gathered from a service. -type ServiceInfoResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Error message if the request failed. - Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` - // A number of MySQL tables, 0 if unknown. - TableCount int32 `protobuf:"varint,2,opt,name=table_count,json=tableCount,proto3" json:"table_count,omitempty"` - // Database server version. - Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"` - // A list of PostgreSQL databases. - DatabaseList []string `protobuf:"bytes,4,rep,name=database_list,json=databaseList,proto3" json:"database_list,omitempty"` - // A version of pg_stat_monitor, empty if unavailable. - PgsmVersion *string `protobuf:"bytes,5,opt,name=pgsm_version,json=pgsmVersion,proto3,oneof" json:"pgsm_version,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ServiceInfoResponse) Reset() { - *x = ServiceInfoResponse{} - mi := &file_agent_v1_agent_proto_msgTypes[27] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ServiceInfoResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ServiceInfoResponse) ProtoMessage() {} - -func (x *ServiceInfoResponse) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_agent_proto_msgTypes[27] - 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 ServiceInfoResponse.ProtoReflect.Descriptor instead. -func (*ServiceInfoResponse) Descriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{27} -} - -func (x *ServiceInfoResponse) GetError() string { - if x != nil { - return x.Error - } - return "" -} - -func (x *ServiceInfoResponse) GetTableCount() int32 { - if x != nil { - return x.TableCount - } - return 0 -} - -func (x *ServiceInfoResponse) GetVersion() string { - if x != nil { - return x.Version - } - return "" -} - -func (x *ServiceInfoResponse) GetDatabaseList() []string { - if x != nil { - return x.DatabaseList - } - return nil -} - -func (x *ServiceInfoResponse) GetPgsmVersion() string { - if x != nil && x.PgsmVersion != nil { - return *x.PgsmVersion - } - return "" -} - -// JobStatusRequest is a ServerMessage asking pmm-agent for job status. -type JobStatusRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - JobId string `protobuf:"bytes,1,opt,name=job_id,json=jobId,proto3" json:"job_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *JobStatusRequest) Reset() { - *x = JobStatusRequest{} - mi := &file_agent_v1_agent_proto_msgTypes[28] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *JobStatusRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*JobStatusRequest) ProtoMessage() {} - -func (x *JobStatusRequest) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_agent_proto_msgTypes[28] - 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 JobStatusRequest.ProtoReflect.Descriptor instead. -func (*JobStatusRequest) Descriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{28} -} - -func (x *JobStatusRequest) GetJobId() string { - if x != nil { - return x.JobId - } - return "" -} - -// JobStatusResponse is an AgentMessage containing job status. -type JobStatusResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Alive bool `protobuf:"varint,1,opt,name=alive,proto3" json:"alive,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *JobStatusResponse) Reset() { - *x = JobStatusResponse{} - mi := &file_agent_v1_agent_proto_msgTypes[29] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *JobStatusResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*JobStatusResponse) ProtoMessage() {} - -func (x *JobStatusResponse) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_agent_proto_msgTypes[29] - 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 JobStatusResponse.ProtoReflect.Descriptor instead. -func (*JobStatusResponse) Descriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{29} -} - -func (x *JobStatusResponse) GetAlive() bool { - if x != nil { - return x.Alive - } - return false -} - -// S3LocationConfig represents S3 bucket configuration. -type S3LocationConfig struct { - state protoimpl.MessageState `protogen:"open.v1"` - Endpoint string `protobuf:"bytes,1,opt,name=endpoint,proto3" json:"endpoint,omitempty"` - AccessKey string `protobuf:"bytes,2,opt,name=access_key,json=accessKey,proto3" json:"access_key,omitempty"` - SecretKey string `protobuf:"bytes,3,opt,name=secret_key,json=secretKey,proto3" json:"secret_key,omitempty"` - BucketName string `protobuf:"bytes,4,opt,name=bucket_name,json=bucketName,proto3" json:"bucket_name,omitempty"` - BucketRegion string `protobuf:"bytes,5,opt,name=bucket_region,json=bucketRegion,proto3" json:"bucket_region,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *S3LocationConfig) Reset() { - *x = S3LocationConfig{} - mi := &file_agent_v1_agent_proto_msgTypes[30] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *S3LocationConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*S3LocationConfig) ProtoMessage() {} - -func (x *S3LocationConfig) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_agent_proto_msgTypes[30] - 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 S3LocationConfig.ProtoReflect.Descriptor instead. -func (*S3LocationConfig) Descriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{30} -} - -func (x *S3LocationConfig) GetEndpoint() string { - if x != nil { - return x.Endpoint - } - return "" -} - -func (x *S3LocationConfig) GetAccessKey() string { - if x != nil { - return x.AccessKey - } - return "" -} - -func (x *S3LocationConfig) GetSecretKey() string { - if x != nil { - return x.SecretKey - } - return "" -} - -func (x *S3LocationConfig) GetBucketName() string { - if x != nil { - return x.BucketName - } - return "" -} - -func (x *S3LocationConfig) GetBucketRegion() string { - if x != nil { - return x.BucketRegion - } - return "" -} - -// FilesystemLocationConfig represents path for storing backup artifacts locally. -type FilesystemLocationConfig struct { - state protoimpl.MessageState `protogen:"open.v1"` - Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *FilesystemLocationConfig) Reset() { - *x = FilesystemLocationConfig{} - mi := &file_agent_v1_agent_proto_msgTypes[31] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *FilesystemLocationConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FilesystemLocationConfig) ProtoMessage() {} - -func (x *FilesystemLocationConfig) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_agent_proto_msgTypes[31] - 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 FilesystemLocationConfig.ProtoReflect.Descriptor instead. -func (*FilesystemLocationConfig) Descriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{31} -} - -func (x *FilesystemLocationConfig) GetPath() string { - if x != nil { - return x.Path - } - return "" -} - -// StartJobRequest is a ServerMessage asking pmm-agent to start job. -type StartJobRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - JobId string `protobuf:"bytes,1,opt,name=job_id,json=jobId,proto3" json:"job_id,omitempty"` - // Timeout for the job. - Timeout *durationpb.Duration `protobuf:"bytes,2,opt,name=timeout,proto3" json:"timeout,omitempty"` - // Types that are valid to be assigned to Job: - // - // *StartJobRequest_MysqlBackup - // *StartJobRequest_MysqlRestoreBackup - // *StartJobRequest_MongodbBackup - // *StartJobRequest_MongodbRestoreBackup - Job isStartJobRequest_Job `protobuf_oneof:"job"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StartJobRequest) Reset() { - *x = StartJobRequest{} - mi := &file_agent_v1_agent_proto_msgTypes[32] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StartJobRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StartJobRequest) ProtoMessage() {} - -func (x *StartJobRequest) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_agent_proto_msgTypes[32] - 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 StartJobRequest.ProtoReflect.Descriptor instead. -func (*StartJobRequest) Descriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{32} -} - -func (x *StartJobRequest) GetJobId() string { - if x != nil { - return x.JobId - } - return "" -} - -func (x *StartJobRequest) GetTimeout() *durationpb.Duration { - if x != nil { - return x.Timeout - } - return nil -} - -func (x *StartJobRequest) GetJob() isStartJobRequest_Job { - if x != nil { - return x.Job - } - return nil -} - -func (x *StartJobRequest) GetMysqlBackup() *StartJobRequest_MySQLBackup { - if x != nil { - if x, ok := x.Job.(*StartJobRequest_MysqlBackup); ok { - return x.MysqlBackup - } - } - return nil -} - -func (x *StartJobRequest) GetMysqlRestoreBackup() *StartJobRequest_MySQLRestoreBackup { - if x != nil { - if x, ok := x.Job.(*StartJobRequest_MysqlRestoreBackup); ok { - return x.MysqlRestoreBackup - } - } - return nil -} - -func (x *StartJobRequest) GetMongodbBackup() *StartJobRequest_MongoDBBackup { - if x != nil { - if x, ok := x.Job.(*StartJobRequest_MongodbBackup); ok { - return x.MongodbBackup - } - } - return nil -} - -func (x *StartJobRequest) GetMongodbRestoreBackup() *StartJobRequest_MongoDBRestoreBackup { - if x != nil { - if x, ok := x.Job.(*StartJobRequest_MongodbRestoreBackup); ok { - return x.MongodbRestoreBackup - } - } - return nil -} - -type isStartJobRequest_Job interface { - isStartJobRequest_Job() -} - -type StartJobRequest_MysqlBackup struct { - MysqlBackup *StartJobRequest_MySQLBackup `protobuf:"bytes,11,opt,name=mysql_backup,json=mysqlBackup,proto3,oneof"` -} - -type StartJobRequest_MysqlRestoreBackup struct { - MysqlRestoreBackup *StartJobRequest_MySQLRestoreBackup `protobuf:"bytes,12,opt,name=mysql_restore_backup,json=mysqlRestoreBackup,proto3,oneof"` -} - -type StartJobRequest_MongodbBackup struct { - MongodbBackup *StartJobRequest_MongoDBBackup `protobuf:"bytes,13,opt,name=mongodb_backup,json=mongodbBackup,proto3,oneof"` -} - -type StartJobRequest_MongodbRestoreBackup struct { - MongodbRestoreBackup *StartJobRequest_MongoDBRestoreBackup `protobuf:"bytes,14,opt,name=mongodb_restore_backup,json=mongodbRestoreBackup,proto3,oneof"` -} - -func (*StartJobRequest_MysqlBackup) isStartJobRequest_Job() {} - -func (*StartJobRequest_MysqlRestoreBackup) isStartJobRequest_Job() {} - -func (*StartJobRequest_MongodbBackup) isStartJobRequest_Job() {} - -func (*StartJobRequest_MongodbRestoreBackup) isStartJobRequest_Job() {} - -// StartJobResponse is an AgentMessage for StartJobRequest acceptance. -type StartJobResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StartJobResponse) Reset() { - *x = StartJobResponse{} - mi := &file_agent_v1_agent_proto_msgTypes[33] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StartJobResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StartJobResponse) ProtoMessage() {} - -func (x *StartJobResponse) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_agent_proto_msgTypes[33] - 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 StartJobResponse.ProtoReflect.Descriptor instead. -func (*StartJobResponse) Descriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{33} -} - -func (x *StartJobResponse) GetError() string { - if x != nil { - return x.Error - } - return "" -} - -// StopJobRequest is a ServerMessage asking pmm-agent to stop job. -type StopJobRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - JobId string `protobuf:"bytes,1,opt,name=job_id,json=jobId,proto3" json:"job_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StopJobRequest) Reset() { - *x = StopJobRequest{} - mi := &file_agent_v1_agent_proto_msgTypes[34] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StopJobRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StopJobRequest) ProtoMessage() {} - -func (x *StopJobRequest) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_agent_proto_msgTypes[34] - 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 StopJobRequest.ProtoReflect.Descriptor instead. -func (*StopJobRequest) Descriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{34} -} - -func (x *StopJobRequest) GetJobId() string { - if x != nil { - return x.JobId - } - return "" -} - -// StopJobResponse is an AgentMessage for StopJobRequest acceptance. -type StopJobResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StopJobResponse) Reset() { - *x = StopJobResponse{} - mi := &file_agent_v1_agent_proto_msgTypes[35] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StopJobResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StopJobResponse) ProtoMessage() {} - -func (x *StopJobResponse) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_agent_proto_msgTypes[35] - 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 StopJobResponse.ProtoReflect.Descriptor instead. -func (*StopJobResponse) Descriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{35} -} - -// JobResult represents job result. -type JobResult struct { - state protoimpl.MessageState `protogen:"open.v1"` - JobId string `protobuf:"bytes,1,opt,name=job_id,json=jobId,proto3" json:"job_id,omitempty"` - Timestamp *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - // Types that are valid to be assigned to Result: - // - // *JobResult_Error_ - // *JobResult_MysqlBackup - // *JobResult_MysqlRestoreBackup - // *JobResult_MongodbBackup - // *JobResult_MongodbRestoreBackup - Result isJobResult_Result `protobuf_oneof:"result"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *JobResult) Reset() { - *x = JobResult{} - mi := &file_agent_v1_agent_proto_msgTypes[36] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *JobResult) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*JobResult) ProtoMessage() {} - -func (x *JobResult) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_agent_proto_msgTypes[36] - 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 JobResult.ProtoReflect.Descriptor instead. -func (*JobResult) Descriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{36} -} - -func (x *JobResult) GetJobId() string { - if x != nil { - return x.JobId - } - return "" -} - -func (x *JobResult) GetTimestamp() *timestamppb.Timestamp { - if x != nil { - return x.Timestamp - } - return nil -} - -func (x *JobResult) GetResult() isJobResult_Result { - if x != nil { - return x.Result - } - return nil -} - -func (x *JobResult) GetError() *JobResult_Error { - if x != nil { - if x, ok := x.Result.(*JobResult_Error_); ok { - return x.Error - } - } - return nil -} - -func (x *JobResult) GetMysqlBackup() *JobResult_MySQLBackup { - if x != nil { - if x, ok := x.Result.(*JobResult_MysqlBackup); ok { - return x.MysqlBackup - } - } - return nil -} - -func (x *JobResult) GetMysqlRestoreBackup() *JobResult_MySQLRestoreBackup { - if x != nil { - if x, ok := x.Result.(*JobResult_MysqlRestoreBackup); ok { - return x.MysqlRestoreBackup - } - } - return nil -} - -func (x *JobResult) GetMongodbBackup() *JobResult_MongoDBBackup { - if x != nil { - if x, ok := x.Result.(*JobResult_MongodbBackup); ok { - return x.MongodbBackup - } - } - return nil -} - -func (x *JobResult) GetMongodbRestoreBackup() *JobResult_MongoDBRestoreBackup { - if x != nil { - if x, ok := x.Result.(*JobResult_MongodbRestoreBackup); ok { - return x.MongodbRestoreBackup - } - } - return nil -} - -type isJobResult_Result interface { - isJobResult_Result() -} - -type JobResult_Error_ struct { - Error *JobResult_Error `protobuf:"bytes,10,opt,name=error,proto3,oneof"` -} - -type JobResult_MysqlBackup struct { - MysqlBackup *JobResult_MySQLBackup `protobuf:"bytes,12,opt,name=mysql_backup,json=mysqlBackup,proto3,oneof"` -} - -type JobResult_MysqlRestoreBackup struct { - MysqlRestoreBackup *JobResult_MySQLRestoreBackup `protobuf:"bytes,13,opt,name=mysql_restore_backup,json=mysqlRestoreBackup,proto3,oneof"` -} - -type JobResult_MongodbBackup struct { - MongodbBackup *JobResult_MongoDBBackup `protobuf:"bytes,14,opt,name=mongodb_backup,json=mongodbBackup,proto3,oneof"` -} - -type JobResult_MongodbRestoreBackup struct { - MongodbRestoreBackup *JobResult_MongoDBRestoreBackup `protobuf:"bytes,15,opt,name=mongodb_restore_backup,json=mongodbRestoreBackup,proto3,oneof"` -} - -func (*JobResult_Error_) isJobResult_Result() {} - -func (*JobResult_MysqlBackup) isJobResult_Result() {} - -func (*JobResult_MysqlRestoreBackup) isJobResult_Result() {} - -func (*JobResult_MongodbBackup) isJobResult_Result() {} - -func (*JobResult_MongodbRestoreBackup) isJobResult_Result() {} - -// JobProgress represents job progress messages like percentage of completion, status updates, etc. -type JobProgress struct { - state protoimpl.MessageState `protogen:"open.v1"` - JobId string `protobuf:"bytes,1,opt,name=job_id,json=jobId,proto3" json:"job_id,omitempty"` - Timestamp *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - // Types that are valid to be assigned to Result: - // - // *JobProgress_MysqlBackup - // *JobProgress_MysqlRestoreBackup - // *JobProgress_Logs_ - Result isJobProgress_Result `protobuf_oneof:"result"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *JobProgress) Reset() { - *x = JobProgress{} - mi := &file_agent_v1_agent_proto_msgTypes[37] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *JobProgress) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*JobProgress) ProtoMessage() {} - -func (x *JobProgress) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_agent_proto_msgTypes[37] - 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 JobProgress.ProtoReflect.Descriptor instead. -func (*JobProgress) Descriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{37} -} - -func (x *JobProgress) GetJobId() string { - if x != nil { - return x.JobId - } - return "" -} - -func (x *JobProgress) GetTimestamp() *timestamppb.Timestamp { - if x != nil { - return x.Timestamp - } - return nil -} - -func (x *JobProgress) GetResult() isJobProgress_Result { - if x != nil { - return x.Result - } - return nil -} - -func (x *JobProgress) GetMysqlBackup() *JobProgress_MySQLBackup { - if x != nil { - if x, ok := x.Result.(*JobProgress_MysqlBackup); ok { - return x.MysqlBackup - } - } - return nil -} - -func (x *JobProgress) GetMysqlRestoreBackup() *JobProgress_MySQLRestoreBackup { - if x != nil { - if x, ok := x.Result.(*JobProgress_MysqlRestoreBackup); ok { - return x.MysqlRestoreBackup - } - } - return nil -} - -func (x *JobProgress) GetLogs() *JobProgress_Logs { - if x != nil { - if x, ok := x.Result.(*JobProgress_Logs_); ok { - return x.Logs - } - } - return nil -} - -type isJobProgress_Result interface { - isJobProgress_Result() -} - -type JobProgress_MysqlBackup struct { - MysqlBackup *JobProgress_MySQLBackup `protobuf:"bytes,11,opt,name=mysql_backup,json=mysqlBackup,proto3,oneof"` -} - -type JobProgress_MysqlRestoreBackup struct { - MysqlRestoreBackup *JobProgress_MySQLRestoreBackup `protobuf:"bytes,12,opt,name=mysql_restore_backup,json=mysqlRestoreBackup,proto3,oneof"` -} - -type JobProgress_Logs_ struct { - Logs *JobProgress_Logs `protobuf:"bytes,20,opt,name=logs,proto3,oneof"` -} - -func (*JobProgress_MysqlBackup) isJobProgress_Result() {} - -func (*JobProgress_MysqlRestoreBackup) isJobProgress_Result() {} - -func (*JobProgress_Logs_) isJobProgress_Result() {} - -// GetVersionsRequest represents a request for version retrieving of different software. -type GetVersionsRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - Softwares []*GetVersionsRequest_Software `protobuf:"bytes,1,rep,name=softwares,proto3" json:"softwares,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetVersionsRequest) Reset() { - *x = GetVersionsRequest{} - mi := &file_agent_v1_agent_proto_msgTypes[38] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetVersionsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetVersionsRequest) ProtoMessage() {} - -func (x *GetVersionsRequest) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_agent_proto_msgTypes[38] - 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 GetVersionsRequest.ProtoReflect.Descriptor instead. -func (*GetVersionsRequest) Descriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{38} -} - -func (x *GetVersionsRequest) GetSoftwares() []*GetVersionsRequest_Software { - if x != nil { - return x.Softwares - } - return nil -} - -// GetVersionsResponse represents a response containing versions of software in the same order as in the request. -type GetVersionsResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Versions []*GetVersionsResponse_Version `protobuf:"bytes,1,rep,name=versions,proto3" json:"versions,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetVersionsResponse) Reset() { - *x = GetVersionsResponse{} - mi := &file_agent_v1_agent_proto_msgTypes[39] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetVersionsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetVersionsResponse) ProtoMessage() {} - -func (x *GetVersionsResponse) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_agent_proto_msgTypes[39] - 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 GetVersionsResponse.ProtoReflect.Descriptor instead. -func (*GetVersionsResponse) Descriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{39} -} - -func (x *GetVersionsResponse) GetVersions() []*GetVersionsResponse_Version { - if x != nil { - return x.Versions - } - return nil -} - -type AgentMessage struct { - state protoimpl.MessageState `protogen:"open.v1"` - Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - // The responder sets the status field in two situations: - // 1. When it received a request with the payload field not set. - // That means that responded is older than the requester, and doesn't know about newer payload types. - // Status code UNIMPLEMENTED (12) is reserved for that case. - // 2. When the payload is set, but the request can't be performed due to some error. - Status *status.Status `protobuf:"bytes,2047,opt,name=status,proto3" json:"status,omitempty"` - // Types that are valid to be assigned to Payload: - // - // *AgentMessage_Ping - // *AgentMessage_StateChanged - // *AgentMessage_QanCollect - // *AgentMessage_ActionResult - // *AgentMessage_JobResult - // *AgentMessage_JobProgress - // *AgentMessage_Pong - // *AgentMessage_SetState - // *AgentMessage_StartAction - // *AgentMessage_StopAction - // *AgentMessage_CheckConnection - // *AgentMessage_StartJob - // *AgentMessage_StopJob - // *AgentMessage_JobStatus - // *AgentMessage_GetVersions - // *AgentMessage_PbmSwitchPitr - // *AgentMessage_AgentLogs - // *AgentMessage_ServiceInfo - Payload isAgentMessage_Payload `protobuf_oneof:"payload"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AgentMessage) Reset() { - *x = AgentMessage{} - mi := &file_agent_v1_agent_proto_msgTypes[40] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AgentMessage) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AgentMessage) ProtoMessage() {} - -func (x *AgentMessage) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_agent_proto_msgTypes[40] - 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 AgentMessage.ProtoReflect.Descriptor instead. -func (*AgentMessage) Descriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{40} -} - -func (x *AgentMessage) GetId() uint32 { - if x != nil { - return x.Id - } - return 0 -} - -func (x *AgentMessage) GetStatus() *status.Status { - if x != nil { - return x.Status - } - return nil -} - -func (x *AgentMessage) GetPayload() isAgentMessage_Payload { - if x != nil { - return x.Payload - } - return nil -} - -func (x *AgentMessage) GetPing() *Ping { - if x != nil { - if x, ok := x.Payload.(*AgentMessage_Ping); ok { - return x.Ping - } - } - return nil -} - -func (x *AgentMessage) GetStateChanged() *StateChangedRequest { - if x != nil { - if x, ok := x.Payload.(*AgentMessage_StateChanged); ok { - return x.StateChanged - } - } - return nil -} - -func (x *AgentMessage) GetQanCollect() *QANCollectRequest { - if x != nil { - if x, ok := x.Payload.(*AgentMessage_QanCollect); ok { - return x.QanCollect - } - } - return nil -} - -func (x *AgentMessage) GetActionResult() *ActionResultRequest { - if x != nil { - if x, ok := x.Payload.(*AgentMessage_ActionResult); ok { - return x.ActionResult - } - } - return nil -} - -func (x *AgentMessage) GetJobResult() *JobResult { - if x != nil { - if x, ok := x.Payload.(*AgentMessage_JobResult); ok { - return x.JobResult - } - } - return nil -} - -func (x *AgentMessage) GetJobProgress() *JobProgress { - if x != nil { - if x, ok := x.Payload.(*AgentMessage_JobProgress); ok { - return x.JobProgress - } - } - return nil -} - -func (x *AgentMessage) GetPong() *Pong { - if x != nil { - if x, ok := x.Payload.(*AgentMessage_Pong); ok { - return x.Pong - } - } - return nil -} - -func (x *AgentMessage) GetSetState() *SetStateResponse { - if x != nil { - if x, ok := x.Payload.(*AgentMessage_SetState); ok { - return x.SetState - } - } - return nil -} - -func (x *AgentMessage) GetStartAction() *StartActionResponse { - if x != nil { - if x, ok := x.Payload.(*AgentMessage_StartAction); ok { - return x.StartAction - } - } - return nil -} - -func (x *AgentMessage) GetStopAction() *StopActionResponse { - if x != nil { - if x, ok := x.Payload.(*AgentMessage_StopAction); ok { - return x.StopAction - } - } - return nil -} - -func (x *AgentMessage) GetCheckConnection() *CheckConnectionResponse { - if x != nil { - if x, ok := x.Payload.(*AgentMessage_CheckConnection); ok { - return x.CheckConnection - } - } - return nil -} - -func (x *AgentMessage) GetStartJob() *StartJobResponse { - if x != nil { - if x, ok := x.Payload.(*AgentMessage_StartJob); ok { - return x.StartJob - } - } - return nil -} - -func (x *AgentMessage) GetStopJob() *StopJobResponse { - if x != nil { - if x, ok := x.Payload.(*AgentMessage_StopJob); ok { - return x.StopJob - } - } - return nil -} - -func (x *AgentMessage) GetJobStatus() *JobStatusResponse { - if x != nil { - if x, ok := x.Payload.(*AgentMessage_JobStatus); ok { - return x.JobStatus - } - } - return nil -} - -func (x *AgentMessage) GetGetVersions() *GetVersionsResponse { - if x != nil { - if x, ok := x.Payload.(*AgentMessage_GetVersions); ok { - return x.GetVersions - } - } - return nil -} - -func (x *AgentMessage) GetPbmSwitchPitr() *PBMSwitchPITRResponse { - if x != nil { - if x, ok := x.Payload.(*AgentMessage_PbmSwitchPitr); ok { - return x.PbmSwitchPitr - } - } - return nil -} - -func (x *AgentMessage) GetAgentLogs() *AgentLogsResponse { - if x != nil { - if x, ok := x.Payload.(*AgentMessage_AgentLogs); ok { - return x.AgentLogs - } - } - return nil -} - -func (x *AgentMessage) GetServiceInfo() *ServiceInfoResponse { - if x != nil { - if x, ok := x.Payload.(*AgentMessage_ServiceInfo); ok { - return x.ServiceInfo - } - } - return nil -} - -type isAgentMessage_Payload interface { - isAgentMessage_Payload() -} - -type AgentMessage_Ping struct { - // requests from agent - Ping *Ping `protobuf:"bytes,2,opt,name=ping,proto3,oneof"` -} - -type AgentMessage_StateChanged struct { - StateChanged *StateChangedRequest `protobuf:"bytes,3,opt,name=state_changed,json=stateChanged,proto3,oneof"` -} - -type AgentMessage_QanCollect struct { - QanCollect *QANCollectRequest `protobuf:"bytes,4,opt,name=qan_collect,json=qanCollect,proto3,oneof"` -} - -type AgentMessage_ActionResult struct { - ActionResult *ActionResultRequest `protobuf:"bytes,5,opt,name=action_result,json=actionResult,proto3,oneof"` -} - -type AgentMessage_JobResult struct { - JobResult *JobResult `protobuf:"bytes,16,opt,name=job_result,json=jobResult,proto3,oneof"` -} - -type AgentMessage_JobProgress struct { - JobProgress *JobProgress `protobuf:"bytes,17,opt,name=job_progress,json=jobProgress,proto3,oneof"` -} - -type AgentMessage_Pong struct { - // responses from agent - Pong *Pong `protobuf:"bytes,8,opt,name=pong,proto3,oneof"` -} - -type AgentMessage_SetState struct { - SetState *SetStateResponse `protobuf:"bytes,9,opt,name=set_state,json=setState,proto3,oneof"` -} - -type AgentMessage_StartAction struct { - StartAction *StartActionResponse `protobuf:"bytes,10,opt,name=start_action,json=startAction,proto3,oneof"` -} - -type AgentMessage_StopAction struct { - StopAction *StopActionResponse `protobuf:"bytes,11,opt,name=stop_action,json=stopAction,proto3,oneof"` -} - -type AgentMessage_CheckConnection struct { - CheckConnection *CheckConnectionResponse `protobuf:"bytes,12,opt,name=check_connection,json=checkConnection,proto3,oneof"` -} - -type AgentMessage_StartJob struct { - StartJob *StartJobResponse `protobuf:"bytes,13,opt,name=start_job,json=startJob,proto3,oneof"` -} - -type AgentMessage_StopJob struct { - StopJob *StopJobResponse `protobuf:"bytes,14,opt,name=stop_job,json=stopJob,proto3,oneof"` -} - -type AgentMessage_JobStatus struct { - JobStatus *JobStatusResponse `protobuf:"bytes,15,opt,name=job_status,json=jobStatus,proto3,oneof"` -} - -type AgentMessage_GetVersions struct { - GetVersions *GetVersionsResponse `protobuf:"bytes,18,opt,name=get_versions,json=getVersions,proto3,oneof"` -} - -type AgentMessage_PbmSwitchPitr struct { - PbmSwitchPitr *PBMSwitchPITRResponse `protobuf:"bytes,19,opt,name=pbm_switch_pitr,json=pbmSwitchPitr,proto3,oneof"` -} - -type AgentMessage_AgentLogs struct { - AgentLogs *AgentLogsResponse `protobuf:"bytes,21,opt,name=agent_logs,json=agentLogs,proto3,oneof"` -} - -type AgentMessage_ServiceInfo struct { - ServiceInfo *ServiceInfoResponse `protobuf:"bytes,22,opt,name=service_info,json=serviceInfo,proto3,oneof"` -} - -func (*AgentMessage_Ping) isAgentMessage_Payload() {} - -func (*AgentMessage_StateChanged) isAgentMessage_Payload() {} - -func (*AgentMessage_QanCollect) isAgentMessage_Payload() {} - -func (*AgentMessage_ActionResult) isAgentMessage_Payload() {} - -func (*AgentMessage_JobResult) isAgentMessage_Payload() {} - -func (*AgentMessage_JobProgress) isAgentMessage_Payload() {} - -func (*AgentMessage_Pong) isAgentMessage_Payload() {} - -func (*AgentMessage_SetState) isAgentMessage_Payload() {} - -func (*AgentMessage_StartAction) isAgentMessage_Payload() {} - -func (*AgentMessage_StopAction) isAgentMessage_Payload() {} - -func (*AgentMessage_CheckConnection) isAgentMessage_Payload() {} - -func (*AgentMessage_StartJob) isAgentMessage_Payload() {} - -func (*AgentMessage_StopJob) isAgentMessage_Payload() {} - -func (*AgentMessage_JobStatus) isAgentMessage_Payload() {} - -func (*AgentMessage_GetVersions) isAgentMessage_Payload() {} - -func (*AgentMessage_PbmSwitchPitr) isAgentMessage_Payload() {} - -func (*AgentMessage_AgentLogs) isAgentMessage_Payload() {} - -func (*AgentMessage_ServiceInfo) isAgentMessage_Payload() {} - -type ServerMessage struct { - state protoimpl.MessageState `protogen:"open.v1"` - Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - // The responder sets the status field in two situations: - // 1. When it received a request with the payload field not set. - // That means that responded is older than the requester, and doesn't know about newer payload types. - // Status code UNIMPLEMENTED (12) is reserved for that case. - // 2. When the payload is set, but the request can't be performed due to some error. - Status *status.Status `protobuf:"bytes,2047,opt,name=status,proto3" json:"status,omitempty"` - // Types that are valid to be assigned to Payload: - // - // *ServerMessage_Pong - // *ServerMessage_StateChanged - // *ServerMessage_QanCollect - // *ServerMessage_ActionResult - // *ServerMessage_Ping - // *ServerMessage_SetState - // *ServerMessage_StartAction - // *ServerMessage_StopAction - // *ServerMessage_CheckConnection - // *ServerMessage_StartJob - // *ServerMessage_StopJob - // *ServerMessage_JobStatus - // *ServerMessage_GetVersions - // *ServerMessage_PbmSwitchPitr - // *ServerMessage_AgentLogs - // *ServerMessage_ServiceInfo - Payload isServerMessage_Payload `protobuf_oneof:"payload"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ServerMessage) Reset() { - *x = ServerMessage{} - mi := &file_agent_v1_agent_proto_msgTypes[41] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ServerMessage) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ServerMessage) ProtoMessage() {} - -func (x *ServerMessage) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_agent_proto_msgTypes[41] - 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 ServerMessage.ProtoReflect.Descriptor instead. -func (*ServerMessage) Descriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{41} -} - -func (x *ServerMessage) GetId() uint32 { - if x != nil { - return x.Id - } - return 0 -} - -func (x *ServerMessage) GetStatus() *status.Status { - if x != nil { - return x.Status - } - return nil -} - -func (x *ServerMessage) GetPayload() isServerMessage_Payload { - if x != nil { - return x.Payload - } - return nil -} - -func (x *ServerMessage) GetPong() *Pong { - if x != nil { - if x, ok := x.Payload.(*ServerMessage_Pong); ok { - return x.Pong - } - } - return nil -} - -func (x *ServerMessage) GetStateChanged() *StateChangedResponse { - if x != nil { - if x, ok := x.Payload.(*ServerMessage_StateChanged); ok { - return x.StateChanged - } - } - return nil -} - -func (x *ServerMessage) GetQanCollect() *QANCollectResponse { - if x != nil { - if x, ok := x.Payload.(*ServerMessage_QanCollect); ok { - return x.QanCollect - } - } - return nil -} - -func (x *ServerMessage) GetActionResult() *ActionResultResponse { - if x != nil { - if x, ok := x.Payload.(*ServerMessage_ActionResult); ok { - return x.ActionResult - } - } - return nil -} - -func (x *ServerMessage) GetPing() *Ping { - if x != nil { - if x, ok := x.Payload.(*ServerMessage_Ping); ok { - return x.Ping - } - } - return nil -} - -func (x *ServerMessage) GetSetState() *SetStateRequest { - if x != nil { - if x, ok := x.Payload.(*ServerMessage_SetState); ok { - return x.SetState - } - } - return nil -} - -func (x *ServerMessage) GetStartAction() *StartActionRequest { - if x != nil { - if x, ok := x.Payload.(*ServerMessage_StartAction); ok { - return x.StartAction - } - } - return nil -} - -func (x *ServerMessage) GetStopAction() *StopActionRequest { - if x != nil { - if x, ok := x.Payload.(*ServerMessage_StopAction); ok { - return x.StopAction - } - } - return nil -} - -func (x *ServerMessage) GetCheckConnection() *CheckConnectionRequest { - if x != nil { - if x, ok := x.Payload.(*ServerMessage_CheckConnection); ok { - return x.CheckConnection - } - } - return nil -} - -func (x *ServerMessage) GetStartJob() *StartJobRequest { - if x != nil { - if x, ok := x.Payload.(*ServerMessage_StartJob); ok { - return x.StartJob - } - } - return nil -} - -func (x *ServerMessage) GetStopJob() *StopJobRequest { - if x != nil { - if x, ok := x.Payload.(*ServerMessage_StopJob); ok { - return x.StopJob - } - } - return nil -} - -func (x *ServerMessage) GetJobStatus() *JobStatusRequest { - if x != nil { - if x, ok := x.Payload.(*ServerMessage_JobStatus); ok { - return x.JobStatus - } - } - return nil -} - -func (x *ServerMessage) GetGetVersions() *GetVersionsRequest { - if x != nil { - if x, ok := x.Payload.(*ServerMessage_GetVersions); ok { - return x.GetVersions - } - } - return nil -} - -func (x *ServerMessage) GetPbmSwitchPitr() *PBMSwitchPITRRequest { - if x != nil { - if x, ok := x.Payload.(*ServerMessage_PbmSwitchPitr); ok { - return x.PbmSwitchPitr - } - } - return nil -} - -func (x *ServerMessage) GetAgentLogs() *AgentLogsRequest { - if x != nil { - if x, ok := x.Payload.(*ServerMessage_AgentLogs); ok { - return x.AgentLogs - } - } - return nil -} - -func (x *ServerMessage) GetServiceInfo() *ServiceInfoRequest { - if x != nil { - if x, ok := x.Payload.(*ServerMessage_ServiceInfo); ok { - return x.ServiceInfo - } - } - return nil -} - -type isServerMessage_Payload interface { - isServerMessage_Payload() -} - -type ServerMessage_Pong struct { - // responses from server - Pong *Pong `protobuf:"bytes,2,opt,name=pong,proto3,oneof"` -} - -type ServerMessage_StateChanged struct { - StateChanged *StateChangedResponse `protobuf:"bytes,3,opt,name=state_changed,json=stateChanged,proto3,oneof"` -} - -type ServerMessage_QanCollect struct { - QanCollect *QANCollectResponse `protobuf:"bytes,4,opt,name=qan_collect,json=qanCollect,proto3,oneof"` -} - -type ServerMessage_ActionResult struct { - ActionResult *ActionResultResponse `protobuf:"bytes,5,opt,name=action_result,json=actionResult,proto3,oneof"` -} - -type ServerMessage_Ping struct { - // requests from server - Ping *Ping `protobuf:"bytes,8,opt,name=ping,proto3,oneof"` -} - -type ServerMessage_SetState struct { - SetState *SetStateRequest `protobuf:"bytes,9,opt,name=set_state,json=setState,proto3,oneof"` -} - -type ServerMessage_StartAction struct { - StartAction *StartActionRequest `protobuf:"bytes,10,opt,name=start_action,json=startAction,proto3,oneof"` -} - -type ServerMessage_StopAction struct { - StopAction *StopActionRequest `protobuf:"bytes,11,opt,name=stop_action,json=stopAction,proto3,oneof"` -} - -type ServerMessage_CheckConnection struct { - CheckConnection *CheckConnectionRequest `protobuf:"bytes,12,opt,name=check_connection,json=checkConnection,proto3,oneof"` -} - -type ServerMessage_StartJob struct { - StartJob *StartJobRequest `protobuf:"bytes,13,opt,name=start_job,json=startJob,proto3,oneof"` -} - -type ServerMessage_StopJob struct { - StopJob *StopJobRequest `protobuf:"bytes,14,opt,name=stop_job,json=stopJob,proto3,oneof"` -} - -type ServerMessage_JobStatus struct { - JobStatus *JobStatusRequest `protobuf:"bytes,15,opt,name=job_status,json=jobStatus,proto3,oneof"` -} - -type ServerMessage_GetVersions struct { - GetVersions *GetVersionsRequest `protobuf:"bytes,16,opt,name=get_versions,json=getVersions,proto3,oneof"` -} - -type ServerMessage_PbmSwitchPitr struct { - PbmSwitchPitr *PBMSwitchPITRRequest `protobuf:"bytes,17,opt,name=pbm_switch_pitr,json=pbmSwitchPitr,proto3,oneof"` -} - -type ServerMessage_AgentLogs struct { - AgentLogs *AgentLogsRequest `protobuf:"bytes,19,opt,name=agent_logs,json=agentLogs,proto3,oneof"` -} - -type ServerMessage_ServiceInfo struct { - ServiceInfo *ServiceInfoRequest `protobuf:"bytes,20,opt,name=service_info,json=serviceInfo,proto3,oneof"` -} - -func (*ServerMessage_Pong) isServerMessage_Payload() {} - -func (*ServerMessage_StateChanged) isServerMessage_Payload() {} - -func (*ServerMessage_QanCollect) isServerMessage_Payload() {} - -func (*ServerMessage_ActionResult) isServerMessage_Payload() {} - -func (*ServerMessage_Ping) isServerMessage_Payload() {} - -func (*ServerMessage_SetState) isServerMessage_Payload() {} - -func (*ServerMessage_StartAction) isServerMessage_Payload() {} - -func (*ServerMessage_StopAction) isServerMessage_Payload() {} - -func (*ServerMessage_CheckConnection) isServerMessage_Payload() {} - -func (*ServerMessage_StartJob) isServerMessage_Payload() {} - -func (*ServerMessage_StopJob) isServerMessage_Payload() {} - -func (*ServerMessage_JobStatus) isServerMessage_Payload() {} - -func (*ServerMessage_GetVersions) isServerMessage_Payload() {} - -func (*ServerMessage_PbmSwitchPitr) isServerMessage_Payload() {} - -func (*ServerMessage_AgentLogs) isServerMessage_Payload() {} - -func (*ServerMessage_ServiceInfo) isServerMessage_Payload() {} - -// AgentProcess describes desired configuration of a single agent process started by pmm-agent. -type SetStateRequest_AgentProcess struct { - state protoimpl.MessageState `protogen:"open.v1"` - Type v1.AgentType `protobuf:"varint,1,opt,name=type,proto3,enum=inventory.v1.AgentType" json:"type,omitempty"` - TemplateLeftDelim string `protobuf:"bytes,2,opt,name=template_left_delim,json=templateLeftDelim,proto3" json:"template_left_delim,omitempty"` - TemplateRightDelim string `protobuf:"bytes,3,opt,name=template_right_delim,json=templateRightDelim,proto3" json:"template_right_delim,omitempty"` - Args []string `protobuf:"bytes,4,rep,name=args,proto3" json:"args,omitempty"` - Env []string `protobuf:"bytes,5,rep,name=env,proto3" json:"env,omitempty"` - TextFiles map[string]string `protobuf:"bytes,6,rep,name=text_files,json=textFiles,proto3" json:"text_files,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - RedactWords []string `protobuf:"bytes,7,rep,name=redact_words,json=redactWords,proto3" json:"redact_words,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SetStateRequest_AgentProcess) Reset() { - *x = SetStateRequest_AgentProcess{} - mi := &file_agent_v1_agent_proto_msgTypes[43] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SetStateRequest_AgentProcess) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SetStateRequest_AgentProcess) ProtoMessage() {} - -func (x *SetStateRequest_AgentProcess) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_agent_proto_msgTypes[43] - 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 SetStateRequest_AgentProcess.ProtoReflect.Descriptor instead. -func (*SetStateRequest_AgentProcess) Descriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{7, 0} -} - -func (x *SetStateRequest_AgentProcess) GetType() v1.AgentType { - if x != nil { - return x.Type - } - return v1.AgentType(0) -} - -func (x *SetStateRequest_AgentProcess) GetTemplateLeftDelim() string { - if x != nil { - return x.TemplateLeftDelim - } - return "" -} - -func (x *SetStateRequest_AgentProcess) GetTemplateRightDelim() string { - if x != nil { - return x.TemplateRightDelim - } - return "" -} - -func (x *SetStateRequest_AgentProcess) GetArgs() []string { - if x != nil { - return x.Args - } - return nil -} - -func (x *SetStateRequest_AgentProcess) GetEnv() []string { - if x != nil { - return x.Env - } - return nil -} - -func (x *SetStateRequest_AgentProcess) GetTextFiles() map[string]string { - if x != nil { - return x.TextFiles - } - return nil -} - -func (x *SetStateRequest_AgentProcess) GetRedactWords() []string { - if x != nil { - return x.RedactWords - } - return nil -} - -// BuiltinAgent describes desired configuration of a single built-in agent for pmm-agent. -type SetStateRequest_BuiltinAgent struct { - state protoimpl.MessageState `protogen:"open.v1"` - Type v1.AgentType `protobuf:"varint,1,opt,name=type,proto3,enum=inventory.v1.AgentType" json:"type,omitempty"` - Dsn string `protobuf:"bytes,2,opt,name=dsn,proto3" json:"dsn,omitempty"` - // Limit query length in QAN (default: server-defined; -1: no limit). - MaxQueryLength int32 `protobuf:"varint,3,opt,name=max_query_length,json=maxQueryLength,proto3" json:"max_query_length,omitempty"` - // Disable parsing comments from queries and showing them in QAN. - DisableCommentsParsing bool `protobuf:"varint,4,opt,name=disable_comments_parsing,json=disableCommentsParsing,proto3" json:"disable_comments_parsing,omitempty"` - // Disables query examples for QAN Agents if true. - DisableQueryExamples bool `protobuf:"varint,5,opt,name=disable_query_examples,json=disableQueryExamples,proto3" json:"disable_query_examples,omitempty"` - // Instructs QAN Agents to rotate query log file or table at this size if > 0. - MaxQueryLogSize int64 `protobuf:"varint,6,opt,name=max_query_log_size,json=maxQueryLogSize,proto3" json:"max_query_log_size,omitempty"` - // Contains files and their contents which can be used in DSN. - TextFiles *TextFiles `protobuf:"bytes,7,opt,name=text_files,json=textFiles,proto3" json:"text_files,omitempty"` - // TLS in enabled if true. - Tls bool `protobuf:"varint,8,opt,name=tls,proto3" json:"tls,omitempty"` - // TLS certificate wont be verified. - TlsSkipVerify bool `protobuf:"varint,9,opt,name=tls_skip_verify,json=tlsSkipVerify,proto3" json:"tls_skip_verify,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SetStateRequest_BuiltinAgent) Reset() { - *x = SetStateRequest_BuiltinAgent{} - mi := &file_agent_v1_agent_proto_msgTypes[45] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SetStateRequest_BuiltinAgent) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SetStateRequest_BuiltinAgent) ProtoMessage() {} - -func (x *SetStateRequest_BuiltinAgent) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_agent_proto_msgTypes[45] - 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 SetStateRequest_BuiltinAgent.ProtoReflect.Descriptor instead. -func (*SetStateRequest_BuiltinAgent) Descriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{7, 2} -} - -func (x *SetStateRequest_BuiltinAgent) GetType() v1.AgentType { - if x != nil { - return x.Type - } - return v1.AgentType(0) -} - -func (x *SetStateRequest_BuiltinAgent) GetDsn() string { - if x != nil { - return x.Dsn - } - return "" -} - -func (x *SetStateRequest_BuiltinAgent) GetMaxQueryLength() int32 { - if x != nil { - return x.MaxQueryLength - } - return 0 -} - -func (x *SetStateRequest_BuiltinAgent) GetDisableCommentsParsing() bool { - if x != nil { - return x.DisableCommentsParsing - } - return false -} - -func (x *SetStateRequest_BuiltinAgent) GetDisableQueryExamples() bool { - if x != nil { - return x.DisableQueryExamples - } - return false -} - -func (x *SetStateRequest_BuiltinAgent) GetMaxQueryLogSize() int64 { - if x != nil { - return x.MaxQueryLogSize - } - return 0 -} - -func (x *SetStateRequest_BuiltinAgent) GetTextFiles() *TextFiles { - if x != nil { - return x.TextFiles - } - return nil -} - -func (x *SetStateRequest_BuiltinAgent) GetTls() bool { - if x != nil { - return x.Tls - } - return false -} - -func (x *SetStateRequest_BuiltinAgent) GetTlsSkipVerify() bool { - if x != nil { - return x.TlsSkipVerify - } - return false -} - -// MySQLExplainParams describes MySQL EXPLAIN action parameters. -type StartActionRequest_MySQLExplainParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - // DSN for the service. May contain connection (dial) timeout. - Dsn string `protobuf:"bytes,1,opt,name=dsn,proto3" json:"dsn,omitempty"` - Query string `protobuf:"bytes,2,opt,name=query,proto3" json:"query,omitempty"` - Values []string `protobuf:"bytes,3,rep,name=values,proto3" json:"values,omitempty"` - Schema string `protobuf:"bytes,4,opt,name=schema,proto3" json:"schema,omitempty"` - OutputFormat MysqlExplainOutputFormat `protobuf:"varint,5,opt,name=output_format,json=outputFormat,proto3,enum=agent.v1.MysqlExplainOutputFormat" json:"output_format,omitempty"` - // Contains files and their contents which can be used in DSN. - TlsFiles *TextFiles `protobuf:"bytes,6,opt,name=tls_files,json=tlsFiles,proto3" json:"tls_files,omitempty"` - // TLS certificate wont be verified. - TlsSkipVerify bool `protobuf:"varint,7,opt,name=tls_skip_verify,json=tlsSkipVerify,proto3" json:"tls_skip_verify,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StartActionRequest_MySQLExplainParams) Reset() { - *x = StartActionRequest_MySQLExplainParams{} - mi := &file_agent_v1_agent_proto_msgTypes[49] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StartActionRequest_MySQLExplainParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StartActionRequest_MySQLExplainParams) ProtoMessage() {} - -func (x *StartActionRequest_MySQLExplainParams) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_agent_proto_msgTypes[49] - 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 StartActionRequest_MySQLExplainParams.ProtoReflect.Descriptor instead. -func (*StartActionRequest_MySQLExplainParams) Descriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{14, 0} -} - -func (x *StartActionRequest_MySQLExplainParams) GetDsn() string { - if x != nil { - return x.Dsn - } - return "" -} - -func (x *StartActionRequest_MySQLExplainParams) GetQuery() string { - if x != nil { - return x.Query - } - return "" -} - -func (x *StartActionRequest_MySQLExplainParams) GetValues() []string { - if x != nil { - return x.Values - } - return nil -} - -func (x *StartActionRequest_MySQLExplainParams) GetSchema() string { - if x != nil { - return x.Schema - } - return "" -} - -func (x *StartActionRequest_MySQLExplainParams) GetOutputFormat() MysqlExplainOutputFormat { - if x != nil { - return x.OutputFormat - } - return MysqlExplainOutputFormat_MYSQL_EXPLAIN_OUTPUT_FORMAT_UNSPECIFIED -} - -func (x *StartActionRequest_MySQLExplainParams) GetTlsFiles() *TextFiles { - if x != nil { - return x.TlsFiles - } - return nil -} - -func (x *StartActionRequest_MySQLExplainParams) GetTlsSkipVerify() bool { - if x != nil { - return x.TlsSkipVerify - } - return false -} - -// MySQLShowCreateTableParams describes MySQL SHOW CREATE TABLE action parameters. -type StartActionRequest_MySQLShowCreateTableParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - // DSN for the service. May contain connection (dial) timeout. - Dsn string `protobuf:"bytes,1,opt,name=dsn,proto3" json:"dsn,omitempty"` - Table string `protobuf:"bytes,2,opt,name=table,proto3" json:"table,omitempty"` - // Contains files and their contents which can be used in DSN. - TlsFiles *TextFiles `protobuf:"bytes,3,opt,name=tls_files,json=tlsFiles,proto3" json:"tls_files,omitempty"` - // TLS certificate wont be verified. - TlsSkipVerify bool `protobuf:"varint,4,opt,name=tls_skip_verify,json=tlsSkipVerify,proto3" json:"tls_skip_verify,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StartActionRequest_MySQLShowCreateTableParams) Reset() { - *x = StartActionRequest_MySQLShowCreateTableParams{} - mi := &file_agent_v1_agent_proto_msgTypes[50] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StartActionRequest_MySQLShowCreateTableParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StartActionRequest_MySQLShowCreateTableParams) ProtoMessage() {} - -func (x *StartActionRequest_MySQLShowCreateTableParams) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_agent_proto_msgTypes[50] - 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 StartActionRequest_MySQLShowCreateTableParams.ProtoReflect.Descriptor instead. -func (*StartActionRequest_MySQLShowCreateTableParams) Descriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{14, 1} -} - -func (x *StartActionRequest_MySQLShowCreateTableParams) GetDsn() string { - if x != nil { - return x.Dsn - } - return "" -} - -func (x *StartActionRequest_MySQLShowCreateTableParams) GetTable() string { - if x != nil { - return x.Table - } - return "" -} - -func (x *StartActionRequest_MySQLShowCreateTableParams) GetTlsFiles() *TextFiles { - if x != nil { - return x.TlsFiles - } - return nil -} - -func (x *StartActionRequest_MySQLShowCreateTableParams) GetTlsSkipVerify() bool { - if x != nil { - return x.TlsSkipVerify - } - return false -} - -// MySQLShowTableStatusParams describes MySQL SHOW TABLE STATUS action parameters. -type StartActionRequest_MySQLShowTableStatusParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - // DSN for the service. May contain connection (dial) timeout. - Dsn string `protobuf:"bytes,1,opt,name=dsn,proto3" json:"dsn,omitempty"` - Table string `protobuf:"bytes,2,opt,name=table,proto3" json:"table,omitempty"` - // Contains files and their contents which can be used in DSN. - TlsFiles *TextFiles `protobuf:"bytes,3,opt,name=tls_files,json=tlsFiles,proto3" json:"tls_files,omitempty"` - // TLS certificate wont be verified. - TlsSkipVerify bool `protobuf:"varint,4,opt,name=tls_skip_verify,json=tlsSkipVerify,proto3" json:"tls_skip_verify,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StartActionRequest_MySQLShowTableStatusParams) Reset() { - *x = StartActionRequest_MySQLShowTableStatusParams{} - mi := &file_agent_v1_agent_proto_msgTypes[51] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StartActionRequest_MySQLShowTableStatusParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StartActionRequest_MySQLShowTableStatusParams) ProtoMessage() {} - -func (x *StartActionRequest_MySQLShowTableStatusParams) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_agent_proto_msgTypes[51] - 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 StartActionRequest_MySQLShowTableStatusParams.ProtoReflect.Descriptor instead. -func (*StartActionRequest_MySQLShowTableStatusParams) Descriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{14, 2} -} - -func (x *StartActionRequest_MySQLShowTableStatusParams) GetDsn() string { - if x != nil { - return x.Dsn - } - return "" -} - -func (x *StartActionRequest_MySQLShowTableStatusParams) GetTable() string { - if x != nil { - return x.Table - } - return "" -} - -func (x *StartActionRequest_MySQLShowTableStatusParams) GetTlsFiles() *TextFiles { - if x != nil { - return x.TlsFiles - } - return nil -} - -func (x *StartActionRequest_MySQLShowTableStatusParams) GetTlsSkipVerify() bool { - if x != nil { - return x.TlsSkipVerify - } - return false -} - -// MySQLShowIndexParams describes MySQL SHOW INDEX action parameters. -type StartActionRequest_MySQLShowIndexParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - // DSN for the service. May contain connection (dial) timeout. - Dsn string `protobuf:"bytes,1,opt,name=dsn,proto3" json:"dsn,omitempty"` - Table string `protobuf:"bytes,2,opt,name=table,proto3" json:"table,omitempty"` - // Contains files and their contents which can be used in DSN. - TlsFiles *TextFiles `protobuf:"bytes,3,opt,name=tls_files,json=tlsFiles,proto3" json:"tls_files,omitempty"` - // TLS certificate wont be verified. - TlsSkipVerify bool `protobuf:"varint,4,opt,name=tls_skip_verify,json=tlsSkipVerify,proto3" json:"tls_skip_verify,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StartActionRequest_MySQLShowIndexParams) Reset() { - *x = StartActionRequest_MySQLShowIndexParams{} - mi := &file_agent_v1_agent_proto_msgTypes[52] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StartActionRequest_MySQLShowIndexParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StartActionRequest_MySQLShowIndexParams) ProtoMessage() {} - -func (x *StartActionRequest_MySQLShowIndexParams) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_agent_proto_msgTypes[52] - 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 StartActionRequest_MySQLShowIndexParams.ProtoReflect.Descriptor instead. -func (*StartActionRequest_MySQLShowIndexParams) Descriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{14, 3} -} - -func (x *StartActionRequest_MySQLShowIndexParams) GetDsn() string { - if x != nil { - return x.Dsn - } - return "" -} - -func (x *StartActionRequest_MySQLShowIndexParams) GetTable() string { - if x != nil { - return x.Table - } - return "" -} - -func (x *StartActionRequest_MySQLShowIndexParams) GetTlsFiles() *TextFiles { - if x != nil { - return x.TlsFiles - } - return nil -} - -func (x *StartActionRequest_MySQLShowIndexParams) GetTlsSkipVerify() bool { - if x != nil { - return x.TlsSkipVerify - } - return false -} - -// PostgreSQLShowCreateTableParams describes PostgreSQL SHOW CREATE TABLE action parameters. -type StartActionRequest_PostgreSQLShowCreateTableParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - // DSN for the service. May contain connection (dial) timeout. - Dsn string `protobuf:"bytes,1,opt,name=dsn,proto3" json:"dsn,omitempty"` - Table string `protobuf:"bytes,2,opt,name=table,proto3" json:"table,omitempty"` - // Contains files and their contents which can be used in DSN. - TlsFiles *TextFiles `protobuf:"bytes,3,opt,name=tls_files,json=tlsFiles,proto3" json:"tls_files,omitempty"` - // TLS certificate wont be verified. - TlsSkipVerify bool `protobuf:"varint,4,opt,name=tls_skip_verify,json=tlsSkipVerify,proto3" json:"tls_skip_verify,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StartActionRequest_PostgreSQLShowCreateTableParams) Reset() { - *x = StartActionRequest_PostgreSQLShowCreateTableParams{} - mi := &file_agent_v1_agent_proto_msgTypes[53] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StartActionRequest_PostgreSQLShowCreateTableParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StartActionRequest_PostgreSQLShowCreateTableParams) ProtoMessage() {} - -func (x *StartActionRequest_PostgreSQLShowCreateTableParams) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_agent_proto_msgTypes[53] - 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 StartActionRequest_PostgreSQLShowCreateTableParams.ProtoReflect.Descriptor instead. -func (*StartActionRequest_PostgreSQLShowCreateTableParams) Descriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{14, 4} -} - -func (x *StartActionRequest_PostgreSQLShowCreateTableParams) GetDsn() string { - if x != nil { - return x.Dsn - } - return "" -} - -func (x *StartActionRequest_PostgreSQLShowCreateTableParams) GetTable() string { - if x != nil { - return x.Table - } - return "" -} - -func (x *StartActionRequest_PostgreSQLShowCreateTableParams) GetTlsFiles() *TextFiles { - if x != nil { - return x.TlsFiles - } - return nil -} - -func (x *StartActionRequest_PostgreSQLShowCreateTableParams) GetTlsSkipVerify() bool { - if x != nil { - return x.TlsSkipVerify - } - return false -} - -// PostgreSQLShowIndexParams describes PostgreSQL SHOW INDEX action parameters. -type StartActionRequest_PostgreSQLShowIndexParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - // DSN for the service. May contain connection (dial) timeout. - Dsn string `protobuf:"bytes,1,opt,name=dsn,proto3" json:"dsn,omitempty"` - Table string `protobuf:"bytes,2,opt,name=table,proto3" json:"table,omitempty"` - // Contains files and their contents which can be used in DSN. - TlsFiles *TextFiles `protobuf:"bytes,3,opt,name=tls_files,json=tlsFiles,proto3" json:"tls_files,omitempty"` - // TLS certificate wont be verified. - TlsSkipVerify bool `protobuf:"varint,4,opt,name=tls_skip_verify,json=tlsSkipVerify,proto3" json:"tls_skip_verify,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StartActionRequest_PostgreSQLShowIndexParams) Reset() { - *x = StartActionRequest_PostgreSQLShowIndexParams{} - mi := &file_agent_v1_agent_proto_msgTypes[54] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StartActionRequest_PostgreSQLShowIndexParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StartActionRequest_PostgreSQLShowIndexParams) ProtoMessage() {} - -func (x *StartActionRequest_PostgreSQLShowIndexParams) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_agent_proto_msgTypes[54] - 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 StartActionRequest_PostgreSQLShowIndexParams.ProtoReflect.Descriptor instead. -func (*StartActionRequest_PostgreSQLShowIndexParams) Descriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{14, 5} -} - -func (x *StartActionRequest_PostgreSQLShowIndexParams) GetDsn() string { - if x != nil { - return x.Dsn - } - return "" -} - -func (x *StartActionRequest_PostgreSQLShowIndexParams) GetTable() string { - if x != nil { - return x.Table - } - return "" -} - -func (x *StartActionRequest_PostgreSQLShowIndexParams) GetTlsFiles() *TextFiles { - if x != nil { - return x.TlsFiles - } - return nil -} - -func (x *StartActionRequest_PostgreSQLShowIndexParams) GetTlsSkipVerify() bool { - if x != nil { - return x.TlsSkipVerify - } - return false -} - -// MongoDBExplainParams describes MongoDB EXPLAIN action parameters. -type StartActionRequest_MongoDBExplainParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - // DSN for the service. May contain connection (dial) timeout. - // May contain placeholders for file paths in DSN. - Dsn string `protobuf:"bytes,1,opt,name=dsn,proto3" json:"dsn,omitempty"` - Query string `protobuf:"bytes,2,opt,name=query,proto3" json:"query,omitempty"` - // Contains files and their contents which can be used in DSN. - TextFiles *TextFiles `protobuf:"bytes,3,opt,name=text_files,json=textFiles,proto3" json:"text_files,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StartActionRequest_MongoDBExplainParams) Reset() { - *x = StartActionRequest_MongoDBExplainParams{} - mi := &file_agent_v1_agent_proto_msgTypes[55] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StartActionRequest_MongoDBExplainParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StartActionRequest_MongoDBExplainParams) ProtoMessage() {} - -func (x *StartActionRequest_MongoDBExplainParams) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_agent_proto_msgTypes[55] - 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 StartActionRequest_MongoDBExplainParams.ProtoReflect.Descriptor instead. -func (*StartActionRequest_MongoDBExplainParams) Descriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{14, 6} -} - -func (x *StartActionRequest_MongoDBExplainParams) GetDsn() string { - if x != nil { - return x.Dsn - } - return "" -} - -func (x *StartActionRequest_MongoDBExplainParams) GetQuery() string { - if x != nil { - return x.Query - } - return "" -} - -func (x *StartActionRequest_MongoDBExplainParams) GetTextFiles() *TextFiles { - if x != nil { - return x.TextFiles - } - return nil -} - -// PTSummaryParams describes parameters for PT summary. -type StartActionRequest_PTSummaryParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StartActionRequest_PTSummaryParams) Reset() { - *x = StartActionRequest_PTSummaryParams{} - mi := &file_agent_v1_agent_proto_msgTypes[56] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StartActionRequest_PTSummaryParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StartActionRequest_PTSummaryParams) ProtoMessage() {} - -func (x *StartActionRequest_PTSummaryParams) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_agent_proto_msgTypes[56] - 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 StartActionRequest_PTSummaryParams.ProtoReflect.Descriptor instead. -func (*StartActionRequest_PTSummaryParams) Descriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{14, 7} -} - -// PTPgSummaryParams describes parameters for PT PG summary. -type StartActionRequest_PTPgSummaryParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - Host string `protobuf:"bytes,1,opt,name=host,proto3" json:"host,omitempty"` - Port uint32 `protobuf:"varint,2,opt,name=port,proto3" json:"port,omitempty"` - Username string `protobuf:"bytes,3,opt,name=username,proto3" json:"username,omitempty"` - Password string `protobuf:"bytes,4,opt,name=password,proto3" json:"password,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StartActionRequest_PTPgSummaryParams) Reset() { - *x = StartActionRequest_PTPgSummaryParams{} - mi := &file_agent_v1_agent_proto_msgTypes[57] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StartActionRequest_PTPgSummaryParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StartActionRequest_PTPgSummaryParams) ProtoMessage() {} - -func (x *StartActionRequest_PTPgSummaryParams) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_agent_proto_msgTypes[57] - 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 StartActionRequest_PTPgSummaryParams.ProtoReflect.Descriptor instead. -func (*StartActionRequest_PTPgSummaryParams) Descriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{14, 8} -} - -func (x *StartActionRequest_PTPgSummaryParams) GetHost() string { - if x != nil { - return x.Host - } - return "" -} - -func (x *StartActionRequest_PTPgSummaryParams) GetPort() uint32 { - if x != nil { - return x.Port - } - return 0 -} - -func (x *StartActionRequest_PTPgSummaryParams) GetUsername() string { - if x != nil { - return x.Username - } - return "" -} - -func (x *StartActionRequest_PTPgSummaryParams) GetPassword() string { - if x != nil { - return x.Password - } - return "" -} - -// PTMongoDBSummaryParams describes parameters for PT MongoDB summary. -type StartActionRequest_PTMongoDBSummaryParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - Host string `protobuf:"bytes,1,opt,name=host,proto3" json:"host,omitempty"` - Port uint32 `protobuf:"varint,2,opt,name=port,proto3" json:"port,omitempty"` - Username string `protobuf:"bytes,3,opt,name=username,proto3" json:"username,omitempty"` - Password string `protobuf:"bytes,4,opt,name=password,proto3" json:"password,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StartActionRequest_PTMongoDBSummaryParams) Reset() { - *x = StartActionRequest_PTMongoDBSummaryParams{} - mi := &file_agent_v1_agent_proto_msgTypes[58] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StartActionRequest_PTMongoDBSummaryParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StartActionRequest_PTMongoDBSummaryParams) ProtoMessage() {} - -func (x *StartActionRequest_PTMongoDBSummaryParams) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_agent_proto_msgTypes[58] - 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 StartActionRequest_PTMongoDBSummaryParams.ProtoReflect.Descriptor instead. -func (*StartActionRequest_PTMongoDBSummaryParams) Descriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{14, 9} -} - -func (x *StartActionRequest_PTMongoDBSummaryParams) GetHost() string { - if x != nil { - return x.Host - } - return "" -} - -func (x *StartActionRequest_PTMongoDBSummaryParams) GetPort() uint32 { - if x != nil { - return x.Port - } - return 0 -} - -func (x *StartActionRequest_PTMongoDBSummaryParams) GetUsername() string { - if x != nil { - return x.Username - } - return "" -} - -func (x *StartActionRequest_PTMongoDBSummaryParams) GetPassword() string { - if x != nil { - return x.Password - } - return "" -} - -// PTMySQLSummaryParams describes parameters for PT MySQL summary. -type StartActionRequest_PTMySQLSummaryParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - Host string `protobuf:"bytes,1,opt,name=host,proto3" json:"host,omitempty"` - Port uint32 `protobuf:"varint,2,opt,name=port,proto3" json:"port,omitempty"` - Socket string `protobuf:"bytes,3,opt,name=socket,proto3" json:"socket,omitempty"` - Username string `protobuf:"bytes,4,opt,name=username,proto3" json:"username,omitempty"` - Password string `protobuf:"bytes,5,opt,name=password,proto3" json:"password,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StartActionRequest_PTMySQLSummaryParams) Reset() { - *x = StartActionRequest_PTMySQLSummaryParams{} - mi := &file_agent_v1_agent_proto_msgTypes[59] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StartActionRequest_PTMySQLSummaryParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StartActionRequest_PTMySQLSummaryParams) ProtoMessage() {} - -func (x *StartActionRequest_PTMySQLSummaryParams) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_agent_proto_msgTypes[59] - 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 StartActionRequest_PTMySQLSummaryParams.ProtoReflect.Descriptor instead. -func (*StartActionRequest_PTMySQLSummaryParams) Descriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{14, 10} -} - -func (x *StartActionRequest_PTMySQLSummaryParams) GetHost() string { - if x != nil { - return x.Host - } - return "" -} - -func (x *StartActionRequest_PTMySQLSummaryParams) GetPort() uint32 { - if x != nil { - return x.Port - } - return 0 -} - -func (x *StartActionRequest_PTMySQLSummaryParams) GetSocket() string { - if x != nil { - return x.Socket - } - return "" -} - -func (x *StartActionRequest_PTMySQLSummaryParams) GetUsername() string { - if x != nil { - return x.Username - } - return "" -} - -func (x *StartActionRequest_PTMySQLSummaryParams) GetPassword() string { - if x != nil { - return x.Password - } - return "" -} - -// MySQLQueryShowParams describes MySQL SHOW query action parameters. -type StartActionRequest_MySQLQueryShowParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - // DSN for the service. May contain connection (dial) timeout. - Dsn string `protobuf:"bytes,1,opt,name=dsn,proto3" json:"dsn,omitempty"` - // Query suffix (without leading SHOW). - Query string `protobuf:"bytes,2,opt,name=query,proto3" json:"query,omitempty"` - // Contains files and their contents which can be used in DSN. - TlsFiles *TextFiles `protobuf:"bytes,3,opt,name=tls_files,json=tlsFiles,proto3" json:"tls_files,omitempty"` - // TLS certificate wont be verified. - TlsSkipVerify bool `protobuf:"varint,4,opt,name=tls_skip_verify,json=tlsSkipVerify,proto3" json:"tls_skip_verify,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StartActionRequest_MySQLQueryShowParams) Reset() { - *x = StartActionRequest_MySQLQueryShowParams{} - mi := &file_agent_v1_agent_proto_msgTypes[60] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StartActionRequest_MySQLQueryShowParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StartActionRequest_MySQLQueryShowParams) ProtoMessage() {} - -func (x *StartActionRequest_MySQLQueryShowParams) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_agent_proto_msgTypes[60] - 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 StartActionRequest_MySQLQueryShowParams.ProtoReflect.Descriptor instead. -func (*StartActionRequest_MySQLQueryShowParams) Descriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{14, 11} -} - -func (x *StartActionRequest_MySQLQueryShowParams) GetDsn() string { - if x != nil { - return x.Dsn - } - return "" -} - -func (x *StartActionRequest_MySQLQueryShowParams) GetQuery() string { - if x != nil { - return x.Query - } - return "" -} - -func (x *StartActionRequest_MySQLQueryShowParams) GetTlsFiles() *TextFiles { - if x != nil { - return x.TlsFiles - } - return nil -} - -func (x *StartActionRequest_MySQLQueryShowParams) GetTlsSkipVerify() bool { - if x != nil { - return x.TlsSkipVerify - } - return false -} - -// MySQLQuerySelectParams describes MySQL SELECT query action parameters. -type StartActionRequest_MySQLQuerySelectParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - // DSN for the service. May contain connection (dial) timeout. - Dsn string `protobuf:"bytes,1,opt,name=dsn,proto3" json:"dsn,omitempty"` - // Query suffix (without leading SELECT). - Query string `protobuf:"bytes,2,opt,name=query,proto3" json:"query,omitempty"` - // Contains files and their contents which can be used in DSN. - TlsFiles *TextFiles `protobuf:"bytes,3,opt,name=tls_files,json=tlsFiles,proto3" json:"tls_files,omitempty"` - // TLS certificate wont be verified. - TlsSkipVerify bool `protobuf:"varint,4,opt,name=tls_skip_verify,json=tlsSkipVerify,proto3" json:"tls_skip_verify,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StartActionRequest_MySQLQuerySelectParams) Reset() { - *x = StartActionRequest_MySQLQuerySelectParams{} - mi := &file_agent_v1_agent_proto_msgTypes[61] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StartActionRequest_MySQLQuerySelectParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StartActionRequest_MySQLQuerySelectParams) ProtoMessage() {} - -func (x *StartActionRequest_MySQLQuerySelectParams) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_agent_proto_msgTypes[61] - 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 StartActionRequest_MySQLQuerySelectParams.ProtoReflect.Descriptor instead. -func (*StartActionRequest_MySQLQuerySelectParams) Descriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{14, 12} -} - -func (x *StartActionRequest_MySQLQuerySelectParams) GetDsn() string { - if x != nil { - return x.Dsn - } - return "" -} - -func (x *StartActionRequest_MySQLQuerySelectParams) GetQuery() string { - if x != nil { - return x.Query - } - return "" -} - -func (x *StartActionRequest_MySQLQuerySelectParams) GetTlsFiles() *TextFiles { - if x != nil { - return x.TlsFiles - } - return nil -} - -func (x *StartActionRequest_MySQLQuerySelectParams) GetTlsSkipVerify() bool { - if x != nil { - return x.TlsSkipVerify - } - return false -} - -// PostgreSQLQueryShowParams describes PostgreSQL SHOW query action parameters. -type StartActionRequest_PostgreSQLQueryShowParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - // DSN for the service. May contain connection (dial) timeout. - Dsn string `protobuf:"bytes,1,opt,name=dsn,proto3" json:"dsn,omitempty"` - // Contains files and their contents which can be used in DSN. - TlsFiles *TextFiles `protobuf:"bytes,2,opt,name=tls_files,json=tlsFiles,proto3" json:"tls_files,omitempty"` - // TLS certificate wont be verified. - TlsSkipVerify bool `protobuf:"varint,3,opt,name=tls_skip_verify,json=tlsSkipVerify,proto3" json:"tls_skip_verify,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StartActionRequest_PostgreSQLQueryShowParams) Reset() { - *x = StartActionRequest_PostgreSQLQueryShowParams{} - mi := &file_agent_v1_agent_proto_msgTypes[62] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StartActionRequest_PostgreSQLQueryShowParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StartActionRequest_PostgreSQLQueryShowParams) ProtoMessage() {} - -func (x *StartActionRequest_PostgreSQLQueryShowParams) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_agent_proto_msgTypes[62] - 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 StartActionRequest_PostgreSQLQueryShowParams.ProtoReflect.Descriptor instead. -func (*StartActionRequest_PostgreSQLQueryShowParams) Descriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{14, 13} -} - -func (x *StartActionRequest_PostgreSQLQueryShowParams) GetDsn() string { - if x != nil { - return x.Dsn - } - return "" -} - -func (x *StartActionRequest_PostgreSQLQueryShowParams) GetTlsFiles() *TextFiles { - if x != nil { - return x.TlsFiles - } - return nil -} - -func (x *StartActionRequest_PostgreSQLQueryShowParams) GetTlsSkipVerify() bool { - if x != nil { - return x.TlsSkipVerify - } - return false -} - -// PostgreSQLQuerySelectParams describes PostgreSQL SELECT query action parameters. -type StartActionRequest_PostgreSQLQuerySelectParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - // DSN for the service. May contain connection (dial) timeout. - Dsn string `protobuf:"bytes,1,opt,name=dsn,proto3" json:"dsn,omitempty"` - // Query suffix (without leading SELECT). - Query string `protobuf:"bytes,2,opt,name=query,proto3" json:"query,omitempty"` - // Contains files and their contents which can be used in DSN. - TlsFiles *TextFiles `protobuf:"bytes,3,opt,name=tls_files,json=tlsFiles,proto3" json:"tls_files,omitempty"` - // TLS certificate wont be verified. - TlsSkipVerify bool `protobuf:"varint,4,opt,name=tls_skip_verify,json=tlsSkipVerify,proto3" json:"tls_skip_verify,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StartActionRequest_PostgreSQLQuerySelectParams) Reset() { - *x = StartActionRequest_PostgreSQLQuerySelectParams{} - mi := &file_agent_v1_agent_proto_msgTypes[63] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StartActionRequest_PostgreSQLQuerySelectParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StartActionRequest_PostgreSQLQuerySelectParams) ProtoMessage() {} - -func (x *StartActionRequest_PostgreSQLQuerySelectParams) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_agent_proto_msgTypes[63] - 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 StartActionRequest_PostgreSQLQuerySelectParams.ProtoReflect.Descriptor instead. -func (*StartActionRequest_PostgreSQLQuerySelectParams) Descriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{14, 14} -} - -func (x *StartActionRequest_PostgreSQLQuerySelectParams) GetDsn() string { - if x != nil { - return x.Dsn - } - return "" -} - -func (x *StartActionRequest_PostgreSQLQuerySelectParams) GetQuery() string { - if x != nil { - return x.Query - } - return "" -} - -func (x *StartActionRequest_PostgreSQLQuerySelectParams) GetTlsFiles() *TextFiles { - if x != nil { - return x.TlsFiles - } - return nil -} - -func (x *StartActionRequest_PostgreSQLQuerySelectParams) GetTlsSkipVerify() bool { - if x != nil { - return x.TlsSkipVerify - } - return false -} - -// MongoDBQueryGetParameterParams describes MongoDB getParameter query action parameters. -type StartActionRequest_MongoDBQueryGetParameterParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - // DSN for the service. May contain connection (dial) timeout. - // May contain placeholders for file paths in DSN. - Dsn string `protobuf:"bytes,1,opt,name=dsn,proto3" json:"dsn,omitempty"` - // Contains files and their contents which can be used in DSN. - TextFiles *TextFiles `protobuf:"bytes,2,opt,name=text_files,json=textFiles,proto3" json:"text_files,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StartActionRequest_MongoDBQueryGetParameterParams) Reset() { - *x = StartActionRequest_MongoDBQueryGetParameterParams{} - mi := &file_agent_v1_agent_proto_msgTypes[64] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StartActionRequest_MongoDBQueryGetParameterParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StartActionRequest_MongoDBQueryGetParameterParams) ProtoMessage() {} - -func (x *StartActionRequest_MongoDBQueryGetParameterParams) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_agent_proto_msgTypes[64] - 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 StartActionRequest_MongoDBQueryGetParameterParams.ProtoReflect.Descriptor instead. -func (*StartActionRequest_MongoDBQueryGetParameterParams) Descriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{14, 15} -} - -func (x *StartActionRequest_MongoDBQueryGetParameterParams) GetDsn() string { - if x != nil { - return x.Dsn - } - return "" -} - -func (x *StartActionRequest_MongoDBQueryGetParameterParams) GetTextFiles() *TextFiles { - if x != nil { - return x.TextFiles - } - return nil -} - -// MongoDBQueryBuildInfoParams describes MongoDB buildInfo query action parameters. -type StartActionRequest_MongoDBQueryBuildInfoParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - // DSN for the service. May contain connection (dial) timeout. - // May contain placeholders for file paths in DSN. - Dsn string `protobuf:"bytes,1,opt,name=dsn,proto3" json:"dsn,omitempty"` - // Contains files and their contents which can be used in DSN. - TextFiles *TextFiles `protobuf:"bytes,2,opt,name=text_files,json=textFiles,proto3" json:"text_files,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StartActionRequest_MongoDBQueryBuildInfoParams) Reset() { - *x = StartActionRequest_MongoDBQueryBuildInfoParams{} - mi := &file_agent_v1_agent_proto_msgTypes[65] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StartActionRequest_MongoDBQueryBuildInfoParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StartActionRequest_MongoDBQueryBuildInfoParams) ProtoMessage() {} - -func (x *StartActionRequest_MongoDBQueryBuildInfoParams) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_agent_proto_msgTypes[65] - 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 StartActionRequest_MongoDBQueryBuildInfoParams.ProtoReflect.Descriptor instead. -func (*StartActionRequest_MongoDBQueryBuildInfoParams) Descriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{14, 16} -} - -func (x *StartActionRequest_MongoDBQueryBuildInfoParams) GetDsn() string { - if x != nil { - return x.Dsn - } - return "" -} - -func (x *StartActionRequest_MongoDBQueryBuildInfoParams) GetTextFiles() *TextFiles { - if x != nil { - return x.TextFiles - } - return nil -} - -// MongoDBQueryGetCmdLineOptsParams describes MongoDB getCmdLineOpts query action parameters. -type StartActionRequest_MongoDBQueryGetCmdLineOptsParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - // DSN for the service. May contain connection (dial) timeout. - // May contain placeholders for file paths in DSN. - Dsn string `protobuf:"bytes,1,opt,name=dsn,proto3" json:"dsn,omitempty"` - // Contains files and their contents which can be used in DSN. - TextFiles *TextFiles `protobuf:"bytes,2,opt,name=text_files,json=textFiles,proto3" json:"text_files,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StartActionRequest_MongoDBQueryGetCmdLineOptsParams) Reset() { - *x = StartActionRequest_MongoDBQueryGetCmdLineOptsParams{} - mi := &file_agent_v1_agent_proto_msgTypes[66] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StartActionRequest_MongoDBQueryGetCmdLineOptsParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StartActionRequest_MongoDBQueryGetCmdLineOptsParams) ProtoMessage() {} - -func (x *StartActionRequest_MongoDBQueryGetCmdLineOptsParams) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_agent_proto_msgTypes[66] - 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 StartActionRequest_MongoDBQueryGetCmdLineOptsParams.ProtoReflect.Descriptor instead. -func (*StartActionRequest_MongoDBQueryGetCmdLineOptsParams) Descriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{14, 17} -} - -func (x *StartActionRequest_MongoDBQueryGetCmdLineOptsParams) GetDsn() string { - if x != nil { - return x.Dsn - } - return "" -} - -func (x *StartActionRequest_MongoDBQueryGetCmdLineOptsParams) GetTextFiles() *TextFiles { - if x != nil { - return x.TextFiles - } - return nil -} - -// MongoDBQueryReplSetGetStatusParams describes MongoDB replSetGetStatus query action parameters. -type StartActionRequest_MongoDBQueryReplSetGetStatusParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - // DSN for the service. May contain connection (dial) timeout. - // May contain placeholders for file paths in DSN. - Dsn string `protobuf:"bytes,1,opt,name=dsn,proto3" json:"dsn,omitempty"` - // Contains files and their contents which can be used in DSN. - TextFiles *TextFiles `protobuf:"bytes,2,opt,name=text_files,json=textFiles,proto3" json:"text_files,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StartActionRequest_MongoDBQueryReplSetGetStatusParams) Reset() { - *x = StartActionRequest_MongoDBQueryReplSetGetStatusParams{} - mi := &file_agent_v1_agent_proto_msgTypes[67] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StartActionRequest_MongoDBQueryReplSetGetStatusParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StartActionRequest_MongoDBQueryReplSetGetStatusParams) ProtoMessage() {} - -func (x *StartActionRequest_MongoDBQueryReplSetGetStatusParams) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_agent_proto_msgTypes[67] - 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 StartActionRequest_MongoDBQueryReplSetGetStatusParams.ProtoReflect.Descriptor instead. -func (*StartActionRequest_MongoDBQueryReplSetGetStatusParams) Descriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{14, 18} -} - -func (x *StartActionRequest_MongoDBQueryReplSetGetStatusParams) GetDsn() string { - if x != nil { - return x.Dsn - } - return "" -} - -func (x *StartActionRequest_MongoDBQueryReplSetGetStatusParams) GetTextFiles() *TextFiles { - if x != nil { - return x.TextFiles - } - return nil -} - -// MongoDBQueryGetDiagnosticDataParams describes MongoDB getDiagnosticData query action parameters. -type StartActionRequest_MongoDBQueryGetDiagnosticDataParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - // DSN for the service. May contain connection (dial) timeout. - // May contain placeholders for file paths in DSN. - Dsn string `protobuf:"bytes,1,opt,name=dsn,proto3" json:"dsn,omitempty"` - // Contains files and their contents which can be used in DSN. - TextFiles *TextFiles `protobuf:"bytes,2,opt,name=text_files,json=textFiles,proto3" json:"text_files,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StartActionRequest_MongoDBQueryGetDiagnosticDataParams) Reset() { - *x = StartActionRequest_MongoDBQueryGetDiagnosticDataParams{} - mi := &file_agent_v1_agent_proto_msgTypes[68] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StartActionRequest_MongoDBQueryGetDiagnosticDataParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StartActionRequest_MongoDBQueryGetDiagnosticDataParams) ProtoMessage() {} - -func (x *StartActionRequest_MongoDBQueryGetDiagnosticDataParams) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_agent_proto_msgTypes[68] - 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 StartActionRequest_MongoDBQueryGetDiagnosticDataParams.ProtoReflect.Descriptor instead. -func (*StartActionRequest_MongoDBQueryGetDiagnosticDataParams) Descriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{14, 19} -} - -func (x *StartActionRequest_MongoDBQueryGetDiagnosticDataParams) GetDsn() string { - if x != nil { - return x.Dsn - } - return "" -} - -func (x *StartActionRequest_MongoDBQueryGetDiagnosticDataParams) GetTextFiles() *TextFiles { - if x != nil { - return x.TextFiles - } - return nil -} - -// RestartSystemServiceParams describes an action request to restart a systemctl service on a node. -type StartActionRequest_RestartSystemServiceParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - SystemService StartActionRequest_RestartSystemServiceParams_SystemService `protobuf:"varint,1,opt,name=system_service,json=systemService,proto3,enum=agent.v1.StartActionRequest_RestartSystemServiceParams_SystemService" json:"system_service,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StartActionRequest_RestartSystemServiceParams) Reset() { - *x = StartActionRequest_RestartSystemServiceParams{} - mi := &file_agent_v1_agent_proto_msgTypes[69] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StartActionRequest_RestartSystemServiceParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StartActionRequest_RestartSystemServiceParams) ProtoMessage() {} - -func (x *StartActionRequest_RestartSystemServiceParams) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_agent_proto_msgTypes[69] - 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 StartActionRequest_RestartSystemServiceParams.ProtoReflect.Descriptor instead. -func (*StartActionRequest_RestartSystemServiceParams) Descriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{14, 20} -} - -func (x *StartActionRequest_RestartSystemServiceParams) GetSystemService() StartActionRequest_RestartSystemServiceParams_SystemService { - if x != nil { - return x.SystemService - } - return StartActionRequest_RestartSystemServiceParams_SYSTEM_SERVICE_UNSPECIFIED -} - -// Stats contains various Service statistics. -type CheckConnectionResponse_Stats struct { - state protoimpl.MessageState `protogen:"open.v1"` - // A number of tables, 0 if unknown. - TableCount int32 `protobuf:"varint,1,opt,name=table_count,json=tableCount,proto3" json:"table_count,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CheckConnectionResponse_Stats) Reset() { - *x = CheckConnectionResponse_Stats{} - mi := &file_agent_v1_agent_proto_msgTypes[70] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CheckConnectionResponse_Stats) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CheckConnectionResponse_Stats) ProtoMessage() {} - -func (x *CheckConnectionResponse_Stats) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_agent_proto_msgTypes[70] - 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 CheckConnectionResponse_Stats.ProtoReflect.Descriptor instead. -func (*CheckConnectionResponse_Stats) Descriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{25, 0} -} - -func (x *CheckConnectionResponse_Stats) GetTableCount() int32 { - if x != nil { - return x.TableCount - } - return 0 -} - -// MySQLBackup is job for backup MySQL service. -type StartJobRequest_MySQLBackup struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Database user; - User string `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` - // Database password. - Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` - // Database address. Can't be specified with socket. - Address string `protobuf:"bytes,3,opt,name=address,proto3" json:"address,omitempty"` - // Database port. Can't be specified with socket. - Port int32 `protobuf:"varint,4,opt,name=port,proto3" json:"port,omitempty"` - // Database unix socket. Can't be specified with address/port. - Socket string `protobuf:"bytes,5,opt,name=socket,proto3" json:"socket,omitempty"` - // Backup name. - Name string `protobuf:"bytes,6,opt,name=name,proto3" json:"name,omitempty"` - // Folder to store artifact on a storage. - Folder string `protobuf:"bytes,7,opt,name=folder,proto3" json:"folder,omitempty"` - // Backup target location. - // - // Types that are valid to be assigned to LocationConfig: - // - // *StartJobRequest_MySQLBackup_S3Config - LocationConfig isStartJobRequest_MySQLBackup_LocationConfig `protobuf_oneof:"location_config"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StartJobRequest_MySQLBackup) Reset() { - *x = StartJobRequest_MySQLBackup{} - mi := &file_agent_v1_agent_proto_msgTypes[71] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StartJobRequest_MySQLBackup) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StartJobRequest_MySQLBackup) ProtoMessage() {} - -func (x *StartJobRequest_MySQLBackup) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_agent_proto_msgTypes[71] - 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 StartJobRequest_MySQLBackup.ProtoReflect.Descriptor instead. -func (*StartJobRequest_MySQLBackup) Descriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{32, 0} -} - -func (x *StartJobRequest_MySQLBackup) GetUser() string { - if x != nil { - return x.User - } - return "" -} - -func (x *StartJobRequest_MySQLBackup) GetPassword() string { - if x != nil { - return x.Password - } - return "" -} - -func (x *StartJobRequest_MySQLBackup) GetAddress() string { - if x != nil { - return x.Address - } - return "" -} - -func (x *StartJobRequest_MySQLBackup) GetPort() int32 { - if x != nil { - return x.Port - } - return 0 -} - -func (x *StartJobRequest_MySQLBackup) GetSocket() string { - if x != nil { - return x.Socket - } - return "" -} - -func (x *StartJobRequest_MySQLBackup) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *StartJobRequest_MySQLBackup) GetFolder() string { - if x != nil { - return x.Folder - } - return "" -} - -func (x *StartJobRequest_MySQLBackup) GetLocationConfig() isStartJobRequest_MySQLBackup_LocationConfig { - if x != nil { - return x.LocationConfig - } - return nil -} - -func (x *StartJobRequest_MySQLBackup) GetS3Config() *S3LocationConfig { - if x != nil { - if x, ok := x.LocationConfig.(*StartJobRequest_MySQLBackup_S3Config); ok { - return x.S3Config - } - } - return nil -} - -type isStartJobRequest_MySQLBackup_LocationConfig interface { - isStartJobRequest_MySQLBackup_LocationConfig() -} - -type StartJobRequest_MySQLBackup_S3Config struct { - S3Config *S3LocationConfig `protobuf:"bytes,10,opt,name=s3_config,json=s3Config,proto3,oneof"` -} - -func (*StartJobRequest_MySQLBackup_S3Config) isStartJobRequest_MySQLBackup_LocationConfig() {} - -// MySQLRestoreBackup is job for MySQL restore backup service. -type StartJobRequest_MySQLRestoreBackup struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Service identifier where the backup should be restored. - ServiceId string `protobuf:"bytes,1,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` - // Backup name. - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - // Folder to store artifact on a storage. - Folder string `protobuf:"bytes,3,opt,name=folder,proto3" json:"folder,omitempty"` - // Where backup is stored. - // - // Types that are valid to be assigned to LocationConfig: - // - // *StartJobRequest_MySQLRestoreBackup_S3Config - LocationConfig isStartJobRequest_MySQLRestoreBackup_LocationConfig `protobuf_oneof:"location_config"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StartJobRequest_MySQLRestoreBackup) Reset() { - *x = StartJobRequest_MySQLRestoreBackup{} - mi := &file_agent_v1_agent_proto_msgTypes[72] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StartJobRequest_MySQLRestoreBackup) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StartJobRequest_MySQLRestoreBackup) ProtoMessage() {} - -func (x *StartJobRequest_MySQLRestoreBackup) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_agent_proto_msgTypes[72] - 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 StartJobRequest_MySQLRestoreBackup.ProtoReflect.Descriptor instead. -func (*StartJobRequest_MySQLRestoreBackup) Descriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{32, 1} -} - -func (x *StartJobRequest_MySQLRestoreBackup) GetServiceId() string { - if x != nil { - return x.ServiceId - } - return "" -} - -func (x *StartJobRequest_MySQLRestoreBackup) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *StartJobRequest_MySQLRestoreBackup) GetFolder() string { - if x != nil { - return x.Folder - } - return "" -} - -func (x *StartJobRequest_MySQLRestoreBackup) GetLocationConfig() isStartJobRequest_MySQLRestoreBackup_LocationConfig { - if x != nil { - return x.LocationConfig - } - return nil -} - -func (x *StartJobRequest_MySQLRestoreBackup) GetS3Config() *S3LocationConfig { - if x != nil { - if x, ok := x.LocationConfig.(*StartJobRequest_MySQLRestoreBackup_S3Config); ok { - return x.S3Config - } - } - return nil -} - -type isStartJobRequest_MySQLRestoreBackup_LocationConfig interface { - isStartJobRequest_MySQLRestoreBackup_LocationConfig() -} - -type StartJobRequest_MySQLRestoreBackup_S3Config struct { - S3Config *S3LocationConfig `protobuf:"bytes,10,opt,name=s3_config,json=s3Config,proto3,oneof"` -} - -func (*StartJobRequest_MySQLRestoreBackup_S3Config) isStartJobRequest_MySQLRestoreBackup_LocationConfig() { -} - -// MongoDBBackup is job for backup MongoDB service. -type StartJobRequest_MongoDBBackup struct { - state protoimpl.MessageState `protogen:"open.v1"` - // DSN for the MongoDB service. May contain connection (dial) timeout. - // May contain placeholders for file paths in DSN. - Dsn string `protobuf:"bytes,1,opt,name=dsn,proto3" json:"dsn,omitempty"` - // Contains files and their contents which can be used in DSN. - TextFiles *TextFiles `protobuf:"bytes,2,opt,name=text_files,json=textFiles,proto3" json:"text_files,omitempty"` - // Backup name. - Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` - // Folder to store artifact on a storage. - Folder string `protobuf:"bytes,4,opt,name=folder,proto3" json:"folder,omitempty"` - // Enable Point-in-Time recovery feature. - EnablePitr bool `protobuf:"varint,5,opt,name=enable_pitr,json=enablePitr,proto3" json:"enable_pitr,omitempty"` - // Backup data model (physical or logical). - DataModel v11.DataModel `protobuf:"varint,6,opt,name=data_model,json=dataModel,proto3,enum=backup.v1.DataModel" json:"data_model,omitempty"` - // Backup target location. - // - // Types that are valid to be assigned to LocationConfig: - // - // *StartJobRequest_MongoDBBackup_S3Config - // *StartJobRequest_MongoDBBackup_FilesystemConfig - LocationConfig isStartJobRequest_MongoDBBackup_LocationConfig `protobuf_oneof:"location_config"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StartJobRequest_MongoDBBackup) Reset() { - *x = StartJobRequest_MongoDBBackup{} - mi := &file_agent_v1_agent_proto_msgTypes[73] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StartJobRequest_MongoDBBackup) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StartJobRequest_MongoDBBackup) ProtoMessage() {} - -func (x *StartJobRequest_MongoDBBackup) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_agent_proto_msgTypes[73] - 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 StartJobRequest_MongoDBBackup.ProtoReflect.Descriptor instead. -func (*StartJobRequest_MongoDBBackup) Descriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{32, 2} -} - -func (x *StartJobRequest_MongoDBBackup) GetDsn() string { - if x != nil { - return x.Dsn - } - return "" -} - -func (x *StartJobRequest_MongoDBBackup) GetTextFiles() *TextFiles { - if x != nil { - return x.TextFiles - } - return nil -} - -func (x *StartJobRequest_MongoDBBackup) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *StartJobRequest_MongoDBBackup) GetFolder() string { - if x != nil { - return x.Folder - } - return "" -} - -func (x *StartJobRequest_MongoDBBackup) GetEnablePitr() bool { - if x != nil { - return x.EnablePitr - } - return false -} - -func (x *StartJobRequest_MongoDBBackup) GetDataModel() v11.DataModel { - if x != nil { - return x.DataModel - } - return v11.DataModel(0) -} - -func (x *StartJobRequest_MongoDBBackup) GetLocationConfig() isStartJobRequest_MongoDBBackup_LocationConfig { - if x != nil { - return x.LocationConfig - } - return nil -} - -func (x *StartJobRequest_MongoDBBackup) GetS3Config() *S3LocationConfig { - if x != nil { - if x, ok := x.LocationConfig.(*StartJobRequest_MongoDBBackup_S3Config); ok { - return x.S3Config - } - } - return nil -} - -func (x *StartJobRequest_MongoDBBackup) GetFilesystemConfig() *FilesystemLocationConfig { - if x != nil { - if x, ok := x.LocationConfig.(*StartJobRequest_MongoDBBackup_FilesystemConfig); ok { - return x.FilesystemConfig - } - } - return nil -} - -type isStartJobRequest_MongoDBBackup_LocationConfig interface { - isStartJobRequest_MongoDBBackup_LocationConfig() -} - -type StartJobRequest_MongoDBBackup_S3Config struct { - S3Config *S3LocationConfig `protobuf:"bytes,10,opt,name=s3_config,json=s3Config,proto3,oneof"` -} - -type StartJobRequest_MongoDBBackup_FilesystemConfig struct { - FilesystemConfig *FilesystemLocationConfig `protobuf:"bytes,11,opt,name=filesystem_config,json=filesystemConfig,proto3,oneof"` -} - -func (*StartJobRequest_MongoDBBackup_S3Config) isStartJobRequest_MongoDBBackup_LocationConfig() {} - -func (*StartJobRequest_MongoDBBackup_FilesystemConfig) isStartJobRequest_MongoDBBackup_LocationConfig() { -} - -// MongoDBRestoreBackup is job for MongoDB restore backup service. -type StartJobRequest_MongoDBRestoreBackup struct { - state protoimpl.MessageState `protogen:"open.v1"` - // DSN for the MongoDB service. May contain connection (dial) timeout. - // May contain placeholders for file paths in DSN. - Dsn string `protobuf:"bytes,1,opt,name=dsn,proto3" json:"dsn,omitempty"` - // Contains files and their contents which can be used in DSN. - TextFiles *TextFiles `protobuf:"bytes,2,opt,name=text_files,json=textFiles,proto3" json:"text_files,omitempty"` - // Backup name. - Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` - // Folder to store artifact on a storage. - Folder string `protobuf:"bytes,4,opt,name=folder,proto3" json:"folder,omitempty"` - // Extra data for backup tool. - PbmMetadata *v11.PbmMetadata `protobuf:"bytes,5,opt,name=pbm_metadata,json=pbmMetadata,proto3" json:"pbm_metadata,omitempty"` - // Point-in-Time recovery timestamp. - PitrTimestamp *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=pitr_timestamp,json=pitrTimestamp,proto3" json:"pitr_timestamp,omitempty"` - // Where backup is stored. - // - // Types that are valid to be assigned to LocationConfig: - // - // *StartJobRequest_MongoDBRestoreBackup_S3Config - // *StartJobRequest_MongoDBRestoreBackup_FilesystemConfig - LocationConfig isStartJobRequest_MongoDBRestoreBackup_LocationConfig `protobuf_oneof:"location_config"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StartJobRequest_MongoDBRestoreBackup) Reset() { - *x = StartJobRequest_MongoDBRestoreBackup{} - mi := &file_agent_v1_agent_proto_msgTypes[74] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StartJobRequest_MongoDBRestoreBackup) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StartJobRequest_MongoDBRestoreBackup) ProtoMessage() {} - -func (x *StartJobRequest_MongoDBRestoreBackup) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_agent_proto_msgTypes[74] - 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 StartJobRequest_MongoDBRestoreBackup.ProtoReflect.Descriptor instead. -func (*StartJobRequest_MongoDBRestoreBackup) Descriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{32, 3} -} - -func (x *StartJobRequest_MongoDBRestoreBackup) GetDsn() string { - if x != nil { - return x.Dsn - } - return "" -} - -func (x *StartJobRequest_MongoDBRestoreBackup) GetTextFiles() *TextFiles { - if x != nil { - return x.TextFiles - } - return nil -} - -func (x *StartJobRequest_MongoDBRestoreBackup) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *StartJobRequest_MongoDBRestoreBackup) GetFolder() string { - if x != nil { - return x.Folder - } - return "" -} - -func (x *StartJobRequest_MongoDBRestoreBackup) GetPbmMetadata() *v11.PbmMetadata { - if x != nil { - return x.PbmMetadata - } - return nil -} - -func (x *StartJobRequest_MongoDBRestoreBackup) GetPitrTimestamp() *timestamppb.Timestamp { - if x != nil { - return x.PitrTimestamp - } - return nil -} - -func (x *StartJobRequest_MongoDBRestoreBackup) GetLocationConfig() isStartJobRequest_MongoDBRestoreBackup_LocationConfig { - if x != nil { - return x.LocationConfig - } - return nil -} - -func (x *StartJobRequest_MongoDBRestoreBackup) GetS3Config() *S3LocationConfig { - if x != nil { - if x, ok := x.LocationConfig.(*StartJobRequest_MongoDBRestoreBackup_S3Config); ok { - return x.S3Config - } - } - return nil -} - -func (x *StartJobRequest_MongoDBRestoreBackup) GetFilesystemConfig() *FilesystemLocationConfig { - if x != nil { - if x, ok := x.LocationConfig.(*StartJobRequest_MongoDBRestoreBackup_FilesystemConfig); ok { - return x.FilesystemConfig - } - } - return nil -} - -type isStartJobRequest_MongoDBRestoreBackup_LocationConfig interface { - isStartJobRequest_MongoDBRestoreBackup_LocationConfig() -} - -type StartJobRequest_MongoDBRestoreBackup_S3Config struct { - S3Config *S3LocationConfig `protobuf:"bytes,10,opt,name=s3_config,json=s3Config,proto3,oneof"` -} - -type StartJobRequest_MongoDBRestoreBackup_FilesystemConfig struct { - FilesystemConfig *FilesystemLocationConfig `protobuf:"bytes,11,opt,name=filesystem_config,json=filesystemConfig,proto3,oneof"` -} - -func (*StartJobRequest_MongoDBRestoreBackup_S3Config) isStartJobRequest_MongoDBRestoreBackup_LocationConfig() { -} - -func (*StartJobRequest_MongoDBRestoreBackup_FilesystemConfig) isStartJobRequest_MongoDBRestoreBackup_LocationConfig() { -} - -// Error contains job error message. -type JobResult_Error struct { - state protoimpl.MessageState `protogen:"open.v1"` - Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *JobResult_Error) Reset() { - *x = JobResult_Error{} - mi := &file_agent_v1_agent_proto_msgTypes[75] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *JobResult_Error) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*JobResult_Error) ProtoMessage() {} - -func (x *JobResult_Error) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_agent_proto_msgTypes[75] - 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 JobResult_Error.ProtoReflect.Descriptor instead. -func (*JobResult_Error) Descriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{36, 0} -} - -func (x *JobResult_Error) GetMessage() string { - if x != nil { - return x.Message - } - return "" -} - -// MongoDBBackup contains result for MongoDB backup job. -type JobResult_MongoDBBackup struct { - state protoimpl.MessageState `protogen:"open.v1"` - IsShardedCluster bool `protobuf:"varint,1,opt,name=is_sharded_cluster,json=isShardedCluster,proto3" json:"is_sharded_cluster,omitempty"` - // Contains additional data describing artifact. - Metadata *v11.Metadata `protobuf:"bytes,2,opt,name=metadata,proto3" json:"metadata,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *JobResult_MongoDBBackup) Reset() { - *x = JobResult_MongoDBBackup{} - mi := &file_agent_v1_agent_proto_msgTypes[76] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *JobResult_MongoDBBackup) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*JobResult_MongoDBBackup) ProtoMessage() {} - -func (x *JobResult_MongoDBBackup) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_agent_proto_msgTypes[76] - 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 JobResult_MongoDBBackup.ProtoReflect.Descriptor instead. -func (*JobResult_MongoDBBackup) Descriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{36, 1} -} - -func (x *JobResult_MongoDBBackup) GetIsShardedCluster() bool { - if x != nil { - return x.IsShardedCluster - } - return false -} - -func (x *JobResult_MongoDBBackup) GetMetadata() *v11.Metadata { - if x != nil { - return x.Metadata - } - return nil -} - -// MySQLBackup contains result for MySQL backup job. -type JobResult_MySQLBackup struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Contains additional data describing artifact. - Metadata *v11.Metadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *JobResult_MySQLBackup) Reset() { - *x = JobResult_MySQLBackup{} - mi := &file_agent_v1_agent_proto_msgTypes[77] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *JobResult_MySQLBackup) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*JobResult_MySQLBackup) ProtoMessage() {} - -func (x *JobResult_MySQLBackup) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_agent_proto_msgTypes[77] - 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 JobResult_MySQLBackup.ProtoReflect.Descriptor instead. -func (*JobResult_MySQLBackup) Descriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{36, 2} -} - -func (x *JobResult_MySQLBackup) GetMetadata() *v11.Metadata { - if x != nil { - return x.Metadata - } - return nil -} - -// MySQLRestoreBackup contains result for MySQL restore backup job. -type JobResult_MySQLRestoreBackup struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *JobResult_MySQLRestoreBackup) Reset() { - *x = JobResult_MySQLRestoreBackup{} - mi := &file_agent_v1_agent_proto_msgTypes[78] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *JobResult_MySQLRestoreBackup) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*JobResult_MySQLRestoreBackup) ProtoMessage() {} - -func (x *JobResult_MySQLRestoreBackup) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_agent_proto_msgTypes[78] - 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 JobResult_MySQLRestoreBackup.ProtoReflect.Descriptor instead. -func (*JobResult_MySQLRestoreBackup) Descriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{36, 3} -} - -// MongoDBRestoreBackup contains result for MongoDB restore backup job. -type JobResult_MongoDBRestoreBackup struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *JobResult_MongoDBRestoreBackup) Reset() { - *x = JobResult_MongoDBRestoreBackup{} - mi := &file_agent_v1_agent_proto_msgTypes[79] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *JobResult_MongoDBRestoreBackup) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*JobResult_MongoDBRestoreBackup) ProtoMessage() {} - -func (x *JobResult_MongoDBRestoreBackup) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_agent_proto_msgTypes[79] - 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 JobResult_MongoDBRestoreBackup.ProtoReflect.Descriptor instead. -func (*JobResult_MongoDBRestoreBackup) Descriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{36, 4} -} - -// MySQLBackup contains backup job status update. -type JobProgress_MySQLBackup struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *JobProgress_MySQLBackup) Reset() { - *x = JobProgress_MySQLBackup{} - mi := &file_agent_v1_agent_proto_msgTypes[80] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *JobProgress_MySQLBackup) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*JobProgress_MySQLBackup) ProtoMessage() {} - -func (x *JobProgress_MySQLBackup) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_agent_proto_msgTypes[80] - 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 JobProgress_MySQLBackup.ProtoReflect.Descriptor instead. -func (*JobProgress_MySQLBackup) Descriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{37, 0} -} - -// MySQLRestoreBackup contains restore backup job status update. -type JobProgress_MySQLRestoreBackup struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *JobProgress_MySQLRestoreBackup) Reset() { - *x = JobProgress_MySQLRestoreBackup{} - mi := &file_agent_v1_agent_proto_msgTypes[81] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *JobProgress_MySQLRestoreBackup) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*JobProgress_MySQLRestoreBackup) ProtoMessage() {} - -func (x *JobProgress_MySQLRestoreBackup) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_agent_proto_msgTypes[81] - 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 JobProgress_MySQLRestoreBackup.ProtoReflect.Descriptor instead. -func (*JobProgress_MySQLRestoreBackup) Descriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{37, 1} -} - -// Logs contains generic logs from job. -type JobProgress_Logs struct { - state protoimpl.MessageState `protogen:"open.v1"` - ChunkId uint32 `protobuf:"varint,1,opt,name=chunk_id,json=chunkId,proto3" json:"chunk_id,omitempty"` - Data string `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` - Done bool `protobuf:"varint,3,opt,name=done,proto3" json:"done,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *JobProgress_Logs) Reset() { - *x = JobProgress_Logs{} - mi := &file_agent_v1_agent_proto_msgTypes[82] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *JobProgress_Logs) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*JobProgress_Logs) ProtoMessage() {} - -func (x *JobProgress_Logs) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_agent_proto_msgTypes[82] - 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 JobProgress_Logs.ProtoReflect.Descriptor instead. -func (*JobProgress_Logs) Descriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{37, 2} -} - -func (x *JobProgress_Logs) GetChunkId() uint32 { - if x != nil { - return x.ChunkId - } - return 0 -} - -func (x *JobProgress_Logs) GetData() string { - if x != nil { - return x.Data - } - return "" -} - -func (x *JobProgress_Logs) GetDone() bool { - if x != nil { - return x.Done - } - return false -} - -// MySQLd is used for mysqld binary version retrieving using `mysqld --version`. -type GetVersionsRequest_MySQLd struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetVersionsRequest_MySQLd) Reset() { - *x = GetVersionsRequest_MySQLd{} - mi := &file_agent_v1_agent_proto_msgTypes[83] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetVersionsRequest_MySQLd) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetVersionsRequest_MySQLd) ProtoMessage() {} - -func (x *GetVersionsRequest_MySQLd) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_agent_proto_msgTypes[83] - 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 GetVersionsRequest_MySQLd.ProtoReflect.Descriptor instead. -func (*GetVersionsRequest_MySQLd) Descriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{38, 0} -} - -// Xtrabackup is used for xtrabackup binary version retrieving. -type GetVersionsRequest_Xtrabackup struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetVersionsRequest_Xtrabackup) Reset() { - *x = GetVersionsRequest_Xtrabackup{} - mi := &file_agent_v1_agent_proto_msgTypes[84] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetVersionsRequest_Xtrabackup) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetVersionsRequest_Xtrabackup) ProtoMessage() {} - -func (x *GetVersionsRequest_Xtrabackup) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_agent_proto_msgTypes[84] - 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 GetVersionsRequest_Xtrabackup.ProtoReflect.Descriptor instead. -func (*GetVersionsRequest_Xtrabackup) Descriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{38, 1} -} - -// Xbcloud is used for xbcloud binary version retrieving. -type GetVersionsRequest_Xbcloud struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetVersionsRequest_Xbcloud) Reset() { - *x = GetVersionsRequest_Xbcloud{} - mi := &file_agent_v1_agent_proto_msgTypes[85] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetVersionsRequest_Xbcloud) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetVersionsRequest_Xbcloud) ProtoMessage() {} - -func (x *GetVersionsRequest_Xbcloud) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_agent_proto_msgTypes[85] - 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 GetVersionsRequest_Xbcloud.ProtoReflect.Descriptor instead. -func (*GetVersionsRequest_Xbcloud) Descriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{38, 2} -} - -// Qpress is used for qpress binary version retrieving. -type GetVersionsRequest_Qpress struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetVersionsRequest_Qpress) Reset() { - *x = GetVersionsRequest_Qpress{} - mi := &file_agent_v1_agent_proto_msgTypes[86] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetVersionsRequest_Qpress) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetVersionsRequest_Qpress) ProtoMessage() {} - -func (x *GetVersionsRequest_Qpress) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_agent_proto_msgTypes[86] - 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 GetVersionsRequest_Qpress.ProtoReflect.Descriptor instead. -func (*GetVersionsRequest_Qpress) Descriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{38, 3} -} - -// MongoDB is used for mongod binary version retrieving. -type GetVersionsRequest_MongoDB struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetVersionsRequest_MongoDB) Reset() { - *x = GetVersionsRequest_MongoDB{} - mi := &file_agent_v1_agent_proto_msgTypes[87] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetVersionsRequest_MongoDB) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetVersionsRequest_MongoDB) ProtoMessage() {} - -func (x *GetVersionsRequest_MongoDB) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_agent_proto_msgTypes[87] - 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 GetVersionsRequest_MongoDB.ProtoReflect.Descriptor instead. -func (*GetVersionsRequest_MongoDB) Descriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{38, 4} -} - -// PBM is used for pbm (Percona Backup for MongoDB) binary version retrieving. -type GetVersionsRequest_PBM struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetVersionsRequest_PBM) Reset() { - *x = GetVersionsRequest_PBM{} - mi := &file_agent_v1_agent_proto_msgTypes[88] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetVersionsRequest_PBM) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetVersionsRequest_PBM) ProtoMessage() {} - -func (x *GetVersionsRequest_PBM) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_agent_proto_msgTypes[88] - 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 GetVersionsRequest_PBM.ProtoReflect.Descriptor instead. -func (*GetVersionsRequest_PBM) Descriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{38, 5} -} - -// Software is used to select software for which retrieve version. -type GetVersionsRequest_Software struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Software: - // - // *GetVersionsRequest_Software_Mysqld - // *GetVersionsRequest_Software_Xtrabackup - // *GetVersionsRequest_Software_Xbcloud - // *GetVersionsRequest_Software_Qpress - // *GetVersionsRequest_Software_Mongod - // *GetVersionsRequest_Software_Pbm - Software isGetVersionsRequest_Software_Software `protobuf_oneof:"software"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetVersionsRequest_Software) Reset() { - *x = GetVersionsRequest_Software{} - mi := &file_agent_v1_agent_proto_msgTypes[89] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetVersionsRequest_Software) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetVersionsRequest_Software) ProtoMessage() {} - -func (x *GetVersionsRequest_Software) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_agent_proto_msgTypes[89] - 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 GetVersionsRequest_Software.ProtoReflect.Descriptor instead. -func (*GetVersionsRequest_Software) Descriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{38, 6} -} - -func (x *GetVersionsRequest_Software) GetSoftware() isGetVersionsRequest_Software_Software { - if x != nil { - return x.Software - } - return nil -} - -func (x *GetVersionsRequest_Software) GetMysqld() *GetVersionsRequest_MySQLd { - if x != nil { - if x, ok := x.Software.(*GetVersionsRequest_Software_Mysqld); ok { - return x.Mysqld - } - } - return nil -} - -func (x *GetVersionsRequest_Software) GetXtrabackup() *GetVersionsRequest_Xtrabackup { - if x != nil { - if x, ok := x.Software.(*GetVersionsRequest_Software_Xtrabackup); ok { - return x.Xtrabackup - } - } - return nil -} - -func (x *GetVersionsRequest_Software) GetXbcloud() *GetVersionsRequest_Xbcloud { - if x != nil { - if x, ok := x.Software.(*GetVersionsRequest_Software_Xbcloud); ok { - return x.Xbcloud - } - } - return nil -} - -func (x *GetVersionsRequest_Software) GetQpress() *GetVersionsRequest_Qpress { - if x != nil { - if x, ok := x.Software.(*GetVersionsRequest_Software_Qpress); ok { - return x.Qpress - } - } - return nil -} - -func (x *GetVersionsRequest_Software) GetMongod() *GetVersionsRequest_MongoDB { - if x != nil { - if x, ok := x.Software.(*GetVersionsRequest_Software_Mongod); ok { - return x.Mongod - } - } - return nil -} - -func (x *GetVersionsRequest_Software) GetPbm() *GetVersionsRequest_PBM { - if x != nil { - if x, ok := x.Software.(*GetVersionsRequest_Software_Pbm); ok { - return x.Pbm - } - } - return nil -} - -type isGetVersionsRequest_Software_Software interface { - isGetVersionsRequest_Software_Software() -} - -type GetVersionsRequest_Software_Mysqld struct { - Mysqld *GetVersionsRequest_MySQLd `protobuf:"bytes,1,opt,name=mysqld,proto3,oneof"` -} - -type GetVersionsRequest_Software_Xtrabackup struct { - Xtrabackup *GetVersionsRequest_Xtrabackup `protobuf:"bytes,2,opt,name=xtrabackup,proto3,oneof"` -} - -type GetVersionsRequest_Software_Xbcloud struct { - Xbcloud *GetVersionsRequest_Xbcloud `protobuf:"bytes,3,opt,name=xbcloud,proto3,oneof"` -} - -type GetVersionsRequest_Software_Qpress struct { - Qpress *GetVersionsRequest_Qpress `protobuf:"bytes,4,opt,name=qpress,proto3,oneof"` -} - -type GetVersionsRequest_Software_Mongod struct { - Mongod *GetVersionsRequest_MongoDB `protobuf:"bytes,5,opt,name=mongod,proto3,oneof"` -} - -type GetVersionsRequest_Software_Pbm struct { - Pbm *GetVersionsRequest_PBM `protobuf:"bytes,6,opt,name=pbm,proto3,oneof"` -} - -func (*GetVersionsRequest_Software_Mysqld) isGetVersionsRequest_Software_Software() {} - -func (*GetVersionsRequest_Software_Xtrabackup) isGetVersionsRequest_Software_Software() {} - -func (*GetVersionsRequest_Software_Xbcloud) isGetVersionsRequest_Software_Software() {} - -func (*GetVersionsRequest_Software_Qpress) isGetVersionsRequest_Software_Software() {} - -func (*GetVersionsRequest_Software_Mongod) isGetVersionsRequest_Software_Software() {} - -func (*GetVersionsRequest_Software_Pbm) isGetVersionsRequest_Software_Software() {} - -// Version contains the version field of the requested software and -// the error field which is set in case of version retrieving error. -type GetVersionsResponse_Version struct { - state protoimpl.MessageState `protogen:"open.v1"` - Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` - Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetVersionsResponse_Version) Reset() { - *x = GetVersionsResponse_Version{} - mi := &file_agent_v1_agent_proto_msgTypes[90] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetVersionsResponse_Version) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetVersionsResponse_Version) ProtoMessage() {} - -func (x *GetVersionsResponse_Version) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_agent_proto_msgTypes[90] - 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 GetVersionsResponse_Version.ProtoReflect.Descriptor instead. -func (*GetVersionsResponse_Version) Descriptor() ([]byte, []int) { - return file_agent_v1_agent_proto_rawDescGZIP(), []int{39, 0} -} - -func (x *GetVersionsResponse_Version) GetVersion() string { - if x != nil { - return x.Version - } - return "" -} - -func (x *GetVersionsResponse_Version) GetError() string { - if x != nil { - return x.Error - } - return "" -} - -var File_agent_v1_agent_proto protoreflect.FileDescriptor - -const file_agent_v1_agent_proto_rawDesc = "" + - "\n" + - "\x14agent/v1/agent.proto\x12\bagent.v1\x1a\x18agent/v1/collector.proto\x1a\x16backup/v1/common.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\x1a\x1finventory/v1/agent_status.proto\x1a\x19inventory/v1/agents.proto\x1a\x1binventory/v1/services.proto\"\xdd\x01\n" + - "\tTextFiles\x124\n" + - "\x05files\x18\x01 \x03(\v2\x1e.agent.v1.TextFiles.FilesEntryR\x05files\x12.\n" + - "\x13template_left_delim\x18\x02 \x01(\tR\x11templateLeftDelim\x120\n" + - "\x14template_right_delim\x18\x03 \x01(\tR\x12templateRightDelim\x1a8\n" + - "\n" + - "FilesEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\x06\n" + - "\x04Ping\"E\n" + - "\x04Pong\x12=\n" + - "\fcurrent_time\x18\x01 \x01(\v2\x1a.google.protobuf.TimestampR\vcurrentTime\"S\n" + - "\x11QANCollectRequest\x12>\n" + - "\x0emetrics_bucket\x18\x01 \x03(\v2\x17.agent.v1.MetricsBucketR\rmetricsBucket\"\x14\n" + - "\x12QANCollectResponse\"\xca\x01\n" + - "\x13StateChangedRequest\x12\x19\n" + - "\bagent_id\x18\x01 \x01(\tR\aagentId\x121\n" + - "\x06status\x18\x02 \x01(\x0e2\x19.inventory.v1.AgentStatusR\x06status\x12\x1f\n" + - "\vlisten_port\x18\x03 \x01(\rR\n" + - "listenPort\x12*\n" + - "\x11process_exec_path\x18\x04 \x01(\tR\x0fprocessExecPath\x12\x18\n" + - "\aversion\x18\x05 \x01(\tR\aversion\"\x16\n" + - "\x14StateChangedResponse\"\x95\t\n" + - "\x0fSetStateRequest\x12V\n" + - "\x0fagent_processes\x18\x01 \x03(\v2-.agent.v1.SetStateRequest.AgentProcessesEntryR\x0eagentProcesses\x12S\n" + - "\x0ebuiltin_agents\x18\x02 \x03(\v2,.agent.v1.SetStateRequest.BuiltinAgentsEntryR\rbuiltinAgents\x1a\xfa\x02\n" + - "\fAgentProcess\x12+\n" + - "\x04type\x18\x01 \x01(\x0e2\x17.inventory.v1.AgentTypeR\x04type\x12.\n" + - "\x13template_left_delim\x18\x02 \x01(\tR\x11templateLeftDelim\x120\n" + - "\x14template_right_delim\x18\x03 \x01(\tR\x12templateRightDelim\x12\x12\n" + - "\x04args\x18\x04 \x03(\tR\x04args\x12\x10\n" + - "\x03env\x18\x05 \x03(\tR\x03env\x12T\n" + - "\n" + - "text_files\x18\x06 \x03(\v25.agent.v1.SetStateRequest.AgentProcess.TextFilesEntryR\ttextFiles\x12!\n" + - "\fredact_words\x18\a \x03(\tR\vredactWords\x1a<\n" + - "\x0eTextFilesEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\x1ai\n" + - "\x13AgentProcessesEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12<\n" + - "\x05value\x18\x02 \x01(\v2&.agent.v1.SetStateRequest.AgentProcessR\x05value:\x028\x01\x1a\x82\x03\n" + - "\fBuiltinAgent\x12+\n" + - "\x04type\x18\x01 \x01(\x0e2\x17.inventory.v1.AgentTypeR\x04type\x12\x10\n" + - "\x03dsn\x18\x02 \x01(\tR\x03dsn\x12(\n" + - "\x10max_query_length\x18\x03 \x01(\x05R\x0emaxQueryLength\x128\n" + - "\x18disable_comments_parsing\x18\x04 \x01(\bR\x16disableCommentsParsing\x124\n" + - "\x16disable_query_examples\x18\x05 \x01(\bR\x14disableQueryExamples\x12+\n" + - "\x12max_query_log_size\x18\x06 \x01(\x03R\x0fmaxQueryLogSize\x122\n" + - "\n" + - "text_files\x18\a \x01(\v2\x13.agent.v1.TextFilesR\ttextFiles\x12\x10\n" + - "\x03tls\x18\b \x01(\bR\x03tls\x12&\n" + - "\x0ftls_skip_verify\x18\t \x01(\bR\rtlsSkipVerify\x1ah\n" + - "\x12BuiltinAgentsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12<\n" + - "\x05value\x18\x02 \x01(\v2&.agent.v1.SetStateRequest.BuiltinAgentR\x05value:\x028\x01\"\x12\n" + - "\x10SetStateResponse\"\x83\x03\n" + - "\x10QueryActionValue\x12\x12\n" + - "\x03nil\x18\x01 \x01(\bH\x00R\x03nil\x12\x14\n" + - "\x04bool\x18\x02 \x01(\bH\x00R\x04bool\x12\x16\n" + - "\x05int64\x18\x03 \x01(\x03H\x00R\x05int64\x12\x18\n" + - "\x06uint64\x18\x04 \x01(\x04H\x00R\x06uint64\x12\x18\n" + - "\x06double\x18\x05 \x01(\x01H\x00R\x06double\x12\x16\n" + - "\x05bytes\x18\x06 \x01(\fH\x00R\x05bytes\x12:\n" + - "\ttimestamp\x18\b \x01(\v2\x1a.google.protobuf.TimestampH\x00R\ttimestamp\x122\n" + - "\x05slice\x18\n" + - " \x01(\v2\x1a.agent.v1.QueryActionSliceH\x00R\x05slice\x12,\n" + - "\x03map\x18\v \x01(\v2\x18.agent.v1.QueryActionMapH\x00R\x03map\x125\n" + - "\x06binary\x18\f \x01(\v2\x1b.agent.v1.QueryActionBinaryH\x00R\x06binaryB\x06\n" + - "\x04kindJ\x04\b\a\x10\b\"D\n" + - "\x10QueryActionSlice\x120\n" + - "\x05slice\x18\x01 \x03(\v2\x1a.agent.v1.QueryActionValueR\x05slice\"\x99\x01\n" + - "\x0eQueryActionMap\x123\n" + - "\x03map\x18\x01 \x03(\v2!.agent.v1.QueryActionMap.MapEntryR\x03map\x1aR\n" + - "\bMapEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x120\n" + - "\x05value\x18\x02 \x01(\v2\x1a.agent.v1.QueryActionValueR\x05value:\x028\x01\"C\n" + - "\x11QueryActionBinary\x12\x18\n" + - "\asubtype\x18\x01 \x01(\x05R\asubtype\x12\x14\n" + - "\x05bytes\x18\x02 \x01(\fR\x05bytes\"\x8b\x01\n" + - "\x11QueryActionResult\x12\x18\n" + - "\acolumns\x18\x01 \x03(\tR\acolumns\x12.\n" + - "\x04rows\x18\x02 \x03(\v2\x1a.agent.v1.QueryActionSliceR\x04rows\x12,\n" + - "\x04docs\x18\x03 \x03(\v2\x18.agent.v1.QueryActionMapR\x04docs\"\x98,\n" + - "\x12StartActionRequest\x12\x1b\n" + - "\taction_id\x18\x01 \x01(\tR\bactionId\x123\n" + - "\atimeout\x18\x02 \x01(\v2\x19.google.protobuf.DurationR\atimeout\x12c\n" + - "\x14mysql_explain_params\x18\n" + - " \x01(\v2/.agent.v1.StartActionRequest.MySQLExplainParamsH\x00R\x12mysqlExplainParams\x12}\n" + - "\x1emysql_show_create_table_params\x18\v \x01(\v27.agent.v1.StartActionRequest.MySQLShowCreateTableParamsH\x00R\x1amysqlShowCreateTableParams\x12}\n" + - "\x1emysql_show_table_status_params\x18\f \x01(\v27.agent.v1.StartActionRequest.MySQLShowTableStatusParamsH\x00R\x1amysqlShowTableStatusParams\x12j\n" + - "\x17mysql_show_index_params\x18\r \x01(\v21.agent.v1.StartActionRequest.MySQLShowIndexParamsH\x00R\x14mysqlShowIndexParams\x12\x8c\x01\n" + - "#postgresql_show_create_table_params\x18\x0e \x01(\v2<.agent.v1.StartActionRequest.PostgreSQLShowCreateTableParamsH\x00R\x1fpostgresqlShowCreateTableParams\x12y\n" + - "\x1cpostgresql_show_index_params\x18\x0f \x01(\v26.agent.v1.StartActionRequest.PostgreSQLShowIndexParamsH\x00R\x19postgresqlShowIndexParams\x12i\n" + - "\x16mongodb_explain_params\x18\x10 \x01(\v21.agent.v1.StartActionRequest.MongoDBExplainParamsH\x00R\x14mongodbExplainParams\x12Z\n" + - "\x11pt_summary_params\x18\x11 \x01(\v2,.agent.v1.StartActionRequest.PTSummaryParamsH\x00R\x0fptSummaryParams\x12a\n" + - "\x14pt_pg_summary_params\x18\x12 \x01(\v2..agent.v1.StartActionRequest.PTPgSummaryParamsH\x00R\x11ptPgSummaryParams\x12p\n" + - "\x19pt_mongodb_summary_params\x18\x13 \x01(\v23.agent.v1.StartActionRequest.PTMongoDBSummaryParamsH\x00R\x16ptMongodbSummaryParams\x12j\n" + - "\x17pt_mysql_summary_params\x18\x14 \x01(\v21.agent.v1.StartActionRequest.PTMySQLSummaryParamsH\x00R\x14ptMysqlSummaryParams\x12j\n" + - "\x17mysql_query_show_params\x18\x15 \x01(\v21.agent.v1.StartActionRequest.MySQLQueryShowParamsH\x00R\x14mysqlQueryShowParams\x12p\n" + - "\x19mysql_query_select_params\x18\x16 \x01(\v23.agent.v1.StartActionRequest.MySQLQuerySelectParamsH\x00R\x16mysqlQuerySelectParams\x12y\n" + - "\x1cpostgresql_query_show_params\x18\x17 \x01(\v26.agent.v1.StartActionRequest.PostgreSQLQueryShowParamsH\x00R\x19postgresqlQueryShowParams\x12\x7f\n" + - "\x1epostgresql_query_select_params\x18\x18 \x01(\v28.agent.v1.StartActionRequest.PostgreSQLQuerySelectParamsH\x00R\x1bpostgresqlQuerySelectParams\x12\x88\x01\n" + - "!mongodb_query_getparameter_params\x18\x19 \x01(\v2;.agent.v1.StartActionRequest.MongoDBQueryGetParameterParamsH\x00R\x1emongodbQueryGetparameterParams\x12\x7f\n" + - "\x1emongodb_query_buildinfo_params\x18\x1a \x01(\v28.agent.v1.StartActionRequest.MongoDBQueryBuildInfoParamsH\x00R\x1bmongodbQueryBuildinfoParams\x12\x8e\x01\n" + - "#mongodb_query_getcmdlineopts_params\x18\x1b \x01(\v2=.agent.v1.StartActionRequest.MongoDBQueryGetCmdLineOptsParamsH\x00R mongodbQueryGetcmdlineoptsParams\x12\x94\x01\n" + - "%mongodb_query_replsetgetstatus_params\x18\x1c \x01(\v2?.agent.v1.StartActionRequest.MongoDBQueryReplSetGetStatusParamsH\x00R\"mongodbQueryReplsetgetstatusParams\x12\x97\x01\n" + - "&mongodb_query_getdiagnosticdata_params\x18\x1d \x01(\v2@.agent.v1.StartActionRequest.MongoDBQueryGetDiagnosticDataParamsH\x00R#mongodbQueryGetdiagnosticdataParams\x12v\n" + - "\x1arestart_sys_service_params\x182 \x01(\v27.agent.v1.StartActionRequest.RestartSystemServiceParamsH\x00R\x17restartSysServiceParams\x1a\x8f\x02\n" + - "\x12MySQLExplainParams\x12\x10\n" + - "\x03dsn\x18\x01 \x01(\tR\x03dsn\x12\x14\n" + - "\x05query\x18\x02 \x01(\tR\x05query\x12\x16\n" + - "\x06values\x18\x03 \x03(\tR\x06values\x12\x16\n" + - "\x06schema\x18\x04 \x01(\tR\x06schema\x12G\n" + - "\routput_format\x18\x05 \x01(\x0e2\".agent.v1.MysqlExplainOutputFormatR\foutputFormat\x120\n" + - "\ttls_files\x18\x06 \x01(\v2\x13.agent.v1.TextFilesR\btlsFiles\x12&\n" + - "\x0ftls_skip_verify\x18\a \x01(\bR\rtlsSkipVerify\x1a\x9e\x01\n" + - "\x1aMySQLShowCreateTableParams\x12\x10\n" + - "\x03dsn\x18\x01 \x01(\tR\x03dsn\x12\x14\n" + - "\x05table\x18\x02 \x01(\tR\x05table\x120\n" + - "\ttls_files\x18\x03 \x01(\v2\x13.agent.v1.TextFilesR\btlsFiles\x12&\n" + - "\x0ftls_skip_verify\x18\x04 \x01(\bR\rtlsSkipVerify\x1a\x9e\x01\n" + - "\x1aMySQLShowTableStatusParams\x12\x10\n" + - "\x03dsn\x18\x01 \x01(\tR\x03dsn\x12\x14\n" + - "\x05table\x18\x02 \x01(\tR\x05table\x120\n" + - "\ttls_files\x18\x03 \x01(\v2\x13.agent.v1.TextFilesR\btlsFiles\x12&\n" + - "\x0ftls_skip_verify\x18\x04 \x01(\bR\rtlsSkipVerify\x1a\x98\x01\n" + - "\x14MySQLShowIndexParams\x12\x10\n" + - "\x03dsn\x18\x01 \x01(\tR\x03dsn\x12\x14\n" + - "\x05table\x18\x02 \x01(\tR\x05table\x120\n" + - "\ttls_files\x18\x03 \x01(\v2\x13.agent.v1.TextFilesR\btlsFiles\x12&\n" + - "\x0ftls_skip_verify\x18\x04 \x01(\bR\rtlsSkipVerify\x1a\xa3\x01\n" + - "\x1fPostgreSQLShowCreateTableParams\x12\x10\n" + - "\x03dsn\x18\x01 \x01(\tR\x03dsn\x12\x14\n" + - "\x05table\x18\x02 \x01(\tR\x05table\x120\n" + - "\ttls_files\x18\x03 \x01(\v2\x13.agent.v1.TextFilesR\btlsFiles\x12&\n" + - "\x0ftls_skip_verify\x18\x04 \x01(\bR\rtlsSkipVerify\x1a\x9d\x01\n" + - "\x19PostgreSQLShowIndexParams\x12\x10\n" + - "\x03dsn\x18\x01 \x01(\tR\x03dsn\x12\x14\n" + - "\x05table\x18\x02 \x01(\tR\x05table\x120\n" + - "\ttls_files\x18\x03 \x01(\v2\x13.agent.v1.TextFilesR\btlsFiles\x12&\n" + - "\x0ftls_skip_verify\x18\x04 \x01(\bR\rtlsSkipVerify\x1ar\n" + - "\x14MongoDBExplainParams\x12\x10\n" + - "\x03dsn\x18\x01 \x01(\tR\x03dsn\x12\x14\n" + - "\x05query\x18\x02 \x01(\tR\x05query\x122\n" + - "\n" + - "text_files\x18\x03 \x01(\v2\x13.agent.v1.TextFilesR\ttextFiles\x1a\x11\n" + - "\x0fPTSummaryParams\x1as\n" + - "\x11PTPgSummaryParams\x12\x12\n" + - "\x04host\x18\x01 \x01(\tR\x04host\x12\x12\n" + - "\x04port\x18\x02 \x01(\rR\x04port\x12\x1a\n" + - "\busername\x18\x03 \x01(\tR\busername\x12\x1a\n" + - "\bpassword\x18\x04 \x01(\tR\bpassword\x1ax\n" + - "\x16PTMongoDBSummaryParams\x12\x12\n" + - "\x04host\x18\x01 \x01(\tR\x04host\x12\x12\n" + - "\x04port\x18\x02 \x01(\rR\x04port\x12\x1a\n" + - "\busername\x18\x03 \x01(\tR\busername\x12\x1a\n" + - "\bpassword\x18\x04 \x01(\tR\bpassword\x1a\x8e\x01\n" + - "\x14PTMySQLSummaryParams\x12\x12\n" + - "\x04host\x18\x01 \x01(\tR\x04host\x12\x12\n" + - "\x04port\x18\x02 \x01(\rR\x04port\x12\x16\n" + - "\x06socket\x18\x03 \x01(\tR\x06socket\x12\x1a\n" + - "\busername\x18\x04 \x01(\tR\busername\x12\x1a\n" + - "\bpassword\x18\x05 \x01(\tR\bpassword\x1a\x98\x01\n" + - "\x14MySQLQueryShowParams\x12\x10\n" + - "\x03dsn\x18\x01 \x01(\tR\x03dsn\x12\x14\n" + - "\x05query\x18\x02 \x01(\tR\x05query\x120\n" + - "\ttls_files\x18\x03 \x01(\v2\x13.agent.v1.TextFilesR\btlsFiles\x12&\n" + - "\x0ftls_skip_verify\x18\x04 \x01(\bR\rtlsSkipVerify\x1a\x9a\x01\n" + - "\x16MySQLQuerySelectParams\x12\x10\n" + - "\x03dsn\x18\x01 \x01(\tR\x03dsn\x12\x14\n" + - "\x05query\x18\x02 \x01(\tR\x05query\x120\n" + - "\ttls_files\x18\x03 \x01(\v2\x13.agent.v1.TextFilesR\btlsFiles\x12&\n" + - "\x0ftls_skip_verify\x18\x04 \x01(\bR\rtlsSkipVerify\x1a\x87\x01\n" + - "\x19PostgreSQLQueryShowParams\x12\x10\n" + - "\x03dsn\x18\x01 \x01(\tR\x03dsn\x120\n" + - "\ttls_files\x18\x02 \x01(\v2\x13.agent.v1.TextFilesR\btlsFiles\x12&\n" + - "\x0ftls_skip_verify\x18\x03 \x01(\bR\rtlsSkipVerify\x1a\x9f\x01\n" + - "\x1bPostgreSQLQuerySelectParams\x12\x10\n" + - "\x03dsn\x18\x01 \x01(\tR\x03dsn\x12\x14\n" + - "\x05query\x18\x02 \x01(\tR\x05query\x120\n" + - "\ttls_files\x18\x03 \x01(\v2\x13.agent.v1.TextFilesR\btlsFiles\x12&\n" + - "\x0ftls_skip_verify\x18\x04 \x01(\bR\rtlsSkipVerify\x1af\n" + - "\x1eMongoDBQueryGetParameterParams\x12\x10\n" + - "\x03dsn\x18\x01 \x01(\tR\x03dsn\x122\n" + - "\n" + - "text_files\x18\x02 \x01(\v2\x13.agent.v1.TextFilesR\ttextFiles\x1ac\n" + - "\x1bMongoDBQueryBuildInfoParams\x12\x10\n" + - "\x03dsn\x18\x01 \x01(\tR\x03dsn\x122\n" + - "\n" + - "text_files\x18\x02 \x01(\v2\x13.agent.v1.TextFilesR\ttextFiles\x1ah\n" + - " MongoDBQueryGetCmdLineOptsParams\x12\x10\n" + - "\x03dsn\x18\x01 \x01(\tR\x03dsn\x122\n" + - "\n" + - "text_files\x18\x02 \x01(\v2\x13.agent.v1.TextFilesR\ttextFiles\x1aj\n" + - "\"MongoDBQueryReplSetGetStatusParams\x12\x10\n" + - "\x03dsn\x18\x01 \x01(\tR\x03dsn\x122\n" + - "\n" + - "text_files\x18\x02 \x01(\v2\x13.agent.v1.TextFilesR\ttextFiles\x1ak\n" + - "#MongoDBQueryGetDiagnosticDataParams\x12\x10\n" + - "\x03dsn\x18\x01 \x01(\tR\x03dsn\x122\n" + - "\n" + - "text_files\x18\x02 \x01(\v2\x13.agent.v1.TextFilesR\ttextFiles\x1a\xf4\x01\n" + - "\x1aRestartSystemServiceParams\x12l\n" + - "\x0esystem_service\x18\x01 \x01(\x0e2E.agent.v1.StartActionRequest.RestartSystemServiceParams.SystemServiceR\rsystemService\"h\n" + - "\rSystemService\x12\x1e\n" + - "\x1aSYSTEM_SERVICE_UNSPECIFIED\x10\x00\x12\x19\n" + - "\x15SYSTEM_SERVICE_MONGOD\x10\x01\x12\x1c\n" + - "\x18SYSTEM_SERVICE_PBM_AGENT\x10\x02B\b\n" + - "\x06params\"\x15\n" + - "\x13StartActionResponse\"0\n" + - "\x11StopActionRequest\x12\x1b\n" + - "\taction_id\x18\x01 \x01(\tR\bactionId\"\x14\n" + - "\x12StopActionResponse\"t\n" + - "\x13ActionResultRequest\x12\x1b\n" + - "\taction_id\x18\x01 \x01(\tR\bactionId\x12\x16\n" + - "\x06output\x18\x03 \x01(\fR\x06output\x12\x12\n" + - "\x04done\x18\x04 \x01(\bR\x04done\x12\x14\n" + - "\x05error\x18\x05 \x01(\tR\x05error\"\x16\n" + - "\x14ActionResultResponse\"v\n" + - "\x14PBMSwitchPITRRequest\x12\x10\n" + - "\x03dsn\x18\x01 \x01(\tR\x03dsn\x122\n" + - "\n" + - "text_files\x18\x02 \x01(\v2\x13.agent.v1.TextFilesR\ttextFiles\x12\x18\n" + - "\aenabled\x18\x03 \x01(\bR\aenabled\"-\n" + - "\x15PBMSwitchPITRResponse\x12\x14\n" + - "\x05error\x18\x01 \x01(\tR\x05error\"C\n" + - "\x10AgentLogsRequest\x12\x19\n" + - "\bagent_id\x18\x01 \x01(\tR\aagentId\x12\x14\n" + - "\x05limit\x18\x02 \x01(\rR\x05limit\"g\n" + - "\x11AgentLogsResponse\x12\x12\n" + - "\x04logs\x18\x01 \x03(\tR\x04logs\x12>\n" + - "\x1cagent_config_log_lines_count\x18\x02 \x01(\rR\x18agentConfigLogLinesCount\"\xfc\x01\n" + - "\x16CheckConnectionRequest\x12-\n" + - "\x04type\x18\x01 \x01(\x0e2\x19.inventory.v1.ServiceTypeR\x04type\x12\x10\n" + - "\x03dsn\x18\x02 \x01(\tR\x03dsn\x123\n" + - "\atimeout\x18\x03 \x01(\v2\x19.google.protobuf.DurationR\atimeout\x122\n" + - "\n" + - "text_files\x18\x04 \x01(\v2\x13.agent.v1.TextFilesR\ttextFiles\x12&\n" + - "\x0ftls_skip_verify\x18\x05 \x01(\bR\rtlsSkipVerify\x12\x10\n" + - "\x03tls\x18\x06 \x01(\bR\x03tls\"Y\n" + - "\x17CheckConnectionResponse\x12\x14\n" + - "\x05error\x18\x01 \x01(\tR\x05error\x1a(\n" + - "\x05Stats\x12\x1f\n" + - "\vtable_count\x18\x01 \x01(\x05R\n" + - "tableCount\"\xf8\x01\n" + - "\x12ServiceInfoRequest\x12-\n" + - "\x04type\x18\x01 \x01(\x0e2\x19.inventory.v1.ServiceTypeR\x04type\x12\x10\n" + - "\x03dsn\x18\x02 \x01(\tR\x03dsn\x123\n" + - "\atimeout\x18\x03 \x01(\v2\x19.google.protobuf.DurationR\atimeout\x122\n" + - "\n" + - "text_files\x18\x04 \x01(\v2\x13.agent.v1.TextFilesR\ttextFiles\x12&\n" + - "\x0ftls_skip_verify\x18\x05 \x01(\bR\rtlsSkipVerify\x12\x10\n" + - "\x03tls\x18\x06 \x01(\bR\x03tls\"\xc4\x01\n" + - "\x13ServiceInfoResponse\x12\x14\n" + - "\x05error\x18\x01 \x01(\tR\x05error\x12\x1f\n" + - "\vtable_count\x18\x02 \x01(\x05R\n" + - "tableCount\x12\x18\n" + - "\aversion\x18\x03 \x01(\tR\aversion\x12#\n" + - "\rdatabase_list\x18\x04 \x03(\tR\fdatabaseList\x12&\n" + - "\fpgsm_version\x18\x05 \x01(\tH\x00R\vpgsmVersion\x88\x01\x01B\x0f\n" + - "\r_pgsm_version\")\n" + - "\x10JobStatusRequest\x12\x15\n" + - "\x06job_id\x18\x01 \x01(\tR\x05jobId\")\n" + - "\x11JobStatusResponse\x12\x14\n" + - "\x05alive\x18\x01 \x01(\bR\x05alive\"\xb2\x01\n" + - "\x10S3LocationConfig\x12\x1a\n" + - "\bendpoint\x18\x01 \x01(\tR\bendpoint\x12\x1d\n" + - "\n" + - "access_key\x18\x02 \x01(\tR\taccessKey\x12\x1d\n" + - "\n" + - "secret_key\x18\x03 \x01(\tR\tsecretKey\x12\x1f\n" + - "\vbucket_name\x18\x04 \x01(\tR\n" + - "bucketName\x12#\n" + - "\rbucket_region\x18\x05 \x01(\tR\fbucketRegion\".\n" + - "\x18FilesystemLocationConfig\x12\x12\n" + - "\x04path\x18\x01 \x01(\tR\x04path\"\xd3\r\n" + - "\x0fStartJobRequest\x12\x15\n" + - "\x06job_id\x18\x01 \x01(\tR\x05jobId\x123\n" + - "\atimeout\x18\x02 \x01(\v2\x19.google.protobuf.DurationR\atimeout\x12J\n" + - "\fmysql_backup\x18\v \x01(\v2%.agent.v1.StartJobRequest.MySQLBackupH\x00R\vmysqlBackup\x12`\n" + - "\x14mysql_restore_backup\x18\f \x01(\v2,.agent.v1.StartJobRequest.MySQLRestoreBackupH\x00R\x12mysqlRestoreBackup\x12P\n" + - "\x0emongodb_backup\x18\r \x01(\v2'.agent.v1.StartJobRequest.MongoDBBackupH\x00R\rmongodbBackup\x12f\n" + - "\x16mongodb_restore_backup\x18\x0e \x01(\v2..agent.v1.StartJobRequest.MongoDBRestoreBackupH\x00R\x14mongodbRestoreBackup\x1a\x96\x02\n" + - "\vMySQLBackup\x12\x12\n" + - "\x04user\x18\x01 \x01(\tR\x04user\x12\x1a\n" + - "\bpassword\x18\x02 \x01(\tR\bpassword\x12\x18\n" + - "\aaddress\x18\x03 \x01(\tR\aaddress\x12\x12\n" + - "\x04port\x18\x04 \x01(\x05R\x04port\x12\x16\n" + - "\x06socket\x18\x05 \x01(\tR\x06socket\x12\x12\n" + - "\x04name\x18\x06 \x01(\tR\x04name\x12\x16\n" + - "\x06folder\x18\a \x01(\tR\x06folder\x129\n" + - "\ts3_config\x18\n" + - " \x01(\v2\x1a.agent.v1.S3LocationConfigH\x00R\bs3ConfigB\x11\n" + - "\x0flocation_configJ\x04\b\v\x10\fR\x11filesystem_config\x1a\xc6\x01\n" + - "\x12MySQLRestoreBackup\x12\x1d\n" + - "\n" + - "service_id\x18\x01 \x01(\tR\tserviceId\x12\x12\n" + - "\x04name\x18\x02 \x01(\tR\x04name\x12\x16\n" + - "\x06folder\x18\x03 \x01(\tR\x06folder\x129\n" + - "\ts3_config\x18\n" + - " \x01(\v2\x1a.agent.v1.S3LocationConfigH\x00R\bs3ConfigB\x11\n" + - "\x0flocation_configJ\x04\b\v\x10\fR\x11filesystem_config\x1a\xf8\x02\n" + - "\rMongoDBBackup\x12\x10\n" + - "\x03dsn\x18\x01 \x01(\tR\x03dsn\x122\n" + - "\n" + - "text_files\x18\x02 \x01(\v2\x13.agent.v1.TextFilesR\ttextFiles\x12\x12\n" + - "\x04name\x18\x03 \x01(\tR\x04name\x12\x16\n" + - "\x06folder\x18\x04 \x01(\tR\x06folder\x12\x1f\n" + - "\venable_pitr\x18\x05 \x01(\bR\n" + - "enablePitr\x123\n" + - "\n" + - "data_model\x18\x06 \x01(\x0e2\x14.backup.v1.DataModelR\tdataModel\x129\n" + - "\ts3_config\x18\n" + - " \x01(\v2\x1a.agent.v1.S3LocationConfigH\x00R\bs3Config\x12Q\n" + - "\x11filesystem_config\x18\v \x01(\v2\".agent.v1.FilesystemLocationConfigH\x00R\x10filesystemConfigB\x11\n" + - "\x0flocation_config\x1a\xa7\x03\n" + - "\x14MongoDBRestoreBackup\x12\x10\n" + - "\x03dsn\x18\x01 \x01(\tR\x03dsn\x122\n" + - "\n" + - "text_files\x18\x02 \x01(\v2\x13.agent.v1.TextFilesR\ttextFiles\x12\x12\n" + - "\x04name\x18\x03 \x01(\tR\x04name\x12\x16\n" + - "\x06folder\x18\x04 \x01(\tR\x06folder\x129\n" + - "\fpbm_metadata\x18\x05 \x01(\v2\x16.backup.v1.PbmMetadataR\vpbmMetadata\x12A\n" + - "\x0epitr_timestamp\x18\x06 \x01(\v2\x1a.google.protobuf.TimestampR\rpitrTimestamp\x129\n" + - "\ts3_config\x18\n" + - " \x01(\v2\x1a.agent.v1.S3LocationConfigH\x00R\bs3Config\x12Q\n" + - "\x11filesystem_config\x18\v \x01(\v2\".agent.v1.FilesystemLocationConfigH\x00R\x10filesystemConfigB\x11\n" + - "\x0flocation_configB\x05\n" + - "\x03job\"(\n" + - "\x10StartJobResponse\x12\x14\n" + - "\x05error\x18\x01 \x01(\tR\x05error\"'\n" + - "\x0eStopJobRequest\x12\x15\n" + - "\x06job_id\x18\x01 \x01(\tR\x05jobId\"\x11\n" + - "\x0fStopJobResponse\"\xea\x05\n" + - "\tJobResult\x12\x15\n" + - "\x06job_id\x18\x01 \x01(\tR\x05jobId\x128\n" + - "\ttimestamp\x18\x02 \x01(\v2\x1a.google.protobuf.TimestampR\ttimestamp\x121\n" + - "\x05error\x18\n" + - " \x01(\v2\x19.agent.v1.JobResult.ErrorH\x00R\x05error\x12D\n" + - "\fmysql_backup\x18\f \x01(\v2\x1f.agent.v1.JobResult.MySQLBackupH\x00R\vmysqlBackup\x12Z\n" + - "\x14mysql_restore_backup\x18\r \x01(\v2&.agent.v1.JobResult.MySQLRestoreBackupH\x00R\x12mysqlRestoreBackup\x12J\n" + - "\x0emongodb_backup\x18\x0e \x01(\v2!.agent.v1.JobResult.MongoDBBackupH\x00R\rmongodbBackup\x12`\n" + - "\x16mongodb_restore_backup\x18\x0f \x01(\v2(.agent.v1.JobResult.MongoDBRestoreBackupH\x00R\x14mongodbRestoreBackup\x1a!\n" + - "\x05Error\x12\x18\n" + - "\amessage\x18\x01 \x01(\tR\amessage\x1an\n" + - "\rMongoDBBackup\x12,\n" + - "\x12is_sharded_cluster\x18\x01 \x01(\bR\x10isShardedCluster\x12/\n" + - "\bmetadata\x18\x02 \x01(\v2\x13.backup.v1.MetadataR\bmetadata\x1a>\n" + - "\vMySQLBackup\x12/\n" + - "\bmetadata\x18\x01 \x01(\v2\x13.backup.v1.MetadataR\bmetadata\x1a\x14\n" + - "\x12MySQLRestoreBackup\x1a\x16\n" + - "\x14MongoDBRestoreBackupB\b\n" + - "\x06result\"\xb0\x03\n" + - "\vJobProgress\x12\x15\n" + - "\x06job_id\x18\x01 \x01(\tR\x05jobId\x128\n" + - "\ttimestamp\x18\x02 \x01(\v2\x1a.google.protobuf.TimestampR\ttimestamp\x12F\n" + - "\fmysql_backup\x18\v \x01(\v2!.agent.v1.JobProgress.MySQLBackupH\x00R\vmysqlBackup\x12\\\n" + - "\x14mysql_restore_backup\x18\f \x01(\v2(.agent.v1.JobProgress.MySQLRestoreBackupH\x00R\x12mysqlRestoreBackup\x120\n" + - "\x04logs\x18\x14 \x01(\v2\x1a.agent.v1.JobProgress.LogsH\x00R\x04logs\x1a\r\n" + - "\vMySQLBackup\x1a\x14\n" + - "\x12MySQLRestoreBackup\x1aI\n" + - "\x04Logs\x12\x19\n" + - "\bchunk_id\x18\x01 \x01(\rR\achunkId\x12\x12\n" + - "\x04data\x18\x02 \x01(\tR\x04data\x12\x12\n" + - "\x04done\x18\x03 \x01(\bR\x04doneB\b\n" + - "\x06result\"\xb2\x04\n" + - "\x12GetVersionsRequest\x12C\n" + - "\tsoftwares\x18\x01 \x03(\v2%.agent.v1.GetVersionsRequest.SoftwareR\tsoftwares\x1a\b\n" + - "\x06MySQLd\x1a\f\n" + - "\n" + - "Xtrabackup\x1a\t\n" + - "\aXbcloud\x1a\b\n" + - "\x06Qpress\x1a\t\n" + - "\aMongoDB\x1a\x05\n" + - "\x03PBM\x1a\x97\x03\n" + - "\bSoftware\x12=\n" + - "\x06mysqld\x18\x01 \x01(\v2#.agent.v1.GetVersionsRequest.MySQLdH\x00R\x06mysqld\x12I\n" + - "\n" + - "xtrabackup\x18\x02 \x01(\v2'.agent.v1.GetVersionsRequest.XtrabackupH\x00R\n" + - "xtrabackup\x12@\n" + - "\axbcloud\x18\x03 \x01(\v2$.agent.v1.GetVersionsRequest.XbcloudH\x00R\axbcloud\x12=\n" + - "\x06qpress\x18\x04 \x01(\v2#.agent.v1.GetVersionsRequest.QpressH\x00R\x06qpress\x12>\n" + - "\x06mongod\x18\x05 \x01(\v2$.agent.v1.GetVersionsRequest.MongoDBH\x00R\x06mongod\x124\n" + - "\x03pbm\x18\x06 \x01(\v2 .agent.v1.GetVersionsRequest.PBMH\x00R\x03pbmB\n" + - "\n" + - "\bsoftware\"\x93\x01\n" + - "\x13GetVersionsResponse\x12A\n" + - "\bversions\x18\x01 \x03(\v2%.agent.v1.GetVersionsResponse.VersionR\bversions\x1a9\n" + - "\aVersion\x12\x18\n" + - "\aversion\x18\x01 \x01(\tR\aversion\x12\x14\n" + - "\x05error\x18\x02 \x01(\tR\x05error\"\xb2\t\n" + - "\fAgentMessage\x12\x0e\n" + - "\x02id\x18\x01 \x01(\rR\x02id\x12+\n" + - "\x06status\x18\xff\x0f \x01(\v2\x12.google.rpc.StatusR\x06status\x12$\n" + - "\x04ping\x18\x02 \x01(\v2\x0e.agent.v1.PingH\x00R\x04ping\x12D\n" + - "\rstate_changed\x18\x03 \x01(\v2\x1d.agent.v1.StateChangedRequestH\x00R\fstateChanged\x12>\n" + - "\vqan_collect\x18\x04 \x01(\v2\x1b.agent.v1.QANCollectRequestH\x00R\n" + - "qanCollect\x12D\n" + - "\raction_result\x18\x05 \x01(\v2\x1d.agent.v1.ActionResultRequestH\x00R\factionResult\x124\n" + - "\n" + - "job_result\x18\x10 \x01(\v2\x13.agent.v1.JobResultH\x00R\tjobResult\x12:\n" + - "\fjob_progress\x18\x11 \x01(\v2\x15.agent.v1.JobProgressH\x00R\vjobProgress\x12$\n" + - "\x04pong\x18\b \x01(\v2\x0e.agent.v1.PongH\x00R\x04pong\x129\n" + - "\tset_state\x18\t \x01(\v2\x1a.agent.v1.SetStateResponseH\x00R\bsetState\x12B\n" + - "\fstart_action\x18\n" + - " \x01(\v2\x1d.agent.v1.StartActionResponseH\x00R\vstartAction\x12?\n" + - "\vstop_action\x18\v \x01(\v2\x1c.agent.v1.StopActionResponseH\x00R\n" + - "stopAction\x12N\n" + - "\x10check_connection\x18\f \x01(\v2!.agent.v1.CheckConnectionResponseH\x00R\x0fcheckConnection\x129\n" + - "\tstart_job\x18\r \x01(\v2\x1a.agent.v1.StartJobResponseH\x00R\bstartJob\x126\n" + - "\bstop_job\x18\x0e \x01(\v2\x19.agent.v1.StopJobResponseH\x00R\astopJob\x12<\n" + - "\n" + - "job_status\x18\x0f \x01(\v2\x1b.agent.v1.JobStatusResponseH\x00R\tjobStatus\x12B\n" + - "\fget_versions\x18\x12 \x01(\v2\x1d.agent.v1.GetVersionsResponseH\x00R\vgetVersions\x12I\n" + - "\x0fpbm_switch_pitr\x18\x13 \x01(\v2\x1f.agent.v1.PBMSwitchPITRResponseH\x00R\rpbmSwitchPitr\x12<\n" + - "\n" + - "agent_logs\x18\x15 \x01(\v2\x1b.agent.v1.AgentLogsResponseH\x00R\tagentLogs\x12B\n" + - "\fservice_info\x18\x16 \x01(\v2\x1d.agent.v1.ServiceInfoResponseH\x00R\vserviceInfoB\t\n" + - "\apayload\"\xb9\b\n" + - "\rServerMessage\x12\x0e\n" + - "\x02id\x18\x01 \x01(\rR\x02id\x12+\n" + - "\x06status\x18\xff\x0f \x01(\v2\x12.google.rpc.StatusR\x06status\x12$\n" + - "\x04pong\x18\x02 \x01(\v2\x0e.agent.v1.PongH\x00R\x04pong\x12E\n" + - "\rstate_changed\x18\x03 \x01(\v2\x1e.agent.v1.StateChangedResponseH\x00R\fstateChanged\x12?\n" + - "\vqan_collect\x18\x04 \x01(\v2\x1c.agent.v1.QANCollectResponseH\x00R\n" + - "qanCollect\x12E\n" + - "\raction_result\x18\x05 \x01(\v2\x1e.agent.v1.ActionResultResponseH\x00R\factionResult\x12$\n" + - "\x04ping\x18\b \x01(\v2\x0e.agent.v1.PingH\x00R\x04ping\x128\n" + - "\tset_state\x18\t \x01(\v2\x19.agent.v1.SetStateRequestH\x00R\bsetState\x12A\n" + - "\fstart_action\x18\n" + - " \x01(\v2\x1c.agent.v1.StartActionRequestH\x00R\vstartAction\x12>\n" + - "\vstop_action\x18\v \x01(\v2\x1b.agent.v1.StopActionRequestH\x00R\n" + - "stopAction\x12M\n" + - "\x10check_connection\x18\f \x01(\v2 .agent.v1.CheckConnectionRequestH\x00R\x0fcheckConnection\x128\n" + - "\tstart_job\x18\r \x01(\v2\x19.agent.v1.StartJobRequestH\x00R\bstartJob\x125\n" + - "\bstop_job\x18\x0e \x01(\v2\x18.agent.v1.StopJobRequestH\x00R\astopJob\x12;\n" + - "\n" + - "job_status\x18\x0f \x01(\v2\x1a.agent.v1.JobStatusRequestH\x00R\tjobStatus\x12A\n" + - "\fget_versions\x18\x10 \x01(\v2\x1c.agent.v1.GetVersionsRequestH\x00R\vgetVersions\x12H\n" + - "\x0fpbm_switch_pitr\x18\x11 \x01(\v2\x1e.agent.v1.PBMSwitchPITRRequestH\x00R\rpbmSwitchPitr\x12;\n" + - "\n" + - "agent_logs\x18\x13 \x01(\v2\x1a.agent.v1.AgentLogsRequestH\x00R\tagentLogs\x12A\n" + - "\fservice_info\x18\x14 \x01(\v2\x1c.agent.v1.ServiceInfoRequestH\x00R\vserviceInfoB\t\n" + - "\apayload*\xc8\x01\n" + - "\x18MysqlExplainOutputFormat\x12+\n" + - "'MYSQL_EXPLAIN_OUTPUT_FORMAT_UNSPECIFIED\x10\x00\x12'\n" + - "#MYSQL_EXPLAIN_OUTPUT_FORMAT_DEFAULT\x10\x01\x12$\n" + - " MYSQL_EXPLAIN_OUTPUT_FORMAT_JSON\x10\x02\x120\n" + - ",MYSQL_EXPLAIN_OUTPUT_FORMAT_TRADITIONAL_JSON\x10\x032N\n" + - "\fAgentService\x12>\n" + - "\aConnect\x12\x16.agent.v1.AgentMessage\x1a\x17.agent.v1.ServerMessage(\x010\x01B\x88\x01\n" + - "\fcom.agent.v1B\n" + - "AgentProtoP\x01Z+github.com/percona/pmm/api/agent/v1;agentv1\xa2\x02\x03AXX\xaa\x02\bAgent.V1\xca\x02\bAgent\\V1\xe2\x02\x14Agent\\V1\\GPBMetadata\xea\x02\tAgent::V1b\x06proto3" - -var ( - file_agent_v1_agent_proto_rawDescOnce sync.Once - file_agent_v1_agent_proto_rawDescData []byte -) - -func file_agent_v1_agent_proto_rawDescGZIP() []byte { - file_agent_v1_agent_proto_rawDescOnce.Do(func() { - file_agent_v1_agent_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_agent_v1_agent_proto_rawDesc), len(file_agent_v1_agent_proto_rawDesc))) - }) - 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, 91) - 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.QueryActionMap.MapEntry - (*StartActionRequest_MySQLExplainParams)(nil), // 51: agent.v1.StartActionRequest.MySQLExplainParams - (*StartActionRequest_MySQLShowCreateTableParams)(nil), // 52: agent.v1.StartActionRequest.MySQLShowCreateTableParams - (*StartActionRequest_MySQLShowTableStatusParams)(nil), // 53: agent.v1.StartActionRequest.MySQLShowTableStatusParams - (*StartActionRequest_MySQLShowIndexParams)(nil), // 54: agent.v1.StartActionRequest.MySQLShowIndexParams - (*StartActionRequest_PostgreSQLShowCreateTableParams)(nil), // 55: agent.v1.StartActionRequest.PostgreSQLShowCreateTableParams - (*StartActionRequest_PostgreSQLShowIndexParams)(nil), // 56: agent.v1.StartActionRequest.PostgreSQLShowIndexParams - (*StartActionRequest_MongoDBExplainParams)(nil), // 57: agent.v1.StartActionRequest.MongoDBExplainParams - (*StartActionRequest_PTSummaryParams)(nil), // 58: agent.v1.StartActionRequest.PTSummaryParams - (*StartActionRequest_PTPgSummaryParams)(nil), // 59: agent.v1.StartActionRequest.PTPgSummaryParams - (*StartActionRequest_PTMongoDBSummaryParams)(nil), // 60: agent.v1.StartActionRequest.PTMongoDBSummaryParams - (*StartActionRequest_PTMySQLSummaryParams)(nil), // 61: agent.v1.StartActionRequest.PTMySQLSummaryParams - (*StartActionRequest_MySQLQueryShowParams)(nil), // 62: agent.v1.StartActionRequest.MySQLQueryShowParams - (*StartActionRequest_MySQLQuerySelectParams)(nil), // 63: agent.v1.StartActionRequest.MySQLQuerySelectParams - (*StartActionRequest_PostgreSQLQueryShowParams)(nil), // 64: agent.v1.StartActionRequest.PostgreSQLQueryShowParams - (*StartActionRequest_PostgreSQLQuerySelectParams)(nil), // 65: agent.v1.StartActionRequest.PostgreSQLQuerySelectParams - (*StartActionRequest_MongoDBQueryGetParameterParams)(nil), // 66: agent.v1.StartActionRequest.MongoDBQueryGetParameterParams - (*StartActionRequest_MongoDBQueryBuildInfoParams)(nil), // 67: agent.v1.StartActionRequest.MongoDBQueryBuildInfoParams - (*StartActionRequest_MongoDBQueryGetCmdLineOptsParams)(nil), // 68: agent.v1.StartActionRequest.MongoDBQueryGetCmdLineOptsParams - (*StartActionRequest_MongoDBQueryReplSetGetStatusParams)(nil), // 69: agent.v1.StartActionRequest.MongoDBQueryReplSetGetStatusParams - (*StartActionRequest_MongoDBQueryGetDiagnosticDataParams)(nil), // 70: agent.v1.StartActionRequest.MongoDBQueryGetDiagnosticDataParams - (*StartActionRequest_RestartSystemServiceParams)(nil), // 71: agent.v1.StartActionRequest.RestartSystemServiceParams - (*CheckConnectionResponse_Stats)(nil), // 72: agent.v1.CheckConnectionResponse.Stats - (*StartJobRequest_MySQLBackup)(nil), // 73: agent.v1.StartJobRequest.MySQLBackup - (*StartJobRequest_MySQLRestoreBackup)(nil), // 74: agent.v1.StartJobRequest.MySQLRestoreBackup - (*StartJobRequest_MongoDBBackup)(nil), // 75: agent.v1.StartJobRequest.MongoDBBackup - (*StartJobRequest_MongoDBRestoreBackup)(nil), // 76: agent.v1.StartJobRequest.MongoDBRestoreBackup - (*JobResult_Error)(nil), // 77: agent.v1.JobResult.Error - (*JobResult_MongoDBBackup)(nil), // 78: agent.v1.JobResult.MongoDBBackup - (*JobResult_MySQLBackup)(nil), // 79: agent.v1.JobResult.MySQLBackup - (*JobResult_MySQLRestoreBackup)(nil), // 80: agent.v1.JobResult.MySQLRestoreBackup - (*JobResult_MongoDBRestoreBackup)(nil), // 81: agent.v1.JobResult.MongoDBRestoreBackup - (*JobProgress_MySQLBackup)(nil), // 82: agent.v1.JobProgress.MySQLBackup - (*JobProgress_MySQLRestoreBackup)(nil), // 83: agent.v1.JobProgress.MySQLRestoreBackup - (*JobProgress_Logs)(nil), // 84: agent.v1.JobProgress.Logs - (*GetVersionsRequest_MySQLd)(nil), // 85: agent.v1.GetVersionsRequest.MySQLd - (*GetVersionsRequest_Xtrabackup)(nil), // 86: agent.v1.GetVersionsRequest.Xtrabackup - (*GetVersionsRequest_Xbcloud)(nil), // 87: agent.v1.GetVersionsRequest.Xbcloud - (*GetVersionsRequest_Qpress)(nil), // 88: agent.v1.GetVersionsRequest.Qpress - (*GetVersionsRequest_MongoDB)(nil), // 89: agent.v1.GetVersionsRequest.MongoDB - (*GetVersionsRequest_PBM)(nil), // 90: agent.v1.GetVersionsRequest.PBM - (*GetVersionsRequest_Software)(nil), // 91: agent.v1.GetVersionsRequest.Software - (*GetVersionsResponse_Version)(nil), // 92: agent.v1.GetVersionsResponse.Version - (*timestamppb.Timestamp)(nil), // 93: google.protobuf.Timestamp - (*MetricsBucket)(nil), // 94: agent.v1.MetricsBucket - (v1.AgentStatus)(0), // 95: inventory.v1.AgentStatus - (*durationpb.Duration)(nil), // 96: google.protobuf.Duration - (v1.ServiceType)(0), // 97: inventory.v1.ServiceType - (*status.Status)(nil), // 98: google.rpc.Status - (v1.AgentType)(0), // 99: inventory.v1.AgentType - (v11.DataModel)(0), // 100: backup.v1.DataModel - (*v11.PbmMetadata)(nil), // 101: backup.v1.PbmMetadata - (*v11.Metadata)(nil), // 102: backup.v1.Metadata - } -) - -var file_agent_v1_agent_proto_depIdxs = []int32{ - 44, // 0: agent.v1.TextFiles.files:type_name -> agent.v1.TextFiles.FilesEntry - 93, // 1: agent.v1.Pong.current_time:type_name -> google.protobuf.Timestamp - 94, // 2: agent.v1.QANCollectRequest.metrics_bucket:type_name -> agent.v1.MetricsBucket - 95, // 3: agent.v1.StateChangedRequest.status:type_name -> inventory.v1.AgentStatus - 46, // 4: agent.v1.SetStateRequest.agent_processes:type_name -> agent.v1.SetStateRequest.AgentProcessesEntry - 48, // 5: agent.v1.SetStateRequest.builtin_agents:type_name -> agent.v1.SetStateRequest.BuiltinAgentsEntry - 93, // 6: agent.v1.QueryActionValue.timestamp:type_name -> google.protobuf.Timestamp - 12, // 7: agent.v1.QueryActionValue.slice:type_name -> agent.v1.QueryActionSlice - 13, // 8: agent.v1.QueryActionValue.map:type_name -> agent.v1.QueryActionMap - 14, // 9: agent.v1.QueryActionValue.binary:type_name -> agent.v1.QueryActionBinary - 11, // 10: agent.v1.QueryActionSlice.slice:type_name -> agent.v1.QueryActionValue - 50, // 11: agent.v1.QueryActionMap.map:type_name -> agent.v1.QueryActionMap.MapEntry - 12, // 12: agent.v1.QueryActionResult.rows:type_name -> agent.v1.QueryActionSlice - 13, // 13: agent.v1.QueryActionResult.docs:type_name -> agent.v1.QueryActionMap - 96, // 14: agent.v1.StartActionRequest.timeout:type_name -> google.protobuf.Duration - 51, // 15: agent.v1.StartActionRequest.mysql_explain_params:type_name -> agent.v1.StartActionRequest.MySQLExplainParams - 52, // 16: agent.v1.StartActionRequest.mysql_show_create_table_params:type_name -> agent.v1.StartActionRequest.MySQLShowCreateTableParams - 53, // 17: agent.v1.StartActionRequest.mysql_show_table_status_params:type_name -> agent.v1.StartActionRequest.MySQLShowTableStatusParams - 54, // 18: agent.v1.StartActionRequest.mysql_show_index_params:type_name -> agent.v1.StartActionRequest.MySQLShowIndexParams - 55, // 19: agent.v1.StartActionRequest.postgresql_show_create_table_params:type_name -> agent.v1.StartActionRequest.PostgreSQLShowCreateTableParams - 56, // 20: agent.v1.StartActionRequest.postgresql_show_index_params:type_name -> agent.v1.StartActionRequest.PostgreSQLShowIndexParams - 57, // 21: agent.v1.StartActionRequest.mongodb_explain_params:type_name -> agent.v1.StartActionRequest.MongoDBExplainParams - 58, // 22: agent.v1.StartActionRequest.pt_summary_params:type_name -> agent.v1.StartActionRequest.PTSummaryParams - 59, // 23: agent.v1.StartActionRequest.pt_pg_summary_params:type_name -> agent.v1.StartActionRequest.PTPgSummaryParams - 60, // 24: agent.v1.StartActionRequest.pt_mongodb_summary_params:type_name -> agent.v1.StartActionRequest.PTMongoDBSummaryParams - 61, // 25: agent.v1.StartActionRequest.pt_mysql_summary_params:type_name -> agent.v1.StartActionRequest.PTMySQLSummaryParams - 62, // 26: agent.v1.StartActionRequest.mysql_query_show_params:type_name -> agent.v1.StartActionRequest.MySQLQueryShowParams - 63, // 27: agent.v1.StartActionRequest.mysql_query_select_params:type_name -> agent.v1.StartActionRequest.MySQLQuerySelectParams - 64, // 28: agent.v1.StartActionRequest.postgresql_query_show_params:type_name -> agent.v1.StartActionRequest.PostgreSQLQueryShowParams - 65, // 29: agent.v1.StartActionRequest.postgresql_query_select_params:type_name -> agent.v1.StartActionRequest.PostgreSQLQuerySelectParams - 66, // 30: agent.v1.StartActionRequest.mongodb_query_getparameter_params:type_name -> agent.v1.StartActionRequest.MongoDBQueryGetParameterParams - 67, // 31: agent.v1.StartActionRequest.mongodb_query_buildinfo_params:type_name -> agent.v1.StartActionRequest.MongoDBQueryBuildInfoParams - 68, // 32: agent.v1.StartActionRequest.mongodb_query_getcmdlineopts_params:type_name -> agent.v1.StartActionRequest.MongoDBQueryGetCmdLineOptsParams - 69, // 33: agent.v1.StartActionRequest.mongodb_query_replsetgetstatus_params:type_name -> agent.v1.StartActionRequest.MongoDBQueryReplSetGetStatusParams - 70, // 34: agent.v1.StartActionRequest.mongodb_query_getdiagnosticdata_params:type_name -> agent.v1.StartActionRequest.MongoDBQueryGetDiagnosticDataParams - 71, // 35: agent.v1.StartActionRequest.restart_sys_service_params:type_name -> agent.v1.StartActionRequest.RestartSystemServiceParams - 2, // 36: agent.v1.PBMSwitchPITRRequest.text_files:type_name -> agent.v1.TextFiles - 97, // 37: agent.v1.CheckConnectionRequest.type:type_name -> inventory.v1.ServiceType - 96, // 38: agent.v1.CheckConnectionRequest.timeout:type_name -> google.protobuf.Duration - 2, // 39: agent.v1.CheckConnectionRequest.text_files:type_name -> agent.v1.TextFiles - 97, // 40: agent.v1.ServiceInfoRequest.type:type_name -> inventory.v1.ServiceType - 96, // 41: agent.v1.ServiceInfoRequest.timeout:type_name -> google.protobuf.Duration - 2, // 42: agent.v1.ServiceInfoRequest.text_files:type_name -> agent.v1.TextFiles - 96, // 43: agent.v1.StartJobRequest.timeout:type_name -> google.protobuf.Duration - 73, // 44: agent.v1.StartJobRequest.mysql_backup:type_name -> agent.v1.StartJobRequest.MySQLBackup - 74, // 45: agent.v1.StartJobRequest.mysql_restore_backup:type_name -> agent.v1.StartJobRequest.MySQLRestoreBackup - 75, // 46: agent.v1.StartJobRequest.mongodb_backup:type_name -> agent.v1.StartJobRequest.MongoDBBackup - 76, // 47: agent.v1.StartJobRequest.mongodb_restore_backup:type_name -> agent.v1.StartJobRequest.MongoDBRestoreBackup - 93, // 48: agent.v1.JobResult.timestamp:type_name -> google.protobuf.Timestamp - 77, // 49: agent.v1.JobResult.error:type_name -> agent.v1.JobResult.Error - 79, // 50: agent.v1.JobResult.mysql_backup:type_name -> agent.v1.JobResult.MySQLBackup - 80, // 51: agent.v1.JobResult.mysql_restore_backup:type_name -> agent.v1.JobResult.MySQLRestoreBackup - 78, // 52: agent.v1.JobResult.mongodb_backup:type_name -> agent.v1.JobResult.MongoDBBackup - 81, // 53: agent.v1.JobResult.mongodb_restore_backup:type_name -> agent.v1.JobResult.MongoDBRestoreBackup - 93, // 54: agent.v1.JobProgress.timestamp:type_name -> google.protobuf.Timestamp - 82, // 55: agent.v1.JobProgress.mysql_backup:type_name -> agent.v1.JobProgress.MySQLBackup - 83, // 56: agent.v1.JobProgress.mysql_restore_backup:type_name -> agent.v1.JobProgress.MySQLRestoreBackup - 84, // 57: agent.v1.JobProgress.logs:type_name -> agent.v1.JobProgress.Logs - 91, // 58: agent.v1.GetVersionsRequest.softwares:type_name -> agent.v1.GetVersionsRequest.Software - 92, // 59: agent.v1.GetVersionsResponse.versions:type_name -> agent.v1.GetVersionsResponse.Version - 98, // 60: agent.v1.AgentMessage.status:type_name -> google.rpc.Status - 3, // 61: agent.v1.AgentMessage.ping:type_name -> agent.v1.Ping - 7, // 62: agent.v1.AgentMessage.state_changed:type_name -> agent.v1.StateChangedRequest - 5, // 63: agent.v1.AgentMessage.qan_collect:type_name -> agent.v1.QANCollectRequest - 20, // 64: agent.v1.AgentMessage.action_result:type_name -> agent.v1.ActionResultRequest - 38, // 65: agent.v1.AgentMessage.job_result:type_name -> agent.v1.JobResult - 39, // 66: agent.v1.AgentMessage.job_progress:type_name -> agent.v1.JobProgress - 4, // 67: agent.v1.AgentMessage.pong:type_name -> agent.v1.Pong - 10, // 68: agent.v1.AgentMessage.set_state:type_name -> agent.v1.SetStateResponse - 17, // 69: agent.v1.AgentMessage.start_action:type_name -> agent.v1.StartActionResponse - 19, // 70: agent.v1.AgentMessage.stop_action:type_name -> agent.v1.StopActionResponse - 27, // 71: agent.v1.AgentMessage.check_connection:type_name -> agent.v1.CheckConnectionResponse - 35, // 72: agent.v1.AgentMessage.start_job:type_name -> agent.v1.StartJobResponse - 37, // 73: agent.v1.AgentMessage.stop_job:type_name -> agent.v1.StopJobResponse - 31, // 74: agent.v1.AgentMessage.job_status:type_name -> agent.v1.JobStatusResponse - 41, // 75: agent.v1.AgentMessage.get_versions:type_name -> agent.v1.GetVersionsResponse - 23, // 76: agent.v1.AgentMessage.pbm_switch_pitr:type_name -> agent.v1.PBMSwitchPITRResponse - 25, // 77: agent.v1.AgentMessage.agent_logs:type_name -> agent.v1.AgentLogsResponse - 29, // 78: agent.v1.AgentMessage.service_info:type_name -> agent.v1.ServiceInfoResponse - 98, // 79: agent.v1.ServerMessage.status:type_name -> google.rpc.Status - 4, // 80: agent.v1.ServerMessage.pong:type_name -> agent.v1.Pong - 8, // 81: agent.v1.ServerMessage.state_changed:type_name -> agent.v1.StateChangedResponse - 6, // 82: agent.v1.ServerMessage.qan_collect:type_name -> agent.v1.QANCollectResponse - 21, // 83: agent.v1.ServerMessage.action_result:type_name -> agent.v1.ActionResultResponse - 3, // 84: agent.v1.ServerMessage.ping:type_name -> agent.v1.Ping - 9, // 85: agent.v1.ServerMessage.set_state:type_name -> agent.v1.SetStateRequest - 16, // 86: agent.v1.ServerMessage.start_action:type_name -> agent.v1.StartActionRequest - 18, // 87: agent.v1.ServerMessage.stop_action:type_name -> agent.v1.StopActionRequest - 26, // 88: agent.v1.ServerMessage.check_connection:type_name -> agent.v1.CheckConnectionRequest - 34, // 89: agent.v1.ServerMessage.start_job:type_name -> agent.v1.StartJobRequest - 36, // 90: agent.v1.ServerMessage.stop_job:type_name -> agent.v1.StopJobRequest - 30, // 91: agent.v1.ServerMessage.job_status:type_name -> agent.v1.JobStatusRequest - 40, // 92: agent.v1.ServerMessage.get_versions:type_name -> agent.v1.GetVersionsRequest - 22, // 93: agent.v1.ServerMessage.pbm_switch_pitr:type_name -> agent.v1.PBMSwitchPITRRequest - 24, // 94: agent.v1.ServerMessage.agent_logs:type_name -> agent.v1.AgentLogsRequest - 28, // 95: agent.v1.ServerMessage.service_info:type_name -> agent.v1.ServiceInfoRequest - 99, // 96: agent.v1.SetStateRequest.AgentProcess.type:type_name -> inventory.v1.AgentType - 49, // 97: agent.v1.SetStateRequest.AgentProcess.text_files:type_name -> agent.v1.SetStateRequest.AgentProcess.TextFilesEntry - 45, // 98: agent.v1.SetStateRequest.AgentProcessesEntry.value:type_name -> agent.v1.SetStateRequest.AgentProcess - 99, // 99: agent.v1.SetStateRequest.BuiltinAgent.type:type_name -> inventory.v1.AgentType - 2, // 100: agent.v1.SetStateRequest.BuiltinAgent.text_files:type_name -> agent.v1.TextFiles - 47, // 101: agent.v1.SetStateRequest.BuiltinAgentsEntry.value:type_name -> agent.v1.SetStateRequest.BuiltinAgent - 11, // 102: agent.v1.QueryActionMap.MapEntry.value:type_name -> agent.v1.QueryActionValue - 0, // 103: agent.v1.StartActionRequest.MySQLExplainParams.output_format:type_name -> agent.v1.MysqlExplainOutputFormat - 2, // 104: agent.v1.StartActionRequest.MySQLExplainParams.tls_files:type_name -> agent.v1.TextFiles - 2, // 105: agent.v1.StartActionRequest.MySQLShowCreateTableParams.tls_files:type_name -> agent.v1.TextFiles - 2, // 106: agent.v1.StartActionRequest.MySQLShowTableStatusParams.tls_files:type_name -> agent.v1.TextFiles - 2, // 107: agent.v1.StartActionRequest.MySQLShowIndexParams.tls_files:type_name -> agent.v1.TextFiles - 2, // 108: agent.v1.StartActionRequest.PostgreSQLShowCreateTableParams.tls_files:type_name -> agent.v1.TextFiles - 2, // 109: agent.v1.StartActionRequest.PostgreSQLShowIndexParams.tls_files:type_name -> agent.v1.TextFiles - 2, // 110: agent.v1.StartActionRequest.MongoDBExplainParams.text_files:type_name -> agent.v1.TextFiles - 2, // 111: agent.v1.StartActionRequest.MySQLQueryShowParams.tls_files:type_name -> agent.v1.TextFiles - 2, // 112: agent.v1.StartActionRequest.MySQLQuerySelectParams.tls_files:type_name -> agent.v1.TextFiles - 2, // 113: agent.v1.StartActionRequest.PostgreSQLQueryShowParams.tls_files:type_name -> agent.v1.TextFiles - 2, // 114: agent.v1.StartActionRequest.PostgreSQLQuerySelectParams.tls_files:type_name -> agent.v1.TextFiles - 2, // 115: agent.v1.StartActionRequest.MongoDBQueryGetParameterParams.text_files:type_name -> agent.v1.TextFiles - 2, // 116: agent.v1.StartActionRequest.MongoDBQueryBuildInfoParams.text_files:type_name -> agent.v1.TextFiles - 2, // 117: agent.v1.StartActionRequest.MongoDBQueryGetCmdLineOptsParams.text_files:type_name -> agent.v1.TextFiles - 2, // 118: agent.v1.StartActionRequest.MongoDBQueryReplSetGetStatusParams.text_files:type_name -> agent.v1.TextFiles - 2, // 119: agent.v1.StartActionRequest.MongoDBQueryGetDiagnosticDataParams.text_files:type_name -> agent.v1.TextFiles - 1, // 120: agent.v1.StartActionRequest.RestartSystemServiceParams.system_service:type_name -> agent.v1.StartActionRequest.RestartSystemServiceParams.SystemService - 32, // 121: agent.v1.StartJobRequest.MySQLBackup.s3_config:type_name -> agent.v1.S3LocationConfig - 32, // 122: agent.v1.StartJobRequest.MySQLRestoreBackup.s3_config:type_name -> agent.v1.S3LocationConfig - 2, // 123: agent.v1.StartJobRequest.MongoDBBackup.text_files:type_name -> agent.v1.TextFiles - 100, // 124: agent.v1.StartJobRequest.MongoDBBackup.data_model:type_name -> backup.v1.DataModel - 32, // 125: agent.v1.StartJobRequest.MongoDBBackup.s3_config:type_name -> agent.v1.S3LocationConfig - 33, // 126: agent.v1.StartJobRequest.MongoDBBackup.filesystem_config:type_name -> agent.v1.FilesystemLocationConfig - 2, // 127: agent.v1.StartJobRequest.MongoDBRestoreBackup.text_files:type_name -> agent.v1.TextFiles - 101, // 128: agent.v1.StartJobRequest.MongoDBRestoreBackup.pbm_metadata:type_name -> backup.v1.PbmMetadata - 93, // 129: agent.v1.StartJobRequest.MongoDBRestoreBackup.pitr_timestamp:type_name -> google.protobuf.Timestamp - 32, // 130: agent.v1.StartJobRequest.MongoDBRestoreBackup.s3_config:type_name -> agent.v1.S3LocationConfig - 33, // 131: agent.v1.StartJobRequest.MongoDBRestoreBackup.filesystem_config:type_name -> agent.v1.FilesystemLocationConfig - 102, // 132: agent.v1.JobResult.MongoDBBackup.metadata:type_name -> backup.v1.Metadata - 102, // 133: agent.v1.JobResult.MySQLBackup.metadata:type_name -> backup.v1.Metadata - 85, // 134: agent.v1.GetVersionsRequest.Software.mysqld:type_name -> agent.v1.GetVersionsRequest.MySQLd - 86, // 135: agent.v1.GetVersionsRequest.Software.xtrabackup:type_name -> agent.v1.GetVersionsRequest.Xtrabackup - 87, // 136: agent.v1.GetVersionsRequest.Software.xbcloud:type_name -> agent.v1.GetVersionsRequest.Xbcloud - 88, // 137: agent.v1.GetVersionsRequest.Software.qpress:type_name -> agent.v1.GetVersionsRequest.Qpress - 89, // 138: agent.v1.GetVersionsRequest.Software.mongod:type_name -> agent.v1.GetVersionsRequest.MongoDB - 90, // 139: agent.v1.GetVersionsRequest.Software.pbm:type_name -> agent.v1.GetVersionsRequest.PBM - 42, // 140: agent.v1.AgentService.Connect:input_type -> agent.v1.AgentMessage - 43, // 141: agent.v1.AgentService.Connect:output_type -> agent.v1.ServerMessage - 141, // [141:142] is the sub-list for method output_type - 140, // [140:141] is the sub-list for method input_type - 140, // [140:140] is the sub-list for extension type_name - 140, // [140:140] is the sub-list for extension extendee - 0, // [0:140] is the sub-list for field type_name -} - -func init() { file_agent_v1_agent_proto_init() } -func file_agent_v1_agent_proto_init() { - if File_agent_v1_agent_proto != nil { - return - } - file_agent_v1_collector_proto_init() - file_agent_v1_agent_proto_msgTypes[9].OneofWrappers = []any{ - (*QueryActionValue_Nil)(nil), - (*QueryActionValue_Bool)(nil), - (*QueryActionValue_Int64)(nil), - (*QueryActionValue_Uint64)(nil), - (*QueryActionValue_Double)(nil), - (*QueryActionValue_Bytes)(nil), - (*QueryActionValue_Timestamp)(nil), - (*QueryActionValue_Slice)(nil), - (*QueryActionValue_Map)(nil), - (*QueryActionValue_Binary)(nil), - } - file_agent_v1_agent_proto_msgTypes[14].OneofWrappers = []any{ - (*StartActionRequest_MysqlExplainParams)(nil), - (*StartActionRequest_MysqlShowCreateTableParams)(nil), - (*StartActionRequest_MysqlShowTableStatusParams)(nil), - (*StartActionRequest_MysqlShowIndexParams)(nil), - (*StartActionRequest_PostgresqlShowCreateTableParams)(nil), - (*StartActionRequest_PostgresqlShowIndexParams)(nil), - (*StartActionRequest_MongodbExplainParams)(nil), - (*StartActionRequest_PtSummaryParams)(nil), - (*StartActionRequest_PtPgSummaryParams)(nil), - (*StartActionRequest_PtMongodbSummaryParams)(nil), - (*StartActionRequest_PtMysqlSummaryParams)(nil), - (*StartActionRequest_MysqlQueryShowParams)(nil), - (*StartActionRequest_MysqlQuerySelectParams)(nil), - (*StartActionRequest_PostgresqlQueryShowParams)(nil), - (*StartActionRequest_PostgresqlQuerySelectParams)(nil), - (*StartActionRequest_MongodbQueryGetparameterParams)(nil), - (*StartActionRequest_MongodbQueryBuildinfoParams)(nil), - (*StartActionRequest_MongodbQueryGetcmdlineoptsParams)(nil), - (*StartActionRequest_MongodbQueryReplsetgetstatusParams)(nil), - (*StartActionRequest_MongodbQueryGetdiagnosticdataParams)(nil), - (*StartActionRequest_RestartSysServiceParams)(nil), - } - file_agent_v1_agent_proto_msgTypes[27].OneofWrappers = []any{} - file_agent_v1_agent_proto_msgTypes[32].OneofWrappers = []any{ - (*StartJobRequest_MysqlBackup)(nil), - (*StartJobRequest_MysqlRestoreBackup)(nil), - (*StartJobRequest_MongodbBackup)(nil), - (*StartJobRequest_MongodbRestoreBackup)(nil), - } - file_agent_v1_agent_proto_msgTypes[36].OneofWrappers = []any{ - (*JobResult_Error_)(nil), - (*JobResult_MysqlBackup)(nil), - (*JobResult_MysqlRestoreBackup)(nil), - (*JobResult_MongodbBackup)(nil), - (*JobResult_MongodbRestoreBackup)(nil), - } - file_agent_v1_agent_proto_msgTypes[37].OneofWrappers = []any{ - (*JobProgress_MysqlBackup)(nil), - (*JobProgress_MysqlRestoreBackup)(nil), - (*JobProgress_Logs_)(nil), - } - file_agent_v1_agent_proto_msgTypes[40].OneofWrappers = []any{ - (*AgentMessage_Ping)(nil), - (*AgentMessage_StateChanged)(nil), - (*AgentMessage_QanCollect)(nil), - (*AgentMessage_ActionResult)(nil), - (*AgentMessage_JobResult)(nil), - (*AgentMessage_JobProgress)(nil), - (*AgentMessage_Pong)(nil), - (*AgentMessage_SetState)(nil), - (*AgentMessage_StartAction)(nil), - (*AgentMessage_StopAction)(nil), - (*AgentMessage_CheckConnection)(nil), - (*AgentMessage_StartJob)(nil), - (*AgentMessage_StopJob)(nil), - (*AgentMessage_JobStatus)(nil), - (*AgentMessage_GetVersions)(nil), - (*AgentMessage_PbmSwitchPitr)(nil), - (*AgentMessage_AgentLogs)(nil), - (*AgentMessage_ServiceInfo)(nil), - } - file_agent_v1_agent_proto_msgTypes[41].OneofWrappers = []any{ - (*ServerMessage_Pong)(nil), - (*ServerMessage_StateChanged)(nil), - (*ServerMessage_QanCollect)(nil), - (*ServerMessage_ActionResult)(nil), - (*ServerMessage_Ping)(nil), - (*ServerMessage_SetState)(nil), - (*ServerMessage_StartAction)(nil), - (*ServerMessage_StopAction)(nil), - (*ServerMessage_CheckConnection)(nil), - (*ServerMessage_StartJob)(nil), - (*ServerMessage_StopJob)(nil), - (*ServerMessage_JobStatus)(nil), - (*ServerMessage_GetVersions)(nil), - (*ServerMessage_PbmSwitchPitr)(nil), - (*ServerMessage_AgentLogs)(nil), - (*ServerMessage_ServiceInfo)(nil), - } - file_agent_v1_agent_proto_msgTypes[71].OneofWrappers = []any{ - (*StartJobRequest_MySQLBackup_S3Config)(nil), - } - file_agent_v1_agent_proto_msgTypes[72].OneofWrappers = []any{ - (*StartJobRequest_MySQLRestoreBackup_S3Config)(nil), - } - file_agent_v1_agent_proto_msgTypes[73].OneofWrappers = []any{ - (*StartJobRequest_MongoDBBackup_S3Config)(nil), - (*StartJobRequest_MongoDBBackup_FilesystemConfig)(nil), - } - file_agent_v1_agent_proto_msgTypes[74].OneofWrappers = []any{ - (*StartJobRequest_MongoDBRestoreBackup_S3Config)(nil), - (*StartJobRequest_MongoDBRestoreBackup_FilesystemConfig)(nil), - } - file_agent_v1_agent_proto_msgTypes[89].OneofWrappers = []any{ - (*GetVersionsRequest_Software_Mysqld)(nil), - (*GetVersionsRequest_Software_Xtrabackup)(nil), - (*GetVersionsRequest_Software_Xbcloud)(nil), - (*GetVersionsRequest_Software_Qpress)(nil), - (*GetVersionsRequest_Software_Mongod)(nil), - (*GetVersionsRequest_Software_Pbm)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_agent_v1_agent_proto_rawDesc), len(file_agent_v1_agent_proto_rawDesc)), - NumEnums: 2, - NumMessages: 91, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_agent_v1_agent_proto_goTypes, - DependencyIndexes: file_agent_v1_agent_proto_depIdxs, - EnumInfos: file_agent_v1_agent_proto_enumTypes, - MessageInfos: file_agent_v1_agent_proto_msgTypes, - }.Build() - File_agent_v1_agent_proto = out.File - file_agent_v1_agent_proto_goTypes = nil - file_agent_v1_agent_proto_depIdxs = nil -} diff --git a/api/agent/v1/agent.pb.validate.go b/api/agent/v1/agent.pb.validate.go deleted file mode 100644 index ed9da319c44..00000000000 --- a/api/agent/v1/agent.pb.validate.go +++ /dev/null @@ -1,14101 +0,0 @@ -// Code generated by protoc-gen-validate. DO NOT EDIT. -// source: agent/v1/agent.proto - -package agentv1 - -import ( - "bytes" - "errors" - "fmt" - "net" - "net/mail" - "net/url" - "regexp" - "sort" - "strings" - "time" - "unicode/utf8" - - "google.golang.org/protobuf/types/known/anypb" - - backupv1 "github.com/percona/pmm/api/backup/v1" - inventoryv1 "github.com/percona/pmm/api/inventory/v1" -) - -// ensure the imports are used -var ( - _ = bytes.MinRead - _ = errors.New("") - _ = fmt.Print - _ = utf8.UTFMax - _ = (*regexp.Regexp)(nil) - _ = (*strings.Reader)(nil) - _ = net.IPv4len - _ = time.Duration(0) - _ = (*url.URL)(nil) - _ = (*mail.Address)(nil) - _ = anypb.Any{} - _ = sort.Sort - - _ = backupv1.DataModel(0) - - _ = inventoryv1.AgentStatus(0) -) - -// Validate checks the field values on TextFiles 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 *TextFiles) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on TextFiles 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 TextFilesMultiError, or nil -// if none found. -func (m *TextFiles) ValidateAll() error { - return m.validate(true) -} - -func (m *TextFiles) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Files - - // no validation rules for TemplateLeftDelim - - // no validation rules for TemplateRightDelim - - if len(errors) > 0 { - return TextFilesMultiError(errors) - } - - return nil -} - -// TextFilesMultiError is an error wrapping multiple validation errors returned -// by TextFiles.ValidateAll() if the designated constraints aren't met. -type TextFilesMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m TextFilesMultiError) 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 TextFilesMultiError) AllErrors() []error { return m } - -// TextFilesValidationError is the validation error returned by -// TextFiles.Validate if the designated constraints aren't met. -type TextFilesValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e TextFilesValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e TextFilesValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e TextFilesValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e TextFilesValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e TextFilesValidationError) ErrorName() string { return "TextFilesValidationError" } - -// Error satisfies the builtin error interface -func (e TextFilesValidationError) 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 %sTextFiles.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = TextFilesValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = TextFilesValidationError{} - -// Validate checks the field values on Ping 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 *Ping) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on Ping 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 PingMultiError, or nil if none found. -func (m *Ping) ValidateAll() error { - return m.validate(true) -} - -func (m *Ping) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return PingMultiError(errors) - } - - return nil -} - -// PingMultiError is an error wrapping multiple validation errors returned by -// Ping.ValidateAll() if the designated constraints aren't met. -type PingMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m PingMultiError) 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 PingMultiError) AllErrors() []error { return m } - -// PingValidationError is the validation error returned by Ping.Validate if the -// designated constraints aren't met. -type PingValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e PingValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e PingValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e PingValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e PingValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e PingValidationError) ErrorName() string { return "PingValidationError" } - -// Error satisfies the builtin error interface -func (e PingValidationError) 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 %sPing.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = PingValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = PingValidationError{} - -// Validate checks the field values on Pong 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 *Pong) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on Pong 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 PongMultiError, or nil if none found. -func (m *Pong) ValidateAll() error { - return m.validate(true) -} - -func (m *Pong) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if all { - switch v := interface{}(m.GetCurrentTime()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, PongValidationError{ - field: "CurrentTime", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, PongValidationError{ - field: "CurrentTime", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetCurrentTime()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return PongValidationError{ - field: "CurrentTime", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if len(errors) > 0 { - return PongMultiError(errors) - } - - return nil -} - -// PongMultiError is an error wrapping multiple validation errors returned by -// Pong.ValidateAll() if the designated constraints aren't met. -type PongMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m PongMultiError) 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 PongMultiError) AllErrors() []error { return m } - -// PongValidationError is the validation error returned by Pong.Validate if the -// designated constraints aren't met. -type PongValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e PongValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e PongValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e PongValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e PongValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e PongValidationError) ErrorName() string { return "PongValidationError" } - -// Error satisfies the builtin error interface -func (e PongValidationError) 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 %sPong.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = PongValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = PongValidationError{} - -// Validate checks the field values on QANCollectRequest 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 *QANCollectRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on QANCollectRequest 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 -// QANCollectRequestMultiError, or nil if none found. -func (m *QANCollectRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *QANCollectRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - for idx, item := range m.GetMetricsBucket() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, QANCollectRequestValidationError{ - field: fmt.Sprintf("MetricsBucket[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, QANCollectRequestValidationError{ - field: fmt.Sprintf("MetricsBucket[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return QANCollectRequestValidationError{ - field: fmt.Sprintf("MetricsBucket[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - if len(errors) > 0 { - return QANCollectRequestMultiError(errors) - } - - return nil -} - -// QANCollectRequestMultiError is an error wrapping multiple validation errors -// returned by QANCollectRequest.ValidateAll() if the designated constraints -// aren't met. -type QANCollectRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m QANCollectRequestMultiError) 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 QANCollectRequestMultiError) AllErrors() []error { return m } - -// QANCollectRequestValidationError is the validation error returned by -// QANCollectRequest.Validate if the designated constraints aren't met. -type QANCollectRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e QANCollectRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e QANCollectRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e QANCollectRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e QANCollectRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e QANCollectRequestValidationError) ErrorName() string { - return "QANCollectRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e QANCollectRequestValidationError) 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 %sQANCollectRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = QANCollectRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = QANCollectRequestValidationError{} - -// Validate checks the field values on QANCollectResponse 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 *QANCollectResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on QANCollectResponse 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 -// QANCollectResponseMultiError, or nil if none found. -func (m *QANCollectResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *QANCollectResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return QANCollectResponseMultiError(errors) - } - - return nil -} - -// QANCollectResponseMultiError is an error wrapping multiple validation errors -// returned by QANCollectResponse.ValidateAll() if the designated constraints -// aren't met. -type QANCollectResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m QANCollectResponseMultiError) 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 QANCollectResponseMultiError) AllErrors() []error { return m } - -// QANCollectResponseValidationError is the validation error returned by -// QANCollectResponse.Validate if the designated constraints aren't met. -type QANCollectResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e QANCollectResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e QANCollectResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e QANCollectResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e QANCollectResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e QANCollectResponseValidationError) ErrorName() string { - return "QANCollectResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e QANCollectResponseValidationError) 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 %sQANCollectResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = QANCollectResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = QANCollectResponseValidationError{} - -// Validate checks the field values on StateChangedRequest 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 *StateChangedRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on StateChangedRequest 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 -// StateChangedRequestMultiError, or nil if none found. -func (m *StateChangedRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *StateChangedRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for AgentId - - // no validation rules for Status - - // no validation rules for ListenPort - - // no validation rules for ProcessExecPath - - // no validation rules for Version - - if len(errors) > 0 { - return StateChangedRequestMultiError(errors) - } - - return nil -} - -// StateChangedRequestMultiError is an error wrapping multiple validation -// errors returned by StateChangedRequest.ValidateAll() if the designated -// constraints aren't met. -type StateChangedRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m StateChangedRequestMultiError) 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 StateChangedRequestMultiError) AllErrors() []error { return m } - -// StateChangedRequestValidationError is the validation error returned by -// StateChangedRequest.Validate if the designated constraints aren't met. -type StateChangedRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e StateChangedRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e StateChangedRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e StateChangedRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e StateChangedRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e StateChangedRequestValidationError) ErrorName() string { - return "StateChangedRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e StateChangedRequestValidationError) 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 %sStateChangedRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = StateChangedRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = StateChangedRequestValidationError{} - -// Validate checks the field values on StateChangedResponse 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 *StateChangedResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on StateChangedResponse 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 -// StateChangedResponseMultiError, or nil if none found. -func (m *StateChangedResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *StateChangedResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return StateChangedResponseMultiError(errors) - } - - return nil -} - -// StateChangedResponseMultiError is an error wrapping multiple validation -// errors returned by StateChangedResponse.ValidateAll() if the designated -// constraints aren't met. -type StateChangedResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m StateChangedResponseMultiError) 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 StateChangedResponseMultiError) AllErrors() []error { return m } - -// StateChangedResponseValidationError is the validation error returned by -// StateChangedResponse.Validate if the designated constraints aren't met. -type StateChangedResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e StateChangedResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e StateChangedResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e StateChangedResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e StateChangedResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e StateChangedResponseValidationError) ErrorName() string { - return "StateChangedResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e StateChangedResponseValidationError) 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 %sStateChangedResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = StateChangedResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = StateChangedResponseValidationError{} - -// Validate checks the field values on SetStateRequest 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 *SetStateRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on SetStateRequest 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 -// SetStateRequestMultiError, or nil if none found. -func (m *SetStateRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *SetStateRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - { - sorted_keys := make([]string, len(m.GetAgentProcesses())) - i := 0 - for key := range m.GetAgentProcesses() { - sorted_keys[i] = key - i++ - } - sort.Slice(sorted_keys, func(i, j int) bool { return sorted_keys[i] < sorted_keys[j] }) - for _, key := range sorted_keys { - val := m.GetAgentProcesses()[key] - _ = val - - // no validation rules for AgentProcesses[key] - - if all { - switch v := interface{}(val).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, SetStateRequestValidationError{ - field: fmt.Sprintf("AgentProcesses[%v]", key), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, SetStateRequestValidationError{ - field: fmt.Sprintf("AgentProcesses[%v]", key), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(val).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return SetStateRequestValidationError{ - field: fmt.Sprintf("AgentProcesses[%v]", key), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - } - - { - sorted_keys := make([]string, len(m.GetBuiltinAgents())) - i := 0 - for key := range m.GetBuiltinAgents() { - sorted_keys[i] = key - i++ - } - sort.Slice(sorted_keys, func(i, j int) bool { return sorted_keys[i] < sorted_keys[j] }) - for _, key := range sorted_keys { - val := m.GetBuiltinAgents()[key] - _ = val - - // no validation rules for BuiltinAgents[key] - - if all { - switch v := interface{}(val).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, SetStateRequestValidationError{ - field: fmt.Sprintf("BuiltinAgents[%v]", key), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, SetStateRequestValidationError{ - field: fmt.Sprintf("BuiltinAgents[%v]", key), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(val).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return SetStateRequestValidationError{ - field: fmt.Sprintf("BuiltinAgents[%v]", key), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - } - - if len(errors) > 0 { - return SetStateRequestMultiError(errors) - } - - return nil -} - -// SetStateRequestMultiError is an error wrapping multiple validation errors -// returned by SetStateRequest.ValidateAll() if the designated constraints -// aren't met. -type SetStateRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m SetStateRequestMultiError) 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 SetStateRequestMultiError) AllErrors() []error { return m } - -// SetStateRequestValidationError is the validation error returned by -// SetStateRequest.Validate if the designated constraints aren't met. -type SetStateRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e SetStateRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e SetStateRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e SetStateRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e SetStateRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e SetStateRequestValidationError) ErrorName() string { return "SetStateRequestValidationError" } - -// Error satisfies the builtin error interface -func (e SetStateRequestValidationError) 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 %sSetStateRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = SetStateRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = SetStateRequestValidationError{} - -// Validate checks the field values on SetStateResponse 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 *SetStateResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on SetStateResponse 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 -// SetStateResponseMultiError, or nil if none found. -func (m *SetStateResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *SetStateResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return SetStateResponseMultiError(errors) - } - - return nil -} - -// SetStateResponseMultiError is an error wrapping multiple validation errors -// returned by SetStateResponse.ValidateAll() if the designated constraints -// aren't met. -type SetStateResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m SetStateResponseMultiError) 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 SetStateResponseMultiError) AllErrors() []error { return m } - -// SetStateResponseValidationError is the validation error returned by -// SetStateResponse.Validate if the designated constraints aren't met. -type SetStateResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e SetStateResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e SetStateResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e SetStateResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e SetStateResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e SetStateResponseValidationError) ErrorName() string { return "SetStateResponseValidationError" } - -// Error satisfies the builtin error interface -func (e SetStateResponseValidationError) 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 %sSetStateResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = SetStateResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = SetStateResponseValidationError{} - -// Validate checks the field values on QueryActionValue 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 *QueryActionValue) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on QueryActionValue 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 -// QueryActionValueMultiError, or nil if none found. -func (m *QueryActionValue) ValidateAll() error { - return m.validate(true) -} - -func (m *QueryActionValue) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - switch v := m.Kind.(type) { - case *QueryActionValue_Nil: - if v == nil { - err := QueryActionValueValidationError{ - field: "Kind", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - // no validation rules for Nil - case *QueryActionValue_Bool: - if v == nil { - err := QueryActionValueValidationError{ - field: "Kind", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - // no validation rules for Bool - case *QueryActionValue_Int64: - if v == nil { - err := QueryActionValueValidationError{ - field: "Kind", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - // no validation rules for Int64 - case *QueryActionValue_Uint64: - if v == nil { - err := QueryActionValueValidationError{ - field: "Kind", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - // no validation rules for Uint64 - case *QueryActionValue_Double: - if v == nil { - err := QueryActionValueValidationError{ - field: "Kind", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - // no validation rules for Double - case *QueryActionValue_Bytes: - if v == nil { - err := QueryActionValueValidationError{ - field: "Kind", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - // no validation rules for Bytes - case *QueryActionValue_Timestamp: - if v == nil { - err := QueryActionValueValidationError{ - field: "Kind", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetTimestamp()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, QueryActionValueValidationError{ - field: "Timestamp", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, QueryActionValueValidationError{ - field: "Timestamp", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetTimestamp()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return QueryActionValueValidationError{ - field: "Timestamp", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *QueryActionValue_Slice: - if v == nil { - err := QueryActionValueValidationError{ - field: "Kind", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetSlice()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, QueryActionValueValidationError{ - field: "Slice", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, QueryActionValueValidationError{ - field: "Slice", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetSlice()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return QueryActionValueValidationError{ - field: "Slice", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *QueryActionValue_Map: - if v == nil { - err := QueryActionValueValidationError{ - field: "Kind", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetMap()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, QueryActionValueValidationError{ - field: "Map", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, QueryActionValueValidationError{ - field: "Map", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMap()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return QueryActionValueValidationError{ - field: "Map", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *QueryActionValue_Binary: - if v == nil { - err := QueryActionValueValidationError{ - field: "Kind", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetBinary()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, QueryActionValueValidationError{ - field: "Binary", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, QueryActionValueValidationError{ - field: "Binary", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetBinary()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return QueryActionValueValidationError{ - field: "Binary", - reason: "embedded message failed validation", - cause: err, - } - } - } - - default: - _ = v // ensures v is used - } - - if len(errors) > 0 { - return QueryActionValueMultiError(errors) - } - - return nil -} - -// QueryActionValueMultiError is an error wrapping multiple validation errors -// returned by QueryActionValue.ValidateAll() if the designated constraints -// aren't met. -type QueryActionValueMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m QueryActionValueMultiError) 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 QueryActionValueMultiError) AllErrors() []error { return m } - -// QueryActionValueValidationError is the validation error returned by -// QueryActionValue.Validate if the designated constraints aren't met. -type QueryActionValueValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e QueryActionValueValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e QueryActionValueValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e QueryActionValueValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e QueryActionValueValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e QueryActionValueValidationError) ErrorName() string { return "QueryActionValueValidationError" } - -// Error satisfies the builtin error interface -func (e QueryActionValueValidationError) 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 %sQueryActionValue.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = QueryActionValueValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = QueryActionValueValidationError{} - -// Validate checks the field values on QueryActionSlice 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 *QueryActionSlice) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on QueryActionSlice 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 -// QueryActionSliceMultiError, or nil if none found. -func (m *QueryActionSlice) ValidateAll() error { - return m.validate(true) -} - -func (m *QueryActionSlice) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - for idx, item := range m.GetSlice() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, QueryActionSliceValidationError{ - field: fmt.Sprintf("Slice[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, QueryActionSliceValidationError{ - field: fmt.Sprintf("Slice[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return QueryActionSliceValidationError{ - field: fmt.Sprintf("Slice[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - if len(errors) > 0 { - return QueryActionSliceMultiError(errors) - } - - return nil -} - -// QueryActionSliceMultiError is an error wrapping multiple validation errors -// returned by QueryActionSlice.ValidateAll() if the designated constraints -// aren't met. -type QueryActionSliceMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m QueryActionSliceMultiError) 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 QueryActionSliceMultiError) AllErrors() []error { return m } - -// QueryActionSliceValidationError is the validation error returned by -// QueryActionSlice.Validate if the designated constraints aren't met. -type QueryActionSliceValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e QueryActionSliceValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e QueryActionSliceValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e QueryActionSliceValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e QueryActionSliceValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e QueryActionSliceValidationError) ErrorName() string { return "QueryActionSliceValidationError" } - -// Error satisfies the builtin error interface -func (e QueryActionSliceValidationError) 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 %sQueryActionSlice.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = QueryActionSliceValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = QueryActionSliceValidationError{} - -// Validate checks the field values on QueryActionMap 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 *QueryActionMap) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on QueryActionMap 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 QueryActionMapMultiError, -// or nil if none found. -func (m *QueryActionMap) ValidateAll() error { - return m.validate(true) -} - -func (m *QueryActionMap) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - { - sorted_keys := make([]string, len(m.GetMap())) - i := 0 - for key := range m.GetMap() { - sorted_keys[i] = key - i++ - } - sort.Slice(sorted_keys, func(i, j int) bool { return sorted_keys[i] < sorted_keys[j] }) - for _, key := range sorted_keys { - val := m.GetMap()[key] - _ = val - - // no validation rules for Map[key] - - if all { - switch v := interface{}(val).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, QueryActionMapValidationError{ - field: fmt.Sprintf("Map[%v]", key), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, QueryActionMapValidationError{ - field: fmt.Sprintf("Map[%v]", key), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(val).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return QueryActionMapValidationError{ - field: fmt.Sprintf("Map[%v]", key), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - } - - if len(errors) > 0 { - return QueryActionMapMultiError(errors) - } - - return nil -} - -// QueryActionMapMultiError is an error wrapping multiple validation errors -// returned by QueryActionMap.ValidateAll() if the designated constraints -// aren't met. -type QueryActionMapMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m QueryActionMapMultiError) 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 QueryActionMapMultiError) AllErrors() []error { return m } - -// QueryActionMapValidationError is the validation error returned by -// QueryActionMap.Validate if the designated constraints aren't met. -type QueryActionMapValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e QueryActionMapValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e QueryActionMapValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e QueryActionMapValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e QueryActionMapValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e QueryActionMapValidationError) ErrorName() string { return "QueryActionMapValidationError" } - -// Error satisfies the builtin error interface -func (e QueryActionMapValidationError) 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 %sQueryActionMap.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = QueryActionMapValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = QueryActionMapValidationError{} - -// Validate checks the field values on QueryActionBinary 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 *QueryActionBinary) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on QueryActionBinary 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 -// QueryActionBinaryMultiError, or nil if none found. -func (m *QueryActionBinary) ValidateAll() error { - return m.validate(true) -} - -func (m *QueryActionBinary) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Subtype - - // no validation rules for Bytes - - if len(errors) > 0 { - return QueryActionBinaryMultiError(errors) - } - - return nil -} - -// QueryActionBinaryMultiError is an error wrapping multiple validation errors -// returned by QueryActionBinary.ValidateAll() if the designated constraints -// aren't met. -type QueryActionBinaryMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m QueryActionBinaryMultiError) 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 QueryActionBinaryMultiError) AllErrors() []error { return m } - -// QueryActionBinaryValidationError is the validation error returned by -// QueryActionBinary.Validate if the designated constraints aren't met. -type QueryActionBinaryValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e QueryActionBinaryValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e QueryActionBinaryValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e QueryActionBinaryValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e QueryActionBinaryValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e QueryActionBinaryValidationError) ErrorName() string { - return "QueryActionBinaryValidationError" -} - -// Error satisfies the builtin error interface -func (e QueryActionBinaryValidationError) 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 %sQueryActionBinary.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = QueryActionBinaryValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = QueryActionBinaryValidationError{} - -// Validate checks the field values on QueryActionResult 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 *QueryActionResult) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on QueryActionResult 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 -// QueryActionResultMultiError, or nil if none found. -func (m *QueryActionResult) ValidateAll() error { - return m.validate(true) -} - -func (m *QueryActionResult) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - for idx, item := range m.GetRows() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, QueryActionResultValidationError{ - field: fmt.Sprintf("Rows[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, QueryActionResultValidationError{ - field: fmt.Sprintf("Rows[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return QueryActionResultValidationError{ - field: fmt.Sprintf("Rows[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - for idx, item := range m.GetDocs() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, QueryActionResultValidationError{ - field: fmt.Sprintf("Docs[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, QueryActionResultValidationError{ - field: fmt.Sprintf("Docs[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return QueryActionResultValidationError{ - field: fmt.Sprintf("Docs[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - if len(errors) > 0 { - return QueryActionResultMultiError(errors) - } - - return nil -} - -// QueryActionResultMultiError is an error wrapping multiple validation errors -// returned by QueryActionResult.ValidateAll() if the designated constraints -// aren't met. -type QueryActionResultMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m QueryActionResultMultiError) 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 QueryActionResultMultiError) AllErrors() []error { return m } - -// QueryActionResultValidationError is the validation error returned by -// QueryActionResult.Validate if the designated constraints aren't met. -type QueryActionResultValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e QueryActionResultValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e QueryActionResultValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e QueryActionResultValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e QueryActionResultValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e QueryActionResultValidationError) ErrorName() string { - return "QueryActionResultValidationError" -} - -// Error satisfies the builtin error interface -func (e QueryActionResultValidationError) 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 %sQueryActionResult.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = QueryActionResultValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = QueryActionResultValidationError{} - -// Validate checks the field values on StartActionRequest 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 *StartActionRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on StartActionRequest 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 -// StartActionRequestMultiError, or nil if none found. -func (m *StartActionRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *StartActionRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for ActionId - - if all { - switch v := interface{}(m.GetTimeout()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, StartActionRequestValidationError{ - field: "Timeout", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, StartActionRequestValidationError{ - field: "Timeout", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetTimeout()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return StartActionRequestValidationError{ - field: "Timeout", - reason: "embedded message failed validation", - cause: err, - } - } - } - - switch v := m.Params.(type) { - case *StartActionRequest_MysqlExplainParams: - if v == nil { - err := StartActionRequestValidationError{ - field: "Params", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetMysqlExplainParams()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, StartActionRequestValidationError{ - field: "MysqlExplainParams", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, StartActionRequestValidationError{ - field: "MysqlExplainParams", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMysqlExplainParams()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return StartActionRequestValidationError{ - field: "MysqlExplainParams", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *StartActionRequest_MysqlShowCreateTableParams: - if v == nil { - err := StartActionRequestValidationError{ - field: "Params", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetMysqlShowCreateTableParams()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, StartActionRequestValidationError{ - field: "MysqlShowCreateTableParams", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, StartActionRequestValidationError{ - field: "MysqlShowCreateTableParams", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMysqlShowCreateTableParams()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return StartActionRequestValidationError{ - field: "MysqlShowCreateTableParams", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *StartActionRequest_MysqlShowTableStatusParams: - if v == nil { - err := StartActionRequestValidationError{ - field: "Params", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetMysqlShowTableStatusParams()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, StartActionRequestValidationError{ - field: "MysqlShowTableStatusParams", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, StartActionRequestValidationError{ - field: "MysqlShowTableStatusParams", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMysqlShowTableStatusParams()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return StartActionRequestValidationError{ - field: "MysqlShowTableStatusParams", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *StartActionRequest_MysqlShowIndexParams: - if v == nil { - err := StartActionRequestValidationError{ - field: "Params", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetMysqlShowIndexParams()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, StartActionRequestValidationError{ - field: "MysqlShowIndexParams", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, StartActionRequestValidationError{ - field: "MysqlShowIndexParams", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMysqlShowIndexParams()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return StartActionRequestValidationError{ - field: "MysqlShowIndexParams", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *StartActionRequest_PostgresqlShowCreateTableParams: - if v == nil { - err := StartActionRequestValidationError{ - field: "Params", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetPostgresqlShowCreateTableParams()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, StartActionRequestValidationError{ - field: "PostgresqlShowCreateTableParams", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, StartActionRequestValidationError{ - field: "PostgresqlShowCreateTableParams", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetPostgresqlShowCreateTableParams()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return StartActionRequestValidationError{ - field: "PostgresqlShowCreateTableParams", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *StartActionRequest_PostgresqlShowIndexParams: - if v == nil { - err := StartActionRequestValidationError{ - field: "Params", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetPostgresqlShowIndexParams()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, StartActionRequestValidationError{ - field: "PostgresqlShowIndexParams", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, StartActionRequestValidationError{ - field: "PostgresqlShowIndexParams", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetPostgresqlShowIndexParams()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return StartActionRequestValidationError{ - field: "PostgresqlShowIndexParams", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *StartActionRequest_MongodbExplainParams: - if v == nil { - err := StartActionRequestValidationError{ - field: "Params", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetMongodbExplainParams()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, StartActionRequestValidationError{ - field: "MongodbExplainParams", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, StartActionRequestValidationError{ - field: "MongodbExplainParams", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMongodbExplainParams()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return StartActionRequestValidationError{ - field: "MongodbExplainParams", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *StartActionRequest_PtSummaryParams: - if v == nil { - err := StartActionRequestValidationError{ - field: "Params", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetPtSummaryParams()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, StartActionRequestValidationError{ - field: "PtSummaryParams", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, StartActionRequestValidationError{ - field: "PtSummaryParams", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetPtSummaryParams()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return StartActionRequestValidationError{ - field: "PtSummaryParams", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *StartActionRequest_PtPgSummaryParams: - if v == nil { - err := StartActionRequestValidationError{ - field: "Params", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetPtPgSummaryParams()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, StartActionRequestValidationError{ - field: "PtPgSummaryParams", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, StartActionRequestValidationError{ - field: "PtPgSummaryParams", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetPtPgSummaryParams()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return StartActionRequestValidationError{ - field: "PtPgSummaryParams", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *StartActionRequest_PtMongodbSummaryParams: - if v == nil { - err := StartActionRequestValidationError{ - field: "Params", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetPtMongodbSummaryParams()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, StartActionRequestValidationError{ - field: "PtMongodbSummaryParams", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, StartActionRequestValidationError{ - field: "PtMongodbSummaryParams", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetPtMongodbSummaryParams()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return StartActionRequestValidationError{ - field: "PtMongodbSummaryParams", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *StartActionRequest_PtMysqlSummaryParams: - if v == nil { - err := StartActionRequestValidationError{ - field: "Params", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetPtMysqlSummaryParams()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, StartActionRequestValidationError{ - field: "PtMysqlSummaryParams", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, StartActionRequestValidationError{ - field: "PtMysqlSummaryParams", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetPtMysqlSummaryParams()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return StartActionRequestValidationError{ - field: "PtMysqlSummaryParams", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *StartActionRequest_MysqlQueryShowParams: - if v == nil { - err := StartActionRequestValidationError{ - field: "Params", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetMysqlQueryShowParams()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, StartActionRequestValidationError{ - field: "MysqlQueryShowParams", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, StartActionRequestValidationError{ - field: "MysqlQueryShowParams", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMysqlQueryShowParams()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return StartActionRequestValidationError{ - field: "MysqlQueryShowParams", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *StartActionRequest_MysqlQuerySelectParams: - if v == nil { - err := StartActionRequestValidationError{ - field: "Params", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetMysqlQuerySelectParams()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, StartActionRequestValidationError{ - field: "MysqlQuerySelectParams", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, StartActionRequestValidationError{ - field: "MysqlQuerySelectParams", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMysqlQuerySelectParams()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return StartActionRequestValidationError{ - field: "MysqlQuerySelectParams", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *StartActionRequest_PostgresqlQueryShowParams: - if v == nil { - err := StartActionRequestValidationError{ - field: "Params", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetPostgresqlQueryShowParams()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, StartActionRequestValidationError{ - field: "PostgresqlQueryShowParams", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, StartActionRequestValidationError{ - field: "PostgresqlQueryShowParams", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetPostgresqlQueryShowParams()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return StartActionRequestValidationError{ - field: "PostgresqlQueryShowParams", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *StartActionRequest_PostgresqlQuerySelectParams: - if v == nil { - err := StartActionRequestValidationError{ - field: "Params", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetPostgresqlQuerySelectParams()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, StartActionRequestValidationError{ - field: "PostgresqlQuerySelectParams", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, StartActionRequestValidationError{ - field: "PostgresqlQuerySelectParams", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetPostgresqlQuerySelectParams()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return StartActionRequestValidationError{ - field: "PostgresqlQuerySelectParams", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *StartActionRequest_MongodbQueryGetparameterParams: - if v == nil { - err := StartActionRequestValidationError{ - field: "Params", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetMongodbQueryGetparameterParams()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, StartActionRequestValidationError{ - field: "MongodbQueryGetparameterParams", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, StartActionRequestValidationError{ - field: "MongodbQueryGetparameterParams", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMongodbQueryGetparameterParams()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return StartActionRequestValidationError{ - field: "MongodbQueryGetparameterParams", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *StartActionRequest_MongodbQueryBuildinfoParams: - if v == nil { - err := StartActionRequestValidationError{ - field: "Params", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetMongodbQueryBuildinfoParams()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, StartActionRequestValidationError{ - field: "MongodbQueryBuildinfoParams", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, StartActionRequestValidationError{ - field: "MongodbQueryBuildinfoParams", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMongodbQueryBuildinfoParams()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return StartActionRequestValidationError{ - field: "MongodbQueryBuildinfoParams", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *StartActionRequest_MongodbQueryGetcmdlineoptsParams: - if v == nil { - err := StartActionRequestValidationError{ - field: "Params", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetMongodbQueryGetcmdlineoptsParams()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, StartActionRequestValidationError{ - field: "MongodbQueryGetcmdlineoptsParams", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, StartActionRequestValidationError{ - field: "MongodbQueryGetcmdlineoptsParams", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMongodbQueryGetcmdlineoptsParams()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return StartActionRequestValidationError{ - field: "MongodbQueryGetcmdlineoptsParams", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *StartActionRequest_MongodbQueryReplsetgetstatusParams: - if v == nil { - err := StartActionRequestValidationError{ - field: "Params", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetMongodbQueryReplsetgetstatusParams()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, StartActionRequestValidationError{ - field: "MongodbQueryReplsetgetstatusParams", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, StartActionRequestValidationError{ - field: "MongodbQueryReplsetgetstatusParams", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMongodbQueryReplsetgetstatusParams()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return StartActionRequestValidationError{ - field: "MongodbQueryReplsetgetstatusParams", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *StartActionRequest_MongodbQueryGetdiagnosticdataParams: - if v == nil { - err := StartActionRequestValidationError{ - field: "Params", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetMongodbQueryGetdiagnosticdataParams()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, StartActionRequestValidationError{ - field: "MongodbQueryGetdiagnosticdataParams", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, StartActionRequestValidationError{ - field: "MongodbQueryGetdiagnosticdataParams", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMongodbQueryGetdiagnosticdataParams()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return StartActionRequestValidationError{ - field: "MongodbQueryGetdiagnosticdataParams", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *StartActionRequest_RestartSysServiceParams: - if v == nil { - err := StartActionRequestValidationError{ - field: "Params", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetRestartSysServiceParams()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, StartActionRequestValidationError{ - field: "RestartSysServiceParams", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, StartActionRequestValidationError{ - field: "RestartSysServiceParams", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetRestartSysServiceParams()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return StartActionRequestValidationError{ - field: "RestartSysServiceParams", - reason: "embedded message failed validation", - cause: err, - } - } - } - - default: - _ = v // ensures v is used - } - - if len(errors) > 0 { - return StartActionRequestMultiError(errors) - } - - return nil -} - -// StartActionRequestMultiError is an error wrapping multiple validation errors -// returned by StartActionRequest.ValidateAll() if the designated constraints -// aren't met. -type StartActionRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m StartActionRequestMultiError) 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 StartActionRequestMultiError) AllErrors() []error { return m } - -// StartActionRequestValidationError is the validation error returned by -// StartActionRequest.Validate if the designated constraints aren't met. -type StartActionRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e StartActionRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e StartActionRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e StartActionRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e StartActionRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e StartActionRequestValidationError) ErrorName() string { - return "StartActionRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e StartActionRequestValidationError) 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 %sStartActionRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = StartActionRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = StartActionRequestValidationError{} - -// Validate checks the field values on StartActionResponse 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 *StartActionResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on StartActionResponse 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 -// StartActionResponseMultiError, or nil if none found. -func (m *StartActionResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *StartActionResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return StartActionResponseMultiError(errors) - } - - return nil -} - -// StartActionResponseMultiError is an error wrapping multiple validation -// errors returned by StartActionResponse.ValidateAll() if the designated -// constraints aren't met. -type StartActionResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m StartActionResponseMultiError) 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 StartActionResponseMultiError) AllErrors() []error { return m } - -// StartActionResponseValidationError is the validation error returned by -// StartActionResponse.Validate if the designated constraints aren't met. -type StartActionResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e StartActionResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e StartActionResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e StartActionResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e StartActionResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e StartActionResponseValidationError) ErrorName() string { - return "StartActionResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e StartActionResponseValidationError) 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 %sStartActionResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = StartActionResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = StartActionResponseValidationError{} - -// Validate checks the field values on StopActionRequest 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 *StopActionRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on StopActionRequest 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 -// StopActionRequestMultiError, or nil if none found. -func (m *StopActionRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *StopActionRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for ActionId - - if len(errors) > 0 { - return StopActionRequestMultiError(errors) - } - - return nil -} - -// StopActionRequestMultiError is an error wrapping multiple validation errors -// returned by StopActionRequest.ValidateAll() if the designated constraints -// aren't met. -type StopActionRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m StopActionRequestMultiError) 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 StopActionRequestMultiError) AllErrors() []error { return m } - -// StopActionRequestValidationError is the validation error returned by -// StopActionRequest.Validate if the designated constraints aren't met. -type StopActionRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e StopActionRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e StopActionRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e StopActionRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e StopActionRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e StopActionRequestValidationError) ErrorName() string { - return "StopActionRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e StopActionRequestValidationError) 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 %sStopActionRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = StopActionRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = StopActionRequestValidationError{} - -// Validate checks the field values on StopActionResponse 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 *StopActionResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on StopActionResponse 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 -// StopActionResponseMultiError, or nil if none found. -func (m *StopActionResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *StopActionResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return StopActionResponseMultiError(errors) - } - - return nil -} - -// StopActionResponseMultiError is an error wrapping multiple validation errors -// returned by StopActionResponse.ValidateAll() if the designated constraints -// aren't met. -type StopActionResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m StopActionResponseMultiError) 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 StopActionResponseMultiError) AllErrors() []error { return m } - -// StopActionResponseValidationError is the validation error returned by -// StopActionResponse.Validate if the designated constraints aren't met. -type StopActionResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e StopActionResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e StopActionResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e StopActionResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e StopActionResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e StopActionResponseValidationError) ErrorName() string { - return "StopActionResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e StopActionResponseValidationError) 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 %sStopActionResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = StopActionResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = StopActionResponseValidationError{} - -// Validate checks the field values on ActionResultRequest 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 *ActionResultRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ActionResultRequest 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 -// ActionResultRequestMultiError, or nil if none found. -func (m *ActionResultRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *ActionResultRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for ActionId - - // no validation rules for Output - - // no validation rules for Done - - // no validation rules for Error - - if len(errors) > 0 { - return ActionResultRequestMultiError(errors) - } - - return nil -} - -// ActionResultRequestMultiError is an error wrapping multiple validation -// errors returned by ActionResultRequest.ValidateAll() if the designated -// constraints aren't met. -type ActionResultRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ActionResultRequestMultiError) 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 ActionResultRequestMultiError) AllErrors() []error { return m } - -// ActionResultRequestValidationError is the validation error returned by -// ActionResultRequest.Validate if the designated constraints aren't met. -type ActionResultRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ActionResultRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ActionResultRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ActionResultRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ActionResultRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ActionResultRequestValidationError) ErrorName() string { - return "ActionResultRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e ActionResultRequestValidationError) 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 %sActionResultRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ActionResultRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ActionResultRequestValidationError{} - -// Validate checks the field values on ActionResultResponse 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 *ActionResultResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ActionResultResponse 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 -// ActionResultResponseMultiError, or nil if none found. -func (m *ActionResultResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *ActionResultResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return ActionResultResponseMultiError(errors) - } - - return nil -} - -// ActionResultResponseMultiError is an error wrapping multiple validation -// errors returned by ActionResultResponse.ValidateAll() if the designated -// constraints aren't met. -type ActionResultResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ActionResultResponseMultiError) 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 ActionResultResponseMultiError) AllErrors() []error { return m } - -// ActionResultResponseValidationError is the validation error returned by -// ActionResultResponse.Validate if the designated constraints aren't met. -type ActionResultResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ActionResultResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ActionResultResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ActionResultResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ActionResultResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ActionResultResponseValidationError) ErrorName() string { - return "ActionResultResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e ActionResultResponseValidationError) 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 %sActionResultResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ActionResultResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ActionResultResponseValidationError{} - -// Validate checks the field values on PBMSwitchPITRRequest 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 *PBMSwitchPITRRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on PBMSwitchPITRRequest 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 -// PBMSwitchPITRRequestMultiError, or nil if none found. -func (m *PBMSwitchPITRRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *PBMSwitchPITRRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Dsn - - if all { - switch v := interface{}(m.GetTextFiles()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, PBMSwitchPITRRequestValidationError{ - field: "TextFiles", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, PBMSwitchPITRRequestValidationError{ - field: "TextFiles", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetTextFiles()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return PBMSwitchPITRRequestValidationError{ - field: "TextFiles", - reason: "embedded message failed validation", - cause: err, - } - } - } - - // no validation rules for Enabled - - if len(errors) > 0 { - return PBMSwitchPITRRequestMultiError(errors) - } - - return nil -} - -// PBMSwitchPITRRequestMultiError is an error wrapping multiple validation -// errors returned by PBMSwitchPITRRequest.ValidateAll() if the designated -// constraints aren't met. -type PBMSwitchPITRRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m PBMSwitchPITRRequestMultiError) 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 PBMSwitchPITRRequestMultiError) AllErrors() []error { return m } - -// PBMSwitchPITRRequestValidationError is the validation error returned by -// PBMSwitchPITRRequest.Validate if the designated constraints aren't met. -type PBMSwitchPITRRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e PBMSwitchPITRRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e PBMSwitchPITRRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e PBMSwitchPITRRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e PBMSwitchPITRRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e PBMSwitchPITRRequestValidationError) ErrorName() string { - return "PBMSwitchPITRRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e PBMSwitchPITRRequestValidationError) 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 %sPBMSwitchPITRRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = PBMSwitchPITRRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = PBMSwitchPITRRequestValidationError{} - -// Validate checks the field values on PBMSwitchPITRResponse 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 *PBMSwitchPITRResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on PBMSwitchPITRResponse 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 -// PBMSwitchPITRResponseMultiError, or nil if none found. -func (m *PBMSwitchPITRResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *PBMSwitchPITRResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Error - - if len(errors) > 0 { - return PBMSwitchPITRResponseMultiError(errors) - } - - return nil -} - -// PBMSwitchPITRResponseMultiError is an error wrapping multiple validation -// errors returned by PBMSwitchPITRResponse.ValidateAll() if the designated -// constraints aren't met. -type PBMSwitchPITRResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m PBMSwitchPITRResponseMultiError) 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 PBMSwitchPITRResponseMultiError) AllErrors() []error { return m } - -// PBMSwitchPITRResponseValidationError is the validation error returned by -// PBMSwitchPITRResponse.Validate if the designated constraints aren't met. -type PBMSwitchPITRResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e PBMSwitchPITRResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e PBMSwitchPITRResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e PBMSwitchPITRResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e PBMSwitchPITRResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e PBMSwitchPITRResponseValidationError) ErrorName() string { - return "PBMSwitchPITRResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e PBMSwitchPITRResponseValidationError) 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 %sPBMSwitchPITRResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = PBMSwitchPITRResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = PBMSwitchPITRResponseValidationError{} - -// Validate checks the field values on AgentLogsRequest 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 *AgentLogsRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on AgentLogsRequest 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 -// AgentLogsRequestMultiError, or nil if none found. -func (m *AgentLogsRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *AgentLogsRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for AgentId - - // no validation rules for Limit - - if len(errors) > 0 { - return AgentLogsRequestMultiError(errors) - } - - return nil -} - -// AgentLogsRequestMultiError is an error wrapping multiple validation errors -// returned by AgentLogsRequest.ValidateAll() if the designated constraints -// aren't met. -type AgentLogsRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m AgentLogsRequestMultiError) 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 AgentLogsRequestMultiError) AllErrors() []error { return m } - -// AgentLogsRequestValidationError is the validation error returned by -// AgentLogsRequest.Validate if the designated constraints aren't met. -type AgentLogsRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e AgentLogsRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e AgentLogsRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e AgentLogsRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e AgentLogsRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e AgentLogsRequestValidationError) ErrorName() string { return "AgentLogsRequestValidationError" } - -// Error satisfies the builtin error interface -func (e AgentLogsRequestValidationError) 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 %sAgentLogsRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = AgentLogsRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = AgentLogsRequestValidationError{} - -// Validate checks the field values on AgentLogsResponse 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 *AgentLogsResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on AgentLogsResponse 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 -// AgentLogsResponseMultiError, or nil if none found. -func (m *AgentLogsResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *AgentLogsResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for AgentConfigLogLinesCount - - if len(errors) > 0 { - return AgentLogsResponseMultiError(errors) - } - - return nil -} - -// AgentLogsResponseMultiError is an error wrapping multiple validation errors -// returned by AgentLogsResponse.ValidateAll() if the designated constraints -// aren't met. -type AgentLogsResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m AgentLogsResponseMultiError) 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 AgentLogsResponseMultiError) AllErrors() []error { return m } - -// AgentLogsResponseValidationError is the validation error returned by -// AgentLogsResponse.Validate if the designated constraints aren't met. -type AgentLogsResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e AgentLogsResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e AgentLogsResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e AgentLogsResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e AgentLogsResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e AgentLogsResponseValidationError) ErrorName() string { - return "AgentLogsResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e AgentLogsResponseValidationError) 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 %sAgentLogsResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = AgentLogsResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = AgentLogsResponseValidationError{} - -// Validate checks the field values on CheckConnectionRequest 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 *CheckConnectionRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on CheckConnectionRequest 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 -// CheckConnectionRequestMultiError, or nil if none found. -func (m *CheckConnectionRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *CheckConnectionRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Type - - // no validation rules for Dsn - - if all { - switch v := interface{}(m.GetTimeout()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, CheckConnectionRequestValidationError{ - field: "Timeout", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, CheckConnectionRequestValidationError{ - field: "Timeout", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetTimeout()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return CheckConnectionRequestValidationError{ - field: "Timeout", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetTextFiles()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, CheckConnectionRequestValidationError{ - field: "TextFiles", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, CheckConnectionRequestValidationError{ - field: "TextFiles", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetTextFiles()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return CheckConnectionRequestValidationError{ - field: "TextFiles", - reason: "embedded message failed validation", - cause: err, - } - } - } - - // no validation rules for TlsSkipVerify - - // no validation rules for Tls - - if len(errors) > 0 { - return CheckConnectionRequestMultiError(errors) - } - - return nil -} - -// CheckConnectionRequestMultiError is an error wrapping multiple validation -// errors returned by CheckConnectionRequest.ValidateAll() if the designated -// constraints aren't met. -type CheckConnectionRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m CheckConnectionRequestMultiError) 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 CheckConnectionRequestMultiError) AllErrors() []error { return m } - -// CheckConnectionRequestValidationError is the validation error returned by -// CheckConnectionRequest.Validate if the designated constraints aren't met. -type CheckConnectionRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e CheckConnectionRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e CheckConnectionRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e CheckConnectionRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e CheckConnectionRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e CheckConnectionRequestValidationError) ErrorName() string { - return "CheckConnectionRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e CheckConnectionRequestValidationError) 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 %sCheckConnectionRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = CheckConnectionRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = CheckConnectionRequestValidationError{} - -// Validate checks the field values on CheckConnectionResponse 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 *CheckConnectionResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on CheckConnectionResponse 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 -// CheckConnectionResponseMultiError, or nil if none found. -func (m *CheckConnectionResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *CheckConnectionResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Error - - if len(errors) > 0 { - return CheckConnectionResponseMultiError(errors) - } - - return nil -} - -// CheckConnectionResponseMultiError is an error wrapping multiple validation -// errors returned by CheckConnectionResponse.ValidateAll() if the designated -// constraints aren't met. -type CheckConnectionResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m CheckConnectionResponseMultiError) 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 CheckConnectionResponseMultiError) AllErrors() []error { return m } - -// CheckConnectionResponseValidationError is the validation error returned by -// CheckConnectionResponse.Validate if the designated constraints aren't met. -type CheckConnectionResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e CheckConnectionResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e CheckConnectionResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e CheckConnectionResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e CheckConnectionResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e CheckConnectionResponseValidationError) ErrorName() string { - return "CheckConnectionResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e CheckConnectionResponseValidationError) 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 %sCheckConnectionResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = CheckConnectionResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = CheckConnectionResponseValidationError{} - -// Validate checks the field values on ServiceInfoRequest 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 *ServiceInfoRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ServiceInfoRequest 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 -// ServiceInfoRequestMultiError, or nil if none found. -func (m *ServiceInfoRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *ServiceInfoRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Type - - // no validation rules for Dsn - - if all { - switch v := interface{}(m.GetTimeout()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ServiceInfoRequestValidationError{ - field: "Timeout", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ServiceInfoRequestValidationError{ - field: "Timeout", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetTimeout()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ServiceInfoRequestValidationError{ - field: "Timeout", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetTextFiles()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ServiceInfoRequestValidationError{ - field: "TextFiles", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ServiceInfoRequestValidationError{ - field: "TextFiles", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetTextFiles()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ServiceInfoRequestValidationError{ - field: "TextFiles", - reason: "embedded message failed validation", - cause: err, - } - } - } - - // no validation rules for TlsSkipVerify - - // no validation rules for Tls - - if len(errors) > 0 { - return ServiceInfoRequestMultiError(errors) - } - - return nil -} - -// ServiceInfoRequestMultiError is an error wrapping multiple validation errors -// returned by ServiceInfoRequest.ValidateAll() if the designated constraints -// aren't met. -type ServiceInfoRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ServiceInfoRequestMultiError) 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 ServiceInfoRequestMultiError) AllErrors() []error { return m } - -// ServiceInfoRequestValidationError is the validation error returned by -// ServiceInfoRequest.Validate if the designated constraints aren't met. -type ServiceInfoRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ServiceInfoRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ServiceInfoRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ServiceInfoRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ServiceInfoRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ServiceInfoRequestValidationError) ErrorName() string { - return "ServiceInfoRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e ServiceInfoRequestValidationError) 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 %sServiceInfoRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ServiceInfoRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ServiceInfoRequestValidationError{} - -// Validate checks the field values on ServiceInfoResponse 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 *ServiceInfoResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ServiceInfoResponse 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 -// ServiceInfoResponseMultiError, or nil if none found. -func (m *ServiceInfoResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *ServiceInfoResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Error - - // no validation rules for TableCount - - // no validation rules for Version - - if m.PgsmVersion != nil { - // no validation rules for PgsmVersion - } - - if len(errors) > 0 { - return ServiceInfoResponseMultiError(errors) - } - - return nil -} - -// ServiceInfoResponseMultiError is an error wrapping multiple validation -// errors returned by ServiceInfoResponse.ValidateAll() if the designated -// constraints aren't met. -type ServiceInfoResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ServiceInfoResponseMultiError) 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 ServiceInfoResponseMultiError) AllErrors() []error { return m } - -// ServiceInfoResponseValidationError is the validation error returned by -// ServiceInfoResponse.Validate if the designated constraints aren't met. -type ServiceInfoResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ServiceInfoResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ServiceInfoResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ServiceInfoResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ServiceInfoResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ServiceInfoResponseValidationError) ErrorName() string { - return "ServiceInfoResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e ServiceInfoResponseValidationError) 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 %sServiceInfoResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ServiceInfoResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ServiceInfoResponseValidationError{} - -// Validate checks the field values on JobStatusRequest 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 *JobStatusRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on JobStatusRequest 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 -// JobStatusRequestMultiError, or nil if none found. -func (m *JobStatusRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *JobStatusRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for JobId - - if len(errors) > 0 { - return JobStatusRequestMultiError(errors) - } - - return nil -} - -// JobStatusRequestMultiError is an error wrapping multiple validation errors -// returned by JobStatusRequest.ValidateAll() if the designated constraints -// aren't met. -type JobStatusRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m JobStatusRequestMultiError) 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 JobStatusRequestMultiError) AllErrors() []error { return m } - -// JobStatusRequestValidationError is the validation error returned by -// JobStatusRequest.Validate if the designated constraints aren't met. -type JobStatusRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e JobStatusRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e JobStatusRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e JobStatusRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e JobStatusRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e JobStatusRequestValidationError) ErrorName() string { return "JobStatusRequestValidationError" } - -// Error satisfies the builtin error interface -func (e JobStatusRequestValidationError) 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 %sJobStatusRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = JobStatusRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = JobStatusRequestValidationError{} - -// Validate checks the field values on JobStatusResponse 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 *JobStatusResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on JobStatusResponse 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 -// JobStatusResponseMultiError, or nil if none found. -func (m *JobStatusResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *JobStatusResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Alive - - if len(errors) > 0 { - return JobStatusResponseMultiError(errors) - } - - return nil -} - -// JobStatusResponseMultiError is an error wrapping multiple validation errors -// returned by JobStatusResponse.ValidateAll() if the designated constraints -// aren't met. -type JobStatusResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m JobStatusResponseMultiError) 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 JobStatusResponseMultiError) AllErrors() []error { return m } - -// JobStatusResponseValidationError is the validation error returned by -// JobStatusResponse.Validate if the designated constraints aren't met. -type JobStatusResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e JobStatusResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e JobStatusResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e JobStatusResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e JobStatusResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e JobStatusResponseValidationError) ErrorName() string { - return "JobStatusResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e JobStatusResponseValidationError) 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 %sJobStatusResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = JobStatusResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = JobStatusResponseValidationError{} - -// Validate checks the field values on S3LocationConfig 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 *S3LocationConfig) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on S3LocationConfig 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 -// S3LocationConfigMultiError, or nil if none found. -func (m *S3LocationConfig) ValidateAll() error { - return m.validate(true) -} - -func (m *S3LocationConfig) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Endpoint - - // no validation rules for AccessKey - - // no validation rules for SecretKey - - // no validation rules for BucketName - - // no validation rules for BucketRegion - - if len(errors) > 0 { - return S3LocationConfigMultiError(errors) - } - - return nil -} - -// S3LocationConfigMultiError is an error wrapping multiple validation errors -// returned by S3LocationConfig.ValidateAll() if the designated constraints -// aren't met. -type S3LocationConfigMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m S3LocationConfigMultiError) 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 S3LocationConfigMultiError) AllErrors() []error { return m } - -// S3LocationConfigValidationError is the validation error returned by -// S3LocationConfig.Validate if the designated constraints aren't met. -type S3LocationConfigValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e S3LocationConfigValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e S3LocationConfigValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e S3LocationConfigValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e S3LocationConfigValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e S3LocationConfigValidationError) ErrorName() string { return "S3LocationConfigValidationError" } - -// Error satisfies the builtin error interface -func (e S3LocationConfigValidationError) 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 %sS3LocationConfig.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = S3LocationConfigValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = S3LocationConfigValidationError{} - -// Validate checks the field values on FilesystemLocationConfig 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 *FilesystemLocationConfig) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on FilesystemLocationConfig 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 -// FilesystemLocationConfigMultiError, or nil if none found. -func (m *FilesystemLocationConfig) ValidateAll() error { - return m.validate(true) -} - -func (m *FilesystemLocationConfig) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Path - - if len(errors) > 0 { - return FilesystemLocationConfigMultiError(errors) - } - - return nil -} - -// FilesystemLocationConfigMultiError is an error wrapping multiple validation -// errors returned by FilesystemLocationConfig.ValidateAll() if the designated -// constraints aren't met. -type FilesystemLocationConfigMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m FilesystemLocationConfigMultiError) 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 FilesystemLocationConfigMultiError) AllErrors() []error { return m } - -// FilesystemLocationConfigValidationError is the validation error returned by -// FilesystemLocationConfig.Validate if the designated constraints aren't met. -type FilesystemLocationConfigValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e FilesystemLocationConfigValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e FilesystemLocationConfigValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e FilesystemLocationConfigValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e FilesystemLocationConfigValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e FilesystemLocationConfigValidationError) ErrorName() string { - return "FilesystemLocationConfigValidationError" -} - -// Error satisfies the builtin error interface -func (e FilesystemLocationConfigValidationError) 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 %sFilesystemLocationConfig.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = FilesystemLocationConfigValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = FilesystemLocationConfigValidationError{} - -// Validate checks the field values on StartJobRequest 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 *StartJobRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on StartJobRequest 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 -// StartJobRequestMultiError, or nil if none found. -func (m *StartJobRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *StartJobRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for JobId - - if all { - switch v := interface{}(m.GetTimeout()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, StartJobRequestValidationError{ - field: "Timeout", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, StartJobRequestValidationError{ - field: "Timeout", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetTimeout()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return StartJobRequestValidationError{ - field: "Timeout", - reason: "embedded message failed validation", - cause: err, - } - } - } - - switch v := m.Job.(type) { - case *StartJobRequest_MysqlBackup: - if v == nil { - err := StartJobRequestValidationError{ - field: "Job", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetMysqlBackup()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, StartJobRequestValidationError{ - field: "MysqlBackup", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, StartJobRequestValidationError{ - field: "MysqlBackup", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMysqlBackup()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return StartJobRequestValidationError{ - field: "MysqlBackup", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *StartJobRequest_MysqlRestoreBackup: - if v == nil { - err := StartJobRequestValidationError{ - field: "Job", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetMysqlRestoreBackup()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, StartJobRequestValidationError{ - field: "MysqlRestoreBackup", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, StartJobRequestValidationError{ - field: "MysqlRestoreBackup", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMysqlRestoreBackup()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return StartJobRequestValidationError{ - field: "MysqlRestoreBackup", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *StartJobRequest_MongodbBackup: - if v == nil { - err := StartJobRequestValidationError{ - field: "Job", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetMongodbBackup()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, StartJobRequestValidationError{ - field: "MongodbBackup", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, StartJobRequestValidationError{ - field: "MongodbBackup", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMongodbBackup()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return StartJobRequestValidationError{ - field: "MongodbBackup", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *StartJobRequest_MongodbRestoreBackup: - if v == nil { - err := StartJobRequestValidationError{ - field: "Job", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetMongodbRestoreBackup()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, StartJobRequestValidationError{ - field: "MongodbRestoreBackup", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, StartJobRequestValidationError{ - field: "MongodbRestoreBackup", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMongodbRestoreBackup()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return StartJobRequestValidationError{ - field: "MongodbRestoreBackup", - reason: "embedded message failed validation", - cause: err, - } - } - } - - default: - _ = v // ensures v is used - } - - if len(errors) > 0 { - return StartJobRequestMultiError(errors) - } - - return nil -} - -// StartJobRequestMultiError is an error wrapping multiple validation errors -// returned by StartJobRequest.ValidateAll() if the designated constraints -// aren't met. -type StartJobRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m StartJobRequestMultiError) 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 StartJobRequestMultiError) AllErrors() []error { return m } - -// StartJobRequestValidationError is the validation error returned by -// StartJobRequest.Validate if the designated constraints aren't met. -type StartJobRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e StartJobRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e StartJobRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e StartJobRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e StartJobRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e StartJobRequestValidationError) ErrorName() string { return "StartJobRequestValidationError" } - -// Error satisfies the builtin error interface -func (e StartJobRequestValidationError) 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 %sStartJobRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = StartJobRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = StartJobRequestValidationError{} - -// Validate checks the field values on StartJobResponse 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 *StartJobResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on StartJobResponse 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 -// StartJobResponseMultiError, or nil if none found. -func (m *StartJobResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *StartJobResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Error - - if len(errors) > 0 { - return StartJobResponseMultiError(errors) - } - - return nil -} - -// StartJobResponseMultiError is an error wrapping multiple validation errors -// returned by StartJobResponse.ValidateAll() if the designated constraints -// aren't met. -type StartJobResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m StartJobResponseMultiError) 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 StartJobResponseMultiError) AllErrors() []error { return m } - -// StartJobResponseValidationError is the validation error returned by -// StartJobResponse.Validate if the designated constraints aren't met. -type StartJobResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e StartJobResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e StartJobResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e StartJobResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e StartJobResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e StartJobResponseValidationError) ErrorName() string { return "StartJobResponseValidationError" } - -// Error satisfies the builtin error interface -func (e StartJobResponseValidationError) 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 %sStartJobResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = StartJobResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = StartJobResponseValidationError{} - -// Validate checks the field values on StopJobRequest 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 *StopJobRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on StopJobRequest 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 StopJobRequestMultiError, -// or nil if none found. -func (m *StopJobRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *StopJobRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for JobId - - if len(errors) > 0 { - return StopJobRequestMultiError(errors) - } - - return nil -} - -// StopJobRequestMultiError is an error wrapping multiple validation errors -// returned by StopJobRequest.ValidateAll() if the designated constraints -// aren't met. -type StopJobRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m StopJobRequestMultiError) 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 StopJobRequestMultiError) AllErrors() []error { return m } - -// StopJobRequestValidationError is the validation error returned by -// StopJobRequest.Validate if the designated constraints aren't met. -type StopJobRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e StopJobRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e StopJobRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e StopJobRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e StopJobRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e StopJobRequestValidationError) ErrorName() string { return "StopJobRequestValidationError" } - -// Error satisfies the builtin error interface -func (e StopJobRequestValidationError) 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 %sStopJobRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = StopJobRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = StopJobRequestValidationError{} - -// Validate checks the field values on StopJobResponse 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 *StopJobResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on StopJobResponse 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 -// StopJobResponseMultiError, or nil if none found. -func (m *StopJobResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *StopJobResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return StopJobResponseMultiError(errors) - } - - return nil -} - -// StopJobResponseMultiError is an error wrapping multiple validation errors -// returned by StopJobResponse.ValidateAll() if the designated constraints -// aren't met. -type StopJobResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m StopJobResponseMultiError) 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 StopJobResponseMultiError) AllErrors() []error { return m } - -// StopJobResponseValidationError is the validation error returned by -// StopJobResponse.Validate if the designated constraints aren't met. -type StopJobResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e StopJobResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e StopJobResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e StopJobResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e StopJobResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e StopJobResponseValidationError) ErrorName() string { return "StopJobResponseValidationError" } - -// Error satisfies the builtin error interface -func (e StopJobResponseValidationError) 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 %sStopJobResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = StopJobResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = StopJobResponseValidationError{} - -// Validate checks the field values on JobResult 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 *JobResult) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on JobResult 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 JobResultMultiError, or nil -// if none found. -func (m *JobResult) ValidateAll() error { - return m.validate(true) -} - -func (m *JobResult) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for JobId - - if all { - switch v := interface{}(m.GetTimestamp()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, JobResultValidationError{ - field: "Timestamp", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, JobResultValidationError{ - field: "Timestamp", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetTimestamp()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return JobResultValidationError{ - field: "Timestamp", - reason: "embedded message failed validation", - cause: err, - } - } - } - - switch v := m.Result.(type) { - case *JobResult_Error_: - if v == nil { - err := JobResultValidationError{ - field: "Result", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetError()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, JobResultValidationError{ - field: "Error", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, JobResultValidationError{ - field: "Error", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetError()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return JobResultValidationError{ - field: "Error", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *JobResult_MysqlBackup: - if v == nil { - err := JobResultValidationError{ - field: "Result", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetMysqlBackup()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, JobResultValidationError{ - field: "MysqlBackup", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, JobResultValidationError{ - field: "MysqlBackup", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMysqlBackup()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return JobResultValidationError{ - field: "MysqlBackup", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *JobResult_MysqlRestoreBackup: - if v == nil { - err := JobResultValidationError{ - field: "Result", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetMysqlRestoreBackup()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, JobResultValidationError{ - field: "MysqlRestoreBackup", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, JobResultValidationError{ - field: "MysqlRestoreBackup", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMysqlRestoreBackup()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return JobResultValidationError{ - field: "MysqlRestoreBackup", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *JobResult_MongodbBackup: - if v == nil { - err := JobResultValidationError{ - field: "Result", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetMongodbBackup()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, JobResultValidationError{ - field: "MongodbBackup", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, JobResultValidationError{ - field: "MongodbBackup", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMongodbBackup()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return JobResultValidationError{ - field: "MongodbBackup", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *JobResult_MongodbRestoreBackup: - if v == nil { - err := JobResultValidationError{ - field: "Result", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetMongodbRestoreBackup()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, JobResultValidationError{ - field: "MongodbRestoreBackup", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, JobResultValidationError{ - field: "MongodbRestoreBackup", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMongodbRestoreBackup()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return JobResultValidationError{ - field: "MongodbRestoreBackup", - reason: "embedded message failed validation", - cause: err, - } - } - } - - default: - _ = v // ensures v is used - } - - if len(errors) > 0 { - return JobResultMultiError(errors) - } - - return nil -} - -// JobResultMultiError is an error wrapping multiple validation errors returned -// by JobResult.ValidateAll() if the designated constraints aren't met. -type JobResultMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m JobResultMultiError) 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 JobResultMultiError) AllErrors() []error { return m } - -// JobResultValidationError is the validation error returned by -// JobResult.Validate if the designated constraints aren't met. -type JobResultValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e JobResultValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e JobResultValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e JobResultValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e JobResultValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e JobResultValidationError) ErrorName() string { return "JobResultValidationError" } - -// Error satisfies the builtin error interface -func (e JobResultValidationError) 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 %sJobResult.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = JobResultValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = JobResultValidationError{} - -// Validate checks the field values on JobProgress 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 *JobProgress) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on JobProgress 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 JobProgressMultiError, or -// nil if none found. -func (m *JobProgress) ValidateAll() error { - return m.validate(true) -} - -func (m *JobProgress) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for JobId - - if all { - switch v := interface{}(m.GetTimestamp()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, JobProgressValidationError{ - field: "Timestamp", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, JobProgressValidationError{ - field: "Timestamp", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetTimestamp()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return JobProgressValidationError{ - field: "Timestamp", - reason: "embedded message failed validation", - cause: err, - } - } - } - - switch v := m.Result.(type) { - case *JobProgress_MysqlBackup: - if v == nil { - err := JobProgressValidationError{ - field: "Result", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetMysqlBackup()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, JobProgressValidationError{ - field: "MysqlBackup", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, JobProgressValidationError{ - field: "MysqlBackup", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMysqlBackup()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return JobProgressValidationError{ - field: "MysqlBackup", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *JobProgress_MysqlRestoreBackup: - if v == nil { - err := JobProgressValidationError{ - field: "Result", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetMysqlRestoreBackup()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, JobProgressValidationError{ - field: "MysqlRestoreBackup", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, JobProgressValidationError{ - field: "MysqlRestoreBackup", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMysqlRestoreBackup()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return JobProgressValidationError{ - field: "MysqlRestoreBackup", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *JobProgress_Logs_: - if v == nil { - err := JobProgressValidationError{ - field: "Result", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetLogs()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, JobProgressValidationError{ - field: "Logs", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, JobProgressValidationError{ - field: "Logs", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetLogs()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return JobProgressValidationError{ - field: "Logs", - reason: "embedded message failed validation", - cause: err, - } - } - } - - default: - _ = v // ensures v is used - } - - if len(errors) > 0 { - return JobProgressMultiError(errors) - } - - return nil -} - -// JobProgressMultiError is an error wrapping multiple validation errors -// returned by JobProgress.ValidateAll() if the designated constraints aren't met. -type JobProgressMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m JobProgressMultiError) 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 JobProgressMultiError) AllErrors() []error { return m } - -// JobProgressValidationError is the validation error returned by -// JobProgress.Validate if the designated constraints aren't met. -type JobProgressValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e JobProgressValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e JobProgressValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e JobProgressValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e JobProgressValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e JobProgressValidationError) ErrorName() string { return "JobProgressValidationError" } - -// Error satisfies the builtin error interface -func (e JobProgressValidationError) 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 %sJobProgress.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = JobProgressValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = JobProgressValidationError{} - -// Validate checks the field values on GetVersionsRequest 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 *GetVersionsRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on GetVersionsRequest 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 -// GetVersionsRequestMultiError, or nil if none found. -func (m *GetVersionsRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *GetVersionsRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - for idx, item := range m.GetSoftwares() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GetVersionsRequestValidationError{ - field: fmt.Sprintf("Softwares[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GetVersionsRequestValidationError{ - field: fmt.Sprintf("Softwares[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GetVersionsRequestValidationError{ - field: fmt.Sprintf("Softwares[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - if len(errors) > 0 { - return GetVersionsRequestMultiError(errors) - } - - return nil -} - -// GetVersionsRequestMultiError is an error wrapping multiple validation errors -// returned by GetVersionsRequest.ValidateAll() if the designated constraints -// aren't met. -type GetVersionsRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m GetVersionsRequestMultiError) 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 GetVersionsRequestMultiError) AllErrors() []error { return m } - -// GetVersionsRequestValidationError is the validation error returned by -// GetVersionsRequest.Validate if the designated constraints aren't met. -type GetVersionsRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e GetVersionsRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e GetVersionsRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e GetVersionsRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e GetVersionsRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e GetVersionsRequestValidationError) ErrorName() string { - return "GetVersionsRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e GetVersionsRequestValidationError) 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 %sGetVersionsRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = GetVersionsRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = GetVersionsRequestValidationError{} - -// Validate checks the field values on GetVersionsResponse 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 *GetVersionsResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on GetVersionsResponse 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 -// GetVersionsResponseMultiError, or nil if none found. -func (m *GetVersionsResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *GetVersionsResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - for idx, item := range m.GetVersions() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GetVersionsResponseValidationError{ - field: fmt.Sprintf("Versions[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GetVersionsResponseValidationError{ - field: fmt.Sprintf("Versions[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GetVersionsResponseValidationError{ - field: fmt.Sprintf("Versions[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - if len(errors) > 0 { - return GetVersionsResponseMultiError(errors) - } - - return nil -} - -// GetVersionsResponseMultiError is an error wrapping multiple validation -// errors returned by GetVersionsResponse.ValidateAll() if the designated -// constraints aren't met. -type GetVersionsResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m GetVersionsResponseMultiError) 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 GetVersionsResponseMultiError) AllErrors() []error { return m } - -// GetVersionsResponseValidationError is the validation error returned by -// GetVersionsResponse.Validate if the designated constraints aren't met. -type GetVersionsResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e GetVersionsResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e GetVersionsResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e GetVersionsResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e GetVersionsResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e GetVersionsResponseValidationError) ErrorName() string { - return "GetVersionsResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e GetVersionsResponseValidationError) 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 %sGetVersionsResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = GetVersionsResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = GetVersionsResponseValidationError{} - -// Validate checks the field values on AgentMessage 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 *AgentMessage) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on AgentMessage 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 AgentMessageMultiError, or -// nil if none found. -func (m *AgentMessage) ValidateAll() error { - return m.validate(true) -} - -func (m *AgentMessage) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Id - - if all { - switch v := interface{}(m.GetStatus()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AgentMessageValidationError{ - field: "Status", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AgentMessageValidationError{ - field: "Status", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetStatus()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AgentMessageValidationError{ - field: "Status", - reason: "embedded message failed validation", - cause: err, - } - } - } - - switch v := m.Payload.(type) { - case *AgentMessage_Ping: - if v == nil { - err := AgentMessageValidationError{ - field: "Payload", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetPing()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AgentMessageValidationError{ - field: "Ping", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AgentMessageValidationError{ - field: "Ping", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetPing()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AgentMessageValidationError{ - field: "Ping", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *AgentMessage_StateChanged: - if v == nil { - err := AgentMessageValidationError{ - field: "Payload", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetStateChanged()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AgentMessageValidationError{ - field: "StateChanged", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AgentMessageValidationError{ - field: "StateChanged", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetStateChanged()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AgentMessageValidationError{ - field: "StateChanged", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *AgentMessage_QanCollect: - if v == nil { - err := AgentMessageValidationError{ - field: "Payload", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetQanCollect()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AgentMessageValidationError{ - field: "QanCollect", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AgentMessageValidationError{ - field: "QanCollect", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetQanCollect()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AgentMessageValidationError{ - field: "QanCollect", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *AgentMessage_ActionResult: - if v == nil { - err := AgentMessageValidationError{ - field: "Payload", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetActionResult()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AgentMessageValidationError{ - field: "ActionResult", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AgentMessageValidationError{ - field: "ActionResult", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetActionResult()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AgentMessageValidationError{ - field: "ActionResult", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *AgentMessage_JobResult: - if v == nil { - err := AgentMessageValidationError{ - field: "Payload", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetJobResult()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AgentMessageValidationError{ - field: "JobResult", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AgentMessageValidationError{ - field: "JobResult", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetJobResult()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AgentMessageValidationError{ - field: "JobResult", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *AgentMessage_JobProgress: - if v == nil { - err := AgentMessageValidationError{ - field: "Payload", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetJobProgress()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AgentMessageValidationError{ - field: "JobProgress", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AgentMessageValidationError{ - field: "JobProgress", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetJobProgress()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AgentMessageValidationError{ - field: "JobProgress", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *AgentMessage_Pong: - if v == nil { - err := AgentMessageValidationError{ - field: "Payload", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetPong()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AgentMessageValidationError{ - field: "Pong", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AgentMessageValidationError{ - field: "Pong", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetPong()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AgentMessageValidationError{ - field: "Pong", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *AgentMessage_SetState: - if v == nil { - err := AgentMessageValidationError{ - field: "Payload", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetSetState()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AgentMessageValidationError{ - field: "SetState", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AgentMessageValidationError{ - field: "SetState", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetSetState()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AgentMessageValidationError{ - field: "SetState", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *AgentMessage_StartAction: - if v == nil { - err := AgentMessageValidationError{ - field: "Payload", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetStartAction()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AgentMessageValidationError{ - field: "StartAction", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AgentMessageValidationError{ - field: "StartAction", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetStartAction()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AgentMessageValidationError{ - field: "StartAction", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *AgentMessage_StopAction: - if v == nil { - err := AgentMessageValidationError{ - field: "Payload", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetStopAction()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AgentMessageValidationError{ - field: "StopAction", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AgentMessageValidationError{ - field: "StopAction", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetStopAction()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AgentMessageValidationError{ - field: "StopAction", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *AgentMessage_CheckConnection: - if v == nil { - err := AgentMessageValidationError{ - field: "Payload", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetCheckConnection()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AgentMessageValidationError{ - field: "CheckConnection", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AgentMessageValidationError{ - field: "CheckConnection", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetCheckConnection()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AgentMessageValidationError{ - field: "CheckConnection", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *AgentMessage_StartJob: - if v == nil { - err := AgentMessageValidationError{ - field: "Payload", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetStartJob()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AgentMessageValidationError{ - field: "StartJob", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AgentMessageValidationError{ - field: "StartJob", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetStartJob()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AgentMessageValidationError{ - field: "StartJob", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *AgentMessage_StopJob: - if v == nil { - err := AgentMessageValidationError{ - field: "Payload", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetStopJob()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AgentMessageValidationError{ - field: "StopJob", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AgentMessageValidationError{ - field: "StopJob", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetStopJob()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AgentMessageValidationError{ - field: "StopJob", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *AgentMessage_JobStatus: - if v == nil { - err := AgentMessageValidationError{ - field: "Payload", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetJobStatus()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AgentMessageValidationError{ - field: "JobStatus", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AgentMessageValidationError{ - field: "JobStatus", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetJobStatus()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AgentMessageValidationError{ - field: "JobStatus", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *AgentMessage_GetVersions: - if v == nil { - err := AgentMessageValidationError{ - field: "Payload", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetGetVersions()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AgentMessageValidationError{ - field: "GetVersions", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AgentMessageValidationError{ - field: "GetVersions", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetGetVersions()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AgentMessageValidationError{ - field: "GetVersions", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *AgentMessage_PbmSwitchPitr: - if v == nil { - err := AgentMessageValidationError{ - field: "Payload", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetPbmSwitchPitr()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AgentMessageValidationError{ - field: "PbmSwitchPitr", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AgentMessageValidationError{ - field: "PbmSwitchPitr", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetPbmSwitchPitr()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AgentMessageValidationError{ - field: "PbmSwitchPitr", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *AgentMessage_AgentLogs: - if v == nil { - err := AgentMessageValidationError{ - field: "Payload", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetAgentLogs()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AgentMessageValidationError{ - field: "AgentLogs", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AgentMessageValidationError{ - field: "AgentLogs", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetAgentLogs()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AgentMessageValidationError{ - field: "AgentLogs", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *AgentMessage_ServiceInfo: - if v == nil { - err := AgentMessageValidationError{ - field: "Payload", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetServiceInfo()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AgentMessageValidationError{ - field: "ServiceInfo", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AgentMessageValidationError{ - field: "ServiceInfo", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetServiceInfo()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AgentMessageValidationError{ - field: "ServiceInfo", - reason: "embedded message failed validation", - cause: err, - } - } - } - - default: - _ = v // ensures v is used - } - - if len(errors) > 0 { - return AgentMessageMultiError(errors) - } - - return nil -} - -// AgentMessageMultiError is an error wrapping multiple validation errors -// returned by AgentMessage.ValidateAll() if the designated constraints aren't met. -type AgentMessageMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m AgentMessageMultiError) 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 AgentMessageMultiError) AllErrors() []error { return m } - -// AgentMessageValidationError is the validation error returned by -// AgentMessage.Validate if the designated constraints aren't met. -type AgentMessageValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e AgentMessageValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e AgentMessageValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e AgentMessageValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e AgentMessageValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e AgentMessageValidationError) ErrorName() string { return "AgentMessageValidationError" } - -// Error satisfies the builtin error interface -func (e AgentMessageValidationError) 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 %sAgentMessage.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = AgentMessageValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = AgentMessageValidationError{} - -// Validate checks the field values on ServerMessage 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 *ServerMessage) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ServerMessage 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 ServerMessageMultiError, or -// nil if none found. -func (m *ServerMessage) ValidateAll() error { - return m.validate(true) -} - -func (m *ServerMessage) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Id - - if all { - switch v := interface{}(m.GetStatus()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ServerMessageValidationError{ - field: "Status", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ServerMessageValidationError{ - field: "Status", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetStatus()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ServerMessageValidationError{ - field: "Status", - reason: "embedded message failed validation", - cause: err, - } - } - } - - switch v := m.Payload.(type) { - case *ServerMessage_Pong: - if v == nil { - err := ServerMessageValidationError{ - field: "Payload", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetPong()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ServerMessageValidationError{ - field: "Pong", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ServerMessageValidationError{ - field: "Pong", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetPong()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ServerMessageValidationError{ - field: "Pong", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *ServerMessage_StateChanged: - if v == nil { - err := ServerMessageValidationError{ - field: "Payload", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetStateChanged()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ServerMessageValidationError{ - field: "StateChanged", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ServerMessageValidationError{ - field: "StateChanged", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetStateChanged()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ServerMessageValidationError{ - field: "StateChanged", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *ServerMessage_QanCollect: - if v == nil { - err := ServerMessageValidationError{ - field: "Payload", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetQanCollect()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ServerMessageValidationError{ - field: "QanCollect", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ServerMessageValidationError{ - field: "QanCollect", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetQanCollect()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ServerMessageValidationError{ - field: "QanCollect", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *ServerMessage_ActionResult: - if v == nil { - err := ServerMessageValidationError{ - field: "Payload", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetActionResult()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ServerMessageValidationError{ - field: "ActionResult", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ServerMessageValidationError{ - field: "ActionResult", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetActionResult()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ServerMessageValidationError{ - field: "ActionResult", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *ServerMessage_Ping: - if v == nil { - err := ServerMessageValidationError{ - field: "Payload", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetPing()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ServerMessageValidationError{ - field: "Ping", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ServerMessageValidationError{ - field: "Ping", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetPing()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ServerMessageValidationError{ - field: "Ping", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *ServerMessage_SetState: - if v == nil { - err := ServerMessageValidationError{ - field: "Payload", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetSetState()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ServerMessageValidationError{ - field: "SetState", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ServerMessageValidationError{ - field: "SetState", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetSetState()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ServerMessageValidationError{ - field: "SetState", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *ServerMessage_StartAction: - if v == nil { - err := ServerMessageValidationError{ - field: "Payload", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetStartAction()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ServerMessageValidationError{ - field: "StartAction", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ServerMessageValidationError{ - field: "StartAction", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetStartAction()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ServerMessageValidationError{ - field: "StartAction", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *ServerMessage_StopAction: - if v == nil { - err := ServerMessageValidationError{ - field: "Payload", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetStopAction()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ServerMessageValidationError{ - field: "StopAction", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ServerMessageValidationError{ - field: "StopAction", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetStopAction()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ServerMessageValidationError{ - field: "StopAction", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *ServerMessage_CheckConnection: - if v == nil { - err := ServerMessageValidationError{ - field: "Payload", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetCheckConnection()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ServerMessageValidationError{ - field: "CheckConnection", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ServerMessageValidationError{ - field: "CheckConnection", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetCheckConnection()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ServerMessageValidationError{ - field: "CheckConnection", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *ServerMessage_StartJob: - if v == nil { - err := ServerMessageValidationError{ - field: "Payload", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetStartJob()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ServerMessageValidationError{ - field: "StartJob", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ServerMessageValidationError{ - field: "StartJob", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetStartJob()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ServerMessageValidationError{ - field: "StartJob", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *ServerMessage_StopJob: - if v == nil { - err := ServerMessageValidationError{ - field: "Payload", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetStopJob()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ServerMessageValidationError{ - field: "StopJob", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ServerMessageValidationError{ - field: "StopJob", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetStopJob()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ServerMessageValidationError{ - field: "StopJob", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *ServerMessage_JobStatus: - if v == nil { - err := ServerMessageValidationError{ - field: "Payload", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetJobStatus()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ServerMessageValidationError{ - field: "JobStatus", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ServerMessageValidationError{ - field: "JobStatus", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetJobStatus()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ServerMessageValidationError{ - field: "JobStatus", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *ServerMessage_GetVersions: - if v == nil { - err := ServerMessageValidationError{ - field: "Payload", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetGetVersions()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ServerMessageValidationError{ - field: "GetVersions", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ServerMessageValidationError{ - field: "GetVersions", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetGetVersions()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ServerMessageValidationError{ - field: "GetVersions", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *ServerMessage_PbmSwitchPitr: - if v == nil { - err := ServerMessageValidationError{ - field: "Payload", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetPbmSwitchPitr()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ServerMessageValidationError{ - field: "PbmSwitchPitr", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ServerMessageValidationError{ - field: "PbmSwitchPitr", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetPbmSwitchPitr()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ServerMessageValidationError{ - field: "PbmSwitchPitr", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *ServerMessage_AgentLogs: - if v == nil { - err := ServerMessageValidationError{ - field: "Payload", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetAgentLogs()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ServerMessageValidationError{ - field: "AgentLogs", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ServerMessageValidationError{ - field: "AgentLogs", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetAgentLogs()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ServerMessageValidationError{ - field: "AgentLogs", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *ServerMessage_ServiceInfo: - if v == nil { - err := ServerMessageValidationError{ - field: "Payload", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetServiceInfo()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ServerMessageValidationError{ - field: "ServiceInfo", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ServerMessageValidationError{ - field: "ServiceInfo", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetServiceInfo()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ServerMessageValidationError{ - field: "ServiceInfo", - reason: "embedded message failed validation", - cause: err, - } - } - } - - default: - _ = v // ensures v is used - } - - if len(errors) > 0 { - return ServerMessageMultiError(errors) - } - - return nil -} - -// ServerMessageMultiError is an error wrapping multiple validation errors -// returned by ServerMessage.ValidateAll() if the designated constraints -// aren't met. -type ServerMessageMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ServerMessageMultiError) 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 ServerMessageMultiError) AllErrors() []error { return m } - -// ServerMessageValidationError is the validation error returned by -// ServerMessage.Validate if the designated constraints aren't met. -type ServerMessageValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ServerMessageValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ServerMessageValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ServerMessageValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ServerMessageValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ServerMessageValidationError) ErrorName() string { return "ServerMessageValidationError" } - -// Error satisfies the builtin error interface -func (e ServerMessageValidationError) 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 %sServerMessage.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ServerMessageValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ServerMessageValidationError{} - -// Validate checks the field values on SetStateRequest_AgentProcess 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 *SetStateRequest_AgentProcess) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on SetStateRequest_AgentProcess 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 -// SetStateRequest_AgentProcessMultiError, or nil if none found. -func (m *SetStateRequest_AgentProcess) ValidateAll() error { - return m.validate(true) -} - -func (m *SetStateRequest_AgentProcess) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Type - - // no validation rules for TemplateLeftDelim - - // no validation rules for TemplateRightDelim - - // no validation rules for TextFiles - - if len(errors) > 0 { - return SetStateRequest_AgentProcessMultiError(errors) - } - - return nil -} - -// SetStateRequest_AgentProcessMultiError is an error wrapping multiple -// validation errors returned by SetStateRequest_AgentProcess.ValidateAll() if -// the designated constraints aren't met. -type SetStateRequest_AgentProcessMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m SetStateRequest_AgentProcessMultiError) 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 SetStateRequest_AgentProcessMultiError) AllErrors() []error { return m } - -// SetStateRequest_AgentProcessValidationError is the validation error returned -// by SetStateRequest_AgentProcess.Validate if the designated constraints -// aren't met. -type SetStateRequest_AgentProcessValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e SetStateRequest_AgentProcessValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e SetStateRequest_AgentProcessValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e SetStateRequest_AgentProcessValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e SetStateRequest_AgentProcessValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e SetStateRequest_AgentProcessValidationError) ErrorName() string { - return "SetStateRequest_AgentProcessValidationError" -} - -// Error satisfies the builtin error interface -func (e SetStateRequest_AgentProcessValidationError) 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 %sSetStateRequest_AgentProcess.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = SetStateRequest_AgentProcessValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = SetStateRequest_AgentProcessValidationError{} - -// Validate checks the field values on SetStateRequest_BuiltinAgent 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 *SetStateRequest_BuiltinAgent) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on SetStateRequest_BuiltinAgent 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 -// SetStateRequest_BuiltinAgentMultiError, or nil if none found. -func (m *SetStateRequest_BuiltinAgent) ValidateAll() error { - return m.validate(true) -} - -func (m *SetStateRequest_BuiltinAgent) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Type - - // no validation rules for Dsn - - // no validation rules for MaxQueryLength - - // no validation rules for DisableCommentsParsing - - // no validation rules for DisableQueryExamples - - // no validation rules for MaxQueryLogSize - - if all { - switch v := interface{}(m.GetTextFiles()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, SetStateRequest_BuiltinAgentValidationError{ - field: "TextFiles", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, SetStateRequest_BuiltinAgentValidationError{ - field: "TextFiles", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetTextFiles()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return SetStateRequest_BuiltinAgentValidationError{ - field: "TextFiles", - reason: "embedded message failed validation", - cause: err, - } - } - } - - // no validation rules for Tls - - // no validation rules for TlsSkipVerify - - if len(errors) > 0 { - return SetStateRequest_BuiltinAgentMultiError(errors) - } - - return nil -} - -// SetStateRequest_BuiltinAgentMultiError is an error wrapping multiple -// validation errors returned by SetStateRequest_BuiltinAgent.ValidateAll() if -// the designated constraints aren't met. -type SetStateRequest_BuiltinAgentMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m SetStateRequest_BuiltinAgentMultiError) 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 SetStateRequest_BuiltinAgentMultiError) AllErrors() []error { return m } - -// SetStateRequest_BuiltinAgentValidationError is the validation error returned -// by SetStateRequest_BuiltinAgent.Validate if the designated constraints -// aren't met. -type SetStateRequest_BuiltinAgentValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e SetStateRequest_BuiltinAgentValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e SetStateRequest_BuiltinAgentValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e SetStateRequest_BuiltinAgentValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e SetStateRequest_BuiltinAgentValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e SetStateRequest_BuiltinAgentValidationError) ErrorName() string { - return "SetStateRequest_BuiltinAgentValidationError" -} - -// Error satisfies the builtin error interface -func (e SetStateRequest_BuiltinAgentValidationError) 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 %sSetStateRequest_BuiltinAgent.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = SetStateRequest_BuiltinAgentValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = SetStateRequest_BuiltinAgentValidationError{} - -// Validate checks the field values on StartActionRequest_MySQLExplainParams -// 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 *StartActionRequest_MySQLExplainParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on StartActionRequest_MySQLExplainParams -// 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 -// StartActionRequest_MySQLExplainParamsMultiError, or nil if none found. -func (m *StartActionRequest_MySQLExplainParams) ValidateAll() error { - return m.validate(true) -} - -func (m *StartActionRequest_MySQLExplainParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Dsn - - // no validation rules for Query - - // no validation rules for Schema - - // no validation rules for OutputFormat - - if all { - switch v := interface{}(m.GetTlsFiles()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, StartActionRequest_MySQLExplainParamsValidationError{ - field: "TlsFiles", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, StartActionRequest_MySQLExplainParamsValidationError{ - field: "TlsFiles", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetTlsFiles()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return StartActionRequest_MySQLExplainParamsValidationError{ - field: "TlsFiles", - reason: "embedded message failed validation", - cause: err, - } - } - } - - // no validation rules for TlsSkipVerify - - if len(errors) > 0 { - return StartActionRequest_MySQLExplainParamsMultiError(errors) - } - - return nil -} - -// StartActionRequest_MySQLExplainParamsMultiError is an error wrapping -// multiple validation errors returned by -// StartActionRequest_MySQLExplainParams.ValidateAll() if the designated -// constraints aren't met. -type StartActionRequest_MySQLExplainParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m StartActionRequest_MySQLExplainParamsMultiError) 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 StartActionRequest_MySQLExplainParamsMultiError) AllErrors() []error { return m } - -// StartActionRequest_MySQLExplainParamsValidationError is the validation error -// returned by StartActionRequest_MySQLExplainParams.Validate if the -// designated constraints aren't met. -type StartActionRequest_MySQLExplainParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e StartActionRequest_MySQLExplainParamsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e StartActionRequest_MySQLExplainParamsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e StartActionRequest_MySQLExplainParamsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e StartActionRequest_MySQLExplainParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e StartActionRequest_MySQLExplainParamsValidationError) ErrorName() string { - return "StartActionRequest_MySQLExplainParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e StartActionRequest_MySQLExplainParamsValidationError) 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 %sStartActionRequest_MySQLExplainParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = StartActionRequest_MySQLExplainParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = StartActionRequest_MySQLExplainParamsValidationError{} - -// Validate checks the field values on -// StartActionRequest_MySQLShowCreateTableParams 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 *StartActionRequest_MySQLShowCreateTableParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on -// StartActionRequest_MySQLShowCreateTableParams 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 -// StartActionRequest_MySQLShowCreateTableParamsMultiError, or nil if none found. -func (m *StartActionRequest_MySQLShowCreateTableParams) ValidateAll() error { - return m.validate(true) -} - -func (m *StartActionRequest_MySQLShowCreateTableParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Dsn - - // no validation rules for Table - - if all { - switch v := interface{}(m.GetTlsFiles()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, StartActionRequest_MySQLShowCreateTableParamsValidationError{ - field: "TlsFiles", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, StartActionRequest_MySQLShowCreateTableParamsValidationError{ - field: "TlsFiles", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetTlsFiles()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return StartActionRequest_MySQLShowCreateTableParamsValidationError{ - field: "TlsFiles", - reason: "embedded message failed validation", - cause: err, - } - } - } - - // no validation rules for TlsSkipVerify - - if len(errors) > 0 { - return StartActionRequest_MySQLShowCreateTableParamsMultiError(errors) - } - - return nil -} - -// StartActionRequest_MySQLShowCreateTableParamsMultiError is an error wrapping -// multiple validation errors returned by -// StartActionRequest_MySQLShowCreateTableParams.ValidateAll() if the -// designated constraints aren't met. -type StartActionRequest_MySQLShowCreateTableParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m StartActionRequest_MySQLShowCreateTableParamsMultiError) 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 StartActionRequest_MySQLShowCreateTableParamsMultiError) AllErrors() []error { return m } - -// StartActionRequest_MySQLShowCreateTableParamsValidationError is the -// validation error returned by -// StartActionRequest_MySQLShowCreateTableParams.Validate if the designated -// constraints aren't met. -type StartActionRequest_MySQLShowCreateTableParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e StartActionRequest_MySQLShowCreateTableParamsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e StartActionRequest_MySQLShowCreateTableParamsValidationError) Reason() string { - return e.reason -} - -// Cause function returns cause value. -func (e StartActionRequest_MySQLShowCreateTableParamsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e StartActionRequest_MySQLShowCreateTableParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e StartActionRequest_MySQLShowCreateTableParamsValidationError) ErrorName() string { - return "StartActionRequest_MySQLShowCreateTableParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e StartActionRequest_MySQLShowCreateTableParamsValidationError) 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 %sStartActionRequest_MySQLShowCreateTableParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = StartActionRequest_MySQLShowCreateTableParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = StartActionRequest_MySQLShowCreateTableParamsValidationError{} - -// Validate checks the field values on -// StartActionRequest_MySQLShowTableStatusParams 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 *StartActionRequest_MySQLShowTableStatusParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on -// StartActionRequest_MySQLShowTableStatusParams 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 -// StartActionRequest_MySQLShowTableStatusParamsMultiError, or nil if none found. -func (m *StartActionRequest_MySQLShowTableStatusParams) ValidateAll() error { - return m.validate(true) -} - -func (m *StartActionRequest_MySQLShowTableStatusParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Dsn - - // no validation rules for Table - - if all { - switch v := interface{}(m.GetTlsFiles()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, StartActionRequest_MySQLShowTableStatusParamsValidationError{ - field: "TlsFiles", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, StartActionRequest_MySQLShowTableStatusParamsValidationError{ - field: "TlsFiles", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetTlsFiles()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return StartActionRequest_MySQLShowTableStatusParamsValidationError{ - field: "TlsFiles", - reason: "embedded message failed validation", - cause: err, - } - } - } - - // no validation rules for TlsSkipVerify - - if len(errors) > 0 { - return StartActionRequest_MySQLShowTableStatusParamsMultiError(errors) - } - - return nil -} - -// StartActionRequest_MySQLShowTableStatusParamsMultiError is an error wrapping -// multiple validation errors returned by -// StartActionRequest_MySQLShowTableStatusParams.ValidateAll() if the -// designated constraints aren't met. -type StartActionRequest_MySQLShowTableStatusParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m StartActionRequest_MySQLShowTableStatusParamsMultiError) 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 StartActionRequest_MySQLShowTableStatusParamsMultiError) AllErrors() []error { return m } - -// StartActionRequest_MySQLShowTableStatusParamsValidationError is the -// validation error returned by -// StartActionRequest_MySQLShowTableStatusParams.Validate if the designated -// constraints aren't met. -type StartActionRequest_MySQLShowTableStatusParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e StartActionRequest_MySQLShowTableStatusParamsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e StartActionRequest_MySQLShowTableStatusParamsValidationError) Reason() string { - return e.reason -} - -// Cause function returns cause value. -func (e StartActionRequest_MySQLShowTableStatusParamsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e StartActionRequest_MySQLShowTableStatusParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e StartActionRequest_MySQLShowTableStatusParamsValidationError) ErrorName() string { - return "StartActionRequest_MySQLShowTableStatusParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e StartActionRequest_MySQLShowTableStatusParamsValidationError) 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 %sStartActionRequest_MySQLShowTableStatusParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = StartActionRequest_MySQLShowTableStatusParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = StartActionRequest_MySQLShowTableStatusParamsValidationError{} - -// Validate checks the field values on StartActionRequest_MySQLShowIndexParams -// 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 *StartActionRequest_MySQLShowIndexParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on -// StartActionRequest_MySQLShowIndexParams 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 -// StartActionRequest_MySQLShowIndexParamsMultiError, or nil if none found. -func (m *StartActionRequest_MySQLShowIndexParams) ValidateAll() error { - return m.validate(true) -} - -func (m *StartActionRequest_MySQLShowIndexParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Dsn - - // no validation rules for Table - - if all { - switch v := interface{}(m.GetTlsFiles()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, StartActionRequest_MySQLShowIndexParamsValidationError{ - field: "TlsFiles", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, StartActionRequest_MySQLShowIndexParamsValidationError{ - field: "TlsFiles", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetTlsFiles()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return StartActionRequest_MySQLShowIndexParamsValidationError{ - field: "TlsFiles", - reason: "embedded message failed validation", - cause: err, - } - } - } - - // no validation rules for TlsSkipVerify - - if len(errors) > 0 { - return StartActionRequest_MySQLShowIndexParamsMultiError(errors) - } - - return nil -} - -// StartActionRequest_MySQLShowIndexParamsMultiError is an error wrapping -// multiple validation errors returned by -// StartActionRequest_MySQLShowIndexParams.ValidateAll() if the designated -// constraints aren't met. -type StartActionRequest_MySQLShowIndexParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m StartActionRequest_MySQLShowIndexParamsMultiError) 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 StartActionRequest_MySQLShowIndexParamsMultiError) AllErrors() []error { return m } - -// StartActionRequest_MySQLShowIndexParamsValidationError is the validation -// error returned by StartActionRequest_MySQLShowIndexParams.Validate if the -// designated constraints aren't met. -type StartActionRequest_MySQLShowIndexParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e StartActionRequest_MySQLShowIndexParamsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e StartActionRequest_MySQLShowIndexParamsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e StartActionRequest_MySQLShowIndexParamsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e StartActionRequest_MySQLShowIndexParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e StartActionRequest_MySQLShowIndexParamsValidationError) ErrorName() string { - return "StartActionRequest_MySQLShowIndexParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e StartActionRequest_MySQLShowIndexParamsValidationError) 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 %sStartActionRequest_MySQLShowIndexParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = StartActionRequest_MySQLShowIndexParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = StartActionRequest_MySQLShowIndexParamsValidationError{} - -// Validate checks the field values on -// StartActionRequest_PostgreSQLShowCreateTableParams 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 *StartActionRequest_PostgreSQLShowCreateTableParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on -// StartActionRequest_PostgreSQLShowCreateTableParams 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 -// StartActionRequest_PostgreSQLShowCreateTableParamsMultiError, or nil if -// none found. -func (m *StartActionRequest_PostgreSQLShowCreateTableParams) ValidateAll() error { - return m.validate(true) -} - -func (m *StartActionRequest_PostgreSQLShowCreateTableParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Dsn - - // no validation rules for Table - - if all { - switch v := interface{}(m.GetTlsFiles()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, StartActionRequest_PostgreSQLShowCreateTableParamsValidationError{ - field: "TlsFiles", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, StartActionRequest_PostgreSQLShowCreateTableParamsValidationError{ - field: "TlsFiles", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetTlsFiles()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return StartActionRequest_PostgreSQLShowCreateTableParamsValidationError{ - field: "TlsFiles", - reason: "embedded message failed validation", - cause: err, - } - } - } - - // no validation rules for TlsSkipVerify - - if len(errors) > 0 { - return StartActionRequest_PostgreSQLShowCreateTableParamsMultiError(errors) - } - - return nil -} - -// StartActionRequest_PostgreSQLShowCreateTableParamsMultiError is an error -// wrapping multiple validation errors returned by -// StartActionRequest_PostgreSQLShowCreateTableParams.ValidateAll() if the -// designated constraints aren't met. -type StartActionRequest_PostgreSQLShowCreateTableParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m StartActionRequest_PostgreSQLShowCreateTableParamsMultiError) 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 StartActionRequest_PostgreSQLShowCreateTableParamsMultiError) AllErrors() []error { return m } - -// StartActionRequest_PostgreSQLShowCreateTableParamsValidationError is the -// validation error returned by -// StartActionRequest_PostgreSQLShowCreateTableParams.Validate if the -// designated constraints aren't met. -type StartActionRequest_PostgreSQLShowCreateTableParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e StartActionRequest_PostgreSQLShowCreateTableParamsValidationError) Field() string { - return e.field -} - -// Reason function returns reason value. -func (e StartActionRequest_PostgreSQLShowCreateTableParamsValidationError) Reason() string { - return e.reason -} - -// Cause function returns cause value. -func (e StartActionRequest_PostgreSQLShowCreateTableParamsValidationError) Cause() error { - return e.cause -} - -// Key function returns key value. -func (e StartActionRequest_PostgreSQLShowCreateTableParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e StartActionRequest_PostgreSQLShowCreateTableParamsValidationError) ErrorName() string { - return "StartActionRequest_PostgreSQLShowCreateTableParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e StartActionRequest_PostgreSQLShowCreateTableParamsValidationError) 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 %sStartActionRequest_PostgreSQLShowCreateTableParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = StartActionRequest_PostgreSQLShowCreateTableParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = StartActionRequest_PostgreSQLShowCreateTableParamsValidationError{} - -// Validate checks the field values on -// StartActionRequest_PostgreSQLShowIndexParams 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 *StartActionRequest_PostgreSQLShowIndexParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on -// StartActionRequest_PostgreSQLShowIndexParams 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 -// StartActionRequest_PostgreSQLShowIndexParamsMultiError, or nil if none found. -func (m *StartActionRequest_PostgreSQLShowIndexParams) ValidateAll() error { - return m.validate(true) -} - -func (m *StartActionRequest_PostgreSQLShowIndexParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Dsn - - // no validation rules for Table - - if all { - switch v := interface{}(m.GetTlsFiles()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, StartActionRequest_PostgreSQLShowIndexParamsValidationError{ - field: "TlsFiles", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, StartActionRequest_PostgreSQLShowIndexParamsValidationError{ - field: "TlsFiles", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetTlsFiles()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return StartActionRequest_PostgreSQLShowIndexParamsValidationError{ - field: "TlsFiles", - reason: "embedded message failed validation", - cause: err, - } - } - } - - // no validation rules for TlsSkipVerify - - if len(errors) > 0 { - return StartActionRequest_PostgreSQLShowIndexParamsMultiError(errors) - } - - return nil -} - -// StartActionRequest_PostgreSQLShowIndexParamsMultiError is an error wrapping -// multiple validation errors returned by -// StartActionRequest_PostgreSQLShowIndexParams.ValidateAll() if the -// designated constraints aren't met. -type StartActionRequest_PostgreSQLShowIndexParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m StartActionRequest_PostgreSQLShowIndexParamsMultiError) 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 StartActionRequest_PostgreSQLShowIndexParamsMultiError) AllErrors() []error { return m } - -// StartActionRequest_PostgreSQLShowIndexParamsValidationError is the -// validation error returned by -// StartActionRequest_PostgreSQLShowIndexParams.Validate if the designated -// constraints aren't met. -type StartActionRequest_PostgreSQLShowIndexParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e StartActionRequest_PostgreSQLShowIndexParamsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e StartActionRequest_PostgreSQLShowIndexParamsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e StartActionRequest_PostgreSQLShowIndexParamsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e StartActionRequest_PostgreSQLShowIndexParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e StartActionRequest_PostgreSQLShowIndexParamsValidationError) ErrorName() string { - return "StartActionRequest_PostgreSQLShowIndexParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e StartActionRequest_PostgreSQLShowIndexParamsValidationError) 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 %sStartActionRequest_PostgreSQLShowIndexParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = StartActionRequest_PostgreSQLShowIndexParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = StartActionRequest_PostgreSQLShowIndexParamsValidationError{} - -// Validate checks the field values on StartActionRequest_MongoDBExplainParams -// 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 *StartActionRequest_MongoDBExplainParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on -// StartActionRequest_MongoDBExplainParams 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 -// StartActionRequest_MongoDBExplainParamsMultiError, or nil if none found. -func (m *StartActionRequest_MongoDBExplainParams) ValidateAll() error { - return m.validate(true) -} - -func (m *StartActionRequest_MongoDBExplainParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Dsn - - // no validation rules for Query - - if all { - switch v := interface{}(m.GetTextFiles()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, StartActionRequest_MongoDBExplainParamsValidationError{ - field: "TextFiles", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, StartActionRequest_MongoDBExplainParamsValidationError{ - field: "TextFiles", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetTextFiles()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return StartActionRequest_MongoDBExplainParamsValidationError{ - field: "TextFiles", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if len(errors) > 0 { - return StartActionRequest_MongoDBExplainParamsMultiError(errors) - } - - return nil -} - -// StartActionRequest_MongoDBExplainParamsMultiError is an error wrapping -// multiple validation errors returned by -// StartActionRequest_MongoDBExplainParams.ValidateAll() if the designated -// constraints aren't met. -type StartActionRequest_MongoDBExplainParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m StartActionRequest_MongoDBExplainParamsMultiError) 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 StartActionRequest_MongoDBExplainParamsMultiError) AllErrors() []error { return m } - -// StartActionRequest_MongoDBExplainParamsValidationError is the validation -// error returned by StartActionRequest_MongoDBExplainParams.Validate if the -// designated constraints aren't met. -type StartActionRequest_MongoDBExplainParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e StartActionRequest_MongoDBExplainParamsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e StartActionRequest_MongoDBExplainParamsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e StartActionRequest_MongoDBExplainParamsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e StartActionRequest_MongoDBExplainParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e StartActionRequest_MongoDBExplainParamsValidationError) ErrorName() string { - return "StartActionRequest_MongoDBExplainParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e StartActionRequest_MongoDBExplainParamsValidationError) 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 %sStartActionRequest_MongoDBExplainParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = StartActionRequest_MongoDBExplainParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = StartActionRequest_MongoDBExplainParamsValidationError{} - -// Validate checks the field values on StartActionRequest_PTSummaryParams 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 *StartActionRequest_PTSummaryParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on StartActionRequest_PTSummaryParams -// 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 -// StartActionRequest_PTSummaryParamsMultiError, or nil if none found. -func (m *StartActionRequest_PTSummaryParams) ValidateAll() error { - return m.validate(true) -} - -func (m *StartActionRequest_PTSummaryParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return StartActionRequest_PTSummaryParamsMultiError(errors) - } - - return nil -} - -// StartActionRequest_PTSummaryParamsMultiError is an error wrapping multiple -// validation errors returned by -// StartActionRequest_PTSummaryParams.ValidateAll() if the designated -// constraints aren't met. -type StartActionRequest_PTSummaryParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m StartActionRequest_PTSummaryParamsMultiError) 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 StartActionRequest_PTSummaryParamsMultiError) AllErrors() []error { return m } - -// StartActionRequest_PTSummaryParamsValidationError is the validation error -// returned by StartActionRequest_PTSummaryParams.Validate if the designated -// constraints aren't met. -type StartActionRequest_PTSummaryParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e StartActionRequest_PTSummaryParamsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e StartActionRequest_PTSummaryParamsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e StartActionRequest_PTSummaryParamsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e StartActionRequest_PTSummaryParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e StartActionRequest_PTSummaryParamsValidationError) ErrorName() string { - return "StartActionRequest_PTSummaryParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e StartActionRequest_PTSummaryParamsValidationError) 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 %sStartActionRequest_PTSummaryParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = StartActionRequest_PTSummaryParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = StartActionRequest_PTSummaryParamsValidationError{} - -// Validate checks the field values on StartActionRequest_PTPgSummaryParams -// 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 *StartActionRequest_PTPgSummaryParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on StartActionRequest_PTPgSummaryParams -// 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 -// StartActionRequest_PTPgSummaryParamsMultiError, or nil if none found. -func (m *StartActionRequest_PTPgSummaryParams) ValidateAll() error { - return m.validate(true) -} - -func (m *StartActionRequest_PTPgSummaryParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Host - - // no validation rules for Port - - // no validation rules for Username - - // no validation rules for Password - - if len(errors) > 0 { - return StartActionRequest_PTPgSummaryParamsMultiError(errors) - } - - return nil -} - -// StartActionRequest_PTPgSummaryParamsMultiError is an error wrapping multiple -// validation errors returned by -// StartActionRequest_PTPgSummaryParams.ValidateAll() if the designated -// constraints aren't met. -type StartActionRequest_PTPgSummaryParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m StartActionRequest_PTPgSummaryParamsMultiError) 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 StartActionRequest_PTPgSummaryParamsMultiError) AllErrors() []error { return m } - -// StartActionRequest_PTPgSummaryParamsValidationError is the validation error -// returned by StartActionRequest_PTPgSummaryParams.Validate if the designated -// constraints aren't met. -type StartActionRequest_PTPgSummaryParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e StartActionRequest_PTPgSummaryParamsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e StartActionRequest_PTPgSummaryParamsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e StartActionRequest_PTPgSummaryParamsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e StartActionRequest_PTPgSummaryParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e StartActionRequest_PTPgSummaryParamsValidationError) ErrorName() string { - return "StartActionRequest_PTPgSummaryParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e StartActionRequest_PTPgSummaryParamsValidationError) 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 %sStartActionRequest_PTPgSummaryParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = StartActionRequest_PTPgSummaryParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = StartActionRequest_PTPgSummaryParamsValidationError{} - -// Validate checks the field values on -// StartActionRequest_PTMongoDBSummaryParams 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 *StartActionRequest_PTMongoDBSummaryParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on -// StartActionRequest_PTMongoDBSummaryParams 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 -// StartActionRequest_PTMongoDBSummaryParamsMultiError, or nil if none found. -func (m *StartActionRequest_PTMongoDBSummaryParams) ValidateAll() error { - return m.validate(true) -} - -func (m *StartActionRequest_PTMongoDBSummaryParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Host - - // no validation rules for Port - - // no validation rules for Username - - // no validation rules for Password - - if len(errors) > 0 { - return StartActionRequest_PTMongoDBSummaryParamsMultiError(errors) - } - - return nil -} - -// StartActionRequest_PTMongoDBSummaryParamsMultiError is an error wrapping -// multiple validation errors returned by -// StartActionRequest_PTMongoDBSummaryParams.ValidateAll() if the designated -// constraints aren't met. -type StartActionRequest_PTMongoDBSummaryParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m StartActionRequest_PTMongoDBSummaryParamsMultiError) 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 StartActionRequest_PTMongoDBSummaryParamsMultiError) AllErrors() []error { return m } - -// StartActionRequest_PTMongoDBSummaryParamsValidationError is the validation -// error returned by StartActionRequest_PTMongoDBSummaryParams.Validate if the -// designated constraints aren't met. -type StartActionRequest_PTMongoDBSummaryParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e StartActionRequest_PTMongoDBSummaryParamsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e StartActionRequest_PTMongoDBSummaryParamsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e StartActionRequest_PTMongoDBSummaryParamsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e StartActionRequest_PTMongoDBSummaryParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e StartActionRequest_PTMongoDBSummaryParamsValidationError) ErrorName() string { - return "StartActionRequest_PTMongoDBSummaryParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e StartActionRequest_PTMongoDBSummaryParamsValidationError) 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 %sStartActionRequest_PTMongoDBSummaryParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = StartActionRequest_PTMongoDBSummaryParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = StartActionRequest_PTMongoDBSummaryParamsValidationError{} - -// Validate checks the field values on StartActionRequest_PTMySQLSummaryParams -// 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 *StartActionRequest_PTMySQLSummaryParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on -// StartActionRequest_PTMySQLSummaryParams 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 -// StartActionRequest_PTMySQLSummaryParamsMultiError, or nil if none found. -func (m *StartActionRequest_PTMySQLSummaryParams) ValidateAll() error { - return m.validate(true) -} - -func (m *StartActionRequest_PTMySQLSummaryParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Host - - // no validation rules for Port - - // no validation rules for Socket - - // no validation rules for Username - - // no validation rules for Password - - if len(errors) > 0 { - return StartActionRequest_PTMySQLSummaryParamsMultiError(errors) - } - - return nil -} - -// StartActionRequest_PTMySQLSummaryParamsMultiError is an error wrapping -// multiple validation errors returned by -// StartActionRequest_PTMySQLSummaryParams.ValidateAll() if the designated -// constraints aren't met. -type StartActionRequest_PTMySQLSummaryParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m StartActionRequest_PTMySQLSummaryParamsMultiError) 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 StartActionRequest_PTMySQLSummaryParamsMultiError) AllErrors() []error { return m } - -// StartActionRequest_PTMySQLSummaryParamsValidationError is the validation -// error returned by StartActionRequest_PTMySQLSummaryParams.Validate if the -// designated constraints aren't met. -type StartActionRequest_PTMySQLSummaryParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e StartActionRequest_PTMySQLSummaryParamsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e StartActionRequest_PTMySQLSummaryParamsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e StartActionRequest_PTMySQLSummaryParamsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e StartActionRequest_PTMySQLSummaryParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e StartActionRequest_PTMySQLSummaryParamsValidationError) ErrorName() string { - return "StartActionRequest_PTMySQLSummaryParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e StartActionRequest_PTMySQLSummaryParamsValidationError) 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 %sStartActionRequest_PTMySQLSummaryParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = StartActionRequest_PTMySQLSummaryParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = StartActionRequest_PTMySQLSummaryParamsValidationError{} - -// Validate checks the field values on StartActionRequest_MySQLQueryShowParams -// 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 *StartActionRequest_MySQLQueryShowParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on -// StartActionRequest_MySQLQueryShowParams 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 -// StartActionRequest_MySQLQueryShowParamsMultiError, or nil if none found. -func (m *StartActionRequest_MySQLQueryShowParams) ValidateAll() error { - return m.validate(true) -} - -func (m *StartActionRequest_MySQLQueryShowParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Dsn - - // no validation rules for Query - - if all { - switch v := interface{}(m.GetTlsFiles()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, StartActionRequest_MySQLQueryShowParamsValidationError{ - field: "TlsFiles", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, StartActionRequest_MySQLQueryShowParamsValidationError{ - field: "TlsFiles", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetTlsFiles()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return StartActionRequest_MySQLQueryShowParamsValidationError{ - field: "TlsFiles", - reason: "embedded message failed validation", - cause: err, - } - } - } - - // no validation rules for TlsSkipVerify - - if len(errors) > 0 { - return StartActionRequest_MySQLQueryShowParamsMultiError(errors) - } - - return nil -} - -// StartActionRequest_MySQLQueryShowParamsMultiError is an error wrapping -// multiple validation errors returned by -// StartActionRequest_MySQLQueryShowParams.ValidateAll() if the designated -// constraints aren't met. -type StartActionRequest_MySQLQueryShowParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m StartActionRequest_MySQLQueryShowParamsMultiError) 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 StartActionRequest_MySQLQueryShowParamsMultiError) AllErrors() []error { return m } - -// StartActionRequest_MySQLQueryShowParamsValidationError is the validation -// error returned by StartActionRequest_MySQLQueryShowParams.Validate if the -// designated constraints aren't met. -type StartActionRequest_MySQLQueryShowParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e StartActionRequest_MySQLQueryShowParamsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e StartActionRequest_MySQLQueryShowParamsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e StartActionRequest_MySQLQueryShowParamsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e StartActionRequest_MySQLQueryShowParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e StartActionRequest_MySQLQueryShowParamsValidationError) ErrorName() string { - return "StartActionRequest_MySQLQueryShowParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e StartActionRequest_MySQLQueryShowParamsValidationError) 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 %sStartActionRequest_MySQLQueryShowParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = StartActionRequest_MySQLQueryShowParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = StartActionRequest_MySQLQueryShowParamsValidationError{} - -// Validate checks the field values on -// StartActionRequest_MySQLQuerySelectParams 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 *StartActionRequest_MySQLQuerySelectParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on -// StartActionRequest_MySQLQuerySelectParams 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 -// StartActionRequest_MySQLQuerySelectParamsMultiError, or nil if none found. -func (m *StartActionRequest_MySQLQuerySelectParams) ValidateAll() error { - return m.validate(true) -} - -func (m *StartActionRequest_MySQLQuerySelectParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Dsn - - // no validation rules for Query - - if all { - switch v := interface{}(m.GetTlsFiles()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, StartActionRequest_MySQLQuerySelectParamsValidationError{ - field: "TlsFiles", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, StartActionRequest_MySQLQuerySelectParamsValidationError{ - field: "TlsFiles", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetTlsFiles()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return StartActionRequest_MySQLQuerySelectParamsValidationError{ - field: "TlsFiles", - reason: "embedded message failed validation", - cause: err, - } - } - } - - // no validation rules for TlsSkipVerify - - if len(errors) > 0 { - return StartActionRequest_MySQLQuerySelectParamsMultiError(errors) - } - - return nil -} - -// StartActionRequest_MySQLQuerySelectParamsMultiError is an error wrapping -// multiple validation errors returned by -// StartActionRequest_MySQLQuerySelectParams.ValidateAll() if the designated -// constraints aren't met. -type StartActionRequest_MySQLQuerySelectParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m StartActionRequest_MySQLQuerySelectParamsMultiError) 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 StartActionRequest_MySQLQuerySelectParamsMultiError) AllErrors() []error { return m } - -// StartActionRequest_MySQLQuerySelectParamsValidationError is the validation -// error returned by StartActionRequest_MySQLQuerySelectParams.Validate if the -// designated constraints aren't met. -type StartActionRequest_MySQLQuerySelectParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e StartActionRequest_MySQLQuerySelectParamsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e StartActionRequest_MySQLQuerySelectParamsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e StartActionRequest_MySQLQuerySelectParamsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e StartActionRequest_MySQLQuerySelectParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e StartActionRequest_MySQLQuerySelectParamsValidationError) ErrorName() string { - return "StartActionRequest_MySQLQuerySelectParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e StartActionRequest_MySQLQuerySelectParamsValidationError) 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 %sStartActionRequest_MySQLQuerySelectParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = StartActionRequest_MySQLQuerySelectParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = StartActionRequest_MySQLQuerySelectParamsValidationError{} - -// Validate checks the field values on -// StartActionRequest_PostgreSQLQueryShowParams 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 *StartActionRequest_PostgreSQLQueryShowParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on -// StartActionRequest_PostgreSQLQueryShowParams 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 -// StartActionRequest_PostgreSQLQueryShowParamsMultiError, or nil if none found. -func (m *StartActionRequest_PostgreSQLQueryShowParams) ValidateAll() error { - return m.validate(true) -} - -func (m *StartActionRequest_PostgreSQLQueryShowParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Dsn - - if all { - switch v := interface{}(m.GetTlsFiles()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, StartActionRequest_PostgreSQLQueryShowParamsValidationError{ - field: "TlsFiles", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, StartActionRequest_PostgreSQLQueryShowParamsValidationError{ - field: "TlsFiles", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetTlsFiles()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return StartActionRequest_PostgreSQLQueryShowParamsValidationError{ - field: "TlsFiles", - reason: "embedded message failed validation", - cause: err, - } - } - } - - // no validation rules for TlsSkipVerify - - if len(errors) > 0 { - return StartActionRequest_PostgreSQLQueryShowParamsMultiError(errors) - } - - return nil -} - -// StartActionRequest_PostgreSQLQueryShowParamsMultiError is an error wrapping -// multiple validation errors returned by -// StartActionRequest_PostgreSQLQueryShowParams.ValidateAll() if the -// designated constraints aren't met. -type StartActionRequest_PostgreSQLQueryShowParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m StartActionRequest_PostgreSQLQueryShowParamsMultiError) 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 StartActionRequest_PostgreSQLQueryShowParamsMultiError) AllErrors() []error { return m } - -// StartActionRequest_PostgreSQLQueryShowParamsValidationError is the -// validation error returned by -// StartActionRequest_PostgreSQLQueryShowParams.Validate if the designated -// constraints aren't met. -type StartActionRequest_PostgreSQLQueryShowParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e StartActionRequest_PostgreSQLQueryShowParamsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e StartActionRequest_PostgreSQLQueryShowParamsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e StartActionRequest_PostgreSQLQueryShowParamsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e StartActionRequest_PostgreSQLQueryShowParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e StartActionRequest_PostgreSQLQueryShowParamsValidationError) ErrorName() string { - return "StartActionRequest_PostgreSQLQueryShowParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e StartActionRequest_PostgreSQLQueryShowParamsValidationError) 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 %sStartActionRequest_PostgreSQLQueryShowParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = StartActionRequest_PostgreSQLQueryShowParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = StartActionRequest_PostgreSQLQueryShowParamsValidationError{} - -// Validate checks the field values on -// StartActionRequest_PostgreSQLQuerySelectParams 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 *StartActionRequest_PostgreSQLQuerySelectParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on -// StartActionRequest_PostgreSQLQuerySelectParams 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 -// StartActionRequest_PostgreSQLQuerySelectParamsMultiError, or nil if none found. -func (m *StartActionRequest_PostgreSQLQuerySelectParams) ValidateAll() error { - return m.validate(true) -} - -func (m *StartActionRequest_PostgreSQLQuerySelectParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Dsn - - // no validation rules for Query - - if all { - switch v := interface{}(m.GetTlsFiles()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, StartActionRequest_PostgreSQLQuerySelectParamsValidationError{ - field: "TlsFiles", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, StartActionRequest_PostgreSQLQuerySelectParamsValidationError{ - field: "TlsFiles", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetTlsFiles()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return StartActionRequest_PostgreSQLQuerySelectParamsValidationError{ - field: "TlsFiles", - reason: "embedded message failed validation", - cause: err, - } - } - } - - // no validation rules for TlsSkipVerify - - if len(errors) > 0 { - return StartActionRequest_PostgreSQLQuerySelectParamsMultiError(errors) - } - - return nil -} - -// StartActionRequest_PostgreSQLQuerySelectParamsMultiError is an error -// wrapping multiple validation errors returned by -// StartActionRequest_PostgreSQLQuerySelectParams.ValidateAll() if the -// designated constraints aren't met. -type StartActionRequest_PostgreSQLQuerySelectParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m StartActionRequest_PostgreSQLQuerySelectParamsMultiError) 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 StartActionRequest_PostgreSQLQuerySelectParamsMultiError) AllErrors() []error { return m } - -// StartActionRequest_PostgreSQLQuerySelectParamsValidationError is the -// validation error returned by -// StartActionRequest_PostgreSQLQuerySelectParams.Validate if the designated -// constraints aren't met. -type StartActionRequest_PostgreSQLQuerySelectParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e StartActionRequest_PostgreSQLQuerySelectParamsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e StartActionRequest_PostgreSQLQuerySelectParamsValidationError) Reason() string { - return e.reason -} - -// Cause function returns cause value. -func (e StartActionRequest_PostgreSQLQuerySelectParamsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e StartActionRequest_PostgreSQLQuerySelectParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e StartActionRequest_PostgreSQLQuerySelectParamsValidationError) ErrorName() string { - return "StartActionRequest_PostgreSQLQuerySelectParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e StartActionRequest_PostgreSQLQuerySelectParamsValidationError) 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 %sStartActionRequest_PostgreSQLQuerySelectParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = StartActionRequest_PostgreSQLQuerySelectParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = StartActionRequest_PostgreSQLQuerySelectParamsValidationError{} - -// Validate checks the field values on -// StartActionRequest_MongoDBQueryGetParameterParams 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 *StartActionRequest_MongoDBQueryGetParameterParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on -// StartActionRequest_MongoDBQueryGetParameterParams 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 -// StartActionRequest_MongoDBQueryGetParameterParamsMultiError, or nil if none found. -func (m *StartActionRequest_MongoDBQueryGetParameterParams) ValidateAll() error { - return m.validate(true) -} - -func (m *StartActionRequest_MongoDBQueryGetParameterParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Dsn - - if all { - switch v := interface{}(m.GetTextFiles()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, StartActionRequest_MongoDBQueryGetParameterParamsValidationError{ - field: "TextFiles", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, StartActionRequest_MongoDBQueryGetParameterParamsValidationError{ - field: "TextFiles", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetTextFiles()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return StartActionRequest_MongoDBQueryGetParameterParamsValidationError{ - field: "TextFiles", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if len(errors) > 0 { - return StartActionRequest_MongoDBQueryGetParameterParamsMultiError(errors) - } - - return nil -} - -// StartActionRequest_MongoDBQueryGetParameterParamsMultiError is an error -// wrapping multiple validation errors returned by -// StartActionRequest_MongoDBQueryGetParameterParams.ValidateAll() if the -// designated constraints aren't met. -type StartActionRequest_MongoDBQueryGetParameterParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m StartActionRequest_MongoDBQueryGetParameterParamsMultiError) 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 StartActionRequest_MongoDBQueryGetParameterParamsMultiError) AllErrors() []error { return m } - -// StartActionRequest_MongoDBQueryGetParameterParamsValidationError is the -// validation error returned by -// StartActionRequest_MongoDBQueryGetParameterParams.Validate if the -// designated constraints aren't met. -type StartActionRequest_MongoDBQueryGetParameterParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e StartActionRequest_MongoDBQueryGetParameterParamsValidationError) Field() string { - return e.field -} - -// Reason function returns reason value. -func (e StartActionRequest_MongoDBQueryGetParameterParamsValidationError) Reason() string { - return e.reason -} - -// Cause function returns cause value. -func (e StartActionRequest_MongoDBQueryGetParameterParamsValidationError) Cause() error { - return e.cause -} - -// Key function returns key value. -func (e StartActionRequest_MongoDBQueryGetParameterParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e StartActionRequest_MongoDBQueryGetParameterParamsValidationError) ErrorName() string { - return "StartActionRequest_MongoDBQueryGetParameterParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e StartActionRequest_MongoDBQueryGetParameterParamsValidationError) 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 %sStartActionRequest_MongoDBQueryGetParameterParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = StartActionRequest_MongoDBQueryGetParameterParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = StartActionRequest_MongoDBQueryGetParameterParamsValidationError{} - -// Validate checks the field values on -// StartActionRequest_MongoDBQueryBuildInfoParams 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 *StartActionRequest_MongoDBQueryBuildInfoParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on -// StartActionRequest_MongoDBQueryBuildInfoParams 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 -// StartActionRequest_MongoDBQueryBuildInfoParamsMultiError, or nil if none found. -func (m *StartActionRequest_MongoDBQueryBuildInfoParams) ValidateAll() error { - return m.validate(true) -} - -func (m *StartActionRequest_MongoDBQueryBuildInfoParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Dsn - - if all { - switch v := interface{}(m.GetTextFiles()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, StartActionRequest_MongoDBQueryBuildInfoParamsValidationError{ - field: "TextFiles", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, StartActionRequest_MongoDBQueryBuildInfoParamsValidationError{ - field: "TextFiles", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetTextFiles()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return StartActionRequest_MongoDBQueryBuildInfoParamsValidationError{ - field: "TextFiles", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if len(errors) > 0 { - return StartActionRequest_MongoDBQueryBuildInfoParamsMultiError(errors) - } - - return nil -} - -// StartActionRequest_MongoDBQueryBuildInfoParamsMultiError is an error -// wrapping multiple validation errors returned by -// StartActionRequest_MongoDBQueryBuildInfoParams.ValidateAll() if the -// designated constraints aren't met. -type StartActionRequest_MongoDBQueryBuildInfoParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m StartActionRequest_MongoDBQueryBuildInfoParamsMultiError) 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 StartActionRequest_MongoDBQueryBuildInfoParamsMultiError) AllErrors() []error { return m } - -// StartActionRequest_MongoDBQueryBuildInfoParamsValidationError is the -// validation error returned by -// StartActionRequest_MongoDBQueryBuildInfoParams.Validate if the designated -// constraints aren't met. -type StartActionRequest_MongoDBQueryBuildInfoParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e StartActionRequest_MongoDBQueryBuildInfoParamsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e StartActionRequest_MongoDBQueryBuildInfoParamsValidationError) Reason() string { - return e.reason -} - -// Cause function returns cause value. -func (e StartActionRequest_MongoDBQueryBuildInfoParamsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e StartActionRequest_MongoDBQueryBuildInfoParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e StartActionRequest_MongoDBQueryBuildInfoParamsValidationError) ErrorName() string { - return "StartActionRequest_MongoDBQueryBuildInfoParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e StartActionRequest_MongoDBQueryBuildInfoParamsValidationError) 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 %sStartActionRequest_MongoDBQueryBuildInfoParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = StartActionRequest_MongoDBQueryBuildInfoParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = StartActionRequest_MongoDBQueryBuildInfoParamsValidationError{} - -// Validate checks the field values on -// StartActionRequest_MongoDBQueryGetCmdLineOptsParams 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 *StartActionRequest_MongoDBQueryGetCmdLineOptsParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on -// StartActionRequest_MongoDBQueryGetCmdLineOptsParams 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 -// StartActionRequest_MongoDBQueryGetCmdLineOptsParamsMultiError, or nil if -// none found. -func (m *StartActionRequest_MongoDBQueryGetCmdLineOptsParams) ValidateAll() error { - return m.validate(true) -} - -func (m *StartActionRequest_MongoDBQueryGetCmdLineOptsParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Dsn - - if all { - switch v := interface{}(m.GetTextFiles()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, StartActionRequest_MongoDBQueryGetCmdLineOptsParamsValidationError{ - field: "TextFiles", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, StartActionRequest_MongoDBQueryGetCmdLineOptsParamsValidationError{ - field: "TextFiles", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetTextFiles()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return StartActionRequest_MongoDBQueryGetCmdLineOptsParamsValidationError{ - field: "TextFiles", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if len(errors) > 0 { - return StartActionRequest_MongoDBQueryGetCmdLineOptsParamsMultiError(errors) - } - - return nil -} - -// StartActionRequest_MongoDBQueryGetCmdLineOptsParamsMultiError is an error -// wrapping multiple validation errors returned by -// StartActionRequest_MongoDBQueryGetCmdLineOptsParams.ValidateAll() if the -// designated constraints aren't met. -type StartActionRequest_MongoDBQueryGetCmdLineOptsParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m StartActionRequest_MongoDBQueryGetCmdLineOptsParamsMultiError) 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 StartActionRequest_MongoDBQueryGetCmdLineOptsParamsMultiError) AllErrors() []error { return m } - -// StartActionRequest_MongoDBQueryGetCmdLineOptsParamsValidationError is the -// validation error returned by -// StartActionRequest_MongoDBQueryGetCmdLineOptsParams.Validate if the -// designated constraints aren't met. -type StartActionRequest_MongoDBQueryGetCmdLineOptsParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e StartActionRequest_MongoDBQueryGetCmdLineOptsParamsValidationError) Field() string { - return e.field -} - -// Reason function returns reason value. -func (e StartActionRequest_MongoDBQueryGetCmdLineOptsParamsValidationError) Reason() string { - return e.reason -} - -// Cause function returns cause value. -func (e StartActionRequest_MongoDBQueryGetCmdLineOptsParamsValidationError) Cause() error { - return e.cause -} - -// Key function returns key value. -func (e StartActionRequest_MongoDBQueryGetCmdLineOptsParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e StartActionRequest_MongoDBQueryGetCmdLineOptsParamsValidationError) ErrorName() string { - return "StartActionRequest_MongoDBQueryGetCmdLineOptsParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e StartActionRequest_MongoDBQueryGetCmdLineOptsParamsValidationError) 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 %sStartActionRequest_MongoDBQueryGetCmdLineOptsParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = StartActionRequest_MongoDBQueryGetCmdLineOptsParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = StartActionRequest_MongoDBQueryGetCmdLineOptsParamsValidationError{} - -// Validate checks the field values on -// StartActionRequest_MongoDBQueryReplSetGetStatusParams 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 *StartActionRequest_MongoDBQueryReplSetGetStatusParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on -// StartActionRequest_MongoDBQueryReplSetGetStatusParams 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 -// StartActionRequest_MongoDBQueryReplSetGetStatusParamsMultiError, or nil if -// none found. -func (m *StartActionRequest_MongoDBQueryReplSetGetStatusParams) ValidateAll() error { - return m.validate(true) -} - -func (m *StartActionRequest_MongoDBQueryReplSetGetStatusParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Dsn - - if all { - switch v := interface{}(m.GetTextFiles()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, StartActionRequest_MongoDBQueryReplSetGetStatusParamsValidationError{ - field: "TextFiles", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, StartActionRequest_MongoDBQueryReplSetGetStatusParamsValidationError{ - field: "TextFiles", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetTextFiles()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return StartActionRequest_MongoDBQueryReplSetGetStatusParamsValidationError{ - field: "TextFiles", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if len(errors) > 0 { - return StartActionRequest_MongoDBQueryReplSetGetStatusParamsMultiError(errors) - } - - return nil -} - -// StartActionRequest_MongoDBQueryReplSetGetStatusParamsMultiError is an error -// wrapping multiple validation errors returned by -// StartActionRequest_MongoDBQueryReplSetGetStatusParams.ValidateAll() if the -// designated constraints aren't met. -type StartActionRequest_MongoDBQueryReplSetGetStatusParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m StartActionRequest_MongoDBQueryReplSetGetStatusParamsMultiError) 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 StartActionRequest_MongoDBQueryReplSetGetStatusParamsMultiError) AllErrors() []error { - return m -} - -// StartActionRequest_MongoDBQueryReplSetGetStatusParamsValidationError is the -// validation error returned by -// StartActionRequest_MongoDBQueryReplSetGetStatusParams.Validate if the -// designated constraints aren't met. -type StartActionRequest_MongoDBQueryReplSetGetStatusParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e StartActionRequest_MongoDBQueryReplSetGetStatusParamsValidationError) Field() string { - return e.field -} - -// Reason function returns reason value. -func (e StartActionRequest_MongoDBQueryReplSetGetStatusParamsValidationError) Reason() string { - return e.reason -} - -// Cause function returns cause value. -func (e StartActionRequest_MongoDBQueryReplSetGetStatusParamsValidationError) Cause() error { - return e.cause -} - -// Key function returns key value. -func (e StartActionRequest_MongoDBQueryReplSetGetStatusParamsValidationError) Key() bool { - return e.key -} - -// ErrorName returns error name. -func (e StartActionRequest_MongoDBQueryReplSetGetStatusParamsValidationError) ErrorName() string { - return "StartActionRequest_MongoDBQueryReplSetGetStatusParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e StartActionRequest_MongoDBQueryReplSetGetStatusParamsValidationError) 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 %sStartActionRequest_MongoDBQueryReplSetGetStatusParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = StartActionRequest_MongoDBQueryReplSetGetStatusParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = StartActionRequest_MongoDBQueryReplSetGetStatusParamsValidationError{} - -// Validate checks the field values on -// StartActionRequest_MongoDBQueryGetDiagnosticDataParams 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 *StartActionRequest_MongoDBQueryGetDiagnosticDataParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on -// StartActionRequest_MongoDBQueryGetDiagnosticDataParams 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 -// StartActionRequest_MongoDBQueryGetDiagnosticDataParamsMultiError, or nil if -// none found. -func (m *StartActionRequest_MongoDBQueryGetDiagnosticDataParams) ValidateAll() error { - return m.validate(true) -} - -func (m *StartActionRequest_MongoDBQueryGetDiagnosticDataParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Dsn - - if all { - switch v := interface{}(m.GetTextFiles()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, StartActionRequest_MongoDBQueryGetDiagnosticDataParamsValidationError{ - field: "TextFiles", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, StartActionRequest_MongoDBQueryGetDiagnosticDataParamsValidationError{ - field: "TextFiles", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetTextFiles()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return StartActionRequest_MongoDBQueryGetDiagnosticDataParamsValidationError{ - field: "TextFiles", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if len(errors) > 0 { - return StartActionRequest_MongoDBQueryGetDiagnosticDataParamsMultiError(errors) - } - - return nil -} - -// StartActionRequest_MongoDBQueryGetDiagnosticDataParamsMultiError is an error -// wrapping multiple validation errors returned by -// StartActionRequest_MongoDBQueryGetDiagnosticDataParams.ValidateAll() if the -// designated constraints aren't met. -type StartActionRequest_MongoDBQueryGetDiagnosticDataParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m StartActionRequest_MongoDBQueryGetDiagnosticDataParamsMultiError) 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 StartActionRequest_MongoDBQueryGetDiagnosticDataParamsMultiError) AllErrors() []error { - return m -} - -// StartActionRequest_MongoDBQueryGetDiagnosticDataParamsValidationError is the -// validation error returned by -// StartActionRequest_MongoDBQueryGetDiagnosticDataParams.Validate if the -// designated constraints aren't met. -type StartActionRequest_MongoDBQueryGetDiagnosticDataParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e StartActionRequest_MongoDBQueryGetDiagnosticDataParamsValidationError) Field() string { - return e.field -} - -// Reason function returns reason value. -func (e StartActionRequest_MongoDBQueryGetDiagnosticDataParamsValidationError) Reason() string { - return e.reason -} - -// Cause function returns cause value. -func (e StartActionRequest_MongoDBQueryGetDiagnosticDataParamsValidationError) Cause() error { - return e.cause -} - -// Key function returns key value. -func (e StartActionRequest_MongoDBQueryGetDiagnosticDataParamsValidationError) Key() bool { - return e.key -} - -// ErrorName returns error name. -func (e StartActionRequest_MongoDBQueryGetDiagnosticDataParamsValidationError) ErrorName() string { - return "StartActionRequest_MongoDBQueryGetDiagnosticDataParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e StartActionRequest_MongoDBQueryGetDiagnosticDataParamsValidationError) 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 %sStartActionRequest_MongoDBQueryGetDiagnosticDataParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = StartActionRequest_MongoDBQueryGetDiagnosticDataParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = StartActionRequest_MongoDBQueryGetDiagnosticDataParamsValidationError{} - -// Validate checks the field values on -// StartActionRequest_RestartSystemServiceParams 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 *StartActionRequest_RestartSystemServiceParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on -// StartActionRequest_RestartSystemServiceParams 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 -// StartActionRequest_RestartSystemServiceParamsMultiError, or nil if none found. -func (m *StartActionRequest_RestartSystemServiceParams) ValidateAll() error { - return m.validate(true) -} - -func (m *StartActionRequest_RestartSystemServiceParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for SystemService - - if len(errors) > 0 { - return StartActionRequest_RestartSystemServiceParamsMultiError(errors) - } - - return nil -} - -// StartActionRequest_RestartSystemServiceParamsMultiError is an error wrapping -// multiple validation errors returned by -// StartActionRequest_RestartSystemServiceParams.ValidateAll() if the -// designated constraints aren't met. -type StartActionRequest_RestartSystemServiceParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m StartActionRequest_RestartSystemServiceParamsMultiError) 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 StartActionRequest_RestartSystemServiceParamsMultiError) AllErrors() []error { return m } - -// StartActionRequest_RestartSystemServiceParamsValidationError is the -// validation error returned by -// StartActionRequest_RestartSystemServiceParams.Validate if the designated -// constraints aren't met. -type StartActionRequest_RestartSystemServiceParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e StartActionRequest_RestartSystemServiceParamsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e StartActionRequest_RestartSystemServiceParamsValidationError) Reason() string { - return e.reason -} - -// Cause function returns cause value. -func (e StartActionRequest_RestartSystemServiceParamsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e StartActionRequest_RestartSystemServiceParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e StartActionRequest_RestartSystemServiceParamsValidationError) ErrorName() string { - return "StartActionRequest_RestartSystemServiceParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e StartActionRequest_RestartSystemServiceParamsValidationError) 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 %sStartActionRequest_RestartSystemServiceParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = StartActionRequest_RestartSystemServiceParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = StartActionRequest_RestartSystemServiceParamsValidationError{} - -// Validate checks the field values on CheckConnectionResponse_Stats 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 *CheckConnectionResponse_Stats) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on CheckConnectionResponse_Stats 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 -// CheckConnectionResponse_StatsMultiError, or nil if none found. -func (m *CheckConnectionResponse_Stats) ValidateAll() error { - return m.validate(true) -} - -func (m *CheckConnectionResponse_Stats) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for TableCount - - if len(errors) > 0 { - return CheckConnectionResponse_StatsMultiError(errors) - } - - return nil -} - -// CheckConnectionResponse_StatsMultiError is an error wrapping multiple -// validation errors returned by CheckConnectionResponse_Stats.ValidateAll() -// if the designated constraints aren't met. -type CheckConnectionResponse_StatsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m CheckConnectionResponse_StatsMultiError) 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 CheckConnectionResponse_StatsMultiError) AllErrors() []error { return m } - -// CheckConnectionResponse_StatsValidationError is the validation error -// returned by CheckConnectionResponse_Stats.Validate if the designated -// constraints aren't met. -type CheckConnectionResponse_StatsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e CheckConnectionResponse_StatsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e CheckConnectionResponse_StatsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e CheckConnectionResponse_StatsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e CheckConnectionResponse_StatsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e CheckConnectionResponse_StatsValidationError) ErrorName() string { - return "CheckConnectionResponse_StatsValidationError" -} - -// Error satisfies the builtin error interface -func (e CheckConnectionResponse_StatsValidationError) 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 %sCheckConnectionResponse_Stats.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = CheckConnectionResponse_StatsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = CheckConnectionResponse_StatsValidationError{} - -// Validate checks the field values on StartJobRequest_MySQLBackup 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 *StartJobRequest_MySQLBackup) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on StartJobRequest_MySQLBackup 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 -// StartJobRequest_MySQLBackupMultiError, or nil if none found. -func (m *StartJobRequest_MySQLBackup) ValidateAll() error { - return m.validate(true) -} - -func (m *StartJobRequest_MySQLBackup) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for User - - // no validation rules for Password - - // no validation rules for Address - - // no validation rules for Port - - // no validation rules for Socket - - // no validation rules for Name - - // no validation rules for Folder - - switch v := m.LocationConfig.(type) { - case *StartJobRequest_MySQLBackup_S3Config: - if v == nil { - err := StartJobRequest_MySQLBackupValidationError{ - field: "LocationConfig", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetS3Config()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, StartJobRequest_MySQLBackupValidationError{ - field: "S3Config", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, StartJobRequest_MySQLBackupValidationError{ - field: "S3Config", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetS3Config()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return StartJobRequest_MySQLBackupValidationError{ - field: "S3Config", - reason: "embedded message failed validation", - cause: err, - } - } - } - - default: - _ = v // ensures v is used - } - - if len(errors) > 0 { - return StartJobRequest_MySQLBackupMultiError(errors) - } - - return nil -} - -// StartJobRequest_MySQLBackupMultiError is an error wrapping multiple -// validation errors returned by StartJobRequest_MySQLBackup.ValidateAll() if -// the designated constraints aren't met. -type StartJobRequest_MySQLBackupMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m StartJobRequest_MySQLBackupMultiError) 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 StartJobRequest_MySQLBackupMultiError) AllErrors() []error { return m } - -// StartJobRequest_MySQLBackupValidationError is the validation error returned -// by StartJobRequest_MySQLBackup.Validate if the designated constraints -// aren't met. -type StartJobRequest_MySQLBackupValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e StartJobRequest_MySQLBackupValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e StartJobRequest_MySQLBackupValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e StartJobRequest_MySQLBackupValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e StartJobRequest_MySQLBackupValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e StartJobRequest_MySQLBackupValidationError) ErrorName() string { - return "StartJobRequest_MySQLBackupValidationError" -} - -// Error satisfies the builtin error interface -func (e StartJobRequest_MySQLBackupValidationError) 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 %sStartJobRequest_MySQLBackup.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = StartJobRequest_MySQLBackupValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = StartJobRequest_MySQLBackupValidationError{} - -// Validate checks the field values on StartJobRequest_MySQLRestoreBackup 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 *StartJobRequest_MySQLRestoreBackup) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on StartJobRequest_MySQLRestoreBackup -// 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 -// StartJobRequest_MySQLRestoreBackupMultiError, or nil if none found. -func (m *StartJobRequest_MySQLRestoreBackup) ValidateAll() error { - return m.validate(true) -} - -func (m *StartJobRequest_MySQLRestoreBackup) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for ServiceId - - // no validation rules for Name - - // no validation rules for Folder - - switch v := m.LocationConfig.(type) { - case *StartJobRequest_MySQLRestoreBackup_S3Config: - if v == nil { - err := StartJobRequest_MySQLRestoreBackupValidationError{ - field: "LocationConfig", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetS3Config()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, StartJobRequest_MySQLRestoreBackupValidationError{ - field: "S3Config", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, StartJobRequest_MySQLRestoreBackupValidationError{ - field: "S3Config", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetS3Config()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return StartJobRequest_MySQLRestoreBackupValidationError{ - field: "S3Config", - reason: "embedded message failed validation", - cause: err, - } - } - } - - default: - _ = v // ensures v is used - } - - if len(errors) > 0 { - return StartJobRequest_MySQLRestoreBackupMultiError(errors) - } - - return nil -} - -// StartJobRequest_MySQLRestoreBackupMultiError is an error wrapping multiple -// validation errors returned by -// StartJobRequest_MySQLRestoreBackup.ValidateAll() if the designated -// constraints aren't met. -type StartJobRequest_MySQLRestoreBackupMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m StartJobRequest_MySQLRestoreBackupMultiError) 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 StartJobRequest_MySQLRestoreBackupMultiError) AllErrors() []error { return m } - -// StartJobRequest_MySQLRestoreBackupValidationError is the validation error -// returned by StartJobRequest_MySQLRestoreBackup.Validate if the designated -// constraints aren't met. -type StartJobRequest_MySQLRestoreBackupValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e StartJobRequest_MySQLRestoreBackupValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e StartJobRequest_MySQLRestoreBackupValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e StartJobRequest_MySQLRestoreBackupValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e StartJobRequest_MySQLRestoreBackupValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e StartJobRequest_MySQLRestoreBackupValidationError) ErrorName() string { - return "StartJobRequest_MySQLRestoreBackupValidationError" -} - -// Error satisfies the builtin error interface -func (e StartJobRequest_MySQLRestoreBackupValidationError) 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 %sStartJobRequest_MySQLRestoreBackup.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = StartJobRequest_MySQLRestoreBackupValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = StartJobRequest_MySQLRestoreBackupValidationError{} - -// Validate checks the field values on StartJobRequest_MongoDBBackup 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 *StartJobRequest_MongoDBBackup) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on StartJobRequest_MongoDBBackup 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 -// StartJobRequest_MongoDBBackupMultiError, or nil if none found. -func (m *StartJobRequest_MongoDBBackup) ValidateAll() error { - return m.validate(true) -} - -func (m *StartJobRequest_MongoDBBackup) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Dsn - - if all { - switch v := interface{}(m.GetTextFiles()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, StartJobRequest_MongoDBBackupValidationError{ - field: "TextFiles", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, StartJobRequest_MongoDBBackupValidationError{ - field: "TextFiles", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetTextFiles()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return StartJobRequest_MongoDBBackupValidationError{ - field: "TextFiles", - reason: "embedded message failed validation", - cause: err, - } - } - } - - // no validation rules for Name - - // no validation rules for Folder - - // no validation rules for EnablePitr - - // no validation rules for DataModel - - switch v := m.LocationConfig.(type) { - case *StartJobRequest_MongoDBBackup_S3Config: - if v == nil { - err := StartJobRequest_MongoDBBackupValidationError{ - field: "LocationConfig", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetS3Config()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, StartJobRequest_MongoDBBackupValidationError{ - field: "S3Config", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, StartJobRequest_MongoDBBackupValidationError{ - field: "S3Config", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetS3Config()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return StartJobRequest_MongoDBBackupValidationError{ - field: "S3Config", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *StartJobRequest_MongoDBBackup_FilesystemConfig: - if v == nil { - err := StartJobRequest_MongoDBBackupValidationError{ - field: "LocationConfig", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetFilesystemConfig()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, StartJobRequest_MongoDBBackupValidationError{ - field: "FilesystemConfig", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, StartJobRequest_MongoDBBackupValidationError{ - field: "FilesystemConfig", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetFilesystemConfig()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return StartJobRequest_MongoDBBackupValidationError{ - field: "FilesystemConfig", - reason: "embedded message failed validation", - cause: err, - } - } - } - - default: - _ = v // ensures v is used - } - - if len(errors) > 0 { - return StartJobRequest_MongoDBBackupMultiError(errors) - } - - return nil -} - -// StartJobRequest_MongoDBBackupMultiError is an error wrapping multiple -// validation errors returned by StartJobRequest_MongoDBBackup.ValidateAll() -// if the designated constraints aren't met. -type StartJobRequest_MongoDBBackupMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m StartJobRequest_MongoDBBackupMultiError) 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 StartJobRequest_MongoDBBackupMultiError) AllErrors() []error { return m } - -// StartJobRequest_MongoDBBackupValidationError is the validation error -// returned by StartJobRequest_MongoDBBackup.Validate if the designated -// constraints aren't met. -type StartJobRequest_MongoDBBackupValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e StartJobRequest_MongoDBBackupValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e StartJobRequest_MongoDBBackupValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e StartJobRequest_MongoDBBackupValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e StartJobRequest_MongoDBBackupValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e StartJobRequest_MongoDBBackupValidationError) ErrorName() string { - return "StartJobRequest_MongoDBBackupValidationError" -} - -// Error satisfies the builtin error interface -func (e StartJobRequest_MongoDBBackupValidationError) 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 %sStartJobRequest_MongoDBBackup.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = StartJobRequest_MongoDBBackupValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = StartJobRequest_MongoDBBackupValidationError{} - -// Validate checks the field values on StartJobRequest_MongoDBRestoreBackup -// 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 *StartJobRequest_MongoDBRestoreBackup) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on StartJobRequest_MongoDBRestoreBackup -// 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 -// StartJobRequest_MongoDBRestoreBackupMultiError, or nil if none found. -func (m *StartJobRequest_MongoDBRestoreBackup) ValidateAll() error { - return m.validate(true) -} - -func (m *StartJobRequest_MongoDBRestoreBackup) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Dsn - - if all { - switch v := interface{}(m.GetTextFiles()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, StartJobRequest_MongoDBRestoreBackupValidationError{ - field: "TextFiles", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, StartJobRequest_MongoDBRestoreBackupValidationError{ - field: "TextFiles", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetTextFiles()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return StartJobRequest_MongoDBRestoreBackupValidationError{ - field: "TextFiles", - reason: "embedded message failed validation", - cause: err, - } - } - } - - // no validation rules for Name - - // no validation rules for Folder - - if all { - switch v := interface{}(m.GetPbmMetadata()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, StartJobRequest_MongoDBRestoreBackupValidationError{ - field: "PbmMetadata", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, StartJobRequest_MongoDBRestoreBackupValidationError{ - field: "PbmMetadata", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetPbmMetadata()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return StartJobRequest_MongoDBRestoreBackupValidationError{ - field: "PbmMetadata", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetPitrTimestamp()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, StartJobRequest_MongoDBRestoreBackupValidationError{ - field: "PitrTimestamp", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, StartJobRequest_MongoDBRestoreBackupValidationError{ - field: "PitrTimestamp", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetPitrTimestamp()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return StartJobRequest_MongoDBRestoreBackupValidationError{ - field: "PitrTimestamp", - reason: "embedded message failed validation", - cause: err, - } - } - } - - switch v := m.LocationConfig.(type) { - case *StartJobRequest_MongoDBRestoreBackup_S3Config: - if v == nil { - err := StartJobRequest_MongoDBRestoreBackupValidationError{ - field: "LocationConfig", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetS3Config()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, StartJobRequest_MongoDBRestoreBackupValidationError{ - field: "S3Config", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, StartJobRequest_MongoDBRestoreBackupValidationError{ - field: "S3Config", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetS3Config()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return StartJobRequest_MongoDBRestoreBackupValidationError{ - field: "S3Config", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *StartJobRequest_MongoDBRestoreBackup_FilesystemConfig: - if v == nil { - err := StartJobRequest_MongoDBRestoreBackupValidationError{ - field: "LocationConfig", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetFilesystemConfig()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, StartJobRequest_MongoDBRestoreBackupValidationError{ - field: "FilesystemConfig", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, StartJobRequest_MongoDBRestoreBackupValidationError{ - field: "FilesystemConfig", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetFilesystemConfig()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return StartJobRequest_MongoDBRestoreBackupValidationError{ - field: "FilesystemConfig", - reason: "embedded message failed validation", - cause: err, - } - } - } - - default: - _ = v // ensures v is used - } - - if len(errors) > 0 { - return StartJobRequest_MongoDBRestoreBackupMultiError(errors) - } - - return nil -} - -// StartJobRequest_MongoDBRestoreBackupMultiError is an error wrapping multiple -// validation errors returned by -// StartJobRequest_MongoDBRestoreBackup.ValidateAll() if the designated -// constraints aren't met. -type StartJobRequest_MongoDBRestoreBackupMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m StartJobRequest_MongoDBRestoreBackupMultiError) 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 StartJobRequest_MongoDBRestoreBackupMultiError) AllErrors() []error { return m } - -// StartJobRequest_MongoDBRestoreBackupValidationError is the validation error -// returned by StartJobRequest_MongoDBRestoreBackup.Validate if the designated -// constraints aren't met. -type StartJobRequest_MongoDBRestoreBackupValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e StartJobRequest_MongoDBRestoreBackupValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e StartJobRequest_MongoDBRestoreBackupValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e StartJobRequest_MongoDBRestoreBackupValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e StartJobRequest_MongoDBRestoreBackupValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e StartJobRequest_MongoDBRestoreBackupValidationError) ErrorName() string { - return "StartJobRequest_MongoDBRestoreBackupValidationError" -} - -// Error satisfies the builtin error interface -func (e StartJobRequest_MongoDBRestoreBackupValidationError) 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 %sStartJobRequest_MongoDBRestoreBackup.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = StartJobRequest_MongoDBRestoreBackupValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = StartJobRequest_MongoDBRestoreBackupValidationError{} - -// Validate checks the field values on JobResult_Error 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 *JobResult_Error) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on JobResult_Error 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 -// JobResult_ErrorMultiError, or nil if none found. -func (m *JobResult_Error) ValidateAll() error { - return m.validate(true) -} - -func (m *JobResult_Error) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Message - - if len(errors) > 0 { - return JobResult_ErrorMultiError(errors) - } - - return nil -} - -// JobResult_ErrorMultiError is an error wrapping multiple validation errors -// returned by JobResult_Error.ValidateAll() if the designated constraints -// aren't met. -type JobResult_ErrorMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m JobResult_ErrorMultiError) 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 JobResult_ErrorMultiError) AllErrors() []error { return m } - -// JobResult_ErrorValidationError is the validation error returned by -// JobResult_Error.Validate if the designated constraints aren't met. -type JobResult_ErrorValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e JobResult_ErrorValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e JobResult_ErrorValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e JobResult_ErrorValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e JobResult_ErrorValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e JobResult_ErrorValidationError) ErrorName() string { return "JobResult_ErrorValidationError" } - -// Error satisfies the builtin error interface -func (e JobResult_ErrorValidationError) 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 %sJobResult_Error.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = JobResult_ErrorValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = JobResult_ErrorValidationError{} - -// Validate checks the field values on JobResult_MongoDBBackup 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 *JobResult_MongoDBBackup) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on JobResult_MongoDBBackup 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 -// JobResult_MongoDBBackupMultiError, or nil if none found. -func (m *JobResult_MongoDBBackup) ValidateAll() error { - return m.validate(true) -} - -func (m *JobResult_MongoDBBackup) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for IsShardedCluster - - if all { - switch v := interface{}(m.GetMetadata()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, JobResult_MongoDBBackupValidationError{ - field: "Metadata", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, JobResult_MongoDBBackupValidationError{ - field: "Metadata", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return JobResult_MongoDBBackupValidationError{ - field: "Metadata", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if len(errors) > 0 { - return JobResult_MongoDBBackupMultiError(errors) - } - - return nil -} - -// JobResult_MongoDBBackupMultiError is an error wrapping multiple validation -// errors returned by JobResult_MongoDBBackup.ValidateAll() if the designated -// constraints aren't met. -type JobResult_MongoDBBackupMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m JobResult_MongoDBBackupMultiError) 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 JobResult_MongoDBBackupMultiError) AllErrors() []error { return m } - -// JobResult_MongoDBBackupValidationError is the validation error returned by -// JobResult_MongoDBBackup.Validate if the designated constraints aren't met. -type JobResult_MongoDBBackupValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e JobResult_MongoDBBackupValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e JobResult_MongoDBBackupValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e JobResult_MongoDBBackupValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e JobResult_MongoDBBackupValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e JobResult_MongoDBBackupValidationError) ErrorName() string { - return "JobResult_MongoDBBackupValidationError" -} - -// Error satisfies the builtin error interface -func (e JobResult_MongoDBBackupValidationError) 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 %sJobResult_MongoDBBackup.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = JobResult_MongoDBBackupValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = JobResult_MongoDBBackupValidationError{} - -// Validate checks the field values on JobResult_MySQLBackup 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 *JobResult_MySQLBackup) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on JobResult_MySQLBackup 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 -// JobResult_MySQLBackupMultiError, or nil if none found. -func (m *JobResult_MySQLBackup) ValidateAll() error { - return m.validate(true) -} - -func (m *JobResult_MySQLBackup) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if all { - switch v := interface{}(m.GetMetadata()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, JobResult_MySQLBackupValidationError{ - field: "Metadata", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, JobResult_MySQLBackupValidationError{ - field: "Metadata", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return JobResult_MySQLBackupValidationError{ - field: "Metadata", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if len(errors) > 0 { - return JobResult_MySQLBackupMultiError(errors) - } - - return nil -} - -// JobResult_MySQLBackupMultiError is an error wrapping multiple validation -// errors returned by JobResult_MySQLBackup.ValidateAll() if the designated -// constraints aren't met. -type JobResult_MySQLBackupMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m JobResult_MySQLBackupMultiError) 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 JobResult_MySQLBackupMultiError) AllErrors() []error { return m } - -// JobResult_MySQLBackupValidationError is the validation error returned by -// JobResult_MySQLBackup.Validate if the designated constraints aren't met. -type JobResult_MySQLBackupValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e JobResult_MySQLBackupValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e JobResult_MySQLBackupValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e JobResult_MySQLBackupValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e JobResult_MySQLBackupValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e JobResult_MySQLBackupValidationError) ErrorName() string { - return "JobResult_MySQLBackupValidationError" -} - -// Error satisfies the builtin error interface -func (e JobResult_MySQLBackupValidationError) 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 %sJobResult_MySQLBackup.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = JobResult_MySQLBackupValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = JobResult_MySQLBackupValidationError{} - -// Validate checks the field values on JobResult_MySQLRestoreBackup 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 *JobResult_MySQLRestoreBackup) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on JobResult_MySQLRestoreBackup 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 -// JobResult_MySQLRestoreBackupMultiError, or nil if none found. -func (m *JobResult_MySQLRestoreBackup) ValidateAll() error { - return m.validate(true) -} - -func (m *JobResult_MySQLRestoreBackup) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return JobResult_MySQLRestoreBackupMultiError(errors) - } - - return nil -} - -// JobResult_MySQLRestoreBackupMultiError is an error wrapping multiple -// validation errors returned by JobResult_MySQLRestoreBackup.ValidateAll() if -// the designated constraints aren't met. -type JobResult_MySQLRestoreBackupMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m JobResult_MySQLRestoreBackupMultiError) 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 JobResult_MySQLRestoreBackupMultiError) AllErrors() []error { return m } - -// JobResult_MySQLRestoreBackupValidationError is the validation error returned -// by JobResult_MySQLRestoreBackup.Validate if the designated constraints -// aren't met. -type JobResult_MySQLRestoreBackupValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e JobResult_MySQLRestoreBackupValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e JobResult_MySQLRestoreBackupValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e JobResult_MySQLRestoreBackupValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e JobResult_MySQLRestoreBackupValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e JobResult_MySQLRestoreBackupValidationError) ErrorName() string { - return "JobResult_MySQLRestoreBackupValidationError" -} - -// Error satisfies the builtin error interface -func (e JobResult_MySQLRestoreBackupValidationError) 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 %sJobResult_MySQLRestoreBackup.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = JobResult_MySQLRestoreBackupValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = JobResult_MySQLRestoreBackupValidationError{} - -// Validate checks the field values on JobResult_MongoDBRestoreBackup 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 *JobResult_MongoDBRestoreBackup) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on JobResult_MongoDBRestoreBackup 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 -// JobResult_MongoDBRestoreBackupMultiError, or nil if none found. -func (m *JobResult_MongoDBRestoreBackup) ValidateAll() error { - return m.validate(true) -} - -func (m *JobResult_MongoDBRestoreBackup) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return JobResult_MongoDBRestoreBackupMultiError(errors) - } - - return nil -} - -// JobResult_MongoDBRestoreBackupMultiError is an error wrapping multiple -// validation errors returned by JobResult_MongoDBRestoreBackup.ValidateAll() -// if the designated constraints aren't met. -type JobResult_MongoDBRestoreBackupMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m JobResult_MongoDBRestoreBackupMultiError) 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 JobResult_MongoDBRestoreBackupMultiError) AllErrors() []error { return m } - -// JobResult_MongoDBRestoreBackupValidationError is the validation error -// returned by JobResult_MongoDBRestoreBackup.Validate if the designated -// constraints aren't met. -type JobResult_MongoDBRestoreBackupValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e JobResult_MongoDBRestoreBackupValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e JobResult_MongoDBRestoreBackupValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e JobResult_MongoDBRestoreBackupValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e JobResult_MongoDBRestoreBackupValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e JobResult_MongoDBRestoreBackupValidationError) ErrorName() string { - return "JobResult_MongoDBRestoreBackupValidationError" -} - -// Error satisfies the builtin error interface -func (e JobResult_MongoDBRestoreBackupValidationError) 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 %sJobResult_MongoDBRestoreBackup.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = JobResult_MongoDBRestoreBackupValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = JobResult_MongoDBRestoreBackupValidationError{} - -// Validate checks the field values on JobProgress_MySQLBackup 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 *JobProgress_MySQLBackup) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on JobProgress_MySQLBackup 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 -// JobProgress_MySQLBackupMultiError, or nil if none found. -func (m *JobProgress_MySQLBackup) ValidateAll() error { - return m.validate(true) -} - -func (m *JobProgress_MySQLBackup) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return JobProgress_MySQLBackupMultiError(errors) - } - - return nil -} - -// JobProgress_MySQLBackupMultiError is an error wrapping multiple validation -// errors returned by JobProgress_MySQLBackup.ValidateAll() if the designated -// constraints aren't met. -type JobProgress_MySQLBackupMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m JobProgress_MySQLBackupMultiError) 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 JobProgress_MySQLBackupMultiError) AllErrors() []error { return m } - -// JobProgress_MySQLBackupValidationError is the validation error returned by -// JobProgress_MySQLBackup.Validate if the designated constraints aren't met. -type JobProgress_MySQLBackupValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e JobProgress_MySQLBackupValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e JobProgress_MySQLBackupValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e JobProgress_MySQLBackupValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e JobProgress_MySQLBackupValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e JobProgress_MySQLBackupValidationError) ErrorName() string { - return "JobProgress_MySQLBackupValidationError" -} - -// Error satisfies the builtin error interface -func (e JobProgress_MySQLBackupValidationError) 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 %sJobProgress_MySQLBackup.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = JobProgress_MySQLBackupValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = JobProgress_MySQLBackupValidationError{} - -// Validate checks the field values on JobProgress_MySQLRestoreBackup 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 *JobProgress_MySQLRestoreBackup) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on JobProgress_MySQLRestoreBackup 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 -// JobProgress_MySQLRestoreBackupMultiError, or nil if none found. -func (m *JobProgress_MySQLRestoreBackup) ValidateAll() error { - return m.validate(true) -} - -func (m *JobProgress_MySQLRestoreBackup) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return JobProgress_MySQLRestoreBackupMultiError(errors) - } - - return nil -} - -// JobProgress_MySQLRestoreBackupMultiError is an error wrapping multiple -// validation errors returned by JobProgress_MySQLRestoreBackup.ValidateAll() -// if the designated constraints aren't met. -type JobProgress_MySQLRestoreBackupMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m JobProgress_MySQLRestoreBackupMultiError) 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 JobProgress_MySQLRestoreBackupMultiError) AllErrors() []error { return m } - -// JobProgress_MySQLRestoreBackupValidationError is the validation error -// returned by JobProgress_MySQLRestoreBackup.Validate if the designated -// constraints aren't met. -type JobProgress_MySQLRestoreBackupValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e JobProgress_MySQLRestoreBackupValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e JobProgress_MySQLRestoreBackupValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e JobProgress_MySQLRestoreBackupValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e JobProgress_MySQLRestoreBackupValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e JobProgress_MySQLRestoreBackupValidationError) ErrorName() string { - return "JobProgress_MySQLRestoreBackupValidationError" -} - -// Error satisfies the builtin error interface -func (e JobProgress_MySQLRestoreBackupValidationError) 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 %sJobProgress_MySQLRestoreBackup.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = JobProgress_MySQLRestoreBackupValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = JobProgress_MySQLRestoreBackupValidationError{} - -// Validate checks the field values on JobProgress_Logs 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 *JobProgress_Logs) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on JobProgress_Logs 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 -// JobProgress_LogsMultiError, or nil if none found. -func (m *JobProgress_Logs) ValidateAll() error { - return m.validate(true) -} - -func (m *JobProgress_Logs) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for ChunkId - - // no validation rules for Data - - // no validation rules for Done - - if len(errors) > 0 { - return JobProgress_LogsMultiError(errors) - } - - return nil -} - -// JobProgress_LogsMultiError is an error wrapping multiple validation errors -// returned by JobProgress_Logs.ValidateAll() if the designated constraints -// aren't met. -type JobProgress_LogsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m JobProgress_LogsMultiError) 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 JobProgress_LogsMultiError) AllErrors() []error { return m } - -// JobProgress_LogsValidationError is the validation error returned by -// JobProgress_Logs.Validate if the designated constraints aren't met. -type JobProgress_LogsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e JobProgress_LogsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e JobProgress_LogsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e JobProgress_LogsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e JobProgress_LogsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e JobProgress_LogsValidationError) ErrorName() string { return "JobProgress_LogsValidationError" } - -// Error satisfies the builtin error interface -func (e JobProgress_LogsValidationError) 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 %sJobProgress_Logs.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = JobProgress_LogsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = JobProgress_LogsValidationError{} - -// Validate checks the field values on GetVersionsRequest_MySQLd 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 *GetVersionsRequest_MySQLd) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on GetVersionsRequest_MySQLd 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 -// GetVersionsRequest_MySQLdMultiError, or nil if none found. -func (m *GetVersionsRequest_MySQLd) ValidateAll() error { - return m.validate(true) -} - -func (m *GetVersionsRequest_MySQLd) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return GetVersionsRequest_MySQLdMultiError(errors) - } - - return nil -} - -// GetVersionsRequest_MySQLdMultiError is an error wrapping multiple validation -// errors returned by GetVersionsRequest_MySQLd.ValidateAll() if the -// designated constraints aren't met. -type GetVersionsRequest_MySQLdMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m GetVersionsRequest_MySQLdMultiError) 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 GetVersionsRequest_MySQLdMultiError) AllErrors() []error { return m } - -// GetVersionsRequest_MySQLdValidationError is the validation error returned by -// GetVersionsRequest_MySQLd.Validate if the designated constraints aren't met. -type GetVersionsRequest_MySQLdValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e GetVersionsRequest_MySQLdValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e GetVersionsRequest_MySQLdValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e GetVersionsRequest_MySQLdValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e GetVersionsRequest_MySQLdValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e GetVersionsRequest_MySQLdValidationError) ErrorName() string { - return "GetVersionsRequest_MySQLdValidationError" -} - -// Error satisfies the builtin error interface -func (e GetVersionsRequest_MySQLdValidationError) 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 %sGetVersionsRequest_MySQLd.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = GetVersionsRequest_MySQLdValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = GetVersionsRequest_MySQLdValidationError{} - -// Validate checks the field values on GetVersionsRequest_Xtrabackup 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 *GetVersionsRequest_Xtrabackup) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on GetVersionsRequest_Xtrabackup 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 -// GetVersionsRequest_XtrabackupMultiError, or nil if none found. -func (m *GetVersionsRequest_Xtrabackup) ValidateAll() error { - return m.validate(true) -} - -func (m *GetVersionsRequest_Xtrabackup) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return GetVersionsRequest_XtrabackupMultiError(errors) - } - - return nil -} - -// GetVersionsRequest_XtrabackupMultiError is an error wrapping multiple -// validation errors returned by GetVersionsRequest_Xtrabackup.ValidateAll() -// if the designated constraints aren't met. -type GetVersionsRequest_XtrabackupMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m GetVersionsRequest_XtrabackupMultiError) 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 GetVersionsRequest_XtrabackupMultiError) AllErrors() []error { return m } - -// GetVersionsRequest_XtrabackupValidationError is the validation error -// returned by GetVersionsRequest_Xtrabackup.Validate if the designated -// constraints aren't met. -type GetVersionsRequest_XtrabackupValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e GetVersionsRequest_XtrabackupValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e GetVersionsRequest_XtrabackupValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e GetVersionsRequest_XtrabackupValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e GetVersionsRequest_XtrabackupValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e GetVersionsRequest_XtrabackupValidationError) ErrorName() string { - return "GetVersionsRequest_XtrabackupValidationError" -} - -// Error satisfies the builtin error interface -func (e GetVersionsRequest_XtrabackupValidationError) 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 %sGetVersionsRequest_Xtrabackup.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = GetVersionsRequest_XtrabackupValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = GetVersionsRequest_XtrabackupValidationError{} - -// Validate checks the field values on GetVersionsRequest_Xbcloud 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 *GetVersionsRequest_Xbcloud) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on GetVersionsRequest_Xbcloud 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 -// GetVersionsRequest_XbcloudMultiError, or nil if none found. -func (m *GetVersionsRequest_Xbcloud) ValidateAll() error { - return m.validate(true) -} - -func (m *GetVersionsRequest_Xbcloud) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return GetVersionsRequest_XbcloudMultiError(errors) - } - - return nil -} - -// GetVersionsRequest_XbcloudMultiError is an error wrapping multiple -// validation errors returned by GetVersionsRequest_Xbcloud.ValidateAll() if -// the designated constraints aren't met. -type GetVersionsRequest_XbcloudMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m GetVersionsRequest_XbcloudMultiError) 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 GetVersionsRequest_XbcloudMultiError) AllErrors() []error { return m } - -// GetVersionsRequest_XbcloudValidationError is the validation error returned -// by GetVersionsRequest_Xbcloud.Validate if the designated constraints aren't met. -type GetVersionsRequest_XbcloudValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e GetVersionsRequest_XbcloudValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e GetVersionsRequest_XbcloudValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e GetVersionsRequest_XbcloudValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e GetVersionsRequest_XbcloudValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e GetVersionsRequest_XbcloudValidationError) ErrorName() string { - return "GetVersionsRequest_XbcloudValidationError" -} - -// Error satisfies the builtin error interface -func (e GetVersionsRequest_XbcloudValidationError) 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 %sGetVersionsRequest_Xbcloud.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = GetVersionsRequest_XbcloudValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = GetVersionsRequest_XbcloudValidationError{} - -// Validate checks the field values on GetVersionsRequest_Qpress 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 *GetVersionsRequest_Qpress) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on GetVersionsRequest_Qpress 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 -// GetVersionsRequest_QpressMultiError, or nil if none found. -func (m *GetVersionsRequest_Qpress) ValidateAll() error { - return m.validate(true) -} - -func (m *GetVersionsRequest_Qpress) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return GetVersionsRequest_QpressMultiError(errors) - } - - return nil -} - -// GetVersionsRequest_QpressMultiError is an error wrapping multiple validation -// errors returned by GetVersionsRequest_Qpress.ValidateAll() if the -// designated constraints aren't met. -type GetVersionsRequest_QpressMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m GetVersionsRequest_QpressMultiError) 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 GetVersionsRequest_QpressMultiError) AllErrors() []error { return m } - -// GetVersionsRequest_QpressValidationError is the validation error returned by -// GetVersionsRequest_Qpress.Validate if the designated constraints aren't met. -type GetVersionsRequest_QpressValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e GetVersionsRequest_QpressValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e GetVersionsRequest_QpressValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e GetVersionsRequest_QpressValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e GetVersionsRequest_QpressValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e GetVersionsRequest_QpressValidationError) ErrorName() string { - return "GetVersionsRequest_QpressValidationError" -} - -// Error satisfies the builtin error interface -func (e GetVersionsRequest_QpressValidationError) 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 %sGetVersionsRequest_Qpress.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = GetVersionsRequest_QpressValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = GetVersionsRequest_QpressValidationError{} - -// Validate checks the field values on GetVersionsRequest_MongoDB 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 *GetVersionsRequest_MongoDB) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on GetVersionsRequest_MongoDB 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 -// GetVersionsRequest_MongoDBMultiError, or nil if none found. -func (m *GetVersionsRequest_MongoDB) ValidateAll() error { - return m.validate(true) -} - -func (m *GetVersionsRequest_MongoDB) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return GetVersionsRequest_MongoDBMultiError(errors) - } - - return nil -} - -// GetVersionsRequest_MongoDBMultiError is an error wrapping multiple -// validation errors returned by GetVersionsRequest_MongoDB.ValidateAll() if -// the designated constraints aren't met. -type GetVersionsRequest_MongoDBMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m GetVersionsRequest_MongoDBMultiError) 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 GetVersionsRequest_MongoDBMultiError) AllErrors() []error { return m } - -// GetVersionsRequest_MongoDBValidationError is the validation error returned -// by GetVersionsRequest_MongoDB.Validate if the designated constraints aren't met. -type GetVersionsRequest_MongoDBValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e GetVersionsRequest_MongoDBValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e GetVersionsRequest_MongoDBValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e GetVersionsRequest_MongoDBValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e GetVersionsRequest_MongoDBValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e GetVersionsRequest_MongoDBValidationError) ErrorName() string { - return "GetVersionsRequest_MongoDBValidationError" -} - -// Error satisfies the builtin error interface -func (e GetVersionsRequest_MongoDBValidationError) 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 %sGetVersionsRequest_MongoDB.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = GetVersionsRequest_MongoDBValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = GetVersionsRequest_MongoDBValidationError{} - -// Validate checks the field values on GetVersionsRequest_PBM 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 *GetVersionsRequest_PBM) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on GetVersionsRequest_PBM 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 -// GetVersionsRequest_PBMMultiError, or nil if none found. -func (m *GetVersionsRequest_PBM) ValidateAll() error { - return m.validate(true) -} - -func (m *GetVersionsRequest_PBM) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return GetVersionsRequest_PBMMultiError(errors) - } - - return nil -} - -// GetVersionsRequest_PBMMultiError is an error wrapping multiple validation -// errors returned by GetVersionsRequest_PBM.ValidateAll() if the designated -// constraints aren't met. -type GetVersionsRequest_PBMMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m GetVersionsRequest_PBMMultiError) 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 GetVersionsRequest_PBMMultiError) AllErrors() []error { return m } - -// GetVersionsRequest_PBMValidationError is the validation error returned by -// GetVersionsRequest_PBM.Validate if the designated constraints aren't met. -type GetVersionsRequest_PBMValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e GetVersionsRequest_PBMValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e GetVersionsRequest_PBMValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e GetVersionsRequest_PBMValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e GetVersionsRequest_PBMValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e GetVersionsRequest_PBMValidationError) ErrorName() string { - return "GetVersionsRequest_PBMValidationError" -} - -// Error satisfies the builtin error interface -func (e GetVersionsRequest_PBMValidationError) 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 %sGetVersionsRequest_PBM.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = GetVersionsRequest_PBMValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = GetVersionsRequest_PBMValidationError{} - -// Validate checks the field values on GetVersionsRequest_Software 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 *GetVersionsRequest_Software) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on GetVersionsRequest_Software 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 -// GetVersionsRequest_SoftwareMultiError, or nil if none found. -func (m *GetVersionsRequest_Software) ValidateAll() error { - return m.validate(true) -} - -func (m *GetVersionsRequest_Software) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - switch v := m.Software.(type) { - case *GetVersionsRequest_Software_Mysqld: - if v == nil { - err := GetVersionsRequest_SoftwareValidationError{ - field: "Software", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetMysqld()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GetVersionsRequest_SoftwareValidationError{ - field: "Mysqld", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GetVersionsRequest_SoftwareValidationError{ - field: "Mysqld", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMysqld()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GetVersionsRequest_SoftwareValidationError{ - field: "Mysqld", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *GetVersionsRequest_Software_Xtrabackup: - if v == nil { - err := GetVersionsRequest_SoftwareValidationError{ - field: "Software", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetXtrabackup()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GetVersionsRequest_SoftwareValidationError{ - field: "Xtrabackup", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GetVersionsRequest_SoftwareValidationError{ - field: "Xtrabackup", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetXtrabackup()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GetVersionsRequest_SoftwareValidationError{ - field: "Xtrabackup", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *GetVersionsRequest_Software_Xbcloud: - if v == nil { - err := GetVersionsRequest_SoftwareValidationError{ - field: "Software", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetXbcloud()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GetVersionsRequest_SoftwareValidationError{ - field: "Xbcloud", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GetVersionsRequest_SoftwareValidationError{ - field: "Xbcloud", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetXbcloud()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GetVersionsRequest_SoftwareValidationError{ - field: "Xbcloud", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *GetVersionsRequest_Software_Qpress: - if v == nil { - err := GetVersionsRequest_SoftwareValidationError{ - field: "Software", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetQpress()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GetVersionsRequest_SoftwareValidationError{ - field: "Qpress", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GetVersionsRequest_SoftwareValidationError{ - field: "Qpress", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetQpress()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GetVersionsRequest_SoftwareValidationError{ - field: "Qpress", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *GetVersionsRequest_Software_Mongod: - if v == nil { - err := GetVersionsRequest_SoftwareValidationError{ - field: "Software", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetMongod()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GetVersionsRequest_SoftwareValidationError{ - field: "Mongod", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GetVersionsRequest_SoftwareValidationError{ - field: "Mongod", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMongod()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GetVersionsRequest_SoftwareValidationError{ - field: "Mongod", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *GetVersionsRequest_Software_Pbm: - if v == nil { - err := GetVersionsRequest_SoftwareValidationError{ - field: "Software", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetPbm()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GetVersionsRequest_SoftwareValidationError{ - field: "Pbm", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GetVersionsRequest_SoftwareValidationError{ - field: "Pbm", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetPbm()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GetVersionsRequest_SoftwareValidationError{ - field: "Pbm", - reason: "embedded message failed validation", - cause: err, - } - } - } - - default: - _ = v // ensures v is used - } - - if len(errors) > 0 { - return GetVersionsRequest_SoftwareMultiError(errors) - } - - return nil -} - -// GetVersionsRequest_SoftwareMultiError is an error wrapping multiple -// validation errors returned by GetVersionsRequest_Software.ValidateAll() if -// the designated constraints aren't met. -type GetVersionsRequest_SoftwareMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m GetVersionsRequest_SoftwareMultiError) 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 GetVersionsRequest_SoftwareMultiError) AllErrors() []error { return m } - -// GetVersionsRequest_SoftwareValidationError is the validation error returned -// by GetVersionsRequest_Software.Validate if the designated constraints -// aren't met. -type GetVersionsRequest_SoftwareValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e GetVersionsRequest_SoftwareValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e GetVersionsRequest_SoftwareValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e GetVersionsRequest_SoftwareValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e GetVersionsRequest_SoftwareValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e GetVersionsRequest_SoftwareValidationError) ErrorName() string { - return "GetVersionsRequest_SoftwareValidationError" -} - -// Error satisfies the builtin error interface -func (e GetVersionsRequest_SoftwareValidationError) 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 %sGetVersionsRequest_Software.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = GetVersionsRequest_SoftwareValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = GetVersionsRequest_SoftwareValidationError{} - -// Validate checks the field values on GetVersionsResponse_Version 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 *GetVersionsResponse_Version) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on GetVersionsResponse_Version 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 -// GetVersionsResponse_VersionMultiError, or nil if none found. -func (m *GetVersionsResponse_Version) ValidateAll() error { - return m.validate(true) -} - -func (m *GetVersionsResponse_Version) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Version - - // no validation rules for Error - - if len(errors) > 0 { - return GetVersionsResponse_VersionMultiError(errors) - } - - return nil -} - -// GetVersionsResponse_VersionMultiError is an error wrapping multiple -// validation errors returned by GetVersionsResponse_Version.ValidateAll() if -// the designated constraints aren't met. -type GetVersionsResponse_VersionMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m GetVersionsResponse_VersionMultiError) 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 GetVersionsResponse_VersionMultiError) AllErrors() []error { return m } - -// GetVersionsResponse_VersionValidationError is the validation error returned -// by GetVersionsResponse_Version.Validate if the designated constraints -// aren't met. -type GetVersionsResponse_VersionValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e GetVersionsResponse_VersionValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e GetVersionsResponse_VersionValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e GetVersionsResponse_VersionValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e GetVersionsResponse_VersionValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e GetVersionsResponse_VersionValidationError) ErrorName() string { - return "GetVersionsResponse_VersionValidationError" -} - -// Error satisfies the builtin error interface -func (e GetVersionsResponse_VersionValidationError) 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 %sGetVersionsResponse_Version.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = GetVersionsResponse_VersionValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = GetVersionsResponse_VersionValidationError{} diff --git a/api/agent/v1/agent_grpc.pb.go b/api/agent/v1/agent_grpc.pb.go deleted file mode 100644 index 93727efa84c..00000000000 --- a/api/agent/v1/agent_grpc.pb.go +++ /dev/null @@ -1,122 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.6.0 -// - protoc (unknown) -// source: agent/v1/agent.proto - -package agentv1 - -import ( - context "context" - - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.64.0 or later. -const _ = grpc.SupportPackageIsVersion9 - -const ( - AgentService_Connect_FullMethodName = "/agent.v1.AgentService/Connect" -) - -// AgentServiceClient is the client API for AgentService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -// -// Agent service provides private methods for pmm-agent <-> pmm-managed interactions. -type AgentServiceClient interface { - // Connect establishes two-way communication channel between pmm-agent and pmm-managed. - Connect(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[AgentMessage, ServerMessage], error) -} - -type agentServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewAgentServiceClient(cc grpc.ClientConnInterface) AgentServiceClient { - return &agentServiceClient{cc} -} - -func (c *agentServiceClient) Connect(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[AgentMessage, ServerMessage], error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - stream, err := c.cc.NewStream(ctx, &AgentService_ServiceDesc.Streams[0], AgentService_Connect_FullMethodName, cOpts...) - if err != nil { - return nil, err - } - x := &grpc.GenericClientStream[AgentMessage, ServerMessage]{ClientStream: stream} - return x, nil -} - -// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. -type AgentService_ConnectClient = grpc.BidiStreamingClient[AgentMessage, ServerMessage] - -// AgentServiceServer is the server API for AgentService service. -// All implementations must embed UnimplementedAgentServiceServer -// for forward compatibility. -// -// Agent service provides private methods for pmm-agent <-> pmm-managed interactions. -type AgentServiceServer interface { - // Connect establishes two-way communication channel between pmm-agent and pmm-managed. - Connect(grpc.BidiStreamingServer[AgentMessage, ServerMessage]) error - mustEmbedUnimplementedAgentServiceServer() -} - -// UnimplementedAgentServiceServer must be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -type UnimplementedAgentServiceServer struct{} - -func (UnimplementedAgentServiceServer) Connect(grpc.BidiStreamingServer[AgentMessage, ServerMessage]) error { - return status.Error(codes.Unimplemented, "method Connect not implemented") -} -func (UnimplementedAgentServiceServer) mustEmbedUnimplementedAgentServiceServer() {} -func (UnimplementedAgentServiceServer) testEmbeddedByValue() {} - -// UnsafeAgentServiceServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to AgentServiceServer will -// result in compilation errors. -type UnsafeAgentServiceServer interface { - mustEmbedUnimplementedAgentServiceServer() -} - -func RegisterAgentServiceServer(s grpc.ServiceRegistrar, srv AgentServiceServer) { - // If the following call panics, it indicates UnimplementedAgentServiceServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } - s.RegisterService(&AgentService_ServiceDesc, srv) -} - -func _AgentService_Connect_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(AgentServiceServer).Connect(&grpc.GenericServerStream[AgentMessage, ServerMessage]{ServerStream: stream}) -} - -// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. -type AgentService_ConnectServer = grpc.BidiStreamingServer[AgentMessage, ServerMessage] - -// AgentService_ServiceDesc is the grpc.ServiceDesc for AgentService service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var AgentService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "agent.v1.AgentService", - HandlerType: (*AgentServiceServer)(nil), - Methods: []grpc.MethodDesc{}, - Streams: []grpc.StreamDesc{ - { - StreamName: "Connect", - Handler: _AgentService_Connect_Handler, - ServerStreams: true, - ClientStreams: true, - }, - }, - Metadata: "agent/v1/agent.proto", -} diff --git a/api/agent/v1/collector.pb.go b/api/agent/v1/collector.pb.go deleted file mode 100644 index 6339580a49c..00000000000 --- a/api/agent/v1/collector.pb.go +++ /dev/null @@ -1,2813 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.10 -// protoc (unknown) -// source: agent/v1/collector.proto - -package agentv1 - -import ( - 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 ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// ExampleType is a type of query example selected for this query class in given period of time. -type ExampleType int32 - -const ( - ExampleType_EXAMPLE_TYPE_UNSPECIFIED ExampleType = 0 - ExampleType_EXAMPLE_TYPE_RANDOM ExampleType = 1 - ExampleType_EXAMPLE_TYPE_SLOWEST ExampleType = 2 - ExampleType_EXAMPLE_TYPE_FASTEST ExampleType = 3 - ExampleType_EXAMPLE_TYPE_WITH_ERROR ExampleType = 4 -) - -// Enum value maps for ExampleType. -var ( - ExampleType_name = map[int32]string{ - 0: "EXAMPLE_TYPE_UNSPECIFIED", - 1: "EXAMPLE_TYPE_RANDOM", - 2: "EXAMPLE_TYPE_SLOWEST", - 3: "EXAMPLE_TYPE_FASTEST", - 4: "EXAMPLE_TYPE_WITH_ERROR", - } - ExampleType_value = map[string]int32{ - "EXAMPLE_TYPE_UNSPECIFIED": 0, - "EXAMPLE_TYPE_RANDOM": 1, - "EXAMPLE_TYPE_SLOWEST": 2, - "EXAMPLE_TYPE_FASTEST": 3, - "EXAMPLE_TYPE_WITH_ERROR": 4, - } -) - -func (x ExampleType) Enum() *ExampleType { - p := new(ExampleType) - *p = x - return p -} - -func (x ExampleType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (ExampleType) Descriptor() protoreflect.EnumDescriptor { - return file_agent_v1_collector_proto_enumTypes[0].Descriptor() -} - -func (ExampleType) Type() protoreflect.EnumType { - return &file_agent_v1_collector_proto_enumTypes[0] -} - -func (x ExampleType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use ExampleType.Descriptor instead. -func (ExampleType) EnumDescriptor() ([]byte, []int) { - return file_agent_v1_collector_proto_rawDescGZIP(), []int{0} -} - -// MetricsBucket is aggregated message created by pmm-agent. -// Contains information about one query selected in defined way from query class in specific period of time. -type MetricsBucket struct { - state protoimpl.MessageState `protogen:"open.v1"` - Common *MetricsBucket_Common `protobuf:"bytes,1,opt,name=common,proto3" json:"common,omitempty"` - Mysql *MetricsBucket_MySQL `protobuf:"bytes,2,opt,name=mysql,proto3" json:"mysql,omitempty"` - Mongodb *MetricsBucket_MongoDB `protobuf:"bytes,3,opt,name=mongodb,proto3" json:"mongodb,omitempty"` - Postgresql *MetricsBucket_PostgreSQL `protobuf:"bytes,4,opt,name=postgresql,proto3" json:"postgresql,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *MetricsBucket) Reset() { - *x = MetricsBucket{} - mi := &file_agent_v1_collector_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *MetricsBucket) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MetricsBucket) ProtoMessage() {} - -func (x *MetricsBucket) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_collector_proto_msgTypes[0] - 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 MetricsBucket.ProtoReflect.Descriptor instead. -func (*MetricsBucket) Descriptor() ([]byte, []int) { - return file_agent_v1_collector_proto_rawDescGZIP(), []int{0} -} - -func (x *MetricsBucket) GetCommon() *MetricsBucket_Common { - if x != nil { - return x.Common - } - return nil -} - -func (x *MetricsBucket) GetMysql() *MetricsBucket_MySQL { - if x != nil { - return x.Mysql - } - return nil -} - -func (x *MetricsBucket) GetMongodb() *MetricsBucket_MongoDB { - if x != nil { - return x.Mongodb - } - return nil -} - -func (x *MetricsBucket) GetPostgresql() *MetricsBucket_PostgreSQL { - if x != nil { - return x.Postgresql - } - return nil -} - -// HistogramItem represents one item in histogram. -type HistogramItem struct { - state protoimpl.MessageState `protogen:"open.v1"` - Range string `protobuf:"bytes,1,opt,name=range,proto3" json:"range,omitempty"` - Frequency uint32 `protobuf:"varint,2,opt,name=frequency,proto3" json:"frequency,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *HistogramItem) Reset() { - *x = HistogramItem{} - mi := &file_agent_v1_collector_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *HistogramItem) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*HistogramItem) ProtoMessage() {} - -func (x *HistogramItem) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_collector_proto_msgTypes[1] - 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 HistogramItem.ProtoReflect.Descriptor instead. -func (*HistogramItem) Descriptor() ([]byte, []int) { - return file_agent_v1_collector_proto_rawDescGZIP(), []int{1} -} - -func (x *HistogramItem) GetRange() string { - if x != nil { - return x.Range - } - return "" -} - -func (x *HistogramItem) GetFrequency() uint32 { - if x != nil { - return x.Frequency - } - return 0 -} - -// Common contains common fields for all DBs. -type MetricsBucket_Common struct { - state protoimpl.MessageState `protogen:"open.v1"` - // md5 of digest_text/fingerprint. - Queryid string `protobuf:"bytes,1,opt,name=queryid,proto3" json:"queryid,omitempty"` - // contains fingerprint prepared by sql parser, which can be different than fingerprint. - ExplainFingerprint string `protobuf:"bytes,25,opt,name=explain_fingerprint,json=explainFingerprint,proto3" json:"explain_fingerprint,omitempty"` - // ammount of variables in query. - PlaceholdersCount uint32 `protobuf:"varint,26,opt,name=placeholders_count,json=placeholdersCount,proto3" json:"placeholders_count,omitempty"` - // List of keys and values of comments. - Comments map[string]string `protobuf:"bytes,27,rep,name=comments,proto3" json:"comments,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - // digest_text - query signature. Query without values. - Fingerprint string `protobuf:"bytes,2,opt,name=fingerprint,proto3" json:"fingerprint,omitempty"` - // Dimension Group. - // - // MongoDB or PostgreSQL database. - // Several databases can't be combined in a single declarative query. - Database string `protobuf:"bytes,3,opt,name=database,proto3" json:"database,omitempty"` - // MySQL database or PostgreSQL schema. - // Several schemas can be combined in a single declarative query. - Schema string `protobuf:"bytes,4,opt,name=schema,proto3" json:"schema,omitempty"` - // Tables or Collections list. - Tables []string `protobuf:"bytes,5,rep,name=tables,proto3" json:"tables,omitempty"` - // client user name. - Username string `protobuf:"bytes,6,opt,name=username,proto3" json:"username,omitempty"` - // client IP or hostname. - ClientHost string `protobuf:"bytes,7,opt,name=client_host,json=clientHost,proto3" json:"client_host,omitempty"` - // Identifier of agent that collect and send metrics. - AgentId string `protobuf:"bytes,8,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"` - // Metrics source. - AgentType v1.AgentType `protobuf:"varint,9,opt,name=agent_type,json=agentType,proto3,enum=inventory.v1.AgentType" json:"agent_type,omitempty"` - // Time when collection of bucket started. - PeriodStartUnixSecs uint32 `protobuf:"varint,10,opt,name=period_start_unix_secs,json=periodStartUnixSecs,proto3" json:"period_start_unix_secs,omitempty"` - // Duration of bucket. - PeriodLengthSecs uint32 `protobuf:"varint,11,opt,name=period_length_secs,json=periodLengthSecs,proto3" json:"period_length_secs,omitempty"` - // One of query example from set found in bucket. - Example string `protobuf:"bytes,12,opt,name=example,proto3" json:"example,omitempty"` - ExampleType ExampleType `protobuf:"varint,14,opt,name=example_type,json=exampleType,proto3,enum=agent.v1.ExampleType" json:"example_type,omitempty"` - // Indicates if the query example is truncated. - IsTruncated bool `protobuf:"varint,24,opt,name=is_truncated,json=isTruncated,proto3" json:"is_truncated,omitempty"` - // How many queries was with warnings in bucket. - NumQueriesWithWarnings float32 `protobuf:"fixed32,15,opt,name=num_queries_with_warnings,json=numQueriesWithWarnings,proto3" json:"num_queries_with_warnings,omitempty"` - // How many queries was with error in bucket. - NumQueriesWithErrors float32 `protobuf:"fixed32,16,opt,name=num_queries_with_errors,json=numQueriesWithErrors,proto3" json:"num_queries_with_errors,omitempty"` - // List of errors: {code: count}. - Errors map[uint64]uint64 `protobuf:"bytes,17,rep,name=errors,proto3" json:"errors,omitempty" protobuf_key:"varint,1,opt,name=key" protobuf_val:"varint,2,opt,name=value"` - // Amount queries in this bucket. - NumQueries float32 `protobuf:"fixed32,18,opt,name=num_queries,json=numQueries,proto3" json:"num_queries,omitempty"` - // How many times query_time was found. - MQueryTimeCnt float32 `protobuf:"fixed32,19,opt,name=m_query_time_cnt,json=mQueryTimeCnt,proto3" json:"m_query_time_cnt,omitempty"` - // The statement execution time in seconds. - MQueryTimeSum float32 `protobuf:"fixed32,20,opt,name=m_query_time_sum,json=mQueryTimeSum,proto3" json:"m_query_time_sum,omitempty"` - // Smallest value of query_time in bucket. - MQueryTimeMin float32 `protobuf:"fixed32,21,opt,name=m_query_time_min,json=mQueryTimeMin,proto3" json:"m_query_time_min,omitempty"` - // Biggest value of query_time in bucket. - MQueryTimeMax float32 `protobuf:"fixed32,22,opt,name=m_query_time_max,json=mQueryTimeMax,proto3" json:"m_query_time_max,omitempty"` - // 99 percentile of value of query_time in bucket. - MQueryTimeP99 float32 `protobuf:"fixed32,23,opt,name=m_query_time_p99,json=mQueryTimeP99,proto3" json:"m_query_time_p99,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *MetricsBucket_Common) Reset() { - *x = MetricsBucket_Common{} - mi := &file_agent_v1_collector_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *MetricsBucket_Common) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MetricsBucket_Common) ProtoMessage() {} - -func (x *MetricsBucket_Common) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_collector_proto_msgTypes[2] - 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 MetricsBucket_Common.ProtoReflect.Descriptor instead. -func (*MetricsBucket_Common) Descriptor() ([]byte, []int) { - return file_agent_v1_collector_proto_rawDescGZIP(), []int{0, 0} -} - -func (x *MetricsBucket_Common) GetQueryid() string { - if x != nil { - return x.Queryid - } - return "" -} - -func (x *MetricsBucket_Common) GetExplainFingerprint() string { - if x != nil { - return x.ExplainFingerprint - } - return "" -} - -func (x *MetricsBucket_Common) GetPlaceholdersCount() uint32 { - if x != nil { - return x.PlaceholdersCount - } - return 0 -} - -func (x *MetricsBucket_Common) GetComments() map[string]string { - if x != nil { - return x.Comments - } - return nil -} - -func (x *MetricsBucket_Common) GetFingerprint() string { - if x != nil { - return x.Fingerprint - } - return "" -} - -func (x *MetricsBucket_Common) GetDatabase() string { - if x != nil { - return x.Database - } - return "" -} - -func (x *MetricsBucket_Common) GetSchema() string { - if x != nil { - return x.Schema - } - return "" -} - -func (x *MetricsBucket_Common) GetTables() []string { - if x != nil { - return x.Tables - } - return nil -} - -func (x *MetricsBucket_Common) GetUsername() string { - if x != nil { - return x.Username - } - return "" -} - -func (x *MetricsBucket_Common) GetClientHost() string { - if x != nil { - return x.ClientHost - } - return "" -} - -func (x *MetricsBucket_Common) GetAgentId() string { - if x != nil { - return x.AgentId - } - return "" -} - -func (x *MetricsBucket_Common) GetAgentType() v1.AgentType { - if x != nil { - return x.AgentType - } - return v1.AgentType(0) -} - -func (x *MetricsBucket_Common) GetPeriodStartUnixSecs() uint32 { - if x != nil { - return x.PeriodStartUnixSecs - } - return 0 -} - -func (x *MetricsBucket_Common) GetPeriodLengthSecs() uint32 { - if x != nil { - return x.PeriodLengthSecs - } - return 0 -} - -func (x *MetricsBucket_Common) GetExample() string { - if x != nil { - return x.Example - } - return "" -} - -func (x *MetricsBucket_Common) GetExampleType() ExampleType { - if x != nil { - return x.ExampleType - } - return ExampleType_EXAMPLE_TYPE_UNSPECIFIED -} - -func (x *MetricsBucket_Common) GetIsTruncated() bool { - if x != nil { - return x.IsTruncated - } - return false -} - -func (x *MetricsBucket_Common) GetNumQueriesWithWarnings() float32 { - if x != nil { - return x.NumQueriesWithWarnings - } - return 0 -} - -func (x *MetricsBucket_Common) GetNumQueriesWithErrors() float32 { - if x != nil { - return x.NumQueriesWithErrors - } - return 0 -} - -func (x *MetricsBucket_Common) GetErrors() map[uint64]uint64 { - if x != nil { - return x.Errors - } - return nil -} - -func (x *MetricsBucket_Common) GetNumQueries() float32 { - if x != nil { - return x.NumQueries - } - return 0 -} - -func (x *MetricsBucket_Common) GetMQueryTimeCnt() float32 { - if x != nil { - return x.MQueryTimeCnt - } - return 0 -} - -func (x *MetricsBucket_Common) GetMQueryTimeSum() float32 { - if x != nil { - return x.MQueryTimeSum - } - return 0 -} - -func (x *MetricsBucket_Common) GetMQueryTimeMin() float32 { - if x != nil { - return x.MQueryTimeMin - } - return 0 -} - -func (x *MetricsBucket_Common) GetMQueryTimeMax() float32 { - if x != nil { - return x.MQueryTimeMax - } - return 0 -} - -func (x *MetricsBucket_Common) GetMQueryTimeP99() float32 { - if x != nil { - return x.MQueryTimeP99 - } - return 0 -} - -// MySQL contains metrics for MySQL. -type MetricsBucket_MySQL struct { - state protoimpl.MessageState `protogen:"open.v1"` - MLockTimeCnt float32 `protobuf:"fixed32,1,opt,name=m_lock_time_cnt,json=mLockTimeCnt,proto3" json:"m_lock_time_cnt,omitempty"` - // The time to acquire locks in seconds. - MLockTimeSum float32 `protobuf:"fixed32,2,opt,name=m_lock_time_sum,json=mLockTimeSum,proto3" json:"m_lock_time_sum,omitempty"` - MLockTimeMin float32 `protobuf:"fixed32,3,opt,name=m_lock_time_min,json=mLockTimeMin,proto3" json:"m_lock_time_min,omitempty"` - MLockTimeMax float32 `protobuf:"fixed32,4,opt,name=m_lock_time_max,json=mLockTimeMax,proto3" json:"m_lock_time_max,omitempty"` - MLockTimeP99 float32 `protobuf:"fixed32,5,opt,name=m_lock_time_p99,json=mLockTimeP99,proto3" json:"m_lock_time_p99,omitempty"` - MRowsSentCnt float32 `protobuf:"fixed32,6,opt,name=m_rows_sent_cnt,json=mRowsSentCnt,proto3" json:"m_rows_sent_cnt,omitempty"` - // The number of rows sent to the client. - MRowsSentSum float32 `protobuf:"fixed32,7,opt,name=m_rows_sent_sum,json=mRowsSentSum,proto3" json:"m_rows_sent_sum,omitempty"` - MRowsSentMin float32 `protobuf:"fixed32,8,opt,name=m_rows_sent_min,json=mRowsSentMin,proto3" json:"m_rows_sent_min,omitempty"` - MRowsSentMax float32 `protobuf:"fixed32,9,opt,name=m_rows_sent_max,json=mRowsSentMax,proto3" json:"m_rows_sent_max,omitempty"` - MRowsSentP99 float32 `protobuf:"fixed32,10,opt,name=m_rows_sent_p99,json=mRowsSentP99,proto3" json:"m_rows_sent_p99,omitempty"` - MRowsExaminedCnt float32 `protobuf:"fixed32,11,opt,name=m_rows_examined_cnt,json=mRowsExaminedCnt,proto3" json:"m_rows_examined_cnt,omitempty"` - // Number of rows scanned - SELECT. - MRowsExaminedSum float32 `protobuf:"fixed32,12,opt,name=m_rows_examined_sum,json=mRowsExaminedSum,proto3" json:"m_rows_examined_sum,omitempty"` - MRowsExaminedMin float32 `protobuf:"fixed32,13,opt,name=m_rows_examined_min,json=mRowsExaminedMin,proto3" json:"m_rows_examined_min,omitempty"` - MRowsExaminedMax float32 `protobuf:"fixed32,14,opt,name=m_rows_examined_max,json=mRowsExaminedMax,proto3" json:"m_rows_examined_max,omitempty"` - MRowsExaminedP99 float32 `protobuf:"fixed32,15,opt,name=m_rows_examined_p99,json=mRowsExaminedP99,proto3" json:"m_rows_examined_p99,omitempty"` - MRowsAffectedCnt float32 `protobuf:"fixed32,16,opt,name=m_rows_affected_cnt,json=mRowsAffectedCnt,proto3" json:"m_rows_affected_cnt,omitempty"` - // Number of rows changed - UPDATE, DELETE, INSERT. - MRowsAffectedSum float32 `protobuf:"fixed32,17,opt,name=m_rows_affected_sum,json=mRowsAffectedSum,proto3" json:"m_rows_affected_sum,omitempty"` - MRowsAffectedMin float32 `protobuf:"fixed32,18,opt,name=m_rows_affected_min,json=mRowsAffectedMin,proto3" json:"m_rows_affected_min,omitempty"` - MRowsAffectedMax float32 `protobuf:"fixed32,19,opt,name=m_rows_affected_max,json=mRowsAffectedMax,proto3" json:"m_rows_affected_max,omitempty"` - MRowsAffectedP99 float32 `protobuf:"fixed32,20,opt,name=m_rows_affected_p99,json=mRowsAffectedP99,proto3" json:"m_rows_affected_p99,omitempty"` - MRowsReadCnt float32 `protobuf:"fixed32,21,opt,name=m_rows_read_cnt,json=mRowsReadCnt,proto3" json:"m_rows_read_cnt,omitempty"` - // The number of rows read from tables. - MRowsReadSum float32 `protobuf:"fixed32,22,opt,name=m_rows_read_sum,json=mRowsReadSum,proto3" json:"m_rows_read_sum,omitempty"` - MRowsReadMin float32 `protobuf:"fixed32,23,opt,name=m_rows_read_min,json=mRowsReadMin,proto3" json:"m_rows_read_min,omitempty"` - MRowsReadMax float32 `protobuf:"fixed32,24,opt,name=m_rows_read_max,json=mRowsReadMax,proto3" json:"m_rows_read_max,omitempty"` - MRowsReadP99 float32 `protobuf:"fixed32,25,opt,name=m_rows_read_p99,json=mRowsReadP99,proto3" json:"m_rows_read_p99,omitempty"` - MMergePassesCnt float32 `protobuf:"fixed32,26,opt,name=m_merge_passes_cnt,json=mMergePassesCnt,proto3" json:"m_merge_passes_cnt,omitempty"` - // The number of merge passes that the sort algorithm has had to do. - MMergePassesSum float32 `protobuf:"fixed32,27,opt,name=m_merge_passes_sum,json=mMergePassesSum,proto3" json:"m_merge_passes_sum,omitempty"` - MMergePassesMin float32 `protobuf:"fixed32,28,opt,name=m_merge_passes_min,json=mMergePassesMin,proto3" json:"m_merge_passes_min,omitempty"` - MMergePassesMax float32 `protobuf:"fixed32,29,opt,name=m_merge_passes_max,json=mMergePassesMax,proto3" json:"m_merge_passes_max,omitempty"` - MMergePassesP99 float32 `protobuf:"fixed32,30,opt,name=m_merge_passes_p99,json=mMergePassesP99,proto3" json:"m_merge_passes_p99,omitempty"` - MInnodbIoROpsCnt float32 `protobuf:"fixed32,31,opt,name=m_innodb_io_r_ops_cnt,json=mInnodbIoROpsCnt,proto3" json:"m_innodb_io_r_ops_cnt,omitempty"` - // Counts the number of page read operations scheduled. - MInnodbIoROpsSum float32 `protobuf:"fixed32,32,opt,name=m_innodb_io_r_ops_sum,json=mInnodbIoROpsSum,proto3" json:"m_innodb_io_r_ops_sum,omitempty"` - MInnodbIoROpsMin float32 `protobuf:"fixed32,33,opt,name=m_innodb_io_r_ops_min,json=mInnodbIoROpsMin,proto3" json:"m_innodb_io_r_ops_min,omitempty"` - MInnodbIoROpsMax float32 `protobuf:"fixed32,34,opt,name=m_innodb_io_r_ops_max,json=mInnodbIoROpsMax,proto3" json:"m_innodb_io_r_ops_max,omitempty"` - MInnodbIoROpsP99 float32 `protobuf:"fixed32,35,opt,name=m_innodb_io_r_ops_p99,json=mInnodbIoROpsP99,proto3" json:"m_innodb_io_r_ops_p99,omitempty"` - MInnodbIoRBytesCnt float32 `protobuf:"fixed32,36,opt,name=m_innodb_io_r_bytes_cnt,json=mInnodbIoRBytesCnt,proto3" json:"m_innodb_io_r_bytes_cnt,omitempty"` - // Similar to innodb_IO_r_ops, but the unit is bytes. - MInnodbIoRBytesSum float32 `protobuf:"fixed32,37,opt,name=m_innodb_io_r_bytes_sum,json=mInnodbIoRBytesSum,proto3" json:"m_innodb_io_r_bytes_sum,omitempty"` - MInnodbIoRBytesMin float32 `protobuf:"fixed32,38,opt,name=m_innodb_io_r_bytes_min,json=mInnodbIoRBytesMin,proto3" json:"m_innodb_io_r_bytes_min,omitempty"` - MInnodbIoRBytesMax float32 `protobuf:"fixed32,39,opt,name=m_innodb_io_r_bytes_max,json=mInnodbIoRBytesMax,proto3" json:"m_innodb_io_r_bytes_max,omitempty"` - MInnodbIoRBytesP99 float32 `protobuf:"fixed32,40,opt,name=m_innodb_io_r_bytes_p99,json=mInnodbIoRBytesP99,proto3" json:"m_innodb_io_r_bytes_p99,omitempty"` - MInnodbIoRWaitCnt float32 `protobuf:"fixed32,41,opt,name=m_innodb_io_r_wait_cnt,json=mInnodbIoRWaitCnt,proto3" json:"m_innodb_io_r_wait_cnt,omitempty"` - // Shows how long (in seconds) it took InnoDB to actually read the data from storage. - MInnodbIoRWaitSum float32 `protobuf:"fixed32,42,opt,name=m_innodb_io_r_wait_sum,json=mInnodbIoRWaitSum,proto3" json:"m_innodb_io_r_wait_sum,omitempty"` - MInnodbIoRWaitMin float32 `protobuf:"fixed32,43,opt,name=m_innodb_io_r_wait_min,json=mInnodbIoRWaitMin,proto3" json:"m_innodb_io_r_wait_min,omitempty"` - MInnodbIoRWaitMax float32 `protobuf:"fixed32,44,opt,name=m_innodb_io_r_wait_max,json=mInnodbIoRWaitMax,proto3" json:"m_innodb_io_r_wait_max,omitempty"` - MInnodbIoRWaitP99 float32 `protobuf:"fixed32,45,opt,name=m_innodb_io_r_wait_p99,json=mInnodbIoRWaitP99,proto3" json:"m_innodb_io_r_wait_p99,omitempty"` - MInnodbRecLockWaitCnt float32 `protobuf:"fixed32,46,opt,name=m_innodb_rec_lock_wait_cnt,json=mInnodbRecLockWaitCnt,proto3" json:"m_innodb_rec_lock_wait_cnt,omitempty"` - // Shows how long (in seconds) the query waited for row locks. - MInnodbRecLockWaitSum float32 `protobuf:"fixed32,47,opt,name=m_innodb_rec_lock_wait_sum,json=mInnodbRecLockWaitSum,proto3" json:"m_innodb_rec_lock_wait_sum,omitempty"` - MInnodbRecLockWaitMin float32 `protobuf:"fixed32,48,opt,name=m_innodb_rec_lock_wait_min,json=mInnodbRecLockWaitMin,proto3" json:"m_innodb_rec_lock_wait_min,omitempty"` - MInnodbRecLockWaitMax float32 `protobuf:"fixed32,49,opt,name=m_innodb_rec_lock_wait_max,json=mInnodbRecLockWaitMax,proto3" json:"m_innodb_rec_lock_wait_max,omitempty"` - MInnodbRecLockWaitP99 float32 `protobuf:"fixed32,50,opt,name=m_innodb_rec_lock_wait_p99,json=mInnodbRecLockWaitP99,proto3" json:"m_innodb_rec_lock_wait_p99,omitempty"` - MInnodbQueueWaitCnt float32 `protobuf:"fixed32,51,opt,name=m_innodb_queue_wait_cnt,json=mInnodbQueueWaitCnt,proto3" json:"m_innodb_queue_wait_cnt,omitempty"` - // Shows how long (in seconds) the query spent either waiting to enter the InnoDB queue or inside that queue waiting for execution. - MInnodbQueueWaitSum float32 `protobuf:"fixed32,52,opt,name=m_innodb_queue_wait_sum,json=mInnodbQueueWaitSum,proto3" json:"m_innodb_queue_wait_sum,omitempty"` - MInnodbQueueWaitMin float32 `protobuf:"fixed32,53,opt,name=m_innodb_queue_wait_min,json=mInnodbQueueWaitMin,proto3" json:"m_innodb_queue_wait_min,omitempty"` - MInnodbQueueWaitMax float32 `protobuf:"fixed32,54,opt,name=m_innodb_queue_wait_max,json=mInnodbQueueWaitMax,proto3" json:"m_innodb_queue_wait_max,omitempty"` - MInnodbQueueWaitP99 float32 `protobuf:"fixed32,55,opt,name=m_innodb_queue_wait_p99,json=mInnodbQueueWaitP99,proto3" json:"m_innodb_queue_wait_p99,omitempty"` - MInnodbPagesDistinctCnt float32 `protobuf:"fixed32,56,opt,name=m_innodb_pages_distinct_cnt,json=mInnodbPagesDistinctCnt,proto3" json:"m_innodb_pages_distinct_cnt,omitempty"` - // Counts approximately the number of unique pages the query accessed. - MInnodbPagesDistinctSum float32 `protobuf:"fixed32,57,opt,name=m_innodb_pages_distinct_sum,json=mInnodbPagesDistinctSum,proto3" json:"m_innodb_pages_distinct_sum,omitempty"` - MInnodbPagesDistinctMin float32 `protobuf:"fixed32,58,opt,name=m_innodb_pages_distinct_min,json=mInnodbPagesDistinctMin,proto3" json:"m_innodb_pages_distinct_min,omitempty"` - MInnodbPagesDistinctMax float32 `protobuf:"fixed32,59,opt,name=m_innodb_pages_distinct_max,json=mInnodbPagesDistinctMax,proto3" json:"m_innodb_pages_distinct_max,omitempty"` - MInnodbPagesDistinctP99 float32 `protobuf:"fixed32,60,opt,name=m_innodb_pages_distinct_p99,json=mInnodbPagesDistinctP99,proto3" json:"m_innodb_pages_distinct_p99,omitempty"` - MQueryLengthCnt float32 `protobuf:"fixed32,61,opt,name=m_query_length_cnt,json=mQueryLengthCnt,proto3" json:"m_query_length_cnt,omitempty"` - // Shows how long the query is. - MQueryLengthSum float32 `protobuf:"fixed32,62,opt,name=m_query_length_sum,json=mQueryLengthSum,proto3" json:"m_query_length_sum,omitempty"` - MQueryLengthMin float32 `protobuf:"fixed32,63,opt,name=m_query_length_min,json=mQueryLengthMin,proto3" json:"m_query_length_min,omitempty"` - MQueryLengthMax float32 `protobuf:"fixed32,64,opt,name=m_query_length_max,json=mQueryLengthMax,proto3" json:"m_query_length_max,omitempty"` - MQueryLengthP99 float32 `protobuf:"fixed32,65,opt,name=m_query_length_p99,json=mQueryLengthP99,proto3" json:"m_query_length_p99,omitempty"` - MBytesSentCnt float32 `protobuf:"fixed32,66,opt,name=m_bytes_sent_cnt,json=mBytesSentCnt,proto3" json:"m_bytes_sent_cnt,omitempty"` - // The number of bytes sent to all clients. - MBytesSentSum float32 `protobuf:"fixed32,67,opt,name=m_bytes_sent_sum,json=mBytesSentSum,proto3" json:"m_bytes_sent_sum,omitempty"` - MBytesSentMin float32 `protobuf:"fixed32,68,opt,name=m_bytes_sent_min,json=mBytesSentMin,proto3" json:"m_bytes_sent_min,omitempty"` - MBytesSentMax float32 `protobuf:"fixed32,69,opt,name=m_bytes_sent_max,json=mBytesSentMax,proto3" json:"m_bytes_sent_max,omitempty"` - MBytesSentP99 float32 `protobuf:"fixed32,70,opt,name=m_bytes_sent_p99,json=mBytesSentP99,proto3" json:"m_bytes_sent_p99,omitempty"` - MTmpTablesCnt float32 `protobuf:"fixed32,71,opt,name=m_tmp_tables_cnt,json=mTmpTablesCnt,proto3" json:"m_tmp_tables_cnt,omitempty"` - // Number of temporary tables created on memory for the query. - MTmpTablesSum float32 `protobuf:"fixed32,72,opt,name=m_tmp_tables_sum,json=mTmpTablesSum,proto3" json:"m_tmp_tables_sum,omitempty"` - MTmpTablesMin float32 `protobuf:"fixed32,73,opt,name=m_tmp_tables_min,json=mTmpTablesMin,proto3" json:"m_tmp_tables_min,omitempty"` - MTmpTablesMax float32 `protobuf:"fixed32,74,opt,name=m_tmp_tables_max,json=mTmpTablesMax,proto3" json:"m_tmp_tables_max,omitempty"` - MTmpTablesP99 float32 `protobuf:"fixed32,75,opt,name=m_tmp_tables_p99,json=mTmpTablesP99,proto3" json:"m_tmp_tables_p99,omitempty"` - MTmpDiskTablesCnt float32 `protobuf:"fixed32,76,opt,name=m_tmp_disk_tables_cnt,json=mTmpDiskTablesCnt,proto3" json:"m_tmp_disk_tables_cnt,omitempty"` - // Number of temporary tables created on disk for the query. - MTmpDiskTablesSum float32 `protobuf:"fixed32,77,opt,name=m_tmp_disk_tables_sum,json=mTmpDiskTablesSum,proto3" json:"m_tmp_disk_tables_sum,omitempty"` - MTmpDiskTablesMin float32 `protobuf:"fixed32,78,opt,name=m_tmp_disk_tables_min,json=mTmpDiskTablesMin,proto3" json:"m_tmp_disk_tables_min,omitempty"` - MTmpDiskTablesMax float32 `protobuf:"fixed32,79,opt,name=m_tmp_disk_tables_max,json=mTmpDiskTablesMax,proto3" json:"m_tmp_disk_tables_max,omitempty"` - MTmpDiskTablesP99 float32 `protobuf:"fixed32,80,opt,name=m_tmp_disk_tables_p99,json=mTmpDiskTablesP99,proto3" json:"m_tmp_disk_tables_p99,omitempty"` - MTmpTableSizesCnt float32 `protobuf:"fixed32,81,opt,name=m_tmp_table_sizes_cnt,json=mTmpTableSizesCnt,proto3" json:"m_tmp_table_sizes_cnt,omitempty"` - // Total Size in bytes for all temporary tables used in the query. - MTmpTableSizesSum float32 `protobuf:"fixed32,82,opt,name=m_tmp_table_sizes_sum,json=mTmpTableSizesSum,proto3" json:"m_tmp_table_sizes_sum,omitempty"` - MTmpTableSizesMin float32 `protobuf:"fixed32,83,opt,name=m_tmp_table_sizes_min,json=mTmpTableSizesMin,proto3" json:"m_tmp_table_sizes_min,omitempty"` - MTmpTableSizesMax float32 `protobuf:"fixed32,84,opt,name=m_tmp_table_sizes_max,json=mTmpTableSizesMax,proto3" json:"m_tmp_table_sizes_max,omitempty"` - MTmpTableSizesP99 float32 `protobuf:"fixed32,85,opt,name=m_tmp_table_sizes_p99,json=mTmpTableSizesP99,proto3" json:"m_tmp_table_sizes_p99,omitempty"` - // Boolean metrics: - // - *_cnt - how many times this metric was met. - // - *_sum - how many times this metric was true. - MQcHitCnt float32 `protobuf:"fixed32,86,opt,name=m_qc_hit_cnt,json=mQcHitCnt,proto3" json:"m_qc_hit_cnt,omitempty"` - // Query Cache hits. - MQcHitSum float32 `protobuf:"fixed32,87,opt,name=m_qc_hit_sum,json=mQcHitSum,proto3" json:"m_qc_hit_sum,omitempty"` - MFullScanCnt float32 `protobuf:"fixed32,88,opt,name=m_full_scan_cnt,json=mFullScanCnt,proto3" json:"m_full_scan_cnt,omitempty"` - // The query performed a full table scan. - MFullScanSum float32 `protobuf:"fixed32,89,opt,name=m_full_scan_sum,json=mFullScanSum,proto3" json:"m_full_scan_sum,omitempty"` - MFullJoinCnt float32 `protobuf:"fixed32,90,opt,name=m_full_join_cnt,json=mFullJoinCnt,proto3" json:"m_full_join_cnt,omitempty"` - // The query performed a full join (a join without indexes). - MFullJoinSum float32 `protobuf:"fixed32,91,opt,name=m_full_join_sum,json=mFullJoinSum,proto3" json:"m_full_join_sum,omitempty"` - MTmpTableCnt float32 `protobuf:"fixed32,92,opt,name=m_tmp_table_cnt,json=mTmpTableCnt,proto3" json:"m_tmp_table_cnt,omitempty"` - // The query created an implicit internal temporary table. - MTmpTableSum float32 `protobuf:"fixed32,93,opt,name=m_tmp_table_sum,json=mTmpTableSum,proto3" json:"m_tmp_table_sum,omitempty"` - MTmpTableOnDiskCnt float32 `protobuf:"fixed32,94,opt,name=m_tmp_table_on_disk_cnt,json=mTmpTableOnDiskCnt,proto3" json:"m_tmp_table_on_disk_cnt,omitempty"` - // The querys temporary table was stored on disk. - MTmpTableOnDiskSum float32 `protobuf:"fixed32,95,opt,name=m_tmp_table_on_disk_sum,json=mTmpTableOnDiskSum,proto3" json:"m_tmp_table_on_disk_sum,omitempty"` - MFilesortCnt float32 `protobuf:"fixed32,96,opt,name=m_filesort_cnt,json=mFilesortCnt,proto3" json:"m_filesort_cnt,omitempty"` - // The query used a filesort. - MFilesortSum float32 `protobuf:"fixed32,97,opt,name=m_filesort_sum,json=mFilesortSum,proto3" json:"m_filesort_sum,omitempty"` - MFilesortOnDiskCnt float32 `protobuf:"fixed32,98,opt,name=m_filesort_on_disk_cnt,json=mFilesortOnDiskCnt,proto3" json:"m_filesort_on_disk_cnt,omitempty"` - // The filesort was performed on disk. - MFilesortOnDiskSum float32 `protobuf:"fixed32,99,opt,name=m_filesort_on_disk_sum,json=mFilesortOnDiskSum,proto3" json:"m_filesort_on_disk_sum,omitempty"` - MSelectFullRangeJoinCnt float32 `protobuf:"fixed32,100,opt,name=m_select_full_range_join_cnt,json=mSelectFullRangeJoinCnt,proto3" json:"m_select_full_range_join_cnt,omitempty"` - // The number of joins that used a range search on a reference table. - MSelectFullRangeJoinSum float32 `protobuf:"fixed32,101,opt,name=m_select_full_range_join_sum,json=mSelectFullRangeJoinSum,proto3" json:"m_select_full_range_join_sum,omitempty"` - MSelectRangeCnt float32 `protobuf:"fixed32,102,opt,name=m_select_range_cnt,json=mSelectRangeCnt,proto3" json:"m_select_range_cnt,omitempty"` - // The number of joins that used ranges on the first table. - MSelectRangeSum float32 `protobuf:"fixed32,103,opt,name=m_select_range_sum,json=mSelectRangeSum,proto3" json:"m_select_range_sum,omitempty"` - MSelectRangeCheckCnt float32 `protobuf:"fixed32,104,opt,name=m_select_range_check_cnt,json=mSelectRangeCheckCnt,proto3" json:"m_select_range_check_cnt,omitempty"` - // The number of joins without keys that check for key usage after each row. - MSelectRangeCheckSum float32 `protobuf:"fixed32,105,opt,name=m_select_range_check_sum,json=mSelectRangeCheckSum,proto3" json:"m_select_range_check_sum,omitempty"` - MSortRangeCnt float32 `protobuf:"fixed32,106,opt,name=m_sort_range_cnt,json=mSortRangeCnt,proto3" json:"m_sort_range_cnt,omitempty"` - // The number of sorts that were done using ranges. - MSortRangeSum float32 `protobuf:"fixed32,107,opt,name=m_sort_range_sum,json=mSortRangeSum,proto3" json:"m_sort_range_sum,omitempty"` - MSortRowsCnt float32 `protobuf:"fixed32,108,opt,name=m_sort_rows_cnt,json=mSortRowsCnt,proto3" json:"m_sort_rows_cnt,omitempty"` - // The number of sorted rows. - MSortRowsSum float32 `protobuf:"fixed32,109,opt,name=m_sort_rows_sum,json=mSortRowsSum,proto3" json:"m_sort_rows_sum,omitempty"` - MSortScanCnt float32 `protobuf:"fixed32,110,opt,name=m_sort_scan_cnt,json=mSortScanCnt,proto3" json:"m_sort_scan_cnt,omitempty"` - // The number of sorts that were done by scanning the table. - MSortScanSum float32 `protobuf:"fixed32,111,opt,name=m_sort_scan_sum,json=mSortScanSum,proto3" json:"m_sort_scan_sum,omitempty"` - MNoIndexUsedCnt float32 `protobuf:"fixed32,112,opt,name=m_no_index_used_cnt,json=mNoIndexUsedCnt,proto3" json:"m_no_index_used_cnt,omitempty"` - // The number of queries without index. - MNoIndexUsedSum float32 `protobuf:"fixed32,113,opt,name=m_no_index_used_sum,json=mNoIndexUsedSum,proto3" json:"m_no_index_used_sum,omitempty"` - MNoGoodIndexUsedCnt float32 `protobuf:"fixed32,114,opt,name=m_no_good_index_used_cnt,json=mNoGoodIndexUsedCnt,proto3" json:"m_no_good_index_used_cnt,omitempty"` - // The number of queries without good index. - MNoGoodIndexUsedSum float32 `protobuf:"fixed32,115,opt,name=m_no_good_index_used_sum,json=mNoGoodIndexUsedSum,proto3" json:"m_no_good_index_used_sum,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *MetricsBucket_MySQL) Reset() { - *x = MetricsBucket_MySQL{} - mi := &file_agent_v1_collector_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *MetricsBucket_MySQL) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MetricsBucket_MySQL) ProtoMessage() {} - -func (x *MetricsBucket_MySQL) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_collector_proto_msgTypes[3] - 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 MetricsBucket_MySQL.ProtoReflect.Descriptor instead. -func (*MetricsBucket_MySQL) Descriptor() ([]byte, []int) { - return file_agent_v1_collector_proto_rawDescGZIP(), []int{0, 1} -} - -func (x *MetricsBucket_MySQL) GetMLockTimeCnt() float32 { - if x != nil { - return x.MLockTimeCnt - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMLockTimeSum() float32 { - if x != nil { - return x.MLockTimeSum - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMLockTimeMin() float32 { - if x != nil { - return x.MLockTimeMin - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMLockTimeMax() float32 { - if x != nil { - return x.MLockTimeMax - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMLockTimeP99() float32 { - if x != nil { - return x.MLockTimeP99 - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMRowsSentCnt() float32 { - if x != nil { - return x.MRowsSentCnt - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMRowsSentSum() float32 { - if x != nil { - return x.MRowsSentSum - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMRowsSentMin() float32 { - if x != nil { - return x.MRowsSentMin - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMRowsSentMax() float32 { - if x != nil { - return x.MRowsSentMax - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMRowsSentP99() float32 { - if x != nil { - return x.MRowsSentP99 - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMRowsExaminedCnt() float32 { - if x != nil { - return x.MRowsExaminedCnt - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMRowsExaminedSum() float32 { - if x != nil { - return x.MRowsExaminedSum - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMRowsExaminedMin() float32 { - if x != nil { - return x.MRowsExaminedMin - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMRowsExaminedMax() float32 { - if x != nil { - return x.MRowsExaminedMax - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMRowsExaminedP99() float32 { - if x != nil { - return x.MRowsExaminedP99 - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMRowsAffectedCnt() float32 { - if x != nil { - return x.MRowsAffectedCnt - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMRowsAffectedSum() float32 { - if x != nil { - return x.MRowsAffectedSum - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMRowsAffectedMin() float32 { - if x != nil { - return x.MRowsAffectedMin - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMRowsAffectedMax() float32 { - if x != nil { - return x.MRowsAffectedMax - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMRowsAffectedP99() float32 { - if x != nil { - return x.MRowsAffectedP99 - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMRowsReadCnt() float32 { - if x != nil { - return x.MRowsReadCnt - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMRowsReadSum() float32 { - if x != nil { - return x.MRowsReadSum - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMRowsReadMin() float32 { - if x != nil { - return x.MRowsReadMin - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMRowsReadMax() float32 { - if x != nil { - return x.MRowsReadMax - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMRowsReadP99() float32 { - if x != nil { - return x.MRowsReadP99 - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMMergePassesCnt() float32 { - if x != nil { - return x.MMergePassesCnt - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMMergePassesSum() float32 { - if x != nil { - return x.MMergePassesSum - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMMergePassesMin() float32 { - if x != nil { - return x.MMergePassesMin - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMMergePassesMax() float32 { - if x != nil { - return x.MMergePassesMax - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMMergePassesP99() float32 { - if x != nil { - return x.MMergePassesP99 - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMInnodbIoROpsCnt() float32 { - if x != nil { - return x.MInnodbIoROpsCnt - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMInnodbIoROpsSum() float32 { - if x != nil { - return x.MInnodbIoROpsSum - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMInnodbIoROpsMin() float32 { - if x != nil { - return x.MInnodbIoROpsMin - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMInnodbIoROpsMax() float32 { - if x != nil { - return x.MInnodbIoROpsMax - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMInnodbIoROpsP99() float32 { - if x != nil { - return x.MInnodbIoROpsP99 - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMInnodbIoRBytesCnt() float32 { - if x != nil { - return x.MInnodbIoRBytesCnt - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMInnodbIoRBytesSum() float32 { - if x != nil { - return x.MInnodbIoRBytesSum - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMInnodbIoRBytesMin() float32 { - if x != nil { - return x.MInnodbIoRBytesMin - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMInnodbIoRBytesMax() float32 { - if x != nil { - return x.MInnodbIoRBytesMax - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMInnodbIoRBytesP99() float32 { - if x != nil { - return x.MInnodbIoRBytesP99 - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMInnodbIoRWaitCnt() float32 { - if x != nil { - return x.MInnodbIoRWaitCnt - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMInnodbIoRWaitSum() float32 { - if x != nil { - return x.MInnodbIoRWaitSum - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMInnodbIoRWaitMin() float32 { - if x != nil { - return x.MInnodbIoRWaitMin - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMInnodbIoRWaitMax() float32 { - if x != nil { - return x.MInnodbIoRWaitMax - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMInnodbIoRWaitP99() float32 { - if x != nil { - return x.MInnodbIoRWaitP99 - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMInnodbRecLockWaitCnt() float32 { - if x != nil { - return x.MInnodbRecLockWaitCnt - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMInnodbRecLockWaitSum() float32 { - if x != nil { - return x.MInnodbRecLockWaitSum - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMInnodbRecLockWaitMin() float32 { - if x != nil { - return x.MInnodbRecLockWaitMin - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMInnodbRecLockWaitMax() float32 { - if x != nil { - return x.MInnodbRecLockWaitMax - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMInnodbRecLockWaitP99() float32 { - if x != nil { - return x.MInnodbRecLockWaitP99 - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMInnodbQueueWaitCnt() float32 { - if x != nil { - return x.MInnodbQueueWaitCnt - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMInnodbQueueWaitSum() float32 { - if x != nil { - return x.MInnodbQueueWaitSum - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMInnodbQueueWaitMin() float32 { - if x != nil { - return x.MInnodbQueueWaitMin - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMInnodbQueueWaitMax() float32 { - if x != nil { - return x.MInnodbQueueWaitMax - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMInnodbQueueWaitP99() float32 { - if x != nil { - return x.MInnodbQueueWaitP99 - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMInnodbPagesDistinctCnt() float32 { - if x != nil { - return x.MInnodbPagesDistinctCnt - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMInnodbPagesDistinctSum() float32 { - if x != nil { - return x.MInnodbPagesDistinctSum - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMInnodbPagesDistinctMin() float32 { - if x != nil { - return x.MInnodbPagesDistinctMin - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMInnodbPagesDistinctMax() float32 { - if x != nil { - return x.MInnodbPagesDistinctMax - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMInnodbPagesDistinctP99() float32 { - if x != nil { - return x.MInnodbPagesDistinctP99 - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMQueryLengthCnt() float32 { - if x != nil { - return x.MQueryLengthCnt - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMQueryLengthSum() float32 { - if x != nil { - return x.MQueryLengthSum - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMQueryLengthMin() float32 { - if x != nil { - return x.MQueryLengthMin - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMQueryLengthMax() float32 { - if x != nil { - return x.MQueryLengthMax - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMQueryLengthP99() float32 { - if x != nil { - return x.MQueryLengthP99 - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMBytesSentCnt() float32 { - if x != nil { - return x.MBytesSentCnt - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMBytesSentSum() float32 { - if x != nil { - return x.MBytesSentSum - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMBytesSentMin() float32 { - if x != nil { - return x.MBytesSentMin - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMBytesSentMax() float32 { - if x != nil { - return x.MBytesSentMax - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMBytesSentP99() float32 { - if x != nil { - return x.MBytesSentP99 - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMTmpTablesCnt() float32 { - if x != nil { - return x.MTmpTablesCnt - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMTmpTablesSum() float32 { - if x != nil { - return x.MTmpTablesSum - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMTmpTablesMin() float32 { - if x != nil { - return x.MTmpTablesMin - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMTmpTablesMax() float32 { - if x != nil { - return x.MTmpTablesMax - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMTmpTablesP99() float32 { - if x != nil { - return x.MTmpTablesP99 - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMTmpDiskTablesCnt() float32 { - if x != nil { - return x.MTmpDiskTablesCnt - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMTmpDiskTablesSum() float32 { - if x != nil { - return x.MTmpDiskTablesSum - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMTmpDiskTablesMin() float32 { - if x != nil { - return x.MTmpDiskTablesMin - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMTmpDiskTablesMax() float32 { - if x != nil { - return x.MTmpDiskTablesMax - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMTmpDiskTablesP99() float32 { - if x != nil { - return x.MTmpDiskTablesP99 - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMTmpTableSizesCnt() float32 { - if x != nil { - return x.MTmpTableSizesCnt - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMTmpTableSizesSum() float32 { - if x != nil { - return x.MTmpTableSizesSum - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMTmpTableSizesMin() float32 { - if x != nil { - return x.MTmpTableSizesMin - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMTmpTableSizesMax() float32 { - if x != nil { - return x.MTmpTableSizesMax - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMTmpTableSizesP99() float32 { - if x != nil { - return x.MTmpTableSizesP99 - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMQcHitCnt() float32 { - if x != nil { - return x.MQcHitCnt - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMQcHitSum() float32 { - if x != nil { - return x.MQcHitSum - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMFullScanCnt() float32 { - if x != nil { - return x.MFullScanCnt - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMFullScanSum() float32 { - if x != nil { - return x.MFullScanSum - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMFullJoinCnt() float32 { - if x != nil { - return x.MFullJoinCnt - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMFullJoinSum() float32 { - if x != nil { - return x.MFullJoinSum - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMTmpTableCnt() float32 { - if x != nil { - return x.MTmpTableCnt - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMTmpTableSum() float32 { - if x != nil { - return x.MTmpTableSum - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMTmpTableOnDiskCnt() float32 { - if x != nil { - return x.MTmpTableOnDiskCnt - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMTmpTableOnDiskSum() float32 { - if x != nil { - return x.MTmpTableOnDiskSum - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMFilesortCnt() float32 { - if x != nil { - return x.MFilesortCnt - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMFilesortSum() float32 { - if x != nil { - return x.MFilesortSum - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMFilesortOnDiskCnt() float32 { - if x != nil { - return x.MFilesortOnDiskCnt - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMFilesortOnDiskSum() float32 { - if x != nil { - return x.MFilesortOnDiskSum - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMSelectFullRangeJoinCnt() float32 { - if x != nil { - return x.MSelectFullRangeJoinCnt - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMSelectFullRangeJoinSum() float32 { - if x != nil { - return x.MSelectFullRangeJoinSum - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMSelectRangeCnt() float32 { - if x != nil { - return x.MSelectRangeCnt - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMSelectRangeSum() float32 { - if x != nil { - return x.MSelectRangeSum - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMSelectRangeCheckCnt() float32 { - if x != nil { - return x.MSelectRangeCheckCnt - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMSelectRangeCheckSum() float32 { - if x != nil { - return x.MSelectRangeCheckSum - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMSortRangeCnt() float32 { - if x != nil { - return x.MSortRangeCnt - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMSortRangeSum() float32 { - if x != nil { - return x.MSortRangeSum - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMSortRowsCnt() float32 { - if x != nil { - return x.MSortRowsCnt - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMSortRowsSum() float32 { - if x != nil { - return x.MSortRowsSum - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMSortScanCnt() float32 { - if x != nil { - return x.MSortScanCnt - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMSortScanSum() float32 { - if x != nil { - return x.MSortScanSum - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMNoIndexUsedCnt() float32 { - if x != nil { - return x.MNoIndexUsedCnt - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMNoIndexUsedSum() float32 { - if x != nil { - return x.MNoIndexUsedSum - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMNoGoodIndexUsedCnt() float32 { - if x != nil { - return x.MNoGoodIndexUsedCnt - } - return 0 -} - -func (x *MetricsBucket_MySQL) GetMNoGoodIndexUsedSum() float32 { - if x != nil { - return x.MNoGoodIndexUsedSum - } - return 0 -} - -// MongoDB contains metrics for Mongo DB. -type MetricsBucket_MongoDB struct { - state protoimpl.MessageState `protogen:"open.v1"` - MDocsReturnedCnt float32 `protobuf:"fixed32,1,opt,name=m_docs_returned_cnt,json=mDocsReturnedCnt,proto3" json:"m_docs_returned_cnt,omitempty"` - // The number of returned documents. - MDocsReturnedSum float32 `protobuf:"fixed32,2,opt,name=m_docs_returned_sum,json=mDocsReturnedSum,proto3" json:"m_docs_returned_sum,omitempty"` - MDocsReturnedMin float32 `protobuf:"fixed32,3,opt,name=m_docs_returned_min,json=mDocsReturnedMin,proto3" json:"m_docs_returned_min,omitempty"` - MDocsReturnedMax float32 `protobuf:"fixed32,4,opt,name=m_docs_returned_max,json=mDocsReturnedMax,proto3" json:"m_docs_returned_max,omitempty"` - MDocsReturnedP99 float32 `protobuf:"fixed32,5,opt,name=m_docs_returned_p99,json=mDocsReturnedP99,proto3" json:"m_docs_returned_p99,omitempty"` - MResponseLengthCnt float32 `protobuf:"fixed32,6,opt,name=m_response_length_cnt,json=mResponseLengthCnt,proto3" json:"m_response_length_cnt,omitempty"` - // The response length of the query result in bytes. - MResponseLengthSum float32 `protobuf:"fixed32,7,opt,name=m_response_length_sum,json=mResponseLengthSum,proto3" json:"m_response_length_sum,omitempty"` - MResponseLengthMin float32 `protobuf:"fixed32,8,opt,name=m_response_length_min,json=mResponseLengthMin,proto3" json:"m_response_length_min,omitempty"` - MResponseLengthMax float32 `protobuf:"fixed32,9,opt,name=m_response_length_max,json=mResponseLengthMax,proto3" json:"m_response_length_max,omitempty"` - MResponseLengthP99 float32 `protobuf:"fixed32,10,opt,name=m_response_length_p99,json=mResponseLengthP99,proto3" json:"m_response_length_p99,omitempty"` - MDocsScannedCnt float32 `protobuf:"fixed32,11,opt,name=m_docs_scanned_cnt,json=mDocsScannedCnt,proto3" json:"m_docs_scanned_cnt,omitempty"` - // The number of scanned documents. - MDocsScannedSum float32 `protobuf:"fixed32,12,opt,name=m_docs_scanned_sum,json=mDocsScannedSum,proto3" json:"m_docs_scanned_sum,omitempty"` - MDocsScannedMin float32 `protobuf:"fixed32,13,opt,name=m_docs_scanned_min,json=mDocsScannedMin,proto3" json:"m_docs_scanned_min,omitempty"` - MDocsScannedMax float32 `protobuf:"fixed32,14,opt,name=m_docs_scanned_max,json=mDocsScannedMax,proto3" json:"m_docs_scanned_max,omitempty"` - MDocsScannedP99 float32 `protobuf:"fixed32,15,opt,name=m_docs_scanned_p99,json=mDocsScannedP99,proto3" json:"m_docs_scanned_p99,omitempty"` - // The query performed a full collection scan (COLLSCAN). - MFullScanCnt float32 `protobuf:"fixed32,16,opt,name=m_full_scan_cnt,json=mFullScanCnt,proto3" json:"m_full_scan_cnt,omitempty"` - MFullScanSum float32 `protobuf:"fixed32,17,opt,name=m_full_scan_sum,json=mFullScanSum,proto3" json:"m_full_scan_sum,omitempty"` - // Plan summary type (COLLSCAN, IXSCAN, etc). - PlanSummary string `protobuf:"bytes,18,opt,name=plan_summary,json=planSummary,proto3" json:"plan_summary,omitempty"` - // Total number of documents scanned during query execution. - MDocsExaminedCnt float32 `protobuf:"fixed32,19,opt,name=m_docs_examined_cnt,json=mDocsExaminedCnt,proto3" json:"m_docs_examined_cnt,omitempty"` - MDocsExaminedSum float32 `protobuf:"fixed32,20,opt,name=m_docs_examined_sum,json=mDocsExaminedSum,proto3" json:"m_docs_examined_sum,omitempty"` - MDocsExaminedMin float32 `protobuf:"fixed32,21,opt,name=m_docs_examined_min,json=mDocsExaminedMin,proto3" json:"m_docs_examined_min,omitempty"` - MDocsExaminedMax float32 `protobuf:"fixed32,22,opt,name=m_docs_examined_max,json=mDocsExaminedMax,proto3" json:"m_docs_examined_max,omitempty"` - MDocsExaminedP99 float32 `protobuf:"fixed32,23,opt,name=m_docs_examined_p99,json=mDocsExaminedP99,proto3" json:"m_docs_examined_p99,omitempty"` - // Total number of index keys scanned during query execution. - MKeysExaminedCnt float32 `protobuf:"fixed32,24,opt,name=m_keys_examined_cnt,json=mKeysExaminedCnt,proto3" json:"m_keys_examined_cnt,omitempty"` - MKeysExaminedSum float32 `protobuf:"fixed32,25,opt,name=m_keys_examined_sum,json=mKeysExaminedSum,proto3" json:"m_keys_examined_sum,omitempty"` - MKeysExaminedMin float32 `protobuf:"fixed32,26,opt,name=m_keys_examined_min,json=mKeysExaminedMin,proto3" json:"m_keys_examined_min,omitempty"` - MKeysExaminedMax float32 `protobuf:"fixed32,27,opt,name=m_keys_examined_max,json=mKeysExaminedMax,proto3" json:"m_keys_examined_max,omitempty"` - MKeysExaminedP99 float32 `protobuf:"fixed32,28,opt,name=m_keys_examined_p99,json=mKeysExaminedP99,proto3" json:"m_keys_examined_p99,omitempty"` - // Application name from client. - ApplicationName string `protobuf:"bytes,29,opt,name=application_name,json=applicationName,proto3" json:"application_name,omitempty"` - // Number of times a global read lock was acquired during query execution. - MLocksGlobalAcquireCountReadSharedCnt float32 `protobuf:"fixed32,30,opt,name=m_locks_global_acquire_count_read_shared_cnt,json=mLocksGlobalAcquireCountReadSharedCnt,proto3" json:"m_locks_global_acquire_count_read_shared_cnt,omitempty"` - MLocksGlobalAcquireCountReadSharedSum float32 `protobuf:"fixed32,31,opt,name=m_locks_global_acquire_count_read_shared_sum,json=mLocksGlobalAcquireCountReadSharedSum,proto3" json:"m_locks_global_acquire_count_read_shared_sum,omitempty"` - // Number of times a global write lock was acquired during query execution. - MLocksGlobalAcquireCountWriteSharedCnt float32 `protobuf:"fixed32,32,opt,name=m_locks_global_acquire_count_write_shared_cnt,json=mLocksGlobalAcquireCountWriteSharedCnt,proto3" json:"m_locks_global_acquire_count_write_shared_cnt,omitempty"` - MLocksGlobalAcquireCountWriteSharedSum float32 `protobuf:"fixed32,33,opt,name=m_locks_global_acquire_count_write_shared_sum,json=mLocksGlobalAcquireCountWriteSharedSum,proto3" json:"m_locks_global_acquire_count_write_shared_sum,omitempty"` - // Number of times a read lock was acquired at the database level during query execution. - MLocksDatabaseAcquireCountReadSharedCnt float32 `protobuf:"fixed32,34,opt,name=m_locks_database_acquire_count_read_shared_cnt,json=mLocksDatabaseAcquireCountReadSharedCnt,proto3" json:"m_locks_database_acquire_count_read_shared_cnt,omitempty"` - MLocksDatabaseAcquireCountReadSharedSum float32 `protobuf:"fixed32,35,opt,name=m_locks_database_acquire_count_read_shared_sum,json=mLocksDatabaseAcquireCountReadSharedSum,proto3" json:"m_locks_database_acquire_count_read_shared_sum,omitempty"` - // Number of times a read lock at the database level was requested but had to wait before being granted. - MLocksDatabaseAcquireWaitCountReadSharedCnt float32 `protobuf:"fixed32,36,opt,name=m_locks_database_acquire_wait_count_read_shared_cnt,json=mLocksDatabaseAcquireWaitCountReadSharedCnt,proto3" json:"m_locks_database_acquire_wait_count_read_shared_cnt,omitempty"` - MLocksDatabaseAcquireWaitCountReadSharedSum float32 `protobuf:"fixed32,37,opt,name=m_locks_database_acquire_wait_count_read_shared_sum,json=mLocksDatabaseAcquireWaitCountReadSharedSum,proto3" json:"m_locks_database_acquire_wait_count_read_shared_sum,omitempty"` - // Indicates the time, spent acquiring a read lock at the database level during an operation. - MLocksDatabaseTimeAcquiringMicrosReadSharedCnt float32 `protobuf:"fixed32,38,opt,name=m_locks_database_time_acquiring_micros_read_shared_cnt,json=mLocksDatabaseTimeAcquiringMicrosReadSharedCnt,proto3" json:"m_locks_database_time_acquiring_micros_read_shared_cnt,omitempty"` - MLocksDatabaseTimeAcquiringMicrosReadSharedSum float32 `protobuf:"fixed32,39,opt,name=m_locks_database_time_acquiring_micros_read_shared_sum,json=mLocksDatabaseTimeAcquiringMicrosReadSharedSum,proto3" json:"m_locks_database_time_acquiring_micros_read_shared_sum,omitempty"` - MLocksDatabaseTimeAcquiringMicrosReadSharedMin float32 `protobuf:"fixed32,40,opt,name=m_locks_database_time_acquiring_micros_read_shared_min,json=mLocksDatabaseTimeAcquiringMicrosReadSharedMin,proto3" json:"m_locks_database_time_acquiring_micros_read_shared_min,omitempty"` - MLocksDatabaseTimeAcquiringMicrosReadSharedMax float32 `protobuf:"fixed32,41,opt,name=m_locks_database_time_acquiring_micros_read_shared_max,json=mLocksDatabaseTimeAcquiringMicrosReadSharedMax,proto3" json:"m_locks_database_time_acquiring_micros_read_shared_max,omitempty"` - MLocksDatabaseTimeAcquiringMicrosReadSharedP99 float32 `protobuf:"fixed32,42,opt,name=m_locks_database_time_acquiring_micros_read_shared_p99,json=mLocksDatabaseTimeAcquiringMicrosReadSharedP99,proto3" json:"m_locks_database_time_acquiring_micros_read_shared_p99,omitempty"` - // Number of times a read lock was acquired on a specific collection during operations. - MLocksCollectionAcquireCountReadSharedCnt float32 `protobuf:"fixed32,43,opt,name=m_locks_collection_acquire_count_read_shared_cnt,json=mLocksCollectionAcquireCountReadSharedCnt,proto3" json:"m_locks_collection_acquire_count_read_shared_cnt,omitempty"` - MLocksCollectionAcquireCountReadSharedSum float32 `protobuf:"fixed32,44,opt,name=m_locks_collection_acquire_count_read_shared_sum,json=mLocksCollectionAcquireCountReadSharedSum,proto3" json:"m_locks_collection_acquire_count_read_shared_sum,omitempty"` - // Total number of bytes read from storage during a specific operation. - MStorageBytesReadCnt float32 `protobuf:"fixed32,45,opt,name=m_storage_bytes_read_cnt,json=mStorageBytesReadCnt,proto3" json:"m_storage_bytes_read_cnt,omitempty"` - MStorageBytesReadSum float32 `protobuf:"fixed32,46,opt,name=m_storage_bytes_read_sum,json=mStorageBytesReadSum,proto3" json:"m_storage_bytes_read_sum,omitempty"` - MStorageBytesReadMin float32 `protobuf:"fixed32,47,opt,name=m_storage_bytes_read_min,json=mStorageBytesReadMin,proto3" json:"m_storage_bytes_read_min,omitempty"` - MStorageBytesReadMax float32 `protobuf:"fixed32,48,opt,name=m_storage_bytes_read_max,json=mStorageBytesReadMax,proto3" json:"m_storage_bytes_read_max,omitempty"` - MStorageBytesReadP99 float32 `protobuf:"fixed32,49,opt,name=m_storage_bytes_read_p99,json=mStorageBytesReadP99,proto3" json:"m_storage_bytes_read_p99,omitempty"` - // Indicates the time, spent reading data from storage during an operation. - MStorageTimeReadingMicrosCnt float32 `protobuf:"fixed32,50,opt,name=m_storage_time_reading_micros_cnt,json=mStorageTimeReadingMicrosCnt,proto3" json:"m_storage_time_reading_micros_cnt,omitempty"` - MStorageTimeReadingMicrosSum float32 `protobuf:"fixed32,51,opt,name=m_storage_time_reading_micros_sum,json=mStorageTimeReadingMicrosSum,proto3" json:"m_storage_time_reading_micros_sum,omitempty"` - MStorageTimeReadingMicrosMin float32 `protobuf:"fixed32,52,opt,name=m_storage_time_reading_micros_min,json=mStorageTimeReadingMicrosMin,proto3" json:"m_storage_time_reading_micros_min,omitempty"` - MStorageTimeReadingMicrosMax float32 `protobuf:"fixed32,53,opt,name=m_storage_time_reading_micros_max,json=mStorageTimeReadingMicrosMax,proto3" json:"m_storage_time_reading_micros_max,omitempty"` - MStorageTimeReadingMicrosP99 float32 `protobuf:"fixed32,54,opt,name=m_storage_time_reading_micros_p99,json=mStorageTimeReadingMicrosP99,proto3" json:"m_storage_time_reading_micros_p99,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *MetricsBucket_MongoDB) Reset() { - *x = MetricsBucket_MongoDB{} - mi := &file_agent_v1_collector_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *MetricsBucket_MongoDB) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MetricsBucket_MongoDB) ProtoMessage() {} - -func (x *MetricsBucket_MongoDB) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_collector_proto_msgTypes[4] - 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 MetricsBucket_MongoDB.ProtoReflect.Descriptor instead. -func (*MetricsBucket_MongoDB) Descriptor() ([]byte, []int) { - return file_agent_v1_collector_proto_rawDescGZIP(), []int{0, 2} -} - -func (x *MetricsBucket_MongoDB) GetMDocsReturnedCnt() float32 { - if x != nil { - return x.MDocsReturnedCnt - } - return 0 -} - -func (x *MetricsBucket_MongoDB) GetMDocsReturnedSum() float32 { - if x != nil { - return x.MDocsReturnedSum - } - return 0 -} - -func (x *MetricsBucket_MongoDB) GetMDocsReturnedMin() float32 { - if x != nil { - return x.MDocsReturnedMin - } - return 0 -} - -func (x *MetricsBucket_MongoDB) GetMDocsReturnedMax() float32 { - if x != nil { - return x.MDocsReturnedMax - } - return 0 -} - -func (x *MetricsBucket_MongoDB) GetMDocsReturnedP99() float32 { - if x != nil { - return x.MDocsReturnedP99 - } - return 0 -} - -func (x *MetricsBucket_MongoDB) GetMResponseLengthCnt() float32 { - if x != nil { - return x.MResponseLengthCnt - } - return 0 -} - -func (x *MetricsBucket_MongoDB) GetMResponseLengthSum() float32 { - if x != nil { - return x.MResponseLengthSum - } - return 0 -} - -func (x *MetricsBucket_MongoDB) GetMResponseLengthMin() float32 { - if x != nil { - return x.MResponseLengthMin - } - return 0 -} - -func (x *MetricsBucket_MongoDB) GetMResponseLengthMax() float32 { - if x != nil { - return x.MResponseLengthMax - } - return 0 -} - -func (x *MetricsBucket_MongoDB) GetMResponseLengthP99() float32 { - if x != nil { - return x.MResponseLengthP99 - } - return 0 -} - -func (x *MetricsBucket_MongoDB) GetMDocsScannedCnt() float32 { - if x != nil { - return x.MDocsScannedCnt - } - return 0 -} - -func (x *MetricsBucket_MongoDB) GetMDocsScannedSum() float32 { - if x != nil { - return x.MDocsScannedSum - } - return 0 -} - -func (x *MetricsBucket_MongoDB) GetMDocsScannedMin() float32 { - if x != nil { - return x.MDocsScannedMin - } - return 0 -} - -func (x *MetricsBucket_MongoDB) GetMDocsScannedMax() float32 { - if x != nil { - return x.MDocsScannedMax - } - return 0 -} - -func (x *MetricsBucket_MongoDB) GetMDocsScannedP99() float32 { - if x != nil { - return x.MDocsScannedP99 - } - return 0 -} - -func (x *MetricsBucket_MongoDB) GetMFullScanCnt() float32 { - if x != nil { - return x.MFullScanCnt - } - return 0 -} - -func (x *MetricsBucket_MongoDB) GetMFullScanSum() float32 { - if x != nil { - return x.MFullScanSum - } - return 0 -} - -func (x *MetricsBucket_MongoDB) GetPlanSummary() string { - if x != nil { - return x.PlanSummary - } - return "" -} - -func (x *MetricsBucket_MongoDB) GetMDocsExaminedCnt() float32 { - if x != nil { - return x.MDocsExaminedCnt - } - return 0 -} - -func (x *MetricsBucket_MongoDB) GetMDocsExaminedSum() float32 { - if x != nil { - return x.MDocsExaminedSum - } - return 0 -} - -func (x *MetricsBucket_MongoDB) GetMDocsExaminedMin() float32 { - if x != nil { - return x.MDocsExaminedMin - } - return 0 -} - -func (x *MetricsBucket_MongoDB) GetMDocsExaminedMax() float32 { - if x != nil { - return x.MDocsExaminedMax - } - return 0 -} - -func (x *MetricsBucket_MongoDB) GetMDocsExaminedP99() float32 { - if x != nil { - return x.MDocsExaminedP99 - } - return 0 -} - -func (x *MetricsBucket_MongoDB) GetMKeysExaminedCnt() float32 { - if x != nil { - return x.MKeysExaminedCnt - } - return 0 -} - -func (x *MetricsBucket_MongoDB) GetMKeysExaminedSum() float32 { - if x != nil { - return x.MKeysExaminedSum - } - return 0 -} - -func (x *MetricsBucket_MongoDB) GetMKeysExaminedMin() float32 { - if x != nil { - return x.MKeysExaminedMin - } - return 0 -} - -func (x *MetricsBucket_MongoDB) GetMKeysExaminedMax() float32 { - if x != nil { - return x.MKeysExaminedMax - } - return 0 -} - -func (x *MetricsBucket_MongoDB) GetMKeysExaminedP99() float32 { - if x != nil { - return x.MKeysExaminedP99 - } - return 0 -} - -func (x *MetricsBucket_MongoDB) GetApplicationName() string { - if x != nil { - return x.ApplicationName - } - return "" -} - -func (x *MetricsBucket_MongoDB) GetMLocksGlobalAcquireCountReadSharedCnt() float32 { - if x != nil { - return x.MLocksGlobalAcquireCountReadSharedCnt - } - return 0 -} - -func (x *MetricsBucket_MongoDB) GetMLocksGlobalAcquireCountReadSharedSum() float32 { - if x != nil { - return x.MLocksGlobalAcquireCountReadSharedSum - } - return 0 -} - -func (x *MetricsBucket_MongoDB) GetMLocksGlobalAcquireCountWriteSharedCnt() float32 { - if x != nil { - return x.MLocksGlobalAcquireCountWriteSharedCnt - } - return 0 -} - -func (x *MetricsBucket_MongoDB) GetMLocksGlobalAcquireCountWriteSharedSum() float32 { - if x != nil { - return x.MLocksGlobalAcquireCountWriteSharedSum - } - return 0 -} - -func (x *MetricsBucket_MongoDB) GetMLocksDatabaseAcquireCountReadSharedCnt() float32 { - if x != nil { - return x.MLocksDatabaseAcquireCountReadSharedCnt - } - return 0 -} - -func (x *MetricsBucket_MongoDB) GetMLocksDatabaseAcquireCountReadSharedSum() float32 { - if x != nil { - return x.MLocksDatabaseAcquireCountReadSharedSum - } - return 0 -} - -func (x *MetricsBucket_MongoDB) GetMLocksDatabaseAcquireWaitCountReadSharedCnt() float32 { - if x != nil { - return x.MLocksDatabaseAcquireWaitCountReadSharedCnt - } - return 0 -} - -func (x *MetricsBucket_MongoDB) GetMLocksDatabaseAcquireWaitCountReadSharedSum() float32 { - if x != nil { - return x.MLocksDatabaseAcquireWaitCountReadSharedSum - } - return 0 -} - -func (x *MetricsBucket_MongoDB) GetMLocksDatabaseTimeAcquiringMicrosReadSharedCnt() float32 { - if x != nil { - return x.MLocksDatabaseTimeAcquiringMicrosReadSharedCnt - } - return 0 -} - -func (x *MetricsBucket_MongoDB) GetMLocksDatabaseTimeAcquiringMicrosReadSharedSum() float32 { - if x != nil { - return x.MLocksDatabaseTimeAcquiringMicrosReadSharedSum - } - return 0 -} - -func (x *MetricsBucket_MongoDB) GetMLocksDatabaseTimeAcquiringMicrosReadSharedMin() float32 { - if x != nil { - return x.MLocksDatabaseTimeAcquiringMicrosReadSharedMin - } - return 0 -} - -func (x *MetricsBucket_MongoDB) GetMLocksDatabaseTimeAcquiringMicrosReadSharedMax() float32 { - if x != nil { - return x.MLocksDatabaseTimeAcquiringMicrosReadSharedMax - } - return 0 -} - -func (x *MetricsBucket_MongoDB) GetMLocksDatabaseTimeAcquiringMicrosReadSharedP99() float32 { - if x != nil { - return x.MLocksDatabaseTimeAcquiringMicrosReadSharedP99 - } - return 0 -} - -func (x *MetricsBucket_MongoDB) GetMLocksCollectionAcquireCountReadSharedCnt() float32 { - if x != nil { - return x.MLocksCollectionAcquireCountReadSharedCnt - } - return 0 -} - -func (x *MetricsBucket_MongoDB) GetMLocksCollectionAcquireCountReadSharedSum() float32 { - if x != nil { - return x.MLocksCollectionAcquireCountReadSharedSum - } - return 0 -} - -func (x *MetricsBucket_MongoDB) GetMStorageBytesReadCnt() float32 { - if x != nil { - return x.MStorageBytesReadCnt - } - return 0 -} - -func (x *MetricsBucket_MongoDB) GetMStorageBytesReadSum() float32 { - if x != nil { - return x.MStorageBytesReadSum - } - return 0 -} - -func (x *MetricsBucket_MongoDB) GetMStorageBytesReadMin() float32 { - if x != nil { - return x.MStorageBytesReadMin - } - return 0 -} - -func (x *MetricsBucket_MongoDB) GetMStorageBytesReadMax() float32 { - if x != nil { - return x.MStorageBytesReadMax - } - return 0 -} - -func (x *MetricsBucket_MongoDB) GetMStorageBytesReadP99() float32 { - if x != nil { - return x.MStorageBytesReadP99 - } - return 0 -} - -func (x *MetricsBucket_MongoDB) GetMStorageTimeReadingMicrosCnt() float32 { - if x != nil { - return x.MStorageTimeReadingMicrosCnt - } - return 0 -} - -func (x *MetricsBucket_MongoDB) GetMStorageTimeReadingMicrosSum() float32 { - if x != nil { - return x.MStorageTimeReadingMicrosSum - } - return 0 -} - -func (x *MetricsBucket_MongoDB) GetMStorageTimeReadingMicrosMin() float32 { - if x != nil { - return x.MStorageTimeReadingMicrosMin - } - return 0 -} - -func (x *MetricsBucket_MongoDB) GetMStorageTimeReadingMicrosMax() float32 { - if x != nil { - return x.MStorageTimeReadingMicrosMax - } - return 0 -} - -func (x *MetricsBucket_MongoDB) GetMStorageTimeReadingMicrosP99() float32 { - if x != nil { - return x.MStorageTimeReadingMicrosP99 - } - return 0 -} - -// PostgreSQL contains metrics for PostgreSQL. -type MetricsBucket_PostgreSQL struct { - state protoimpl.MessageState `protogen:"open.v1"` - MRowsCnt float32 `protobuf:"fixed32,1,opt,name=m_rows_cnt,json=mRowsCnt,proto3" json:"m_rows_cnt,omitempty"` - // The number of rows sent to the client. - MRowsSum float32 `protobuf:"fixed32,2,opt,name=m_rows_sum,json=mRowsSum,proto3" json:"m_rows_sum,omitempty"` - MSharedBlksHitCnt float32 `protobuf:"fixed32,3,opt,name=m_shared_blks_hit_cnt,json=mSharedBlksHitCnt,proto3" json:"m_shared_blks_hit_cnt,omitempty"` - // Total number of shared block cache hits by the statement. - MSharedBlksHitSum float32 `protobuf:"fixed32,4,opt,name=m_shared_blks_hit_sum,json=mSharedBlksHitSum,proto3" json:"m_shared_blks_hit_sum,omitempty"` - MSharedBlksReadCnt float32 `protobuf:"fixed32,5,opt,name=m_shared_blks_read_cnt,json=mSharedBlksReadCnt,proto3" json:"m_shared_blks_read_cnt,omitempty"` - // Total number of shared blocks read by the statement. - MSharedBlksReadSum float32 `protobuf:"fixed32,6,opt,name=m_shared_blks_read_sum,json=mSharedBlksReadSum,proto3" json:"m_shared_blks_read_sum,omitempty"` - MSharedBlksDirtiedCnt float32 `protobuf:"fixed32,7,opt,name=m_shared_blks_dirtied_cnt,json=mSharedBlksDirtiedCnt,proto3" json:"m_shared_blks_dirtied_cnt,omitempty"` - // Total number of shared blocks dirtied by the statement. - MSharedBlksDirtiedSum float32 `protobuf:"fixed32,8,opt,name=m_shared_blks_dirtied_sum,json=mSharedBlksDirtiedSum,proto3" json:"m_shared_blks_dirtied_sum,omitempty"` - MSharedBlksWrittenCnt float32 `protobuf:"fixed32,9,opt,name=m_shared_blks_written_cnt,json=mSharedBlksWrittenCnt,proto3" json:"m_shared_blks_written_cnt,omitempty"` - // Total number of shared blocks written by the statement. - MSharedBlksWrittenSum float32 `protobuf:"fixed32,10,opt,name=m_shared_blks_written_sum,json=mSharedBlksWrittenSum,proto3" json:"m_shared_blks_written_sum,omitempty"` - MLocalBlksHitCnt float32 `protobuf:"fixed32,11,opt,name=m_local_blks_hit_cnt,json=mLocalBlksHitCnt,proto3" json:"m_local_blks_hit_cnt,omitempty"` - // Total number of local block cache hits by the statement. - MLocalBlksHitSum float32 `protobuf:"fixed32,12,opt,name=m_local_blks_hit_sum,json=mLocalBlksHitSum,proto3" json:"m_local_blks_hit_sum,omitempty"` - MLocalBlksReadCnt float32 `protobuf:"fixed32,13,opt,name=m_local_blks_read_cnt,json=mLocalBlksReadCnt,proto3" json:"m_local_blks_read_cnt,omitempty"` - // Total number of local blocks read by the statement. - MLocalBlksReadSum float32 `protobuf:"fixed32,14,opt,name=m_local_blks_read_sum,json=mLocalBlksReadSum,proto3" json:"m_local_blks_read_sum,omitempty"` - MLocalBlksDirtiedCnt float32 `protobuf:"fixed32,15,opt,name=m_local_blks_dirtied_cnt,json=mLocalBlksDirtiedCnt,proto3" json:"m_local_blks_dirtied_cnt,omitempty"` - // Total number of local blocks dirtied by the statement. - MLocalBlksDirtiedSum float32 `protobuf:"fixed32,16,opt,name=m_local_blks_dirtied_sum,json=mLocalBlksDirtiedSum,proto3" json:"m_local_blks_dirtied_sum,omitempty"` - MLocalBlksWrittenCnt float32 `protobuf:"fixed32,17,opt,name=m_local_blks_written_cnt,json=mLocalBlksWrittenCnt,proto3" json:"m_local_blks_written_cnt,omitempty"` - // Total number of local blocks written by the statement. - MLocalBlksWrittenSum float32 `protobuf:"fixed32,18,opt,name=m_local_blks_written_sum,json=mLocalBlksWrittenSum,proto3" json:"m_local_blks_written_sum,omitempty"` - MTempBlksReadCnt float32 `protobuf:"fixed32,19,opt,name=m_temp_blks_read_cnt,json=mTempBlksReadCnt,proto3" json:"m_temp_blks_read_cnt,omitempty"` - // Total number of temp blocks read by the statement. - MTempBlksReadSum float32 `protobuf:"fixed32,20,opt,name=m_temp_blks_read_sum,json=mTempBlksReadSum,proto3" json:"m_temp_blks_read_sum,omitempty"` - MTempBlksWrittenCnt float32 `protobuf:"fixed32,21,opt,name=m_temp_blks_written_cnt,json=mTempBlksWrittenCnt,proto3" json:"m_temp_blks_written_cnt,omitempty"` - // Total number of temp blocks written by the statement. - MTempBlksWrittenSum float32 `protobuf:"fixed32,22,opt,name=m_temp_blks_written_sum,json=mTempBlksWrittenSum,proto3" json:"m_temp_blks_written_sum,omitempty"` - MSharedBlkReadTimeCnt float32 `protobuf:"fixed32,23,opt,name=m_shared_blk_read_time_cnt,json=mSharedBlkReadTimeCnt,proto3" json:"m_shared_blk_read_time_cnt,omitempty"` - // Total time the statement spent reading shared blocks, in milliseconds (if track_io_timing is enabled, otherwise zero). - MSharedBlkReadTimeSum float32 `protobuf:"fixed32,24,opt,name=m_shared_blk_read_time_sum,json=mSharedBlkReadTimeSum,proto3" json:"m_shared_blk_read_time_sum,omitempty"` - MSharedBlkWriteTimeCnt float32 `protobuf:"fixed32,25,opt,name=m_shared_blk_write_time_cnt,json=mSharedBlkWriteTimeCnt,proto3" json:"m_shared_blk_write_time_cnt,omitempty"` - // Total time the statement spent writing shared blocks, in milliseconds (if track_io_timing is enabled, otherwise zero). - MSharedBlkWriteTimeSum float32 `protobuf:"fixed32,26,opt,name=m_shared_blk_write_time_sum,json=mSharedBlkWriteTimeSum,proto3" json:"m_shared_blk_write_time_sum,omitempty"` - MLocalBlkReadTimeCnt float32 `protobuf:"fixed32,50,opt,name=m_local_blk_read_time_cnt,json=mLocalBlkReadTimeCnt,proto3" json:"m_local_blk_read_time_cnt,omitempty"` - // Total time the statement spent reading local blocks, in milliseconds (if track_io_timing is enabled, otherwise zero). - MLocalBlkReadTimeSum float32 `protobuf:"fixed32,51,opt,name=m_local_blk_read_time_sum,json=mLocalBlkReadTimeSum,proto3" json:"m_local_blk_read_time_sum,omitempty"` - MLocalBlkWriteTimeCnt float32 `protobuf:"fixed32,52,opt,name=m_local_blk_write_time_cnt,json=mLocalBlkWriteTimeCnt,proto3" json:"m_local_blk_write_time_cnt,omitempty"` - // Total time the statement spent writing local blocks, in milliseconds (if track_io_timing is enabled, otherwise zero). - MLocalBlkWriteTimeSum float32 `protobuf:"fixed32,53,opt,name=m_local_blk_write_time_sum,json=mLocalBlkWriteTimeSum,proto3" json:"m_local_blk_write_time_sum,omitempty"` - MCpuUserTimeCnt float32 `protobuf:"fixed32,27,opt,name=m_cpu_user_time_cnt,json=mCpuUserTimeCnt,proto3" json:"m_cpu_user_time_cnt,omitempty"` - // Total time user spent in query. - MCpuUserTimeSum float32 `protobuf:"fixed32,28,opt,name=m_cpu_user_time_sum,json=mCpuUserTimeSum,proto3" json:"m_cpu_user_time_sum,omitempty"` - MCpuSysTimeCnt float32 `protobuf:"fixed32,29,opt,name=m_cpu_sys_time_cnt,json=mCpuSysTimeCnt,proto3" json:"m_cpu_sys_time_cnt,omitempty"` - // Total time system spent in query. - MCpuSysTimeSum float32 `protobuf:"fixed32,30,opt,name=m_cpu_sys_time_sum,json=mCpuSysTimeSum,proto3" json:"m_cpu_sys_time_sum,omitempty"` - // Type of SQL command. - CmdType string `protobuf:"bytes,43,opt,name=cmd_type,json=cmdType,proto3" json:"cmd_type,omitempty"` - // pg_stat_monitor 0.9 metrics - // - // Total number of planned calls. - MPlansCallsSum float32 `protobuf:"fixed32,31,opt,name=m_plans_calls_sum,json=mPlansCallsSum,proto3" json:"m_plans_calls_sum,omitempty"` - MPlansCallsCnt float32 `protobuf:"fixed32,32,opt,name=m_plans_calls_cnt,json=mPlansCallsCnt,proto3" json:"m_plans_calls_cnt,omitempty"` - // Total number of WAL (Write-ahead logging) records. - MWalRecordsSum float32 `protobuf:"fixed32,33,opt,name=m_wal_records_sum,json=mWalRecordsSum,proto3" json:"m_wal_records_sum,omitempty"` - MWalRecordsCnt float32 `protobuf:"fixed32,34,opt,name=m_wal_records_cnt,json=mWalRecordsCnt,proto3" json:"m_wal_records_cnt,omitempty"` - // Total number of FPI (full page images) in WAL (Write-ahead logging) records. - MWalFpiSum float32 `protobuf:"fixed32,35,opt,name=m_wal_fpi_sum,json=mWalFpiSum,proto3" json:"m_wal_fpi_sum,omitempty"` - MWalFpiCnt float32 `protobuf:"fixed32,36,opt,name=m_wal_fpi_cnt,json=mWalFpiCnt,proto3" json:"m_wal_fpi_cnt,omitempty"` - // Total bytes of WAL (Write-ahead logging) records. - MWalBytesSum float32 `protobuf:"fixed32,37,opt,name=m_wal_bytes_sum,json=mWalBytesSum,proto3" json:"m_wal_bytes_sum,omitempty"` - MWalBytesCnt float32 `protobuf:"fixed32,38,opt,name=m_wal_bytes_cnt,json=mWalBytesCnt,proto3" json:"m_wal_bytes_cnt,omitempty"` - // Sum, count, min, max of plan time. - MPlanTimeSum float32 `protobuf:"fixed32,39,opt,name=m_plan_time_sum,json=mPlanTimeSum,proto3" json:"m_plan_time_sum,omitempty"` - MPlanTimeCnt float32 `protobuf:"fixed32,40,opt,name=m_plan_time_cnt,json=mPlanTimeCnt,proto3" json:"m_plan_time_cnt,omitempty"` - MPlanTimeMin float32 `protobuf:"fixed32,41,opt,name=m_plan_time_min,json=mPlanTimeMin,proto3" json:"m_plan_time_min,omitempty"` - MPlanTimeMax float32 `protobuf:"fixed32,42,opt,name=m_plan_time_max,json=mPlanTimeMax,proto3" json:"m_plan_time_max,omitempty"` - // Metrics skipped due to different bucket_time in pg_stat_monitor (1min in PMM, 5min in pg_stat_monitor): - // min_time, max_time, mean_time - // plan_mean_time - // stddev_time - // Other metrics skipped (empty values, codes): - // cmd_type_text, elevel, sqlcode, message, state_code, state - TopQueryid string `protobuf:"bytes,44,opt,name=top_queryid,json=topQueryid,proto3" json:"top_queryid,omitempty"` - TopQuery string `protobuf:"bytes,47,opt,name=top_query,json=topQuery,proto3" json:"top_query,omitempty"` - ApplicationName string `protobuf:"bytes,45,opt,name=application_name,json=applicationName,proto3" json:"application_name,omitempty"` - Planid string `protobuf:"bytes,46,opt,name=planid,proto3" json:"planid,omitempty"` - QueryPlan string `protobuf:"bytes,48,opt,name=query_plan,json=queryPlan,proto3" json:"query_plan,omitempty"` - HistogramItems []*HistogramItem `protobuf:"bytes,49,rep,name=histogram_items,json=histogramItems,proto3" json:"histogram_items,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *MetricsBucket_PostgreSQL) Reset() { - *x = MetricsBucket_PostgreSQL{} - mi := &file_agent_v1_collector_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *MetricsBucket_PostgreSQL) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MetricsBucket_PostgreSQL) ProtoMessage() {} - -func (x *MetricsBucket_PostgreSQL) ProtoReflect() protoreflect.Message { - mi := &file_agent_v1_collector_proto_msgTypes[5] - 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 MetricsBucket_PostgreSQL.ProtoReflect.Descriptor instead. -func (*MetricsBucket_PostgreSQL) Descriptor() ([]byte, []int) { - return file_agent_v1_collector_proto_rawDescGZIP(), []int{0, 3} -} - -func (x *MetricsBucket_PostgreSQL) GetMRowsCnt() float32 { - if x != nil { - return x.MRowsCnt - } - return 0 -} - -func (x *MetricsBucket_PostgreSQL) GetMRowsSum() float32 { - if x != nil { - return x.MRowsSum - } - return 0 -} - -func (x *MetricsBucket_PostgreSQL) GetMSharedBlksHitCnt() float32 { - if x != nil { - return x.MSharedBlksHitCnt - } - return 0 -} - -func (x *MetricsBucket_PostgreSQL) GetMSharedBlksHitSum() float32 { - if x != nil { - return x.MSharedBlksHitSum - } - return 0 -} - -func (x *MetricsBucket_PostgreSQL) GetMSharedBlksReadCnt() float32 { - if x != nil { - return x.MSharedBlksReadCnt - } - return 0 -} - -func (x *MetricsBucket_PostgreSQL) GetMSharedBlksReadSum() float32 { - if x != nil { - return x.MSharedBlksReadSum - } - return 0 -} - -func (x *MetricsBucket_PostgreSQL) GetMSharedBlksDirtiedCnt() float32 { - if x != nil { - return x.MSharedBlksDirtiedCnt - } - return 0 -} - -func (x *MetricsBucket_PostgreSQL) GetMSharedBlksDirtiedSum() float32 { - if x != nil { - return x.MSharedBlksDirtiedSum - } - return 0 -} - -func (x *MetricsBucket_PostgreSQL) GetMSharedBlksWrittenCnt() float32 { - if x != nil { - return x.MSharedBlksWrittenCnt - } - return 0 -} - -func (x *MetricsBucket_PostgreSQL) GetMSharedBlksWrittenSum() float32 { - if x != nil { - return x.MSharedBlksWrittenSum - } - return 0 -} - -func (x *MetricsBucket_PostgreSQL) GetMLocalBlksHitCnt() float32 { - if x != nil { - return x.MLocalBlksHitCnt - } - return 0 -} - -func (x *MetricsBucket_PostgreSQL) GetMLocalBlksHitSum() float32 { - if x != nil { - return x.MLocalBlksHitSum - } - return 0 -} - -func (x *MetricsBucket_PostgreSQL) GetMLocalBlksReadCnt() float32 { - if x != nil { - return x.MLocalBlksReadCnt - } - return 0 -} - -func (x *MetricsBucket_PostgreSQL) GetMLocalBlksReadSum() float32 { - if x != nil { - return x.MLocalBlksReadSum - } - return 0 -} - -func (x *MetricsBucket_PostgreSQL) GetMLocalBlksDirtiedCnt() float32 { - if x != nil { - return x.MLocalBlksDirtiedCnt - } - return 0 -} - -func (x *MetricsBucket_PostgreSQL) GetMLocalBlksDirtiedSum() float32 { - if x != nil { - return x.MLocalBlksDirtiedSum - } - return 0 -} - -func (x *MetricsBucket_PostgreSQL) GetMLocalBlksWrittenCnt() float32 { - if x != nil { - return x.MLocalBlksWrittenCnt - } - return 0 -} - -func (x *MetricsBucket_PostgreSQL) GetMLocalBlksWrittenSum() float32 { - if x != nil { - return x.MLocalBlksWrittenSum - } - return 0 -} - -func (x *MetricsBucket_PostgreSQL) GetMTempBlksReadCnt() float32 { - if x != nil { - return x.MTempBlksReadCnt - } - return 0 -} - -func (x *MetricsBucket_PostgreSQL) GetMTempBlksReadSum() float32 { - if x != nil { - return x.MTempBlksReadSum - } - return 0 -} - -func (x *MetricsBucket_PostgreSQL) GetMTempBlksWrittenCnt() float32 { - if x != nil { - return x.MTempBlksWrittenCnt - } - return 0 -} - -func (x *MetricsBucket_PostgreSQL) GetMTempBlksWrittenSum() float32 { - if x != nil { - return x.MTempBlksWrittenSum - } - return 0 -} - -func (x *MetricsBucket_PostgreSQL) GetMSharedBlkReadTimeCnt() float32 { - if x != nil { - return x.MSharedBlkReadTimeCnt - } - return 0 -} - -func (x *MetricsBucket_PostgreSQL) GetMSharedBlkReadTimeSum() float32 { - if x != nil { - return x.MSharedBlkReadTimeSum - } - return 0 -} - -func (x *MetricsBucket_PostgreSQL) GetMSharedBlkWriteTimeCnt() float32 { - if x != nil { - return x.MSharedBlkWriteTimeCnt - } - return 0 -} - -func (x *MetricsBucket_PostgreSQL) GetMSharedBlkWriteTimeSum() float32 { - if x != nil { - return x.MSharedBlkWriteTimeSum - } - return 0 -} - -func (x *MetricsBucket_PostgreSQL) GetMLocalBlkReadTimeCnt() float32 { - if x != nil { - return x.MLocalBlkReadTimeCnt - } - return 0 -} - -func (x *MetricsBucket_PostgreSQL) GetMLocalBlkReadTimeSum() float32 { - if x != nil { - return x.MLocalBlkReadTimeSum - } - return 0 -} - -func (x *MetricsBucket_PostgreSQL) GetMLocalBlkWriteTimeCnt() float32 { - if x != nil { - return x.MLocalBlkWriteTimeCnt - } - return 0 -} - -func (x *MetricsBucket_PostgreSQL) GetMLocalBlkWriteTimeSum() float32 { - if x != nil { - return x.MLocalBlkWriteTimeSum - } - return 0 -} - -func (x *MetricsBucket_PostgreSQL) GetMCpuUserTimeCnt() float32 { - if x != nil { - return x.MCpuUserTimeCnt - } - return 0 -} - -func (x *MetricsBucket_PostgreSQL) GetMCpuUserTimeSum() float32 { - if x != nil { - return x.MCpuUserTimeSum - } - return 0 -} - -func (x *MetricsBucket_PostgreSQL) GetMCpuSysTimeCnt() float32 { - if x != nil { - return x.MCpuSysTimeCnt - } - return 0 -} - -func (x *MetricsBucket_PostgreSQL) GetMCpuSysTimeSum() float32 { - if x != nil { - return x.MCpuSysTimeSum - } - return 0 -} - -func (x *MetricsBucket_PostgreSQL) GetCmdType() string { - if x != nil { - return x.CmdType - } - return "" -} - -func (x *MetricsBucket_PostgreSQL) GetMPlansCallsSum() float32 { - if x != nil { - return x.MPlansCallsSum - } - return 0 -} - -func (x *MetricsBucket_PostgreSQL) GetMPlansCallsCnt() float32 { - if x != nil { - return x.MPlansCallsCnt - } - return 0 -} - -func (x *MetricsBucket_PostgreSQL) GetMWalRecordsSum() float32 { - if x != nil { - return x.MWalRecordsSum - } - return 0 -} - -func (x *MetricsBucket_PostgreSQL) GetMWalRecordsCnt() float32 { - if x != nil { - return x.MWalRecordsCnt - } - return 0 -} - -func (x *MetricsBucket_PostgreSQL) GetMWalFpiSum() float32 { - if x != nil { - return x.MWalFpiSum - } - return 0 -} - -func (x *MetricsBucket_PostgreSQL) GetMWalFpiCnt() float32 { - if x != nil { - return x.MWalFpiCnt - } - return 0 -} - -func (x *MetricsBucket_PostgreSQL) GetMWalBytesSum() float32 { - if x != nil { - return x.MWalBytesSum - } - return 0 -} - -func (x *MetricsBucket_PostgreSQL) GetMWalBytesCnt() float32 { - if x != nil { - return x.MWalBytesCnt - } - return 0 -} - -func (x *MetricsBucket_PostgreSQL) GetMPlanTimeSum() float32 { - if x != nil { - return x.MPlanTimeSum - } - return 0 -} - -func (x *MetricsBucket_PostgreSQL) GetMPlanTimeCnt() float32 { - if x != nil { - return x.MPlanTimeCnt - } - return 0 -} - -func (x *MetricsBucket_PostgreSQL) GetMPlanTimeMin() float32 { - if x != nil { - return x.MPlanTimeMin - } - return 0 -} - -func (x *MetricsBucket_PostgreSQL) GetMPlanTimeMax() float32 { - if x != nil { - return x.MPlanTimeMax - } - return 0 -} - -func (x *MetricsBucket_PostgreSQL) GetTopQueryid() string { - if x != nil { - return x.TopQueryid - } - return "" -} - -func (x *MetricsBucket_PostgreSQL) GetTopQuery() string { - if x != nil { - return x.TopQuery - } - return "" -} - -func (x *MetricsBucket_PostgreSQL) GetApplicationName() string { - if x != nil { - return x.ApplicationName - } - return "" -} - -func (x *MetricsBucket_PostgreSQL) GetPlanid() string { - if x != nil { - return x.Planid - } - return "" -} - -func (x *MetricsBucket_PostgreSQL) GetQueryPlan() string { - if x != nil { - return x.QueryPlan - } - return "" -} - -func (x *MetricsBucket_PostgreSQL) GetHistogramItems() []*HistogramItem { - if x != nil { - return x.HistogramItems - } - return nil -} - -var File_agent_v1_collector_proto protoreflect.FileDescriptor - -const file_agent_v1_collector_proto_rawDesc = "" + - "\n" + - "\x18agent/v1/collector.proto\x12\bagent.v1\x1a\x19inventory/v1/agents.proto\"\xa9e\n" + - "\rMetricsBucket\x126\n" + - "\x06common\x18\x01 \x01(\v2\x1e.agent.v1.MetricsBucket.CommonR\x06common\x123\n" + - "\x05mysql\x18\x02 \x01(\v2\x1d.agent.v1.MetricsBucket.MySQLR\x05mysql\x129\n" + - "\amongodb\x18\x03 \x01(\v2\x1f.agent.v1.MetricsBucket.MongoDBR\amongodb\x12B\n" + - "\n" + - "postgresql\x18\x04 \x01(\v2\".agent.v1.MetricsBucket.PostgreSQLR\n" + - "postgresql\x1a\xd6\t\n" + - "\x06Common\x12\x18\n" + - "\aqueryid\x18\x01 \x01(\tR\aqueryid\x12/\n" + - "\x13explain_fingerprint\x18\x19 \x01(\tR\x12explainFingerprint\x12-\n" + - "\x12placeholders_count\x18\x1a \x01(\rR\x11placeholdersCount\x12H\n" + - "\bcomments\x18\x1b \x03(\v2,.agent.v1.MetricsBucket.Common.CommentsEntryR\bcomments\x12 \n" + - "\vfingerprint\x18\x02 \x01(\tR\vfingerprint\x12\x1a\n" + - "\bdatabase\x18\x03 \x01(\tR\bdatabase\x12\x16\n" + - "\x06schema\x18\x04 \x01(\tR\x06schema\x12\x16\n" + - "\x06tables\x18\x05 \x03(\tR\x06tables\x12\x1a\n" + - "\busername\x18\x06 \x01(\tR\busername\x12\x1f\n" + - "\vclient_host\x18\a \x01(\tR\n" + - "clientHost\x12\x19\n" + - "\bagent_id\x18\b \x01(\tR\aagentId\x126\n" + - "\n" + - "agent_type\x18\t \x01(\x0e2\x17.inventory.v1.AgentTypeR\tagentType\x123\n" + - "\x16period_start_unix_secs\x18\n" + - " \x01(\rR\x13periodStartUnixSecs\x12,\n" + - "\x12period_length_secs\x18\v \x01(\rR\x10periodLengthSecs\x12\x18\n" + - "\aexample\x18\f \x01(\tR\aexample\x128\n" + - "\fexample_type\x18\x0e \x01(\x0e2\x15.agent.v1.ExampleTypeR\vexampleType\x12!\n" + - "\fis_truncated\x18\x18 \x01(\bR\visTruncated\x129\n" + - "\x19num_queries_with_warnings\x18\x0f \x01(\x02R\x16numQueriesWithWarnings\x125\n" + - "\x17num_queries_with_errors\x18\x10 \x01(\x02R\x14numQueriesWithErrors\x12B\n" + - "\x06errors\x18\x11 \x03(\v2*.agent.v1.MetricsBucket.Common.ErrorsEntryR\x06errors\x12\x1f\n" + - "\vnum_queries\x18\x12 \x01(\x02R\n" + - "numQueries\x12'\n" + - "\x10m_query_time_cnt\x18\x13 \x01(\x02R\rmQueryTimeCnt\x12'\n" + - "\x10m_query_time_sum\x18\x14 \x01(\x02R\rmQueryTimeSum\x12'\n" + - "\x10m_query_time_min\x18\x15 \x01(\x02R\rmQueryTimeMin\x12'\n" + - "\x10m_query_time_max\x18\x16 \x01(\x02R\rmQueryTimeMax\x12'\n" + - "\x10m_query_time_p99\x18\x17 \x01(\x02R\rmQueryTimeP99\x1a;\n" + - "\rCommentsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\x1a9\n" + - "\vErrorsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\x04R\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\x04R\x05value:\x028\x01J\x04\b\r\x10\x0eR\x0eexample_format\x1a\xa8*\n" + - "\x05MySQL\x12%\n" + - "\x0fm_lock_time_cnt\x18\x01 \x01(\x02R\fmLockTimeCnt\x12%\n" + - "\x0fm_lock_time_sum\x18\x02 \x01(\x02R\fmLockTimeSum\x12%\n" + - "\x0fm_lock_time_min\x18\x03 \x01(\x02R\fmLockTimeMin\x12%\n" + - "\x0fm_lock_time_max\x18\x04 \x01(\x02R\fmLockTimeMax\x12%\n" + - "\x0fm_lock_time_p99\x18\x05 \x01(\x02R\fmLockTimeP99\x12%\n" + - "\x0fm_rows_sent_cnt\x18\x06 \x01(\x02R\fmRowsSentCnt\x12%\n" + - "\x0fm_rows_sent_sum\x18\a \x01(\x02R\fmRowsSentSum\x12%\n" + - "\x0fm_rows_sent_min\x18\b \x01(\x02R\fmRowsSentMin\x12%\n" + - "\x0fm_rows_sent_max\x18\t \x01(\x02R\fmRowsSentMax\x12%\n" + - "\x0fm_rows_sent_p99\x18\n" + - " \x01(\x02R\fmRowsSentP99\x12-\n" + - "\x13m_rows_examined_cnt\x18\v \x01(\x02R\x10mRowsExaminedCnt\x12-\n" + - "\x13m_rows_examined_sum\x18\f \x01(\x02R\x10mRowsExaminedSum\x12-\n" + - "\x13m_rows_examined_min\x18\r \x01(\x02R\x10mRowsExaminedMin\x12-\n" + - "\x13m_rows_examined_max\x18\x0e \x01(\x02R\x10mRowsExaminedMax\x12-\n" + - "\x13m_rows_examined_p99\x18\x0f \x01(\x02R\x10mRowsExaminedP99\x12-\n" + - "\x13m_rows_affected_cnt\x18\x10 \x01(\x02R\x10mRowsAffectedCnt\x12-\n" + - "\x13m_rows_affected_sum\x18\x11 \x01(\x02R\x10mRowsAffectedSum\x12-\n" + - "\x13m_rows_affected_min\x18\x12 \x01(\x02R\x10mRowsAffectedMin\x12-\n" + - "\x13m_rows_affected_max\x18\x13 \x01(\x02R\x10mRowsAffectedMax\x12-\n" + - "\x13m_rows_affected_p99\x18\x14 \x01(\x02R\x10mRowsAffectedP99\x12%\n" + - "\x0fm_rows_read_cnt\x18\x15 \x01(\x02R\fmRowsReadCnt\x12%\n" + - "\x0fm_rows_read_sum\x18\x16 \x01(\x02R\fmRowsReadSum\x12%\n" + - "\x0fm_rows_read_min\x18\x17 \x01(\x02R\fmRowsReadMin\x12%\n" + - "\x0fm_rows_read_max\x18\x18 \x01(\x02R\fmRowsReadMax\x12%\n" + - "\x0fm_rows_read_p99\x18\x19 \x01(\x02R\fmRowsReadP99\x12+\n" + - "\x12m_merge_passes_cnt\x18\x1a \x01(\x02R\x0fmMergePassesCnt\x12+\n" + - "\x12m_merge_passes_sum\x18\x1b \x01(\x02R\x0fmMergePassesSum\x12+\n" + - "\x12m_merge_passes_min\x18\x1c \x01(\x02R\x0fmMergePassesMin\x12+\n" + - "\x12m_merge_passes_max\x18\x1d \x01(\x02R\x0fmMergePassesMax\x12+\n" + - "\x12m_merge_passes_p99\x18\x1e \x01(\x02R\x0fmMergePassesP99\x12/\n" + - "\x15m_innodb_io_r_ops_cnt\x18\x1f \x01(\x02R\x10mInnodbIoROpsCnt\x12/\n" + - "\x15m_innodb_io_r_ops_sum\x18 \x01(\x02R\x10mInnodbIoROpsSum\x12/\n" + - "\x15m_innodb_io_r_ops_min\x18! \x01(\x02R\x10mInnodbIoROpsMin\x12/\n" + - "\x15m_innodb_io_r_ops_max\x18\" \x01(\x02R\x10mInnodbIoROpsMax\x12/\n" + - "\x15m_innodb_io_r_ops_p99\x18# \x01(\x02R\x10mInnodbIoROpsP99\x123\n" + - "\x17m_innodb_io_r_bytes_cnt\x18$ \x01(\x02R\x12mInnodbIoRBytesCnt\x123\n" + - "\x17m_innodb_io_r_bytes_sum\x18% \x01(\x02R\x12mInnodbIoRBytesSum\x123\n" + - "\x17m_innodb_io_r_bytes_min\x18& \x01(\x02R\x12mInnodbIoRBytesMin\x123\n" + - "\x17m_innodb_io_r_bytes_max\x18' \x01(\x02R\x12mInnodbIoRBytesMax\x123\n" + - "\x17m_innodb_io_r_bytes_p99\x18( \x01(\x02R\x12mInnodbIoRBytesP99\x121\n" + - "\x16m_innodb_io_r_wait_cnt\x18) \x01(\x02R\x11mInnodbIoRWaitCnt\x121\n" + - "\x16m_innodb_io_r_wait_sum\x18* \x01(\x02R\x11mInnodbIoRWaitSum\x121\n" + - "\x16m_innodb_io_r_wait_min\x18+ \x01(\x02R\x11mInnodbIoRWaitMin\x121\n" + - "\x16m_innodb_io_r_wait_max\x18, \x01(\x02R\x11mInnodbIoRWaitMax\x121\n" + - "\x16m_innodb_io_r_wait_p99\x18- \x01(\x02R\x11mInnodbIoRWaitP99\x129\n" + - "\x1am_innodb_rec_lock_wait_cnt\x18. \x01(\x02R\x15mInnodbRecLockWaitCnt\x129\n" + - "\x1am_innodb_rec_lock_wait_sum\x18/ \x01(\x02R\x15mInnodbRecLockWaitSum\x129\n" + - "\x1am_innodb_rec_lock_wait_min\x180 \x01(\x02R\x15mInnodbRecLockWaitMin\x129\n" + - "\x1am_innodb_rec_lock_wait_max\x181 \x01(\x02R\x15mInnodbRecLockWaitMax\x129\n" + - "\x1am_innodb_rec_lock_wait_p99\x182 \x01(\x02R\x15mInnodbRecLockWaitP99\x124\n" + - "\x17m_innodb_queue_wait_cnt\x183 \x01(\x02R\x13mInnodbQueueWaitCnt\x124\n" + - "\x17m_innodb_queue_wait_sum\x184 \x01(\x02R\x13mInnodbQueueWaitSum\x124\n" + - "\x17m_innodb_queue_wait_min\x185 \x01(\x02R\x13mInnodbQueueWaitMin\x124\n" + - "\x17m_innodb_queue_wait_max\x186 \x01(\x02R\x13mInnodbQueueWaitMax\x124\n" + - "\x17m_innodb_queue_wait_p99\x187 \x01(\x02R\x13mInnodbQueueWaitP99\x12<\n" + - "\x1bm_innodb_pages_distinct_cnt\x188 \x01(\x02R\x17mInnodbPagesDistinctCnt\x12<\n" + - "\x1bm_innodb_pages_distinct_sum\x189 \x01(\x02R\x17mInnodbPagesDistinctSum\x12<\n" + - "\x1bm_innodb_pages_distinct_min\x18: \x01(\x02R\x17mInnodbPagesDistinctMin\x12<\n" + - "\x1bm_innodb_pages_distinct_max\x18; \x01(\x02R\x17mInnodbPagesDistinctMax\x12<\n" + - "\x1bm_innodb_pages_distinct_p99\x18< \x01(\x02R\x17mInnodbPagesDistinctP99\x12+\n" + - "\x12m_query_length_cnt\x18= \x01(\x02R\x0fmQueryLengthCnt\x12+\n" + - "\x12m_query_length_sum\x18> \x01(\x02R\x0fmQueryLengthSum\x12+\n" + - "\x12m_query_length_min\x18? \x01(\x02R\x0fmQueryLengthMin\x12+\n" + - "\x12m_query_length_max\x18@ \x01(\x02R\x0fmQueryLengthMax\x12+\n" + - "\x12m_query_length_p99\x18A \x01(\x02R\x0fmQueryLengthP99\x12'\n" + - "\x10m_bytes_sent_cnt\x18B \x01(\x02R\rmBytesSentCnt\x12'\n" + - "\x10m_bytes_sent_sum\x18C \x01(\x02R\rmBytesSentSum\x12'\n" + - "\x10m_bytes_sent_min\x18D \x01(\x02R\rmBytesSentMin\x12'\n" + - "\x10m_bytes_sent_max\x18E \x01(\x02R\rmBytesSentMax\x12'\n" + - "\x10m_bytes_sent_p99\x18F \x01(\x02R\rmBytesSentP99\x12'\n" + - "\x10m_tmp_tables_cnt\x18G \x01(\x02R\rmTmpTablesCnt\x12'\n" + - "\x10m_tmp_tables_sum\x18H \x01(\x02R\rmTmpTablesSum\x12'\n" + - "\x10m_tmp_tables_min\x18I \x01(\x02R\rmTmpTablesMin\x12'\n" + - "\x10m_tmp_tables_max\x18J \x01(\x02R\rmTmpTablesMax\x12'\n" + - "\x10m_tmp_tables_p99\x18K \x01(\x02R\rmTmpTablesP99\x120\n" + - "\x15m_tmp_disk_tables_cnt\x18L \x01(\x02R\x11mTmpDiskTablesCnt\x120\n" + - "\x15m_tmp_disk_tables_sum\x18M \x01(\x02R\x11mTmpDiskTablesSum\x120\n" + - "\x15m_tmp_disk_tables_min\x18N \x01(\x02R\x11mTmpDiskTablesMin\x120\n" + - "\x15m_tmp_disk_tables_max\x18O \x01(\x02R\x11mTmpDiskTablesMax\x120\n" + - "\x15m_tmp_disk_tables_p99\x18P \x01(\x02R\x11mTmpDiskTablesP99\x120\n" + - "\x15m_tmp_table_sizes_cnt\x18Q \x01(\x02R\x11mTmpTableSizesCnt\x120\n" + - "\x15m_tmp_table_sizes_sum\x18R \x01(\x02R\x11mTmpTableSizesSum\x120\n" + - "\x15m_tmp_table_sizes_min\x18S \x01(\x02R\x11mTmpTableSizesMin\x120\n" + - "\x15m_tmp_table_sizes_max\x18T \x01(\x02R\x11mTmpTableSizesMax\x120\n" + - "\x15m_tmp_table_sizes_p99\x18U \x01(\x02R\x11mTmpTableSizesP99\x12\x1f\n" + - "\fm_qc_hit_cnt\x18V \x01(\x02R\tmQcHitCnt\x12\x1f\n" + - "\fm_qc_hit_sum\x18W \x01(\x02R\tmQcHitSum\x12%\n" + - "\x0fm_full_scan_cnt\x18X \x01(\x02R\fmFullScanCnt\x12%\n" + - "\x0fm_full_scan_sum\x18Y \x01(\x02R\fmFullScanSum\x12%\n" + - "\x0fm_full_join_cnt\x18Z \x01(\x02R\fmFullJoinCnt\x12%\n" + - "\x0fm_full_join_sum\x18[ \x01(\x02R\fmFullJoinSum\x12%\n" + - "\x0fm_tmp_table_cnt\x18\\ \x01(\x02R\fmTmpTableCnt\x12%\n" + - "\x0fm_tmp_table_sum\x18] \x01(\x02R\fmTmpTableSum\x123\n" + - "\x17m_tmp_table_on_disk_cnt\x18^ \x01(\x02R\x12mTmpTableOnDiskCnt\x123\n" + - "\x17m_tmp_table_on_disk_sum\x18_ \x01(\x02R\x12mTmpTableOnDiskSum\x12$\n" + - "\x0em_filesort_cnt\x18` \x01(\x02R\fmFilesortCnt\x12$\n" + - "\x0em_filesort_sum\x18a \x01(\x02R\fmFilesortSum\x122\n" + - "\x16m_filesort_on_disk_cnt\x18b \x01(\x02R\x12mFilesortOnDiskCnt\x122\n" + - "\x16m_filesort_on_disk_sum\x18c \x01(\x02R\x12mFilesortOnDiskSum\x12=\n" + - "\x1cm_select_full_range_join_cnt\x18d \x01(\x02R\x17mSelectFullRangeJoinCnt\x12=\n" + - "\x1cm_select_full_range_join_sum\x18e \x01(\x02R\x17mSelectFullRangeJoinSum\x12+\n" + - "\x12m_select_range_cnt\x18f \x01(\x02R\x0fmSelectRangeCnt\x12+\n" + - "\x12m_select_range_sum\x18g \x01(\x02R\x0fmSelectRangeSum\x126\n" + - "\x18m_select_range_check_cnt\x18h \x01(\x02R\x14mSelectRangeCheckCnt\x126\n" + - "\x18m_select_range_check_sum\x18i \x01(\x02R\x14mSelectRangeCheckSum\x12'\n" + - "\x10m_sort_range_cnt\x18j \x01(\x02R\rmSortRangeCnt\x12'\n" + - "\x10m_sort_range_sum\x18k \x01(\x02R\rmSortRangeSum\x12%\n" + - "\x0fm_sort_rows_cnt\x18l \x01(\x02R\fmSortRowsCnt\x12%\n" + - "\x0fm_sort_rows_sum\x18m \x01(\x02R\fmSortRowsSum\x12%\n" + - "\x0fm_sort_scan_cnt\x18n \x01(\x02R\fmSortScanCnt\x12%\n" + - "\x0fm_sort_scan_sum\x18o \x01(\x02R\fmSortScanSum\x12,\n" + - "\x13m_no_index_used_cnt\x18p \x01(\x02R\x0fmNoIndexUsedCnt\x12,\n" + - "\x13m_no_index_used_sum\x18q \x01(\x02R\x0fmNoIndexUsedSum\x125\n" + - "\x18m_no_good_index_used_cnt\x18r \x01(\x02R\x13mNoGoodIndexUsedCnt\x125\n" + - "\x18m_no_good_index_used_sum\x18s \x01(\x02R\x13mNoGoodIndexUsedSum\x1a\xd3\x1b\n" + - "\aMongoDB\x12-\n" + - "\x13m_docs_returned_cnt\x18\x01 \x01(\x02R\x10mDocsReturnedCnt\x12-\n" + - "\x13m_docs_returned_sum\x18\x02 \x01(\x02R\x10mDocsReturnedSum\x12-\n" + - "\x13m_docs_returned_min\x18\x03 \x01(\x02R\x10mDocsReturnedMin\x12-\n" + - "\x13m_docs_returned_max\x18\x04 \x01(\x02R\x10mDocsReturnedMax\x12-\n" + - "\x13m_docs_returned_p99\x18\x05 \x01(\x02R\x10mDocsReturnedP99\x121\n" + - "\x15m_response_length_cnt\x18\x06 \x01(\x02R\x12mResponseLengthCnt\x121\n" + - "\x15m_response_length_sum\x18\a \x01(\x02R\x12mResponseLengthSum\x121\n" + - "\x15m_response_length_min\x18\b \x01(\x02R\x12mResponseLengthMin\x121\n" + - "\x15m_response_length_max\x18\t \x01(\x02R\x12mResponseLengthMax\x121\n" + - "\x15m_response_length_p99\x18\n" + - " \x01(\x02R\x12mResponseLengthP99\x12+\n" + - "\x12m_docs_scanned_cnt\x18\v \x01(\x02R\x0fmDocsScannedCnt\x12+\n" + - "\x12m_docs_scanned_sum\x18\f \x01(\x02R\x0fmDocsScannedSum\x12+\n" + - "\x12m_docs_scanned_min\x18\r \x01(\x02R\x0fmDocsScannedMin\x12+\n" + - "\x12m_docs_scanned_max\x18\x0e \x01(\x02R\x0fmDocsScannedMax\x12+\n" + - "\x12m_docs_scanned_p99\x18\x0f \x01(\x02R\x0fmDocsScannedP99\x12%\n" + - "\x0fm_full_scan_cnt\x18\x10 \x01(\x02R\fmFullScanCnt\x12%\n" + - "\x0fm_full_scan_sum\x18\x11 \x01(\x02R\fmFullScanSum\x12!\n" + - "\fplan_summary\x18\x12 \x01(\tR\vplanSummary\x12-\n" + - "\x13m_docs_examined_cnt\x18\x13 \x01(\x02R\x10mDocsExaminedCnt\x12-\n" + - "\x13m_docs_examined_sum\x18\x14 \x01(\x02R\x10mDocsExaminedSum\x12-\n" + - "\x13m_docs_examined_min\x18\x15 \x01(\x02R\x10mDocsExaminedMin\x12-\n" + - "\x13m_docs_examined_max\x18\x16 \x01(\x02R\x10mDocsExaminedMax\x12-\n" + - "\x13m_docs_examined_p99\x18\x17 \x01(\x02R\x10mDocsExaminedP99\x12-\n" + - "\x13m_keys_examined_cnt\x18\x18 \x01(\x02R\x10mKeysExaminedCnt\x12-\n" + - "\x13m_keys_examined_sum\x18\x19 \x01(\x02R\x10mKeysExaminedSum\x12-\n" + - "\x13m_keys_examined_min\x18\x1a \x01(\x02R\x10mKeysExaminedMin\x12-\n" + - "\x13m_keys_examined_max\x18\x1b \x01(\x02R\x10mKeysExaminedMax\x12-\n" + - "\x13m_keys_examined_p99\x18\x1c \x01(\x02R\x10mKeysExaminedP99\x12)\n" + - "\x10application_name\x18\x1d \x01(\tR\x0fapplicationName\x12[\n" + - ",m_locks_global_acquire_count_read_shared_cnt\x18\x1e \x01(\x02R%mLocksGlobalAcquireCountReadSharedCnt\x12[\n" + - ",m_locks_global_acquire_count_read_shared_sum\x18\x1f \x01(\x02R%mLocksGlobalAcquireCountReadSharedSum\x12]\n" + - "-m_locks_global_acquire_count_write_shared_cnt\x18 \x01(\x02R&mLocksGlobalAcquireCountWriteSharedCnt\x12]\n" + - "-m_locks_global_acquire_count_write_shared_sum\x18! \x01(\x02R&mLocksGlobalAcquireCountWriteSharedSum\x12_\n" + - ".m_locks_database_acquire_count_read_shared_cnt\x18\" \x01(\x02R'mLocksDatabaseAcquireCountReadSharedCnt\x12_\n" + - ".m_locks_database_acquire_count_read_shared_sum\x18# \x01(\x02R'mLocksDatabaseAcquireCountReadSharedSum\x12h\n" + - "3m_locks_database_acquire_wait_count_read_shared_cnt\x18$ \x01(\x02R+mLocksDatabaseAcquireWaitCountReadSharedCnt\x12h\n" + - "3m_locks_database_acquire_wait_count_read_shared_sum\x18% \x01(\x02R+mLocksDatabaseAcquireWaitCountReadSharedSum\x12n\n" + - "6m_locks_database_time_acquiring_micros_read_shared_cnt\x18& \x01(\x02R.mLocksDatabaseTimeAcquiringMicrosReadSharedCnt\x12n\n" + - "6m_locks_database_time_acquiring_micros_read_shared_sum\x18' \x01(\x02R.mLocksDatabaseTimeAcquiringMicrosReadSharedSum\x12n\n" + - "6m_locks_database_time_acquiring_micros_read_shared_min\x18( \x01(\x02R.mLocksDatabaseTimeAcquiringMicrosReadSharedMin\x12n\n" + - "6m_locks_database_time_acquiring_micros_read_shared_max\x18) \x01(\x02R.mLocksDatabaseTimeAcquiringMicrosReadSharedMax\x12n\n" + - "6m_locks_database_time_acquiring_micros_read_shared_p99\x18* \x01(\x02R.mLocksDatabaseTimeAcquiringMicrosReadSharedP99\x12c\n" + - "0m_locks_collection_acquire_count_read_shared_cnt\x18+ \x01(\x02R)mLocksCollectionAcquireCountReadSharedCnt\x12c\n" + - "0m_locks_collection_acquire_count_read_shared_sum\x18, \x01(\x02R)mLocksCollectionAcquireCountReadSharedSum\x126\n" + - "\x18m_storage_bytes_read_cnt\x18- \x01(\x02R\x14mStorageBytesReadCnt\x126\n" + - "\x18m_storage_bytes_read_sum\x18. \x01(\x02R\x14mStorageBytesReadSum\x126\n" + - "\x18m_storage_bytes_read_min\x18/ \x01(\x02R\x14mStorageBytesReadMin\x126\n" + - "\x18m_storage_bytes_read_max\x180 \x01(\x02R\x14mStorageBytesReadMax\x126\n" + - "\x18m_storage_bytes_read_p99\x181 \x01(\x02R\x14mStorageBytesReadP99\x12G\n" + - "!m_storage_time_reading_micros_cnt\x182 \x01(\x02R\x1cmStorageTimeReadingMicrosCnt\x12G\n" + - "!m_storage_time_reading_micros_sum\x183 \x01(\x02R\x1cmStorageTimeReadingMicrosSum\x12G\n" + - "!m_storage_time_reading_micros_min\x184 \x01(\x02R\x1cmStorageTimeReadingMicrosMin\x12G\n" + - "!m_storage_time_reading_micros_max\x185 \x01(\x02R\x1cmStorageTimeReadingMicrosMax\x12G\n" + - "!m_storage_time_reading_micros_p99\x186 \x01(\x02R\x1cmStorageTimeReadingMicrosP99\x1a\xd1\x13\n" + - "\n" + - "PostgreSQL\x12\x1c\n" + - "\n" + - "m_rows_cnt\x18\x01 \x01(\x02R\bmRowsCnt\x12\x1c\n" + - "\n" + - "m_rows_sum\x18\x02 \x01(\x02R\bmRowsSum\x120\n" + - "\x15m_shared_blks_hit_cnt\x18\x03 \x01(\x02R\x11mSharedBlksHitCnt\x120\n" + - "\x15m_shared_blks_hit_sum\x18\x04 \x01(\x02R\x11mSharedBlksHitSum\x122\n" + - "\x16m_shared_blks_read_cnt\x18\x05 \x01(\x02R\x12mSharedBlksReadCnt\x122\n" + - "\x16m_shared_blks_read_sum\x18\x06 \x01(\x02R\x12mSharedBlksReadSum\x128\n" + - "\x19m_shared_blks_dirtied_cnt\x18\a \x01(\x02R\x15mSharedBlksDirtiedCnt\x128\n" + - "\x19m_shared_blks_dirtied_sum\x18\b \x01(\x02R\x15mSharedBlksDirtiedSum\x128\n" + - "\x19m_shared_blks_written_cnt\x18\t \x01(\x02R\x15mSharedBlksWrittenCnt\x128\n" + - "\x19m_shared_blks_written_sum\x18\n" + - " \x01(\x02R\x15mSharedBlksWrittenSum\x12.\n" + - "\x14m_local_blks_hit_cnt\x18\v \x01(\x02R\x10mLocalBlksHitCnt\x12.\n" + - "\x14m_local_blks_hit_sum\x18\f \x01(\x02R\x10mLocalBlksHitSum\x120\n" + - "\x15m_local_blks_read_cnt\x18\r \x01(\x02R\x11mLocalBlksReadCnt\x120\n" + - "\x15m_local_blks_read_sum\x18\x0e \x01(\x02R\x11mLocalBlksReadSum\x126\n" + - "\x18m_local_blks_dirtied_cnt\x18\x0f \x01(\x02R\x14mLocalBlksDirtiedCnt\x126\n" + - "\x18m_local_blks_dirtied_sum\x18\x10 \x01(\x02R\x14mLocalBlksDirtiedSum\x126\n" + - "\x18m_local_blks_written_cnt\x18\x11 \x01(\x02R\x14mLocalBlksWrittenCnt\x126\n" + - "\x18m_local_blks_written_sum\x18\x12 \x01(\x02R\x14mLocalBlksWrittenSum\x12.\n" + - "\x14m_temp_blks_read_cnt\x18\x13 \x01(\x02R\x10mTempBlksReadCnt\x12.\n" + - "\x14m_temp_blks_read_sum\x18\x14 \x01(\x02R\x10mTempBlksReadSum\x124\n" + - "\x17m_temp_blks_written_cnt\x18\x15 \x01(\x02R\x13mTempBlksWrittenCnt\x124\n" + - "\x17m_temp_blks_written_sum\x18\x16 \x01(\x02R\x13mTempBlksWrittenSum\x129\n" + - "\x1am_shared_blk_read_time_cnt\x18\x17 \x01(\x02R\x15mSharedBlkReadTimeCnt\x129\n" + - "\x1am_shared_blk_read_time_sum\x18\x18 \x01(\x02R\x15mSharedBlkReadTimeSum\x12;\n" + - "\x1bm_shared_blk_write_time_cnt\x18\x19 \x01(\x02R\x16mSharedBlkWriteTimeCnt\x12;\n" + - "\x1bm_shared_blk_write_time_sum\x18\x1a \x01(\x02R\x16mSharedBlkWriteTimeSum\x127\n" + - "\x19m_local_blk_read_time_cnt\x182 \x01(\x02R\x14mLocalBlkReadTimeCnt\x127\n" + - "\x19m_local_blk_read_time_sum\x183 \x01(\x02R\x14mLocalBlkReadTimeSum\x129\n" + - "\x1am_local_blk_write_time_cnt\x184 \x01(\x02R\x15mLocalBlkWriteTimeCnt\x129\n" + - "\x1am_local_blk_write_time_sum\x185 \x01(\x02R\x15mLocalBlkWriteTimeSum\x12,\n" + - "\x13m_cpu_user_time_cnt\x18\x1b \x01(\x02R\x0fmCpuUserTimeCnt\x12,\n" + - "\x13m_cpu_user_time_sum\x18\x1c \x01(\x02R\x0fmCpuUserTimeSum\x12*\n" + - "\x12m_cpu_sys_time_cnt\x18\x1d \x01(\x02R\x0emCpuSysTimeCnt\x12*\n" + - "\x12m_cpu_sys_time_sum\x18\x1e \x01(\x02R\x0emCpuSysTimeSum\x12\x19\n" + - "\bcmd_type\x18+ \x01(\tR\acmdType\x12)\n" + - "\x11m_plans_calls_sum\x18\x1f \x01(\x02R\x0emPlansCallsSum\x12)\n" + - "\x11m_plans_calls_cnt\x18 \x01(\x02R\x0emPlansCallsCnt\x12)\n" + - "\x11m_wal_records_sum\x18! \x01(\x02R\x0emWalRecordsSum\x12)\n" + - "\x11m_wal_records_cnt\x18\" \x01(\x02R\x0emWalRecordsCnt\x12!\n" + - "\rm_wal_fpi_sum\x18# \x01(\x02R\n" + - "mWalFpiSum\x12!\n" + - "\rm_wal_fpi_cnt\x18$ \x01(\x02R\n" + - "mWalFpiCnt\x12%\n" + - "\x0fm_wal_bytes_sum\x18% \x01(\x02R\fmWalBytesSum\x12%\n" + - "\x0fm_wal_bytes_cnt\x18& \x01(\x02R\fmWalBytesCnt\x12%\n" + - "\x0fm_plan_time_sum\x18' \x01(\x02R\fmPlanTimeSum\x12%\n" + - "\x0fm_plan_time_cnt\x18( \x01(\x02R\fmPlanTimeCnt\x12%\n" + - "\x0fm_plan_time_min\x18) \x01(\x02R\fmPlanTimeMin\x12%\n" + - "\x0fm_plan_time_max\x18* \x01(\x02R\fmPlanTimeMax\x12\x1f\n" + - "\vtop_queryid\x18, \x01(\tR\n" + - "topQueryid\x12\x1b\n" + - "\ttop_query\x18/ \x01(\tR\btopQuery\x12)\n" + - "\x10application_name\x18- \x01(\tR\x0fapplicationName\x12\x16\n" + - "\x06planid\x18. \x01(\tR\x06planid\x12\x1d\n" + - "\n" + - "query_plan\x180 \x01(\tR\tqueryPlan\x12@\n" + - "\x0fhistogram_items\x181 \x03(\v2\x17.agent.v1.HistogramItemR\x0ehistogramItems\"C\n" + - "\rHistogramItem\x12\x14\n" + - "\x05range\x18\x01 \x01(\tR\x05range\x12\x1c\n" + - "\tfrequency\x18\x02 \x01(\rR\tfrequency*\x95\x01\n" + - "\vExampleType\x12\x1c\n" + - "\x18EXAMPLE_TYPE_UNSPECIFIED\x10\x00\x12\x17\n" + - "\x13EXAMPLE_TYPE_RANDOM\x10\x01\x12\x18\n" + - "\x14EXAMPLE_TYPE_SLOWEST\x10\x02\x12\x18\n" + - "\x14EXAMPLE_TYPE_FASTEST\x10\x03\x12\x1b\n" + - "\x17EXAMPLE_TYPE_WITH_ERROR\x10\x04B\x8c\x01\n" + - "\fcom.agent.v1B\x0eCollectorProtoP\x01Z+github.com/percona/pmm/api/agent/v1;agentv1\xa2\x02\x03AXX\xaa\x02\bAgent.V1\xca\x02\bAgent\\V1\xe2\x02\x14Agent\\V1\\GPBMetadata\xea\x02\tAgent::V1b\x06proto3" - -var ( - file_agent_v1_collector_proto_rawDescOnce sync.Once - file_agent_v1_collector_proto_rawDescData []byte -) - -func file_agent_v1_collector_proto_rawDescGZIP() []byte { - file_agent_v1_collector_proto_rawDescOnce.Do(func() { - file_agent_v1_collector_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_agent_v1_collector_proto_rawDesc), len(file_agent_v1_collector_proto_rawDesc))) - }) - 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_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 - 5, // 2: agent.v1.MetricsBucket.mongodb:type_name -> agent.v1.MetricsBucket.MongoDB - 6, // 3: agent.v1.MetricsBucket.postgresql:type_name -> agent.v1.MetricsBucket.PostgreSQL - 7, // 4: agent.v1.MetricsBucket.Common.comments:type_name -> agent.v1.MetricsBucket.Common.CommentsEntry - 9, // 5: agent.v1.MetricsBucket.Common.agent_type:type_name -> inventory.v1.AgentType - 0, // 6: agent.v1.MetricsBucket.Common.example_type:type_name -> agent.v1.ExampleType - 8, // 7: agent.v1.MetricsBucket.Common.errors:type_name -> agent.v1.MetricsBucket.Common.ErrorsEntry - 2, // 8: agent.v1.MetricsBucket.PostgreSQL.histogram_items:type_name -> agent.v1.HistogramItem - 9, // [9:9] is the sub-list for method output_type - 9, // [9:9] is the sub-list for method input_type - 9, // [9:9] is the sub-list for extension type_name - 9, // [9:9] is the sub-list for extension extendee - 0, // [0:9] is the sub-list for field type_name -} - -func init() { file_agent_v1_collector_proto_init() } -func file_agent_v1_collector_proto_init() { - if File_agent_v1_collector_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_agent_v1_collector_proto_rawDesc), len(file_agent_v1_collector_proto_rawDesc)), - NumEnums: 1, - NumMessages: 8, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_agent_v1_collector_proto_goTypes, - DependencyIndexes: file_agent_v1_collector_proto_depIdxs, - EnumInfos: file_agent_v1_collector_proto_enumTypes, - MessageInfos: file_agent_v1_collector_proto_msgTypes, - }.Build() - File_agent_v1_collector_proto = out.File - file_agent_v1_collector_proto_goTypes = nil - file_agent_v1_collector_proto_depIdxs = nil -} diff --git a/api/agent/v1/collector.pb.validate.go b/api/agent/v1/collector.pb.validate.go deleted file mode 100644 index 3b1582a35af..00000000000 --- a/api/agent/v1/collector.pb.validate.go +++ /dev/null @@ -1,1294 +0,0 @@ -// Code generated by protoc-gen-validate. DO NOT EDIT. -// source: agent/v1/collector.proto - -package agentv1 - -import ( - "bytes" - "errors" - "fmt" - "net" - "net/mail" - "net/url" - "regexp" - "sort" - "strings" - "time" - "unicode/utf8" - - "google.golang.org/protobuf/types/known/anypb" - - inventoryv1 "github.com/percona/pmm/api/inventory/v1" -) - -// ensure the imports are used -var ( - _ = bytes.MinRead - _ = errors.New("") - _ = fmt.Print - _ = utf8.UTFMax - _ = (*regexp.Regexp)(nil) - _ = (*strings.Reader)(nil) - _ = net.IPv4len - _ = time.Duration(0) - _ = (*url.URL)(nil) - _ = (*mail.Address)(nil) - _ = anypb.Any{} - _ = sort.Sort - - _ = inventoryv1.AgentType(0) -) - -// Validate checks the field values on MetricsBucket 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 *MetricsBucket) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on MetricsBucket 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 MetricsBucketMultiError, or -// nil if none found. -func (m *MetricsBucket) ValidateAll() error { - return m.validate(true) -} - -func (m *MetricsBucket) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if all { - switch v := interface{}(m.GetCommon()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, MetricsBucketValidationError{ - field: "Common", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, MetricsBucketValidationError{ - field: "Common", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetCommon()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return MetricsBucketValidationError{ - field: "Common", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetMysql()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, MetricsBucketValidationError{ - field: "Mysql", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, MetricsBucketValidationError{ - field: "Mysql", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMysql()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return MetricsBucketValidationError{ - field: "Mysql", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetMongodb()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, MetricsBucketValidationError{ - field: "Mongodb", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, MetricsBucketValidationError{ - field: "Mongodb", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMongodb()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return MetricsBucketValidationError{ - field: "Mongodb", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetPostgresql()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, MetricsBucketValidationError{ - field: "Postgresql", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, MetricsBucketValidationError{ - field: "Postgresql", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetPostgresql()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return MetricsBucketValidationError{ - field: "Postgresql", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if len(errors) > 0 { - return MetricsBucketMultiError(errors) - } - - return nil -} - -// MetricsBucketMultiError is an error wrapping multiple validation errors -// returned by MetricsBucket.ValidateAll() if the designated constraints -// aren't met. -type MetricsBucketMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m MetricsBucketMultiError) 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 MetricsBucketMultiError) AllErrors() []error { return m } - -// MetricsBucketValidationError is the validation error returned by -// MetricsBucket.Validate if the designated constraints aren't met. -type MetricsBucketValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e MetricsBucketValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e MetricsBucketValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e MetricsBucketValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e MetricsBucketValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e MetricsBucketValidationError) ErrorName() string { return "MetricsBucketValidationError" } - -// Error satisfies the builtin error interface -func (e MetricsBucketValidationError) 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 %sMetricsBucket.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = MetricsBucketValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = MetricsBucketValidationError{} - -// Validate checks the field values on HistogramItem 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 *HistogramItem) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on HistogramItem 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 HistogramItemMultiError, or -// nil if none found. -func (m *HistogramItem) ValidateAll() error { - return m.validate(true) -} - -func (m *HistogramItem) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Range - - // no validation rules for Frequency - - if len(errors) > 0 { - return HistogramItemMultiError(errors) - } - - return nil -} - -// HistogramItemMultiError is an error wrapping multiple validation errors -// returned by HistogramItem.ValidateAll() if the designated constraints -// aren't met. -type HistogramItemMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m HistogramItemMultiError) 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 HistogramItemMultiError) AllErrors() []error { return m } - -// HistogramItemValidationError is the validation error returned by -// HistogramItem.Validate if the designated constraints aren't met. -type HistogramItemValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e HistogramItemValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e HistogramItemValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e HistogramItemValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e HistogramItemValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e HistogramItemValidationError) ErrorName() string { return "HistogramItemValidationError" } - -// Error satisfies the builtin error interface -func (e HistogramItemValidationError) 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 %sHistogramItem.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = HistogramItemValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = HistogramItemValidationError{} - -// Validate checks the field values on MetricsBucket_Common 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 *MetricsBucket_Common) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on MetricsBucket_Common 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 -// MetricsBucket_CommonMultiError, or nil if none found. -func (m *MetricsBucket_Common) ValidateAll() error { - return m.validate(true) -} - -func (m *MetricsBucket_Common) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Queryid - - // no validation rules for ExplainFingerprint - - // no validation rules for PlaceholdersCount - - // no validation rules for Comments - - // no validation rules for Fingerprint - - // no validation rules for Database - - // no validation rules for Schema - - // no validation rules for Username - - // no validation rules for ClientHost - - // no validation rules for AgentId - - // no validation rules for AgentType - - // no validation rules for PeriodStartUnixSecs - - // no validation rules for PeriodLengthSecs - - // no validation rules for Example - - // no validation rules for ExampleType - - // no validation rules for IsTruncated - - // no validation rules for NumQueriesWithWarnings - - // no validation rules for NumQueriesWithErrors - - // no validation rules for Errors - - // no validation rules for NumQueries - - // no validation rules for MQueryTimeCnt - - // no validation rules for MQueryTimeSum - - // no validation rules for MQueryTimeMin - - // no validation rules for MQueryTimeMax - - // no validation rules for MQueryTimeP99 - - if len(errors) > 0 { - return MetricsBucket_CommonMultiError(errors) - } - - return nil -} - -// MetricsBucket_CommonMultiError is an error wrapping multiple validation -// errors returned by MetricsBucket_Common.ValidateAll() if the designated -// constraints aren't met. -type MetricsBucket_CommonMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m MetricsBucket_CommonMultiError) 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 MetricsBucket_CommonMultiError) AllErrors() []error { return m } - -// MetricsBucket_CommonValidationError is the validation error returned by -// MetricsBucket_Common.Validate if the designated constraints aren't met. -type MetricsBucket_CommonValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e MetricsBucket_CommonValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e MetricsBucket_CommonValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e MetricsBucket_CommonValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e MetricsBucket_CommonValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e MetricsBucket_CommonValidationError) ErrorName() string { - return "MetricsBucket_CommonValidationError" -} - -// Error satisfies the builtin error interface -func (e MetricsBucket_CommonValidationError) 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 %sMetricsBucket_Common.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = MetricsBucket_CommonValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = MetricsBucket_CommonValidationError{} - -// Validate checks the field values on MetricsBucket_MySQL 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 *MetricsBucket_MySQL) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on MetricsBucket_MySQL 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 -// MetricsBucket_MySQLMultiError, or nil if none found. -func (m *MetricsBucket_MySQL) ValidateAll() error { - return m.validate(true) -} - -func (m *MetricsBucket_MySQL) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for MLockTimeCnt - - // no validation rules for MLockTimeSum - - // no validation rules for MLockTimeMin - - // no validation rules for MLockTimeMax - - // no validation rules for MLockTimeP99 - - // no validation rules for MRowsSentCnt - - // no validation rules for MRowsSentSum - - // no validation rules for MRowsSentMin - - // no validation rules for MRowsSentMax - - // no validation rules for MRowsSentP99 - - // no validation rules for MRowsExaminedCnt - - // no validation rules for MRowsExaminedSum - - // no validation rules for MRowsExaminedMin - - // no validation rules for MRowsExaminedMax - - // no validation rules for MRowsExaminedP99 - - // no validation rules for MRowsAffectedCnt - - // no validation rules for MRowsAffectedSum - - // no validation rules for MRowsAffectedMin - - // no validation rules for MRowsAffectedMax - - // no validation rules for MRowsAffectedP99 - - // no validation rules for MRowsReadCnt - - // no validation rules for MRowsReadSum - - // no validation rules for MRowsReadMin - - // no validation rules for MRowsReadMax - - // no validation rules for MRowsReadP99 - - // no validation rules for MMergePassesCnt - - // no validation rules for MMergePassesSum - - // no validation rules for MMergePassesMin - - // no validation rules for MMergePassesMax - - // no validation rules for MMergePassesP99 - - // no validation rules for MInnodbIoROpsCnt - - // no validation rules for MInnodbIoROpsSum - - // no validation rules for MInnodbIoROpsMin - - // no validation rules for MInnodbIoROpsMax - - // no validation rules for MInnodbIoROpsP99 - - // no validation rules for MInnodbIoRBytesCnt - - // no validation rules for MInnodbIoRBytesSum - - // no validation rules for MInnodbIoRBytesMin - - // no validation rules for MInnodbIoRBytesMax - - // no validation rules for MInnodbIoRBytesP99 - - // no validation rules for MInnodbIoRWaitCnt - - // no validation rules for MInnodbIoRWaitSum - - // no validation rules for MInnodbIoRWaitMin - - // no validation rules for MInnodbIoRWaitMax - - // no validation rules for MInnodbIoRWaitP99 - - // no validation rules for MInnodbRecLockWaitCnt - - // no validation rules for MInnodbRecLockWaitSum - - // no validation rules for MInnodbRecLockWaitMin - - // no validation rules for MInnodbRecLockWaitMax - - // no validation rules for MInnodbRecLockWaitP99 - - // no validation rules for MInnodbQueueWaitCnt - - // no validation rules for MInnodbQueueWaitSum - - // no validation rules for MInnodbQueueWaitMin - - // no validation rules for MInnodbQueueWaitMax - - // no validation rules for MInnodbQueueWaitP99 - - // no validation rules for MInnodbPagesDistinctCnt - - // no validation rules for MInnodbPagesDistinctSum - - // no validation rules for MInnodbPagesDistinctMin - - // no validation rules for MInnodbPagesDistinctMax - - // no validation rules for MInnodbPagesDistinctP99 - - // no validation rules for MQueryLengthCnt - - // no validation rules for MQueryLengthSum - - // no validation rules for MQueryLengthMin - - // no validation rules for MQueryLengthMax - - // no validation rules for MQueryLengthP99 - - // no validation rules for MBytesSentCnt - - // no validation rules for MBytesSentSum - - // no validation rules for MBytesSentMin - - // no validation rules for MBytesSentMax - - // no validation rules for MBytesSentP99 - - // no validation rules for MTmpTablesCnt - - // no validation rules for MTmpTablesSum - - // no validation rules for MTmpTablesMin - - // no validation rules for MTmpTablesMax - - // no validation rules for MTmpTablesP99 - - // no validation rules for MTmpDiskTablesCnt - - // no validation rules for MTmpDiskTablesSum - - // no validation rules for MTmpDiskTablesMin - - // no validation rules for MTmpDiskTablesMax - - // no validation rules for MTmpDiskTablesP99 - - // no validation rules for MTmpTableSizesCnt - - // no validation rules for MTmpTableSizesSum - - // no validation rules for MTmpTableSizesMin - - // no validation rules for MTmpTableSizesMax - - // no validation rules for MTmpTableSizesP99 - - // no validation rules for MQcHitCnt - - // no validation rules for MQcHitSum - - // no validation rules for MFullScanCnt - - // no validation rules for MFullScanSum - - // no validation rules for MFullJoinCnt - - // no validation rules for MFullJoinSum - - // no validation rules for MTmpTableCnt - - // no validation rules for MTmpTableSum - - // no validation rules for MTmpTableOnDiskCnt - - // no validation rules for MTmpTableOnDiskSum - - // no validation rules for MFilesortCnt - - // no validation rules for MFilesortSum - - // no validation rules for MFilesortOnDiskCnt - - // no validation rules for MFilesortOnDiskSum - - // no validation rules for MSelectFullRangeJoinCnt - - // no validation rules for MSelectFullRangeJoinSum - - // no validation rules for MSelectRangeCnt - - // no validation rules for MSelectRangeSum - - // no validation rules for MSelectRangeCheckCnt - - // no validation rules for MSelectRangeCheckSum - - // no validation rules for MSortRangeCnt - - // no validation rules for MSortRangeSum - - // no validation rules for MSortRowsCnt - - // no validation rules for MSortRowsSum - - // no validation rules for MSortScanCnt - - // no validation rules for MSortScanSum - - // no validation rules for MNoIndexUsedCnt - - // no validation rules for MNoIndexUsedSum - - // no validation rules for MNoGoodIndexUsedCnt - - // no validation rules for MNoGoodIndexUsedSum - - if len(errors) > 0 { - return MetricsBucket_MySQLMultiError(errors) - } - - return nil -} - -// MetricsBucket_MySQLMultiError is an error wrapping multiple validation -// errors returned by MetricsBucket_MySQL.ValidateAll() if the designated -// constraints aren't met. -type MetricsBucket_MySQLMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m MetricsBucket_MySQLMultiError) 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 MetricsBucket_MySQLMultiError) AllErrors() []error { return m } - -// MetricsBucket_MySQLValidationError is the validation error returned by -// MetricsBucket_MySQL.Validate if the designated constraints aren't met. -type MetricsBucket_MySQLValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e MetricsBucket_MySQLValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e MetricsBucket_MySQLValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e MetricsBucket_MySQLValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e MetricsBucket_MySQLValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e MetricsBucket_MySQLValidationError) ErrorName() string { - return "MetricsBucket_MySQLValidationError" -} - -// Error satisfies the builtin error interface -func (e MetricsBucket_MySQLValidationError) 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 %sMetricsBucket_MySQL.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = MetricsBucket_MySQLValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = MetricsBucket_MySQLValidationError{} - -// Validate checks the field values on MetricsBucket_MongoDB 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 *MetricsBucket_MongoDB) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on MetricsBucket_MongoDB 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 -// MetricsBucket_MongoDBMultiError, or nil if none found. -func (m *MetricsBucket_MongoDB) ValidateAll() error { - return m.validate(true) -} - -func (m *MetricsBucket_MongoDB) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for MDocsReturnedCnt - - // no validation rules for MDocsReturnedSum - - // no validation rules for MDocsReturnedMin - - // no validation rules for MDocsReturnedMax - - // no validation rules for MDocsReturnedP99 - - // no validation rules for MResponseLengthCnt - - // no validation rules for MResponseLengthSum - - // no validation rules for MResponseLengthMin - - // no validation rules for MResponseLengthMax - - // no validation rules for MResponseLengthP99 - - // no validation rules for MDocsScannedCnt - - // no validation rules for MDocsScannedSum - - // no validation rules for MDocsScannedMin - - // no validation rules for MDocsScannedMax - - // no validation rules for MDocsScannedP99 - - // no validation rules for MFullScanCnt - - // no validation rules for MFullScanSum - - // no validation rules for PlanSummary - - // no validation rules for MDocsExaminedCnt - - // no validation rules for MDocsExaminedSum - - // no validation rules for MDocsExaminedMin - - // no validation rules for MDocsExaminedMax - - // no validation rules for MDocsExaminedP99 - - // no validation rules for MKeysExaminedCnt - - // no validation rules for MKeysExaminedSum - - // no validation rules for MKeysExaminedMin - - // no validation rules for MKeysExaminedMax - - // no validation rules for MKeysExaminedP99 - - // no validation rules for ApplicationName - - // no validation rules for MLocksGlobalAcquireCountReadSharedCnt - - // no validation rules for MLocksGlobalAcquireCountReadSharedSum - - // no validation rules for MLocksGlobalAcquireCountWriteSharedCnt - - // no validation rules for MLocksGlobalAcquireCountWriteSharedSum - - // no validation rules for MLocksDatabaseAcquireCountReadSharedCnt - - // no validation rules for MLocksDatabaseAcquireCountReadSharedSum - - // no validation rules for MLocksDatabaseAcquireWaitCountReadSharedCnt - - // no validation rules for MLocksDatabaseAcquireWaitCountReadSharedSum - - // no validation rules for MLocksDatabaseTimeAcquiringMicrosReadSharedCnt - - // no validation rules for MLocksDatabaseTimeAcquiringMicrosReadSharedSum - - // no validation rules for MLocksDatabaseTimeAcquiringMicrosReadSharedMin - - // no validation rules for MLocksDatabaseTimeAcquiringMicrosReadSharedMax - - // no validation rules for MLocksDatabaseTimeAcquiringMicrosReadSharedP99 - - // no validation rules for MLocksCollectionAcquireCountReadSharedCnt - - // no validation rules for MLocksCollectionAcquireCountReadSharedSum - - // no validation rules for MStorageBytesReadCnt - - // no validation rules for MStorageBytesReadSum - - // no validation rules for MStorageBytesReadMin - - // no validation rules for MStorageBytesReadMax - - // no validation rules for MStorageBytesReadP99 - - // no validation rules for MStorageTimeReadingMicrosCnt - - // no validation rules for MStorageTimeReadingMicrosSum - - // no validation rules for MStorageTimeReadingMicrosMin - - // no validation rules for MStorageTimeReadingMicrosMax - - // no validation rules for MStorageTimeReadingMicrosP99 - - if len(errors) > 0 { - return MetricsBucket_MongoDBMultiError(errors) - } - - return nil -} - -// MetricsBucket_MongoDBMultiError is an error wrapping multiple validation -// errors returned by MetricsBucket_MongoDB.ValidateAll() if the designated -// constraints aren't met. -type MetricsBucket_MongoDBMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m MetricsBucket_MongoDBMultiError) 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 MetricsBucket_MongoDBMultiError) AllErrors() []error { return m } - -// MetricsBucket_MongoDBValidationError is the validation error returned by -// MetricsBucket_MongoDB.Validate if the designated constraints aren't met. -type MetricsBucket_MongoDBValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e MetricsBucket_MongoDBValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e MetricsBucket_MongoDBValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e MetricsBucket_MongoDBValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e MetricsBucket_MongoDBValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e MetricsBucket_MongoDBValidationError) ErrorName() string { - return "MetricsBucket_MongoDBValidationError" -} - -// Error satisfies the builtin error interface -func (e MetricsBucket_MongoDBValidationError) 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 %sMetricsBucket_MongoDB.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = MetricsBucket_MongoDBValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = MetricsBucket_MongoDBValidationError{} - -// Validate checks the field values on MetricsBucket_PostgreSQL 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 *MetricsBucket_PostgreSQL) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on MetricsBucket_PostgreSQL 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 -// MetricsBucket_PostgreSQLMultiError, or nil if none found. -func (m *MetricsBucket_PostgreSQL) ValidateAll() error { - return m.validate(true) -} - -func (m *MetricsBucket_PostgreSQL) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for MRowsCnt - - // no validation rules for MRowsSum - - // no validation rules for MSharedBlksHitCnt - - // no validation rules for MSharedBlksHitSum - - // no validation rules for MSharedBlksReadCnt - - // no validation rules for MSharedBlksReadSum - - // no validation rules for MSharedBlksDirtiedCnt - - // no validation rules for MSharedBlksDirtiedSum - - // no validation rules for MSharedBlksWrittenCnt - - // no validation rules for MSharedBlksWrittenSum - - // no validation rules for MLocalBlksHitCnt - - // no validation rules for MLocalBlksHitSum - - // no validation rules for MLocalBlksReadCnt - - // no validation rules for MLocalBlksReadSum - - // no validation rules for MLocalBlksDirtiedCnt - - // no validation rules for MLocalBlksDirtiedSum - - // no validation rules for MLocalBlksWrittenCnt - - // no validation rules for MLocalBlksWrittenSum - - // no validation rules for MTempBlksReadCnt - - // no validation rules for MTempBlksReadSum - - // no validation rules for MTempBlksWrittenCnt - - // no validation rules for MTempBlksWrittenSum - - // no validation rules for MSharedBlkReadTimeCnt - - // no validation rules for MSharedBlkReadTimeSum - - // no validation rules for MSharedBlkWriteTimeCnt - - // no validation rules for MSharedBlkWriteTimeSum - - // no validation rules for MLocalBlkReadTimeCnt - - // no validation rules for MLocalBlkReadTimeSum - - // no validation rules for MLocalBlkWriteTimeCnt - - // no validation rules for MLocalBlkWriteTimeSum - - // no validation rules for MCpuUserTimeCnt - - // no validation rules for MCpuUserTimeSum - - // no validation rules for MCpuSysTimeCnt - - // no validation rules for MCpuSysTimeSum - - // no validation rules for CmdType - - // no validation rules for MPlansCallsSum - - // no validation rules for MPlansCallsCnt - - // no validation rules for MWalRecordsSum - - // no validation rules for MWalRecordsCnt - - // no validation rules for MWalFpiSum - - // no validation rules for MWalFpiCnt - - // no validation rules for MWalBytesSum - - // no validation rules for MWalBytesCnt - - // no validation rules for MPlanTimeSum - - // no validation rules for MPlanTimeCnt - - // no validation rules for MPlanTimeMin - - // no validation rules for MPlanTimeMax - - // no validation rules for TopQueryid - - // no validation rules for TopQuery - - // no validation rules for ApplicationName - - // no validation rules for Planid - - // no validation rules for QueryPlan - - for idx, item := range m.GetHistogramItems() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, MetricsBucket_PostgreSQLValidationError{ - field: fmt.Sprintf("HistogramItems[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, MetricsBucket_PostgreSQLValidationError{ - field: fmt.Sprintf("HistogramItems[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return MetricsBucket_PostgreSQLValidationError{ - field: fmt.Sprintf("HistogramItems[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - if len(errors) > 0 { - return MetricsBucket_PostgreSQLMultiError(errors) - } - - return nil -} - -// MetricsBucket_PostgreSQLMultiError is an error wrapping multiple validation -// errors returned by MetricsBucket_PostgreSQL.ValidateAll() if the designated -// constraints aren't met. -type MetricsBucket_PostgreSQLMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m MetricsBucket_PostgreSQLMultiError) 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 MetricsBucket_PostgreSQLMultiError) AllErrors() []error { return m } - -// MetricsBucket_PostgreSQLValidationError is the validation error returned by -// MetricsBucket_PostgreSQL.Validate if the designated constraints aren't met. -type MetricsBucket_PostgreSQLValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e MetricsBucket_PostgreSQLValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e MetricsBucket_PostgreSQLValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e MetricsBucket_PostgreSQLValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e MetricsBucket_PostgreSQLValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e MetricsBucket_PostgreSQLValidationError) ErrorName() string { - return "MetricsBucket_PostgreSQLValidationError" -} - -// Error satisfies the builtin error interface -func (e MetricsBucket_PostgreSQLValidationError) 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 %sMetricsBucket_PostgreSQL.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = MetricsBucket_PostgreSQLValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = MetricsBucket_PostgreSQLValidationError{} diff --git a/api/agentlocal/v1/agentlocal.pb.go b/api/agentlocal/v1/agentlocal.pb.go deleted file mode 100644 index a6562ab86f8..00000000000 --- a/api/agentlocal/v1/agentlocal.pb.go +++ /dev/null @@ -1,529 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.10 -// protoc (unknown) -// source: agentlocal/v1/agentlocal.proto - -package agentlocalv1 - -import ( - 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" - - v1 "github.com/percona/pmm/api/inventory/v1" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// ServerInfo contains information about the PMM Server. -type ServerInfo struct { - state protoimpl.MessageState `protogen:"open.v1"` - // PMM Server URL in a form https://HOST:PORT/. - Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"` - // PMM Server's TLS certificate validation should be skipped if true. - InsecureTls bool `protobuf:"varint,2,opt,name=insecure_tls,json=insecureTls,proto3" json:"insecure_tls,omitempty"` - // True if pmm-agent is currently connected to the server. - Connected bool `protobuf:"varint,3,opt,name=connected,proto3" json:"connected,omitempty"` - // PMM Server version (if agent is connected). - Version string `protobuf:"bytes,4,opt,name=version,proto3" json:"version,omitempty"` - // Ping time from pmm-agent to pmm-managed (if agent is connected). - Latency *durationpb.Duration `protobuf:"bytes,5,opt,name=latency,proto3" json:"latency,omitempty"` - // Clock drift from PMM Server (if agent is connected). - ClockDrift *durationpb.Duration `protobuf:"bytes,6,opt,name=clock_drift,json=clockDrift,proto3" json:"clock_drift,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ServerInfo) Reset() { - *x = ServerInfo{} - mi := &file_agentlocal_v1_agentlocal_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ServerInfo) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ServerInfo) ProtoMessage() {} - -func (x *ServerInfo) ProtoReflect() protoreflect.Message { - mi := &file_agentlocal_v1_agentlocal_proto_msgTypes[0] - 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 ServerInfo.ProtoReflect.Descriptor instead. -func (*ServerInfo) Descriptor() ([]byte, []int) { - return file_agentlocal_v1_agentlocal_proto_rawDescGZIP(), []int{0} -} - -func (x *ServerInfo) GetUrl() string { - if x != nil { - return x.Url - } - return "" -} - -func (x *ServerInfo) GetInsecureTls() bool { - if x != nil { - return x.InsecureTls - } - return false -} - -func (x *ServerInfo) GetConnected() bool { - if x != nil { - return x.Connected - } - return false -} - -func (x *ServerInfo) GetVersion() string { - if x != nil { - return x.Version - } - return "" -} - -func (x *ServerInfo) GetLatency() *durationpb.Duration { - if x != nil { - return x.Latency - } - return nil -} - -func (x *ServerInfo) GetClockDrift() *durationpb.Duration { - if x != nil { - return x.ClockDrift - } - return nil -} - -// AgentInfo contains information about Agent managed by pmm-agent. -type AgentInfo struct { - state protoimpl.MessageState `protogen:"open.v1"` - AgentId string `protobuf:"bytes,1,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"` - AgentType v1.AgentType `protobuf:"varint,2,opt,name=agent_type,json=agentType,proto3,enum=inventory.v1.AgentType" json:"agent_type,omitempty"` - Status v1.AgentStatus `protobuf:"varint,3,opt,name=status,proto3,enum=inventory.v1.AgentStatus" json:"status,omitempty"` - // The current listen port of this Agent (exporter or vmagent). - // Zero for other Agent types, or if unknown or not yet supported. - ListenPort uint32 `protobuf:"varint,4,opt,name=listen_port,json=listenPort,proto3" json:"listen_port,omitempty"` - ProcessExecPath string `protobuf:"bytes,5,opt,name=process_exec_path,json=processExecPath,proto3" json:"process_exec_path,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AgentInfo) Reset() { - *x = AgentInfo{} - mi := &file_agentlocal_v1_agentlocal_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AgentInfo) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AgentInfo) ProtoMessage() {} - -func (x *AgentInfo) ProtoReflect() protoreflect.Message { - mi := &file_agentlocal_v1_agentlocal_proto_msgTypes[1] - 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 AgentInfo.ProtoReflect.Descriptor instead. -func (*AgentInfo) Descriptor() ([]byte, []int) { - return file_agentlocal_v1_agentlocal_proto_rawDescGZIP(), []int{1} -} - -func (x *AgentInfo) GetAgentId() string { - if x != nil { - return x.AgentId - } - return "" -} - -func (x *AgentInfo) GetAgentType() v1.AgentType { - if x != nil { - return x.AgentType - } - return v1.AgentType(0) -} - -func (x *AgentInfo) GetStatus() v1.AgentStatus { - if x != nil { - return x.Status - } - return v1.AgentStatus(0) -} - -func (x *AgentInfo) GetListenPort() uint32 { - if x != nil { - return x.ListenPort - } - return 0 -} - -func (x *AgentInfo) GetProcessExecPath() string { - if x != nil { - return x.ProcessExecPath - } - return "" -} - -type StatusRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Returns network info (latency and clock_drift) if true. - GetNetworkInfo bool `protobuf:"varint,1,opt,name=get_network_info,json=getNetworkInfo,proto3" json:"get_network_info,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StatusRequest) Reset() { - *x = StatusRequest{} - mi := &file_agentlocal_v1_agentlocal_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StatusRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StatusRequest) ProtoMessage() {} - -func (x *StatusRequest) ProtoReflect() protoreflect.Message { - mi := &file_agentlocal_v1_agentlocal_proto_msgTypes[2] - 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 StatusRequest.ProtoReflect.Descriptor instead. -func (*StatusRequest) Descriptor() ([]byte, []int) { - return file_agentlocal_v1_agentlocal_proto_rawDescGZIP(), []int{2} -} - -func (x *StatusRequest) GetGetNetworkInfo() bool { - if x != nil { - return x.GetNetworkInfo - } - return false -} - -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 - 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"` - // Config file path if pmm-agent was started with one. - ConfigFilepath string `protobuf:"bytes,6,opt,name=config_filepath,json=configFilepath,proto3" json:"config_filepath,omitempty"` - // PMM Agent version. - AgentVersion string `protobuf:"bytes,7,opt,name=agent_version,json=agentVersion,proto3" json:"agent_version,omitempty"` - // Shows connection uptime in percentage between agent and server - ConnectionUptime float32 `protobuf:"fixed32,8,opt,name=connection_uptime,json=connectionUptime,proto3" json:"connection_uptime,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StatusResponse) Reset() { - *x = StatusResponse{} - mi := &file_agentlocal_v1_agentlocal_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StatusResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StatusResponse) ProtoMessage() {} - -func (x *StatusResponse) ProtoReflect() protoreflect.Message { - mi := &file_agentlocal_v1_agentlocal_proto_msgTypes[3] - 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 StatusResponse.ProtoReflect.Descriptor instead. -func (*StatusResponse) Descriptor() ([]byte, []int) { - return file_agentlocal_v1_agentlocal_proto_rawDescGZIP(), []int{3} -} - -func (x *StatusResponse) GetAgentId() string { - if x != nil { - return x.AgentId - } - return "" -} - -func (x *StatusResponse) GetRunsOnNodeId() string { - if x != nil { - return x.RunsOnNodeId - } - return "" -} - -func (x *StatusResponse) GetNodeName() string { - if x != nil { - return x.NodeName - } - return "" -} - -func (x *StatusResponse) GetServerInfo() *ServerInfo { - if x != nil { - return x.ServerInfo - } - return nil -} - -func (x *StatusResponse) GetAgentsInfo() []*AgentInfo { - if x != nil { - return x.AgentsInfo - } - return nil -} - -func (x *StatusResponse) GetConfigFilepath() string { - if x != nil { - return x.ConfigFilepath - } - return "" -} - -func (x *StatusResponse) GetAgentVersion() string { - if x != nil { - return x.AgentVersion - } - return "" -} - -func (x *StatusResponse) GetConnectionUptime() float32 { - if x != nil { - return x.ConnectionUptime - } - return 0 -} - -type ReloadRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ReloadRequest) Reset() { - *x = ReloadRequest{} - mi := &file_agentlocal_v1_agentlocal_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ReloadRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ReloadRequest) ProtoMessage() {} - -func (x *ReloadRequest) ProtoReflect() protoreflect.Message { - mi := &file_agentlocal_v1_agentlocal_proto_msgTypes[4] - 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 ReloadRequest.ProtoReflect.Descriptor instead. -func (*ReloadRequest) Descriptor() ([]byte, []int) { - return file_agentlocal_v1_agentlocal_proto_rawDescGZIP(), []int{4} -} - -// ReloadRequest may not be received by the client due to pmm-agent restart. -type ReloadResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ReloadResponse) Reset() { - *x = ReloadResponse{} - mi := &file_agentlocal_v1_agentlocal_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ReloadResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ReloadResponse) ProtoMessage() {} - -func (x *ReloadResponse) ProtoReflect() protoreflect.Message { - mi := &file_agentlocal_v1_agentlocal_proto_msgTypes[5] - 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 ReloadResponse.ProtoReflect.Descriptor instead. -func (*ReloadResponse) Descriptor() ([]byte, []int) { - return file_agentlocal_v1_agentlocal_proto_rawDescGZIP(), []int{5} -} - -var File_agentlocal_v1_agentlocal_proto protoreflect.FileDescriptor - -const file_agentlocal_v1_agentlocal_proto_rawDesc = "" + - "\n" + - "\x1eagentlocal/v1/agentlocal.proto\x12\ragentlocal.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1finventory/v1/agent_status.proto\x1a\x19inventory/v1/agents.proto\"\xea\x01\n" + - "\n" + - "ServerInfo\x12\x10\n" + - "\x03url\x18\x01 \x01(\tR\x03url\x12!\n" + - "\finsecure_tls\x18\x02 \x01(\bR\vinsecureTls\x12\x1c\n" + - "\tconnected\x18\x03 \x01(\bR\tconnected\x12\x18\n" + - "\aversion\x18\x04 \x01(\tR\aversion\x123\n" + - "\alatency\x18\x05 \x01(\v2\x19.google.protobuf.DurationR\alatency\x12:\n" + - "\vclock_drift\x18\x06 \x01(\v2\x19.google.protobuf.DurationR\n" + - "clockDrift\"\xde\x01\n" + - "\tAgentInfo\x12\x19\n" + - "\bagent_id\x18\x01 \x01(\tR\aagentId\x126\n" + - "\n" + - "agent_type\x18\x02 \x01(\x0e2\x17.inventory.v1.AgentTypeR\tagentType\x121\n" + - "\x06status\x18\x03 \x01(\x0e2\x19.inventory.v1.AgentStatusR\x06status\x12\x1f\n" + - "\vlisten_port\x18\x04 \x01(\rR\n" + - "listenPort\x12*\n" + - "\x11process_exec_path\x18\x05 \x01(\tR\x0fprocessExecPath\"9\n" + - "\rStatusRequest\x12(\n" + - "\x10get_network_info\x18\x01 \x01(\bR\x0egetNetworkInfo\"\xe1\x02\n" + - "\x0eStatusResponse\x12\x19\n" + - "\bagent_id\x18\x01 \x01(\tR\aagentId\x12%\n" + - "\x0fruns_on_node_id\x18\x02 \x01(\tR\frunsOnNodeId\x12\x1b\n" + - "\tnode_name\x18\x03 \x01(\tR\bnodeName\x12:\n" + - "\vserver_info\x18\x04 \x01(\v2\x19.agentlocal.v1.ServerInfoR\n" + - "serverInfo\x129\n" + - "\vagents_info\x18\x05 \x03(\v2\x18.agentlocal.v1.AgentInfoR\n" + - "agentsInfo\x12'\n" + - "\x0fconfig_filepath\x18\x06 \x01(\tR\x0econfigFilepath\x12#\n" + - "\ragent_version\x18\a \x01(\tR\fagentVersion\x12+\n" + - "\x11connection_uptime\x18\b \x01(\x02R\x10connectionUptime\"\x0f\n" + - "\rReloadRequest\"\x10\n" + - "\x0eReloadResponse2\xe6\x01\n" + - "\x11AgentLocalService\x12p\n" + - "\x06Status\x12\x1c.agentlocal.v1.StatusRequest\x1a\x1d.agentlocal.v1.StatusResponse\")\x82\xd3\xe4\x93\x02#:\x01*Z\x0f\x12\r/local/Status\"\r/local/Status\x12_\n" + - "\x06Reload\x12\x1c.agentlocal.v1.ReloadRequest\x1a\x1d.agentlocal.v1.ReloadResponse\"\x18\x82\xd3\xe4\x93\x02\x12:\x01*\"\r/local/ReloadB\xb0\x01\n" + - "\x11com.agentlocal.v1B\x0fAgentlocalProtoP\x01Z5github.com/percona/pmm/api/agentlocal/v1;agentlocalv1\xa2\x02\x03AXX\xaa\x02\rAgentlocal.V1\xca\x02\rAgentlocal\\V1\xe2\x02\x19Agentlocal\\V1\\GPBMetadata\xea\x02\x0eAgentlocal::V1b\x06proto3" - -var ( - file_agentlocal_v1_agentlocal_proto_rawDescOnce sync.Once - file_agentlocal_v1_agentlocal_proto_rawDescData []byte -) - -func file_agentlocal_v1_agentlocal_proto_rawDescGZIP() []byte { - file_agentlocal_v1_agentlocal_proto_rawDescOnce.Do(func() { - file_agentlocal_v1_agentlocal_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_agentlocal_v1_agentlocal_proto_rawDesc), len(file_agentlocal_v1_agentlocal_proto_rawDesc))) - }) - 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_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 - 7, // 2: agentlocal.v1.AgentInfo.agent_type:type_name -> inventory.v1.AgentType - 8, // 3: agentlocal.v1.AgentInfo.status:type_name -> inventory.v1.AgentStatus - 0, // 4: agentlocal.v1.StatusResponse.server_info:type_name -> agentlocal.v1.ServerInfo - 1, // 5: agentlocal.v1.StatusResponse.agents_info:type_name -> agentlocal.v1.AgentInfo - 2, // 6: agentlocal.v1.AgentLocalService.Status:input_type -> agentlocal.v1.StatusRequest - 4, // 7: agentlocal.v1.AgentLocalService.Reload:input_type -> agentlocal.v1.ReloadRequest - 3, // 8: agentlocal.v1.AgentLocalService.Status:output_type -> agentlocal.v1.StatusResponse - 5, // 9: agentlocal.v1.AgentLocalService.Reload:output_type -> agentlocal.v1.ReloadResponse - 8, // [8:10] is the sub-list for method output_type - 6, // [6:8] is the sub-list for method input_type - 6, // [6:6] is the sub-list for extension type_name - 6, // [6:6] is the sub-list for extension extendee - 0, // [0:6] is the sub-list for field type_name -} - -func init() { file_agentlocal_v1_agentlocal_proto_init() } -func file_agentlocal_v1_agentlocal_proto_init() { - if File_agentlocal_v1_agentlocal_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_agentlocal_v1_agentlocal_proto_rawDesc), len(file_agentlocal_v1_agentlocal_proto_rawDesc)), - NumEnums: 0, - NumMessages: 6, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_agentlocal_v1_agentlocal_proto_goTypes, - DependencyIndexes: file_agentlocal_v1_agentlocal_proto_depIdxs, - MessageInfos: file_agentlocal_v1_agentlocal_proto_msgTypes, - }.Build() - File_agentlocal_v1_agentlocal_proto = out.File - file_agentlocal_v1_agentlocal_proto_goTypes = nil - file_agentlocal_v1_agentlocal_proto_depIdxs = nil -} diff --git a/api/agentlocal/v1/agentlocal.pb.gw.go b/api/agentlocal/v1/agentlocal.pb.gw.go deleted file mode 100644 index 81fd9746102..00000000000 --- a/api/agentlocal/v1/agentlocal.pb.gw.go +++ /dev/null @@ -1,297 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: agentlocal/v1/agentlocal.proto - -/* -Package agentlocalv1 is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package agentlocalv1 - -import ( - "context" - "errors" - "io" - "net/http" - - "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" - "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" - "google.golang.org/protobuf/proto" -) - -// Suppress "imported and not used" errors -var ( - _ codes.Code - _ io.Reader - _ status.Status - _ = errors.New - _ = runtime.String - _ = utilities.NewDoubleArray - _ = metadata.Join -) - -func request_AgentLocalService_Status_0(ctx context.Context, marshaler runtime.Marshaler, client AgentLocalServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq StatusRequest - 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.Status(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_AgentLocalService_Status_0(ctx context.Context, marshaler runtime.Marshaler, server AgentLocalServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq StatusRequest - 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.Status(ctx, &protoReq) - return msg, metadata, err -} - -var filter_AgentLocalService_Status_1 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} - -func request_AgentLocalService_Status_1(ctx context.Context, marshaler runtime.Marshaler, client AgentLocalServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq StatusRequest - metadata runtime.ServerMetadata - ) - if req.Body != nil { - _, _ = io.Copy(io.Discard, req.Body) - } - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_AgentLocalService_Status_1); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - msg, err := client.Status(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_AgentLocalService_Status_1(ctx context.Context, marshaler runtime.Marshaler, server AgentLocalServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq StatusRequest - metadata runtime.ServerMetadata - ) - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_AgentLocalService_Status_1); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - msg, err := server.Status(ctx, &protoReq) - return msg, metadata, err -} - -func request_AgentLocalService_Reload_0(ctx context.Context, marshaler runtime.Marshaler, client AgentLocalServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq ReloadRequest - 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.Reload(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_AgentLocalService_Reload_0(ctx context.Context, marshaler runtime.Marshaler, server AgentLocalServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq ReloadRequest - 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.Reload(ctx, &protoReq) - return msg, metadata, err -} - -// RegisterAgentLocalServiceHandlerServer registers the http handlers for service AgentLocalService to "mux". -// UnaryRPC :call AgentLocalServiceServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterAgentLocalServiceHandlerFromEndpoint instead. -// GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call. -func RegisterAgentLocalServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AgentLocalServiceServer) error { - mux.Handle(http.MethodPost, pattern_AgentLocalService_Status_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, "/agentlocal.v1.AgentLocalService/Status", runtime.WithHTTPPathPattern("/local/Status")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AgentLocalService_Status_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_AgentLocalService_Status_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodGet, pattern_AgentLocalService_Status_1, 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, "/agentlocal.v1.AgentLocalService/Status", runtime.WithHTTPPathPattern("/local/Status")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AgentLocalService_Status_1(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_AgentLocalService_Status_1(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPost, pattern_AgentLocalService_Reload_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, "/agentlocal.v1.AgentLocalService/Reload", runtime.WithHTTPPathPattern("/local/Reload")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AgentLocalService_Reload_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_AgentLocalService_Reload_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - return nil -} - -// RegisterAgentLocalServiceHandlerFromEndpoint is same as RegisterAgentLocalServiceHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterAgentLocalServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.NewClient(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - return RegisterAgentLocalServiceHandler(ctx, mux, conn) -} - -// RegisterAgentLocalServiceHandler registers the http handlers for service AgentLocalService to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterAgentLocalServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterAgentLocalServiceHandlerClient(ctx, mux, NewAgentLocalServiceClient(conn)) -} - -// RegisterAgentLocalServiceHandlerClient registers the http handlers for service AgentLocalService -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "AgentLocalServiceClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "AgentLocalServiceClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "AgentLocalServiceClient" to call the correct interceptors. This client ignores the HTTP middlewares. -func RegisterAgentLocalServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AgentLocalServiceClient) error { - mux.Handle(http.MethodPost, pattern_AgentLocalService_Status_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, "/agentlocal.v1.AgentLocalService/Status", runtime.WithHTTPPathPattern("/local/Status")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AgentLocalService_Status_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_AgentLocalService_Status_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodGet, pattern_AgentLocalService_Status_1, 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, "/agentlocal.v1.AgentLocalService/Status", runtime.WithHTTPPathPattern("/local/Status")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AgentLocalService_Status_1(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_AgentLocalService_Status_1(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPost, pattern_AgentLocalService_Reload_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, "/agentlocal.v1.AgentLocalService/Reload", runtime.WithHTTPPathPattern("/local/Reload")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AgentLocalService_Reload_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_AgentLocalService_Reload_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - return nil -} - -var ( - pattern_AgentLocalService_Status_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"local", "Status"}, "")) - pattern_AgentLocalService_Status_1 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"local", "Status"}, "")) - pattern_AgentLocalService_Reload_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"local", "Reload"}, "")) -) - -var ( - forward_AgentLocalService_Status_0 = runtime.ForwardResponseMessage - forward_AgentLocalService_Status_1 = runtime.ForwardResponseMessage - forward_AgentLocalService_Reload_0 = runtime.ForwardResponseMessage -) diff --git a/api/agentlocal/v1/agentlocal.pb.validate.go b/api/agentlocal/v1/agentlocal.pb.validate.go deleted file mode 100644 index 118cb9f916a..00000000000 --- a/api/agentlocal/v1/agentlocal.pb.validate.go +++ /dev/null @@ -1,791 +0,0 @@ -// Code generated by protoc-gen-validate. DO NOT EDIT. -// source: agentlocal/v1/agentlocal.proto - -package agentlocalv1 - -import ( - "bytes" - "errors" - "fmt" - "net" - "net/mail" - "net/url" - "regexp" - "sort" - "strings" - "time" - "unicode/utf8" - - "google.golang.org/protobuf/types/known/anypb" - - inventoryv1 "github.com/percona/pmm/api/inventory/v1" -) - -// ensure the imports are used -var ( - _ = bytes.MinRead - _ = errors.New("") - _ = fmt.Print - _ = utf8.UTFMax - _ = (*regexp.Regexp)(nil) - _ = (*strings.Reader)(nil) - _ = net.IPv4len - _ = time.Duration(0) - _ = (*url.URL)(nil) - _ = (*mail.Address)(nil) - _ = anypb.Any{} - _ = sort.Sort - - _ = inventoryv1.AgentType(0) -) - -// Validate checks the field values on ServerInfo 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 *ServerInfo) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ServerInfo 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 ServerInfoMultiError, or -// nil if none found. -func (m *ServerInfo) ValidateAll() error { - return m.validate(true) -} - -func (m *ServerInfo) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Url - - // no validation rules for InsecureTls - - // no validation rules for Connected - - // no validation rules for Version - - if all { - switch v := interface{}(m.GetLatency()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ServerInfoValidationError{ - field: "Latency", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ServerInfoValidationError{ - field: "Latency", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetLatency()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ServerInfoValidationError{ - field: "Latency", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetClockDrift()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ServerInfoValidationError{ - field: "ClockDrift", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ServerInfoValidationError{ - field: "ClockDrift", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetClockDrift()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ServerInfoValidationError{ - field: "ClockDrift", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if len(errors) > 0 { - return ServerInfoMultiError(errors) - } - - return nil -} - -// ServerInfoMultiError is an error wrapping multiple validation errors -// returned by ServerInfo.ValidateAll() if the designated constraints aren't met. -type ServerInfoMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ServerInfoMultiError) 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 ServerInfoMultiError) AllErrors() []error { return m } - -// ServerInfoValidationError is the validation error returned by -// ServerInfo.Validate if the designated constraints aren't met. -type ServerInfoValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ServerInfoValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ServerInfoValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ServerInfoValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ServerInfoValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ServerInfoValidationError) ErrorName() string { return "ServerInfoValidationError" } - -// Error satisfies the builtin error interface -func (e ServerInfoValidationError) 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 %sServerInfo.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ServerInfoValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ServerInfoValidationError{} - -// Validate checks the field values on AgentInfo 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 *AgentInfo) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on AgentInfo 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 AgentInfoMultiError, or nil -// if none found. -func (m *AgentInfo) ValidateAll() error { - return m.validate(true) -} - -func (m *AgentInfo) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for AgentId - - // no validation rules for AgentType - - // no validation rules for Status - - // no validation rules for ListenPort - - // no validation rules for ProcessExecPath - - if len(errors) > 0 { - return AgentInfoMultiError(errors) - } - - return nil -} - -// AgentInfoMultiError is an error wrapping multiple validation errors returned -// by AgentInfo.ValidateAll() if the designated constraints aren't met. -type AgentInfoMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m AgentInfoMultiError) 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 AgentInfoMultiError) AllErrors() []error { return m } - -// AgentInfoValidationError is the validation error returned by -// AgentInfo.Validate if the designated constraints aren't met. -type AgentInfoValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e AgentInfoValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e AgentInfoValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e AgentInfoValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e AgentInfoValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e AgentInfoValidationError) ErrorName() string { return "AgentInfoValidationError" } - -// Error satisfies the builtin error interface -func (e AgentInfoValidationError) 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 %sAgentInfo.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = AgentInfoValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = AgentInfoValidationError{} - -// Validate checks the field values on StatusRequest 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 *StatusRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on StatusRequest 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 StatusRequestMultiError, or -// nil if none found. -func (m *StatusRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *StatusRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for GetNetworkInfo - - if len(errors) > 0 { - return StatusRequestMultiError(errors) - } - - return nil -} - -// StatusRequestMultiError is an error wrapping multiple validation errors -// returned by StatusRequest.ValidateAll() if the designated constraints -// aren't met. -type StatusRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m StatusRequestMultiError) 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 StatusRequestMultiError) AllErrors() []error { return m } - -// StatusRequestValidationError is the validation error returned by -// StatusRequest.Validate if the designated constraints aren't met. -type StatusRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e StatusRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e StatusRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e StatusRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e StatusRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e StatusRequestValidationError) ErrorName() string { return "StatusRequestValidationError" } - -// Error satisfies the builtin error interface -func (e StatusRequestValidationError) 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 %sStatusRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = StatusRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = StatusRequestValidationError{} - -// Validate checks the field values on StatusResponse 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 *StatusResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on StatusResponse 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 StatusResponseMultiError, -// or nil if none found. -func (m *StatusResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *StatusResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for AgentId - - // no validation rules for RunsOnNodeId - - // no validation rules for NodeName - - if all { - switch v := interface{}(m.GetServerInfo()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, StatusResponseValidationError{ - field: "ServerInfo", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, StatusResponseValidationError{ - field: "ServerInfo", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetServerInfo()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return StatusResponseValidationError{ - field: "ServerInfo", - reason: "embedded message failed validation", - cause: err, - } - } - } - - for idx, item := range m.GetAgentsInfo() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, StatusResponseValidationError{ - field: fmt.Sprintf("AgentsInfo[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, StatusResponseValidationError{ - field: fmt.Sprintf("AgentsInfo[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return StatusResponseValidationError{ - field: fmt.Sprintf("AgentsInfo[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - // no validation rules for ConfigFilepath - - // no validation rules for AgentVersion - - // no validation rules for ConnectionUptime - - if len(errors) > 0 { - return StatusResponseMultiError(errors) - } - - return nil -} - -// StatusResponseMultiError is an error wrapping multiple validation errors -// returned by StatusResponse.ValidateAll() if the designated constraints -// aren't met. -type StatusResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m StatusResponseMultiError) 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 StatusResponseMultiError) AllErrors() []error { return m } - -// StatusResponseValidationError is the validation error returned by -// StatusResponse.Validate if the designated constraints aren't met. -type StatusResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e StatusResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e StatusResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e StatusResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e StatusResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e StatusResponseValidationError) ErrorName() string { return "StatusResponseValidationError" } - -// Error satisfies the builtin error interface -func (e StatusResponseValidationError) 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 %sStatusResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = StatusResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = StatusResponseValidationError{} - -// Validate checks the field values on ReloadRequest 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 *ReloadRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ReloadRequest 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 ReloadRequestMultiError, or -// nil if none found. -func (m *ReloadRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *ReloadRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return ReloadRequestMultiError(errors) - } - - return nil -} - -// ReloadRequestMultiError is an error wrapping multiple validation errors -// returned by ReloadRequest.ValidateAll() if the designated constraints -// aren't met. -type ReloadRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ReloadRequestMultiError) 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 ReloadRequestMultiError) AllErrors() []error { return m } - -// ReloadRequestValidationError is the validation error returned by -// ReloadRequest.Validate if the designated constraints aren't met. -type ReloadRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ReloadRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ReloadRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ReloadRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ReloadRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ReloadRequestValidationError) ErrorName() string { return "ReloadRequestValidationError" } - -// Error satisfies the builtin error interface -func (e ReloadRequestValidationError) 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 %sReloadRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ReloadRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ReloadRequestValidationError{} - -// Validate checks the field values on ReloadResponse 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 *ReloadResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ReloadResponse 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 ReloadResponseMultiError, -// or nil if none found. -func (m *ReloadResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *ReloadResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return ReloadResponseMultiError(errors) - } - - return nil -} - -// ReloadResponseMultiError is an error wrapping multiple validation errors -// returned by ReloadResponse.ValidateAll() if the designated constraints -// aren't met. -type ReloadResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ReloadResponseMultiError) 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 ReloadResponseMultiError) AllErrors() []error { return m } - -// ReloadResponseValidationError is the validation error returned by -// ReloadResponse.Validate if the designated constraints aren't met. -type ReloadResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ReloadResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ReloadResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ReloadResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ReloadResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ReloadResponseValidationError) ErrorName() string { return "ReloadResponseValidationError" } - -// Error satisfies the builtin error interface -func (e ReloadResponseValidationError) 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 %sReloadResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ReloadResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ReloadResponseValidationError{} diff --git a/api/agentlocal/v1/agentlocal_grpc.pb.go b/api/agentlocal/v1/agentlocal_grpc.pb.go deleted file mode 100644 index 14d47f7c727..00000000000 --- a/api/agentlocal/v1/agentlocal_grpc.pb.go +++ /dev/null @@ -1,169 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.6.0 -// - protoc (unknown) -// source: agentlocal/v1/agentlocal.proto - -package agentlocalv1 - -import ( - context "context" - - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.64.0 or later. -const _ = grpc.SupportPackageIsVersion9 - -const ( - AgentLocalService_Status_FullMethodName = "/agentlocal.v1.AgentLocalService/Status" - AgentLocalService_Reload_FullMethodName = "/agentlocal.v1.AgentLocalService/Reload" -) - -// AgentLocalServiceClient is the client API for AgentLocalService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -// -// AgentLocal service provides public methods for checking pmm-agent status locally. -type AgentLocalServiceClient interface { - // Status returns current pmm-agent status. - Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error) - // Reload reloads pmm-agent configuration. - Reload(ctx context.Context, in *ReloadRequest, opts ...grpc.CallOption) (*ReloadResponse, error) -} - -type agentLocalServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewAgentLocalServiceClient(cc grpc.ClientConnInterface) AgentLocalServiceClient { - return &agentLocalServiceClient{cc} -} - -func (c *agentLocalServiceClient) Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(StatusResponse) - err := c.cc.Invoke(ctx, AgentLocalService_Status_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *agentLocalServiceClient) Reload(ctx context.Context, in *ReloadRequest, opts ...grpc.CallOption) (*ReloadResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(ReloadResponse) - err := c.cc.Invoke(ctx, AgentLocalService_Reload_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -// AgentLocalServiceServer is the server API for AgentLocalService service. -// All implementations must embed UnimplementedAgentLocalServiceServer -// for forward compatibility. -// -// AgentLocal service provides public methods for checking pmm-agent status locally. -type AgentLocalServiceServer interface { - // Status returns current pmm-agent status. - Status(context.Context, *StatusRequest) (*StatusResponse, error) - // Reload reloads pmm-agent configuration. - Reload(context.Context, *ReloadRequest) (*ReloadResponse, error) - mustEmbedUnimplementedAgentLocalServiceServer() -} - -// UnimplementedAgentLocalServiceServer must be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -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") -} -func (UnimplementedAgentLocalServiceServer) mustEmbedUnimplementedAgentLocalServiceServer() {} -func (UnimplementedAgentLocalServiceServer) testEmbeddedByValue() {} - -// UnsafeAgentLocalServiceServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to AgentLocalServiceServer will -// result in compilation errors. -type UnsafeAgentLocalServiceServer interface { - mustEmbedUnimplementedAgentLocalServiceServer() -} - -func RegisterAgentLocalServiceServer(s grpc.ServiceRegistrar, srv AgentLocalServiceServer) { - // If the following call panics, it indicates UnimplementedAgentLocalServiceServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } - s.RegisterService(&AgentLocalService_ServiceDesc, srv) -} - -func _AgentLocalService_Status_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(StatusRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AgentLocalServiceServer).Status(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: AgentLocalService_Status_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AgentLocalServiceServer).Status(ctx, req.(*StatusRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AgentLocalService_Reload_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ReloadRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AgentLocalServiceServer).Reload(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: AgentLocalService_Reload_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AgentLocalServiceServer).Reload(ctx, req.(*ReloadRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// AgentLocalService_ServiceDesc is the grpc.ServiceDesc for AgentLocalService service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var AgentLocalService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "agentlocal.v1.AgentLocalService", - HandlerType: (*AgentLocalServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Status", - Handler: _AgentLocalService_Status_Handler, - }, - { - MethodName: "Reload", - Handler: _AgentLocalService_Reload_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "agentlocal/v1/agentlocal.proto", -} diff --git a/api/agentlocal/v1/json/client/agent_local_service/agent_local_service_client.go b/api/agentlocal/v1/json/client/agent_local_service/agent_local_service_client.go deleted file mode 100644 index e4d4ef9f29c..00000000000 --- a/api/agentlocal/v1/json/client/agent_local_service/agent_local_service_client.go +++ /dev/null @@ -1,195 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package agent_local_service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// New creates a new agent local service API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -// New creates a new agent local service API client with basic auth credentials. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - user: user for basic authentication header. -// - password: password for basic authentication header. -func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BasicAuth(user, password) - return &Client{transport: transport, formats: strfmt.Default} -} - -// New creates a new agent local service API client with a bearer token for authentication. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - bearerToken: bearer token for Bearer authentication header. -func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BearerToken(bearerToken) - return &Client{transport: transport, formats: strfmt.Default} -} - -/* -Client for agent local service API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption may be used to customize the behavior of Client methods. -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - Reload(params *ReloadParams, opts ...ClientOption) (*ReloadOK, error) - - Status(params *StatusParams, opts ...ClientOption) (*StatusOK, error) - - Status2(params *Status2Params, opts ...ClientOption) (*Status2OK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -Reload reloads reloads pmm agent configuration -*/ -func (a *Client) Reload(params *ReloadParams, opts ...ClientOption) (*ReloadOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewReloadParams() - } - op := &runtime.ClientOperation{ - ID: "Reload", - Method: "POST", - PathPattern: "/local/Reload", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &ReloadReader{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.(*ReloadOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*ReloadDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -Status statuses returns current pmm agent status -*/ -func (a *Client) Status(params *StatusParams, opts ...ClientOption) (*StatusOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewStatusParams() - } - op := &runtime.ClientOperation{ - ID: "Status", - Method: "POST", - PathPattern: "/local/Status", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &StatusReader{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.(*StatusOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*StatusDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -Status2 statuses returns current pmm agent status -*/ -func (a *Client) Status2(params *Status2Params, opts ...ClientOption) (*Status2OK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewStatus2Params() - } - op := &runtime.ClientOperation{ - ID: "Status2", - Method: "GET", - PathPattern: "/local/Status", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &Status2Reader{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.(*Status2OK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*Status2Default) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/api/agentlocal/v1/json/client/agent_local_service/reload_parameters.go b/api/agentlocal/v1/json/client/agent_local_service/reload_parameters.go deleted file mode 100644 index 7a559d37dc8..00000000000 --- a/api/agentlocal/v1/json/client/agent_local_service/reload_parameters.go +++ /dev/null @@ -1,146 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package agent_local_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" -) - -// NewReloadParams creates a new ReloadParams 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 NewReloadParams() *ReloadParams { - return &ReloadParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewReloadParamsWithTimeout creates a new ReloadParams object -// with the ability to set a timeout on a request. -func NewReloadParamsWithTimeout(timeout time.Duration) *ReloadParams { - return &ReloadParams{ - timeout: timeout, - } -} - -// NewReloadParamsWithContext creates a new ReloadParams object -// with the ability to set a context for a request. -func NewReloadParamsWithContext(ctx context.Context) *ReloadParams { - return &ReloadParams{ - Context: ctx, - } -} - -// NewReloadParamsWithHTTPClient creates a new ReloadParams object -// with the ability to set a custom HTTPClient for a request. -func NewReloadParamsWithHTTPClient(client *http.Client) *ReloadParams { - return &ReloadParams{ - HTTPClient: client, - } -} - -/* -ReloadParams contains all the parameters to send to the API endpoint - - for the reload operation. - - Typically these are written to a http.Request. -*/ -type ReloadParams struct { - // Body. - Body any - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the reload params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ReloadParams) WithDefaults() *ReloadParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the reload params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ReloadParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the reload params -func (o *ReloadParams) WithTimeout(timeout time.Duration) *ReloadParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the reload params -func (o *ReloadParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the reload params -func (o *ReloadParams) WithContext(ctx context.Context) *ReloadParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the reload params -func (o *ReloadParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the reload params -func (o *ReloadParams) WithHTTPClient(client *http.Client) *ReloadParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the reload params -func (o *ReloadParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the reload params -func (o *ReloadParams) WithBody(body any) *ReloadParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the reload params -func (o *ReloadParams) SetBody(body any) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *ReloadParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/api/agentlocal/v1/json/client/agent_local_service/reload_responses.go b/api/agentlocal/v1/json/client/agent_local_service/reload_responses.go deleted file mode 100644 index 1595292df0d..00000000000 --- a/api/agentlocal/v1/json/client/agent_local_service/reload_responses.go +++ /dev/null @@ -1,414 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package agent_local_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" -) - -// ReloadReader is a Reader for the Reload structure. -type ReloadReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ReloadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewReloadOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewReloadDefault(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 - } -} - -// NewReloadOK creates a ReloadOK with default headers values -func NewReloadOK() *ReloadOK { - return &ReloadOK{} -} - -/* -ReloadOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type ReloadOK struct { - Payload any -} - -// IsSuccess returns true when this reload Ok response has a 2xx status code -func (o *ReloadOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this reload Ok response has a 3xx status code -func (o *ReloadOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this reload Ok response has a 4xx status code -func (o *ReloadOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this reload Ok response has a 5xx status code -func (o *ReloadOK) IsServerError() bool { - return false -} - -// IsCode returns true when this reload Ok response a status code equal to that given -func (o *ReloadOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the reload Ok response -func (o *ReloadOK) Code() int { - return 200 -} - -func (o *ReloadOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /local/Reload][%d] reloadOk %s", 200, payload) -} - -func (o *ReloadOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /local/Reload][%d] reloadOk %s", 200, payload) -} - -func (o *ReloadOK) GetPayload() any { - return o.Payload -} - -func (o *ReloadOK) 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) { - return err - } - - return nil -} - -// NewReloadDefault creates a ReloadDefault with default headers values -func NewReloadDefault(code int) *ReloadDefault { - return &ReloadDefault{ - _statusCode: code, - } -} - -/* -ReloadDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type ReloadDefault struct { - _statusCode int - - Payload *ReloadDefaultBody -} - -// IsSuccess returns true when this reload default response has a 2xx status code -func (o *ReloadDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this reload default response has a 3xx status code -func (o *ReloadDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this reload default response has a 4xx status code -func (o *ReloadDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this reload default response has a 5xx status code -func (o *ReloadDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this reload default response a status code equal to that given -func (o *ReloadDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the reload default response -func (o *ReloadDefault) Code() int { - return o._statusCode -} - -func (o *ReloadDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /local/Reload][%d] Reload default %s", o._statusCode, payload) -} - -func (o *ReloadDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /local/Reload][%d] Reload default %s", o._statusCode, payload) -} - -func (o *ReloadDefault) GetPayload() *ReloadDefaultBody { - return o.Payload -} - -func (o *ReloadDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(ReloadDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -ReloadDefaultBody reload default body -swagger:model ReloadDefaultBody -*/ -type ReloadDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*ReloadDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this reload default body -func (o *ReloadDefaultBody) 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 *ReloadDefaultBody) 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("Reload default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("Reload default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this reload default body based on the context it is used -func (o *ReloadDefaultBody) 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 *ReloadDefaultBody) 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("Reload default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("Reload default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ReloadDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ReloadDefaultBody) UnmarshalBinary(b []byte) error { - var res ReloadDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ReloadDefaultBodyDetailsItems0 reload default body details items0 -swagger:model ReloadDefaultBodyDetailsItems0 -*/ -type ReloadDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` - - // reload default body details items0 - ReloadDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *ReloadDefaultBodyDetailsItems0) 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 ReloadDefaultBodyDetailsItems0 - - 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.ReloadDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o ReloadDefaultBodyDetailsItems0) 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.ReloadDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.ReloadDefaultBodyDetailsItems0) - 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 reload default body details items0 -func (o *ReloadDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this reload default body details items0 based on context it is used -func (o *ReloadDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ReloadDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ReloadDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res ReloadDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/agentlocal/v1/json/client/agent_local_service/status2_parameters.go b/api/agentlocal/v1/json/client/agent_local_service/status2_parameters.go deleted file mode 100644 index 220d4c5bbac..00000000000 --- a/api/agentlocal/v1/json/client/agent_local_service/status2_parameters.go +++ /dev/null @@ -1,161 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package agent_local_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" - "github.com/go-openapi/swag" -) - -// NewStatus2Params creates a new Status2Params 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 NewStatus2Params() *Status2Params { - return &Status2Params{ - timeout: cr.DefaultTimeout, - } -} - -// NewStatus2ParamsWithTimeout creates a new Status2Params object -// with the ability to set a timeout on a request. -func NewStatus2ParamsWithTimeout(timeout time.Duration) *Status2Params { - return &Status2Params{ - timeout: timeout, - } -} - -// NewStatus2ParamsWithContext creates a new Status2Params object -// with the ability to set a context for a request. -func NewStatus2ParamsWithContext(ctx context.Context) *Status2Params { - return &Status2Params{ - Context: ctx, - } -} - -// NewStatus2ParamsWithHTTPClient creates a new Status2Params object -// with the ability to set a custom HTTPClient for a request. -func NewStatus2ParamsWithHTTPClient(client *http.Client) *Status2Params { - return &Status2Params{ - HTTPClient: client, - } -} - -/* -Status2Params contains all the parameters to send to the API endpoint - - for the status2 operation. - - Typically these are written to a http.Request. -*/ -type Status2Params struct { - /* GetNetworkInfo. - - Returns network info (latency and clock_drift) if true. - */ - GetNetworkInfo *bool - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the status2 params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *Status2Params) WithDefaults() *Status2Params { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the status2 params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *Status2Params) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the status2 params -func (o *Status2Params) WithTimeout(timeout time.Duration) *Status2Params { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the status2 params -func (o *Status2Params) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the status2 params -func (o *Status2Params) WithContext(ctx context.Context) *Status2Params { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the status2 params -func (o *Status2Params) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the status2 params -func (o *Status2Params) WithHTTPClient(client *http.Client) *Status2Params { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the status2 params -func (o *Status2Params) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithGetNetworkInfo adds the getNetworkInfo to the status2 params -func (o *Status2Params) WithGetNetworkInfo(getNetworkInfo *bool) *Status2Params { - o.SetGetNetworkInfo(getNetworkInfo) - return o -} - -// SetGetNetworkInfo adds the getNetworkInfo to the status2 params -func (o *Status2Params) SetGetNetworkInfo(getNetworkInfo *bool) { - o.GetNetworkInfo = getNetworkInfo -} - -// WriteToRequest writes these params to a swagger request -func (o *Status2Params) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.GetNetworkInfo != nil { - - // query param get_network_info - var qrGetNetworkInfo bool - - if o.GetNetworkInfo != nil { - qrGetNetworkInfo = *o.GetNetworkInfo - } - qGetNetworkInfo := swag.FormatBool(qrGetNetworkInfo) - if qGetNetworkInfo != "" { - if err := r.SetQueryParam("get_network_info", qGetNetworkInfo); err != nil { - return err - } - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/api/agentlocal/v1/json/client/agent_local_service/status2_responses.go b/api/agentlocal/v1/json/client/agent_local_service/status2_responses.go deleted file mode 100644 index 1f7b1339e84..00000000000 --- a/api/agentlocal/v1/json/client/agent_local_service/status2_responses.go +++ /dev/null @@ -1,882 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package agent_local_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" -) - -// Status2Reader is a Reader for the Status2 structure. -type Status2Reader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *Status2Reader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewStatus2OK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewStatus2Default(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 - } -} - -// NewStatus2OK creates a Status2OK with default headers values -func NewStatus2OK() *Status2OK { - return &Status2OK{} -} - -/* -Status2OK describes a response with status code 200, with default header values. - -A successful response. -*/ -type Status2OK struct { - Payload *Status2OKBody -} - -// IsSuccess returns true when this status2 Ok response has a 2xx status code -func (o *Status2OK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this status2 Ok response has a 3xx status code -func (o *Status2OK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this status2 Ok response has a 4xx status code -func (o *Status2OK) IsClientError() bool { - return false -} - -// IsServerError returns true when this status2 Ok response has a 5xx status code -func (o *Status2OK) IsServerError() bool { - return false -} - -// IsCode returns true when this status2 Ok response a status code equal to that given -func (o *Status2OK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the status2 Ok response -func (o *Status2OK) Code() int { - return 200 -} - -func (o *Status2OK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /local/Status][%d] status2Ok %s", 200, payload) -} - -func (o *Status2OK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /local/Status][%d] status2Ok %s", 200, payload) -} - -func (o *Status2OK) GetPayload() *Status2OKBody { - return o.Payload -} - -func (o *Status2OK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(Status2OKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -// NewStatus2Default creates a Status2Default with default headers values -func NewStatus2Default(code int) *Status2Default { - return &Status2Default{ - _statusCode: code, - } -} - -/* -Status2Default describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type Status2Default struct { - _statusCode int - - Payload *Status2DefaultBody -} - -// IsSuccess returns true when this status2 default response has a 2xx status code -func (o *Status2Default) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this status2 default response has a 3xx status code -func (o *Status2Default) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this status2 default response has a 4xx status code -func (o *Status2Default) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this status2 default response has a 5xx status code -func (o *Status2Default) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this status2 default response a status code equal to that given -func (o *Status2Default) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the status2 default response -func (o *Status2Default) Code() int { - return o._statusCode -} - -func (o *Status2Default) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /local/Status][%d] Status2 default %s", o._statusCode, payload) -} - -func (o *Status2Default) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /local/Status][%d] Status2 default %s", o._statusCode, payload) -} - -func (o *Status2Default) GetPayload() *Status2DefaultBody { - return o.Payload -} - -func (o *Status2Default) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(Status2DefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -Status2DefaultBody status2 default body -swagger:model Status2DefaultBody -*/ -type Status2DefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*Status2DefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this status2 default body -func (o *Status2DefaultBody) 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 *Status2DefaultBody) 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("Status2 default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("Status2 default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this status2 default body based on the context it is used -func (o *Status2DefaultBody) 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 *Status2DefaultBody) 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("Status2 default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("Status2 default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *Status2DefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *Status2DefaultBody) UnmarshalBinary(b []byte) error { - var res Status2DefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -Status2DefaultBodyDetailsItems0 status2 default body details items0 -swagger:model Status2DefaultBodyDetailsItems0 -*/ -type Status2DefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` - - // status2 default body details items0 - Status2DefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *Status2DefaultBodyDetailsItems0) 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 Status2DefaultBodyDetailsItems0 - - 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.Status2DefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o Status2DefaultBodyDetailsItems0) 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.Status2DefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.Status2DefaultBodyDetailsItems0) - 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 status2 default body details items0 -func (o *Status2DefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this status2 default body details items0 based on context it is used -func (o *Status2DefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *Status2DefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *Status2DefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res Status2DefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -Status2OKBody status2 OK body -swagger:model Status2OKBody -*/ -type Status2OKBody struct { - // agent id - AgentID string `json:"agent_id,omitempty"` - - // TODO: rename to node_id - RunsOnNodeID string `json:"runs_on_node_id,omitempty"` - - // node name - NodeName string `json:"node_name,omitempty"` - - // agents info - AgentsInfo []*Status2OKBodyAgentsInfoItems0 `json:"agents_info"` - - // Config file path if pmm-agent was started with one. - ConfigFilepath string `json:"config_filepath,omitempty"` - - // PMM Agent version. - AgentVersion string `json:"agent_version,omitempty"` - - // Shows connection uptime in percentage between agent and server - ConnectionUptime float32 `json:"connection_uptime,omitempty"` - - // server info - ServerInfo *Status2OKBodyServerInfo `json:"server_info,omitempty"` -} - -// Validate validates this status2 OK body -func (o *Status2OKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateAgentsInfo(formats); err != nil { - res = append(res, err) - } - - if err := o.validateServerInfo(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *Status2OKBody) validateAgentsInfo(formats strfmt.Registry) error { - if swag.IsZero(o.AgentsInfo) { // not required - return nil - } - - for i := 0; i < len(o.AgentsInfo); i++ { - if swag.IsZero(o.AgentsInfo[i]) { // not required - continue - } - - if o.AgentsInfo[i] != nil { - if err := o.AgentsInfo[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("status2Ok" + "." + "agents_info" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("status2Ok" + "." + "agents_info" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -func (o *Status2OKBody) validateServerInfo(formats strfmt.Registry) error { - if swag.IsZero(o.ServerInfo) { // not required - return nil - } - - if o.ServerInfo != nil { - if err := o.ServerInfo.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("status2Ok" + "." + "server_info") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("status2Ok" + "." + "server_info") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this status2 OK body based on the context it is used -func (o *Status2OKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateAgentsInfo(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateServerInfo(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *Status2OKBody) contextValidateAgentsInfo(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.AgentsInfo); i++ { - if o.AgentsInfo[i] != nil { - - if swag.IsZero(o.AgentsInfo[i]) { // not required - return nil - } - - if err := o.AgentsInfo[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("status2Ok" + "." + "agents_info" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("status2Ok" + "." + "agents_info" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -func (o *Status2OKBody) contextValidateServerInfo(ctx context.Context, formats strfmt.Registry) error { - if o.ServerInfo != nil { - - if swag.IsZero(o.ServerInfo) { // not required - return nil - } - - if err := o.ServerInfo.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("status2Ok" + "." + "server_info") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("status2Ok" + "." + "server_info") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *Status2OKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *Status2OKBody) UnmarshalBinary(b []byte) error { - var res Status2OKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -Status2OKBodyAgentsInfoItems0 AgentInfo contains information about Agent managed by pmm-agent. -swagger:model Status2OKBodyAgentsInfoItems0 -*/ -type Status2OKBodyAgentsInfoItems0 struct { - // agent id - AgentID string `json:"agent_id,omitempty"` - - // AgentType describes supported Agent types. - // 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"] - AgentType *string `json:"agent_type,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"` - - // The current listen port of this Agent (exporter or vmagent). - // Zero for other Agent types, or if unknown or not yet supported. - ListenPort int64 `json:"listen_port,omitempty"` - - // process exec path - ProcessExecPath string `json:"process_exec_path,omitempty"` -} - -// Validate validates this status2 OK body agents info items0 -func (o *Status2OKBodyAgentsInfoItems0) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateAgentType(formats); err != nil { - res = append(res, err) - } - - if err := o.validateStatus(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var status2OkBodyAgentsInfoItems0TypeAgentTypePropEnum []any - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["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"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - status2OkBodyAgentsInfoItems0TypeAgentTypePropEnum = append(status2OkBodyAgentsInfoItems0TypeAgentTypePropEnum, v) - } -} - -const ( - - // Status2OKBodyAgentsInfoItems0AgentTypeAGENTTYPEUNSPECIFIED captures enum value "AGENT_TYPE_UNSPECIFIED" - Status2OKBodyAgentsInfoItems0AgentTypeAGENTTYPEUNSPECIFIED string = "AGENT_TYPE_UNSPECIFIED" - - // Status2OKBodyAgentsInfoItems0AgentTypeAGENTTYPEPMMAGENT captures enum value "AGENT_TYPE_PMM_AGENT" - Status2OKBodyAgentsInfoItems0AgentTypeAGENTTYPEPMMAGENT string = "AGENT_TYPE_PMM_AGENT" - - // Status2OKBodyAgentsInfoItems0AgentTypeAGENTTYPEVMAGENT captures enum value "AGENT_TYPE_VM_AGENT" - Status2OKBodyAgentsInfoItems0AgentTypeAGENTTYPEVMAGENT string = "AGENT_TYPE_VM_AGENT" - - // Status2OKBodyAgentsInfoItems0AgentTypeAGENTTYPENODEEXPORTER captures enum value "AGENT_TYPE_NODE_EXPORTER" - Status2OKBodyAgentsInfoItems0AgentTypeAGENTTYPENODEEXPORTER string = "AGENT_TYPE_NODE_EXPORTER" - - // Status2OKBodyAgentsInfoItems0AgentTypeAGENTTYPEMYSQLDEXPORTER captures enum value "AGENT_TYPE_MYSQLD_EXPORTER" - Status2OKBodyAgentsInfoItems0AgentTypeAGENTTYPEMYSQLDEXPORTER string = "AGENT_TYPE_MYSQLD_EXPORTER" - - // Status2OKBodyAgentsInfoItems0AgentTypeAGENTTYPEMONGODBEXPORTER captures enum value "AGENT_TYPE_MONGODB_EXPORTER" - Status2OKBodyAgentsInfoItems0AgentTypeAGENTTYPEMONGODBEXPORTER string = "AGENT_TYPE_MONGODB_EXPORTER" - - // Status2OKBodyAgentsInfoItems0AgentTypeAGENTTYPEPOSTGRESEXPORTER captures enum value "AGENT_TYPE_POSTGRES_EXPORTER" - Status2OKBodyAgentsInfoItems0AgentTypeAGENTTYPEPOSTGRESEXPORTER string = "AGENT_TYPE_POSTGRES_EXPORTER" - - // Status2OKBodyAgentsInfoItems0AgentTypeAGENTTYPEPROXYSQLEXPORTER captures enum value "AGENT_TYPE_PROXYSQL_EXPORTER" - Status2OKBodyAgentsInfoItems0AgentTypeAGENTTYPEPROXYSQLEXPORTER string = "AGENT_TYPE_PROXYSQL_EXPORTER" - - // Status2OKBodyAgentsInfoItems0AgentTypeAGENTTYPEVALKEYEXPORTER captures enum value "AGENT_TYPE_VALKEY_EXPORTER" - Status2OKBodyAgentsInfoItems0AgentTypeAGENTTYPEVALKEYEXPORTER string = "AGENT_TYPE_VALKEY_EXPORTER" - - // Status2OKBodyAgentsInfoItems0AgentTypeAGENTTYPEQANMYSQLPERFSCHEMAAGENT captures enum value "AGENT_TYPE_QAN_MYSQL_PERFSCHEMA_AGENT" - Status2OKBodyAgentsInfoItems0AgentTypeAGENTTYPEQANMYSQLPERFSCHEMAAGENT string = "AGENT_TYPE_QAN_MYSQL_PERFSCHEMA_AGENT" - - // Status2OKBodyAgentsInfoItems0AgentTypeAGENTTYPEQANMYSQLSLOWLOGAGENT captures enum value "AGENT_TYPE_QAN_MYSQL_SLOWLOG_AGENT" - Status2OKBodyAgentsInfoItems0AgentTypeAGENTTYPEQANMYSQLSLOWLOGAGENT string = "AGENT_TYPE_QAN_MYSQL_SLOWLOG_AGENT" - - // Status2OKBodyAgentsInfoItems0AgentTypeAGENTTYPEQANMONGODBPROFILERAGENT captures enum value "AGENT_TYPE_QAN_MONGODB_PROFILER_AGENT" - Status2OKBodyAgentsInfoItems0AgentTypeAGENTTYPEQANMONGODBPROFILERAGENT string = "AGENT_TYPE_QAN_MONGODB_PROFILER_AGENT" - - // Status2OKBodyAgentsInfoItems0AgentTypeAGENTTYPEQANMONGODBMONGOLOGAGENT captures enum value "AGENT_TYPE_QAN_MONGODB_MONGOLOG_AGENT" - Status2OKBodyAgentsInfoItems0AgentTypeAGENTTYPEQANMONGODBMONGOLOGAGENT string = "AGENT_TYPE_QAN_MONGODB_MONGOLOG_AGENT" - - // Status2OKBodyAgentsInfoItems0AgentTypeAGENTTYPEQANPOSTGRESQLPGSTATEMENTSAGENT captures enum value "AGENT_TYPE_QAN_POSTGRESQL_PGSTATEMENTS_AGENT" - Status2OKBodyAgentsInfoItems0AgentTypeAGENTTYPEQANPOSTGRESQLPGSTATEMENTSAGENT string = "AGENT_TYPE_QAN_POSTGRESQL_PGSTATEMENTS_AGENT" - - // Status2OKBodyAgentsInfoItems0AgentTypeAGENTTYPEQANPOSTGRESQLPGSTATMONITORAGENT captures enum value "AGENT_TYPE_QAN_POSTGRESQL_PGSTATMONITOR_AGENT" - Status2OKBodyAgentsInfoItems0AgentTypeAGENTTYPEQANPOSTGRESQLPGSTATMONITORAGENT string = "AGENT_TYPE_QAN_POSTGRESQL_PGSTATMONITOR_AGENT" - - // Status2OKBodyAgentsInfoItems0AgentTypeAGENTTYPEEXTERNALEXPORTER captures enum value "AGENT_TYPE_EXTERNAL_EXPORTER" - Status2OKBodyAgentsInfoItems0AgentTypeAGENTTYPEEXTERNALEXPORTER string = "AGENT_TYPE_EXTERNAL_EXPORTER" - - // Status2OKBodyAgentsInfoItems0AgentTypeAGENTTYPERDSEXPORTER captures enum value "AGENT_TYPE_RDS_EXPORTER" - Status2OKBodyAgentsInfoItems0AgentTypeAGENTTYPERDSEXPORTER string = "AGENT_TYPE_RDS_EXPORTER" - - // Status2OKBodyAgentsInfoItems0AgentTypeAGENTTYPEAZUREDATABASEEXPORTER captures enum value "AGENT_TYPE_AZURE_DATABASE_EXPORTER" - Status2OKBodyAgentsInfoItems0AgentTypeAGENTTYPEAZUREDATABASEEXPORTER string = "AGENT_TYPE_AZURE_DATABASE_EXPORTER" - - // Status2OKBodyAgentsInfoItems0AgentTypeAGENTTYPENOMADAGENT captures enum value "AGENT_TYPE_NOMAD_AGENT" - Status2OKBodyAgentsInfoItems0AgentTypeAGENTTYPENOMADAGENT string = "AGENT_TYPE_NOMAD_AGENT" -) - -// prop value enum -func (o *Status2OKBodyAgentsInfoItems0) validateAgentTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, status2OkBodyAgentsInfoItems0TypeAgentTypePropEnum, true); err != nil { - return err - } - return nil -} - -func (o *Status2OKBodyAgentsInfoItems0) validateAgentType(formats strfmt.Registry) error { - if swag.IsZero(o.AgentType) { // not required - return nil - } - - // value enum - if err := o.validateAgentTypeEnum("agent_type", "body", *o.AgentType); err != nil { - return err - } - - return nil -} - -var status2OkBodyAgentsInfoItems0TypeStatusPropEnum []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 { - status2OkBodyAgentsInfoItems0TypeStatusPropEnum = append(status2OkBodyAgentsInfoItems0TypeStatusPropEnum, v) - } -} - -const ( - - // Status2OKBodyAgentsInfoItems0StatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - Status2OKBodyAgentsInfoItems0StatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // Status2OKBodyAgentsInfoItems0StatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - Status2OKBodyAgentsInfoItems0StatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // Status2OKBodyAgentsInfoItems0StatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - Status2OKBodyAgentsInfoItems0StatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - - // Status2OKBodyAgentsInfoItems0StatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - Status2OKBodyAgentsInfoItems0StatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - - // Status2OKBodyAgentsInfoItems0StatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - Status2OKBodyAgentsInfoItems0StatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - - // Status2OKBodyAgentsInfoItems0StatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - Status2OKBodyAgentsInfoItems0StatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" - - // Status2OKBodyAgentsInfoItems0StatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - Status2OKBodyAgentsInfoItems0StatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" - - // Status2OKBodyAgentsInfoItems0StatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - Status2OKBodyAgentsInfoItems0StatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" -) - -// prop value enum -func (o *Status2OKBodyAgentsInfoItems0) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, status2OkBodyAgentsInfoItems0TypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *Status2OKBodyAgentsInfoItems0) 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 validates this status2 OK body agents info items0 based on context it is used -func (o *Status2OKBodyAgentsInfoItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *Status2OKBodyAgentsInfoItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *Status2OKBodyAgentsInfoItems0) UnmarshalBinary(b []byte) error { - var res Status2OKBodyAgentsInfoItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -Status2OKBodyServerInfo ServerInfo contains information about the PMM Server. -swagger:model Status2OKBodyServerInfo -*/ -type Status2OKBodyServerInfo struct { - // PMM Server URL in a form https://HOST:PORT/. - URL string `json:"url,omitempty"` - - // PMM Server's TLS certificate validation should be skipped if true. - InsecureTLS bool `json:"insecure_tls,omitempty"` - - // True if pmm-agent is currently connected to the server. - Connected bool `json:"connected,omitempty"` - - // PMM Server version (if agent is connected). - Version string `json:"version,omitempty"` - - // Ping time from pmm-agent to pmm-managed (if agent is connected). - Latency string `json:"latency,omitempty"` - - // Clock drift from PMM Server (if agent is connected). - ClockDrift string `json:"clock_drift,omitempty"` -} - -// Validate validates this status2 OK body server info -func (o *Status2OKBodyServerInfo) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this status2 OK body server info based on context it is used -func (o *Status2OKBodyServerInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *Status2OKBodyServerInfo) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *Status2OKBodyServerInfo) UnmarshalBinary(b []byte) error { - var res Status2OKBodyServerInfo - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/agentlocal/v1/json/client/agent_local_service/status_parameters.go b/api/agentlocal/v1/json/client/agent_local_service/status_parameters.go deleted file mode 100644 index f522c468298..00000000000 --- a/api/agentlocal/v1/json/client/agent_local_service/status_parameters.go +++ /dev/null @@ -1,144 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package agent_local_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" -) - -// NewStatusParams creates a new StatusParams 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 NewStatusParams() *StatusParams { - return &StatusParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewStatusParamsWithTimeout creates a new StatusParams object -// with the ability to set a timeout on a request. -func NewStatusParamsWithTimeout(timeout time.Duration) *StatusParams { - return &StatusParams{ - timeout: timeout, - } -} - -// NewStatusParamsWithContext creates a new StatusParams object -// with the ability to set a context for a request. -func NewStatusParamsWithContext(ctx context.Context) *StatusParams { - return &StatusParams{ - Context: ctx, - } -} - -// NewStatusParamsWithHTTPClient creates a new StatusParams object -// with the ability to set a custom HTTPClient for a request. -func NewStatusParamsWithHTTPClient(client *http.Client) *StatusParams { - return &StatusParams{ - HTTPClient: client, - } -} - -/* -StatusParams contains all the parameters to send to the API endpoint - - for the status operation. - - Typically these are written to a http.Request. -*/ -type StatusParams struct { - // Body. - Body StatusBody - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the status params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *StatusParams) WithDefaults() *StatusParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the status params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *StatusParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the status params -func (o *StatusParams) WithTimeout(timeout time.Duration) *StatusParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the status params -func (o *StatusParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the status params -func (o *StatusParams) WithContext(ctx context.Context) *StatusParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the status params -func (o *StatusParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the status params -func (o *StatusParams) WithHTTPClient(client *http.Client) *StatusParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the status params -func (o *StatusParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the status params -func (o *StatusParams) WithBody(body StatusBody) *StatusParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the status params -func (o *StatusParams) SetBody(body StatusBody) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *StatusParams) 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/agentlocal/v1/json/client/agent_local_service/status_responses.go b/api/agentlocal/v1/json/client/agent_local_service/status_responses.go deleted file mode 100644 index 0dc3aa4f610..00000000000 --- a/api/agentlocal/v1/json/client/agent_local_service/status_responses.go +++ /dev/null @@ -1,919 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package agent_local_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" -) - -// StatusReader is a Reader for the Status structure. -type StatusReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *StatusReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewStatusOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewStatusDefault(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 - } -} - -// NewStatusOK creates a StatusOK with default headers values -func NewStatusOK() *StatusOK { - return &StatusOK{} -} - -/* -StatusOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type StatusOK struct { - Payload *StatusOKBody -} - -// IsSuccess returns true when this status Ok response has a 2xx status code -func (o *StatusOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this status Ok response has a 3xx status code -func (o *StatusOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this status Ok response has a 4xx status code -func (o *StatusOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this status Ok response has a 5xx status code -func (o *StatusOK) IsServerError() bool { - return false -} - -// IsCode returns true when this status Ok response a status code equal to that given -func (o *StatusOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the status Ok response -func (o *StatusOK) Code() int { - return 200 -} - -func (o *StatusOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /local/Status][%d] statusOk %s", 200, payload) -} - -func (o *StatusOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /local/Status][%d] statusOk %s", 200, payload) -} - -func (o *StatusOK) GetPayload() *StatusOKBody { - return o.Payload -} - -func (o *StatusOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(StatusOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -// NewStatusDefault creates a StatusDefault with default headers values -func NewStatusDefault(code int) *StatusDefault { - return &StatusDefault{ - _statusCode: code, - } -} - -/* -StatusDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type StatusDefault struct { - _statusCode int - - Payload *StatusDefaultBody -} - -// IsSuccess returns true when this status default response has a 2xx status code -func (o *StatusDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this status default response has a 3xx status code -func (o *StatusDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this status default response has a 4xx status code -func (o *StatusDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this status default response has a 5xx status code -func (o *StatusDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this status default response a status code equal to that given -func (o *StatusDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the status default response -func (o *StatusDefault) Code() int { - return o._statusCode -} - -func (o *StatusDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /local/Status][%d] Status default %s", o._statusCode, payload) -} - -func (o *StatusDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /local/Status][%d] Status default %s", o._statusCode, payload) -} - -func (o *StatusDefault) GetPayload() *StatusDefaultBody { - return o.Payload -} - -func (o *StatusDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(StatusDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -StatusBody status body -swagger:model StatusBody -*/ -type StatusBody struct { - // Returns network info (latency and clock_drift) if true. - GetNetworkInfo bool `json:"get_network_info,omitempty"` -} - -// Validate validates this status body -func (o *StatusBody) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this status body based on context it is used -func (o *StatusBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *StatusBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *StatusBody) UnmarshalBinary(b []byte) error { - var res StatusBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -StatusDefaultBody status default body -swagger:model StatusDefaultBody -*/ -type StatusDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*StatusDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this status default body -func (o *StatusDefaultBody) 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 *StatusDefaultBody) 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("Status default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("Status default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this status default body based on the context it is used -func (o *StatusDefaultBody) 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 *StatusDefaultBody) 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("Status default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("Status default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *StatusDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *StatusDefaultBody) UnmarshalBinary(b []byte) error { - var res StatusDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -StatusDefaultBodyDetailsItems0 status default body details items0 -swagger:model StatusDefaultBodyDetailsItems0 -*/ -type StatusDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` - - // status default body details items0 - StatusDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *StatusDefaultBodyDetailsItems0) 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 StatusDefaultBodyDetailsItems0 - - 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.StatusDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o StatusDefaultBodyDetailsItems0) 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.StatusDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.StatusDefaultBodyDetailsItems0) - 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 status default body details items0 -func (o *StatusDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this status default body details items0 based on context it is used -func (o *StatusDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *StatusDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *StatusDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res StatusDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -StatusOKBody status OK body -swagger:model StatusOKBody -*/ -type StatusOKBody struct { - // agent id - AgentID string `json:"agent_id,omitempty"` - - // TODO: rename to node_id - RunsOnNodeID string `json:"runs_on_node_id,omitempty"` - - // node name - NodeName string `json:"node_name,omitempty"` - - // agents info - AgentsInfo []*StatusOKBodyAgentsInfoItems0 `json:"agents_info"` - - // Config file path if pmm-agent was started with one. - ConfigFilepath string `json:"config_filepath,omitempty"` - - // PMM Agent version. - AgentVersion string `json:"agent_version,omitempty"` - - // Shows connection uptime in percentage between agent and server - ConnectionUptime float32 `json:"connection_uptime,omitempty"` - - // server info - ServerInfo *StatusOKBodyServerInfo `json:"server_info,omitempty"` -} - -// Validate validates this status OK body -func (o *StatusOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateAgentsInfo(formats); err != nil { - res = append(res, err) - } - - if err := o.validateServerInfo(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *StatusOKBody) validateAgentsInfo(formats strfmt.Registry) error { - if swag.IsZero(o.AgentsInfo) { // not required - return nil - } - - for i := 0; i < len(o.AgentsInfo); i++ { - if swag.IsZero(o.AgentsInfo[i]) { // not required - continue - } - - if o.AgentsInfo[i] != nil { - if err := o.AgentsInfo[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("statusOk" + "." + "agents_info" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("statusOk" + "." + "agents_info" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -func (o *StatusOKBody) validateServerInfo(formats strfmt.Registry) error { - if swag.IsZero(o.ServerInfo) { // not required - return nil - } - - if o.ServerInfo != nil { - if err := o.ServerInfo.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("statusOk" + "." + "server_info") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("statusOk" + "." + "server_info") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this status OK body based on the context it is used -func (o *StatusOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateAgentsInfo(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateServerInfo(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *StatusOKBody) contextValidateAgentsInfo(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.AgentsInfo); i++ { - if o.AgentsInfo[i] != nil { - - if swag.IsZero(o.AgentsInfo[i]) { // not required - return nil - } - - if err := o.AgentsInfo[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("statusOk" + "." + "agents_info" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("statusOk" + "." + "agents_info" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -func (o *StatusOKBody) contextValidateServerInfo(ctx context.Context, formats strfmt.Registry) error { - if o.ServerInfo != nil { - - if swag.IsZero(o.ServerInfo) { // not required - return nil - } - - if err := o.ServerInfo.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("statusOk" + "." + "server_info") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("statusOk" + "." + "server_info") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *StatusOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *StatusOKBody) UnmarshalBinary(b []byte) error { - var res StatusOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -StatusOKBodyAgentsInfoItems0 AgentInfo contains information about Agent managed by pmm-agent. -swagger:model StatusOKBodyAgentsInfoItems0 -*/ -type StatusOKBodyAgentsInfoItems0 struct { - // agent id - AgentID string `json:"agent_id,omitempty"` - - // AgentType describes supported Agent types. - // 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"] - AgentType *string `json:"agent_type,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"` - - // The current listen port of this Agent (exporter or vmagent). - // Zero for other Agent types, or if unknown or not yet supported. - ListenPort int64 `json:"listen_port,omitempty"` - - // process exec path - ProcessExecPath string `json:"process_exec_path,omitempty"` -} - -// Validate validates this status OK body agents info items0 -func (o *StatusOKBodyAgentsInfoItems0) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateAgentType(formats); err != nil { - res = append(res, err) - } - - if err := o.validateStatus(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var statusOkBodyAgentsInfoItems0TypeAgentTypePropEnum []any - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["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"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - statusOkBodyAgentsInfoItems0TypeAgentTypePropEnum = append(statusOkBodyAgentsInfoItems0TypeAgentTypePropEnum, v) - } -} - -const ( - - // StatusOKBodyAgentsInfoItems0AgentTypeAGENTTYPEUNSPECIFIED captures enum value "AGENT_TYPE_UNSPECIFIED" - StatusOKBodyAgentsInfoItems0AgentTypeAGENTTYPEUNSPECIFIED string = "AGENT_TYPE_UNSPECIFIED" - - // StatusOKBodyAgentsInfoItems0AgentTypeAGENTTYPEPMMAGENT captures enum value "AGENT_TYPE_PMM_AGENT" - StatusOKBodyAgentsInfoItems0AgentTypeAGENTTYPEPMMAGENT string = "AGENT_TYPE_PMM_AGENT" - - // StatusOKBodyAgentsInfoItems0AgentTypeAGENTTYPEVMAGENT captures enum value "AGENT_TYPE_VM_AGENT" - StatusOKBodyAgentsInfoItems0AgentTypeAGENTTYPEVMAGENT string = "AGENT_TYPE_VM_AGENT" - - // StatusOKBodyAgentsInfoItems0AgentTypeAGENTTYPENODEEXPORTER captures enum value "AGENT_TYPE_NODE_EXPORTER" - StatusOKBodyAgentsInfoItems0AgentTypeAGENTTYPENODEEXPORTER string = "AGENT_TYPE_NODE_EXPORTER" - - // StatusOKBodyAgentsInfoItems0AgentTypeAGENTTYPEMYSQLDEXPORTER captures enum value "AGENT_TYPE_MYSQLD_EXPORTER" - StatusOKBodyAgentsInfoItems0AgentTypeAGENTTYPEMYSQLDEXPORTER string = "AGENT_TYPE_MYSQLD_EXPORTER" - - // StatusOKBodyAgentsInfoItems0AgentTypeAGENTTYPEMONGODBEXPORTER captures enum value "AGENT_TYPE_MONGODB_EXPORTER" - StatusOKBodyAgentsInfoItems0AgentTypeAGENTTYPEMONGODBEXPORTER string = "AGENT_TYPE_MONGODB_EXPORTER" - - // StatusOKBodyAgentsInfoItems0AgentTypeAGENTTYPEPOSTGRESEXPORTER captures enum value "AGENT_TYPE_POSTGRES_EXPORTER" - StatusOKBodyAgentsInfoItems0AgentTypeAGENTTYPEPOSTGRESEXPORTER string = "AGENT_TYPE_POSTGRES_EXPORTER" - - // StatusOKBodyAgentsInfoItems0AgentTypeAGENTTYPEPROXYSQLEXPORTER captures enum value "AGENT_TYPE_PROXYSQL_EXPORTER" - StatusOKBodyAgentsInfoItems0AgentTypeAGENTTYPEPROXYSQLEXPORTER string = "AGENT_TYPE_PROXYSQL_EXPORTER" - - // StatusOKBodyAgentsInfoItems0AgentTypeAGENTTYPEVALKEYEXPORTER captures enum value "AGENT_TYPE_VALKEY_EXPORTER" - StatusOKBodyAgentsInfoItems0AgentTypeAGENTTYPEVALKEYEXPORTER string = "AGENT_TYPE_VALKEY_EXPORTER" - - // StatusOKBodyAgentsInfoItems0AgentTypeAGENTTYPEQANMYSQLPERFSCHEMAAGENT captures enum value "AGENT_TYPE_QAN_MYSQL_PERFSCHEMA_AGENT" - StatusOKBodyAgentsInfoItems0AgentTypeAGENTTYPEQANMYSQLPERFSCHEMAAGENT string = "AGENT_TYPE_QAN_MYSQL_PERFSCHEMA_AGENT" - - // StatusOKBodyAgentsInfoItems0AgentTypeAGENTTYPEQANMYSQLSLOWLOGAGENT captures enum value "AGENT_TYPE_QAN_MYSQL_SLOWLOG_AGENT" - StatusOKBodyAgentsInfoItems0AgentTypeAGENTTYPEQANMYSQLSLOWLOGAGENT string = "AGENT_TYPE_QAN_MYSQL_SLOWLOG_AGENT" - - // StatusOKBodyAgentsInfoItems0AgentTypeAGENTTYPEQANMONGODBPROFILERAGENT captures enum value "AGENT_TYPE_QAN_MONGODB_PROFILER_AGENT" - StatusOKBodyAgentsInfoItems0AgentTypeAGENTTYPEQANMONGODBPROFILERAGENT string = "AGENT_TYPE_QAN_MONGODB_PROFILER_AGENT" - - // StatusOKBodyAgentsInfoItems0AgentTypeAGENTTYPEQANMONGODBMONGOLOGAGENT captures enum value "AGENT_TYPE_QAN_MONGODB_MONGOLOG_AGENT" - StatusOKBodyAgentsInfoItems0AgentTypeAGENTTYPEQANMONGODBMONGOLOGAGENT string = "AGENT_TYPE_QAN_MONGODB_MONGOLOG_AGENT" - - // StatusOKBodyAgentsInfoItems0AgentTypeAGENTTYPEQANPOSTGRESQLPGSTATEMENTSAGENT captures enum value "AGENT_TYPE_QAN_POSTGRESQL_PGSTATEMENTS_AGENT" - StatusOKBodyAgentsInfoItems0AgentTypeAGENTTYPEQANPOSTGRESQLPGSTATEMENTSAGENT string = "AGENT_TYPE_QAN_POSTGRESQL_PGSTATEMENTS_AGENT" - - // StatusOKBodyAgentsInfoItems0AgentTypeAGENTTYPEQANPOSTGRESQLPGSTATMONITORAGENT captures enum value "AGENT_TYPE_QAN_POSTGRESQL_PGSTATMONITOR_AGENT" - StatusOKBodyAgentsInfoItems0AgentTypeAGENTTYPEQANPOSTGRESQLPGSTATMONITORAGENT string = "AGENT_TYPE_QAN_POSTGRESQL_PGSTATMONITOR_AGENT" - - // StatusOKBodyAgentsInfoItems0AgentTypeAGENTTYPEEXTERNALEXPORTER captures enum value "AGENT_TYPE_EXTERNAL_EXPORTER" - StatusOKBodyAgentsInfoItems0AgentTypeAGENTTYPEEXTERNALEXPORTER string = "AGENT_TYPE_EXTERNAL_EXPORTER" - - // StatusOKBodyAgentsInfoItems0AgentTypeAGENTTYPERDSEXPORTER captures enum value "AGENT_TYPE_RDS_EXPORTER" - StatusOKBodyAgentsInfoItems0AgentTypeAGENTTYPERDSEXPORTER string = "AGENT_TYPE_RDS_EXPORTER" - - // StatusOKBodyAgentsInfoItems0AgentTypeAGENTTYPEAZUREDATABASEEXPORTER captures enum value "AGENT_TYPE_AZURE_DATABASE_EXPORTER" - StatusOKBodyAgentsInfoItems0AgentTypeAGENTTYPEAZUREDATABASEEXPORTER string = "AGENT_TYPE_AZURE_DATABASE_EXPORTER" - - // StatusOKBodyAgentsInfoItems0AgentTypeAGENTTYPENOMADAGENT captures enum value "AGENT_TYPE_NOMAD_AGENT" - StatusOKBodyAgentsInfoItems0AgentTypeAGENTTYPENOMADAGENT string = "AGENT_TYPE_NOMAD_AGENT" -) - -// prop value enum -func (o *StatusOKBodyAgentsInfoItems0) validateAgentTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, statusOkBodyAgentsInfoItems0TypeAgentTypePropEnum, true); err != nil { - return err - } - return nil -} - -func (o *StatusOKBodyAgentsInfoItems0) validateAgentType(formats strfmt.Registry) error { - if swag.IsZero(o.AgentType) { // not required - return nil - } - - // value enum - if err := o.validateAgentTypeEnum("agent_type", "body", *o.AgentType); err != nil { - return err - } - - return nil -} - -var statusOkBodyAgentsInfoItems0TypeStatusPropEnum []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 { - statusOkBodyAgentsInfoItems0TypeStatusPropEnum = append(statusOkBodyAgentsInfoItems0TypeStatusPropEnum, v) - } -} - -const ( - - // StatusOKBodyAgentsInfoItems0StatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - StatusOKBodyAgentsInfoItems0StatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // StatusOKBodyAgentsInfoItems0StatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - StatusOKBodyAgentsInfoItems0StatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // StatusOKBodyAgentsInfoItems0StatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - StatusOKBodyAgentsInfoItems0StatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - - // StatusOKBodyAgentsInfoItems0StatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - StatusOKBodyAgentsInfoItems0StatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - - // StatusOKBodyAgentsInfoItems0StatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - StatusOKBodyAgentsInfoItems0StatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - - // StatusOKBodyAgentsInfoItems0StatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - StatusOKBodyAgentsInfoItems0StatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" - - // StatusOKBodyAgentsInfoItems0StatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - StatusOKBodyAgentsInfoItems0StatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" - - // StatusOKBodyAgentsInfoItems0StatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - StatusOKBodyAgentsInfoItems0StatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" -) - -// prop value enum -func (o *StatusOKBodyAgentsInfoItems0) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, statusOkBodyAgentsInfoItems0TypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *StatusOKBodyAgentsInfoItems0) 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 validates this status OK body agents info items0 based on context it is used -func (o *StatusOKBodyAgentsInfoItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *StatusOKBodyAgentsInfoItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *StatusOKBodyAgentsInfoItems0) UnmarshalBinary(b []byte) error { - var res StatusOKBodyAgentsInfoItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -StatusOKBodyServerInfo ServerInfo contains information about the PMM Server. -swagger:model StatusOKBodyServerInfo -*/ -type StatusOKBodyServerInfo struct { - // PMM Server URL in a form https://HOST:PORT/. - URL string `json:"url,omitempty"` - - // PMM Server's TLS certificate validation should be skipped if true. - InsecureTLS bool `json:"insecure_tls,omitempty"` - - // True if pmm-agent is currently connected to the server. - Connected bool `json:"connected,omitempty"` - - // PMM Server version (if agent is connected). - Version string `json:"version,omitempty"` - - // Ping time from pmm-agent to pmm-managed (if agent is connected). - Latency string `json:"latency,omitempty"` - - // Clock drift from PMM Server (if agent is connected). - ClockDrift string `json:"clock_drift,omitempty"` -} - -// Validate validates this status OK body server info -func (o *StatusOKBodyServerInfo) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this status OK body server info based on context it is used -func (o *StatusOKBodyServerInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *StatusOKBodyServerInfo) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *StatusOKBodyServerInfo) UnmarshalBinary(b []byte) error { - var res StatusOKBodyServerInfo - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/agentlocal/v1/json/client/pmm_agent_local_api_client.go b/api/agentlocal/v1/json/client/pmm_agent_local_api_client.go deleted file mode 100644 index 4a4e02330ad..00000000000 --- a/api/agentlocal/v1/json/client/pmm_agent_local_api_client.go +++ /dev/null @@ -1,112 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package client - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/percona/pmm/api/agentlocal/v1/json/client/agent_local_service" -) - -// Default PMM agent local API HTTP client. -var Default = NewHTTPClient(nil) - -const ( - // DefaultHost is the default Host - // found in Meta (info) section of spec file - DefaultHost string = "127.0.0.1:7777" - // DefaultBasePath is the default BasePath - // found in Meta (info) section of spec file - DefaultBasePath string = "/" -) - -// DefaultSchemes are the default schemes found in Meta (info) section of spec file -var DefaultSchemes = []string{"http"} - -// NewHTTPClient creates a new PMM agent local API HTTP client. -func NewHTTPClient(formats strfmt.Registry) *PMMAgentLocalAPI { - return NewHTTPClientWithConfig(formats, nil) -} - -// NewHTTPClientWithConfig creates a new PMM agent local API HTTP client, -// using a customizable transport config. -func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *PMMAgentLocalAPI { - // ensure nullable parameters have default - if cfg == nil { - cfg = DefaultTransportConfig() - } - - // create transport and client - transport := httptransport.New(cfg.Host, cfg.BasePath, cfg.Schemes) - return New(transport, formats) -} - -// New creates a new PMM agent local API client -func New(transport runtime.ClientTransport, formats strfmt.Registry) *PMMAgentLocalAPI { - // ensure nullable parameters have default - if formats == nil { - formats = strfmt.Default - } - - cli := new(PMMAgentLocalAPI) - cli.Transport = transport - cli.AgentLocalService = agent_local_service.New(transport, formats) - return cli -} - -// DefaultTransportConfig creates a TransportConfig with the -// default settings taken from the meta section of the spec file. -func DefaultTransportConfig() *TransportConfig { - return &TransportConfig{ - Host: DefaultHost, - BasePath: DefaultBasePath, - Schemes: DefaultSchemes, - } -} - -// TransportConfig contains the transport related info, -// found in the meta section of the spec file. -type TransportConfig struct { - Host string - BasePath string - Schemes []string -} - -// WithHost overrides the default host, -// provided by the meta section of the spec file. -func (cfg *TransportConfig) WithHost(host string) *TransportConfig { - cfg.Host = host - return cfg -} - -// WithBasePath overrides the default basePath, -// provided by the meta section of the spec file. -func (cfg *TransportConfig) WithBasePath(basePath string) *TransportConfig { - cfg.BasePath = basePath - return cfg -} - -// WithSchemes overrides the default schemes, -// provided by the meta section of the spec file. -func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig { - cfg.Schemes = schemes - return cfg -} - -// PMMAgentLocalAPI is a client for PMM agent local API -type PMMAgentLocalAPI struct { - AgentLocalService agent_local_service.ClientService - - Transport runtime.ClientTransport -} - -// SetTransport changes the transport on the client and all its subresources -func (c *PMMAgentLocalAPI) SetTransport(transport runtime.ClientTransport) { - c.Transport = transport - c.AgentLocalService.SetTransport(transport) -} diff --git a/api/agentlocal/v1/json/v1.json b/api/agentlocal/v1/json/v1.json deleted file mode 100644 index 3521a5f59a7..00000000000 --- a/api/agentlocal/v1/json/v1.json +++ /dev/null @@ -1,472 +0,0 @@ -{ - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "schemes": [ - "http" - ], - "swagger": "2.0", - "info": { - "title": "PMM Agent Local API", - "version": "stable" - }, - "host": "127.0.0.1:7777", - "paths": { - "/local/Reload": { - "post": { - "tags": [ - "AgentLocalService" - ], - "summary": "Reload reloads pmm-agent configuration.", - "operationId": "Reload", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object" - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "description": "ReloadRequest may not be received by the client due to pmm-agent restart.", - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/local/Status": { - "get": { - "tags": [ - "AgentLocalService" - ], - "summary": "Status returns current pmm-agent status.", - "operationId": "Status2", - "parameters": [ - { - "type": "boolean", - "description": "Returns network info (latency and clock_drift) if true.", - "name": "get_network_info", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "agent_id": { - "type": "string", - "x-order": 0 - }, - "runs_on_node_id": { - "type": "string", - "title": "TODO: rename to node_id", - "x-order": 1 - }, - "node_name": { - "type": "string", - "x-order": 2 - }, - "server_info": { - "description": "ServerInfo contains information about the PMM Server.", - "type": "object", - "properties": { - "url": { - "description": "PMM Server URL in a form https://HOST:PORT/.", - "type": "string", - "x-order": 0 - }, - "insecure_tls": { - "description": "PMM Server's TLS certificate validation should be skipped if true.", - "type": "boolean", - "x-order": 1 - }, - "connected": { - "description": "True if pmm-agent is currently connected to the server.", - "type": "boolean", - "x-order": 2 - }, - "version": { - "description": "PMM Server version (if agent is connected).", - "type": "string", - "x-order": 3 - }, - "latency": { - "description": "Ping time from pmm-agent to pmm-managed (if agent is connected).", - "type": "string", - "x-order": 4 - }, - "clock_drift": { - "description": "Clock drift from PMM Server (if agent is connected).", - "type": "string", - "x-order": 5 - } - }, - "x-order": 3 - }, - "agents_info": { - "type": "array", - "items": { - "description": "AgentInfo contains information about Agent managed by pmm-agent.", - "type": "object", - "properties": { - "agent_id": { - "type": "string", - "x-order": 0 - }, - "agent_type": { - "description": "AgentType describes supported Agent types.", - "type": "string", - "default": "AGENT_TYPE_UNSPECIFIED", - "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" - ], - "x-order": 1 - }, - "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 - }, - "listen_port": { - "description": "The current listen port of this Agent (exporter or vmagent).\nZero for other Agent types, or if unknown or not yet supported.", - "type": "integer", - "format": "int64", - "x-order": 3 - }, - "process_exec_path": { - "type": "string", - "x-order": 4 - } - } - }, - "x-order": 4 - }, - "config_filepath": { - "description": "Config file path if pmm-agent was started with one.", - "type": "string", - "x-order": 5 - }, - "agent_version": { - "description": "PMM Agent version.", - "type": "string", - "x-order": 6 - }, - "connection_uptime": { - "type": "number", - "format": "float", - "title": "Shows connection uptime in percentage between agent and server", - "x-order": 7 - } - } - } - }, - "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 - } - } - } - } - } - }, - "post": { - "tags": [ - "AgentLocalService" - ], - "summary": "Status returns current pmm-agent status.", - "operationId": "Status", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "get_network_info": { - "description": "Returns network info (latency and clock_drift) if true.", - "type": "boolean", - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "agent_id": { - "type": "string", - "x-order": 0 - }, - "runs_on_node_id": { - "type": "string", - "title": "TODO: rename to node_id", - "x-order": 1 - }, - "node_name": { - "type": "string", - "x-order": 2 - }, - "server_info": { - "description": "ServerInfo contains information about the PMM Server.", - "type": "object", - "properties": { - "url": { - "description": "PMM Server URL in a form https://HOST:PORT/.", - "type": "string", - "x-order": 0 - }, - "insecure_tls": { - "description": "PMM Server's TLS certificate validation should be skipped if true.", - "type": "boolean", - "x-order": 1 - }, - "connected": { - "description": "True if pmm-agent is currently connected to the server.", - "type": "boolean", - "x-order": 2 - }, - "version": { - "description": "PMM Server version (if agent is connected).", - "type": "string", - "x-order": 3 - }, - "latency": { - "description": "Ping time from pmm-agent to pmm-managed (if agent is connected).", - "type": "string", - "x-order": 4 - }, - "clock_drift": { - "description": "Clock drift from PMM Server (if agent is connected).", - "type": "string", - "x-order": 5 - } - }, - "x-order": 3 - }, - "agents_info": { - "type": "array", - "items": { - "description": "AgentInfo contains information about Agent managed by pmm-agent.", - "type": "object", - "properties": { - "agent_id": { - "type": "string", - "x-order": 0 - }, - "agent_type": { - "description": "AgentType describes supported Agent types.", - "type": "string", - "default": "AGENT_TYPE_UNSPECIFIED", - "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" - ], - "x-order": 1 - }, - "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 - }, - "listen_port": { - "description": "The current listen port of this Agent (exporter or vmagent).\nZero for other Agent types, or if unknown or not yet supported.", - "type": "integer", - "format": "int64", - "x-order": 3 - }, - "process_exec_path": { - "type": "string", - "x-order": 4 - } - } - }, - "x-order": 4 - }, - "config_filepath": { - "description": "Config file path if pmm-agent was started with one.", - "type": "string", - "x-order": 5 - }, - "agent_version": { - "description": "PMM Agent version.", - "type": "string", - "x-order": 6 - }, - "connection_uptime": { - "type": "number", - "format": "float", - "title": "Shows connection uptime in percentage between agent and server", - "x-order": 7 - } - } - } - }, - "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 - } - } - } - } - } - } - } - }, - "tags": [ - { - "name": "AgentLocalService" - } - ] -} \ No newline at end of file diff --git a/api/alerting/v1/alerting.pb.go b/api/alerting/v1/alerting.pb.go deleted file mode 100644 index 54fb5a4fdb7..00000000000 --- a/api/alerting/v1/alerting.pb.go +++ /dev/null @@ -1,1540 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.10 -// protoc (unknown) -// source: alerting/v1/alerting.proto - -package alertingv1 - -import ( - reflect "reflect" - sync "sync" - unsafe "unsafe" - - _ "github.com/envoyproxy/protoc-gen-validate/validate" - _ "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" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// TemplateSource defines template source. -type TemplateSource int32 - -const ( - TemplateSource_TEMPLATE_SOURCE_UNSPECIFIED TemplateSource = 0 - // Template that is shipped with PMM Server releases. - TemplateSource_TEMPLATE_SOURCE_BUILT_IN TemplateSource = 1 - // Template that is downloaded from check.percona.com. - TemplateSource_TEMPLATE_SOURCE_SAAS TemplateSource = 2 - // Templated loaded from user-suplied file. - TemplateSource_TEMPLATE_SOURCE_USER_FILE TemplateSource = 3 - // Templated created via API. - TemplateSource_TEMPLATE_SOURCE_USER_API TemplateSource = 4 -) - -// Enum value maps for TemplateSource. -var ( - TemplateSource_name = map[int32]string{ - 0: "TEMPLATE_SOURCE_UNSPECIFIED", - 1: "TEMPLATE_SOURCE_BUILT_IN", - 2: "TEMPLATE_SOURCE_SAAS", - 3: "TEMPLATE_SOURCE_USER_FILE", - 4: "TEMPLATE_SOURCE_USER_API", - } - TemplateSource_value = map[string]int32{ - "TEMPLATE_SOURCE_UNSPECIFIED": 0, - "TEMPLATE_SOURCE_BUILT_IN": 1, - "TEMPLATE_SOURCE_SAAS": 2, - "TEMPLATE_SOURCE_USER_FILE": 3, - "TEMPLATE_SOURCE_USER_API": 4, - } -) - -func (x TemplateSource) Enum() *TemplateSource { - p := new(TemplateSource) - *p = x - return p -} - -func (x TemplateSource) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (TemplateSource) Descriptor() protoreflect.EnumDescriptor { - return file_alerting_v1_alerting_proto_enumTypes[0].Descriptor() -} - -func (TemplateSource) Type() protoreflect.EnumType { - return &file_alerting_v1_alerting_proto_enumTypes[0] -} - -func (x TemplateSource) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use TemplateSource.Descriptor instead. -func (TemplateSource) EnumDescriptor() ([]byte, []int) { - return file_alerting_v1_alerting_proto_rawDescGZIP(), []int{0} -} - -// FilterType represents filter matching type. -type FilterType int32 - -const ( - FilterType_FILTER_TYPE_UNSPECIFIED FilterType = 0 - FilterType_FILTER_TYPE_MATCH FilterType = 1 - FilterType_FILTER_TYPE_MISMATCH FilterType = 2 -) - -// Enum value maps for FilterType. -var ( - FilterType_name = map[int32]string{ - 0: "FILTER_TYPE_UNSPECIFIED", - 1: "FILTER_TYPE_MATCH", - 2: "FILTER_TYPE_MISMATCH", - } - FilterType_value = map[string]int32{ - "FILTER_TYPE_UNSPECIFIED": 0, - "FILTER_TYPE_MATCH": 1, - "FILTER_TYPE_MISMATCH": 2, - } -) - -func (x FilterType) Enum() *FilterType { - p := new(FilterType) - *p = x - return p -} - -func (x FilterType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (FilterType) Descriptor() protoreflect.EnumDescriptor { - return file_alerting_v1_alerting_proto_enumTypes[1].Descriptor() -} - -func (FilterType) Type() protoreflect.EnumType { - return &file_alerting_v1_alerting_proto_enumTypes[1] -} - -func (x FilterType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use FilterType.Descriptor instead. -func (FilterType) EnumDescriptor() ([]byte, []int) { - return file_alerting_v1_alerting_proto_rawDescGZIP(), []int{1} -} - -// BoolParamDefinition represents boolean parameter's default value. -type BoolParamDefinition struct { - state protoimpl.MessageState `protogen:"open.v1"` - Default *bool `protobuf:"varint,1,opt,name=default,proto3,oneof" json:"default,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *BoolParamDefinition) Reset() { - *x = BoolParamDefinition{} - mi := &file_alerting_v1_alerting_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *BoolParamDefinition) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*BoolParamDefinition) ProtoMessage() {} - -func (x *BoolParamDefinition) ProtoReflect() protoreflect.Message { - mi := &file_alerting_v1_alerting_proto_msgTypes[0] - 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 BoolParamDefinition.ProtoReflect.Descriptor instead. -func (*BoolParamDefinition) Descriptor() ([]byte, []int) { - return file_alerting_v1_alerting_proto_rawDescGZIP(), []int{0} -} - -func (x *BoolParamDefinition) GetDefault() bool { - if x != nil && x.Default != nil { - return *x.Default - } - return false -} - -// FloatParamDefinition represents float parameter's default value and valid range. -type FloatParamDefinition struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Default value. - Default *float64 `protobuf:"fixed64,1,opt,name=default,proto3,oneof" json:"default,omitempty"` - // Minimum valid value (inclusive). - Min *float64 `protobuf:"fixed64,2,opt,name=min,proto3,oneof" json:"min,omitempty"` - // Maximum valid value (inclusive). - Max *float64 `protobuf:"fixed64,3,opt,name=max,proto3,oneof" json:"max,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *FloatParamDefinition) Reset() { - *x = FloatParamDefinition{} - mi := &file_alerting_v1_alerting_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *FloatParamDefinition) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FloatParamDefinition) ProtoMessage() {} - -func (x *FloatParamDefinition) ProtoReflect() protoreflect.Message { - mi := &file_alerting_v1_alerting_proto_msgTypes[1] - 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 FloatParamDefinition.ProtoReflect.Descriptor instead. -func (*FloatParamDefinition) Descriptor() ([]byte, []int) { - return file_alerting_v1_alerting_proto_rawDescGZIP(), []int{1} -} - -func (x *FloatParamDefinition) GetDefault() float64 { - if x != nil && x.Default != nil { - return *x.Default - } - return 0 -} - -func (x *FloatParamDefinition) GetMin() float64 { - if x != nil && x.Min != nil { - return *x.Min - } - return 0 -} - -func (x *FloatParamDefinition) GetMax() float64 { - if x != nil && x.Max != nil { - return *x.Max - } - return 0 -} - -// StringParamDefinition represents string parameter's default value. -type StringParamDefinition struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Default value. - Default *string `protobuf:"bytes,1,opt,name=default,proto3,oneof" json:"default,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StringParamDefinition) Reset() { - *x = StringParamDefinition{} - mi := &file_alerting_v1_alerting_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StringParamDefinition) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StringParamDefinition) ProtoMessage() {} - -func (x *StringParamDefinition) ProtoReflect() protoreflect.Message { - mi := &file_alerting_v1_alerting_proto_msgTypes[2] - 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 StringParamDefinition.ProtoReflect.Descriptor instead. -func (*StringParamDefinition) Descriptor() ([]byte, []int) { - return file_alerting_v1_alerting_proto_rawDescGZIP(), []int{2} -} - -func (x *StringParamDefinition) GetDefault() string { - if x != nil && x.Default != nil { - return *x.Default - } - return "" -} - -// ParamDefinition represents a single query parameter. -type ParamDefinition struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Machine-readable name (ID) that is used in expression. - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // Short human-readable parameter summary. - Summary string `protobuf:"bytes,2,opt,name=summary,proto3" json:"summary,omitempty"` - // Parameter unit. TODO: remove this parameter. - Unit ParamUnit `protobuf:"varint,3,opt,name=unit,proto3,enum=alerting.v1.ParamUnit" json:"unit,omitempty"` - // Parameter type. - Type ParamType `protobuf:"varint,4,opt,name=type,proto3,enum=alerting.v1.ParamType" json:"type,omitempty"` - // Parameter value. - // - // Types that are valid to be assigned to Value: - // - // *ParamDefinition_Bool - // *ParamDefinition_Float - // *ParamDefinition_String_ - Value isParamDefinition_Value `protobuf_oneof:"value"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ParamDefinition) Reset() { - *x = ParamDefinition{} - mi := &file_alerting_v1_alerting_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ParamDefinition) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ParamDefinition) ProtoMessage() {} - -func (x *ParamDefinition) ProtoReflect() protoreflect.Message { - mi := &file_alerting_v1_alerting_proto_msgTypes[3] - 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 ParamDefinition.ProtoReflect.Descriptor instead. -func (*ParamDefinition) Descriptor() ([]byte, []int) { - return file_alerting_v1_alerting_proto_rawDescGZIP(), []int{3} -} - -func (x *ParamDefinition) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *ParamDefinition) GetSummary() string { - if x != nil { - return x.Summary - } - return "" -} - -func (x *ParamDefinition) GetUnit() ParamUnit { - if x != nil { - return x.Unit - } - return ParamUnit_PARAM_UNIT_UNSPECIFIED -} - -func (x *ParamDefinition) GetType() ParamType { - if x != nil { - return x.Type - } - return ParamType_PARAM_TYPE_UNSPECIFIED -} - -func (x *ParamDefinition) GetValue() isParamDefinition_Value { - if x != nil { - return x.Value - } - return nil -} - -func (x *ParamDefinition) GetBool() *BoolParamDefinition { - if x != nil { - if x, ok := x.Value.(*ParamDefinition_Bool); ok { - return x.Bool - } - } - return nil -} - -func (x *ParamDefinition) GetFloat() *FloatParamDefinition { - if x != nil { - if x, ok := x.Value.(*ParamDefinition_Float); ok { - return x.Float - } - } - return nil -} - -func (x *ParamDefinition) GetString_() *StringParamDefinition { - if x != nil { - if x, ok := x.Value.(*ParamDefinition_String_); ok { - return x.String_ - } - } - return nil -} - -type isParamDefinition_Value interface { - isParamDefinition_Value() -} - -type ParamDefinition_Bool struct { - // Bool value. - Bool *BoolParamDefinition `protobuf:"bytes,5,opt,name=bool,proto3,oneof"` -} - -type ParamDefinition_Float struct { - // Float value. - Float *FloatParamDefinition `protobuf:"bytes,6,opt,name=float,proto3,oneof"` -} - -type ParamDefinition_String_ struct { - // String value. - String_ *StringParamDefinition `protobuf:"bytes,7,opt,name=string,proto3,oneof"` -} - -func (*ParamDefinition_Bool) isParamDefinition_Value() {} - -func (*ParamDefinition_Float) isParamDefinition_Value() {} - -func (*ParamDefinition_String_) isParamDefinition_Value() {} - -// Template represents Alert Template that is used to create Alert Rule. -type Template struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Machine-readable name (ID). - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // Short human-readable summary. - Summary string `protobuf:"bytes,2,opt,name=summary,proto3" json:"summary,omitempty"` - // PromQL query expression with templating parameters. - Expr string `protobuf:"bytes,3,opt,name=expr,proto3" json:"expr,omitempty"` - // Query parameters definitions. - Params []*ParamDefinition `protobuf:"bytes,4,rep,name=params,proto3" json:"params,omitempty"` - // Default duration value. - For *durationpb.Duration `protobuf:"bytes,5,opt,name=for,proto3" json:"for,omitempty"` - // Severity. - Severity v1.Severity `protobuf:"varint,6,opt,name=severity,proto3,enum=management.v1.Severity" json:"severity,omitempty"` - // Labels. - Labels map[string]string `protobuf:"bytes,7,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - // Annotations. - Annotations map[string]string `protobuf:"bytes,8,rep,name=annotations,proto3" json:"annotations,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - // Template source. Only templates created via API can be updated or deleted via API. - Source TemplateSource `protobuf:"varint,9,opt,name=source,proto3,enum=alerting.v1.TemplateSource" json:"source,omitempty"` - // Template creation time. Empty for built-in and SaaS templates. - CreatedAt *timestamppb.Timestamp `protobuf:"bytes,10,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` - // YAML template file content. Empty for built-in and SaaS templates. - Yaml string `protobuf:"bytes,11,opt,name=yaml,proto3" json:"yaml,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Template) Reset() { - *x = Template{} - mi := &file_alerting_v1_alerting_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Template) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Template) ProtoMessage() {} - -func (x *Template) ProtoReflect() protoreflect.Message { - mi := &file_alerting_v1_alerting_proto_msgTypes[4] - 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 Template.ProtoReflect.Descriptor instead. -func (*Template) Descriptor() ([]byte, []int) { - return file_alerting_v1_alerting_proto_rawDescGZIP(), []int{4} -} - -func (x *Template) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *Template) GetSummary() string { - if x != nil { - return x.Summary - } - return "" -} - -func (x *Template) GetExpr() string { - if x != nil { - return x.Expr - } - return "" -} - -func (x *Template) GetParams() []*ParamDefinition { - if x != nil { - return x.Params - } - return nil -} - -func (x *Template) GetFor() *durationpb.Duration { - if x != nil { - return x.For - } - return nil -} - -func (x *Template) GetSeverity() v1.Severity { - if x != nil { - return x.Severity - } - return v1.Severity(0) -} - -func (x *Template) GetLabels() map[string]string { - if x != nil { - return x.Labels - } - return nil -} - -func (x *Template) GetAnnotations() map[string]string { - if x != nil { - return x.Annotations - } - return nil -} - -func (x *Template) GetSource() TemplateSource { - if x != nil { - return x.Source - } - return TemplateSource_TEMPLATE_SOURCE_UNSPECIFIED -} - -func (x *Template) GetCreatedAt() *timestamppb.Timestamp { - if x != nil { - return x.CreatedAt - } - return nil -} - -func (x *Template) GetYaml() string { - if x != nil { - return x.Yaml - } - return "" -} - -type ListTemplatesRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Maximum number of results per page. - PageSize *int32 `protobuf:"varint,1,opt,name=page_size,json=pageSize,proto3,oneof" json:"page_size,omitempty"` - // Index of the requested page, starts from 0. - PageIndex *int32 `protobuf:"varint,2,opt,name=page_index,json=pageIndex,proto3,oneof" json:"page_index,omitempty"` - // If true, template files will be re-read from disk. - Reload bool `protobuf:"varint,3,opt,name=reload,proto3" json:"reload,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ListTemplatesRequest) Reset() { - *x = ListTemplatesRequest{} - mi := &file_alerting_v1_alerting_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ListTemplatesRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListTemplatesRequest) ProtoMessage() {} - -func (x *ListTemplatesRequest) ProtoReflect() protoreflect.Message { - mi := &file_alerting_v1_alerting_proto_msgTypes[5] - 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 ListTemplatesRequest.ProtoReflect.Descriptor instead. -func (*ListTemplatesRequest) Descriptor() ([]byte, []int) { - return file_alerting_v1_alerting_proto_rawDescGZIP(), []int{5} -} - -func (x *ListTemplatesRequest) GetPageSize() int32 { - if x != nil && x.PageSize != nil { - return *x.PageSize - } - return 0 -} - -func (x *ListTemplatesRequest) GetPageIndex() int32 { - if x != nil && x.PageIndex != nil { - return *x.PageIndex - } - return 0 -} - -func (x *ListTemplatesRequest) GetReload() bool { - if x != nil { - return x.Reload - } - return false -} - -type ListTemplatesResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Total number of results. - TotalItems int32 `protobuf:"varint,1,opt,name=total_items,json=totalItems,proto3" json:"total_items,omitempty"` - // Total number of pages. - TotalPages int32 `protobuf:"varint,2,opt,name=total_pages,json=totalPages,proto3" json:"total_pages,omitempty"` - // Alerting templates. - Templates []*Template `protobuf:"bytes,3,rep,name=templates,proto3" json:"templates,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ListTemplatesResponse) Reset() { - *x = ListTemplatesResponse{} - mi := &file_alerting_v1_alerting_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ListTemplatesResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListTemplatesResponse) ProtoMessage() {} - -func (x *ListTemplatesResponse) ProtoReflect() protoreflect.Message { - mi := &file_alerting_v1_alerting_proto_msgTypes[6] - 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 ListTemplatesResponse.ProtoReflect.Descriptor instead. -func (*ListTemplatesResponse) Descriptor() ([]byte, []int) { - return file_alerting_v1_alerting_proto_rawDescGZIP(), []int{6} -} - -func (x *ListTemplatesResponse) GetTotalItems() int32 { - if x != nil { - return x.TotalItems - } - return 0 -} - -func (x *ListTemplatesResponse) GetTotalPages() int32 { - if x != nil { - return x.TotalPages - } - return 0 -} - -func (x *ListTemplatesResponse) GetTemplates() []*Template { - if x != nil { - return x.Templates - } - return nil -} - -type CreateTemplateRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // YAML template file content. - Yaml string `protobuf:"bytes,1,opt,name=yaml,proto3" json:"yaml,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CreateTemplateRequest) Reset() { - *x = CreateTemplateRequest{} - mi := &file_alerting_v1_alerting_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CreateTemplateRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateTemplateRequest) ProtoMessage() {} - -func (x *CreateTemplateRequest) ProtoReflect() protoreflect.Message { - mi := &file_alerting_v1_alerting_proto_msgTypes[7] - 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 CreateTemplateRequest.ProtoReflect.Descriptor instead. -func (*CreateTemplateRequest) Descriptor() ([]byte, []int) { - return file_alerting_v1_alerting_proto_rawDescGZIP(), []int{7} -} - -func (x *CreateTemplateRequest) GetYaml() string { - if x != nil { - return x.Yaml - } - return "" -} - -type CreateTemplateResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CreateTemplateResponse) Reset() { - *x = CreateTemplateResponse{} - mi := &file_alerting_v1_alerting_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CreateTemplateResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateTemplateResponse) ProtoMessage() {} - -func (x *CreateTemplateResponse) ProtoReflect() protoreflect.Message { - mi := &file_alerting_v1_alerting_proto_msgTypes[8] - 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 CreateTemplateResponse.ProtoReflect.Descriptor instead. -func (*CreateTemplateResponse) Descriptor() ([]byte, []int) { - return file_alerting_v1_alerting_proto_rawDescGZIP(), []int{8} -} - -type UpdateTemplateRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Machine-readable name (ID). - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // YAML template file content. - Yaml string `protobuf:"bytes,2,opt,name=yaml,proto3" json:"yaml,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *UpdateTemplateRequest) Reset() { - *x = UpdateTemplateRequest{} - mi := &file_alerting_v1_alerting_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *UpdateTemplateRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateTemplateRequest) ProtoMessage() {} - -func (x *UpdateTemplateRequest) ProtoReflect() protoreflect.Message { - mi := &file_alerting_v1_alerting_proto_msgTypes[9] - 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 UpdateTemplateRequest.ProtoReflect.Descriptor instead. -func (*UpdateTemplateRequest) Descriptor() ([]byte, []int) { - return file_alerting_v1_alerting_proto_rawDescGZIP(), []int{9} -} - -func (x *UpdateTemplateRequest) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *UpdateTemplateRequest) GetYaml() string { - if x != nil { - return x.Yaml - } - return "" -} - -type UpdateTemplateResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *UpdateTemplateResponse) Reset() { - *x = UpdateTemplateResponse{} - mi := &file_alerting_v1_alerting_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *UpdateTemplateResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateTemplateResponse) ProtoMessage() {} - -func (x *UpdateTemplateResponse) ProtoReflect() protoreflect.Message { - mi := &file_alerting_v1_alerting_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 UpdateTemplateResponse.ProtoReflect.Descriptor instead. -func (*UpdateTemplateResponse) Descriptor() ([]byte, []int) { - return file_alerting_v1_alerting_proto_rawDescGZIP(), []int{10} -} - -type DeleteTemplateRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DeleteTemplateRequest) Reset() { - *x = DeleteTemplateRequest{} - mi := &file_alerting_v1_alerting_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DeleteTemplateRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteTemplateRequest) ProtoMessage() {} - -func (x *DeleteTemplateRequest) ProtoReflect() protoreflect.Message { - mi := &file_alerting_v1_alerting_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 DeleteTemplateRequest.ProtoReflect.Descriptor instead. -func (*DeleteTemplateRequest) Descriptor() ([]byte, []int) { - return file_alerting_v1_alerting_proto_rawDescGZIP(), []int{11} -} - -func (x *DeleteTemplateRequest) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -type DeleteTemplateResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DeleteTemplateResponse) Reset() { - *x = DeleteTemplateResponse{} - mi := &file_alerting_v1_alerting_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DeleteTemplateResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteTemplateResponse) ProtoMessage() {} - -func (x *DeleteTemplateResponse) ProtoReflect() protoreflect.Message { - mi := &file_alerting_v1_alerting_proto_msgTypes[12] - 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 DeleteTemplateResponse.ProtoReflect.Descriptor instead. -func (*DeleteTemplateResponse) Descriptor() ([]byte, []int) { - return file_alerting_v1_alerting_proto_rawDescGZIP(), []int{12} -} - -// Filter represents a single filter condition. -type Filter struct { - state protoimpl.MessageState `protogen:"open.v1"` - Type FilterType `protobuf:"varint,1,opt,name=type,proto3,enum=alerting.v1.FilterType" json:"type,omitempty"` - Label string `protobuf:"bytes,2,opt,name=label,proto3" json:"label,omitempty"` - Regexp string `protobuf:"bytes,3,opt,name=regexp,proto3" json:"regexp,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Filter) Reset() { - *x = Filter{} - mi := &file_alerting_v1_alerting_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Filter) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Filter) ProtoMessage() {} - -func (x *Filter) ProtoReflect() protoreflect.Message { - mi := &file_alerting_v1_alerting_proto_msgTypes[13] - 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 Filter.ProtoReflect.Descriptor instead. -func (*Filter) Descriptor() ([]byte, []int) { - return file_alerting_v1_alerting_proto_rawDescGZIP(), []int{13} -} - -func (x *Filter) GetType() FilterType { - if x != nil { - return x.Type - } - return FilterType_FILTER_TYPE_UNSPECIFIED -} - -func (x *Filter) GetLabel() string { - if x != nil { - return x.Label - } - return "" -} - -func (x *Filter) GetRegexp() string { - if x != nil { - return x.Regexp - } - return "" -} - -// ParamValue represents a single rule parameter value. -type ParamValue struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Machine-readable name (ID) that is used in expression. - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // Parameter type. - Type ParamType `protobuf:"varint,2,opt,name=type,proto3,enum=alerting.v1.ParamType" json:"type,omitempty"` - // Parameter value. - // - // Types that are valid to be assigned to Value: - // - // *ParamValue_Bool - // *ParamValue_Float - // *ParamValue_String_ - Value isParamValue_Value `protobuf_oneof:"value"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ParamValue) Reset() { - *x = ParamValue{} - mi := &file_alerting_v1_alerting_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ParamValue) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ParamValue) ProtoMessage() {} - -func (x *ParamValue) ProtoReflect() protoreflect.Message { - mi := &file_alerting_v1_alerting_proto_msgTypes[14] - 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 ParamValue.ProtoReflect.Descriptor instead. -func (*ParamValue) Descriptor() ([]byte, []int) { - return file_alerting_v1_alerting_proto_rawDescGZIP(), []int{14} -} - -func (x *ParamValue) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *ParamValue) GetType() ParamType { - if x != nil { - return x.Type - } - return ParamType_PARAM_TYPE_UNSPECIFIED -} - -func (x *ParamValue) GetValue() isParamValue_Value { - if x != nil { - return x.Value - } - return nil -} - -func (x *ParamValue) GetBool() bool { - if x != nil { - if x, ok := x.Value.(*ParamValue_Bool); ok { - return x.Bool - } - } - return false -} - -func (x *ParamValue) GetFloat() float64 { - if x != nil { - if x, ok := x.Value.(*ParamValue_Float); ok { - return x.Float - } - } - return 0 -} - -func (x *ParamValue) GetString_() string { - if x != nil { - if x, ok := x.Value.(*ParamValue_String_); ok { - return x.String_ - } - } - return "" -} - -type isParamValue_Value interface { - isParamValue_Value() -} - -type ParamValue_Bool struct { - // Bool value. - Bool bool `protobuf:"varint,3,opt,name=bool,proto3,oneof"` -} - -type ParamValue_Float struct { - // Float value. - Float float64 `protobuf:"fixed64,4,opt,name=float,proto3,oneof"` -} - -type ParamValue_String_ struct { - // String value. - String_ string `protobuf:"bytes,5,opt,name=string,proto3,oneof"` -} - -func (*ParamValue_Bool) isParamValue_Value() {} - -func (*ParamValue_Float) isParamValue_Value() {} - -func (*ParamValue_String_) isParamValue_Value() {} - -type CreateRuleRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Template name. - TemplateName string `protobuf:"bytes,1,opt,name=template_name,json=templateName,proto3" json:"template_name,omitempty"` - // Rule name. - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - // Rule group name. - Group string `protobuf:"bytes,3,opt,name=group,proto3" json:"group,omitempty"` - // Folder UID. - FolderUid string `protobuf:"bytes,4,opt,name=folder_uid,json=folderUid,proto3" json:"folder_uid,omitempty"` - // Rule parameters. All template parameters should be set. - Params []*ParamValue `protobuf:"bytes,5,rep,name=params,proto3" json:"params,omitempty"` - // Rule duration. Should be set. - For *durationpb.Duration `protobuf:"bytes,6,opt,name=for,proto3" json:"for,omitempty"` - // Rule severity. Should be set. - Severity v1.Severity `protobuf:"varint,7,opt,name=severity,proto3,enum=management.v1.Severity" json:"severity,omitempty"` - // All custom labels to add or remove (with empty values) to default labels from template. - CustomLabels map[string]string `protobuf:"bytes,8,rep,name=custom_labels,json=customLabels,proto3" json:"custom_labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - // Filters. - Filters []*Filter `protobuf:"bytes,9,rep,name=filters,proto3" json:"filters,omitempty"` - // Evaluation Interval - Interval *durationpb.Duration `protobuf:"bytes,10,opt,name=interval,proto3" json:"interval,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CreateRuleRequest) Reset() { - *x = CreateRuleRequest{} - mi := &file_alerting_v1_alerting_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CreateRuleRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateRuleRequest) ProtoMessage() {} - -func (x *CreateRuleRequest) ProtoReflect() protoreflect.Message { - mi := &file_alerting_v1_alerting_proto_msgTypes[15] - 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 CreateRuleRequest.ProtoReflect.Descriptor instead. -func (*CreateRuleRequest) Descriptor() ([]byte, []int) { - return file_alerting_v1_alerting_proto_rawDescGZIP(), []int{15} -} - -func (x *CreateRuleRequest) GetTemplateName() string { - if x != nil { - return x.TemplateName - } - return "" -} - -func (x *CreateRuleRequest) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *CreateRuleRequest) GetGroup() string { - if x != nil { - return x.Group - } - return "" -} - -func (x *CreateRuleRequest) GetFolderUid() string { - if x != nil { - return x.FolderUid - } - return "" -} - -func (x *CreateRuleRequest) GetParams() []*ParamValue { - if x != nil { - return x.Params - } - return nil -} - -func (x *CreateRuleRequest) GetFor() *durationpb.Duration { - if x != nil { - return x.For - } - return nil -} - -func (x *CreateRuleRequest) GetSeverity() v1.Severity { - if x != nil { - return x.Severity - } - return v1.Severity(0) -} - -func (x *CreateRuleRequest) GetCustomLabels() map[string]string { - if x != nil { - return x.CustomLabels - } - return nil -} - -func (x *CreateRuleRequest) GetFilters() []*Filter { - if x != nil { - return x.Filters - } - return nil -} - -func (x *CreateRuleRequest) GetInterval() *durationpb.Duration { - if x != nil { - return x.Interval - } - return nil -} - -type CreateRuleResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CreateRuleResponse) Reset() { - *x = CreateRuleResponse{} - mi := &file_alerting_v1_alerting_proto_msgTypes[16] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CreateRuleResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateRuleResponse) ProtoMessage() {} - -func (x *CreateRuleResponse) ProtoReflect() protoreflect.Message { - mi := &file_alerting_v1_alerting_proto_msgTypes[16] - 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 CreateRuleResponse.ProtoReflect.Descriptor instead. -func (*CreateRuleResponse) Descriptor() ([]byte, []int) { - return file_alerting_v1_alerting_proto_rawDescGZIP(), []int{16} -} - -var File_alerting_v1_alerting_proto protoreflect.FileDescriptor - -const file_alerting_v1_alerting_proto_rawDesc = "" + - "\n" + - "\x1aalerting/v1/alerting.proto\x12\valerting.v1\x1a\x18alerting/v1/params.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1cmanagement/v1/severity.proto\x1a\x17validate/validate.proto\"@\n" + - "\x13BoolParamDefinition\x12\x1d\n" + - "\adefault\x18\x01 \x01(\bH\x00R\adefault\x88\x01\x01B\n" + - "\n" + - "\b_default\"\x7f\n" + - "\x14FloatParamDefinition\x12\x1d\n" + - "\adefault\x18\x01 \x01(\x01H\x00R\adefault\x88\x01\x01\x12\x15\n" + - "\x03min\x18\x02 \x01(\x01H\x01R\x03min\x88\x01\x01\x12\x15\n" + - "\x03max\x18\x03 \x01(\x01H\x02R\x03max\x88\x01\x01B\n" + - "\n" + - "\b_defaultB\x06\n" + - "\x04_minB\x06\n" + - "\x04_max\"B\n" + - "\x15StringParamDefinition\x12\x1d\n" + - "\adefault\x18\x01 \x01(\tH\x00R\adefault\x88\x01\x01B\n" + - "\n" + - "\b_default\"\xe3\x02\n" + - "\x0fParamDefinition\x12\x1b\n" + - "\x04name\x18\x01 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\x04name\x12!\n" + - "\asummary\x18\x02 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\asummary\x12*\n" + - "\x04unit\x18\x03 \x01(\x0e2\x16.alerting.v1.ParamUnitR\x04unit\x12*\n" + - "\x04type\x18\x04 \x01(\x0e2\x16.alerting.v1.ParamTypeR\x04type\x126\n" + - "\x04bool\x18\x05 \x01(\v2 .alerting.v1.BoolParamDefinitionH\x00R\x04bool\x129\n" + - "\x05float\x18\x06 \x01(\v2!.alerting.v1.FloatParamDefinitionH\x00R\x05float\x12<\n" + - "\x06string\x18\a \x01(\v2\".alerting.v1.StringParamDefinitionH\x00R\x06stringB\a\n" + - "\x05value\"\xe8\x04\n" + - "\bTemplate\x12\x12\n" + - "\x04name\x18\x01 \x01(\tR\x04name\x12\x18\n" + - "\asummary\x18\x02 \x01(\tR\asummary\x12\x12\n" + - "\x04expr\x18\x03 \x01(\tR\x04expr\x124\n" + - "\x06params\x18\x04 \x03(\v2\x1c.alerting.v1.ParamDefinitionR\x06params\x12+\n" + - "\x03for\x18\x05 \x01(\v2\x19.google.protobuf.DurationR\x03for\x123\n" + - "\bseverity\x18\x06 \x01(\x0e2\x17.management.v1.SeverityR\bseverity\x129\n" + - "\x06labels\x18\a \x03(\v2!.alerting.v1.Template.LabelsEntryR\x06labels\x12H\n" + - "\vannotations\x18\b \x03(\v2&.alerting.v1.Template.AnnotationsEntryR\vannotations\x123\n" + - "\x06source\x18\t \x01(\x0e2\x1b.alerting.v1.TemplateSourceR\x06source\x129\n" + - "\n" + - "created_at\x18\n" + - " \x01(\v2\x1a.google.protobuf.TimestampR\tcreatedAt\x12\x12\n" + - "\x04yaml\x18\v \x01(\tR\x04yaml\x1a9\n" + - "\vLabelsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\x1a>\n" + - "\x10AnnotationsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\xa3\x01\n" + - "\x14ListTemplatesRequest\x12)\n" + - "\tpage_size\x18\x01 \x01(\x05B\a\xfaB\x04\x1a\x02(\x01H\x00R\bpageSize\x88\x01\x01\x12+\n" + - "\n" + - "page_index\x18\x02 \x01(\x05B\a\xfaB\x04\x1a\x02(\x00H\x01R\tpageIndex\x88\x01\x01\x12\x16\n" + - "\x06reload\x18\x03 \x01(\bR\x06reloadB\f\n" + - "\n" + - "_page_sizeB\r\n" + - "\v_page_index\"\x8e\x01\n" + - "\x15ListTemplatesResponse\x12\x1f\n" + - "\vtotal_items\x18\x01 \x01(\x05R\n" + - "totalItems\x12\x1f\n" + - "\vtotal_pages\x18\x02 \x01(\x05R\n" + - "totalPages\x123\n" + - "\ttemplates\x18\x03 \x03(\v2\x15.alerting.v1.TemplateR\ttemplates\"4\n" + - "\x15CreateTemplateRequest\x12\x1b\n" + - "\x04yaml\x18\x01 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\x04yaml\"\x18\n" + - "\x16CreateTemplateResponse\"Q\n" + - "\x15UpdateTemplateRequest\x12\x1b\n" + - "\x04name\x18\x01 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\x04name\x12\x1b\n" + - "\x04yaml\x18\x02 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\x04yaml\"\x18\n" + - "\x16UpdateTemplateResponse\"4\n" + - "\x15DeleteTemplateRequest\x12\x1b\n" + - "\x04name\x18\x01 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\x04name\"\x18\n" + - "\x16DeleteTemplateResponse\"c\n" + - "\x06Filter\x12+\n" + - "\x04type\x18\x01 \x01(\x0e2\x17.alerting.v1.FilterTypeR\x04type\x12\x14\n" + - "\x05label\x18\x02 \x01(\tR\x05label\x12\x16\n" + - "\x06regexp\x18\x03 \x01(\tR\x06regexp\"\xa6\x01\n" + - "\n" + - "ParamValue\x12\x1b\n" + - "\x04name\x18\x01 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\x04name\x12*\n" + - "\x04type\x18\x02 \x01(\x0e2\x16.alerting.v1.ParamTypeR\x04type\x12\x14\n" + - "\x04bool\x18\x03 \x01(\bH\x00R\x04bool\x12\x16\n" + - "\x05float\x18\x04 \x01(\x01H\x00R\x05float\x12\x18\n" + - "\x06string\x18\x05 \x01(\tH\x00R\x06stringB\a\n" + - "\x05value\"\x92\x04\n" + - "\x11CreateRuleRequest\x12#\n" + - "\rtemplate_name\x18\x01 \x01(\tR\ftemplateName\x12\x12\n" + - "\x04name\x18\x02 \x01(\tR\x04name\x12\x14\n" + - "\x05group\x18\x03 \x01(\tR\x05group\x12\x1d\n" + - "\n" + - "folder_uid\x18\x04 \x01(\tR\tfolderUid\x12/\n" + - "\x06params\x18\x05 \x03(\v2\x17.alerting.v1.ParamValueR\x06params\x12+\n" + - "\x03for\x18\x06 \x01(\v2\x19.google.protobuf.DurationR\x03for\x123\n" + - "\bseverity\x18\a \x01(\x0e2\x17.management.v1.SeverityR\bseverity\x12U\n" + - "\rcustom_labels\x18\b \x03(\v20.alerting.v1.CreateRuleRequest.CustomLabelsEntryR\fcustomLabels\x12-\n" + - "\afilters\x18\t \x03(\v2\x13.alerting.v1.FilterR\afilters\x125\n" + - "\binterval\x18\n" + - " \x01(\v2\x19.google.protobuf.DurationR\binterval\x1a?\n" + - "\x11CustomLabelsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\x14\n" + - "\x12CreateRuleResponse*\xa6\x01\n" + - "\x0eTemplateSource\x12\x1f\n" + - "\x1bTEMPLATE_SOURCE_UNSPECIFIED\x10\x00\x12\x1c\n" + - "\x18TEMPLATE_SOURCE_BUILT_IN\x10\x01\x12\x18\n" + - "\x14TEMPLATE_SOURCE_SAAS\x10\x02\x12\x1d\n" + - "\x19TEMPLATE_SOURCE_USER_FILE\x10\x03\x12\x1c\n" + - "\x18TEMPLATE_SOURCE_USER_API\x10\x04*Z\n" + - "\n" + - "FilterType\x12\x1b\n" + - "\x17FILTER_TYPE_UNSPECIFIED\x10\x00\x12\x15\n" + - "\x11FILTER_TYPE_MATCH\x10\x01\x12\x18\n" + - "\x14FILTER_TYPE_MISMATCH\x10\x022\xfe\x04\n" + - "\x0fAlertingService\x12v\n" + - "\rListTemplates\x12!.alerting.v1.ListTemplatesRequest\x1a\".alerting.v1.ListTemplatesResponse\"\x1e\x82\xd3\xe4\x93\x02\x18\x12\x16/v1/alerting/templates\x12|\n" + - "\x0eCreateTemplate\x12\".alerting.v1.CreateTemplateRequest\x1a#.alerting.v1.CreateTemplateResponse\"!\x82\xd3\xe4\x93\x02\x1b:\x01*\"\x16/v1/alerting/templates\x12\x83\x01\n" + - "\x0eUpdateTemplate\x12\".alerting.v1.UpdateTemplateRequest\x1a#.alerting.v1.UpdateTemplateResponse\"(\x82\xd3\xe4\x93\x02\":\x01*\x1a\x1d/v1/alerting/templates/{name}\x12\x80\x01\n" + - "\x0eDeleteTemplate\x12\".alerting.v1.DeleteTemplateRequest\x1a#.alerting.v1.DeleteTemplateResponse\"%\x82\xd3\xe4\x93\x02\x1f*\x1d/v1/alerting/templates/{name}\x12l\n" + - "\n" + - "CreateRule\x12\x1e.alerting.v1.CreateRuleRequest\x1a\x1f.alerting.v1.CreateRuleResponse\"\x1d\x82\xd3\xe4\x93\x02\x17:\x01*\"\x12/v1/alerting/rulesB\xa0\x01\n" + - "\x0fcom.alerting.v1B\rAlertingProtoP\x01Z1github.com/percona/pmm/api/alerting/v1;alertingv1\xa2\x02\x03AXX\xaa\x02\vAlerting.V1\xca\x02\vAlerting\\V1\xe2\x02\x17Alerting\\V1\\GPBMetadata\xea\x02\fAlerting::V1b\x06proto3" - -var ( - file_alerting_v1_alerting_proto_rawDescOnce sync.Once - file_alerting_v1_alerting_proto_rawDescData []byte -) - -func file_alerting_v1_alerting_proto_rawDescGZIP() []byte { - file_alerting_v1_alerting_proto_rawDescOnce.Do(func() { - file_alerting_v1_alerting_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_alerting_v1_alerting_proto_rawDesc), len(file_alerting_v1_alerting_proto_rawDesc))) - }) - 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_depIdxs = []int32{ - 22, // 0: alerting.v1.ParamDefinition.unit:type_name -> alerting.v1.ParamUnit - 23, // 1: alerting.v1.ParamDefinition.type:type_name -> alerting.v1.ParamType - 2, // 2: alerting.v1.ParamDefinition.bool:type_name -> alerting.v1.BoolParamDefinition - 3, // 3: alerting.v1.ParamDefinition.float:type_name -> alerting.v1.FloatParamDefinition - 4, // 4: alerting.v1.ParamDefinition.string:type_name -> alerting.v1.StringParamDefinition - 5, // 5: alerting.v1.Template.params:type_name -> alerting.v1.ParamDefinition - 24, // 6: alerting.v1.Template.for:type_name -> google.protobuf.Duration - 25, // 7: alerting.v1.Template.severity:type_name -> management.v1.Severity - 19, // 8: alerting.v1.Template.labels:type_name -> alerting.v1.Template.LabelsEntry - 20, // 9: alerting.v1.Template.annotations:type_name -> alerting.v1.Template.AnnotationsEntry - 0, // 10: alerting.v1.Template.source:type_name -> alerting.v1.TemplateSource - 26, // 11: alerting.v1.Template.created_at:type_name -> google.protobuf.Timestamp - 6, // 12: alerting.v1.ListTemplatesResponse.templates:type_name -> alerting.v1.Template - 1, // 13: alerting.v1.Filter.type:type_name -> alerting.v1.FilterType - 23, // 14: alerting.v1.ParamValue.type:type_name -> alerting.v1.ParamType - 16, // 15: alerting.v1.CreateRuleRequest.params:type_name -> alerting.v1.ParamValue - 24, // 16: alerting.v1.CreateRuleRequest.for:type_name -> google.protobuf.Duration - 25, // 17: alerting.v1.CreateRuleRequest.severity:type_name -> management.v1.Severity - 21, // 18: alerting.v1.CreateRuleRequest.custom_labels:type_name -> alerting.v1.CreateRuleRequest.CustomLabelsEntry - 15, // 19: alerting.v1.CreateRuleRequest.filters:type_name -> alerting.v1.Filter - 24, // 20: alerting.v1.CreateRuleRequest.interval:type_name -> google.protobuf.Duration - 7, // 21: alerting.v1.AlertingService.ListTemplates:input_type -> alerting.v1.ListTemplatesRequest - 9, // 22: alerting.v1.AlertingService.CreateTemplate:input_type -> alerting.v1.CreateTemplateRequest - 11, // 23: alerting.v1.AlertingService.UpdateTemplate:input_type -> alerting.v1.UpdateTemplateRequest - 13, // 24: alerting.v1.AlertingService.DeleteTemplate:input_type -> alerting.v1.DeleteTemplateRequest - 17, // 25: alerting.v1.AlertingService.CreateRule:input_type -> alerting.v1.CreateRuleRequest - 8, // 26: alerting.v1.AlertingService.ListTemplates:output_type -> alerting.v1.ListTemplatesResponse - 10, // 27: alerting.v1.AlertingService.CreateTemplate:output_type -> alerting.v1.CreateTemplateResponse - 12, // 28: alerting.v1.AlertingService.UpdateTemplate:output_type -> alerting.v1.UpdateTemplateResponse - 14, // 29: alerting.v1.AlertingService.DeleteTemplate:output_type -> alerting.v1.DeleteTemplateResponse - 18, // 30: alerting.v1.AlertingService.CreateRule:output_type -> alerting.v1.CreateRuleResponse - 26, // [26:31] is the sub-list for method output_type - 21, // [21:26] is the sub-list for method input_type - 21, // [21:21] is the sub-list for extension type_name - 21, // [21:21] is the sub-list for extension extendee - 0, // [0:21] is the sub-list for field type_name -} - -func init() { file_alerting_v1_alerting_proto_init() } -func file_alerting_v1_alerting_proto_init() { - if File_alerting_v1_alerting_proto != nil { - return - } - file_alerting_v1_params_proto_init() - file_alerting_v1_alerting_proto_msgTypes[0].OneofWrappers = []any{} - file_alerting_v1_alerting_proto_msgTypes[1].OneofWrappers = []any{} - file_alerting_v1_alerting_proto_msgTypes[2].OneofWrappers = []any{} - file_alerting_v1_alerting_proto_msgTypes[3].OneofWrappers = []any{ - (*ParamDefinition_Bool)(nil), - (*ParamDefinition_Float)(nil), - (*ParamDefinition_String_)(nil), - } - file_alerting_v1_alerting_proto_msgTypes[5].OneofWrappers = []any{} - file_alerting_v1_alerting_proto_msgTypes[14].OneofWrappers = []any{ - (*ParamValue_Bool)(nil), - (*ParamValue_Float)(nil), - (*ParamValue_String_)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_alerting_v1_alerting_proto_rawDesc), len(file_alerting_v1_alerting_proto_rawDesc)), - NumEnums: 2, - NumMessages: 20, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_alerting_v1_alerting_proto_goTypes, - DependencyIndexes: file_alerting_v1_alerting_proto_depIdxs, - EnumInfos: file_alerting_v1_alerting_proto_enumTypes, - MessageInfos: file_alerting_v1_alerting_proto_msgTypes, - }.Build() - File_alerting_v1_alerting_proto = out.File - file_alerting_v1_alerting_proto_goTypes = nil - file_alerting_v1_alerting_proto_depIdxs = nil -} diff --git a/api/alerting/v1/alerting.pb.gw.go b/api/alerting/v1/alerting.pb.gw.go deleted file mode 100644 index d7a8f77b1e8..00000000000 --- a/api/alerting/v1/alerting.pb.gw.go +++ /dev/null @@ -1,459 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: alerting/v1/alerting.proto - -/* -Package alertingv1 is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package alertingv1 - -import ( - "context" - "errors" - "io" - "net/http" - - "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" - "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" - "google.golang.org/protobuf/proto" -) - -// Suppress "imported and not used" errors -var ( - _ codes.Code - _ io.Reader - _ status.Status - _ = errors.New - _ = runtime.String - _ = utilities.NewDoubleArray - _ = metadata.Join -) - -var filter_AlertingService_ListTemplates_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} - -func request_AlertingService_ListTemplates_0(ctx context.Context, marshaler runtime.Marshaler, client AlertingServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq ListTemplatesRequest - metadata runtime.ServerMetadata - ) - if req.Body != nil { - _, _ = io.Copy(io.Discard, req.Body) - } - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_AlertingService_ListTemplates_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - msg, err := client.ListTemplates(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_AlertingService_ListTemplates_0(ctx context.Context, marshaler runtime.Marshaler, server AlertingServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq ListTemplatesRequest - metadata runtime.ServerMetadata - ) - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_AlertingService_ListTemplates_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - msg, err := server.ListTemplates(ctx, &protoReq) - return msg, metadata, err -} - -func request_AlertingService_CreateTemplate_0(ctx context.Context, marshaler runtime.Marshaler, client AlertingServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq CreateTemplateRequest - 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.CreateTemplate(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_AlertingService_CreateTemplate_0(ctx context.Context, marshaler runtime.Marshaler, server AlertingServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq CreateTemplateRequest - 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.CreateTemplate(ctx, &protoReq) - return msg, metadata, err -} - -func request_AlertingService_UpdateTemplate_0(ctx context.Context, marshaler runtime.Marshaler, client AlertingServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq UpdateTemplateRequest - metadata runtime.ServerMetadata - err error - ) - 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) - } - val, ok := pathParams["name"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") - } - protoReq.Name, err = runtime.String(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) - } - msg, err := client.UpdateTemplate(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_AlertingService_UpdateTemplate_0(ctx context.Context, marshaler runtime.Marshaler, server AlertingServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq UpdateTemplateRequest - metadata runtime.ServerMetadata - err error - ) - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - val, ok := pathParams["name"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") - } - protoReq.Name, err = runtime.String(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) - } - msg, err := server.UpdateTemplate(ctx, &protoReq) - return msg, metadata, err -} - -func request_AlertingService_DeleteTemplate_0(ctx context.Context, marshaler runtime.Marshaler, client AlertingServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq DeleteTemplateRequest - metadata runtime.ServerMetadata - err error - ) - if req.Body != nil { - _, _ = io.Copy(io.Discard, req.Body) - } - val, ok := pathParams["name"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") - } - protoReq.Name, err = runtime.String(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) - } - msg, err := client.DeleteTemplate(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_AlertingService_DeleteTemplate_0(ctx context.Context, marshaler runtime.Marshaler, server AlertingServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq DeleteTemplateRequest - metadata runtime.ServerMetadata - err error - ) - val, ok := pathParams["name"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") - } - protoReq.Name, err = runtime.String(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) - } - msg, err := server.DeleteTemplate(ctx, &protoReq) - return msg, metadata, err -} - -func request_AlertingService_CreateRule_0(ctx context.Context, marshaler runtime.Marshaler, client AlertingServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq CreateRuleRequest - 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.CreateRule(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_AlertingService_CreateRule_0(ctx context.Context, marshaler runtime.Marshaler, server AlertingServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq CreateRuleRequest - 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.CreateRule(ctx, &protoReq) - return msg, metadata, err -} - -// RegisterAlertingServiceHandlerServer registers the http handlers for service AlertingService to "mux". -// UnaryRPC :call AlertingServiceServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterAlertingServiceHandlerFromEndpoint instead. -// GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call. -func RegisterAlertingServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AlertingServiceServer) error { - mux.Handle(http.MethodGet, pattern_AlertingService_ListTemplates_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, "/alerting.v1.AlertingService/ListTemplates", runtime.WithHTTPPathPattern("/v1/alerting/templates")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AlertingService_ListTemplates_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_AlertingService_ListTemplates_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPost, pattern_AlertingService_CreateTemplate_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, "/alerting.v1.AlertingService/CreateTemplate", runtime.WithHTTPPathPattern("/v1/alerting/templates")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AlertingService_CreateTemplate_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_AlertingService_CreateTemplate_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPut, pattern_AlertingService_UpdateTemplate_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, "/alerting.v1.AlertingService/UpdateTemplate", runtime.WithHTTPPathPattern("/v1/alerting/templates/{name}")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AlertingService_UpdateTemplate_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_AlertingService_UpdateTemplate_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodDelete, pattern_AlertingService_DeleteTemplate_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, "/alerting.v1.AlertingService/DeleteTemplate", runtime.WithHTTPPathPattern("/v1/alerting/templates/{name}")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AlertingService_DeleteTemplate_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_AlertingService_DeleteTemplate_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPost, pattern_AlertingService_CreateRule_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, "/alerting.v1.AlertingService/CreateRule", runtime.WithHTTPPathPattern("/v1/alerting/rules")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AlertingService_CreateRule_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_AlertingService_CreateRule_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - return nil -} - -// RegisterAlertingServiceHandlerFromEndpoint is same as RegisterAlertingServiceHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterAlertingServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.NewClient(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - return RegisterAlertingServiceHandler(ctx, mux, conn) -} - -// RegisterAlertingServiceHandler registers the http handlers for service AlertingService to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterAlertingServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterAlertingServiceHandlerClient(ctx, mux, NewAlertingServiceClient(conn)) -} - -// RegisterAlertingServiceHandlerClient registers the http handlers for service AlertingService -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "AlertingServiceClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "AlertingServiceClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "AlertingServiceClient" to call the correct interceptors. This client ignores the HTTP middlewares. -func RegisterAlertingServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AlertingServiceClient) error { - mux.Handle(http.MethodGet, pattern_AlertingService_ListTemplates_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, "/alerting.v1.AlertingService/ListTemplates", runtime.WithHTTPPathPattern("/v1/alerting/templates")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AlertingService_ListTemplates_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_AlertingService_ListTemplates_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPost, pattern_AlertingService_CreateTemplate_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, "/alerting.v1.AlertingService/CreateTemplate", runtime.WithHTTPPathPattern("/v1/alerting/templates")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AlertingService_CreateTemplate_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_AlertingService_CreateTemplate_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPut, pattern_AlertingService_UpdateTemplate_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, "/alerting.v1.AlertingService/UpdateTemplate", runtime.WithHTTPPathPattern("/v1/alerting/templates/{name}")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AlertingService_UpdateTemplate_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_AlertingService_UpdateTemplate_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodDelete, pattern_AlertingService_DeleteTemplate_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, "/alerting.v1.AlertingService/DeleteTemplate", runtime.WithHTTPPathPattern("/v1/alerting/templates/{name}")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AlertingService_DeleteTemplate_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_AlertingService_DeleteTemplate_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPost, pattern_AlertingService_CreateRule_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, "/alerting.v1.AlertingService/CreateRule", runtime.WithHTTPPathPattern("/v1/alerting/rules")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AlertingService_CreateRule_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_AlertingService_CreateRule_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - return nil -} - -var ( - pattern_AlertingService_ListTemplates_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "alerting", "templates"}, "")) - pattern_AlertingService_CreateTemplate_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "alerting", "templates"}, "")) - pattern_AlertingService_UpdateTemplate_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "alerting", "templates", "name"}, "")) - pattern_AlertingService_DeleteTemplate_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "alerting", "templates", "name"}, "")) - pattern_AlertingService_CreateRule_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "alerting", "rules"}, "")) -) - -var ( - forward_AlertingService_ListTemplates_0 = runtime.ForwardResponseMessage - forward_AlertingService_CreateTemplate_0 = runtime.ForwardResponseMessage - forward_AlertingService_UpdateTemplate_0 = runtime.ForwardResponseMessage - forward_AlertingService_DeleteTemplate_0 = runtime.ForwardResponseMessage - forward_AlertingService_CreateRule_0 = runtime.ForwardResponseMessage -) diff --git a/api/alerting/v1/alerting.pb.validate.go b/api/alerting/v1/alerting.pb.validate.go deleted file mode 100644 index f6a7dbcf1fa..00000000000 --- a/api/alerting/v1/alerting.pb.validate.go +++ /dev/null @@ -1,2352 +0,0 @@ -// Code generated by protoc-gen-validate. DO NOT EDIT. -// source: alerting/v1/alerting.proto - -package alertingv1 - -import ( - "bytes" - "errors" - "fmt" - "net" - "net/mail" - "net/url" - "regexp" - "sort" - "strings" - "time" - "unicode/utf8" - - "google.golang.org/protobuf/types/known/anypb" - - managementv1 "github.com/percona/pmm/api/management/v1" -) - -// ensure the imports are used -var ( - _ = bytes.MinRead - _ = errors.New("") - _ = fmt.Print - _ = utf8.UTFMax - _ = (*regexp.Regexp)(nil) - _ = (*strings.Reader)(nil) - _ = net.IPv4len - _ = time.Duration(0) - _ = (*url.URL)(nil) - _ = (*mail.Address)(nil) - _ = anypb.Any{} - _ = sort.Sort - - _ = managementv1.Severity(0) -) - -// Validate checks the field values on BoolParamDefinition 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 *BoolParamDefinition) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on BoolParamDefinition 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 -// BoolParamDefinitionMultiError, or nil if none found. -func (m *BoolParamDefinition) ValidateAll() error { - return m.validate(true) -} - -func (m *BoolParamDefinition) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if m.Default != nil { - // no validation rules for Default - } - - if len(errors) > 0 { - return BoolParamDefinitionMultiError(errors) - } - - return nil -} - -// BoolParamDefinitionMultiError is an error wrapping multiple validation -// errors returned by BoolParamDefinition.ValidateAll() if the designated -// constraints aren't met. -type BoolParamDefinitionMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m BoolParamDefinitionMultiError) 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 BoolParamDefinitionMultiError) AllErrors() []error { return m } - -// BoolParamDefinitionValidationError is the validation error returned by -// BoolParamDefinition.Validate if the designated constraints aren't met. -type BoolParamDefinitionValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e BoolParamDefinitionValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e BoolParamDefinitionValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e BoolParamDefinitionValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e BoolParamDefinitionValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e BoolParamDefinitionValidationError) ErrorName() string { - return "BoolParamDefinitionValidationError" -} - -// Error satisfies the builtin error interface -func (e BoolParamDefinitionValidationError) 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 %sBoolParamDefinition.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = BoolParamDefinitionValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = BoolParamDefinitionValidationError{} - -// Validate checks the field values on FloatParamDefinition 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 *FloatParamDefinition) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on FloatParamDefinition 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 -// FloatParamDefinitionMultiError, or nil if none found. -func (m *FloatParamDefinition) ValidateAll() error { - return m.validate(true) -} - -func (m *FloatParamDefinition) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if m.Default != nil { - // no validation rules for Default - } - - if m.Min != nil { - // no validation rules for Min - } - - if m.Max != nil { - // no validation rules for Max - } - - if len(errors) > 0 { - return FloatParamDefinitionMultiError(errors) - } - - return nil -} - -// FloatParamDefinitionMultiError is an error wrapping multiple validation -// errors returned by FloatParamDefinition.ValidateAll() if the designated -// constraints aren't met. -type FloatParamDefinitionMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m FloatParamDefinitionMultiError) 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 FloatParamDefinitionMultiError) AllErrors() []error { return m } - -// FloatParamDefinitionValidationError is the validation error returned by -// FloatParamDefinition.Validate if the designated constraints aren't met. -type FloatParamDefinitionValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e FloatParamDefinitionValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e FloatParamDefinitionValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e FloatParamDefinitionValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e FloatParamDefinitionValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e FloatParamDefinitionValidationError) ErrorName() string { - return "FloatParamDefinitionValidationError" -} - -// Error satisfies the builtin error interface -func (e FloatParamDefinitionValidationError) 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 %sFloatParamDefinition.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = FloatParamDefinitionValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = FloatParamDefinitionValidationError{} - -// Validate checks the field values on StringParamDefinition 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 *StringParamDefinition) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on StringParamDefinition 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 -// StringParamDefinitionMultiError, or nil if none found. -func (m *StringParamDefinition) ValidateAll() error { - return m.validate(true) -} - -func (m *StringParamDefinition) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if m.Default != nil { - // no validation rules for Default - } - - if len(errors) > 0 { - return StringParamDefinitionMultiError(errors) - } - - return nil -} - -// StringParamDefinitionMultiError is an error wrapping multiple validation -// errors returned by StringParamDefinition.ValidateAll() if the designated -// constraints aren't met. -type StringParamDefinitionMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m StringParamDefinitionMultiError) 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 StringParamDefinitionMultiError) AllErrors() []error { return m } - -// StringParamDefinitionValidationError is the validation error returned by -// StringParamDefinition.Validate if the designated constraints aren't met. -type StringParamDefinitionValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e StringParamDefinitionValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e StringParamDefinitionValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e StringParamDefinitionValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e StringParamDefinitionValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e StringParamDefinitionValidationError) ErrorName() string { - return "StringParamDefinitionValidationError" -} - -// Error satisfies the builtin error interface -func (e StringParamDefinitionValidationError) 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 %sStringParamDefinition.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = StringParamDefinitionValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = StringParamDefinitionValidationError{} - -// Validate checks the field values on ParamDefinition 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 *ParamDefinition) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ParamDefinition 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 -// ParamDefinitionMultiError, or nil if none found. -func (m *ParamDefinition) ValidateAll() error { - return m.validate(true) -} - -func (m *ParamDefinition) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetName()) < 1 { - err := ParamDefinitionValidationError{ - field: "Name", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if utf8.RuneCountInString(m.GetSummary()) < 1 { - err := ParamDefinitionValidationError{ - field: "Summary", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for Unit - - // no validation rules for Type - - switch v := m.Value.(type) { - case *ParamDefinition_Bool: - if v == nil { - err := ParamDefinitionValidationError{ - field: "Value", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetBool()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ParamDefinitionValidationError{ - field: "Bool", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ParamDefinitionValidationError{ - field: "Bool", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetBool()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ParamDefinitionValidationError{ - field: "Bool", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *ParamDefinition_Float: - if v == nil { - err := ParamDefinitionValidationError{ - field: "Value", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetFloat()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ParamDefinitionValidationError{ - field: "Float", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ParamDefinitionValidationError{ - field: "Float", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetFloat()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ParamDefinitionValidationError{ - field: "Float", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *ParamDefinition_String_: - if v == nil { - err := ParamDefinitionValidationError{ - field: "Value", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetString_()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ParamDefinitionValidationError{ - field: "String_", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ParamDefinitionValidationError{ - field: "String_", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetString_()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ParamDefinitionValidationError{ - field: "String_", - reason: "embedded message failed validation", - cause: err, - } - } - } - - default: - _ = v // ensures v is used - } - - if len(errors) > 0 { - return ParamDefinitionMultiError(errors) - } - - return nil -} - -// ParamDefinitionMultiError is an error wrapping multiple validation errors -// returned by ParamDefinition.ValidateAll() if the designated constraints -// aren't met. -type ParamDefinitionMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ParamDefinitionMultiError) 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 ParamDefinitionMultiError) AllErrors() []error { return m } - -// ParamDefinitionValidationError is the validation error returned by -// ParamDefinition.Validate if the designated constraints aren't met. -type ParamDefinitionValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ParamDefinitionValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ParamDefinitionValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ParamDefinitionValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ParamDefinitionValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ParamDefinitionValidationError) ErrorName() string { return "ParamDefinitionValidationError" } - -// Error satisfies the builtin error interface -func (e ParamDefinitionValidationError) 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 %sParamDefinition.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ParamDefinitionValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ParamDefinitionValidationError{} - -// Validate checks the field values on Template 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 *Template) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on Template 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 TemplateMultiError, or nil -// if none found. -func (m *Template) ValidateAll() error { - return m.validate(true) -} - -func (m *Template) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Name - - // no validation rules for Summary - - // no validation rules for Expr - - for idx, item := range m.GetParams() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, TemplateValidationError{ - field: fmt.Sprintf("Params[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, TemplateValidationError{ - field: fmt.Sprintf("Params[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return TemplateValidationError{ - field: fmt.Sprintf("Params[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - if all { - switch v := interface{}(m.GetFor()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, TemplateValidationError{ - field: "For", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, TemplateValidationError{ - field: "For", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetFor()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return TemplateValidationError{ - field: "For", - reason: "embedded message failed validation", - cause: err, - } - } - } - - // no validation rules for Severity - - // no validation rules for Labels - - // no validation rules for Annotations - - // no validation rules for Source - - if all { - switch v := interface{}(m.GetCreatedAt()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, TemplateValidationError{ - field: "CreatedAt", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, TemplateValidationError{ - field: "CreatedAt", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetCreatedAt()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return TemplateValidationError{ - field: "CreatedAt", - reason: "embedded message failed validation", - cause: err, - } - } - } - - // no validation rules for Yaml - - if len(errors) > 0 { - return TemplateMultiError(errors) - } - - return nil -} - -// TemplateMultiError is an error wrapping multiple validation errors returned -// by Template.ValidateAll() if the designated constraints aren't met. -type TemplateMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m TemplateMultiError) 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 TemplateMultiError) AllErrors() []error { return m } - -// TemplateValidationError is the validation error returned by -// Template.Validate if the designated constraints aren't met. -type TemplateValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e TemplateValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e TemplateValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e TemplateValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e TemplateValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e TemplateValidationError) ErrorName() string { return "TemplateValidationError" } - -// Error satisfies the builtin error interface -func (e TemplateValidationError) 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 %sTemplate.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = TemplateValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = TemplateValidationError{} - -// Validate checks the field values on ListTemplatesRequest 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 *ListTemplatesRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ListTemplatesRequest 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 -// ListTemplatesRequestMultiError, or nil if none found. -func (m *ListTemplatesRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *ListTemplatesRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Reload - - if m.PageSize != nil { - if m.GetPageSize() < 1 { - err := ListTemplatesRequestValidationError{ - field: "PageSize", - reason: "value must be greater than or equal to 1", - } - if !all { - return err - } - errors = append(errors, err) - } - } - - if m.PageIndex != nil { - if m.GetPageIndex() < 0 { - err := ListTemplatesRequestValidationError{ - field: "PageIndex", - reason: "value must be greater than or equal to 0", - } - if !all { - return err - } - errors = append(errors, err) - } - } - - if len(errors) > 0 { - return ListTemplatesRequestMultiError(errors) - } - - return nil -} - -// ListTemplatesRequestMultiError is an error wrapping multiple validation -// errors returned by ListTemplatesRequest.ValidateAll() if the designated -// constraints aren't met. -type ListTemplatesRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ListTemplatesRequestMultiError) 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 ListTemplatesRequestMultiError) AllErrors() []error { return m } - -// ListTemplatesRequestValidationError is the validation error returned by -// ListTemplatesRequest.Validate if the designated constraints aren't met. -type ListTemplatesRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ListTemplatesRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ListTemplatesRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ListTemplatesRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ListTemplatesRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ListTemplatesRequestValidationError) ErrorName() string { - return "ListTemplatesRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e ListTemplatesRequestValidationError) 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 %sListTemplatesRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ListTemplatesRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ListTemplatesRequestValidationError{} - -// Validate checks the field values on ListTemplatesResponse 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 *ListTemplatesResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ListTemplatesResponse 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 -// ListTemplatesResponseMultiError, or nil if none found. -func (m *ListTemplatesResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *ListTemplatesResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for TotalItems - - // no validation rules for TotalPages - - for idx, item := range m.GetTemplates() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ListTemplatesResponseValidationError{ - field: fmt.Sprintf("Templates[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ListTemplatesResponseValidationError{ - field: fmt.Sprintf("Templates[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ListTemplatesResponseValidationError{ - field: fmt.Sprintf("Templates[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - if len(errors) > 0 { - return ListTemplatesResponseMultiError(errors) - } - - return nil -} - -// ListTemplatesResponseMultiError is an error wrapping multiple validation -// errors returned by ListTemplatesResponse.ValidateAll() if the designated -// constraints aren't met. -type ListTemplatesResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ListTemplatesResponseMultiError) 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 ListTemplatesResponseMultiError) AllErrors() []error { return m } - -// ListTemplatesResponseValidationError is the validation error returned by -// ListTemplatesResponse.Validate if the designated constraints aren't met. -type ListTemplatesResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ListTemplatesResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ListTemplatesResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ListTemplatesResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ListTemplatesResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ListTemplatesResponseValidationError) ErrorName() string { - return "ListTemplatesResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e ListTemplatesResponseValidationError) 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 %sListTemplatesResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ListTemplatesResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ListTemplatesResponseValidationError{} - -// Validate checks the field values on CreateTemplateRequest 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 *CreateTemplateRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on CreateTemplateRequest 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 -// CreateTemplateRequestMultiError, or nil if none found. -func (m *CreateTemplateRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *CreateTemplateRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetYaml()) < 1 { - err := CreateTemplateRequestValidationError{ - field: "Yaml", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if len(errors) > 0 { - return CreateTemplateRequestMultiError(errors) - } - - return nil -} - -// CreateTemplateRequestMultiError is an error wrapping multiple validation -// errors returned by CreateTemplateRequest.ValidateAll() if the designated -// constraints aren't met. -type CreateTemplateRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m CreateTemplateRequestMultiError) 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 CreateTemplateRequestMultiError) AllErrors() []error { return m } - -// CreateTemplateRequestValidationError is the validation error returned by -// CreateTemplateRequest.Validate if the designated constraints aren't met. -type CreateTemplateRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e CreateTemplateRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e CreateTemplateRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e CreateTemplateRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e CreateTemplateRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e CreateTemplateRequestValidationError) ErrorName() string { - return "CreateTemplateRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e CreateTemplateRequestValidationError) 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 %sCreateTemplateRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = CreateTemplateRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = CreateTemplateRequestValidationError{} - -// Validate checks the field values on CreateTemplateResponse 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 *CreateTemplateResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on CreateTemplateResponse 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 -// CreateTemplateResponseMultiError, or nil if none found. -func (m *CreateTemplateResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *CreateTemplateResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return CreateTemplateResponseMultiError(errors) - } - - return nil -} - -// CreateTemplateResponseMultiError is an error wrapping multiple validation -// errors returned by CreateTemplateResponse.ValidateAll() if the designated -// constraints aren't met. -type CreateTemplateResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m CreateTemplateResponseMultiError) 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 CreateTemplateResponseMultiError) AllErrors() []error { return m } - -// CreateTemplateResponseValidationError is the validation error returned by -// CreateTemplateResponse.Validate if the designated constraints aren't met. -type CreateTemplateResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e CreateTemplateResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e CreateTemplateResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e CreateTemplateResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e CreateTemplateResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e CreateTemplateResponseValidationError) ErrorName() string { - return "CreateTemplateResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e CreateTemplateResponseValidationError) 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 %sCreateTemplateResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = CreateTemplateResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = CreateTemplateResponseValidationError{} - -// Validate checks the field values on UpdateTemplateRequest 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 *UpdateTemplateRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on UpdateTemplateRequest 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 -// UpdateTemplateRequestMultiError, or nil if none found. -func (m *UpdateTemplateRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *UpdateTemplateRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetName()) < 1 { - err := UpdateTemplateRequestValidationError{ - field: "Name", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if utf8.RuneCountInString(m.GetYaml()) < 1 { - err := UpdateTemplateRequestValidationError{ - field: "Yaml", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if len(errors) > 0 { - return UpdateTemplateRequestMultiError(errors) - } - - return nil -} - -// UpdateTemplateRequestMultiError is an error wrapping multiple validation -// errors returned by UpdateTemplateRequest.ValidateAll() if the designated -// constraints aren't met. -type UpdateTemplateRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m UpdateTemplateRequestMultiError) 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 UpdateTemplateRequestMultiError) AllErrors() []error { return m } - -// UpdateTemplateRequestValidationError is the validation error returned by -// UpdateTemplateRequest.Validate if the designated constraints aren't met. -type UpdateTemplateRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e UpdateTemplateRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e UpdateTemplateRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e UpdateTemplateRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e UpdateTemplateRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e UpdateTemplateRequestValidationError) ErrorName() string { - return "UpdateTemplateRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e UpdateTemplateRequestValidationError) 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 %sUpdateTemplateRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = UpdateTemplateRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = UpdateTemplateRequestValidationError{} - -// Validate checks the field values on UpdateTemplateResponse 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 *UpdateTemplateResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on UpdateTemplateResponse 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 -// UpdateTemplateResponseMultiError, or nil if none found. -func (m *UpdateTemplateResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *UpdateTemplateResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return UpdateTemplateResponseMultiError(errors) - } - - return nil -} - -// UpdateTemplateResponseMultiError is an error wrapping multiple validation -// errors returned by UpdateTemplateResponse.ValidateAll() if the designated -// constraints aren't met. -type UpdateTemplateResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m UpdateTemplateResponseMultiError) 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 UpdateTemplateResponseMultiError) AllErrors() []error { return m } - -// UpdateTemplateResponseValidationError is the validation error returned by -// UpdateTemplateResponse.Validate if the designated constraints aren't met. -type UpdateTemplateResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e UpdateTemplateResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e UpdateTemplateResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e UpdateTemplateResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e UpdateTemplateResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e UpdateTemplateResponseValidationError) ErrorName() string { - return "UpdateTemplateResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e UpdateTemplateResponseValidationError) 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 %sUpdateTemplateResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = UpdateTemplateResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = UpdateTemplateResponseValidationError{} - -// Validate checks the field values on DeleteTemplateRequest 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 *DeleteTemplateRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on DeleteTemplateRequest 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 -// DeleteTemplateRequestMultiError, or nil if none found. -func (m *DeleteTemplateRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *DeleteTemplateRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetName()) < 1 { - err := DeleteTemplateRequestValidationError{ - field: "Name", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if len(errors) > 0 { - return DeleteTemplateRequestMultiError(errors) - } - - return nil -} - -// DeleteTemplateRequestMultiError is an error wrapping multiple validation -// errors returned by DeleteTemplateRequest.ValidateAll() if the designated -// constraints aren't met. -type DeleteTemplateRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m DeleteTemplateRequestMultiError) 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 DeleteTemplateRequestMultiError) AllErrors() []error { return m } - -// DeleteTemplateRequestValidationError is the validation error returned by -// DeleteTemplateRequest.Validate if the designated constraints aren't met. -type DeleteTemplateRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e DeleteTemplateRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e DeleteTemplateRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e DeleteTemplateRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e DeleteTemplateRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e DeleteTemplateRequestValidationError) ErrorName() string { - return "DeleteTemplateRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e DeleteTemplateRequestValidationError) 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 %sDeleteTemplateRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = DeleteTemplateRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = DeleteTemplateRequestValidationError{} - -// Validate checks the field values on DeleteTemplateResponse 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 *DeleteTemplateResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on DeleteTemplateResponse 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 -// DeleteTemplateResponseMultiError, or nil if none found. -func (m *DeleteTemplateResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *DeleteTemplateResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return DeleteTemplateResponseMultiError(errors) - } - - return nil -} - -// DeleteTemplateResponseMultiError is an error wrapping multiple validation -// errors returned by DeleteTemplateResponse.ValidateAll() if the designated -// constraints aren't met. -type DeleteTemplateResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m DeleteTemplateResponseMultiError) 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 DeleteTemplateResponseMultiError) AllErrors() []error { return m } - -// DeleteTemplateResponseValidationError is the validation error returned by -// DeleteTemplateResponse.Validate if the designated constraints aren't met. -type DeleteTemplateResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e DeleteTemplateResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e DeleteTemplateResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e DeleteTemplateResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e DeleteTemplateResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e DeleteTemplateResponseValidationError) ErrorName() string { - return "DeleteTemplateResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e DeleteTemplateResponseValidationError) 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 %sDeleteTemplateResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = DeleteTemplateResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = DeleteTemplateResponseValidationError{} - -// Validate checks the field values on Filter 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 *Filter) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on Filter 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 FilterMultiError, or nil if none found. -func (m *Filter) ValidateAll() error { - return m.validate(true) -} - -func (m *Filter) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Type - - // no validation rules for Label - - // no validation rules for Regexp - - if len(errors) > 0 { - return FilterMultiError(errors) - } - - return nil -} - -// FilterMultiError is an error wrapping multiple validation errors returned by -// Filter.ValidateAll() if the designated constraints aren't met. -type FilterMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m FilterMultiError) 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 FilterMultiError) AllErrors() []error { return m } - -// FilterValidationError is the validation error returned by Filter.Validate if -// the designated constraints aren't met. -type FilterValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e FilterValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e FilterValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e FilterValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e FilterValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e FilterValidationError) ErrorName() string { return "FilterValidationError" } - -// Error satisfies the builtin error interface -func (e FilterValidationError) 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 %sFilter.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = FilterValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = FilterValidationError{} - -// Validate checks the field values on ParamValue 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 *ParamValue) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ParamValue 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 ParamValueMultiError, or -// nil if none found. -func (m *ParamValue) ValidateAll() error { - return m.validate(true) -} - -func (m *ParamValue) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetName()) < 1 { - err := ParamValueValidationError{ - field: "Name", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for Type - - switch v := m.Value.(type) { - case *ParamValue_Bool: - if v == nil { - err := ParamValueValidationError{ - field: "Value", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - // no validation rules for Bool - case *ParamValue_Float: - if v == nil { - err := ParamValueValidationError{ - field: "Value", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - // no validation rules for Float - case *ParamValue_String_: - if v == nil { - err := ParamValueValidationError{ - field: "Value", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - // no validation rules for String_ - default: - _ = v // ensures v is used - } - - if len(errors) > 0 { - return ParamValueMultiError(errors) - } - - return nil -} - -// ParamValueMultiError is an error wrapping multiple validation errors -// returned by ParamValue.ValidateAll() if the designated constraints aren't met. -type ParamValueMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ParamValueMultiError) 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 ParamValueMultiError) AllErrors() []error { return m } - -// ParamValueValidationError is the validation error returned by -// ParamValue.Validate if the designated constraints aren't met. -type ParamValueValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ParamValueValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ParamValueValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ParamValueValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ParamValueValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ParamValueValidationError) ErrorName() string { return "ParamValueValidationError" } - -// Error satisfies the builtin error interface -func (e ParamValueValidationError) 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 %sParamValue.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ParamValueValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ParamValueValidationError{} - -// Validate checks the field values on CreateRuleRequest 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 *CreateRuleRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on CreateRuleRequest 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 -// CreateRuleRequestMultiError, or nil if none found. -func (m *CreateRuleRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *CreateRuleRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for TemplateName - - // no validation rules for Name - - // no validation rules for Group - - // no validation rules for FolderUid - - for idx, item := range m.GetParams() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, CreateRuleRequestValidationError{ - field: fmt.Sprintf("Params[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, CreateRuleRequestValidationError{ - field: fmt.Sprintf("Params[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return CreateRuleRequestValidationError{ - field: fmt.Sprintf("Params[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - if all { - switch v := interface{}(m.GetFor()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, CreateRuleRequestValidationError{ - field: "For", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, CreateRuleRequestValidationError{ - field: "For", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetFor()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return CreateRuleRequestValidationError{ - field: "For", - reason: "embedded message failed validation", - cause: err, - } - } - } - - // no validation rules for Severity - - // no validation rules for CustomLabels - - for idx, item := range m.GetFilters() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, CreateRuleRequestValidationError{ - field: fmt.Sprintf("Filters[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, CreateRuleRequestValidationError{ - field: fmt.Sprintf("Filters[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return CreateRuleRequestValidationError{ - field: fmt.Sprintf("Filters[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - if all { - switch v := interface{}(m.GetInterval()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, CreateRuleRequestValidationError{ - field: "Interval", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, CreateRuleRequestValidationError{ - field: "Interval", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetInterval()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return CreateRuleRequestValidationError{ - field: "Interval", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if len(errors) > 0 { - return CreateRuleRequestMultiError(errors) - } - - return nil -} - -// CreateRuleRequestMultiError is an error wrapping multiple validation errors -// returned by CreateRuleRequest.ValidateAll() if the designated constraints -// aren't met. -type CreateRuleRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m CreateRuleRequestMultiError) 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 CreateRuleRequestMultiError) AllErrors() []error { return m } - -// CreateRuleRequestValidationError is the validation error returned by -// CreateRuleRequest.Validate if the designated constraints aren't met. -type CreateRuleRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e CreateRuleRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e CreateRuleRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e CreateRuleRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e CreateRuleRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e CreateRuleRequestValidationError) ErrorName() string { - return "CreateRuleRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e CreateRuleRequestValidationError) 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 %sCreateRuleRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = CreateRuleRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = CreateRuleRequestValidationError{} - -// Validate checks the field values on CreateRuleResponse 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 *CreateRuleResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on CreateRuleResponse 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 -// CreateRuleResponseMultiError, or nil if none found. -func (m *CreateRuleResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *CreateRuleResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return CreateRuleResponseMultiError(errors) - } - - return nil -} - -// CreateRuleResponseMultiError is an error wrapping multiple validation errors -// returned by CreateRuleResponse.ValidateAll() if the designated constraints -// aren't met. -type CreateRuleResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m CreateRuleResponseMultiError) 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 CreateRuleResponseMultiError) AllErrors() []error { return m } - -// CreateRuleResponseValidationError is the validation error returned by -// CreateRuleResponse.Validate if the designated constraints aren't met. -type CreateRuleResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e CreateRuleResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e CreateRuleResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e CreateRuleResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e CreateRuleResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e CreateRuleResponseValidationError) ErrorName() string { - return "CreateRuleResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e CreateRuleResponseValidationError) 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 %sCreateRuleResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = CreateRuleResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = CreateRuleResponseValidationError{} diff --git a/api/alerting/v1/alerting_grpc.pb.go b/api/alerting/v1/alerting_grpc.pb.go deleted file mode 100644 index d559dc19bfe..00000000000 --- a/api/alerting/v1/alerting_grpc.pb.go +++ /dev/null @@ -1,292 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.6.0 -// - protoc (unknown) -// source: alerting/v1/alerting.proto - -package alertingv1 - -import ( - context "context" - - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.64.0 or later. -const _ = grpc.SupportPackageIsVersion9 - -const ( - AlertingService_ListTemplates_FullMethodName = "/alerting.v1.AlertingService/ListTemplates" - AlertingService_CreateTemplate_FullMethodName = "/alerting.v1.AlertingService/CreateTemplate" - AlertingService_UpdateTemplate_FullMethodName = "/alerting.v1.AlertingService/UpdateTemplate" - AlertingService_DeleteTemplate_FullMethodName = "/alerting.v1.AlertingService/DeleteTemplate" - AlertingService_CreateRule_FullMethodName = "/alerting.v1.AlertingService/CreateRule" -) - -// AlertingServiceClient is the client API for AlertingService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -// -// Alerting service lets to manage alerting templates and create alerting rules from them. -type AlertingServiceClient interface { - // ListTemplates returns a list of all collected alert rule templates. - ListTemplates(ctx context.Context, in *ListTemplatesRequest, opts ...grpc.CallOption) (*ListTemplatesResponse, error) - // CreateTemplate creates a new template. - CreateTemplate(ctx context.Context, in *CreateTemplateRequest, opts ...grpc.CallOption) (*CreateTemplateResponse, error) - // UpdateTemplate updates existing template, previously created via API. - UpdateTemplate(ctx context.Context, in *UpdateTemplateRequest, opts ...grpc.CallOption) (*UpdateTemplateResponse, error) - // DeleteTemplate deletes existing, previously created via API. - DeleteTemplate(ctx context.Context, in *DeleteTemplateRequest, opts ...grpc.CallOption) (*DeleteTemplateResponse, error) - // CreateRule creates alerting rule from the given template. - CreateRule(ctx context.Context, in *CreateRuleRequest, opts ...grpc.CallOption) (*CreateRuleResponse, error) -} - -type alertingServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewAlertingServiceClient(cc grpc.ClientConnInterface) AlertingServiceClient { - return &alertingServiceClient{cc} -} - -func (c *alertingServiceClient) ListTemplates(ctx context.Context, in *ListTemplatesRequest, opts ...grpc.CallOption) (*ListTemplatesResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(ListTemplatesResponse) - err := c.cc.Invoke(ctx, AlertingService_ListTemplates_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *alertingServiceClient) CreateTemplate(ctx context.Context, in *CreateTemplateRequest, opts ...grpc.CallOption) (*CreateTemplateResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(CreateTemplateResponse) - err := c.cc.Invoke(ctx, AlertingService_CreateTemplate_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *alertingServiceClient) UpdateTemplate(ctx context.Context, in *UpdateTemplateRequest, opts ...grpc.CallOption) (*UpdateTemplateResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(UpdateTemplateResponse) - err := c.cc.Invoke(ctx, AlertingService_UpdateTemplate_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *alertingServiceClient) DeleteTemplate(ctx context.Context, in *DeleteTemplateRequest, opts ...grpc.CallOption) (*DeleteTemplateResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(DeleteTemplateResponse) - err := c.cc.Invoke(ctx, AlertingService_DeleteTemplate_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *alertingServiceClient) CreateRule(ctx context.Context, in *CreateRuleRequest, opts ...grpc.CallOption) (*CreateRuleResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(CreateRuleResponse) - err := c.cc.Invoke(ctx, AlertingService_CreateRule_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -// AlertingServiceServer is the server API for AlertingService service. -// All implementations must embed UnimplementedAlertingServiceServer -// for forward compatibility. -// -// Alerting service lets to manage alerting templates and create alerting rules from them. -type AlertingServiceServer interface { - // ListTemplates returns a list of all collected alert rule templates. - ListTemplates(context.Context, *ListTemplatesRequest) (*ListTemplatesResponse, error) - // CreateTemplate creates a new template. - CreateTemplate(context.Context, *CreateTemplateRequest) (*CreateTemplateResponse, error) - // UpdateTemplate updates existing template, previously created via API. - UpdateTemplate(context.Context, *UpdateTemplateRequest) (*UpdateTemplateResponse, error) - // DeleteTemplate deletes existing, previously created via API. - DeleteTemplate(context.Context, *DeleteTemplateRequest) (*DeleteTemplateResponse, error) - // CreateRule creates alerting rule from the given template. - CreateRule(context.Context, *CreateRuleRequest) (*CreateRuleResponse, error) - mustEmbedUnimplementedAlertingServiceServer() -} - -// UnimplementedAlertingServiceServer must be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -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") -} -func (UnimplementedAlertingServiceServer) mustEmbedUnimplementedAlertingServiceServer() {} -func (UnimplementedAlertingServiceServer) testEmbeddedByValue() {} - -// UnsafeAlertingServiceServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to AlertingServiceServer will -// result in compilation errors. -type UnsafeAlertingServiceServer interface { - mustEmbedUnimplementedAlertingServiceServer() -} - -func RegisterAlertingServiceServer(s grpc.ServiceRegistrar, srv AlertingServiceServer) { - // If the following call panics, it indicates UnimplementedAlertingServiceServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } - s.RegisterService(&AlertingService_ServiceDesc, srv) -} - -func _AlertingService_ListTemplates_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListTemplatesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AlertingServiceServer).ListTemplates(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: AlertingService_ListTemplates_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AlertingServiceServer).ListTemplates(ctx, req.(*ListTemplatesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AlertingService_CreateTemplate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateTemplateRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AlertingServiceServer).CreateTemplate(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: AlertingService_CreateTemplate_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AlertingServiceServer).CreateTemplate(ctx, req.(*CreateTemplateRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AlertingService_UpdateTemplate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdateTemplateRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AlertingServiceServer).UpdateTemplate(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: AlertingService_UpdateTemplate_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AlertingServiceServer).UpdateTemplate(ctx, req.(*UpdateTemplateRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AlertingService_DeleteTemplate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteTemplateRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AlertingServiceServer).DeleteTemplate(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: AlertingService_DeleteTemplate_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AlertingServiceServer).DeleteTemplate(ctx, req.(*DeleteTemplateRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AlertingService_CreateRule_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateRuleRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AlertingServiceServer).CreateRule(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: AlertingService_CreateRule_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AlertingServiceServer).CreateRule(ctx, req.(*CreateRuleRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// AlertingService_ServiceDesc is the grpc.ServiceDesc for AlertingService service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var AlertingService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "alerting.v1.AlertingService", - HandlerType: (*AlertingServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "ListTemplates", - Handler: _AlertingService_ListTemplates_Handler, - }, - { - MethodName: "CreateTemplate", - Handler: _AlertingService_CreateTemplate_Handler, - }, - { - MethodName: "UpdateTemplate", - Handler: _AlertingService_UpdateTemplate_Handler, - }, - { - MethodName: "DeleteTemplate", - Handler: _AlertingService_DeleteTemplate_Handler, - }, - { - MethodName: "CreateRule", - Handler: _AlertingService_CreateRule_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "alerting/v1/alerting.proto", -} diff --git a/api/alerting/v1/json/client/alerting_service/alerting_service_client.go b/api/alerting/v1/json/client/alerting_service/alerting_service_client.go deleted file mode 100644 index 068bcfcc420..00000000000 --- a/api/alerting/v1/json/client/alerting_service/alerting_service_client.go +++ /dev/null @@ -1,283 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package alerting_service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// New creates a new alerting service API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -// New creates a new alerting service API client with basic auth credentials. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - user: user for basic authentication header. -// - password: password for basic authentication header. -func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BasicAuth(user, password) - return &Client{transport: transport, formats: strfmt.Default} -} - -// New creates a new alerting service API client with a bearer token for authentication. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - bearerToken: bearer token for Bearer authentication header. -func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BearerToken(bearerToken) - return &Client{transport: transport, formats: strfmt.Default} -} - -/* -Client for alerting service API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption may be used to customize the behavior of Client methods. -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - CreateRule(params *CreateRuleParams, opts ...ClientOption) (*CreateRuleOK, error) - - CreateTemplate(params *CreateTemplateParams, opts ...ClientOption) (*CreateTemplateOK, error) - - DeleteTemplate(params *DeleteTemplateParams, opts ...ClientOption) (*DeleteTemplateOK, error) - - ListTemplates(params *ListTemplatesParams, opts ...ClientOption) (*ListTemplatesOK, error) - - UpdateTemplate(params *UpdateTemplateParams, opts ...ClientOption) (*UpdateTemplateOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -CreateRule creates rule creates alerting rule from the given template -*/ -func (a *Client) CreateRule(params *CreateRuleParams, opts ...ClientOption) (*CreateRuleOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewCreateRuleParams() - } - op := &runtime.ClientOperation{ - ID: "CreateRule", - Method: "POST", - PathPattern: "/v1/alerting/rules", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &CreateRuleReader{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.(*CreateRuleOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*CreateRuleDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -CreateTemplate creates template creates a new template -*/ -func (a *Client) CreateTemplate(params *CreateTemplateParams, opts ...ClientOption) (*CreateTemplateOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewCreateTemplateParams() - } - op := &runtime.ClientOperation{ - ID: "CreateTemplate", - Method: "POST", - PathPattern: "/v1/alerting/templates", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &CreateTemplateReader{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.(*CreateTemplateOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*CreateTemplateDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -DeleteTemplate deletes template deletes existing previously created via API -*/ -func (a *Client) DeleteTemplate(params *DeleteTemplateParams, opts ...ClientOption) (*DeleteTemplateOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewDeleteTemplateParams() - } - op := &runtime.ClientOperation{ - ID: "DeleteTemplate", - Method: "DELETE", - PathPattern: "/v1/alerting/templates/{name}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &DeleteTemplateReader{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.(*DeleteTemplateOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*DeleteTemplateDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -ListTemplates lists templates returns a list of all collected alert rule templates -*/ -func (a *Client) ListTemplates(params *ListTemplatesParams, opts ...ClientOption) (*ListTemplatesOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewListTemplatesParams() - } - op := &runtime.ClientOperation{ - ID: "ListTemplates", - Method: "GET", - PathPattern: "/v1/alerting/templates", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &ListTemplatesReader{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.(*ListTemplatesOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*ListTemplatesDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -UpdateTemplate updates template updates existing template previously created via API -*/ -func (a *Client) UpdateTemplate(params *UpdateTemplateParams, opts ...ClientOption) (*UpdateTemplateOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewUpdateTemplateParams() - } - op := &runtime.ClientOperation{ - ID: "UpdateTemplate", - Method: "PUT", - PathPattern: "/v1/alerting/templates/{name}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &UpdateTemplateReader{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.(*UpdateTemplateOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*UpdateTemplateDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/api/alerting/v1/json/client/alerting_service/create_rule_parameters.go b/api/alerting/v1/json/client/alerting_service/create_rule_parameters.go deleted file mode 100644 index d99404fc945..00000000000 --- a/api/alerting/v1/json/client/alerting_service/create_rule_parameters.go +++ /dev/null @@ -1,144 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package alerting_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" -) - -// NewCreateRuleParams creates a new CreateRuleParams 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 NewCreateRuleParams() *CreateRuleParams { - return &CreateRuleParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewCreateRuleParamsWithTimeout creates a new CreateRuleParams object -// with the ability to set a timeout on a request. -func NewCreateRuleParamsWithTimeout(timeout time.Duration) *CreateRuleParams { - return &CreateRuleParams{ - timeout: timeout, - } -} - -// NewCreateRuleParamsWithContext creates a new CreateRuleParams object -// with the ability to set a context for a request. -func NewCreateRuleParamsWithContext(ctx context.Context) *CreateRuleParams { - return &CreateRuleParams{ - Context: ctx, - } -} - -// NewCreateRuleParamsWithHTTPClient creates a new CreateRuleParams object -// with the ability to set a custom HTTPClient for a request. -func NewCreateRuleParamsWithHTTPClient(client *http.Client) *CreateRuleParams { - return &CreateRuleParams{ - HTTPClient: client, - } -} - -/* -CreateRuleParams contains all the parameters to send to the API endpoint - - for the create rule operation. - - Typically these are written to a http.Request. -*/ -type CreateRuleParams struct { - // Body. - Body CreateRuleBody - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the create rule params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateRuleParams) WithDefaults() *CreateRuleParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the create rule params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateRuleParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the create rule params -func (o *CreateRuleParams) WithTimeout(timeout time.Duration) *CreateRuleParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the create rule params -func (o *CreateRuleParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the create rule params -func (o *CreateRuleParams) WithContext(ctx context.Context) *CreateRuleParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the create rule params -func (o *CreateRuleParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the create rule params -func (o *CreateRuleParams) WithHTTPClient(client *http.Client) *CreateRuleParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the create rule params -func (o *CreateRuleParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the create rule params -func (o *CreateRuleParams) WithBody(body CreateRuleBody) *CreateRuleParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the create rule params -func (o *CreateRuleParams) SetBody(body CreateRuleBody) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *CreateRuleParams) 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/alerting/v1/json/client/alerting_service/create_rule_responses.go b/api/alerting/v1/json/client/alerting_service/create_rule_responses.go deleted file mode 100644 index 51443beb017..00000000000 --- a/api/alerting/v1/json/client/alerting_service/create_rule_responses.go +++ /dev/null @@ -1,890 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package alerting_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" -) - -// CreateRuleReader is a Reader for the CreateRule structure. -type CreateRuleReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *CreateRuleReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewCreateRuleOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewCreateRuleDefault(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 - } -} - -// NewCreateRuleOK creates a CreateRuleOK with default headers values -func NewCreateRuleOK() *CreateRuleOK { - return &CreateRuleOK{} -} - -/* -CreateRuleOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type CreateRuleOK struct { - Payload any -} - -// IsSuccess returns true when this create rule Ok response has a 2xx status code -func (o *CreateRuleOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this create rule Ok response has a 3xx status code -func (o *CreateRuleOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create rule Ok response has a 4xx status code -func (o *CreateRuleOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this create rule Ok response has a 5xx status code -func (o *CreateRuleOK) IsServerError() bool { - return false -} - -// IsCode returns true when this create rule Ok response a status code equal to that given -func (o *CreateRuleOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the create rule Ok response -func (o *CreateRuleOK) Code() int { - return 200 -} - -func (o *CreateRuleOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/alerting/rules][%d] createRuleOk %s", 200, payload) -} - -func (o *CreateRuleOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/alerting/rules][%d] createRuleOk %s", 200, payload) -} - -func (o *CreateRuleOK) GetPayload() any { - return o.Payload -} - -func (o *CreateRuleOK) 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) { - return err - } - - return nil -} - -// NewCreateRuleDefault creates a CreateRuleDefault with default headers values -func NewCreateRuleDefault(code int) *CreateRuleDefault { - return &CreateRuleDefault{ - _statusCode: code, - } -} - -/* -CreateRuleDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type CreateRuleDefault struct { - _statusCode int - - Payload *CreateRuleDefaultBody -} - -// IsSuccess returns true when this create rule default response has a 2xx status code -func (o *CreateRuleDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this create rule default response has a 3xx status code -func (o *CreateRuleDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this create rule default response has a 4xx status code -func (o *CreateRuleDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this create rule default response has a 5xx status code -func (o *CreateRuleDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this create rule default response a status code equal to that given -func (o *CreateRuleDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the create rule default response -func (o *CreateRuleDefault) Code() int { - return o._statusCode -} - -func (o *CreateRuleDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/alerting/rules][%d] CreateRule default %s", o._statusCode, payload) -} - -func (o *CreateRuleDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/alerting/rules][%d] CreateRule default %s", o._statusCode, payload) -} - -func (o *CreateRuleDefault) GetPayload() *CreateRuleDefaultBody { - return o.Payload -} - -func (o *CreateRuleDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(CreateRuleDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -CreateRuleBody create rule body -swagger:model CreateRuleBody -*/ -type CreateRuleBody struct { - // Template name. - TemplateName string `json:"template_name,omitempty"` - - // Rule name. - Name string `json:"name,omitempty"` - - // Rule group name. - Group string `json:"group,omitempty"` - - // Folder UID. - FolderUID string `json:"folder_uid,omitempty"` - - // Rule parameters. All template parameters should be set. - Params []*CreateRuleParamsBodyParamsItems0 `json:"params"` - - // Rule duration. Should be set. - For string `json:"for,omitempty"` - - // Severity represents severity level of the check result or alert. - // Enum: ["SEVERITY_UNSPECIFIED","SEVERITY_EMERGENCY","SEVERITY_ALERT","SEVERITY_CRITICAL","SEVERITY_ERROR","SEVERITY_WARNING","SEVERITY_NOTICE","SEVERITY_INFO","SEVERITY_DEBUG"] - Severity *string `json:"severity,omitempty"` - - // All custom labels to add or remove (with empty values) to default labels from template. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // Filters. - Filters []*CreateRuleParamsBodyFiltersItems0 `json:"filters"` - - // Evaluation Interval - Interval string `json:"interval,omitempty"` -} - -// Validate validates this create rule body -func (o *CreateRuleBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateParams(formats); err != nil { - res = append(res, err) - } - - if err := o.validateSeverity(formats); err != nil { - res = append(res, err) - } - - if err := o.validateFilters(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *CreateRuleBody) validateParams(formats strfmt.Registry) error { - if swag.IsZero(o.Params) { // not required - return nil - } - - for i := 0; i < len(o.Params); i++ { - if swag.IsZero(o.Params[i]) { // not required - continue - } - - if o.Params[i] != nil { - if err := o.Params[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "params" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "params" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -var createRuleBodyTypeSeverityPropEnum []any - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["SEVERITY_UNSPECIFIED","SEVERITY_EMERGENCY","SEVERITY_ALERT","SEVERITY_CRITICAL","SEVERITY_ERROR","SEVERITY_WARNING","SEVERITY_NOTICE","SEVERITY_INFO","SEVERITY_DEBUG"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - createRuleBodyTypeSeverityPropEnum = append(createRuleBodyTypeSeverityPropEnum, v) - } -} - -const ( - - // CreateRuleBodySeveritySEVERITYUNSPECIFIED captures enum value "SEVERITY_UNSPECIFIED" - CreateRuleBodySeveritySEVERITYUNSPECIFIED string = "SEVERITY_UNSPECIFIED" - - // CreateRuleBodySeveritySEVERITYEMERGENCY captures enum value "SEVERITY_EMERGENCY" - CreateRuleBodySeveritySEVERITYEMERGENCY string = "SEVERITY_EMERGENCY" - - // CreateRuleBodySeveritySEVERITYALERT captures enum value "SEVERITY_ALERT" - CreateRuleBodySeveritySEVERITYALERT string = "SEVERITY_ALERT" - - // CreateRuleBodySeveritySEVERITYCRITICAL captures enum value "SEVERITY_CRITICAL" - CreateRuleBodySeveritySEVERITYCRITICAL string = "SEVERITY_CRITICAL" - - // CreateRuleBodySeveritySEVERITYERROR captures enum value "SEVERITY_ERROR" - CreateRuleBodySeveritySEVERITYERROR string = "SEVERITY_ERROR" - - // CreateRuleBodySeveritySEVERITYWARNING captures enum value "SEVERITY_WARNING" - CreateRuleBodySeveritySEVERITYWARNING string = "SEVERITY_WARNING" - - // CreateRuleBodySeveritySEVERITYNOTICE captures enum value "SEVERITY_NOTICE" - CreateRuleBodySeveritySEVERITYNOTICE string = "SEVERITY_NOTICE" - - // CreateRuleBodySeveritySEVERITYINFO captures enum value "SEVERITY_INFO" - CreateRuleBodySeveritySEVERITYINFO string = "SEVERITY_INFO" - - // CreateRuleBodySeveritySEVERITYDEBUG captures enum value "SEVERITY_DEBUG" - CreateRuleBodySeveritySEVERITYDEBUG string = "SEVERITY_DEBUG" -) - -// prop value enum -func (o *CreateRuleBody) validateSeverityEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, createRuleBodyTypeSeverityPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *CreateRuleBody) validateSeverity(formats strfmt.Registry) error { - if swag.IsZero(o.Severity) { // not required - return nil - } - - // value enum - if err := o.validateSeverityEnum("body"+"."+"severity", "body", *o.Severity); err != nil { - return err - } - - return nil -} - -func (o *CreateRuleBody) validateFilters(formats strfmt.Registry) error { - if swag.IsZero(o.Filters) { // not required - return nil - } - - for i := 0; i < len(o.Filters); i++ { - if swag.IsZero(o.Filters[i]) { // not required - continue - } - - if o.Filters[i] != nil { - if err := o.Filters[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "filters" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "filters" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this create rule body based on the context it is used -func (o *CreateRuleBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateParams(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateFilters(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *CreateRuleBody) contextValidateParams(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Params); i++ { - if o.Params[i] != nil { - - if swag.IsZero(o.Params[i]) { // not required - return nil - } - - if err := o.Params[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "params" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "params" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -func (o *CreateRuleBody) contextValidateFilters(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Filters); i++ { - if o.Filters[i] != nil { - - if swag.IsZero(o.Filters[i]) { // not required - return nil - } - - if err := o.Filters[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "filters" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "filters" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *CreateRuleBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *CreateRuleBody) UnmarshalBinary(b []byte) error { - var res CreateRuleBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -CreateRuleDefaultBody create rule default body -swagger:model CreateRuleDefaultBody -*/ -type CreateRuleDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*CreateRuleDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this create rule default body -func (o *CreateRuleDefaultBody) 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 *CreateRuleDefaultBody) 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("CreateRule default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("CreateRule default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this create rule default body based on the context it is used -func (o *CreateRuleDefaultBody) 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 *CreateRuleDefaultBody) 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("CreateRule default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("CreateRule default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *CreateRuleDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *CreateRuleDefaultBody) UnmarshalBinary(b []byte) error { - var res CreateRuleDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -CreateRuleDefaultBodyDetailsItems0 create rule default body details items0 -swagger:model CreateRuleDefaultBodyDetailsItems0 -*/ -type CreateRuleDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` - - // create rule default body details items0 - CreateRuleDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *CreateRuleDefaultBodyDetailsItems0) 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 CreateRuleDefaultBodyDetailsItems0 - - 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.CreateRuleDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o CreateRuleDefaultBodyDetailsItems0) 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.CreateRuleDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.CreateRuleDefaultBodyDetailsItems0) - 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 rule default body details items0 -func (o *CreateRuleDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this create rule default body details items0 based on context it is used -func (o *CreateRuleDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *CreateRuleDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *CreateRuleDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res CreateRuleDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -CreateRuleParamsBodyFiltersItems0 Filter represents a single filter condition. -swagger:model CreateRuleParamsBodyFiltersItems0 -*/ -type CreateRuleParamsBodyFiltersItems0 struct { - // FilterType represents filter matching type. - // Enum: ["FILTER_TYPE_UNSPECIFIED","FILTER_TYPE_MATCH","FILTER_TYPE_MISMATCH"] - Type *string `json:"type,omitempty"` - - // label - Label string `json:"label,omitempty"` - - // regexp - Regexp string `json:"regexp,omitempty"` -} - -// Validate validates this create rule params body filters items0 -func (o *CreateRuleParamsBodyFiltersItems0) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var createRuleParamsBodyFiltersItems0TypeTypePropEnum []any - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["FILTER_TYPE_UNSPECIFIED","FILTER_TYPE_MATCH","FILTER_TYPE_MISMATCH"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - createRuleParamsBodyFiltersItems0TypeTypePropEnum = append(createRuleParamsBodyFiltersItems0TypeTypePropEnum, v) - } -} - -const ( - - // CreateRuleParamsBodyFiltersItems0TypeFILTERTYPEUNSPECIFIED captures enum value "FILTER_TYPE_UNSPECIFIED" - CreateRuleParamsBodyFiltersItems0TypeFILTERTYPEUNSPECIFIED string = "FILTER_TYPE_UNSPECIFIED" - - // CreateRuleParamsBodyFiltersItems0TypeFILTERTYPEMATCH captures enum value "FILTER_TYPE_MATCH" - CreateRuleParamsBodyFiltersItems0TypeFILTERTYPEMATCH string = "FILTER_TYPE_MATCH" - - // CreateRuleParamsBodyFiltersItems0TypeFILTERTYPEMISMATCH captures enum value "FILTER_TYPE_MISMATCH" - CreateRuleParamsBodyFiltersItems0TypeFILTERTYPEMISMATCH string = "FILTER_TYPE_MISMATCH" -) - -// prop value enum -func (o *CreateRuleParamsBodyFiltersItems0) validateTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, createRuleParamsBodyFiltersItems0TypeTypePropEnum, true); err != nil { - return err - } - return nil -} - -func (o *CreateRuleParamsBodyFiltersItems0) validateType(formats strfmt.Registry) error { - if swag.IsZero(o.Type) { // not required - return nil - } - - // value enum - if err := o.validateTypeEnum("type", "body", *o.Type); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this create rule params body filters items0 based on context it is used -func (o *CreateRuleParamsBodyFiltersItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *CreateRuleParamsBodyFiltersItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *CreateRuleParamsBodyFiltersItems0) UnmarshalBinary(b []byte) error { - var res CreateRuleParamsBodyFiltersItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -CreateRuleParamsBodyParamsItems0 ParamValue represents a single rule parameter value. -swagger:model CreateRuleParamsBodyParamsItems0 -*/ -type CreateRuleParamsBodyParamsItems0 struct { - // Machine-readable name (ID) that is used in expression. - Name string `json:"name,omitempty"` - - // ParamType represents template parameter type. - // Enum: ["PARAM_TYPE_UNSPECIFIED","PARAM_TYPE_BOOL","PARAM_TYPE_FLOAT","PARAM_TYPE_STRING"] - Type *string `json:"type,omitempty"` - - // Bool value. - Bool bool `json:"bool,omitempty"` - - // Float value. - Float float64 `json:"float,omitempty"` - - // String value. - String string `json:"string,omitempty"` -} - -// Validate validates this create rule params body params items0 -func (o *CreateRuleParamsBodyParamsItems0) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var createRuleParamsBodyParamsItems0TypeTypePropEnum []any - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["PARAM_TYPE_UNSPECIFIED","PARAM_TYPE_BOOL","PARAM_TYPE_FLOAT","PARAM_TYPE_STRING"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - createRuleParamsBodyParamsItems0TypeTypePropEnum = append(createRuleParamsBodyParamsItems0TypeTypePropEnum, v) - } -} - -const ( - - // CreateRuleParamsBodyParamsItems0TypePARAMTYPEUNSPECIFIED captures enum value "PARAM_TYPE_UNSPECIFIED" - CreateRuleParamsBodyParamsItems0TypePARAMTYPEUNSPECIFIED string = "PARAM_TYPE_UNSPECIFIED" - - // CreateRuleParamsBodyParamsItems0TypePARAMTYPEBOOL captures enum value "PARAM_TYPE_BOOL" - CreateRuleParamsBodyParamsItems0TypePARAMTYPEBOOL string = "PARAM_TYPE_BOOL" - - // CreateRuleParamsBodyParamsItems0TypePARAMTYPEFLOAT captures enum value "PARAM_TYPE_FLOAT" - CreateRuleParamsBodyParamsItems0TypePARAMTYPEFLOAT string = "PARAM_TYPE_FLOAT" - - // CreateRuleParamsBodyParamsItems0TypePARAMTYPESTRING captures enum value "PARAM_TYPE_STRING" - CreateRuleParamsBodyParamsItems0TypePARAMTYPESTRING string = "PARAM_TYPE_STRING" -) - -// prop value enum -func (o *CreateRuleParamsBodyParamsItems0) validateTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, createRuleParamsBodyParamsItems0TypeTypePropEnum, true); err != nil { - return err - } - return nil -} - -func (o *CreateRuleParamsBodyParamsItems0) validateType(formats strfmt.Registry) error { - if swag.IsZero(o.Type) { // not required - return nil - } - - // value enum - if err := o.validateTypeEnum("type", "body", *o.Type); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this create rule params body params items0 based on context it is used -func (o *CreateRuleParamsBodyParamsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *CreateRuleParamsBodyParamsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *CreateRuleParamsBodyParamsItems0) UnmarshalBinary(b []byte) error { - var res CreateRuleParamsBodyParamsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/alerting/v1/json/client/alerting_service/create_template_parameters.go b/api/alerting/v1/json/client/alerting_service/create_template_parameters.go deleted file mode 100644 index 7af56c35841..00000000000 --- a/api/alerting/v1/json/client/alerting_service/create_template_parameters.go +++ /dev/null @@ -1,144 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package alerting_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" -) - -// NewCreateTemplateParams creates a new CreateTemplateParams 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 NewCreateTemplateParams() *CreateTemplateParams { - return &CreateTemplateParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewCreateTemplateParamsWithTimeout creates a new CreateTemplateParams object -// with the ability to set a timeout on a request. -func NewCreateTemplateParamsWithTimeout(timeout time.Duration) *CreateTemplateParams { - return &CreateTemplateParams{ - timeout: timeout, - } -} - -// NewCreateTemplateParamsWithContext creates a new CreateTemplateParams object -// with the ability to set a context for a request. -func NewCreateTemplateParamsWithContext(ctx context.Context) *CreateTemplateParams { - return &CreateTemplateParams{ - Context: ctx, - } -} - -// NewCreateTemplateParamsWithHTTPClient creates a new CreateTemplateParams object -// with the ability to set a custom HTTPClient for a request. -func NewCreateTemplateParamsWithHTTPClient(client *http.Client) *CreateTemplateParams { - return &CreateTemplateParams{ - HTTPClient: client, - } -} - -/* -CreateTemplateParams contains all the parameters to send to the API endpoint - - for the create template operation. - - Typically these are written to a http.Request. -*/ -type CreateTemplateParams struct { - // Body. - Body CreateTemplateBody - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the create template params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateTemplateParams) WithDefaults() *CreateTemplateParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the create template params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateTemplateParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the create template params -func (o *CreateTemplateParams) WithTimeout(timeout time.Duration) *CreateTemplateParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the create template params -func (o *CreateTemplateParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the create template params -func (o *CreateTemplateParams) WithContext(ctx context.Context) *CreateTemplateParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the create template params -func (o *CreateTemplateParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the create template params -func (o *CreateTemplateParams) WithHTTPClient(client *http.Client) *CreateTemplateParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the create template params -func (o *CreateTemplateParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the create template params -func (o *CreateTemplateParams) WithBody(body CreateTemplateBody) *CreateTemplateParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the create template params -func (o *CreateTemplateParams) SetBody(body CreateTemplateBody) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *CreateTemplateParams) 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/alerting/v1/json/client/alerting_service/create_template_responses.go b/api/alerting/v1/json/client/alerting_service/create_template_responses.go deleted file mode 100644 index d521ef29139..00000000000 --- a/api/alerting/v1/json/client/alerting_service/create_template_responses.go +++ /dev/null @@ -1,451 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package alerting_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" -) - -// CreateTemplateReader is a Reader for the CreateTemplate structure. -type CreateTemplateReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *CreateTemplateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewCreateTemplateOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewCreateTemplateDefault(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 - } -} - -// NewCreateTemplateOK creates a CreateTemplateOK with default headers values -func NewCreateTemplateOK() *CreateTemplateOK { - return &CreateTemplateOK{} -} - -/* -CreateTemplateOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type CreateTemplateOK struct { - Payload any -} - -// IsSuccess returns true when this create template Ok response has a 2xx status code -func (o *CreateTemplateOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this create template Ok response has a 3xx status code -func (o *CreateTemplateOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create template Ok response has a 4xx status code -func (o *CreateTemplateOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this create template Ok response has a 5xx status code -func (o *CreateTemplateOK) IsServerError() bool { - return false -} - -// IsCode returns true when this create template Ok response a status code equal to that given -func (o *CreateTemplateOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the create template Ok response -func (o *CreateTemplateOK) Code() int { - return 200 -} - -func (o *CreateTemplateOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/alerting/templates][%d] createTemplateOk %s", 200, payload) -} - -func (o *CreateTemplateOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/alerting/templates][%d] createTemplateOk %s", 200, payload) -} - -func (o *CreateTemplateOK) GetPayload() any { - return o.Payload -} - -func (o *CreateTemplateOK) 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) { - return err - } - - return nil -} - -// NewCreateTemplateDefault creates a CreateTemplateDefault with default headers values -func NewCreateTemplateDefault(code int) *CreateTemplateDefault { - return &CreateTemplateDefault{ - _statusCode: code, - } -} - -/* -CreateTemplateDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type CreateTemplateDefault struct { - _statusCode int - - Payload *CreateTemplateDefaultBody -} - -// IsSuccess returns true when this create template default response has a 2xx status code -func (o *CreateTemplateDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this create template default response has a 3xx status code -func (o *CreateTemplateDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this create template default response has a 4xx status code -func (o *CreateTemplateDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this create template default response has a 5xx status code -func (o *CreateTemplateDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this create template default response a status code equal to that given -func (o *CreateTemplateDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the create template default response -func (o *CreateTemplateDefault) Code() int { - return o._statusCode -} - -func (o *CreateTemplateDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/alerting/templates][%d] CreateTemplate default %s", o._statusCode, payload) -} - -func (o *CreateTemplateDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/alerting/templates][%d] CreateTemplate default %s", o._statusCode, payload) -} - -func (o *CreateTemplateDefault) GetPayload() *CreateTemplateDefaultBody { - return o.Payload -} - -func (o *CreateTemplateDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(CreateTemplateDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -CreateTemplateBody create template body -swagger:model CreateTemplateBody -*/ -type CreateTemplateBody struct { - // YAML template file content. - Yaml string `json:"yaml,omitempty"` -} - -// Validate validates this create template body -func (o *CreateTemplateBody) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this create template body based on context it is used -func (o *CreateTemplateBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *CreateTemplateBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *CreateTemplateBody) UnmarshalBinary(b []byte) error { - var res CreateTemplateBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -CreateTemplateDefaultBody create template default body -swagger:model CreateTemplateDefaultBody -*/ -type CreateTemplateDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*CreateTemplateDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this create template default body -func (o *CreateTemplateDefaultBody) 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 *CreateTemplateDefaultBody) 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("CreateTemplate default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("CreateTemplate default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this create template default body based on the context it is used -func (o *CreateTemplateDefaultBody) 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 *CreateTemplateDefaultBody) 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("CreateTemplate default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("CreateTemplate default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *CreateTemplateDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *CreateTemplateDefaultBody) UnmarshalBinary(b []byte) error { - var res CreateTemplateDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -CreateTemplateDefaultBodyDetailsItems0 create template default body details items0 -swagger:model CreateTemplateDefaultBodyDetailsItems0 -*/ -type CreateTemplateDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` - - // create template default body details items0 - CreateTemplateDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *CreateTemplateDefaultBodyDetailsItems0) 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 CreateTemplateDefaultBodyDetailsItems0 - - 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.CreateTemplateDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o CreateTemplateDefaultBodyDetailsItems0) 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.CreateTemplateDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.CreateTemplateDefaultBodyDetailsItems0) - 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 template default body details items0 -func (o *CreateTemplateDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this create template default body details items0 based on context it is used -func (o *CreateTemplateDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *CreateTemplateDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *CreateTemplateDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res CreateTemplateDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/alerting/v1/json/client/alerting_service/delete_template_parameters.go b/api/alerting/v1/json/client/alerting_service/delete_template_parameters.go deleted file mode 100644 index 12c5e9f70f9..00000000000 --- a/api/alerting/v1/json/client/alerting_service/delete_template_parameters.go +++ /dev/null @@ -1,146 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package alerting_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" -) - -// NewDeleteTemplateParams creates a new DeleteTemplateParams 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 NewDeleteTemplateParams() *DeleteTemplateParams { - return &DeleteTemplateParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDeleteTemplateParamsWithTimeout creates a new DeleteTemplateParams object -// with the ability to set a timeout on a request. -func NewDeleteTemplateParamsWithTimeout(timeout time.Duration) *DeleteTemplateParams { - return &DeleteTemplateParams{ - timeout: timeout, - } -} - -// NewDeleteTemplateParamsWithContext creates a new DeleteTemplateParams object -// with the ability to set a context for a request. -func NewDeleteTemplateParamsWithContext(ctx context.Context) *DeleteTemplateParams { - return &DeleteTemplateParams{ - Context: ctx, - } -} - -// NewDeleteTemplateParamsWithHTTPClient creates a new DeleteTemplateParams object -// with the ability to set a custom HTTPClient for a request. -func NewDeleteTemplateParamsWithHTTPClient(client *http.Client) *DeleteTemplateParams { - return &DeleteTemplateParams{ - HTTPClient: client, - } -} - -/* -DeleteTemplateParams contains all the parameters to send to the API endpoint - - for the delete template operation. - - Typically these are written to a http.Request. -*/ -type DeleteTemplateParams struct { - // Name. - Name string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the delete template params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteTemplateParams) WithDefaults() *DeleteTemplateParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the delete template params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteTemplateParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the delete template params -func (o *DeleteTemplateParams) WithTimeout(timeout time.Duration) *DeleteTemplateParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the delete template params -func (o *DeleteTemplateParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the delete template params -func (o *DeleteTemplateParams) WithContext(ctx context.Context) *DeleteTemplateParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the delete template params -func (o *DeleteTemplateParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the delete template params -func (o *DeleteTemplateParams) WithHTTPClient(client *http.Client) *DeleteTemplateParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the delete template params -func (o *DeleteTemplateParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithName adds the name to the delete template params -func (o *DeleteTemplateParams) WithName(name string) *DeleteTemplateParams { - o.SetName(name) - return o -} - -// SetName adds the name to the delete template params -func (o *DeleteTemplateParams) SetName(name string) { - o.Name = name -} - -// WriteToRequest writes these params to a swagger request -func (o *DeleteTemplateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param name - if err := r.SetPathParam("name", o.Name); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/api/alerting/v1/json/client/alerting_service/delete_template_responses.go b/api/alerting/v1/json/client/alerting_service/delete_template_responses.go deleted file mode 100644 index 2f12e61369a..00000000000 --- a/api/alerting/v1/json/client/alerting_service/delete_template_responses.go +++ /dev/null @@ -1,414 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package alerting_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" -) - -// DeleteTemplateReader is a Reader for the DeleteTemplate structure. -type DeleteTemplateReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DeleteTemplateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewDeleteTemplateOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewDeleteTemplateDefault(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 - } -} - -// NewDeleteTemplateOK creates a DeleteTemplateOK with default headers values -func NewDeleteTemplateOK() *DeleteTemplateOK { - return &DeleteTemplateOK{} -} - -/* -DeleteTemplateOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type DeleteTemplateOK struct { - Payload any -} - -// IsSuccess returns true when this delete template Ok response has a 2xx status code -func (o *DeleteTemplateOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this delete template Ok response has a 3xx status code -func (o *DeleteTemplateOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this delete template Ok response has a 4xx status code -func (o *DeleteTemplateOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this delete template Ok response has a 5xx status code -func (o *DeleteTemplateOK) IsServerError() bool { - return false -} - -// IsCode returns true when this delete template Ok response a status code equal to that given -func (o *DeleteTemplateOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the delete template Ok response -func (o *DeleteTemplateOK) Code() int { - return 200 -} - -func (o *DeleteTemplateOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/alerting/templates/{name}][%d] deleteTemplateOk %s", 200, payload) -} - -func (o *DeleteTemplateOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/alerting/templates/{name}][%d] deleteTemplateOk %s", 200, payload) -} - -func (o *DeleteTemplateOK) GetPayload() any { - return o.Payload -} - -func (o *DeleteTemplateOK) 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) { - return err - } - - return nil -} - -// NewDeleteTemplateDefault creates a DeleteTemplateDefault with default headers values -func NewDeleteTemplateDefault(code int) *DeleteTemplateDefault { - return &DeleteTemplateDefault{ - _statusCode: code, - } -} - -/* -DeleteTemplateDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type DeleteTemplateDefault struct { - _statusCode int - - Payload *DeleteTemplateDefaultBody -} - -// IsSuccess returns true when this delete template default response has a 2xx status code -func (o *DeleteTemplateDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this delete template default response has a 3xx status code -func (o *DeleteTemplateDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this delete template default response has a 4xx status code -func (o *DeleteTemplateDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this delete template default response has a 5xx status code -func (o *DeleteTemplateDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this delete template default response a status code equal to that given -func (o *DeleteTemplateDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the delete template default response -func (o *DeleteTemplateDefault) Code() int { - return o._statusCode -} - -func (o *DeleteTemplateDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/alerting/templates/{name}][%d] DeleteTemplate default %s", o._statusCode, payload) -} - -func (o *DeleteTemplateDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/alerting/templates/{name}][%d] DeleteTemplate default %s", o._statusCode, payload) -} - -func (o *DeleteTemplateDefault) GetPayload() *DeleteTemplateDefaultBody { - return o.Payload -} - -func (o *DeleteTemplateDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(DeleteTemplateDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -DeleteTemplateDefaultBody delete template default body -swagger:model DeleteTemplateDefaultBody -*/ -type DeleteTemplateDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*DeleteTemplateDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this delete template default body -func (o *DeleteTemplateDefaultBody) 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 *DeleteTemplateDefaultBody) 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("DeleteTemplate default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("DeleteTemplate default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this delete template default body based on the context it is used -func (o *DeleteTemplateDefaultBody) 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 *DeleteTemplateDefaultBody) 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("DeleteTemplate default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("DeleteTemplate default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *DeleteTemplateDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *DeleteTemplateDefaultBody) UnmarshalBinary(b []byte) error { - var res DeleteTemplateDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -DeleteTemplateDefaultBodyDetailsItems0 delete template default body details items0 -swagger:model DeleteTemplateDefaultBodyDetailsItems0 -*/ -type DeleteTemplateDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` - - // delete template default body details items0 - DeleteTemplateDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *DeleteTemplateDefaultBodyDetailsItems0) 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 DeleteTemplateDefaultBodyDetailsItems0 - - 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.DeleteTemplateDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o DeleteTemplateDefaultBodyDetailsItems0) 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.DeleteTemplateDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.DeleteTemplateDefaultBodyDetailsItems0) - 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 delete template default body details items0 -func (o *DeleteTemplateDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this delete template default body details items0 based on context it is used -func (o *DeleteTemplateDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *DeleteTemplateDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *DeleteTemplateDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res DeleteTemplateDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/alerting/v1/json/client/alerting_service/list_templates_parameters.go b/api/alerting/v1/json/client/alerting_service/list_templates_parameters.go deleted file mode 100644 index 54f826721d0..00000000000 --- a/api/alerting/v1/json/client/alerting_service/list_templates_parameters.go +++ /dev/null @@ -1,231 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package alerting_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" - "github.com/go-openapi/swag" -) - -// NewListTemplatesParams creates a new ListTemplatesParams 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 NewListTemplatesParams() *ListTemplatesParams { - return &ListTemplatesParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListTemplatesParamsWithTimeout creates a new ListTemplatesParams object -// with the ability to set a timeout on a request. -func NewListTemplatesParamsWithTimeout(timeout time.Duration) *ListTemplatesParams { - return &ListTemplatesParams{ - timeout: timeout, - } -} - -// NewListTemplatesParamsWithContext creates a new ListTemplatesParams object -// with the ability to set a context for a request. -func NewListTemplatesParamsWithContext(ctx context.Context) *ListTemplatesParams { - return &ListTemplatesParams{ - Context: ctx, - } -} - -// NewListTemplatesParamsWithHTTPClient creates a new ListTemplatesParams object -// with the ability to set a custom HTTPClient for a request. -func NewListTemplatesParamsWithHTTPClient(client *http.Client) *ListTemplatesParams { - return &ListTemplatesParams{ - HTTPClient: client, - } -} - -/* -ListTemplatesParams contains all the parameters to send to the API endpoint - - for the list templates operation. - - Typically these are written to a http.Request. -*/ -type ListTemplatesParams struct { - /* PageIndex. - - Index of the requested page, starts from 0. - - Format: int32 - */ - PageIndex *int32 - - /* PageSize. - - Maximum number of results per page. - - Format: int32 - */ - PageSize *int32 - - /* Reload. - - If true, template files will be re-read from disk. - */ - Reload *bool - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list templates params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListTemplatesParams) WithDefaults() *ListTemplatesParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list templates params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListTemplatesParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list templates params -func (o *ListTemplatesParams) WithTimeout(timeout time.Duration) *ListTemplatesParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list templates params -func (o *ListTemplatesParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list templates params -func (o *ListTemplatesParams) WithContext(ctx context.Context) *ListTemplatesParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list templates params -func (o *ListTemplatesParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list templates params -func (o *ListTemplatesParams) WithHTTPClient(client *http.Client) *ListTemplatesParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list templates params -func (o *ListTemplatesParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithPageIndex adds the pageIndex to the list templates params -func (o *ListTemplatesParams) WithPageIndex(pageIndex *int32) *ListTemplatesParams { - o.SetPageIndex(pageIndex) - return o -} - -// SetPageIndex adds the pageIndex to the list templates params -func (o *ListTemplatesParams) SetPageIndex(pageIndex *int32) { - o.PageIndex = pageIndex -} - -// WithPageSize adds the pageSize to the list templates params -func (o *ListTemplatesParams) WithPageSize(pageSize *int32) *ListTemplatesParams { - o.SetPageSize(pageSize) - return o -} - -// SetPageSize adds the pageSize to the list templates params -func (o *ListTemplatesParams) SetPageSize(pageSize *int32) { - o.PageSize = pageSize -} - -// WithReload adds the reload to the list templates params -func (o *ListTemplatesParams) WithReload(reload *bool) *ListTemplatesParams { - o.SetReload(reload) - return o -} - -// SetReload adds the reload to the list templates params -func (o *ListTemplatesParams) SetReload(reload *bool) { - o.Reload = reload -} - -// WriteToRequest writes these params to a swagger request -func (o *ListTemplatesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.PageIndex != nil { - - // query param page_index - var qrPageIndex int32 - - if o.PageIndex != nil { - qrPageIndex = *o.PageIndex - } - qPageIndex := swag.FormatInt32(qrPageIndex) - if qPageIndex != "" { - if err := r.SetQueryParam("page_index", qPageIndex); err != nil { - return err - } - } - } - - if o.PageSize != nil { - - // query param page_size - var qrPageSize int32 - - if o.PageSize != nil { - qrPageSize = *o.PageSize - } - qPageSize := swag.FormatInt32(qrPageSize) - if qPageSize != "" { - if err := r.SetQueryParam("page_size", qPageSize); err != nil { - return err - } - } - } - - if o.Reload != nil { - - // query param reload - var qrReload bool - - if o.Reload != nil { - qrReload = *o.Reload - } - qReload := swag.FormatBool(qrReload) - if qReload != "" { - if err := r.SetQueryParam("reload", qReload); err != nil { - return err - } - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/api/alerting/v1/json/client/alerting_service/list_templates_responses.go b/api/alerting/v1/json/client/alerting_service/list_templates_responses.go deleted file mode 100644 index e3ef0e66c65..00000000000 --- a/api/alerting/v1/json/client/alerting_service/list_templates_responses.go +++ /dev/null @@ -1,1275 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package alerting_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" -) - -// ListTemplatesReader is a Reader for the ListTemplates structure. -type ListTemplatesReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListTemplatesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewListTemplatesOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewListTemplatesDefault(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 - } -} - -// NewListTemplatesOK creates a ListTemplatesOK with default headers values -func NewListTemplatesOK() *ListTemplatesOK { - return &ListTemplatesOK{} -} - -/* -ListTemplatesOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type ListTemplatesOK struct { - Payload *ListTemplatesOKBody -} - -// IsSuccess returns true when this list templates Ok response has a 2xx status code -func (o *ListTemplatesOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this list templates Ok response has a 3xx status code -func (o *ListTemplatesOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this list templates Ok response has a 4xx status code -func (o *ListTemplatesOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this list templates Ok response has a 5xx status code -func (o *ListTemplatesOK) IsServerError() bool { - return false -} - -// IsCode returns true when this list templates Ok response a status code equal to that given -func (o *ListTemplatesOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the list templates Ok response -func (o *ListTemplatesOK) Code() int { - return 200 -} - -func (o *ListTemplatesOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/alerting/templates][%d] listTemplatesOk %s", 200, payload) -} - -func (o *ListTemplatesOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/alerting/templates][%d] listTemplatesOk %s", 200, payload) -} - -func (o *ListTemplatesOK) GetPayload() *ListTemplatesOKBody { - return o.Payload -} - -func (o *ListTemplatesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(ListTemplatesOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -// NewListTemplatesDefault creates a ListTemplatesDefault with default headers values -func NewListTemplatesDefault(code int) *ListTemplatesDefault { - return &ListTemplatesDefault{ - _statusCode: code, - } -} - -/* -ListTemplatesDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type ListTemplatesDefault struct { - _statusCode int - - Payload *ListTemplatesDefaultBody -} - -// IsSuccess returns true when this list templates default response has a 2xx status code -func (o *ListTemplatesDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this list templates default response has a 3xx status code -func (o *ListTemplatesDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this list templates default response has a 4xx status code -func (o *ListTemplatesDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this list templates default response has a 5xx status code -func (o *ListTemplatesDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this list templates default response a status code equal to that given -func (o *ListTemplatesDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the list templates default response -func (o *ListTemplatesDefault) Code() int { - return o._statusCode -} - -func (o *ListTemplatesDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/alerting/templates][%d] ListTemplates default %s", o._statusCode, payload) -} - -func (o *ListTemplatesDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/alerting/templates][%d] ListTemplates default %s", o._statusCode, payload) -} - -func (o *ListTemplatesDefault) GetPayload() *ListTemplatesDefaultBody { - return o.Payload -} - -func (o *ListTemplatesDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(ListTemplatesDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -ListTemplatesDefaultBody list templates default body -swagger:model ListTemplatesDefaultBody -*/ -type ListTemplatesDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*ListTemplatesDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this list templates default body -func (o *ListTemplatesDefaultBody) 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 *ListTemplatesDefaultBody) 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("ListTemplates default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("ListTemplates default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this list templates default body based on the context it is used -func (o *ListTemplatesDefaultBody) 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 *ListTemplatesDefaultBody) 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("ListTemplates default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("ListTemplates default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListTemplatesDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListTemplatesDefaultBody) UnmarshalBinary(b []byte) error { - var res ListTemplatesDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListTemplatesDefaultBodyDetailsItems0 list templates default body details items0 -swagger:model ListTemplatesDefaultBodyDetailsItems0 -*/ -type ListTemplatesDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` - - // list templates default body details items0 - ListTemplatesDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *ListTemplatesDefaultBodyDetailsItems0) 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 ListTemplatesDefaultBodyDetailsItems0 - - 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.ListTemplatesDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o ListTemplatesDefaultBodyDetailsItems0) 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.ListTemplatesDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.ListTemplatesDefaultBodyDetailsItems0) - 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 list templates default body details items0 -func (o *ListTemplatesDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list templates default body details items0 based on context it is used -func (o *ListTemplatesDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListTemplatesDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListTemplatesDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res ListTemplatesDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListTemplatesOKBody list templates OK body -swagger:model ListTemplatesOKBody -*/ -type ListTemplatesOKBody struct { - // Total number of results. - TotalItems int32 `json:"total_items,omitempty"` - - // Total number of pages. - TotalPages int32 `json:"total_pages,omitempty"` - - // Alerting templates. - Templates []*ListTemplatesOKBodyTemplatesItems0 `json:"templates"` -} - -// Validate validates this list templates OK body -func (o *ListTemplatesOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateTemplates(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListTemplatesOKBody) validateTemplates(formats strfmt.Registry) error { - if swag.IsZero(o.Templates) { // not required - return nil - } - - for i := 0; i < len(o.Templates); i++ { - if swag.IsZero(o.Templates[i]) { // not required - continue - } - - if o.Templates[i] != nil { - if err := o.Templates[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listTemplatesOk" + "." + "templates" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listTemplatesOk" + "." + "templates" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this list templates OK body based on the context it is used -func (o *ListTemplatesOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateTemplates(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListTemplatesOKBody) contextValidateTemplates(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Templates); i++ { - if o.Templates[i] != nil { - - if swag.IsZero(o.Templates[i]) { // not required - return nil - } - - if err := o.Templates[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listTemplatesOk" + "." + "templates" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listTemplatesOk" + "." + "templates" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListTemplatesOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListTemplatesOKBody) UnmarshalBinary(b []byte) error { - var res ListTemplatesOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListTemplatesOKBodyTemplatesItems0 Template represents Alert Template that is used to create Alert Rule. -swagger:model ListTemplatesOKBodyTemplatesItems0 -*/ -type ListTemplatesOKBodyTemplatesItems0 struct { - // Machine-readable name (ID). - Name string `json:"name,omitempty"` - - // Short human-readable summary. - Summary string `json:"summary,omitempty"` - - // PromQL query expression with templating parameters. - Expr string `json:"expr,omitempty"` - - // Query parameters definitions. - Params []*ListTemplatesOKBodyTemplatesItems0ParamsItems0 `json:"params"` - - // Default duration value. - For string `json:"for,omitempty"` - - // Severity represents severity level of the check result or alert. - // Enum: ["SEVERITY_UNSPECIFIED","SEVERITY_EMERGENCY","SEVERITY_ALERT","SEVERITY_CRITICAL","SEVERITY_ERROR","SEVERITY_WARNING","SEVERITY_NOTICE","SEVERITY_INFO","SEVERITY_DEBUG"] - Severity *string `json:"severity,omitempty"` - - // Labels. - Labels map[string]string `json:"labels,omitempty"` - - // Annotations. - Annotations map[string]string `json:"annotations,omitempty"` - - // TemplateSource defines template source. - // - // - TEMPLATE_SOURCE_BUILT_IN: Template that is shipped with PMM Server releases. - // - TEMPLATE_SOURCE_SAAS: Template that is downloaded from check.percona.com. - // - TEMPLATE_SOURCE_USER_FILE: Templated loaded from user-suplied file. - // - TEMPLATE_SOURCE_USER_API: Templated created via API. - // Enum: ["TEMPLATE_SOURCE_UNSPECIFIED","TEMPLATE_SOURCE_BUILT_IN","TEMPLATE_SOURCE_SAAS","TEMPLATE_SOURCE_USER_FILE","TEMPLATE_SOURCE_USER_API"] - Source *string `json:"source,omitempty"` - - // Template creation time. Empty for built-in and SaaS templates. - // Format: date-time - CreatedAt strfmt.DateTime `json:"created_at,omitempty"` - - // YAML template file content. Empty for built-in and SaaS templates. - Yaml string `json:"yaml,omitempty"` -} - -// Validate validates this list templates OK body templates items0 -func (o *ListTemplatesOKBodyTemplatesItems0) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateParams(formats); err != nil { - res = append(res, err) - } - - if err := o.validateSeverity(formats); err != nil { - res = append(res, err) - } - - if err := o.validateSource(formats); err != nil { - res = append(res, err) - } - - if err := o.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListTemplatesOKBodyTemplatesItems0) validateParams(formats strfmt.Registry) error { - if swag.IsZero(o.Params) { // not required - return nil - } - - for i := 0; i < len(o.Params); i++ { - if swag.IsZero(o.Params[i]) { // not required - continue - } - - if o.Params[i] != nil { - if err := o.Params[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("params" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("params" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -var listTemplatesOkBodyTemplatesItems0TypeSeverityPropEnum []any - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["SEVERITY_UNSPECIFIED","SEVERITY_EMERGENCY","SEVERITY_ALERT","SEVERITY_CRITICAL","SEVERITY_ERROR","SEVERITY_WARNING","SEVERITY_NOTICE","SEVERITY_INFO","SEVERITY_DEBUG"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - listTemplatesOkBodyTemplatesItems0TypeSeverityPropEnum = append(listTemplatesOkBodyTemplatesItems0TypeSeverityPropEnum, v) - } -} - -const ( - - // ListTemplatesOKBodyTemplatesItems0SeveritySEVERITYUNSPECIFIED captures enum value "SEVERITY_UNSPECIFIED" - ListTemplatesOKBodyTemplatesItems0SeveritySEVERITYUNSPECIFIED string = "SEVERITY_UNSPECIFIED" - - // ListTemplatesOKBodyTemplatesItems0SeveritySEVERITYEMERGENCY captures enum value "SEVERITY_EMERGENCY" - ListTemplatesOKBodyTemplatesItems0SeveritySEVERITYEMERGENCY string = "SEVERITY_EMERGENCY" - - // ListTemplatesOKBodyTemplatesItems0SeveritySEVERITYALERT captures enum value "SEVERITY_ALERT" - ListTemplatesOKBodyTemplatesItems0SeveritySEVERITYALERT string = "SEVERITY_ALERT" - - // ListTemplatesOKBodyTemplatesItems0SeveritySEVERITYCRITICAL captures enum value "SEVERITY_CRITICAL" - ListTemplatesOKBodyTemplatesItems0SeveritySEVERITYCRITICAL string = "SEVERITY_CRITICAL" - - // ListTemplatesOKBodyTemplatesItems0SeveritySEVERITYERROR captures enum value "SEVERITY_ERROR" - ListTemplatesOKBodyTemplatesItems0SeveritySEVERITYERROR string = "SEVERITY_ERROR" - - // ListTemplatesOKBodyTemplatesItems0SeveritySEVERITYWARNING captures enum value "SEVERITY_WARNING" - ListTemplatesOKBodyTemplatesItems0SeveritySEVERITYWARNING string = "SEVERITY_WARNING" - - // ListTemplatesOKBodyTemplatesItems0SeveritySEVERITYNOTICE captures enum value "SEVERITY_NOTICE" - ListTemplatesOKBodyTemplatesItems0SeveritySEVERITYNOTICE string = "SEVERITY_NOTICE" - - // ListTemplatesOKBodyTemplatesItems0SeveritySEVERITYINFO captures enum value "SEVERITY_INFO" - ListTemplatesOKBodyTemplatesItems0SeveritySEVERITYINFO string = "SEVERITY_INFO" - - // ListTemplatesOKBodyTemplatesItems0SeveritySEVERITYDEBUG captures enum value "SEVERITY_DEBUG" - ListTemplatesOKBodyTemplatesItems0SeveritySEVERITYDEBUG string = "SEVERITY_DEBUG" -) - -// prop value enum -func (o *ListTemplatesOKBodyTemplatesItems0) validateSeverityEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, listTemplatesOkBodyTemplatesItems0TypeSeverityPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ListTemplatesOKBodyTemplatesItems0) validateSeverity(formats strfmt.Registry) error { - if swag.IsZero(o.Severity) { // not required - return nil - } - - // value enum - if err := o.validateSeverityEnum("severity", "body", *o.Severity); err != nil { - return err - } - - return nil -} - -var listTemplatesOkBodyTemplatesItems0TypeSourcePropEnum []any - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["TEMPLATE_SOURCE_UNSPECIFIED","TEMPLATE_SOURCE_BUILT_IN","TEMPLATE_SOURCE_SAAS","TEMPLATE_SOURCE_USER_FILE","TEMPLATE_SOURCE_USER_API"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - listTemplatesOkBodyTemplatesItems0TypeSourcePropEnum = append(listTemplatesOkBodyTemplatesItems0TypeSourcePropEnum, v) - } -} - -const ( - - // ListTemplatesOKBodyTemplatesItems0SourceTEMPLATESOURCEUNSPECIFIED captures enum value "TEMPLATE_SOURCE_UNSPECIFIED" - ListTemplatesOKBodyTemplatesItems0SourceTEMPLATESOURCEUNSPECIFIED string = "TEMPLATE_SOURCE_UNSPECIFIED" - - // ListTemplatesOKBodyTemplatesItems0SourceTEMPLATESOURCEBUILTIN captures enum value "TEMPLATE_SOURCE_BUILT_IN" - ListTemplatesOKBodyTemplatesItems0SourceTEMPLATESOURCEBUILTIN string = "TEMPLATE_SOURCE_BUILT_IN" - - // ListTemplatesOKBodyTemplatesItems0SourceTEMPLATESOURCESAAS captures enum value "TEMPLATE_SOURCE_SAAS" - ListTemplatesOKBodyTemplatesItems0SourceTEMPLATESOURCESAAS string = "TEMPLATE_SOURCE_SAAS" - - // ListTemplatesOKBodyTemplatesItems0SourceTEMPLATESOURCEUSERFILE captures enum value "TEMPLATE_SOURCE_USER_FILE" - ListTemplatesOKBodyTemplatesItems0SourceTEMPLATESOURCEUSERFILE string = "TEMPLATE_SOURCE_USER_FILE" - - // ListTemplatesOKBodyTemplatesItems0SourceTEMPLATESOURCEUSERAPI captures enum value "TEMPLATE_SOURCE_USER_API" - ListTemplatesOKBodyTemplatesItems0SourceTEMPLATESOURCEUSERAPI string = "TEMPLATE_SOURCE_USER_API" -) - -// prop value enum -func (o *ListTemplatesOKBodyTemplatesItems0) validateSourceEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, listTemplatesOkBodyTemplatesItems0TypeSourcePropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ListTemplatesOKBodyTemplatesItems0) validateSource(formats strfmt.Registry) error { - if swag.IsZero(o.Source) { // not required - return nil - } - - // value enum - if err := o.validateSourceEnum("source", "body", *o.Source); err != nil { - return err - } - - return nil -} - -func (o *ListTemplatesOKBodyTemplatesItems0) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(o.CreatedAt) { // not required - return nil - } - - if err := validate.FormatOf("created_at", "body", "date-time", o.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this list templates OK body templates items0 based on the context it is used -func (o *ListTemplatesOKBodyTemplatesItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateParams(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListTemplatesOKBodyTemplatesItems0) contextValidateParams(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Params); i++ { - if o.Params[i] != nil { - - if swag.IsZero(o.Params[i]) { // not required - return nil - } - - if err := o.Params[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("params" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("params" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListTemplatesOKBodyTemplatesItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListTemplatesOKBodyTemplatesItems0) UnmarshalBinary(b []byte) error { - var res ListTemplatesOKBodyTemplatesItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListTemplatesOKBodyTemplatesItems0ParamsItems0 ParamDefinition represents a single query parameter. -swagger:model ListTemplatesOKBodyTemplatesItems0ParamsItems0 -*/ -type ListTemplatesOKBodyTemplatesItems0ParamsItems0 struct { - // Machine-readable name (ID) that is used in expression. - Name string `json:"name,omitempty"` - - // Short human-readable parameter summary. - Summary string `json:"summary,omitempty"` - - // ParamUnit represents template parameter unit. - // - // - PARAM_UNIT_UNSPECIFIED: Invalid, unknown or absent. - // - PARAM_UNIT_PERCENTAGE: % - // - PARAM_UNIT_SECONDS: s - // Enum: ["PARAM_UNIT_UNSPECIFIED","PARAM_UNIT_PERCENTAGE","PARAM_UNIT_SECONDS"] - Unit *string `json:"unit,omitempty"` - - // ParamType represents template parameter type. - // Enum: ["PARAM_TYPE_UNSPECIFIED","PARAM_TYPE_BOOL","PARAM_TYPE_FLOAT","PARAM_TYPE_STRING"] - Type *string `json:"type,omitempty"` - - // bool - Bool *ListTemplatesOKBodyTemplatesItems0ParamsItems0Bool `json:"bool,omitempty"` - - // float - Float *ListTemplatesOKBodyTemplatesItems0ParamsItems0Float `json:"float,omitempty"` - - // string - String *ListTemplatesOKBodyTemplatesItems0ParamsItems0String `json:"string,omitempty"` -} - -// Validate validates this list templates OK body templates items0 params items0 -func (o *ListTemplatesOKBodyTemplatesItems0ParamsItems0) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateUnit(formats); err != nil { - res = append(res, err) - } - - if err := o.validateType(formats); err != nil { - res = append(res, err) - } - - if err := o.validateBool(formats); err != nil { - res = append(res, err) - } - - if err := o.validateFloat(formats); err != nil { - res = append(res, err) - } - - if err := o.validateString(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var listTemplatesOkBodyTemplatesItems0ParamsItems0TypeUnitPropEnum []any - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["PARAM_UNIT_UNSPECIFIED","PARAM_UNIT_PERCENTAGE","PARAM_UNIT_SECONDS"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - listTemplatesOkBodyTemplatesItems0ParamsItems0TypeUnitPropEnum = append(listTemplatesOkBodyTemplatesItems0ParamsItems0TypeUnitPropEnum, v) - } -} - -const ( - - // ListTemplatesOKBodyTemplatesItems0ParamsItems0UnitPARAMUNITUNSPECIFIED captures enum value "PARAM_UNIT_UNSPECIFIED" - ListTemplatesOKBodyTemplatesItems0ParamsItems0UnitPARAMUNITUNSPECIFIED string = "PARAM_UNIT_UNSPECIFIED" - - // ListTemplatesOKBodyTemplatesItems0ParamsItems0UnitPARAMUNITPERCENTAGE captures enum value "PARAM_UNIT_PERCENTAGE" - ListTemplatesOKBodyTemplatesItems0ParamsItems0UnitPARAMUNITPERCENTAGE string = "PARAM_UNIT_PERCENTAGE" - - // ListTemplatesOKBodyTemplatesItems0ParamsItems0UnitPARAMUNITSECONDS captures enum value "PARAM_UNIT_SECONDS" - ListTemplatesOKBodyTemplatesItems0ParamsItems0UnitPARAMUNITSECONDS string = "PARAM_UNIT_SECONDS" -) - -// prop value enum -func (o *ListTemplatesOKBodyTemplatesItems0ParamsItems0) validateUnitEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, listTemplatesOkBodyTemplatesItems0ParamsItems0TypeUnitPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ListTemplatesOKBodyTemplatesItems0ParamsItems0) validateUnit(formats strfmt.Registry) error { - if swag.IsZero(o.Unit) { // not required - return nil - } - - // value enum - if err := o.validateUnitEnum("unit", "body", *o.Unit); err != nil { - return err - } - - return nil -} - -var listTemplatesOkBodyTemplatesItems0ParamsItems0TypeTypePropEnum []any - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["PARAM_TYPE_UNSPECIFIED","PARAM_TYPE_BOOL","PARAM_TYPE_FLOAT","PARAM_TYPE_STRING"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - listTemplatesOkBodyTemplatesItems0ParamsItems0TypeTypePropEnum = append(listTemplatesOkBodyTemplatesItems0ParamsItems0TypeTypePropEnum, v) - } -} - -const ( - - // ListTemplatesOKBodyTemplatesItems0ParamsItems0TypePARAMTYPEUNSPECIFIED captures enum value "PARAM_TYPE_UNSPECIFIED" - ListTemplatesOKBodyTemplatesItems0ParamsItems0TypePARAMTYPEUNSPECIFIED string = "PARAM_TYPE_UNSPECIFIED" - - // ListTemplatesOKBodyTemplatesItems0ParamsItems0TypePARAMTYPEBOOL captures enum value "PARAM_TYPE_BOOL" - ListTemplatesOKBodyTemplatesItems0ParamsItems0TypePARAMTYPEBOOL string = "PARAM_TYPE_BOOL" - - // ListTemplatesOKBodyTemplatesItems0ParamsItems0TypePARAMTYPEFLOAT captures enum value "PARAM_TYPE_FLOAT" - ListTemplatesOKBodyTemplatesItems0ParamsItems0TypePARAMTYPEFLOAT string = "PARAM_TYPE_FLOAT" - - // ListTemplatesOKBodyTemplatesItems0ParamsItems0TypePARAMTYPESTRING captures enum value "PARAM_TYPE_STRING" - ListTemplatesOKBodyTemplatesItems0ParamsItems0TypePARAMTYPESTRING string = "PARAM_TYPE_STRING" -) - -// prop value enum -func (o *ListTemplatesOKBodyTemplatesItems0ParamsItems0) validateTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, listTemplatesOkBodyTemplatesItems0ParamsItems0TypeTypePropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ListTemplatesOKBodyTemplatesItems0ParamsItems0) validateType(formats strfmt.Registry) error { - if swag.IsZero(o.Type) { // not required - return nil - } - - // value enum - if err := o.validateTypeEnum("type", "body", *o.Type); err != nil { - return err - } - - return nil -} - -func (o *ListTemplatesOKBodyTemplatesItems0ParamsItems0) validateBool(formats strfmt.Registry) error { - if swag.IsZero(o.Bool) { // not required - return nil - } - - if o.Bool != nil { - if err := o.Bool.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("bool") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("bool") - } - - return err - } - } - - return nil -} - -func (o *ListTemplatesOKBodyTemplatesItems0ParamsItems0) validateFloat(formats strfmt.Registry) error { - if swag.IsZero(o.Float) { // not required - return nil - } - - if o.Float != nil { - if err := o.Float.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("float") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("float") - } - - return err - } - } - - return nil -} - -func (o *ListTemplatesOKBodyTemplatesItems0ParamsItems0) validateString(formats strfmt.Registry) error { - if swag.IsZero(o.String) { // not required - return nil - } - - if o.String != nil { - if err := o.String.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("string") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("string") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this list templates OK body templates items0 params items0 based on the context it is used -func (o *ListTemplatesOKBodyTemplatesItems0ParamsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateBool(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateFloat(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateString(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListTemplatesOKBodyTemplatesItems0ParamsItems0) contextValidateBool(ctx context.Context, formats strfmt.Registry) error { - if o.Bool != nil { - - if swag.IsZero(o.Bool) { // not required - return nil - } - - if err := o.Bool.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("bool") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("bool") - } - - return err - } - } - - return nil -} - -func (o *ListTemplatesOKBodyTemplatesItems0ParamsItems0) contextValidateFloat(ctx context.Context, formats strfmt.Registry) error { - if o.Float != nil { - - if swag.IsZero(o.Float) { // not required - return nil - } - - if err := o.Float.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("float") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("float") - } - - return err - } - } - - return nil -} - -func (o *ListTemplatesOKBodyTemplatesItems0ParamsItems0) contextValidateString(ctx context.Context, formats strfmt.Registry) error { - if o.String != nil { - - if swag.IsZero(o.String) { // not required - return nil - } - - if err := o.String.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("string") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("string") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListTemplatesOKBodyTemplatesItems0ParamsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListTemplatesOKBodyTemplatesItems0ParamsItems0) UnmarshalBinary(b []byte) error { - var res ListTemplatesOKBodyTemplatesItems0ParamsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListTemplatesOKBodyTemplatesItems0ParamsItems0Bool BoolParamDefinition represents boolean parameter's default value. -swagger:model ListTemplatesOKBodyTemplatesItems0ParamsItems0Bool -*/ -type ListTemplatesOKBodyTemplatesItems0ParamsItems0Bool struct { - // default - Default *bool `json:"default,omitempty"` -} - -// Validate validates this list templates OK body templates items0 params items0 bool -func (o *ListTemplatesOKBodyTemplatesItems0ParamsItems0Bool) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list templates OK body templates items0 params items0 bool based on context it is used -func (o *ListTemplatesOKBodyTemplatesItems0ParamsItems0Bool) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListTemplatesOKBodyTemplatesItems0ParamsItems0Bool) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListTemplatesOKBodyTemplatesItems0ParamsItems0Bool) UnmarshalBinary(b []byte) error { - var res ListTemplatesOKBodyTemplatesItems0ParamsItems0Bool - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListTemplatesOKBodyTemplatesItems0ParamsItems0Float FloatParamDefinition represents float parameter's default value and valid range. -swagger:model ListTemplatesOKBodyTemplatesItems0ParamsItems0Float -*/ -type ListTemplatesOKBodyTemplatesItems0ParamsItems0Float struct { - // Default value. - Default *float64 `json:"default,omitempty"` - - // Minimum valid value (inclusive). - Min *float64 `json:"min,omitempty"` - - // Maximum valid value (inclusive). - Max *float64 `json:"max,omitempty"` -} - -// Validate validates this list templates OK body templates items0 params items0 float -func (o *ListTemplatesOKBodyTemplatesItems0ParamsItems0Float) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list templates OK body templates items0 params items0 float based on context it is used -func (o *ListTemplatesOKBodyTemplatesItems0ParamsItems0Float) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListTemplatesOKBodyTemplatesItems0ParamsItems0Float) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListTemplatesOKBodyTemplatesItems0ParamsItems0Float) UnmarshalBinary(b []byte) error { - var res ListTemplatesOKBodyTemplatesItems0ParamsItems0Float - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListTemplatesOKBodyTemplatesItems0ParamsItems0String StringParamDefinition represents string parameter's default value. -swagger:model ListTemplatesOKBodyTemplatesItems0ParamsItems0String -*/ -type ListTemplatesOKBodyTemplatesItems0ParamsItems0String struct { - // Default value. - Default *string `json:"default,omitempty"` -} - -// Validate validates this list templates OK body templates items0 params items0 string -func (o *ListTemplatesOKBodyTemplatesItems0ParamsItems0String) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list templates OK body templates items0 params items0 string based on context it is used -func (o *ListTemplatesOKBodyTemplatesItems0ParamsItems0String) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListTemplatesOKBodyTemplatesItems0ParamsItems0String) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListTemplatesOKBodyTemplatesItems0ParamsItems0String) UnmarshalBinary(b []byte) error { - var res ListTemplatesOKBodyTemplatesItems0ParamsItems0String - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/alerting/v1/json/client/alerting_service/update_template_parameters.go b/api/alerting/v1/json/client/alerting_service/update_template_parameters.go deleted file mode 100644 index 531cd4e36b3..00000000000 --- a/api/alerting/v1/json/client/alerting_service/update_template_parameters.go +++ /dev/null @@ -1,166 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package alerting_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" -) - -// NewUpdateTemplateParams creates a new UpdateTemplateParams 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 NewUpdateTemplateParams() *UpdateTemplateParams { - return &UpdateTemplateParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewUpdateTemplateParamsWithTimeout creates a new UpdateTemplateParams object -// with the ability to set a timeout on a request. -func NewUpdateTemplateParamsWithTimeout(timeout time.Duration) *UpdateTemplateParams { - return &UpdateTemplateParams{ - timeout: timeout, - } -} - -// NewUpdateTemplateParamsWithContext creates a new UpdateTemplateParams object -// with the ability to set a context for a request. -func NewUpdateTemplateParamsWithContext(ctx context.Context) *UpdateTemplateParams { - return &UpdateTemplateParams{ - Context: ctx, - } -} - -// NewUpdateTemplateParamsWithHTTPClient creates a new UpdateTemplateParams object -// with the ability to set a custom HTTPClient for a request. -func NewUpdateTemplateParamsWithHTTPClient(client *http.Client) *UpdateTemplateParams { - return &UpdateTemplateParams{ - HTTPClient: client, - } -} - -/* -UpdateTemplateParams contains all the parameters to send to the API endpoint - - for the update template operation. - - Typically these are written to a http.Request. -*/ -type UpdateTemplateParams struct { - // Body. - Body UpdateTemplateBody - - /* Name. - - Machine-readable name (ID). - */ - Name string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the update template params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateTemplateParams) WithDefaults() *UpdateTemplateParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the update template params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateTemplateParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the update template params -func (o *UpdateTemplateParams) WithTimeout(timeout time.Duration) *UpdateTemplateParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the update template params -func (o *UpdateTemplateParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the update template params -func (o *UpdateTemplateParams) WithContext(ctx context.Context) *UpdateTemplateParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the update template params -func (o *UpdateTemplateParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the update template params -func (o *UpdateTemplateParams) WithHTTPClient(client *http.Client) *UpdateTemplateParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the update template params -func (o *UpdateTemplateParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the update template params -func (o *UpdateTemplateParams) WithBody(body UpdateTemplateBody) *UpdateTemplateParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the update template params -func (o *UpdateTemplateParams) SetBody(body UpdateTemplateBody) { - o.Body = body -} - -// WithName adds the name to the update template params -func (o *UpdateTemplateParams) WithName(name string) *UpdateTemplateParams { - o.SetName(name) - return o -} - -// SetName adds the name to the update template params -func (o *UpdateTemplateParams) SetName(name string) { - o.Name = name -} - -// WriteToRequest writes these params to a swagger request -func (o *UpdateTemplateParams) 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 - } - - // path param name - if err := r.SetPathParam("name", o.Name); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/api/alerting/v1/json/client/alerting_service/update_template_responses.go b/api/alerting/v1/json/client/alerting_service/update_template_responses.go deleted file mode 100644 index 51a789ea3e5..00000000000 --- a/api/alerting/v1/json/client/alerting_service/update_template_responses.go +++ /dev/null @@ -1,451 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package alerting_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" -) - -// UpdateTemplateReader is a Reader for the UpdateTemplate structure. -type UpdateTemplateReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *UpdateTemplateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewUpdateTemplateOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewUpdateTemplateDefault(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 - } -} - -// NewUpdateTemplateOK creates a UpdateTemplateOK with default headers values -func NewUpdateTemplateOK() *UpdateTemplateOK { - return &UpdateTemplateOK{} -} - -/* -UpdateTemplateOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type UpdateTemplateOK struct { - Payload any -} - -// IsSuccess returns true when this update template Ok response has a 2xx status code -func (o *UpdateTemplateOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this update template Ok response has a 3xx status code -func (o *UpdateTemplateOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update template Ok response has a 4xx status code -func (o *UpdateTemplateOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this update template Ok response has a 5xx status code -func (o *UpdateTemplateOK) IsServerError() bool { - return false -} - -// IsCode returns true when this update template Ok response a status code equal to that given -func (o *UpdateTemplateOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the update template Ok response -func (o *UpdateTemplateOK) Code() int { - return 200 -} - -func (o *UpdateTemplateOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/alerting/templates/{name}][%d] updateTemplateOk %s", 200, payload) -} - -func (o *UpdateTemplateOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/alerting/templates/{name}][%d] updateTemplateOk %s", 200, payload) -} - -func (o *UpdateTemplateOK) GetPayload() any { - return o.Payload -} - -func (o *UpdateTemplateOK) 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) { - return err - } - - return nil -} - -// NewUpdateTemplateDefault creates a UpdateTemplateDefault with default headers values -func NewUpdateTemplateDefault(code int) *UpdateTemplateDefault { - return &UpdateTemplateDefault{ - _statusCode: code, - } -} - -/* -UpdateTemplateDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type UpdateTemplateDefault struct { - _statusCode int - - Payload *UpdateTemplateDefaultBody -} - -// IsSuccess returns true when this update template default response has a 2xx status code -func (o *UpdateTemplateDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this update template default response has a 3xx status code -func (o *UpdateTemplateDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this update template default response has a 4xx status code -func (o *UpdateTemplateDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this update template default response has a 5xx status code -func (o *UpdateTemplateDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this update template default response a status code equal to that given -func (o *UpdateTemplateDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the update template default response -func (o *UpdateTemplateDefault) Code() int { - return o._statusCode -} - -func (o *UpdateTemplateDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/alerting/templates/{name}][%d] UpdateTemplate default %s", o._statusCode, payload) -} - -func (o *UpdateTemplateDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/alerting/templates/{name}][%d] UpdateTemplate default %s", o._statusCode, payload) -} - -func (o *UpdateTemplateDefault) GetPayload() *UpdateTemplateDefaultBody { - return o.Payload -} - -func (o *UpdateTemplateDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(UpdateTemplateDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -UpdateTemplateBody update template body -swagger:model UpdateTemplateBody -*/ -type UpdateTemplateBody struct { - // YAML template file content. - Yaml string `json:"yaml,omitempty"` -} - -// Validate validates this update template body -func (o *UpdateTemplateBody) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this update template body based on context it is used -func (o *UpdateTemplateBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *UpdateTemplateBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *UpdateTemplateBody) UnmarshalBinary(b []byte) error { - var res UpdateTemplateBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -UpdateTemplateDefaultBody update template default body -swagger:model UpdateTemplateDefaultBody -*/ -type UpdateTemplateDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*UpdateTemplateDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this update template default body -func (o *UpdateTemplateDefaultBody) 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 *UpdateTemplateDefaultBody) 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("UpdateTemplate default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("UpdateTemplate default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this update template default body based on the context it is used -func (o *UpdateTemplateDefaultBody) 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 *UpdateTemplateDefaultBody) 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("UpdateTemplate default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("UpdateTemplate default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *UpdateTemplateDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *UpdateTemplateDefaultBody) UnmarshalBinary(b []byte) error { - var res UpdateTemplateDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -UpdateTemplateDefaultBodyDetailsItems0 update template default body details items0 -swagger:model UpdateTemplateDefaultBodyDetailsItems0 -*/ -type UpdateTemplateDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` - - // update template default body details items0 - UpdateTemplateDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *UpdateTemplateDefaultBodyDetailsItems0) 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 UpdateTemplateDefaultBodyDetailsItems0 - - 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.UpdateTemplateDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o UpdateTemplateDefaultBodyDetailsItems0) 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.UpdateTemplateDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.UpdateTemplateDefaultBodyDetailsItems0) - 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 update template default body details items0 -func (o *UpdateTemplateDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this update template default body details items0 based on context it is used -func (o *UpdateTemplateDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *UpdateTemplateDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *UpdateTemplateDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res UpdateTemplateDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/alerting/v1/json/client/pmm_alerting_api_client.go b/api/alerting/v1/json/client/pmm_alerting_api_client.go deleted file mode 100644 index 42c4b90a866..00000000000 --- a/api/alerting/v1/json/client/pmm_alerting_api_client.go +++ /dev/null @@ -1,112 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package client - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/percona/pmm/api/alerting/v1/json/client/alerting_service" -) - -// Default PMM alerting API HTTP client. -var Default = NewHTTPClient(nil) - -const ( - // DefaultHost is the default Host - // found in Meta (info) section of spec file - DefaultHost string = "localhost" - // DefaultBasePath is the default BasePath - // found in Meta (info) section of spec file - DefaultBasePath string = "/" -) - -// DefaultSchemes are the default schemes found in Meta (info) section of spec file -var DefaultSchemes = []string{"http", "https"} - -// NewHTTPClient creates a new PMM alerting API HTTP client. -func NewHTTPClient(formats strfmt.Registry) *PMMAlertingAPI { - return NewHTTPClientWithConfig(formats, nil) -} - -// NewHTTPClientWithConfig creates a new PMM alerting API HTTP client, -// using a customizable transport config. -func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *PMMAlertingAPI { - // ensure nullable parameters have default - if cfg == nil { - cfg = DefaultTransportConfig() - } - - // create transport and client - transport := httptransport.New(cfg.Host, cfg.BasePath, cfg.Schemes) - return New(transport, formats) -} - -// New creates a new PMM alerting API client -func New(transport runtime.ClientTransport, formats strfmt.Registry) *PMMAlertingAPI { - // ensure nullable parameters have default - if formats == nil { - formats = strfmt.Default - } - - cli := new(PMMAlertingAPI) - cli.Transport = transport - cli.AlertingService = alerting_service.New(transport, formats) - return cli -} - -// DefaultTransportConfig creates a TransportConfig with the -// default settings taken from the meta section of the spec file. -func DefaultTransportConfig() *TransportConfig { - return &TransportConfig{ - Host: DefaultHost, - BasePath: DefaultBasePath, - Schemes: DefaultSchemes, - } -} - -// TransportConfig contains the transport related info, -// found in the meta section of the spec file. -type TransportConfig struct { - Host string - BasePath string - Schemes []string -} - -// WithHost overrides the default host, -// provided by the meta section of the spec file. -func (cfg *TransportConfig) WithHost(host string) *TransportConfig { - cfg.Host = host - return cfg -} - -// WithBasePath overrides the default basePath, -// provided by the meta section of the spec file. -func (cfg *TransportConfig) WithBasePath(basePath string) *TransportConfig { - cfg.BasePath = basePath - return cfg -} - -// WithSchemes overrides the default schemes, -// provided by the meta section of the spec file. -func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig { - cfg.Schemes = schemes - return cfg -} - -// PMMAlertingAPI is a client for PMM alerting API -type PMMAlertingAPI struct { - AlertingService alerting_service.ClientService - - Transport runtime.ClientTransport -} - -// SetTransport changes the transport on the client and all its subresources -func (c *PMMAlertingAPI) SetTransport(transport runtime.ClientTransport) { - c.Transport = transport - c.AlertingService.SetTransport(transport) -} diff --git a/api/alerting/v1/json/v1.json b/api/alerting/v1/json/v1.json deleted file mode 100644 index 3e38a2987c6..00000000000 --- a/api/alerting/v1/json/v1.json +++ /dev/null @@ -1,671 +0,0 @@ -{ - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "schemes": [ - "https", - "http" - ], - "swagger": "2.0", - "info": { - "title": "PMM Alerting API", - "version": "v1" - }, - "paths": { - "/v1/alerting/rules": { - "post": { - "tags": [ - "AlertingService" - ], - "summary": "CreateRule creates alerting rule from the given template.", - "operationId": "CreateRule", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "template_name": { - "description": "Template name.", - "type": "string", - "x-order": 0 - }, - "name": { - "description": "Rule name.", - "type": "string", - "x-order": 1 - }, - "group": { - "description": "Rule group name.", - "type": "string", - "x-order": 2 - }, - "folder_uid": { - "description": "Folder UID.", - "type": "string", - "x-order": 3 - }, - "params": { - "description": "Rule parameters. All template parameters should be set.", - "type": "array", - "items": { - "description": "ParamValue represents a single rule parameter value.", - "type": "object", - "properties": { - "name": { - "description": "Machine-readable name (ID) that is used in expression.", - "type": "string", - "x-order": 0 - }, - "type": { - "description": "ParamType represents template parameter type.", - "type": "string", - "default": "PARAM_TYPE_UNSPECIFIED", - "enum": [ - "PARAM_TYPE_UNSPECIFIED", - "PARAM_TYPE_BOOL", - "PARAM_TYPE_FLOAT", - "PARAM_TYPE_STRING" - ], - "x-order": 1 - }, - "bool": { - "description": "Bool value.", - "type": "boolean", - "x-order": 2 - }, - "float": { - "description": "Float value.", - "type": "number", - "format": "double", - "x-order": 3 - }, - "string": { - "description": "String value.", - "type": "string", - "x-order": 4 - } - } - }, - "x-order": 4 - }, - "for": { - "description": "Rule duration. Should be set.", - "type": "string", - "x-order": 5 - }, - "severity": { - "description": "Severity represents severity level of the check result or alert.", - "type": "string", - "default": "SEVERITY_UNSPECIFIED", - "enum": [ - "SEVERITY_UNSPECIFIED", - "SEVERITY_EMERGENCY", - "SEVERITY_ALERT", - "SEVERITY_CRITICAL", - "SEVERITY_ERROR", - "SEVERITY_WARNING", - "SEVERITY_NOTICE", - "SEVERITY_INFO", - "SEVERITY_DEBUG" - ], - "x-order": 6 - }, - "custom_labels": { - "description": "All custom labels to add or remove (with empty values) to default labels from template.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 7 - }, - "filters": { - "description": "Filters.", - "type": "array", - "items": { - "description": "Filter represents a single filter condition.", - "type": "object", - "properties": { - "type": { - "description": "FilterType represents filter matching type.", - "type": "string", - "default": "FILTER_TYPE_UNSPECIFIED", - "enum": [ - "FILTER_TYPE_UNSPECIFIED", - "FILTER_TYPE_MATCH", - "FILTER_TYPE_MISMATCH" - ], - "x-order": 0 - }, - "label": { - "type": "string", - "x-order": 1 - }, - "regexp": { - "type": "string", - "x-order": 2 - } - } - }, - "x-order": 8 - }, - "interval": { - "type": "string", - "title": "Evaluation Interval", - "x-order": 9 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/alerting/templates": { - "get": { - "tags": [ - "AlertingService" - ], - "summary": "ListTemplates returns a list of all collected alert rule templates.", - "operationId": "ListTemplates", - "parameters": [ - { - "type": "integer", - "format": "int32", - "description": "Maximum number of results per page.", - "name": "page_size", - "in": "query" - }, - { - "type": "integer", - "format": "int32", - "description": "Index of the requested page, starts from 0.", - "name": "page_index", - "in": "query" - }, - { - "type": "boolean", - "description": "If true, template files will be re-read from disk.", - "name": "reload", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "total_items": { - "description": "Total number of results.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "total_pages": { - "description": "Total number of pages.", - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "templates": { - "description": "Alerting templates.", - "type": "array", - "items": { - "description": "Template represents Alert Template that is used to create Alert Rule.", - "type": "object", - "properties": { - "name": { - "description": "Machine-readable name (ID).", - "type": "string", - "x-order": 0 - }, - "summary": { - "description": "Short human-readable summary.", - "type": "string", - "x-order": 1 - }, - "expr": { - "description": "PromQL query expression with templating parameters.", - "type": "string", - "x-order": 2 - }, - "params": { - "description": "Query parameters definitions.", - "type": "array", - "items": { - "description": "ParamDefinition represents a single query parameter.", - "type": "object", - "properties": { - "name": { - "description": "Machine-readable name (ID) that is used in expression.", - "type": "string", - "x-order": 0 - }, - "summary": { - "description": "Short human-readable parameter summary.", - "type": "string", - "x-order": 1 - }, - "unit": { - "description": "ParamUnit represents template parameter unit.\n\n - PARAM_UNIT_UNSPECIFIED: Invalid, unknown or absent.\n - PARAM_UNIT_PERCENTAGE: %\n - PARAM_UNIT_SECONDS: s", - "type": "string", - "default": "PARAM_UNIT_UNSPECIFIED", - "enum": [ - "PARAM_UNIT_UNSPECIFIED", - "PARAM_UNIT_PERCENTAGE", - "PARAM_UNIT_SECONDS" - ], - "x-order": 2 - }, - "type": { - "description": "ParamType represents template parameter type.", - "type": "string", - "default": "PARAM_TYPE_UNSPECIFIED", - "enum": [ - "PARAM_TYPE_UNSPECIFIED", - "PARAM_TYPE_BOOL", - "PARAM_TYPE_FLOAT", - "PARAM_TYPE_STRING" - ], - "x-order": 3 - }, - "bool": { - "description": "BoolParamDefinition represents boolean parameter's default value.", - "type": "object", - "properties": { - "default": { - "type": "boolean", - "x-nullable": true, - "x-order": 0 - } - }, - "x-order": 4 - }, - "float": { - "description": "FloatParamDefinition represents float parameter's default value and valid range.", - "type": "object", - "properties": { - "default": { - "description": "Default value.", - "type": "number", - "format": "double", - "x-nullable": true, - "x-order": 0 - }, - "min": { - "description": "Minimum valid value (inclusive).", - "type": "number", - "format": "double", - "x-nullable": true, - "x-order": 1 - }, - "max": { - "description": "Maximum valid value (inclusive).", - "type": "number", - "format": "double", - "x-nullable": true, - "x-order": 2 - } - }, - "x-order": 5 - }, - "string": { - "description": "StringParamDefinition represents string parameter's default value.", - "type": "object", - "properties": { - "default": { - "description": "Default value.", - "type": "string", - "x-nullable": true, - "x-order": 0 - } - }, - "x-order": 6 - } - } - }, - "x-order": 3 - }, - "for": { - "description": "Default duration value.", - "type": "string", - "x-order": 4 - }, - "severity": { - "description": "Severity represents severity level of the check result or alert.", - "type": "string", - "default": "SEVERITY_UNSPECIFIED", - "enum": [ - "SEVERITY_UNSPECIFIED", - "SEVERITY_EMERGENCY", - "SEVERITY_ALERT", - "SEVERITY_CRITICAL", - "SEVERITY_ERROR", - "SEVERITY_WARNING", - "SEVERITY_NOTICE", - "SEVERITY_INFO", - "SEVERITY_DEBUG" - ], - "x-order": 5 - }, - "labels": { - "description": "Labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 6 - }, - "annotations": { - "description": "Annotations.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 7 - }, - "source": { - "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.", - "type": "string", - "default": "TEMPLATE_SOURCE_UNSPECIFIED", - "enum": [ - "TEMPLATE_SOURCE_UNSPECIFIED", - "TEMPLATE_SOURCE_BUILT_IN", - "TEMPLATE_SOURCE_SAAS", - "TEMPLATE_SOURCE_USER_FILE", - "TEMPLATE_SOURCE_USER_API" - ], - "x-order": 8 - }, - "created_at": { - "description": "Template creation time. Empty for built-in and SaaS templates.", - "type": "string", - "format": "date-time", - "x-order": 9 - }, - "yaml": { - "description": "YAML template file content. Empty for built-in and SaaS templates.", - "type": "string", - "x-order": 10 - } - } - }, - "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 - } - } - } - } - } - }, - "post": { - "tags": [ - "AlertingService" - ], - "summary": "CreateTemplate creates a new template.", - "operationId": "CreateTemplate", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "yaml": { - "description": "YAML template file content.", - "type": "string", - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/alerting/templates/{name}": { - "put": { - "tags": [ - "AlertingService" - ], - "summary": "UpdateTemplate updates existing template, previously created via API.", - "operationId": "UpdateTemplate", - "parameters": [ - { - "type": "string", - "description": "Machine-readable name (ID).", - "name": "name", - "in": "path", - "required": true - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "yaml": { - "description": "YAML template file content.", - "type": "string", - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - }, - "delete": { - "tags": [ - "AlertingService" - ], - "summary": "DeleteTemplate deletes existing, previously created via API.", - "operationId": "DeleteTemplate", - "parameters": [ - { - "type": "string", - "name": "name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - } - }, - "tags": [ - { - "name": "AlertingService" - } - ] -} \ No newline at end of file diff --git a/api/alerting/v1/params.pb.go b/api/alerting/v1/params.pb.go deleted file mode 100644 index d9edcb14042..00000000000 --- a/api/alerting/v1/params.pb.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.10 -// protoc (unknown) -// source: alerting/v1/params.proto - -package alertingv1 - -import ( - reflect "reflect" - sync "sync" - unsafe "unsafe" - - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// ParamUnit represents template parameter unit. -type ParamUnit int32 - -const ( - // Invalid, unknown or absent. - ParamUnit_PARAM_UNIT_UNSPECIFIED ParamUnit = 0 - // % - ParamUnit_PARAM_UNIT_PERCENTAGE ParamUnit = 1 - // s - ParamUnit_PARAM_UNIT_SECONDS ParamUnit = 2 -) - -// Enum value maps for ParamUnit. -var ( - ParamUnit_name = map[int32]string{ - 0: "PARAM_UNIT_UNSPECIFIED", - 1: "PARAM_UNIT_PERCENTAGE", - 2: "PARAM_UNIT_SECONDS", - } - ParamUnit_value = map[string]int32{ - "PARAM_UNIT_UNSPECIFIED": 0, - "PARAM_UNIT_PERCENTAGE": 1, - "PARAM_UNIT_SECONDS": 2, - } -) - -func (x ParamUnit) Enum() *ParamUnit { - p := new(ParamUnit) - *p = x - return p -} - -func (x ParamUnit) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (ParamUnit) Descriptor() protoreflect.EnumDescriptor { - return file_alerting_v1_params_proto_enumTypes[0].Descriptor() -} - -func (ParamUnit) Type() protoreflect.EnumType { - return &file_alerting_v1_params_proto_enumTypes[0] -} - -func (x ParamUnit) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use ParamUnit.Descriptor instead. -func (ParamUnit) EnumDescriptor() ([]byte, []int) { - return file_alerting_v1_params_proto_rawDescGZIP(), []int{0} -} - -// ParamType represents template parameter type. -type ParamType int32 - -const ( - ParamType_PARAM_TYPE_UNSPECIFIED ParamType = 0 - ParamType_PARAM_TYPE_BOOL ParamType = 1 - ParamType_PARAM_TYPE_FLOAT ParamType = 2 - ParamType_PARAM_TYPE_STRING ParamType = 3 -) - -// Enum value maps for ParamType. -var ( - ParamType_name = map[int32]string{ - 0: "PARAM_TYPE_UNSPECIFIED", - 1: "PARAM_TYPE_BOOL", - 2: "PARAM_TYPE_FLOAT", - 3: "PARAM_TYPE_STRING", - } - ParamType_value = map[string]int32{ - "PARAM_TYPE_UNSPECIFIED": 0, - "PARAM_TYPE_BOOL": 1, - "PARAM_TYPE_FLOAT": 2, - "PARAM_TYPE_STRING": 3, - } -) - -func (x ParamType) Enum() *ParamType { - p := new(ParamType) - *p = x - return p -} - -func (x ParamType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (ParamType) Descriptor() protoreflect.EnumDescriptor { - return file_alerting_v1_params_proto_enumTypes[1].Descriptor() -} - -func (ParamType) Type() protoreflect.EnumType { - return &file_alerting_v1_params_proto_enumTypes[1] -} - -func (x ParamType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use ParamType.Descriptor instead. -func (ParamType) EnumDescriptor() ([]byte, []int) { - return file_alerting_v1_params_proto_rawDescGZIP(), []int{1} -} - -var File_alerting_v1_params_proto protoreflect.FileDescriptor - -const file_alerting_v1_params_proto_rawDesc = "" + - "\n" + - "\x18alerting/v1/params.proto\x12\valerting.v1*Z\n" + - "\tParamUnit\x12\x1a\n" + - "\x16PARAM_UNIT_UNSPECIFIED\x10\x00\x12\x19\n" + - "\x15PARAM_UNIT_PERCENTAGE\x10\x01\x12\x16\n" + - "\x12PARAM_UNIT_SECONDS\x10\x02*i\n" + - "\tParamType\x12\x1a\n" + - "\x16PARAM_TYPE_UNSPECIFIED\x10\x00\x12\x13\n" + - "\x0fPARAM_TYPE_BOOL\x10\x01\x12\x14\n" + - "\x10PARAM_TYPE_FLOAT\x10\x02\x12\x15\n" + - "\x11PARAM_TYPE_STRING\x10\x03B\x9e\x01\n" + - "\x0fcom.alerting.v1B\vParamsProtoP\x01Z1github.com/percona/pmm/api/alerting/v1;alertingv1\xa2\x02\x03AXX\xaa\x02\vAlerting.V1\xca\x02\vAlerting\\V1\xe2\x02\x17Alerting\\V1\\GPBMetadata\xea\x02\fAlerting::V1b\x06proto3" - -var ( - file_alerting_v1_params_proto_rawDescOnce sync.Once - file_alerting_v1_params_proto_rawDescData []byte -) - -func file_alerting_v1_params_proto_rawDescGZIP() []byte { - file_alerting_v1_params_proto_rawDescOnce.Do(func() { - file_alerting_v1_params_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_alerting_v1_params_proto_rawDesc), len(file_alerting_v1_params_proto_rawDesc))) - }) - 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_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_alerting_v1_params_proto_init() } -func file_alerting_v1_params_proto_init() { - if File_alerting_v1_params_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_alerting_v1_params_proto_rawDesc), len(file_alerting_v1_params_proto_rawDesc)), - NumEnums: 2, - NumMessages: 0, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_alerting_v1_params_proto_goTypes, - DependencyIndexes: file_alerting_v1_params_proto_depIdxs, - EnumInfos: file_alerting_v1_params_proto_enumTypes, - }.Build() - File_alerting_v1_params_proto = out.File - file_alerting_v1_params_proto_goTypes = nil - file_alerting_v1_params_proto_depIdxs = nil -} diff --git a/api/alerting/v1/params.pb.validate.go b/api/alerting/v1/params.pb.validate.go deleted file mode 100644 index afe32b2c093..00000000000 --- a/api/alerting/v1/params.pb.validate.go +++ /dev/null @@ -1,36 +0,0 @@ -// Code generated by protoc-gen-validate. DO NOT EDIT. -// source: alerting/v1/params.proto - -package alertingv1 - -import ( - "bytes" - "errors" - "fmt" - "net" - "net/mail" - "net/url" - "regexp" - "sort" - "strings" - "time" - "unicode/utf8" - - "google.golang.org/protobuf/types/known/anypb" -) - -// ensure the imports are used -var ( - _ = bytes.MinRead - _ = errors.New("") - _ = fmt.Print - _ = utf8.UTFMax - _ = (*regexp.Regexp)(nil) - _ = (*strings.Reader)(nil) - _ = net.IPv4len - _ = time.Duration(0) - _ = (*url.URL)(nil) - _ = (*mail.Address)(nil) - _ = anypb.Any{} - _ = sort.Sort -) diff --git a/api/backup/v1/artifacts.pb.go b/api/backup/v1/artifacts.pb.go deleted file mode 100644 index febec55858c..00000000000 --- a/api/backup/v1/artifacts.pb.go +++ /dev/null @@ -1,701 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.10 -// protoc (unknown) -// source: backup/v1/artifacts.proto - -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" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// BackupStatus shows the current status of execution of backup. -type BackupStatus int32 - -const ( - BackupStatus_BACKUP_STATUS_UNSPECIFIED BackupStatus = 0 - BackupStatus_BACKUP_STATUS_PENDING BackupStatus = 1 - BackupStatus_BACKUP_STATUS_IN_PROGRESS BackupStatus = 2 - BackupStatus_BACKUP_STATUS_PAUSED BackupStatus = 3 - BackupStatus_BACKUP_STATUS_SUCCESS BackupStatus = 4 - BackupStatus_BACKUP_STATUS_ERROR BackupStatus = 5 - BackupStatus_BACKUP_STATUS_DELETING BackupStatus = 6 - BackupStatus_BACKUP_STATUS_FAILED_TO_DELETE BackupStatus = 7 - BackupStatus_BACKUP_STATUS_CLEANUP_IN_PROGRESS BackupStatus = 8 -) - -// Enum value maps for BackupStatus. -var ( - BackupStatus_name = map[int32]string{ - 0: "BACKUP_STATUS_UNSPECIFIED", - 1: "BACKUP_STATUS_PENDING", - 2: "BACKUP_STATUS_IN_PROGRESS", - 3: "BACKUP_STATUS_PAUSED", - 4: "BACKUP_STATUS_SUCCESS", - 5: "BACKUP_STATUS_ERROR", - 6: "BACKUP_STATUS_DELETING", - 7: "BACKUP_STATUS_FAILED_TO_DELETE", - 8: "BACKUP_STATUS_CLEANUP_IN_PROGRESS", - } - BackupStatus_value = map[string]int32{ - "BACKUP_STATUS_UNSPECIFIED": 0, - "BACKUP_STATUS_PENDING": 1, - "BACKUP_STATUS_IN_PROGRESS": 2, - "BACKUP_STATUS_PAUSED": 3, - "BACKUP_STATUS_SUCCESS": 4, - "BACKUP_STATUS_ERROR": 5, - "BACKUP_STATUS_DELETING": 6, - "BACKUP_STATUS_FAILED_TO_DELETE": 7, - "BACKUP_STATUS_CLEANUP_IN_PROGRESS": 8, - } -) - -func (x BackupStatus) Enum() *BackupStatus { - p := new(BackupStatus) - *p = x - return p -} - -func (x BackupStatus) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (BackupStatus) Descriptor() protoreflect.EnumDescriptor { - return file_backup_v1_artifacts_proto_enumTypes[0].Descriptor() -} - -func (BackupStatus) Type() protoreflect.EnumType { - return &file_backup_v1_artifacts_proto_enumTypes[0] -} - -func (x BackupStatus) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use BackupStatus.Descriptor instead. -func (BackupStatus) EnumDescriptor() ([]byte, []int) { - return file_backup_v1_artifacts_proto_rawDescGZIP(), []int{0} -} - -// Artifact represents single backup artifact. -type Artifact struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Machine-readable artifact ID. - ArtifactId string `protobuf:"bytes,1,opt,name=artifact_id,json=artifactId,proto3" json:"artifact_id,omitempty"` - // Artifact name - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - // Database vendor e.g. PostgreSQL, MongoDB, MySQL. - Vendor string `protobuf:"bytes,3,opt,name=vendor,proto3" json:"vendor,omitempty"` - // Machine-readable location ID. - LocationId string `protobuf:"bytes,4,opt,name=location_id,json=locationId,proto3" json:"location_id,omitempty"` - // Location name. - LocationName string `protobuf:"bytes,5,opt,name=location_name,json=locationName,proto3" json:"location_name,omitempty"` - // Machine-readable service ID. - ServiceId string `protobuf:"bytes,6,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` - // Service name. - ServiceName string `protobuf:"bytes,7,opt,name=service_name,json=serviceName,proto3" json:"service_name,omitempty"` - // Backup data model. - DataModel DataModel `protobuf:"varint,8,opt,name=data_model,json=dataModel,proto3,enum=backup.v1.DataModel" json:"data_model,omitempty"` - // Backup status. - Status BackupStatus `protobuf:"varint,9,opt,name=status,proto3,enum=backup.v1.BackupStatus" json:"status,omitempty"` - // Artifact creation time. - CreatedAt *timestamppb.Timestamp `protobuf:"bytes,10,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` - // Backup mode. - Mode BackupMode `protobuf:"varint,11,opt,name=mode,proto3,enum=backup.v1.BackupMode" json:"mode,omitempty"` - // Source database setup type. - IsShardedCluster bool `protobuf:"varint,12,opt,name=is_sharded_cluster,json=isShardedCluster,proto3" json:"is_sharded_cluster,omitempty"` - // Folder to store artifact on a storage. - Folder string `protobuf:"bytes,13,opt,name=folder,proto3" json:"folder,omitempty"` - // List of artifact metadata. - MetadataList []*Metadata `protobuf:"bytes,14,rep,name=metadata_list,json=metadataList,proto3" json:"metadata_list,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Artifact) Reset() { - *x = Artifact{} - mi := &file_backup_v1_artifacts_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Artifact) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Artifact) ProtoMessage() {} - -func (x *Artifact) ProtoReflect() protoreflect.Message { - mi := &file_backup_v1_artifacts_proto_msgTypes[0] - 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 Artifact.ProtoReflect.Descriptor instead. -func (*Artifact) Descriptor() ([]byte, []int) { - return file_backup_v1_artifacts_proto_rawDescGZIP(), []int{0} -} - -func (x *Artifact) GetArtifactId() string { - if x != nil { - return x.ArtifactId - } - return "" -} - -func (x *Artifact) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *Artifact) GetVendor() string { - if x != nil { - return x.Vendor - } - return "" -} - -func (x *Artifact) GetLocationId() string { - if x != nil { - return x.LocationId - } - return "" -} - -func (x *Artifact) GetLocationName() string { - if x != nil { - return x.LocationName - } - return "" -} - -func (x *Artifact) GetServiceId() string { - if x != nil { - return x.ServiceId - } - return "" -} - -func (x *Artifact) GetServiceName() string { - if x != nil { - return x.ServiceName - } - return "" -} - -func (x *Artifact) GetDataModel() DataModel { - if x != nil { - return x.DataModel - } - return DataModel_DATA_MODEL_UNSPECIFIED -} - -func (x *Artifact) GetStatus() BackupStatus { - if x != nil { - return x.Status - } - return BackupStatus_BACKUP_STATUS_UNSPECIFIED -} - -func (x *Artifact) GetCreatedAt() *timestamppb.Timestamp { - if x != nil { - return x.CreatedAt - } - return nil -} - -func (x *Artifact) GetMode() BackupMode { - if x != nil { - return x.Mode - } - return BackupMode_BACKUP_MODE_UNSPECIFIED -} - -func (x *Artifact) GetIsShardedCluster() bool { - if x != nil { - return x.IsShardedCluster - } - return false -} - -func (x *Artifact) GetFolder() string { - if x != nil { - return x.Folder - } - return "" -} - -func (x *Artifact) GetMetadataList() []*Metadata { - if x != nil { - return x.MetadataList - } - return nil -} - -type ListArtifactsRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ListArtifactsRequest) Reset() { - *x = ListArtifactsRequest{} - mi := &file_backup_v1_artifacts_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ListArtifactsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListArtifactsRequest) ProtoMessage() {} - -func (x *ListArtifactsRequest) ProtoReflect() protoreflect.Message { - mi := &file_backup_v1_artifacts_proto_msgTypes[1] - 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 ListArtifactsRequest.ProtoReflect.Descriptor instead. -func (*ListArtifactsRequest) Descriptor() ([]byte, []int) { - return file_backup_v1_artifacts_proto_rawDescGZIP(), []int{1} -} - -type ListArtifactsResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Artifacts []*Artifact `protobuf:"bytes,1,rep,name=artifacts,proto3" json:"artifacts,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ListArtifactsResponse) Reset() { - *x = ListArtifactsResponse{} - mi := &file_backup_v1_artifacts_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ListArtifactsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListArtifactsResponse) ProtoMessage() {} - -func (x *ListArtifactsResponse) ProtoReflect() protoreflect.Message { - mi := &file_backup_v1_artifacts_proto_msgTypes[2] - 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 ListArtifactsResponse.ProtoReflect.Descriptor instead. -func (*ListArtifactsResponse) Descriptor() ([]byte, []int) { - return file_backup_v1_artifacts_proto_rawDescGZIP(), []int{2} -} - -func (x *ListArtifactsResponse) GetArtifacts() []*Artifact { - if x != nil { - return x.Artifacts - } - return nil -} - -type DeleteArtifactRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Machine-readable artifact ID. - ArtifactId string `protobuf:"bytes,1,opt,name=artifact_id,json=artifactId,proto3" json:"artifact_id,omitempty"` - // Removes all the backup files associated with artifact if flag is set. - RemoveFiles bool `protobuf:"varint,2,opt,name=remove_files,json=removeFiles,proto3" json:"remove_files,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DeleteArtifactRequest) Reset() { - *x = DeleteArtifactRequest{} - mi := &file_backup_v1_artifacts_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DeleteArtifactRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteArtifactRequest) ProtoMessage() {} - -func (x *DeleteArtifactRequest) ProtoReflect() protoreflect.Message { - mi := &file_backup_v1_artifacts_proto_msgTypes[3] - 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 DeleteArtifactRequest.ProtoReflect.Descriptor instead. -func (*DeleteArtifactRequest) Descriptor() ([]byte, []int) { - return file_backup_v1_artifacts_proto_rawDescGZIP(), []int{3} -} - -func (x *DeleteArtifactRequest) GetArtifactId() string { - if x != nil { - return x.ArtifactId - } - return "" -} - -func (x *DeleteArtifactRequest) GetRemoveFiles() bool { - if x != nil { - return x.RemoveFiles - } - return false -} - -type DeleteArtifactResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DeleteArtifactResponse) Reset() { - *x = DeleteArtifactResponse{} - mi := &file_backup_v1_artifacts_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DeleteArtifactResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteArtifactResponse) ProtoMessage() {} - -func (x *DeleteArtifactResponse) ProtoReflect() protoreflect.Message { - mi := &file_backup_v1_artifacts_proto_msgTypes[4] - 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 DeleteArtifactResponse.ProtoReflect.Descriptor instead. -func (*DeleteArtifactResponse) Descriptor() ([]byte, []int) { - return file_backup_v1_artifacts_proto_rawDescGZIP(), []int{4} -} - -type PitrTimerange struct { - state protoimpl.MessageState `protogen:"open.v1"` - // start_timestamp is the time of the first event in the PITR chunk. - StartTimestamp *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=start_timestamp,json=startTimestamp,proto3" json:"start_timestamp,omitempty"` - // end_timestamp is the time of the last event in the PITR chunk. - EndTimestamp *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=end_timestamp,json=endTimestamp,proto3" json:"end_timestamp,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *PitrTimerange) Reset() { - *x = PitrTimerange{} - mi := &file_backup_v1_artifacts_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *PitrTimerange) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PitrTimerange) ProtoMessage() {} - -func (x *PitrTimerange) ProtoReflect() protoreflect.Message { - mi := &file_backup_v1_artifacts_proto_msgTypes[5] - 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 PitrTimerange.ProtoReflect.Descriptor instead. -func (*PitrTimerange) Descriptor() ([]byte, []int) { - return file_backup_v1_artifacts_proto_rawDescGZIP(), []int{5} -} - -func (x *PitrTimerange) GetStartTimestamp() *timestamppb.Timestamp { - if x != nil { - return x.StartTimestamp - } - return nil -} - -func (x *PitrTimerange) GetEndTimestamp() *timestamppb.Timestamp { - if x != nil { - return x.EndTimestamp - } - return nil -} - -type ListPitrTimerangesRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Artifact ID represents artifact whose location has PITR timeranges to be retrieved. - ArtifactId string `protobuf:"bytes,1,opt,name=artifact_id,json=artifactId,proto3" json:"artifact_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ListPitrTimerangesRequest) Reset() { - *x = ListPitrTimerangesRequest{} - mi := &file_backup_v1_artifacts_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ListPitrTimerangesRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListPitrTimerangesRequest) ProtoMessage() {} - -func (x *ListPitrTimerangesRequest) ProtoReflect() protoreflect.Message { - mi := &file_backup_v1_artifacts_proto_msgTypes[6] - 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 ListPitrTimerangesRequest.ProtoReflect.Descriptor instead. -func (*ListPitrTimerangesRequest) Descriptor() ([]byte, []int) { - return file_backup_v1_artifacts_proto_rawDescGZIP(), []int{6} -} - -func (x *ListPitrTimerangesRequest) GetArtifactId() string { - if x != nil { - return x.ArtifactId - } - return "" -} - -type ListPitrTimerangesResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Timeranges []*PitrTimerange `protobuf:"bytes,1,rep,name=timeranges,proto3" json:"timeranges,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ListPitrTimerangesResponse) Reset() { - *x = ListPitrTimerangesResponse{} - mi := &file_backup_v1_artifacts_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ListPitrTimerangesResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListPitrTimerangesResponse) ProtoMessage() {} - -func (x *ListPitrTimerangesResponse) ProtoReflect() protoreflect.Message { - mi := &file_backup_v1_artifacts_proto_msgTypes[7] - 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 ListPitrTimerangesResponse.ProtoReflect.Descriptor instead. -func (*ListPitrTimerangesResponse) Descriptor() ([]byte, []int) { - return file_backup_v1_artifacts_proto_rawDescGZIP(), []int{7} -} - -func (x *ListPitrTimerangesResponse) GetTimeranges() []*PitrTimerange { - if x != nil { - return x.Timeranges - } - return nil -} - -var File_backup_v1_artifacts_proto protoreflect.FileDescriptor - -const file_backup_v1_artifacts_proto_rawDesc = "" + - "\n" + - "\x19backup/v1/artifacts.proto\x12\tbackup.v1\x1a\x16backup/v1/common.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17validate/validate.proto\"\xab\x04\n" + - "\bArtifact\x12\x1f\n" + - "\vartifact_id\x18\x01 \x01(\tR\n" + - "artifactId\x12\x12\n" + - "\x04name\x18\x02 \x01(\tR\x04name\x12\x16\n" + - "\x06vendor\x18\x03 \x01(\tR\x06vendor\x12\x1f\n" + - "\vlocation_id\x18\x04 \x01(\tR\n" + - "locationId\x12#\n" + - "\rlocation_name\x18\x05 \x01(\tR\flocationName\x12\x1d\n" + - "\n" + - "service_id\x18\x06 \x01(\tR\tserviceId\x12!\n" + - "\fservice_name\x18\a \x01(\tR\vserviceName\x123\n" + - "\n" + - "data_model\x18\b \x01(\x0e2\x14.backup.v1.DataModelR\tdataModel\x12/\n" + - "\x06status\x18\t \x01(\x0e2\x17.backup.v1.BackupStatusR\x06status\x129\n" + - "\n" + - "created_at\x18\n" + - " \x01(\v2\x1a.google.protobuf.TimestampR\tcreatedAt\x12)\n" + - "\x04mode\x18\v \x01(\x0e2\x15.backup.v1.BackupModeR\x04mode\x12,\n" + - "\x12is_sharded_cluster\x18\f \x01(\bR\x10isShardedCluster\x12\x16\n" + - "\x06folder\x18\r \x01(\tR\x06folder\x128\n" + - "\rmetadata_list\x18\x0e \x03(\v2\x13.backup.v1.MetadataR\fmetadataList\"\x16\n" + - "\x14ListArtifactsRequest\"J\n" + - "\x15ListArtifactsResponse\x121\n" + - "\tartifacts\x18\x01 \x03(\v2\x13.backup.v1.ArtifactR\tartifacts\"d\n" + - "\x15DeleteArtifactRequest\x12(\n" + - "\vartifact_id\x18\x01 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\n" + - "artifactId\x12!\n" + - "\fremove_files\x18\x02 \x01(\bR\vremoveFiles\"\x18\n" + - "\x16DeleteArtifactResponse\"\x95\x01\n" + - "\rPitrTimerange\x12C\n" + - "\x0fstart_timestamp\x18\x01 \x01(\v2\x1a.google.protobuf.TimestampR\x0estartTimestamp\x12?\n" + - "\rend_timestamp\x18\x02 \x01(\v2\x1a.google.protobuf.TimestampR\fendTimestamp\"E\n" + - "\x19ListPitrTimerangesRequest\x12(\n" + - "\vartifact_id\x18\x01 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\n" + - "artifactId\"V\n" + - "\x1aListPitrTimerangesResponse\x128\n" + - "\n" + - "timeranges\x18\x01 \x03(\v2\x18.backup.v1.PitrTimerangeR\n" + - "timeranges*\x9c\x02\n" + - "\fBackupStatus\x12\x1d\n" + - "\x19BACKUP_STATUS_UNSPECIFIED\x10\x00\x12\x19\n" + - "\x15BACKUP_STATUS_PENDING\x10\x01\x12\x1d\n" + - "\x19BACKUP_STATUS_IN_PROGRESS\x10\x02\x12\x18\n" + - "\x14BACKUP_STATUS_PAUSED\x10\x03\x12\x19\n" + - "\x15BACKUP_STATUS_SUCCESS\x10\x04\x12\x17\n" + - "\x13BACKUP_STATUS_ERROR\x10\x05\x12\x1a\n" + - "\x16BACKUP_STATUS_DELETING\x10\x06\x12\"\n" + - "\x1eBACKUP_STATUS_FAILED_TO_DELETE\x10\a\x12%\n" + - "!BACKUP_STATUS_CLEANUP_IN_PROGRESS\x10\bB\x93\x01\n" + - "\rcom.backup.v1B\x0eArtifactsProtoP\x01Z-github.com/percona/pmm/api/backup/v1;backupv1\xa2\x02\x03BXX\xaa\x02\tBackup.V1\xca\x02\tBackup\\V1\xe2\x02\x15Backup\\V1\\GPBMetadata\xea\x02\n" + - "Backup::V1b\x06proto3" - -var ( - file_backup_v1_artifacts_proto_rawDescOnce sync.Once - file_backup_v1_artifacts_proto_rawDescData []byte -) - -func file_backup_v1_artifacts_proto_rawDescGZIP() []byte { - file_backup_v1_artifacts_proto_rawDescOnce.Do(func() { - file_backup_v1_artifacts_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_backup_v1_artifacts_proto_rawDesc), len(file_backup_v1_artifacts_proto_rawDesc))) - }) - 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_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 - 10, // 2: backup.v1.Artifact.created_at:type_name -> google.protobuf.Timestamp - 11, // 3: backup.v1.Artifact.mode:type_name -> backup.v1.BackupMode - 12, // 4: backup.v1.Artifact.metadata_list:type_name -> backup.v1.Metadata - 1, // 5: backup.v1.ListArtifactsResponse.artifacts:type_name -> backup.v1.Artifact - 10, // 6: backup.v1.PitrTimerange.start_timestamp:type_name -> google.protobuf.Timestamp - 10, // 7: backup.v1.PitrTimerange.end_timestamp:type_name -> google.protobuf.Timestamp - 6, // 8: backup.v1.ListPitrTimerangesResponse.timeranges:type_name -> backup.v1.PitrTimerange - 9, // [9:9] is the sub-list for method output_type - 9, // [9:9] is the sub-list for method input_type - 9, // [9:9] is the sub-list for extension type_name - 9, // [9:9] is the sub-list for extension extendee - 0, // [0:9] is the sub-list for field type_name -} - -func init() { file_backup_v1_artifacts_proto_init() } -func file_backup_v1_artifacts_proto_init() { - if File_backup_v1_artifacts_proto != nil { - return - } - file_backup_v1_common_proto_init() - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_backup_v1_artifacts_proto_rawDesc), len(file_backup_v1_artifacts_proto_rawDesc)), - NumEnums: 1, - NumMessages: 8, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_backup_v1_artifacts_proto_goTypes, - DependencyIndexes: file_backup_v1_artifacts_proto_depIdxs, - EnumInfos: file_backup_v1_artifacts_proto_enumTypes, - MessageInfos: file_backup_v1_artifacts_proto_msgTypes, - }.Build() - File_backup_v1_artifacts_proto = out.File - file_backup_v1_artifacts_proto_goTypes = nil - file_backup_v1_artifacts_proto_depIdxs = nil -} diff --git a/api/backup/v1/artifacts.pb.validate.go b/api/backup/v1/artifacts.pb.validate.go deleted file mode 100644 index 4b5be980436..00000000000 --- a/api/backup/v1/artifacts.pb.validate.go +++ /dev/null @@ -1,1084 +0,0 @@ -// Code generated by protoc-gen-validate. DO NOT EDIT. -// source: backup/v1/artifacts.proto - -package backupv1 - -import ( - "bytes" - "errors" - "fmt" - "net" - "net/mail" - "net/url" - "regexp" - "sort" - "strings" - "time" - "unicode/utf8" - - "google.golang.org/protobuf/types/known/anypb" -) - -// ensure the imports are used -var ( - _ = bytes.MinRead - _ = errors.New("") - _ = fmt.Print - _ = utf8.UTFMax - _ = (*regexp.Regexp)(nil) - _ = (*strings.Reader)(nil) - _ = net.IPv4len - _ = time.Duration(0) - _ = (*url.URL)(nil) - _ = (*mail.Address)(nil) - _ = anypb.Any{} - _ = sort.Sort -) - -// Validate checks the field values on Artifact 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 *Artifact) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on Artifact 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 ArtifactMultiError, or nil -// if none found. -func (m *Artifact) ValidateAll() error { - return m.validate(true) -} - -func (m *Artifact) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for ArtifactId - - // no validation rules for Name - - // no validation rules for Vendor - - // no validation rules for LocationId - - // no validation rules for LocationName - - // no validation rules for ServiceId - - // no validation rules for ServiceName - - // no validation rules for DataModel - - // no validation rules for Status - - if all { - switch v := interface{}(m.GetCreatedAt()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ArtifactValidationError{ - field: "CreatedAt", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ArtifactValidationError{ - field: "CreatedAt", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetCreatedAt()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ArtifactValidationError{ - field: "CreatedAt", - reason: "embedded message failed validation", - cause: err, - } - } - } - - // no validation rules for Mode - - // no validation rules for IsShardedCluster - - // no validation rules for Folder - - for idx, item := range m.GetMetadataList() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ArtifactValidationError{ - field: fmt.Sprintf("MetadataList[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ArtifactValidationError{ - field: fmt.Sprintf("MetadataList[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ArtifactValidationError{ - field: fmt.Sprintf("MetadataList[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - if len(errors) > 0 { - return ArtifactMultiError(errors) - } - - return nil -} - -// ArtifactMultiError is an error wrapping multiple validation errors returned -// by Artifact.ValidateAll() if the designated constraints aren't met. -type ArtifactMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ArtifactMultiError) 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 ArtifactMultiError) AllErrors() []error { return m } - -// ArtifactValidationError is the validation error returned by -// Artifact.Validate if the designated constraints aren't met. -type ArtifactValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ArtifactValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ArtifactValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ArtifactValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ArtifactValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ArtifactValidationError) ErrorName() string { return "ArtifactValidationError" } - -// Error satisfies the builtin error interface -func (e ArtifactValidationError) 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 %sArtifact.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ArtifactValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ArtifactValidationError{} - -// Validate checks the field values on ListArtifactsRequest 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 *ListArtifactsRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ListArtifactsRequest 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 -// ListArtifactsRequestMultiError, or nil if none found. -func (m *ListArtifactsRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *ListArtifactsRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return ListArtifactsRequestMultiError(errors) - } - - return nil -} - -// ListArtifactsRequestMultiError is an error wrapping multiple validation -// errors returned by ListArtifactsRequest.ValidateAll() if the designated -// constraints aren't met. -type ListArtifactsRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ListArtifactsRequestMultiError) 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 ListArtifactsRequestMultiError) AllErrors() []error { return m } - -// ListArtifactsRequestValidationError is the validation error returned by -// ListArtifactsRequest.Validate if the designated constraints aren't met. -type ListArtifactsRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ListArtifactsRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ListArtifactsRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ListArtifactsRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ListArtifactsRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ListArtifactsRequestValidationError) ErrorName() string { - return "ListArtifactsRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e ListArtifactsRequestValidationError) 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 %sListArtifactsRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ListArtifactsRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ListArtifactsRequestValidationError{} - -// Validate checks the field values on ListArtifactsResponse 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 *ListArtifactsResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ListArtifactsResponse 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 -// ListArtifactsResponseMultiError, or nil if none found. -func (m *ListArtifactsResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *ListArtifactsResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - for idx, item := range m.GetArtifacts() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ListArtifactsResponseValidationError{ - field: fmt.Sprintf("Artifacts[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ListArtifactsResponseValidationError{ - field: fmt.Sprintf("Artifacts[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ListArtifactsResponseValidationError{ - field: fmt.Sprintf("Artifacts[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - if len(errors) > 0 { - return ListArtifactsResponseMultiError(errors) - } - - return nil -} - -// ListArtifactsResponseMultiError is an error wrapping multiple validation -// errors returned by ListArtifactsResponse.ValidateAll() if the designated -// constraints aren't met. -type ListArtifactsResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ListArtifactsResponseMultiError) 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 ListArtifactsResponseMultiError) AllErrors() []error { return m } - -// ListArtifactsResponseValidationError is the validation error returned by -// ListArtifactsResponse.Validate if the designated constraints aren't met. -type ListArtifactsResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ListArtifactsResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ListArtifactsResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ListArtifactsResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ListArtifactsResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ListArtifactsResponseValidationError) ErrorName() string { - return "ListArtifactsResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e ListArtifactsResponseValidationError) 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 %sListArtifactsResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ListArtifactsResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ListArtifactsResponseValidationError{} - -// Validate checks the field values on DeleteArtifactRequest 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 *DeleteArtifactRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on DeleteArtifactRequest 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 -// DeleteArtifactRequestMultiError, or nil if none found. -func (m *DeleteArtifactRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *DeleteArtifactRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetArtifactId()) < 1 { - err := DeleteArtifactRequestValidationError{ - field: "ArtifactId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for RemoveFiles - - if len(errors) > 0 { - return DeleteArtifactRequestMultiError(errors) - } - - return nil -} - -// DeleteArtifactRequestMultiError is an error wrapping multiple validation -// errors returned by DeleteArtifactRequest.ValidateAll() if the designated -// constraints aren't met. -type DeleteArtifactRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m DeleteArtifactRequestMultiError) 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 DeleteArtifactRequestMultiError) AllErrors() []error { return m } - -// DeleteArtifactRequestValidationError is the validation error returned by -// DeleteArtifactRequest.Validate if the designated constraints aren't met. -type DeleteArtifactRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e DeleteArtifactRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e DeleteArtifactRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e DeleteArtifactRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e DeleteArtifactRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e DeleteArtifactRequestValidationError) ErrorName() string { - return "DeleteArtifactRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e DeleteArtifactRequestValidationError) 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 %sDeleteArtifactRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = DeleteArtifactRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = DeleteArtifactRequestValidationError{} - -// Validate checks the field values on DeleteArtifactResponse 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 *DeleteArtifactResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on DeleteArtifactResponse 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 -// DeleteArtifactResponseMultiError, or nil if none found. -func (m *DeleteArtifactResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *DeleteArtifactResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return DeleteArtifactResponseMultiError(errors) - } - - return nil -} - -// DeleteArtifactResponseMultiError is an error wrapping multiple validation -// errors returned by DeleteArtifactResponse.ValidateAll() if the designated -// constraints aren't met. -type DeleteArtifactResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m DeleteArtifactResponseMultiError) 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 DeleteArtifactResponseMultiError) AllErrors() []error { return m } - -// DeleteArtifactResponseValidationError is the validation error returned by -// DeleteArtifactResponse.Validate if the designated constraints aren't met. -type DeleteArtifactResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e DeleteArtifactResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e DeleteArtifactResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e DeleteArtifactResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e DeleteArtifactResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e DeleteArtifactResponseValidationError) ErrorName() string { - return "DeleteArtifactResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e DeleteArtifactResponseValidationError) 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 %sDeleteArtifactResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = DeleteArtifactResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = DeleteArtifactResponseValidationError{} - -// Validate checks the field values on PitrTimerange 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 *PitrTimerange) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on PitrTimerange 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 PitrTimerangeMultiError, or -// nil if none found. -func (m *PitrTimerange) ValidateAll() error { - return m.validate(true) -} - -func (m *PitrTimerange) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if all { - switch v := interface{}(m.GetStartTimestamp()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, PitrTimerangeValidationError{ - field: "StartTimestamp", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, PitrTimerangeValidationError{ - field: "StartTimestamp", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetStartTimestamp()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return PitrTimerangeValidationError{ - field: "StartTimestamp", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetEndTimestamp()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, PitrTimerangeValidationError{ - field: "EndTimestamp", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, PitrTimerangeValidationError{ - field: "EndTimestamp", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetEndTimestamp()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return PitrTimerangeValidationError{ - field: "EndTimestamp", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if len(errors) > 0 { - return PitrTimerangeMultiError(errors) - } - - return nil -} - -// PitrTimerangeMultiError is an error wrapping multiple validation errors -// returned by PitrTimerange.ValidateAll() if the designated constraints -// aren't met. -type PitrTimerangeMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m PitrTimerangeMultiError) 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 PitrTimerangeMultiError) AllErrors() []error { return m } - -// PitrTimerangeValidationError is the validation error returned by -// PitrTimerange.Validate if the designated constraints aren't met. -type PitrTimerangeValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e PitrTimerangeValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e PitrTimerangeValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e PitrTimerangeValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e PitrTimerangeValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e PitrTimerangeValidationError) ErrorName() string { return "PitrTimerangeValidationError" } - -// Error satisfies the builtin error interface -func (e PitrTimerangeValidationError) 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 %sPitrTimerange.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = PitrTimerangeValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = PitrTimerangeValidationError{} - -// Validate checks the field values on ListPitrTimerangesRequest 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 *ListPitrTimerangesRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ListPitrTimerangesRequest 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 -// ListPitrTimerangesRequestMultiError, or nil if none found. -func (m *ListPitrTimerangesRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *ListPitrTimerangesRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetArtifactId()) < 1 { - err := ListPitrTimerangesRequestValidationError{ - field: "ArtifactId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if len(errors) > 0 { - return ListPitrTimerangesRequestMultiError(errors) - } - - return nil -} - -// ListPitrTimerangesRequestMultiError is an error wrapping multiple validation -// errors returned by ListPitrTimerangesRequest.ValidateAll() if the -// designated constraints aren't met. -type ListPitrTimerangesRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ListPitrTimerangesRequestMultiError) 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 ListPitrTimerangesRequestMultiError) AllErrors() []error { return m } - -// ListPitrTimerangesRequestValidationError is the validation error returned by -// ListPitrTimerangesRequest.Validate if the designated constraints aren't met. -type ListPitrTimerangesRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ListPitrTimerangesRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ListPitrTimerangesRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ListPitrTimerangesRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ListPitrTimerangesRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ListPitrTimerangesRequestValidationError) ErrorName() string { - return "ListPitrTimerangesRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e ListPitrTimerangesRequestValidationError) 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 %sListPitrTimerangesRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ListPitrTimerangesRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ListPitrTimerangesRequestValidationError{} - -// Validate checks the field values on ListPitrTimerangesResponse 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 *ListPitrTimerangesResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ListPitrTimerangesResponse 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 -// ListPitrTimerangesResponseMultiError, or nil if none found. -func (m *ListPitrTimerangesResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *ListPitrTimerangesResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - for idx, item := range m.GetTimeranges() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ListPitrTimerangesResponseValidationError{ - field: fmt.Sprintf("Timeranges[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ListPitrTimerangesResponseValidationError{ - field: fmt.Sprintf("Timeranges[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ListPitrTimerangesResponseValidationError{ - field: fmt.Sprintf("Timeranges[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - if len(errors) > 0 { - return ListPitrTimerangesResponseMultiError(errors) - } - - return nil -} - -// ListPitrTimerangesResponseMultiError is an error wrapping multiple -// validation errors returned by ListPitrTimerangesResponse.ValidateAll() if -// the designated constraints aren't met. -type ListPitrTimerangesResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ListPitrTimerangesResponseMultiError) 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 ListPitrTimerangesResponseMultiError) AllErrors() []error { return m } - -// ListPitrTimerangesResponseValidationError is the validation error returned -// by ListPitrTimerangesResponse.Validate if the designated constraints aren't met. -type ListPitrTimerangesResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ListPitrTimerangesResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ListPitrTimerangesResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ListPitrTimerangesResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ListPitrTimerangesResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ListPitrTimerangesResponseValidationError) ErrorName() string { - return "ListPitrTimerangesResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e ListPitrTimerangesResponseValidationError) 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 %sListPitrTimerangesResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ListPitrTimerangesResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ListPitrTimerangesResponseValidationError{} diff --git a/api/backup/v1/backup.pb.go b/api/backup/v1/backup.pb.go deleted file mode 100644 index 14ff8f92f1c..00000000000 --- a/api/backup/v1/backup.pb.go +++ /dev/null @@ -1,1351 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.10 -// protoc (unknown) -// source: backup/v1/backup.proto - -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" - durationpb "google.golang.org/protobuf/types/known/durationpb" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" - - v1 "github.com/percona/pmm/api/inventory/v1" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type StartBackupRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Service identifier. - ServiceId string `protobuf:"bytes,1,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` - // Machine-readable location ID. - LocationId string `protobuf:"bytes,2,opt,name=location_id,json=locationId,proto3" json:"location_id,omitempty"` - // If empty then name is auto-generated. - Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` - // Human-readable description. - Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"` - // Delay between each retry. Should have a suffix in JSON: 1s, 1m, 1h. - RetryInterval *durationpb.Duration `protobuf:"bytes,5,opt,name=retry_interval,json=retryInterval,proto3" json:"retry_interval,omitempty"` - // How many times to retry a failed backup before giving up. - Retries uint32 `protobuf:"varint,6,opt,name=retries,proto3" json:"retries,omitempty"` - // DataModel represents the data model used for the backup. - DataModel DataModel `protobuf:"varint,7,opt,name=data_model,json=dataModel,proto3,enum=backup.v1.DataModel" json:"data_model,omitempty"` - // Folder on storage for artifact. - Folder string `protobuf:"bytes,8,opt,name=folder,proto3" json:"folder,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StartBackupRequest) Reset() { - *x = StartBackupRequest{} - mi := &file_backup_v1_backup_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StartBackupRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StartBackupRequest) ProtoMessage() {} - -func (x *StartBackupRequest) ProtoReflect() protoreflect.Message { - mi := &file_backup_v1_backup_proto_msgTypes[0] - 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 StartBackupRequest.ProtoReflect.Descriptor instead. -func (*StartBackupRequest) Descriptor() ([]byte, []int) { - return file_backup_v1_backup_proto_rawDescGZIP(), []int{0} -} - -func (x *StartBackupRequest) GetServiceId() string { - if x != nil { - return x.ServiceId - } - return "" -} - -func (x *StartBackupRequest) GetLocationId() string { - if x != nil { - return x.LocationId - } - return "" -} - -func (x *StartBackupRequest) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *StartBackupRequest) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *StartBackupRequest) GetRetryInterval() *durationpb.Duration { - if x != nil { - return x.RetryInterval - } - return nil -} - -func (x *StartBackupRequest) GetRetries() uint32 { - if x != nil { - return x.Retries - } - return 0 -} - -func (x *StartBackupRequest) GetDataModel() DataModel { - if x != nil { - return x.DataModel - } - return DataModel_DATA_MODEL_UNSPECIFIED -} - -func (x *StartBackupRequest) GetFolder() string { - if x != nil { - return x.Folder - } - return "" -} - -type StartBackupResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Unique identifier. - ArtifactId string `protobuf:"bytes,1,opt,name=artifact_id,json=artifactId,proto3" json:"artifact_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StartBackupResponse) Reset() { - *x = StartBackupResponse{} - mi := &file_backup_v1_backup_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StartBackupResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StartBackupResponse) ProtoMessage() {} - -func (x *StartBackupResponse) ProtoReflect() protoreflect.Message { - mi := &file_backup_v1_backup_proto_msgTypes[1] - 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 StartBackupResponse.ProtoReflect.Descriptor instead. -func (*StartBackupResponse) Descriptor() ([]byte, []int) { - return file_backup_v1_backup_proto_rawDescGZIP(), []int{1} -} - -func (x *StartBackupResponse) GetArtifactId() string { - if x != nil { - return x.ArtifactId - } - return "" -} - -type ListArtifactCompatibleServicesRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Artifact id used to determine restore compatibility. - ArtifactId string `protobuf:"bytes,1,opt,name=artifact_id,json=artifactId,proto3" json:"artifact_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ListArtifactCompatibleServicesRequest) Reset() { - *x = ListArtifactCompatibleServicesRequest{} - mi := &file_backup_v1_backup_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ListArtifactCompatibleServicesRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListArtifactCompatibleServicesRequest) ProtoMessage() {} - -func (x *ListArtifactCompatibleServicesRequest) ProtoReflect() protoreflect.Message { - mi := &file_backup_v1_backup_proto_msgTypes[2] - 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 ListArtifactCompatibleServicesRequest.ProtoReflect.Descriptor instead. -func (*ListArtifactCompatibleServicesRequest) Descriptor() ([]byte, []int) { - return file_backup_v1_backup_proto_rawDescGZIP(), []int{2} -} - -func (x *ListArtifactCompatibleServicesRequest) GetArtifactId() string { - if x != nil { - return x.ArtifactId - } - return "" -} - -type ListArtifactCompatibleServicesResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Mysql []*v1.MySQLService `protobuf:"bytes,1,rep,name=mysql,proto3" json:"mysql,omitempty"` - Mongodb []*v1.MongoDBService `protobuf:"bytes,2,rep,name=mongodb,proto3" json:"mongodb,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ListArtifactCompatibleServicesResponse) Reset() { - *x = ListArtifactCompatibleServicesResponse{} - mi := &file_backup_v1_backup_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ListArtifactCompatibleServicesResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListArtifactCompatibleServicesResponse) ProtoMessage() {} - -func (x *ListArtifactCompatibleServicesResponse) ProtoReflect() protoreflect.Message { - mi := &file_backup_v1_backup_proto_msgTypes[3] - 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 ListArtifactCompatibleServicesResponse.ProtoReflect.Descriptor instead. -func (*ListArtifactCompatibleServicesResponse) Descriptor() ([]byte, []int) { - return file_backup_v1_backup_proto_rawDescGZIP(), []int{3} -} - -func (x *ListArtifactCompatibleServicesResponse) GetMysql() []*v1.MySQLService { - if x != nil { - return x.Mysql - } - return nil -} - -func (x *ListArtifactCompatibleServicesResponse) GetMongodb() []*v1.MongoDBService { - if x != nil { - return x.Mongodb - } - return nil -} - -// ScheduledBackup represents scheduled task for backup. -type ScheduledBackup struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Machine-readable ID. - ScheduledBackupId string `protobuf:"bytes,1,opt,name=scheduled_backup_id,json=scheduledBackupId,proto3" json:"scheduled_backup_id,omitempty"` - // Machine-readable service ID. - ServiceId string `protobuf:"bytes,2,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` - // Service name. - ServiceName string `protobuf:"bytes,3,opt,name=service_name,json=serviceName,proto3" json:"service_name,omitempty"` - // Machine-readable location ID. - LocationId string `protobuf:"bytes,4,opt,name=location_id,json=locationId,proto3" json:"location_id,omitempty"` - // Location name. - LocationName string `protobuf:"bytes,5,opt,name=location_name,json=locationName,proto3" json:"location_name,omitempty"` - // Folder on storage for artifact. - Folder string `protobuf:"bytes,6,opt,name=folder,proto3" json:"folder,omitempty"` - // How often backup will be run in cron format. - CronExpression string `protobuf:"bytes,7,opt,name=cron_expression,json=cronExpression,proto3" json:"cron_expression,omitempty"` - // First backup wouldn't happen before this time. - StartTime *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` - // Artifact name. - Name string `protobuf:"bytes,9,opt,name=name,proto3" json:"name,omitempty"` - // Description. - Description string `protobuf:"bytes,10,opt,name=description,proto3" json:"description,omitempty"` - // If scheduling is enabled. - Enabled bool `protobuf:"varint,11,opt,name=enabled,proto3" json:"enabled,omitempty"` - // How many times to retry a failed backup before giving up. - Retries uint32 `protobuf:"varint,12,opt,name=retries,proto3" json:"retries,omitempty"` - // Delay between each retry. Should have a suffix in JSON: 2s, 1m, 1h. - RetryInterval *durationpb.Duration `protobuf:"bytes,13,opt,name=retry_interval,json=retryInterval,proto3" json:"retry_interval,omitempty"` - // Backup data model (physical or logical). - DataModel DataModel `protobuf:"varint,14,opt,name=data_model,json=dataModel,proto3,enum=backup.v1.DataModel" json:"data_model,omitempty"` - // Backup mode. - Mode BackupMode `protobuf:"varint,15,opt,name=mode,proto3,enum=backup.v1.BackupMode" json:"mode,omitempty"` - // Database vendor e.g. PostgreSQL, MongoDB, MySQL. - Vendor string `protobuf:"bytes,16,opt,name=vendor,proto3" json:"vendor,omitempty"` - // Last run. - LastRun *timestamppb.Timestamp `protobuf:"bytes,17,opt,name=last_run,json=lastRun,proto3" json:"last_run,omitempty"` - // Next run. - NextRun *timestamppb.Timestamp `protobuf:"bytes,18,opt,name=next_run,json=nextRun,proto3" json:"next_run,omitempty"` - // How many artifacts keep. 0 - unlimited. - Retention uint32 `protobuf:"varint,19,opt,name=retention,proto3" json:"retention,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ScheduledBackup) Reset() { - *x = ScheduledBackup{} - mi := &file_backup_v1_backup_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ScheduledBackup) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ScheduledBackup) ProtoMessage() {} - -func (x *ScheduledBackup) ProtoReflect() protoreflect.Message { - mi := &file_backup_v1_backup_proto_msgTypes[4] - 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 ScheduledBackup.ProtoReflect.Descriptor instead. -func (*ScheduledBackup) Descriptor() ([]byte, []int) { - return file_backup_v1_backup_proto_rawDescGZIP(), []int{4} -} - -func (x *ScheduledBackup) GetScheduledBackupId() string { - if x != nil { - return x.ScheduledBackupId - } - return "" -} - -func (x *ScheduledBackup) GetServiceId() string { - if x != nil { - return x.ServiceId - } - return "" -} - -func (x *ScheduledBackup) GetServiceName() string { - if x != nil { - return x.ServiceName - } - return "" -} - -func (x *ScheduledBackup) GetLocationId() string { - if x != nil { - return x.LocationId - } - return "" -} - -func (x *ScheduledBackup) GetLocationName() string { - if x != nil { - return x.LocationName - } - return "" -} - -func (x *ScheduledBackup) GetFolder() string { - if x != nil { - return x.Folder - } - return "" -} - -func (x *ScheduledBackup) GetCronExpression() string { - if x != nil { - return x.CronExpression - } - return "" -} - -func (x *ScheduledBackup) GetStartTime() *timestamppb.Timestamp { - if x != nil { - return x.StartTime - } - return nil -} - -func (x *ScheduledBackup) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *ScheduledBackup) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *ScheduledBackup) GetEnabled() bool { - if x != nil { - return x.Enabled - } - return false -} - -func (x *ScheduledBackup) GetRetries() uint32 { - if x != nil { - return x.Retries - } - return 0 -} - -func (x *ScheduledBackup) GetRetryInterval() *durationpb.Duration { - if x != nil { - return x.RetryInterval - } - return nil -} - -func (x *ScheduledBackup) GetDataModel() DataModel { - if x != nil { - return x.DataModel - } - return DataModel_DATA_MODEL_UNSPECIFIED -} - -func (x *ScheduledBackup) GetMode() BackupMode { - if x != nil { - return x.Mode - } - return BackupMode_BACKUP_MODE_UNSPECIFIED -} - -func (x *ScheduledBackup) GetVendor() string { - if x != nil { - return x.Vendor - } - return "" -} - -func (x *ScheduledBackup) GetLastRun() *timestamppb.Timestamp { - if x != nil { - return x.LastRun - } - return nil -} - -func (x *ScheduledBackup) GetNextRun() *timestamppb.Timestamp { - if x != nil { - return x.NextRun - } - return nil -} - -func (x *ScheduledBackup) GetRetention() uint32 { - if x != nil { - return x.Retention - } - return 0 -} - -type ScheduleBackupRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Service identifier where backup should be performed. - ServiceId string `protobuf:"bytes,1,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` - // Machine-readable location ID. - LocationId string `protobuf:"bytes,2,opt,name=location_id,json=locationId,proto3" json:"location_id,omitempty"` - // How often backup should be run in cron format. - // Folder on storage for artifact. - Folder string `protobuf:"bytes,3,opt,name=folder,proto3" json:"folder,omitempty"` - CronExpression string `protobuf:"bytes,4,opt,name=cron_expression,json=cronExpression,proto3" json:"cron_expression,omitempty"` - // First backup wouldn't happen before this time. - StartTime *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` - // Name of backup. - Name string `protobuf:"bytes,6,opt,name=name,proto3" json:"name,omitempty"` - // Human-readable description. - Description string `protobuf:"bytes,7,opt,name=description,proto3" json:"description,omitempty"` - // If scheduling is enabled. - Enabled bool `protobuf:"varint,8,opt,name=enabled,proto3" json:"enabled,omitempty"` - // How many times to retry a failed backup before giving up. - Retries uint32 `protobuf:"varint,9,opt,name=retries,proto3" json:"retries,omitempty"` - // Delay between each retry. Should have a suffix in JSON: 1s, 1m, 1h. - RetryInterval *durationpb.Duration `protobuf:"bytes,10,opt,name=retry_interval,json=retryInterval,proto3" json:"retry_interval,omitempty"` - // Backup mode. - Mode BackupMode `protobuf:"varint,11,opt,name=mode,proto3,enum=backup.v1.BackupMode" json:"mode,omitempty"` - // Backup data model (physical or logical). - DataModel DataModel `protobuf:"varint,12,opt,name=data_model,json=dataModel,proto3,enum=backup.v1.DataModel" json:"data_model,omitempty"` - // How many artifacts keep. 0 - unlimited. - Retention uint32 `protobuf:"varint,13,opt,name=retention,proto3" json:"retention,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ScheduleBackupRequest) Reset() { - *x = ScheduleBackupRequest{} - mi := &file_backup_v1_backup_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ScheduleBackupRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ScheduleBackupRequest) ProtoMessage() {} - -func (x *ScheduleBackupRequest) ProtoReflect() protoreflect.Message { - mi := &file_backup_v1_backup_proto_msgTypes[5] - 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 ScheduleBackupRequest.ProtoReflect.Descriptor instead. -func (*ScheduleBackupRequest) Descriptor() ([]byte, []int) { - return file_backup_v1_backup_proto_rawDescGZIP(), []int{5} -} - -func (x *ScheduleBackupRequest) GetServiceId() string { - if x != nil { - return x.ServiceId - } - return "" -} - -func (x *ScheduleBackupRequest) GetLocationId() string { - if x != nil { - return x.LocationId - } - return "" -} - -func (x *ScheduleBackupRequest) GetFolder() string { - if x != nil { - return x.Folder - } - return "" -} - -func (x *ScheduleBackupRequest) GetCronExpression() string { - if x != nil { - return x.CronExpression - } - return "" -} - -func (x *ScheduleBackupRequest) GetStartTime() *timestamppb.Timestamp { - if x != nil { - return x.StartTime - } - return nil -} - -func (x *ScheduleBackupRequest) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *ScheduleBackupRequest) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *ScheduleBackupRequest) GetEnabled() bool { - if x != nil { - return x.Enabled - } - return false -} - -func (x *ScheduleBackupRequest) GetRetries() uint32 { - if x != nil { - return x.Retries - } - return 0 -} - -func (x *ScheduleBackupRequest) GetRetryInterval() *durationpb.Duration { - if x != nil { - return x.RetryInterval - } - return nil -} - -func (x *ScheduleBackupRequest) GetMode() BackupMode { - if x != nil { - return x.Mode - } - return BackupMode_BACKUP_MODE_UNSPECIFIED -} - -func (x *ScheduleBackupRequest) GetDataModel() DataModel { - if x != nil { - return x.DataModel - } - return DataModel_DATA_MODEL_UNSPECIFIED -} - -func (x *ScheduleBackupRequest) GetRetention() uint32 { - if x != nil { - return x.Retention - } - return 0 -} - -type ScheduleBackupResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - ScheduledBackupId string `protobuf:"bytes,1,opt,name=scheduled_backup_id,json=scheduledBackupId,proto3" json:"scheduled_backup_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ScheduleBackupResponse) Reset() { - *x = ScheduleBackupResponse{} - mi := &file_backup_v1_backup_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ScheduleBackupResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ScheduleBackupResponse) ProtoMessage() {} - -func (x *ScheduleBackupResponse) ProtoReflect() protoreflect.Message { - mi := &file_backup_v1_backup_proto_msgTypes[6] - 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 ScheduleBackupResponse.ProtoReflect.Descriptor instead. -func (*ScheduleBackupResponse) Descriptor() ([]byte, []int) { - return file_backup_v1_backup_proto_rawDescGZIP(), []int{6} -} - -func (x *ScheduleBackupResponse) GetScheduledBackupId() string { - if x != nil { - return x.ScheduledBackupId - } - return "" -} - -type ListScheduledBackupsRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ListScheduledBackupsRequest) Reset() { - *x = ListScheduledBackupsRequest{} - mi := &file_backup_v1_backup_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ListScheduledBackupsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListScheduledBackupsRequest) ProtoMessage() {} - -func (x *ListScheduledBackupsRequest) ProtoReflect() protoreflect.Message { - mi := &file_backup_v1_backup_proto_msgTypes[7] - 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 ListScheduledBackupsRequest.ProtoReflect.Descriptor instead. -func (*ListScheduledBackupsRequest) Descriptor() ([]byte, []int) { - return file_backup_v1_backup_proto_rawDescGZIP(), []int{7} -} - -type ListScheduledBackupsResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - ScheduledBackups []*ScheduledBackup `protobuf:"bytes,1,rep,name=scheduled_backups,json=scheduledBackups,proto3" json:"scheduled_backups,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ListScheduledBackupsResponse) Reset() { - *x = ListScheduledBackupsResponse{} - mi := &file_backup_v1_backup_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ListScheduledBackupsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListScheduledBackupsResponse) ProtoMessage() {} - -func (x *ListScheduledBackupsResponse) ProtoReflect() protoreflect.Message { - mi := &file_backup_v1_backup_proto_msgTypes[8] - 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 ListScheduledBackupsResponse.ProtoReflect.Descriptor instead. -func (*ListScheduledBackupsResponse) Descriptor() ([]byte, []int) { - return file_backup_v1_backup_proto_rawDescGZIP(), []int{8} -} - -func (x *ListScheduledBackupsResponse) GetScheduledBackups() []*ScheduledBackup { - if x != nil { - return x.ScheduledBackups - } - return nil -} - -type ChangeScheduledBackupRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - ScheduledBackupId string `protobuf:"bytes,1,opt,name=scheduled_backup_id,json=scheduledBackupId,proto3" json:"scheduled_backup_id,omitempty"` - Enabled *bool `protobuf:"varint,2,opt,name=enabled,proto3,oneof" json:"enabled,omitempty"` - // How often backup should be run in cron format. - CronExpression *string `protobuf:"bytes,3,opt,name=cron_expression,json=cronExpression,proto3,oneof" json:"cron_expression,omitempty"` - // First backup wouldn't happen before this time. - StartTime *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` - // Name of backup. - Name *string `protobuf:"bytes,5,opt,name=name,proto3,oneof" json:"name,omitempty"` - // Human-readable description. - Description *string `protobuf:"bytes,6,opt,name=description,proto3,oneof" json:"description,omitempty"` - // How many times to retry a failed backup before giving up. - Retries *uint32 `protobuf:"varint,7,opt,name=retries,proto3,oneof" json:"retries,omitempty"` - // Delay between each retry. Should have a suffix in JSON: 1s, 1m, 1h. - RetryInterval *durationpb.Duration `protobuf:"bytes,8,opt,name=retry_interval,json=retryInterval,proto3" json:"retry_interval,omitempty"` - // How many artifacts keep. 0 - unlimited. - Retention *uint32 `protobuf:"varint,9,opt,name=retention,proto3,oneof" json:"retention,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ChangeScheduledBackupRequest) Reset() { - *x = ChangeScheduledBackupRequest{} - mi := &file_backup_v1_backup_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ChangeScheduledBackupRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ChangeScheduledBackupRequest) ProtoMessage() {} - -func (x *ChangeScheduledBackupRequest) ProtoReflect() protoreflect.Message { - mi := &file_backup_v1_backup_proto_msgTypes[9] - 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 ChangeScheduledBackupRequest.ProtoReflect.Descriptor instead. -func (*ChangeScheduledBackupRequest) Descriptor() ([]byte, []int) { - return file_backup_v1_backup_proto_rawDescGZIP(), []int{9} -} - -func (x *ChangeScheduledBackupRequest) GetScheduledBackupId() string { - if x != nil { - return x.ScheduledBackupId - } - return "" -} - -func (x *ChangeScheduledBackupRequest) GetEnabled() bool { - if x != nil && x.Enabled != nil { - return *x.Enabled - } - return false -} - -func (x *ChangeScheduledBackupRequest) GetCronExpression() string { - if x != nil && x.CronExpression != nil { - return *x.CronExpression - } - return "" -} - -func (x *ChangeScheduledBackupRequest) GetStartTime() *timestamppb.Timestamp { - if x != nil { - return x.StartTime - } - return nil -} - -func (x *ChangeScheduledBackupRequest) GetName() string { - if x != nil && x.Name != nil { - return *x.Name - } - return "" -} - -func (x *ChangeScheduledBackupRequest) GetDescription() string { - if x != nil && x.Description != nil { - return *x.Description - } - return "" -} - -func (x *ChangeScheduledBackupRequest) GetRetries() uint32 { - if x != nil && x.Retries != nil { - return *x.Retries - } - return 0 -} - -func (x *ChangeScheduledBackupRequest) GetRetryInterval() *durationpb.Duration { - if x != nil { - return x.RetryInterval - } - return nil -} - -func (x *ChangeScheduledBackupRequest) GetRetention() uint32 { - if x != nil && x.Retention != nil { - return *x.Retention - } - return 0 -} - -type ChangeScheduledBackupResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ChangeScheduledBackupResponse) Reset() { - *x = ChangeScheduledBackupResponse{} - mi := &file_backup_v1_backup_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ChangeScheduledBackupResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ChangeScheduledBackupResponse) ProtoMessage() {} - -func (x *ChangeScheduledBackupResponse) ProtoReflect() protoreflect.Message { - mi := &file_backup_v1_backup_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 ChangeScheduledBackupResponse.ProtoReflect.Descriptor instead. -func (*ChangeScheduledBackupResponse) Descriptor() ([]byte, []int) { - return file_backup_v1_backup_proto_rawDescGZIP(), []int{10} -} - -type RemoveScheduledBackupRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - ScheduledBackupId string `protobuf:"bytes,1,opt,name=scheduled_backup_id,json=scheduledBackupId,proto3" json:"scheduled_backup_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *RemoveScheduledBackupRequest) Reset() { - *x = RemoveScheduledBackupRequest{} - mi := &file_backup_v1_backup_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *RemoveScheduledBackupRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RemoveScheduledBackupRequest) ProtoMessage() {} - -func (x *RemoveScheduledBackupRequest) ProtoReflect() protoreflect.Message { - mi := &file_backup_v1_backup_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 RemoveScheduledBackupRequest.ProtoReflect.Descriptor instead. -func (*RemoveScheduledBackupRequest) Descriptor() ([]byte, []int) { - return file_backup_v1_backup_proto_rawDescGZIP(), []int{11} -} - -func (x *RemoveScheduledBackupRequest) GetScheduledBackupId() string { - if x != nil { - return x.ScheduledBackupId - } - return "" -} - -type RemoveScheduledBackupResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *RemoveScheduledBackupResponse) Reset() { - *x = RemoveScheduledBackupResponse{} - mi := &file_backup_v1_backup_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *RemoveScheduledBackupResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RemoveScheduledBackupResponse) ProtoMessage() {} - -func (x *RemoveScheduledBackupResponse) ProtoReflect() protoreflect.Message { - mi := &file_backup_v1_backup_proto_msgTypes[12] - 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 RemoveScheduledBackupResponse.ProtoReflect.Descriptor instead. -func (*RemoveScheduledBackupResponse) Descriptor() ([]byte, []int) { - return file_backup_v1_backup_proto_rawDescGZIP(), []int{12} -} - -type GetLogsRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - ArtifactId string `protobuf:"bytes,1,opt,name=artifact_id,json=artifactId,proto3" json:"artifact_id,omitempty"` - Offset uint32 `protobuf:"varint,2,opt,name=offset,proto3" json:"offset,omitempty"` - Limit uint32 `protobuf:"varint,3,opt,name=limit,proto3" json:"limit,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetLogsRequest) Reset() { - *x = GetLogsRequest{} - mi := &file_backup_v1_backup_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetLogsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetLogsRequest) ProtoMessage() {} - -func (x *GetLogsRequest) ProtoReflect() protoreflect.Message { - mi := &file_backup_v1_backup_proto_msgTypes[13] - 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 GetLogsRequest.ProtoReflect.Descriptor instead. -func (*GetLogsRequest) Descriptor() ([]byte, []int) { - return file_backup_v1_backup_proto_rawDescGZIP(), []int{13} -} - -func (x *GetLogsRequest) GetArtifactId() string { - if x != nil { - return x.ArtifactId - } - return "" -} - -func (x *GetLogsRequest) GetOffset() uint32 { - if x != nil { - return x.Offset - } - return 0 -} - -func (x *GetLogsRequest) GetLimit() uint32 { - if x != nil { - return x.Limit - } - return 0 -} - -type GetLogsResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Logs []*LogChunk `protobuf:"bytes,1,rep,name=logs,proto3" json:"logs,omitempty"` - End bool `protobuf:"varint,2,opt,name=end,proto3" json:"end,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetLogsResponse) Reset() { - *x = GetLogsResponse{} - mi := &file_backup_v1_backup_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetLogsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetLogsResponse) ProtoMessage() {} - -func (x *GetLogsResponse) ProtoReflect() protoreflect.Message { - mi := &file_backup_v1_backup_proto_msgTypes[14] - 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 GetLogsResponse.ProtoReflect.Descriptor instead. -func (*GetLogsResponse) Descriptor() ([]byte, []int) { - return file_backup_v1_backup_proto_rawDescGZIP(), []int{14} -} - -func (x *GetLogsResponse) GetLogs() []*LogChunk { - if x != nil { - return x.Logs - } - return nil -} - -func (x *GetLogsResponse) GetEnd() bool { - if x != nil { - return x.End - } - return false -} - -var File_backup_v1_backup_proto protoreflect.FileDescriptor - -const file_backup_v1_backup_proto_rawDesc = "" + - "\n" + - "\x16backup/v1/backup.proto\x12\tbackup.v1\x1a\x19backup/v1/artifacts.proto\x1a\x16backup/v1/common.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1binventory/v1/services.proto\x1a.protoc-gen-openapiv2/options/annotations.proto\x1a\x17validate/validate.proto\"\xc5\x02\n" + - "\x12StartBackupRequest\x12&\n" + - "\n" + - "service_id\x18\x01 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\tserviceId\x12(\n" + - "\vlocation_id\x18\x02 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\n" + - "locationId\x12\x12\n" + - "\x04name\x18\x03 \x01(\tR\x04name\x12 \n" + - "\vdescription\x18\x04 \x01(\tR\vdescription\x12@\n" + - "\x0eretry_interval\x18\x05 \x01(\v2\x19.google.protobuf.DurationR\rretryInterval\x12\x18\n" + - "\aretries\x18\x06 \x01(\rR\aretries\x123\n" + - "\n" + - "data_model\x18\a \x01(\x0e2\x14.backup.v1.DataModelR\tdataModel\x12\x16\n" + - "\x06folder\x18\b \x01(\tR\x06folder\"6\n" + - "\x13StartBackupResponse\x12\x1f\n" + - "\vartifact_id\x18\x01 \x01(\tR\n" + - "artifactId\"Q\n" + - "%ListArtifactCompatibleServicesRequest\x12(\n" + - "\vartifact_id\x18\x01 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\n" + - "artifactId\"\x92\x01\n" + - "&ListArtifactCompatibleServicesResponse\x120\n" + - "\x05mysql\x18\x01 \x03(\v2\x1a.inventory.v1.MySQLServiceR\x05mysql\x126\n" + - "\amongodb\x18\x02 \x03(\v2\x1c.inventory.v1.MongoDBServiceR\amongodb\"\xf5\x05\n" + - "\x0fScheduledBackup\x12.\n" + - "\x13scheduled_backup_id\x18\x01 \x01(\tR\x11scheduledBackupId\x12\x1d\n" + - "\n" + - "service_id\x18\x02 \x01(\tR\tserviceId\x12!\n" + - "\fservice_name\x18\x03 \x01(\tR\vserviceName\x12\x1f\n" + - "\vlocation_id\x18\x04 \x01(\tR\n" + - "locationId\x12#\n" + - "\rlocation_name\x18\x05 \x01(\tR\flocationName\x12\x16\n" + - "\x06folder\x18\x06 \x01(\tR\x06folder\x12'\n" + - "\x0fcron_expression\x18\a \x01(\tR\x0ecronExpression\x129\n" + - "\n" + - "start_time\x18\b \x01(\v2\x1a.google.protobuf.TimestampR\tstartTime\x12\x12\n" + - "\x04name\x18\t \x01(\tR\x04name\x12 \n" + - "\vdescription\x18\n" + - " \x01(\tR\vdescription\x12\x18\n" + - "\aenabled\x18\v \x01(\bR\aenabled\x12\x18\n" + - "\aretries\x18\f \x01(\rR\aretries\x12@\n" + - "\x0eretry_interval\x18\r \x01(\v2\x19.google.protobuf.DurationR\rretryInterval\x123\n" + - "\n" + - "data_model\x18\x0e \x01(\x0e2\x14.backup.v1.DataModelR\tdataModel\x12)\n" + - "\x04mode\x18\x0f \x01(\x0e2\x15.backup.v1.BackupModeR\x04mode\x12\x16\n" + - "\x06vendor\x18\x10 \x01(\tR\x06vendor\x125\n" + - "\blast_run\x18\x11 \x01(\v2\x1a.google.protobuf.TimestampR\alastRun\x125\n" + - "\bnext_run\x18\x12 \x01(\v2\x1a.google.protobuf.TimestampR\anextRun\x12\x1c\n" + - "\tretention\x18\x13 \x01(\rR\tretention\"\x98\x04\n" + - "\x15ScheduleBackupRequest\x12&\n" + - "\n" + - "service_id\x18\x01 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\tserviceId\x12(\n" + - "\vlocation_id\x18\x02 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\n" + - "locationId\x12\x16\n" + - "\x06folder\x18\x03 \x01(\tR\x06folder\x120\n" + - "\x0fcron_expression\x18\x04 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\x0ecronExpression\x129\n" + - "\n" + - "start_time\x18\x05 \x01(\v2\x1a.google.protobuf.TimestampR\tstartTime\x12\x12\n" + - "\x04name\x18\x06 \x01(\tR\x04name\x12 \n" + - "\vdescription\x18\a \x01(\tR\vdescription\x12\x18\n" + - "\aenabled\x18\b \x01(\bR\aenabled\x12\x18\n" + - "\aretries\x18\t \x01(\rR\aretries\x12@\n" + - "\x0eretry_interval\x18\n" + - " \x01(\v2\x19.google.protobuf.DurationR\rretryInterval\x12)\n" + - "\x04mode\x18\v \x01(\x0e2\x15.backup.v1.BackupModeR\x04mode\x123\n" + - "\n" + - "data_model\x18\f \x01(\x0e2\x14.backup.v1.DataModelR\tdataModel\x12\x1c\n" + - "\tretention\x18\r \x01(\rR\tretention\"H\n" + - "\x16ScheduleBackupResponse\x12.\n" + - "\x13scheduled_backup_id\x18\x01 \x01(\tR\x11scheduledBackupId\"\x1d\n" + - "\x1bListScheduledBackupsRequest\"g\n" + - "\x1cListScheduledBackupsResponse\x12G\n" + - "\x11scheduled_backups\x18\x01 \x03(\v2\x1a.backup.v1.ScheduledBackupR\x10scheduledBackups\"\xf6\x03\n" + - "\x1cChangeScheduledBackupRequest\x127\n" + - "\x13scheduled_backup_id\x18\x01 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\x11scheduledBackupId\x12\x1d\n" + - "\aenabled\x18\x02 \x01(\bH\x00R\aenabled\x88\x01\x01\x12,\n" + - "\x0fcron_expression\x18\x03 \x01(\tH\x01R\x0ecronExpression\x88\x01\x01\x129\n" + - "\n" + - "start_time\x18\x04 \x01(\v2\x1a.google.protobuf.TimestampR\tstartTime\x12\x17\n" + - "\x04name\x18\x05 \x01(\tH\x02R\x04name\x88\x01\x01\x12%\n" + - "\vdescription\x18\x06 \x01(\tH\x03R\vdescription\x88\x01\x01\x12\x1d\n" + - "\aretries\x18\a \x01(\rH\x04R\aretries\x88\x01\x01\x12@\n" + - "\x0eretry_interval\x18\b \x01(\v2\x19.google.protobuf.DurationR\rretryInterval\x12!\n" + - "\tretention\x18\t \x01(\rH\x05R\tretention\x88\x01\x01B\n" + - "\n" + - "\b_enabledB\x12\n" + - "\x10_cron_expressionB\a\n" + - "\x05_nameB\x0e\n" + - "\f_descriptionB\n" + - "\n" + - "\b_retriesB\f\n" + - "\n" + - "_retention\"\x1f\n" + - "\x1dChangeScheduledBackupResponse\"W\n" + - "\x1cRemoveScheduledBackupRequest\x127\n" + - "\x13scheduled_backup_id\x18\x01 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\x11scheduledBackupId\"\x1f\n" + - "\x1dRemoveScheduledBackupResponse\"h\n" + - "\x0eGetLogsRequest\x12(\n" + - "\vartifact_id\x18\x01 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\n" + - "artifactId\x12\x16\n" + - "\x06offset\x18\x02 \x01(\rR\x06offset\x12\x14\n" + - "\x05limit\x18\x03 \x01(\rR\x05limit\"L\n" + - "\x0fGetLogsResponse\x12'\n" + - "\x04logs\x18\x01 \x03(\v2\x13.backup.v1.LogChunkR\x04logs\x12\x10\n" + - "\x03end\x18\x02 \x01(\bR\x03end2\xc5\x12\n" + - "\rBackupService\x12\xe7\x03\n" + - "\vStartBackup\x12\x1d.backup.v1.StartBackupRequest\x1a\x1e.backup.v1.StartBackupResponse\"\x98\x03\x92A\xf8\x02\x12\x0eStart a Backup\x1a\xe5\x02Could return the Error message in the details containing specific ErrorCode indicating failure reason:\n" + - "ERROR_CODE_XTRABACKUP_NOT_INSTALLED - xtrabackup is not installed on the service\n" + - "ERROR_CODE_INVALID_XTRABACKUP - different versions of xtrabackup and xbcloud\n" + - "ERROR_CODE_INCOMPATIBLE_XTRABACKUP - xtrabackup is not compatible with MySQL for taking a backup\x82\xd3\xe4\x93\x02\x16:\x01*\"\x11/v1/backups:start\x12\x97\x02\n" + - "\x1eListArtifactCompatibleServices\x120.backup.v1.ListArtifactCompatibleServicesRequest\x1a1.backup.v1.ListArtifactCompatibleServicesResponse\"\x8f\x01\x92AW\x12\x18List Compatible Services\x1a;List services that are compatible with the backup artifact.\x82\xd3\xe4\x93\x02/\x12-/v1/backups/{artifact_id}/compatible-services\x12\xbb\x01\n" + - "\x0eScheduleBackup\x12 .backup.v1.ScheduleBackupRequest\x1a!.backup.v1.ScheduleBackupResponse\"d\x92AB\x12\x11Schedule a Backup\x1a-Schedule a backup to run at a specified time.\x82\xd3\xe4\x93\x02\x19:\x01*\"\x14/v1/backups:schedule\x12\xbe\x01\n" + - "\x14ListScheduledBackups\x12&.backup.v1.ListScheduledBackupsRequest\x1a'.backup.v1.ListScheduledBackupsResponse\"U\x92A5\x12\x16List Scheduled Backups\x1a\x1bList all scheduled backups.\x82\xd3\xe4\x93\x02\x17\x12\x15/v1/backups/scheduled\x12\xcc\x01\n" + - "\x15ChangeScheduledBackup\x12'.backup.v1.ChangeScheduledBackupRequest\x1a(.backup.v1.ChangeScheduledBackupResponse\"`\x92A7\x12\x19Change a Scheduled Backup\x1a\x1aChange a scheduled backup.\x82\xd3\xe4\x93\x02 :\x01*\x1a\x1b/v1/backups:changeScheduled\x12\xcf\x01\n" + - "\x15RemoveScheduledBackup\x12'.backup.v1.RemoveScheduledBackupRequest\x1a(.backup.v1.RemoveScheduledBackupResponse\"c\x92A7\x12\x19Remove a Scheduled Backup\x1a\x1aRemove a scheduled backup.\x82\xd3\xe4\x93\x02#*!/v1/backups/{scheduled_backup_id}\x12\xb3\x01\n" + - "\aGetLogs\x12\x19.backup.v1.GetLogsRequest\x1a\x1a.backup.v1.GetLogsResponse\"q\x92AH\x12\bGet Logs\x1a google.protobuf.Duration - 16, // 1: backup.v1.StartBackupRequest.data_model:type_name -> backup.v1.DataModel - 17, // 2: backup.v1.ListArtifactCompatibleServicesResponse.mysql:type_name -> inventory.v1.MySQLService - 18, // 3: backup.v1.ListArtifactCompatibleServicesResponse.mongodb:type_name -> inventory.v1.MongoDBService - 19, // 4: backup.v1.ScheduledBackup.start_time:type_name -> google.protobuf.Timestamp - 15, // 5: backup.v1.ScheduledBackup.retry_interval:type_name -> google.protobuf.Duration - 16, // 6: backup.v1.ScheduledBackup.data_model:type_name -> backup.v1.DataModel - 20, // 7: backup.v1.ScheduledBackup.mode:type_name -> backup.v1.BackupMode - 19, // 8: backup.v1.ScheduledBackup.last_run:type_name -> google.protobuf.Timestamp - 19, // 9: backup.v1.ScheduledBackup.next_run:type_name -> google.protobuf.Timestamp - 19, // 10: backup.v1.ScheduleBackupRequest.start_time:type_name -> google.protobuf.Timestamp - 15, // 11: backup.v1.ScheduleBackupRequest.retry_interval:type_name -> google.protobuf.Duration - 20, // 12: backup.v1.ScheduleBackupRequest.mode:type_name -> backup.v1.BackupMode - 16, // 13: backup.v1.ScheduleBackupRequest.data_model:type_name -> backup.v1.DataModel - 4, // 14: backup.v1.ListScheduledBackupsResponse.scheduled_backups:type_name -> backup.v1.ScheduledBackup - 19, // 15: backup.v1.ChangeScheduledBackupRequest.start_time:type_name -> google.protobuf.Timestamp - 15, // 16: backup.v1.ChangeScheduledBackupRequest.retry_interval:type_name -> google.protobuf.Duration - 21, // 17: backup.v1.GetLogsResponse.logs:type_name -> backup.v1.LogChunk - 0, // 18: backup.v1.BackupService.StartBackup:input_type -> backup.v1.StartBackupRequest - 2, // 19: backup.v1.BackupService.ListArtifactCompatibleServices:input_type -> backup.v1.ListArtifactCompatibleServicesRequest - 5, // 20: backup.v1.BackupService.ScheduleBackup:input_type -> backup.v1.ScheduleBackupRequest - 7, // 21: backup.v1.BackupService.ListScheduledBackups:input_type -> backup.v1.ListScheduledBackupsRequest - 9, // 22: backup.v1.BackupService.ChangeScheduledBackup:input_type -> backup.v1.ChangeScheduledBackupRequest - 11, // 23: backup.v1.BackupService.RemoveScheduledBackup:input_type -> backup.v1.RemoveScheduledBackupRequest - 13, // 24: backup.v1.BackupService.GetLogs:input_type -> backup.v1.GetLogsRequest - 22, // 25: backup.v1.BackupService.ListArtifacts:input_type -> backup.v1.ListArtifactsRequest - 23, // 26: backup.v1.BackupService.DeleteArtifact:input_type -> backup.v1.DeleteArtifactRequest - 24, // 27: backup.v1.BackupService.ListPitrTimeranges:input_type -> backup.v1.ListPitrTimerangesRequest - 1, // 28: backup.v1.BackupService.StartBackup:output_type -> backup.v1.StartBackupResponse - 3, // 29: backup.v1.BackupService.ListArtifactCompatibleServices:output_type -> backup.v1.ListArtifactCompatibleServicesResponse - 6, // 30: backup.v1.BackupService.ScheduleBackup:output_type -> backup.v1.ScheduleBackupResponse - 8, // 31: backup.v1.BackupService.ListScheduledBackups:output_type -> backup.v1.ListScheduledBackupsResponse - 10, // 32: backup.v1.BackupService.ChangeScheduledBackup:output_type -> backup.v1.ChangeScheduledBackupResponse - 12, // 33: backup.v1.BackupService.RemoveScheduledBackup:output_type -> backup.v1.RemoveScheduledBackupResponse - 14, // 34: backup.v1.BackupService.GetLogs:output_type -> backup.v1.GetLogsResponse - 25, // 35: backup.v1.BackupService.ListArtifacts:output_type -> backup.v1.ListArtifactsResponse - 26, // 36: backup.v1.BackupService.DeleteArtifact:output_type -> backup.v1.DeleteArtifactResponse - 27, // 37: backup.v1.BackupService.ListPitrTimeranges:output_type -> backup.v1.ListPitrTimerangesResponse - 28, // [28:38] is the sub-list for method output_type - 18, // [18:28] 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_backup_v1_backup_proto_init() } -func file_backup_v1_backup_proto_init() { - if File_backup_v1_backup_proto != nil { - return - } - file_backup_v1_artifacts_proto_init() - file_backup_v1_common_proto_init() - file_backup_v1_backup_proto_msgTypes[9].OneofWrappers = []any{} - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_backup_v1_backup_proto_rawDesc), len(file_backup_v1_backup_proto_rawDesc)), - NumEnums: 0, - NumMessages: 15, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_backup_v1_backup_proto_goTypes, - DependencyIndexes: file_backup_v1_backup_proto_depIdxs, - MessageInfos: file_backup_v1_backup_proto_msgTypes, - }.Build() - File_backup_v1_backup_proto = out.File - file_backup_v1_backup_proto_goTypes = nil - file_backup_v1_backup_proto_depIdxs = nil -} diff --git a/api/backup/v1/backup.pb.gw.go b/api/backup/v1/backup.pb.gw.go deleted file mode 100644 index f7daee52d8c..00000000000 --- a/api/backup/v1/backup.pb.gw.go +++ /dev/null @@ -1,827 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: backup/v1/backup.proto - -/* -Package backupv1 is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package backupv1 - -import ( - "context" - "errors" - "io" - "net/http" - - "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" - "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" - "google.golang.org/protobuf/proto" -) - -// Suppress "imported and not used" errors -var ( - _ codes.Code - _ io.Reader - _ status.Status - _ = errors.New - _ = runtime.String - _ = utilities.NewDoubleArray - _ = metadata.Join -) - -func request_BackupService_StartBackup_0(ctx context.Context, marshaler runtime.Marshaler, client BackupServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq StartBackupRequest - 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.StartBackup(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_BackupService_StartBackup_0(ctx context.Context, marshaler runtime.Marshaler, server BackupServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq StartBackupRequest - 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.StartBackup(ctx, &protoReq) - return msg, metadata, err -} - -func request_BackupService_ListArtifactCompatibleServices_0(ctx context.Context, marshaler runtime.Marshaler, client BackupServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq ListArtifactCompatibleServicesRequest - metadata runtime.ServerMetadata - err error - ) - if req.Body != nil { - _, _ = io.Copy(io.Discard, req.Body) - } - val, ok := pathParams["artifact_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "artifact_id") - } - protoReq.ArtifactId, err = runtime.String(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "artifact_id", err) - } - msg, err := client.ListArtifactCompatibleServices(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_BackupService_ListArtifactCompatibleServices_0(ctx context.Context, marshaler runtime.Marshaler, server BackupServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq ListArtifactCompatibleServicesRequest - metadata runtime.ServerMetadata - err error - ) - val, ok := pathParams["artifact_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "artifact_id") - } - protoReq.ArtifactId, err = runtime.String(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "artifact_id", err) - } - msg, err := server.ListArtifactCompatibleServices(ctx, &protoReq) - return msg, metadata, err -} - -func request_BackupService_ScheduleBackup_0(ctx context.Context, marshaler runtime.Marshaler, client BackupServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq ScheduleBackupRequest - 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.ScheduleBackup(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_BackupService_ScheduleBackup_0(ctx context.Context, marshaler runtime.Marshaler, server BackupServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq ScheduleBackupRequest - 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.ScheduleBackup(ctx, &protoReq) - return msg, metadata, err -} - -func request_BackupService_ListScheduledBackups_0(ctx context.Context, marshaler runtime.Marshaler, client BackupServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq ListScheduledBackupsRequest - metadata runtime.ServerMetadata - ) - if req.Body != nil { - _, _ = io.Copy(io.Discard, req.Body) - } - msg, err := client.ListScheduledBackups(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_BackupService_ListScheduledBackups_0(ctx context.Context, marshaler runtime.Marshaler, server BackupServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq ListScheduledBackupsRequest - metadata runtime.ServerMetadata - ) - msg, err := server.ListScheduledBackups(ctx, &protoReq) - return msg, metadata, err -} - -func request_BackupService_ChangeScheduledBackup_0(ctx context.Context, marshaler runtime.Marshaler, client BackupServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq ChangeScheduledBackupRequest - 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.ChangeScheduledBackup(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_BackupService_ChangeScheduledBackup_0(ctx context.Context, marshaler runtime.Marshaler, server BackupServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq ChangeScheduledBackupRequest - 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.ChangeScheduledBackup(ctx, &protoReq) - return msg, metadata, err -} - -func request_BackupService_RemoveScheduledBackup_0(ctx context.Context, marshaler runtime.Marshaler, client BackupServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq RemoveScheduledBackupRequest - metadata runtime.ServerMetadata - err error - ) - if req.Body != nil { - _, _ = io.Copy(io.Discard, req.Body) - } - val, ok := pathParams["scheduled_backup_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "scheduled_backup_id") - } - protoReq.ScheduledBackupId, err = runtime.String(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "scheduled_backup_id", err) - } - msg, err := client.RemoveScheduledBackup(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_BackupService_RemoveScheduledBackup_0(ctx context.Context, marshaler runtime.Marshaler, server BackupServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq RemoveScheduledBackupRequest - metadata runtime.ServerMetadata - err error - ) - val, ok := pathParams["scheduled_backup_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "scheduled_backup_id") - } - protoReq.ScheduledBackupId, err = runtime.String(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "scheduled_backup_id", err) - } - msg, err := server.RemoveScheduledBackup(ctx, &protoReq) - return msg, metadata, err -} - -var filter_BackupService_GetLogs_0 = &utilities.DoubleArray{Encoding: map[string]int{"artifact_id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} - -func request_BackupService_GetLogs_0(ctx context.Context, marshaler runtime.Marshaler, client BackupServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq GetLogsRequest - metadata runtime.ServerMetadata - err error - ) - if req.Body != nil { - _, _ = io.Copy(io.Discard, req.Body) - } - val, ok := pathParams["artifact_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "artifact_id") - } - protoReq.ArtifactId, err = runtime.String(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "artifact_id", err) - } - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BackupService_GetLogs_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - msg, err := client.GetLogs(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_BackupService_GetLogs_0(ctx context.Context, marshaler runtime.Marshaler, server BackupServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq GetLogsRequest - metadata runtime.ServerMetadata - err error - ) - val, ok := pathParams["artifact_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "artifact_id") - } - protoReq.ArtifactId, err = runtime.String(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "artifact_id", err) - } - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BackupService_GetLogs_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - msg, err := server.GetLogs(ctx, &protoReq) - return msg, metadata, err -} - -func request_BackupService_ListArtifacts_0(ctx context.Context, marshaler runtime.Marshaler, client BackupServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq ListArtifactsRequest - metadata runtime.ServerMetadata - ) - if req.Body != nil { - _, _ = io.Copy(io.Discard, req.Body) - } - msg, err := client.ListArtifacts(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_BackupService_ListArtifacts_0(ctx context.Context, marshaler runtime.Marshaler, server BackupServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq ListArtifactsRequest - metadata runtime.ServerMetadata - ) - msg, err := server.ListArtifacts(ctx, &protoReq) - return msg, metadata, err -} - -var filter_BackupService_DeleteArtifact_0 = &utilities.DoubleArray{Encoding: map[string]int{"artifact_id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} - -func request_BackupService_DeleteArtifact_0(ctx context.Context, marshaler runtime.Marshaler, client BackupServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq DeleteArtifactRequest - metadata runtime.ServerMetadata - err error - ) - if req.Body != nil { - _, _ = io.Copy(io.Discard, req.Body) - } - val, ok := pathParams["artifact_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "artifact_id") - } - protoReq.ArtifactId, err = runtime.String(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "artifact_id", err) - } - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BackupService_DeleteArtifact_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - msg, err := client.DeleteArtifact(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_BackupService_DeleteArtifact_0(ctx context.Context, marshaler runtime.Marshaler, server BackupServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq DeleteArtifactRequest - metadata runtime.ServerMetadata - err error - ) - val, ok := pathParams["artifact_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "artifact_id") - } - protoReq.ArtifactId, err = runtime.String(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "artifact_id", err) - } - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BackupService_DeleteArtifact_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - msg, err := server.DeleteArtifact(ctx, &protoReq) - return msg, metadata, err -} - -func request_BackupService_ListPitrTimeranges_0(ctx context.Context, marshaler runtime.Marshaler, client BackupServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq ListPitrTimerangesRequest - metadata runtime.ServerMetadata - err error - ) - if req.Body != nil { - _, _ = io.Copy(io.Discard, req.Body) - } - val, ok := pathParams["artifact_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "artifact_id") - } - protoReq.ArtifactId, err = runtime.String(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "artifact_id", err) - } - msg, err := client.ListPitrTimeranges(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_BackupService_ListPitrTimeranges_0(ctx context.Context, marshaler runtime.Marshaler, server BackupServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq ListPitrTimerangesRequest - metadata runtime.ServerMetadata - err error - ) - val, ok := pathParams["artifact_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "artifact_id") - } - protoReq.ArtifactId, err = runtime.String(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "artifact_id", err) - } - msg, err := server.ListPitrTimeranges(ctx, &protoReq) - return msg, metadata, err -} - -// RegisterBackupServiceHandlerServer registers the http handlers for service BackupService to "mux". -// UnaryRPC :call BackupServiceServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterBackupServiceHandlerFromEndpoint instead. -// GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call. -func RegisterBackupServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server BackupServiceServer) error { - mux.Handle(http.MethodPost, pattern_BackupService_StartBackup_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, "/backup.v1.BackupService/StartBackup", runtime.WithHTTPPathPattern("/v1/backups:start")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BackupService_StartBackup_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_BackupService_StartBackup_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodGet, pattern_BackupService_ListArtifactCompatibleServices_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, "/backup.v1.BackupService/ListArtifactCompatibleServices", runtime.WithHTTPPathPattern("/v1/backups/{artifact_id}/compatible-services")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BackupService_ListArtifactCompatibleServices_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_BackupService_ListArtifactCompatibleServices_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPost, pattern_BackupService_ScheduleBackup_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, "/backup.v1.BackupService/ScheduleBackup", runtime.WithHTTPPathPattern("/v1/backups:schedule")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BackupService_ScheduleBackup_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_BackupService_ScheduleBackup_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodGet, pattern_BackupService_ListScheduledBackups_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, "/backup.v1.BackupService/ListScheduledBackups", runtime.WithHTTPPathPattern("/v1/backups/scheduled")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BackupService_ListScheduledBackups_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_BackupService_ListScheduledBackups_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPut, pattern_BackupService_ChangeScheduledBackup_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, "/backup.v1.BackupService/ChangeScheduledBackup", runtime.WithHTTPPathPattern("/v1/backups:changeScheduled")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BackupService_ChangeScheduledBackup_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_BackupService_ChangeScheduledBackup_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodDelete, pattern_BackupService_RemoveScheduledBackup_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, "/backup.v1.BackupService/RemoveScheduledBackup", runtime.WithHTTPPathPattern("/v1/backups/{scheduled_backup_id}")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BackupService_RemoveScheduledBackup_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_BackupService_RemoveScheduledBackup_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodGet, pattern_BackupService_GetLogs_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, "/backup.v1.BackupService/GetLogs", runtime.WithHTTPPathPattern("/v1/backups/{artifact_id}/logs")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BackupService_GetLogs_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_BackupService_GetLogs_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodGet, pattern_BackupService_ListArtifacts_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, "/backup.v1.BackupService/ListArtifacts", runtime.WithHTTPPathPattern("/v1/backups/artifacts")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BackupService_ListArtifacts_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_BackupService_ListArtifacts_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodDelete, pattern_BackupService_DeleteArtifact_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, "/backup.v1.BackupService/DeleteArtifact", runtime.WithHTTPPathPattern("/v1/backups/artifacts/{artifact_id}")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BackupService_DeleteArtifact_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_BackupService_DeleteArtifact_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodGet, pattern_BackupService_ListPitrTimeranges_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, "/backup.v1.BackupService/ListPitrTimeranges", runtime.WithHTTPPathPattern("/v1/backups/artifacts/{artifact_id}/pitr-timeranges")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BackupService_ListPitrTimeranges_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_BackupService_ListPitrTimeranges_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - return nil -} - -// RegisterBackupServiceHandlerFromEndpoint is same as RegisterBackupServiceHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterBackupServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.NewClient(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - return RegisterBackupServiceHandler(ctx, mux, conn) -} - -// RegisterBackupServiceHandler registers the http handlers for service BackupService to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterBackupServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterBackupServiceHandlerClient(ctx, mux, NewBackupServiceClient(conn)) -} - -// RegisterBackupServiceHandlerClient registers the http handlers for service BackupService -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "BackupServiceClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "BackupServiceClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "BackupServiceClient" to call the correct interceptors. This client ignores the HTTP middlewares. -func RegisterBackupServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client BackupServiceClient) error { - mux.Handle(http.MethodPost, pattern_BackupService_StartBackup_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, "/backup.v1.BackupService/StartBackup", runtime.WithHTTPPathPattern("/v1/backups:start")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BackupService_StartBackup_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_BackupService_StartBackup_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodGet, pattern_BackupService_ListArtifactCompatibleServices_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, "/backup.v1.BackupService/ListArtifactCompatibleServices", runtime.WithHTTPPathPattern("/v1/backups/{artifact_id}/compatible-services")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BackupService_ListArtifactCompatibleServices_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_BackupService_ListArtifactCompatibleServices_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPost, pattern_BackupService_ScheduleBackup_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, "/backup.v1.BackupService/ScheduleBackup", runtime.WithHTTPPathPattern("/v1/backups:schedule")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BackupService_ScheduleBackup_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_BackupService_ScheduleBackup_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodGet, pattern_BackupService_ListScheduledBackups_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, "/backup.v1.BackupService/ListScheduledBackups", runtime.WithHTTPPathPattern("/v1/backups/scheduled")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BackupService_ListScheduledBackups_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_BackupService_ListScheduledBackups_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPut, pattern_BackupService_ChangeScheduledBackup_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, "/backup.v1.BackupService/ChangeScheduledBackup", runtime.WithHTTPPathPattern("/v1/backups:changeScheduled")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BackupService_ChangeScheduledBackup_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_BackupService_ChangeScheduledBackup_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodDelete, pattern_BackupService_RemoveScheduledBackup_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, "/backup.v1.BackupService/RemoveScheduledBackup", runtime.WithHTTPPathPattern("/v1/backups/{scheduled_backup_id}")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BackupService_RemoveScheduledBackup_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_BackupService_RemoveScheduledBackup_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodGet, pattern_BackupService_GetLogs_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, "/backup.v1.BackupService/GetLogs", runtime.WithHTTPPathPattern("/v1/backups/{artifact_id}/logs")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BackupService_GetLogs_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_BackupService_GetLogs_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodGet, pattern_BackupService_ListArtifacts_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, "/backup.v1.BackupService/ListArtifacts", runtime.WithHTTPPathPattern("/v1/backups/artifacts")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BackupService_ListArtifacts_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_BackupService_ListArtifacts_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodDelete, pattern_BackupService_DeleteArtifact_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, "/backup.v1.BackupService/DeleteArtifact", runtime.WithHTTPPathPattern("/v1/backups/artifacts/{artifact_id}")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BackupService_DeleteArtifact_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_BackupService_DeleteArtifact_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodGet, pattern_BackupService_ListPitrTimeranges_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, "/backup.v1.BackupService/ListPitrTimeranges", runtime.WithHTTPPathPattern("/v1/backups/artifacts/{artifact_id}/pitr-timeranges")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BackupService_ListPitrTimeranges_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_BackupService_ListPitrTimeranges_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - return nil -} - -var ( - pattern_BackupService_StartBackup_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "backups"}, "start")) - pattern_BackupService_ListArtifactCompatibleServices_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3}, []string{"v1", "backups", "artifact_id", "compatible-services"}, "")) - pattern_BackupService_ScheduleBackup_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "backups"}, "schedule")) - pattern_BackupService_ListScheduledBackups_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "backups", "scheduled"}, "")) - pattern_BackupService_ChangeScheduledBackup_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "backups"}, "changeScheduled")) - pattern_BackupService_RemoveScheduledBackup_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"v1", "backups", "scheduled_backup_id"}, "")) - pattern_BackupService_GetLogs_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3}, []string{"v1", "backups", "artifact_id", "logs"}, "")) - pattern_BackupService_ListArtifacts_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "backups", "artifacts"}, "")) - pattern_BackupService_DeleteArtifact_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "backups", "artifacts", "artifact_id"}, "")) - pattern_BackupService_ListPitrTimeranges_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"v1", "backups", "artifacts", "artifact_id", "pitr-timeranges"}, "")) -) - -var ( - forward_BackupService_StartBackup_0 = runtime.ForwardResponseMessage - forward_BackupService_ListArtifactCompatibleServices_0 = runtime.ForwardResponseMessage - forward_BackupService_ScheduleBackup_0 = runtime.ForwardResponseMessage - forward_BackupService_ListScheduledBackups_0 = runtime.ForwardResponseMessage - forward_BackupService_ChangeScheduledBackup_0 = runtime.ForwardResponseMessage - forward_BackupService_RemoveScheduledBackup_0 = runtime.ForwardResponseMessage - forward_BackupService_GetLogs_0 = runtime.ForwardResponseMessage - forward_BackupService_ListArtifacts_0 = runtime.ForwardResponseMessage - forward_BackupService_DeleteArtifact_0 = runtime.ForwardResponseMessage - forward_BackupService_ListPitrTimeranges_0 = runtime.ForwardResponseMessage -) diff --git a/api/backup/v1/backup.pb.validate.go b/api/backup/v1/backup.pb.validate.go deleted file mode 100644 index 743bd45f688..00000000000 --- a/api/backup/v1/backup.pb.validate.go +++ /dev/null @@ -1,2159 +0,0 @@ -// Code generated by protoc-gen-validate. DO NOT EDIT. -// source: backup/v1/backup.proto - -package backupv1 - -import ( - "bytes" - "errors" - "fmt" - "net" - "net/mail" - "net/url" - "regexp" - "sort" - "strings" - "time" - "unicode/utf8" - - "google.golang.org/protobuf/types/known/anypb" -) - -// ensure the imports are used -var ( - _ = bytes.MinRead - _ = errors.New("") - _ = fmt.Print - _ = utf8.UTFMax - _ = (*regexp.Regexp)(nil) - _ = (*strings.Reader)(nil) - _ = net.IPv4len - _ = time.Duration(0) - _ = (*url.URL)(nil) - _ = (*mail.Address)(nil) - _ = anypb.Any{} - _ = sort.Sort -) - -// Validate checks the field values on StartBackupRequest 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 *StartBackupRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on StartBackupRequest 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 -// StartBackupRequestMultiError, or nil if none found. -func (m *StartBackupRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *StartBackupRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetServiceId()) < 1 { - err := StartBackupRequestValidationError{ - field: "ServiceId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if utf8.RuneCountInString(m.GetLocationId()) < 1 { - err := StartBackupRequestValidationError{ - field: "LocationId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for Name - - // no validation rules for Description - - if all { - switch v := interface{}(m.GetRetryInterval()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, StartBackupRequestValidationError{ - field: "RetryInterval", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, StartBackupRequestValidationError{ - field: "RetryInterval", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetRetryInterval()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return StartBackupRequestValidationError{ - field: "RetryInterval", - reason: "embedded message failed validation", - cause: err, - } - } - } - - // no validation rules for Retries - - // no validation rules for DataModel - - // no validation rules for Folder - - if len(errors) > 0 { - return StartBackupRequestMultiError(errors) - } - - return nil -} - -// StartBackupRequestMultiError is an error wrapping multiple validation errors -// returned by StartBackupRequest.ValidateAll() if the designated constraints -// aren't met. -type StartBackupRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m StartBackupRequestMultiError) 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 StartBackupRequestMultiError) AllErrors() []error { return m } - -// StartBackupRequestValidationError is the validation error returned by -// StartBackupRequest.Validate if the designated constraints aren't met. -type StartBackupRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e StartBackupRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e StartBackupRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e StartBackupRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e StartBackupRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e StartBackupRequestValidationError) ErrorName() string { - return "StartBackupRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e StartBackupRequestValidationError) 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 %sStartBackupRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = StartBackupRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = StartBackupRequestValidationError{} - -// Validate checks the field values on StartBackupResponse 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 *StartBackupResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on StartBackupResponse 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 -// StartBackupResponseMultiError, or nil if none found. -func (m *StartBackupResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *StartBackupResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for ArtifactId - - if len(errors) > 0 { - return StartBackupResponseMultiError(errors) - } - - return nil -} - -// StartBackupResponseMultiError is an error wrapping multiple validation -// errors returned by StartBackupResponse.ValidateAll() if the designated -// constraints aren't met. -type StartBackupResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m StartBackupResponseMultiError) 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 StartBackupResponseMultiError) AllErrors() []error { return m } - -// StartBackupResponseValidationError is the validation error returned by -// StartBackupResponse.Validate if the designated constraints aren't met. -type StartBackupResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e StartBackupResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e StartBackupResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e StartBackupResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e StartBackupResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e StartBackupResponseValidationError) ErrorName() string { - return "StartBackupResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e StartBackupResponseValidationError) 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 %sStartBackupResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = StartBackupResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = StartBackupResponseValidationError{} - -// Validate checks the field values on ListArtifactCompatibleServicesRequest -// 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 *ListArtifactCompatibleServicesRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ListArtifactCompatibleServicesRequest -// 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 -// ListArtifactCompatibleServicesRequestMultiError, or nil if none found. -func (m *ListArtifactCompatibleServicesRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *ListArtifactCompatibleServicesRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetArtifactId()) < 1 { - err := ListArtifactCompatibleServicesRequestValidationError{ - field: "ArtifactId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if len(errors) > 0 { - return ListArtifactCompatibleServicesRequestMultiError(errors) - } - - return nil -} - -// ListArtifactCompatibleServicesRequestMultiError is an error wrapping -// multiple validation errors returned by -// ListArtifactCompatibleServicesRequest.ValidateAll() if the designated -// constraints aren't met. -type ListArtifactCompatibleServicesRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ListArtifactCompatibleServicesRequestMultiError) 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 ListArtifactCompatibleServicesRequestMultiError) AllErrors() []error { return m } - -// ListArtifactCompatibleServicesRequestValidationError is the validation error -// returned by ListArtifactCompatibleServicesRequest.Validate if the -// designated constraints aren't met. -type ListArtifactCompatibleServicesRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ListArtifactCompatibleServicesRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ListArtifactCompatibleServicesRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ListArtifactCompatibleServicesRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ListArtifactCompatibleServicesRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ListArtifactCompatibleServicesRequestValidationError) ErrorName() string { - return "ListArtifactCompatibleServicesRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e ListArtifactCompatibleServicesRequestValidationError) 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 %sListArtifactCompatibleServicesRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ListArtifactCompatibleServicesRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ListArtifactCompatibleServicesRequestValidationError{} - -// Validate checks the field values on ListArtifactCompatibleServicesResponse -// 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 *ListArtifactCompatibleServicesResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on -// ListArtifactCompatibleServicesResponse 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 -// ListArtifactCompatibleServicesResponseMultiError, or nil if none found. -func (m *ListArtifactCompatibleServicesResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *ListArtifactCompatibleServicesResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - for idx, item := range m.GetMysql() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ListArtifactCompatibleServicesResponseValidationError{ - field: fmt.Sprintf("Mysql[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ListArtifactCompatibleServicesResponseValidationError{ - field: fmt.Sprintf("Mysql[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ListArtifactCompatibleServicesResponseValidationError{ - field: fmt.Sprintf("Mysql[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - for idx, item := range m.GetMongodb() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ListArtifactCompatibleServicesResponseValidationError{ - field: fmt.Sprintf("Mongodb[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ListArtifactCompatibleServicesResponseValidationError{ - field: fmt.Sprintf("Mongodb[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ListArtifactCompatibleServicesResponseValidationError{ - field: fmt.Sprintf("Mongodb[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - if len(errors) > 0 { - return ListArtifactCompatibleServicesResponseMultiError(errors) - } - - return nil -} - -// ListArtifactCompatibleServicesResponseMultiError is an error wrapping -// multiple validation errors returned by -// ListArtifactCompatibleServicesResponse.ValidateAll() if the designated -// constraints aren't met. -type ListArtifactCompatibleServicesResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ListArtifactCompatibleServicesResponseMultiError) 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 ListArtifactCompatibleServicesResponseMultiError) AllErrors() []error { return m } - -// ListArtifactCompatibleServicesResponseValidationError is the validation -// error returned by ListArtifactCompatibleServicesResponse.Validate if the -// designated constraints aren't met. -type ListArtifactCompatibleServicesResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ListArtifactCompatibleServicesResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ListArtifactCompatibleServicesResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ListArtifactCompatibleServicesResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ListArtifactCompatibleServicesResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ListArtifactCompatibleServicesResponseValidationError) ErrorName() string { - return "ListArtifactCompatibleServicesResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e ListArtifactCompatibleServicesResponseValidationError) 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 %sListArtifactCompatibleServicesResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ListArtifactCompatibleServicesResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ListArtifactCompatibleServicesResponseValidationError{} - -// Validate checks the field values on ScheduledBackup 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 *ScheduledBackup) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ScheduledBackup 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 -// ScheduledBackupMultiError, or nil if none found. -func (m *ScheduledBackup) ValidateAll() error { - return m.validate(true) -} - -func (m *ScheduledBackup) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for ScheduledBackupId - - // no validation rules for ServiceId - - // no validation rules for ServiceName - - // no validation rules for LocationId - - // no validation rules for LocationName - - // no validation rules for Folder - - // no validation rules for CronExpression - - if all { - switch v := interface{}(m.GetStartTime()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ScheduledBackupValidationError{ - field: "StartTime", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ScheduledBackupValidationError{ - field: "StartTime", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetStartTime()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ScheduledBackupValidationError{ - field: "StartTime", - reason: "embedded message failed validation", - cause: err, - } - } - } - - // no validation rules for Name - - // no validation rules for Description - - // no validation rules for Enabled - - // no validation rules for Retries - - if all { - switch v := interface{}(m.GetRetryInterval()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ScheduledBackupValidationError{ - field: "RetryInterval", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ScheduledBackupValidationError{ - field: "RetryInterval", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetRetryInterval()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ScheduledBackupValidationError{ - field: "RetryInterval", - reason: "embedded message failed validation", - cause: err, - } - } - } - - // no validation rules for DataModel - - // no validation rules for Mode - - // no validation rules for Vendor - - if all { - switch v := interface{}(m.GetLastRun()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ScheduledBackupValidationError{ - field: "LastRun", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ScheduledBackupValidationError{ - field: "LastRun", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetLastRun()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ScheduledBackupValidationError{ - field: "LastRun", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetNextRun()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ScheduledBackupValidationError{ - field: "NextRun", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ScheduledBackupValidationError{ - field: "NextRun", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetNextRun()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ScheduledBackupValidationError{ - field: "NextRun", - reason: "embedded message failed validation", - cause: err, - } - } - } - - // no validation rules for Retention - - if len(errors) > 0 { - return ScheduledBackupMultiError(errors) - } - - return nil -} - -// ScheduledBackupMultiError is an error wrapping multiple validation errors -// returned by ScheduledBackup.ValidateAll() if the designated constraints -// aren't met. -type ScheduledBackupMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ScheduledBackupMultiError) 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 ScheduledBackupMultiError) AllErrors() []error { return m } - -// ScheduledBackupValidationError is the validation error returned by -// ScheduledBackup.Validate if the designated constraints aren't met. -type ScheduledBackupValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ScheduledBackupValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ScheduledBackupValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ScheduledBackupValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ScheduledBackupValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ScheduledBackupValidationError) ErrorName() string { return "ScheduledBackupValidationError" } - -// Error satisfies the builtin error interface -func (e ScheduledBackupValidationError) 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 %sScheduledBackup.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ScheduledBackupValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ScheduledBackupValidationError{} - -// Validate checks the field values on ScheduleBackupRequest 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 *ScheduleBackupRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ScheduleBackupRequest 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 -// ScheduleBackupRequestMultiError, or nil if none found. -func (m *ScheduleBackupRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *ScheduleBackupRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetServiceId()) < 1 { - err := ScheduleBackupRequestValidationError{ - field: "ServiceId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if utf8.RuneCountInString(m.GetLocationId()) < 1 { - err := ScheduleBackupRequestValidationError{ - field: "LocationId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for Folder - - if utf8.RuneCountInString(m.GetCronExpression()) < 1 { - err := ScheduleBackupRequestValidationError{ - field: "CronExpression", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetStartTime()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ScheduleBackupRequestValidationError{ - field: "StartTime", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ScheduleBackupRequestValidationError{ - field: "StartTime", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetStartTime()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ScheduleBackupRequestValidationError{ - field: "StartTime", - reason: "embedded message failed validation", - cause: err, - } - } - } - - // no validation rules for Name - - // no validation rules for Description - - // no validation rules for Enabled - - // no validation rules for Retries - - if all { - switch v := interface{}(m.GetRetryInterval()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ScheduleBackupRequestValidationError{ - field: "RetryInterval", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ScheduleBackupRequestValidationError{ - field: "RetryInterval", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetRetryInterval()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ScheduleBackupRequestValidationError{ - field: "RetryInterval", - reason: "embedded message failed validation", - cause: err, - } - } - } - - // no validation rules for Mode - - // no validation rules for DataModel - - // no validation rules for Retention - - if len(errors) > 0 { - return ScheduleBackupRequestMultiError(errors) - } - - return nil -} - -// ScheduleBackupRequestMultiError is an error wrapping multiple validation -// errors returned by ScheduleBackupRequest.ValidateAll() if the designated -// constraints aren't met. -type ScheduleBackupRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ScheduleBackupRequestMultiError) 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 ScheduleBackupRequestMultiError) AllErrors() []error { return m } - -// ScheduleBackupRequestValidationError is the validation error returned by -// ScheduleBackupRequest.Validate if the designated constraints aren't met. -type ScheduleBackupRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ScheduleBackupRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ScheduleBackupRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ScheduleBackupRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ScheduleBackupRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ScheduleBackupRequestValidationError) ErrorName() string { - return "ScheduleBackupRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e ScheduleBackupRequestValidationError) 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 %sScheduleBackupRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ScheduleBackupRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ScheduleBackupRequestValidationError{} - -// Validate checks the field values on ScheduleBackupResponse 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 *ScheduleBackupResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ScheduleBackupResponse 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 -// ScheduleBackupResponseMultiError, or nil if none found. -func (m *ScheduleBackupResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *ScheduleBackupResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for ScheduledBackupId - - if len(errors) > 0 { - return ScheduleBackupResponseMultiError(errors) - } - - return nil -} - -// ScheduleBackupResponseMultiError is an error wrapping multiple validation -// errors returned by ScheduleBackupResponse.ValidateAll() if the designated -// constraints aren't met. -type ScheduleBackupResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ScheduleBackupResponseMultiError) 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 ScheduleBackupResponseMultiError) AllErrors() []error { return m } - -// ScheduleBackupResponseValidationError is the validation error returned by -// ScheduleBackupResponse.Validate if the designated constraints aren't met. -type ScheduleBackupResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ScheduleBackupResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ScheduleBackupResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ScheduleBackupResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ScheduleBackupResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ScheduleBackupResponseValidationError) ErrorName() string { - return "ScheduleBackupResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e ScheduleBackupResponseValidationError) 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 %sScheduleBackupResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ScheduleBackupResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ScheduleBackupResponseValidationError{} - -// Validate checks the field values on ListScheduledBackupsRequest 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 *ListScheduledBackupsRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ListScheduledBackupsRequest 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 -// ListScheduledBackupsRequestMultiError, or nil if none found. -func (m *ListScheduledBackupsRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *ListScheduledBackupsRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return ListScheduledBackupsRequestMultiError(errors) - } - - return nil -} - -// ListScheduledBackupsRequestMultiError is an error wrapping multiple -// validation errors returned by ListScheduledBackupsRequest.ValidateAll() if -// the designated constraints aren't met. -type ListScheduledBackupsRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ListScheduledBackupsRequestMultiError) 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 ListScheduledBackupsRequestMultiError) AllErrors() []error { return m } - -// ListScheduledBackupsRequestValidationError is the validation error returned -// by ListScheduledBackupsRequest.Validate if the designated constraints -// aren't met. -type ListScheduledBackupsRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ListScheduledBackupsRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ListScheduledBackupsRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ListScheduledBackupsRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ListScheduledBackupsRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ListScheduledBackupsRequestValidationError) ErrorName() string { - return "ListScheduledBackupsRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e ListScheduledBackupsRequestValidationError) 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 %sListScheduledBackupsRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ListScheduledBackupsRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ListScheduledBackupsRequestValidationError{} - -// Validate checks the field values on ListScheduledBackupsResponse 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 *ListScheduledBackupsResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ListScheduledBackupsResponse 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 -// ListScheduledBackupsResponseMultiError, or nil if none found. -func (m *ListScheduledBackupsResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *ListScheduledBackupsResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - for idx, item := range m.GetScheduledBackups() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ListScheduledBackupsResponseValidationError{ - field: fmt.Sprintf("ScheduledBackups[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ListScheduledBackupsResponseValidationError{ - field: fmt.Sprintf("ScheduledBackups[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ListScheduledBackupsResponseValidationError{ - field: fmt.Sprintf("ScheduledBackups[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - if len(errors) > 0 { - return ListScheduledBackupsResponseMultiError(errors) - } - - return nil -} - -// ListScheduledBackupsResponseMultiError is an error wrapping multiple -// validation errors returned by ListScheduledBackupsResponse.ValidateAll() if -// the designated constraints aren't met. -type ListScheduledBackupsResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ListScheduledBackupsResponseMultiError) 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 ListScheduledBackupsResponseMultiError) AllErrors() []error { return m } - -// ListScheduledBackupsResponseValidationError is the validation error returned -// by ListScheduledBackupsResponse.Validate if the designated constraints -// aren't met. -type ListScheduledBackupsResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ListScheduledBackupsResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ListScheduledBackupsResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ListScheduledBackupsResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ListScheduledBackupsResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ListScheduledBackupsResponseValidationError) ErrorName() string { - return "ListScheduledBackupsResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e ListScheduledBackupsResponseValidationError) 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 %sListScheduledBackupsResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ListScheduledBackupsResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ListScheduledBackupsResponseValidationError{} - -// Validate checks the field values on ChangeScheduledBackupRequest 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 *ChangeScheduledBackupRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ChangeScheduledBackupRequest 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 -// ChangeScheduledBackupRequestMultiError, or nil if none found. -func (m *ChangeScheduledBackupRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *ChangeScheduledBackupRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetScheduledBackupId()) < 1 { - err := ChangeScheduledBackupRequestValidationError{ - field: "ScheduledBackupId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetStartTime()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeScheduledBackupRequestValidationError{ - field: "StartTime", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeScheduledBackupRequestValidationError{ - field: "StartTime", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetStartTime()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeScheduledBackupRequestValidationError{ - field: "StartTime", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetRetryInterval()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeScheduledBackupRequestValidationError{ - field: "RetryInterval", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeScheduledBackupRequestValidationError{ - field: "RetryInterval", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetRetryInterval()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeScheduledBackupRequestValidationError{ - field: "RetryInterval", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if m.Enabled != nil { - // no validation rules for Enabled - } - - if m.CronExpression != nil { - // no validation rules for CronExpression - } - - if m.Name != nil { - // no validation rules for Name - } - - if m.Description != nil { - // no validation rules for Description - } - - if m.Retries != nil { - // no validation rules for Retries - } - - if m.Retention != nil { - // no validation rules for Retention - } - - if len(errors) > 0 { - return ChangeScheduledBackupRequestMultiError(errors) - } - - return nil -} - -// ChangeScheduledBackupRequestMultiError is an error wrapping multiple -// validation errors returned by ChangeScheduledBackupRequest.ValidateAll() if -// the designated constraints aren't met. -type ChangeScheduledBackupRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ChangeScheduledBackupRequestMultiError) 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 ChangeScheduledBackupRequestMultiError) AllErrors() []error { return m } - -// ChangeScheduledBackupRequestValidationError is the validation error returned -// by ChangeScheduledBackupRequest.Validate if the designated constraints -// aren't met. -type ChangeScheduledBackupRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ChangeScheduledBackupRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ChangeScheduledBackupRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ChangeScheduledBackupRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ChangeScheduledBackupRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ChangeScheduledBackupRequestValidationError) ErrorName() string { - return "ChangeScheduledBackupRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e ChangeScheduledBackupRequestValidationError) 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 %sChangeScheduledBackupRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ChangeScheduledBackupRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ChangeScheduledBackupRequestValidationError{} - -// Validate checks the field values on ChangeScheduledBackupResponse 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 *ChangeScheduledBackupResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ChangeScheduledBackupResponse 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 -// ChangeScheduledBackupResponseMultiError, or nil if none found. -func (m *ChangeScheduledBackupResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *ChangeScheduledBackupResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return ChangeScheduledBackupResponseMultiError(errors) - } - - return nil -} - -// ChangeScheduledBackupResponseMultiError is an error wrapping multiple -// validation errors returned by ChangeScheduledBackupResponse.ValidateAll() -// if the designated constraints aren't met. -type ChangeScheduledBackupResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ChangeScheduledBackupResponseMultiError) 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 ChangeScheduledBackupResponseMultiError) AllErrors() []error { return m } - -// ChangeScheduledBackupResponseValidationError is the validation error -// returned by ChangeScheduledBackupResponse.Validate if the designated -// constraints aren't met. -type ChangeScheduledBackupResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ChangeScheduledBackupResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ChangeScheduledBackupResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ChangeScheduledBackupResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ChangeScheduledBackupResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ChangeScheduledBackupResponseValidationError) ErrorName() string { - return "ChangeScheduledBackupResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e ChangeScheduledBackupResponseValidationError) 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 %sChangeScheduledBackupResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ChangeScheduledBackupResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ChangeScheduledBackupResponseValidationError{} - -// Validate checks the field values on RemoveScheduledBackupRequest 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 *RemoveScheduledBackupRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on RemoveScheduledBackupRequest 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 -// RemoveScheduledBackupRequestMultiError, or nil if none found. -func (m *RemoveScheduledBackupRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *RemoveScheduledBackupRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetScheduledBackupId()) < 1 { - err := RemoveScheduledBackupRequestValidationError{ - field: "ScheduledBackupId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if len(errors) > 0 { - return RemoveScheduledBackupRequestMultiError(errors) - } - - return nil -} - -// RemoveScheduledBackupRequestMultiError is an error wrapping multiple -// validation errors returned by RemoveScheduledBackupRequest.ValidateAll() if -// the designated constraints aren't met. -type RemoveScheduledBackupRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m RemoveScheduledBackupRequestMultiError) 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 RemoveScheduledBackupRequestMultiError) AllErrors() []error { return m } - -// RemoveScheduledBackupRequestValidationError is the validation error returned -// by RemoveScheduledBackupRequest.Validate if the designated constraints -// aren't met. -type RemoveScheduledBackupRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e RemoveScheduledBackupRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e RemoveScheduledBackupRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e RemoveScheduledBackupRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e RemoveScheduledBackupRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e RemoveScheduledBackupRequestValidationError) ErrorName() string { - return "RemoveScheduledBackupRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e RemoveScheduledBackupRequestValidationError) 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 %sRemoveScheduledBackupRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = RemoveScheduledBackupRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = RemoveScheduledBackupRequestValidationError{} - -// Validate checks the field values on RemoveScheduledBackupResponse 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 *RemoveScheduledBackupResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on RemoveScheduledBackupResponse 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 -// RemoveScheduledBackupResponseMultiError, or nil if none found. -func (m *RemoveScheduledBackupResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *RemoveScheduledBackupResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return RemoveScheduledBackupResponseMultiError(errors) - } - - return nil -} - -// RemoveScheduledBackupResponseMultiError is an error wrapping multiple -// validation errors returned by RemoveScheduledBackupResponse.ValidateAll() -// if the designated constraints aren't met. -type RemoveScheduledBackupResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m RemoveScheduledBackupResponseMultiError) 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 RemoveScheduledBackupResponseMultiError) AllErrors() []error { return m } - -// RemoveScheduledBackupResponseValidationError is the validation error -// returned by RemoveScheduledBackupResponse.Validate if the designated -// constraints aren't met. -type RemoveScheduledBackupResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e RemoveScheduledBackupResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e RemoveScheduledBackupResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e RemoveScheduledBackupResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e RemoveScheduledBackupResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e RemoveScheduledBackupResponseValidationError) ErrorName() string { - return "RemoveScheduledBackupResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e RemoveScheduledBackupResponseValidationError) 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 %sRemoveScheduledBackupResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = RemoveScheduledBackupResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = RemoveScheduledBackupResponseValidationError{} - -// Validate checks the field values on GetLogsRequest 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 *GetLogsRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on GetLogsRequest 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 GetLogsRequestMultiError, -// or nil if none found. -func (m *GetLogsRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *GetLogsRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetArtifactId()) < 1 { - err := GetLogsRequestValidationError{ - field: "ArtifactId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for Offset - - // no validation rules for Limit - - if len(errors) > 0 { - return GetLogsRequestMultiError(errors) - } - - return nil -} - -// GetLogsRequestMultiError is an error wrapping multiple validation errors -// returned by GetLogsRequest.ValidateAll() if the designated constraints -// aren't met. -type GetLogsRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m GetLogsRequestMultiError) 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 GetLogsRequestMultiError) AllErrors() []error { return m } - -// GetLogsRequestValidationError is the validation error returned by -// GetLogsRequest.Validate if the designated constraints aren't met. -type GetLogsRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e GetLogsRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e GetLogsRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e GetLogsRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e GetLogsRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e GetLogsRequestValidationError) ErrorName() string { return "GetLogsRequestValidationError" } - -// Error satisfies the builtin error interface -func (e GetLogsRequestValidationError) 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 %sGetLogsRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = GetLogsRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = GetLogsRequestValidationError{} - -// Validate checks the field values on GetLogsResponse 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 *GetLogsResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on GetLogsResponse 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 -// GetLogsResponseMultiError, or nil if none found. -func (m *GetLogsResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *GetLogsResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - for idx, item := range m.GetLogs() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GetLogsResponseValidationError{ - field: fmt.Sprintf("Logs[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GetLogsResponseValidationError{ - field: fmt.Sprintf("Logs[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GetLogsResponseValidationError{ - field: fmt.Sprintf("Logs[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - // no validation rules for End - - if len(errors) > 0 { - return GetLogsResponseMultiError(errors) - } - - return nil -} - -// GetLogsResponseMultiError is an error wrapping multiple validation errors -// returned by GetLogsResponse.ValidateAll() if the designated constraints -// aren't met. -type GetLogsResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m GetLogsResponseMultiError) 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 GetLogsResponseMultiError) AllErrors() []error { return m } - -// GetLogsResponseValidationError is the validation error returned by -// GetLogsResponse.Validate if the designated constraints aren't met. -type GetLogsResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e GetLogsResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e GetLogsResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e GetLogsResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e GetLogsResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e GetLogsResponseValidationError) ErrorName() string { return "GetLogsResponseValidationError" } - -// Error satisfies the builtin error interface -func (e GetLogsResponseValidationError) 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 %sGetLogsResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = GetLogsResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = GetLogsResponseValidationError{} diff --git a/api/backup/v1/backup_grpc.pb.go b/api/backup/v1/backup_grpc.pb.go deleted file mode 100644 index 2f28a3ab987..00000000000 --- a/api/backup/v1/backup_grpc.pb.go +++ /dev/null @@ -1,497 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.6.0 -// - protoc (unknown) -// source: backup/v1/backup.proto - -package backupv1 - -import ( - context "context" - - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.64.0 or later. -const _ = grpc.SupportPackageIsVersion9 - -const ( - BackupService_StartBackup_FullMethodName = "/backup.v1.BackupService/StartBackup" - BackupService_ListArtifactCompatibleServices_FullMethodName = "/backup.v1.BackupService/ListArtifactCompatibleServices" - BackupService_ScheduleBackup_FullMethodName = "/backup.v1.BackupService/ScheduleBackup" - BackupService_ListScheduledBackups_FullMethodName = "/backup.v1.BackupService/ListScheduledBackups" - BackupService_ChangeScheduledBackup_FullMethodName = "/backup.v1.BackupService/ChangeScheduledBackup" - BackupService_RemoveScheduledBackup_FullMethodName = "/backup.v1.BackupService/RemoveScheduledBackup" - BackupService_GetLogs_FullMethodName = "/backup.v1.BackupService/GetLogs" - BackupService_ListArtifacts_FullMethodName = "/backup.v1.BackupService/ListArtifacts" - BackupService_DeleteArtifact_FullMethodName = "/backup.v1.BackupService/DeleteArtifact" - BackupService_ListPitrTimeranges_FullMethodName = "/backup.v1.BackupService/ListPitrTimeranges" -) - -// BackupServiceClient is the client API for BackupService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -// -// Backups service handles backup operations to DB. -type BackupServiceClient interface { - // StartBackup request backup specified service to location. - StartBackup(ctx context.Context, in *StartBackupRequest, opts ...grpc.CallOption) (*StartBackupResponse, error) - // ListArtifactCompatibleServices lists compatible services for restoring a backup. - ListArtifactCompatibleServices(ctx context.Context, in *ListArtifactCompatibleServicesRequest, opts ...grpc.CallOption) (*ListArtifactCompatibleServicesResponse, error) - // ScheduleBackup schedules repeated backup. - ScheduleBackup(ctx context.Context, in *ScheduleBackupRequest, opts ...grpc.CallOption) (*ScheduleBackupResponse, error) - // ListScheduledBackups returns all scheduled backups. - ListScheduledBackups(ctx context.Context, in *ListScheduledBackupsRequest, opts ...grpc.CallOption) (*ListScheduledBackupsResponse, error) - // ChangeScheduledBackup changes existing scheduled backup. - ChangeScheduledBackup(ctx context.Context, in *ChangeScheduledBackupRequest, opts ...grpc.CallOption) (*ChangeScheduledBackupResponse, error) - // RemoveScheduledBackup removes existing scheduled backup. - RemoveScheduledBackup(ctx context.Context, in *RemoveScheduledBackupRequest, opts ...grpc.CallOption) (*RemoveScheduledBackupResponse, error) - // GetLogs returns logs from the underlying tools for a backup/restore job. - GetLogs(ctx context.Context, in *GetLogsRequest, opts ...grpc.CallOption) (*GetLogsResponse, error) - // ListArtifacts returns a list of all backup artifacts. - ListArtifacts(ctx context.Context, in *ListArtifactsRequest, opts ...grpc.CallOption) (*ListArtifactsResponse, error) - // DeleteArtifact deletes specified artifact. - DeleteArtifact(ctx context.Context, in *DeleteArtifactRequest, opts ...grpc.CallOption) (*DeleteArtifactResponse, error) - // ListPitrTimeranges list the available MongoDB PITR timeranges in a given backup location - ListPitrTimeranges(ctx context.Context, in *ListPitrTimerangesRequest, opts ...grpc.CallOption) (*ListPitrTimerangesResponse, error) -} - -type backupServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewBackupServiceClient(cc grpc.ClientConnInterface) BackupServiceClient { - return &backupServiceClient{cc} -} - -func (c *backupServiceClient) StartBackup(ctx context.Context, in *StartBackupRequest, opts ...grpc.CallOption) (*StartBackupResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(StartBackupResponse) - err := c.cc.Invoke(ctx, BackupService_StartBackup_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *backupServiceClient) ListArtifactCompatibleServices(ctx context.Context, in *ListArtifactCompatibleServicesRequest, opts ...grpc.CallOption) (*ListArtifactCompatibleServicesResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(ListArtifactCompatibleServicesResponse) - err := c.cc.Invoke(ctx, BackupService_ListArtifactCompatibleServices_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *backupServiceClient) ScheduleBackup(ctx context.Context, in *ScheduleBackupRequest, opts ...grpc.CallOption) (*ScheduleBackupResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(ScheduleBackupResponse) - err := c.cc.Invoke(ctx, BackupService_ScheduleBackup_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *backupServiceClient) ListScheduledBackups(ctx context.Context, in *ListScheduledBackupsRequest, opts ...grpc.CallOption) (*ListScheduledBackupsResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(ListScheduledBackupsResponse) - err := c.cc.Invoke(ctx, BackupService_ListScheduledBackups_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *backupServiceClient) ChangeScheduledBackup(ctx context.Context, in *ChangeScheduledBackupRequest, opts ...grpc.CallOption) (*ChangeScheduledBackupResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(ChangeScheduledBackupResponse) - err := c.cc.Invoke(ctx, BackupService_ChangeScheduledBackup_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *backupServiceClient) RemoveScheduledBackup(ctx context.Context, in *RemoveScheduledBackupRequest, opts ...grpc.CallOption) (*RemoveScheduledBackupResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(RemoveScheduledBackupResponse) - err := c.cc.Invoke(ctx, BackupService_RemoveScheduledBackup_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *backupServiceClient) GetLogs(ctx context.Context, in *GetLogsRequest, opts ...grpc.CallOption) (*GetLogsResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetLogsResponse) - err := c.cc.Invoke(ctx, BackupService_GetLogs_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *backupServiceClient) ListArtifacts(ctx context.Context, in *ListArtifactsRequest, opts ...grpc.CallOption) (*ListArtifactsResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(ListArtifactsResponse) - err := c.cc.Invoke(ctx, BackupService_ListArtifacts_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *backupServiceClient) DeleteArtifact(ctx context.Context, in *DeleteArtifactRequest, opts ...grpc.CallOption) (*DeleteArtifactResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(DeleteArtifactResponse) - err := c.cc.Invoke(ctx, BackupService_DeleteArtifact_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *backupServiceClient) ListPitrTimeranges(ctx context.Context, in *ListPitrTimerangesRequest, opts ...grpc.CallOption) (*ListPitrTimerangesResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(ListPitrTimerangesResponse) - err := c.cc.Invoke(ctx, BackupService_ListPitrTimeranges_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -// BackupServiceServer is the server API for BackupService service. -// All implementations must embed UnimplementedBackupServiceServer -// for forward compatibility. -// -// Backups service handles backup operations to DB. -type BackupServiceServer interface { - // StartBackup request backup specified service to location. - StartBackup(context.Context, *StartBackupRequest) (*StartBackupResponse, error) - // ListArtifactCompatibleServices lists compatible services for restoring a backup. - ListArtifactCompatibleServices(context.Context, *ListArtifactCompatibleServicesRequest) (*ListArtifactCompatibleServicesResponse, error) - // ScheduleBackup schedules repeated backup. - ScheduleBackup(context.Context, *ScheduleBackupRequest) (*ScheduleBackupResponse, error) - // ListScheduledBackups returns all scheduled backups. - ListScheduledBackups(context.Context, *ListScheduledBackupsRequest) (*ListScheduledBackupsResponse, error) - // ChangeScheduledBackup changes existing scheduled backup. - ChangeScheduledBackup(context.Context, *ChangeScheduledBackupRequest) (*ChangeScheduledBackupResponse, error) - // RemoveScheduledBackup removes existing scheduled backup. - RemoveScheduledBackup(context.Context, *RemoveScheduledBackupRequest) (*RemoveScheduledBackupResponse, error) - // GetLogs returns logs from the underlying tools for a backup/restore job. - GetLogs(context.Context, *GetLogsRequest) (*GetLogsResponse, error) - // ListArtifacts returns a list of all backup artifacts. - ListArtifacts(context.Context, *ListArtifactsRequest) (*ListArtifactsResponse, error) - // DeleteArtifact deletes specified artifact. - DeleteArtifact(context.Context, *DeleteArtifactRequest) (*DeleteArtifactResponse, error) - // ListPitrTimeranges list the available MongoDB PITR timeranges in a given backup location - ListPitrTimeranges(context.Context, *ListPitrTimerangesRequest) (*ListPitrTimerangesResponse, error) - mustEmbedUnimplementedBackupServiceServer() -} - -// UnimplementedBackupServiceServer must be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -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") -} -func (UnimplementedBackupServiceServer) mustEmbedUnimplementedBackupServiceServer() {} -func (UnimplementedBackupServiceServer) testEmbeddedByValue() {} - -// UnsafeBackupServiceServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to BackupServiceServer will -// result in compilation errors. -type UnsafeBackupServiceServer interface { - mustEmbedUnimplementedBackupServiceServer() -} - -func RegisterBackupServiceServer(s grpc.ServiceRegistrar, srv BackupServiceServer) { - // If the following call panics, it indicates UnimplementedBackupServiceServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } - s.RegisterService(&BackupService_ServiceDesc, srv) -} - -func _BackupService_StartBackup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(StartBackupRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(BackupServiceServer).StartBackup(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: BackupService_StartBackup_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BackupServiceServer).StartBackup(ctx, req.(*StartBackupRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _BackupService_ListArtifactCompatibleServices_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListArtifactCompatibleServicesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(BackupServiceServer).ListArtifactCompatibleServices(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: BackupService_ListArtifactCompatibleServices_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BackupServiceServer).ListArtifactCompatibleServices(ctx, req.(*ListArtifactCompatibleServicesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _BackupService_ScheduleBackup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ScheduleBackupRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(BackupServiceServer).ScheduleBackup(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: BackupService_ScheduleBackup_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BackupServiceServer).ScheduleBackup(ctx, req.(*ScheduleBackupRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _BackupService_ListScheduledBackups_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListScheduledBackupsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(BackupServiceServer).ListScheduledBackups(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: BackupService_ListScheduledBackups_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BackupServiceServer).ListScheduledBackups(ctx, req.(*ListScheduledBackupsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _BackupService_ChangeScheduledBackup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ChangeScheduledBackupRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(BackupServiceServer).ChangeScheduledBackup(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: BackupService_ChangeScheduledBackup_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BackupServiceServer).ChangeScheduledBackup(ctx, req.(*ChangeScheduledBackupRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _BackupService_RemoveScheduledBackup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RemoveScheduledBackupRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(BackupServiceServer).RemoveScheduledBackup(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: BackupService_RemoveScheduledBackup_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BackupServiceServer).RemoveScheduledBackup(ctx, req.(*RemoveScheduledBackupRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _BackupService_GetLogs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetLogsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(BackupServiceServer).GetLogs(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: BackupService_GetLogs_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BackupServiceServer).GetLogs(ctx, req.(*GetLogsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _BackupService_ListArtifacts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListArtifactsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(BackupServiceServer).ListArtifacts(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: BackupService_ListArtifacts_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BackupServiceServer).ListArtifacts(ctx, req.(*ListArtifactsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _BackupService_DeleteArtifact_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteArtifactRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(BackupServiceServer).DeleteArtifact(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: BackupService_DeleteArtifact_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BackupServiceServer).DeleteArtifact(ctx, req.(*DeleteArtifactRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _BackupService_ListPitrTimeranges_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListPitrTimerangesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(BackupServiceServer).ListPitrTimeranges(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: BackupService_ListPitrTimeranges_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BackupServiceServer).ListPitrTimeranges(ctx, req.(*ListPitrTimerangesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// BackupService_ServiceDesc is the grpc.ServiceDesc for BackupService service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var BackupService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "backup.v1.BackupService", - HandlerType: (*BackupServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "StartBackup", - Handler: _BackupService_StartBackup_Handler, - }, - { - MethodName: "ListArtifactCompatibleServices", - Handler: _BackupService_ListArtifactCompatibleServices_Handler, - }, - { - MethodName: "ScheduleBackup", - Handler: _BackupService_ScheduleBackup_Handler, - }, - { - MethodName: "ListScheduledBackups", - Handler: _BackupService_ListScheduledBackups_Handler, - }, - { - MethodName: "ChangeScheduledBackup", - Handler: _BackupService_ChangeScheduledBackup_Handler, - }, - { - MethodName: "RemoveScheduledBackup", - Handler: _BackupService_RemoveScheduledBackup_Handler, - }, - { - MethodName: "GetLogs", - Handler: _BackupService_GetLogs_Handler, - }, - { - MethodName: "ListArtifacts", - Handler: _BackupService_ListArtifacts_Handler, - }, - { - MethodName: "DeleteArtifact", - Handler: _BackupService_DeleteArtifact_Handler, - }, - { - MethodName: "ListPitrTimeranges", - Handler: _BackupService_ListPitrTimeranges_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "backup/v1/backup.proto", -} diff --git a/api/backup/v1/common.pb.go b/api/backup/v1/common.pb.go deleted file mode 100644 index de41c31ac70..00000000000 --- a/api/backup/v1/common.pb.go +++ /dev/null @@ -1,464 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.10 -// protoc (unknown) -// source: backup/v1/common.proto - -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" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// DataModel is a model used for performing a backup. -type DataModel int32 - -const ( - DataModel_DATA_MODEL_UNSPECIFIED DataModel = 0 - DataModel_DATA_MODEL_PHYSICAL DataModel = 1 - DataModel_DATA_MODEL_LOGICAL DataModel = 2 -) - -// Enum value maps for DataModel. -var ( - DataModel_name = map[int32]string{ - 0: "DATA_MODEL_UNSPECIFIED", - 1: "DATA_MODEL_PHYSICAL", - 2: "DATA_MODEL_LOGICAL", - } - DataModel_value = map[string]int32{ - "DATA_MODEL_UNSPECIFIED": 0, - "DATA_MODEL_PHYSICAL": 1, - "DATA_MODEL_LOGICAL": 2, - } -) - -func (x DataModel) Enum() *DataModel { - p := new(DataModel) - *p = x - return p -} - -func (x DataModel) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (DataModel) Descriptor() protoreflect.EnumDescriptor { - return file_backup_v1_common_proto_enumTypes[0].Descriptor() -} - -func (DataModel) Type() protoreflect.EnumType { - return &file_backup_v1_common_proto_enumTypes[0] -} - -func (x DataModel) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use DataModel.Descriptor instead. -func (DataModel) EnumDescriptor() ([]byte, []int) { - return file_backup_v1_common_proto_rawDescGZIP(), []int{0} -} - -// BackupMode specifies backup mode. -type BackupMode int32 - -const ( - BackupMode_BACKUP_MODE_UNSPECIFIED BackupMode = 0 - BackupMode_BACKUP_MODE_SNAPSHOT BackupMode = 1 - BackupMode_BACKUP_MODE_INCREMENTAL BackupMode = 2 - BackupMode_BACKUP_MODE_PITR BackupMode = 3 -) - -// Enum value maps for BackupMode. -var ( - BackupMode_name = map[int32]string{ - 0: "BACKUP_MODE_UNSPECIFIED", - 1: "BACKUP_MODE_SNAPSHOT", - 2: "BACKUP_MODE_INCREMENTAL", - 3: "BACKUP_MODE_PITR", - } - BackupMode_value = map[string]int32{ - "BACKUP_MODE_UNSPECIFIED": 0, - "BACKUP_MODE_SNAPSHOT": 1, - "BACKUP_MODE_INCREMENTAL": 2, - "BACKUP_MODE_PITR": 3, - } -) - -func (x BackupMode) Enum() *BackupMode { - p := new(BackupMode) - *p = x - return p -} - -func (x BackupMode) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (BackupMode) Descriptor() protoreflect.EnumDescriptor { - return file_backup_v1_common_proto_enumTypes[1].Descriptor() -} - -func (BackupMode) Type() protoreflect.EnumType { - return &file_backup_v1_common_proto_enumTypes[1] -} - -func (x BackupMode) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use BackupMode.Descriptor instead. -func (BackupMode) EnumDescriptor() ([]byte, []int) { - return file_backup_v1_common_proto_rawDescGZIP(), []int{1} -} - -// File represents file or folder on a storage. -type File struct { - state protoimpl.MessageState `protogen:"open.v1"` - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - IsDirectory bool `protobuf:"varint,2,opt,name=is_directory,json=isDirectory,proto3" json:"is_directory,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *File) Reset() { - *x = File{} - mi := &file_backup_v1_common_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *File) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*File) ProtoMessage() {} - -func (x *File) ProtoReflect() protoreflect.Message { - mi := &file_backup_v1_common_proto_msgTypes[0] - 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 File.ProtoReflect.Descriptor instead. -func (*File) Descriptor() ([]byte, []int) { - return file_backup_v1_common_proto_rawDescGZIP(), []int{0} -} - -func (x *File) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *File) GetIsDirectory() bool { - if x != nil { - return x.IsDirectory - } - return false -} - -// PbmMetadata contains additional data for pbm cli tools. -type PbmMetadata struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Name of backup in backup tool representation. - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *PbmMetadata) Reset() { - *x = PbmMetadata{} - mi := &file_backup_v1_common_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *PbmMetadata) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PbmMetadata) ProtoMessage() {} - -func (x *PbmMetadata) ProtoReflect() protoreflect.Message { - mi := &file_backup_v1_common_proto_msgTypes[1] - 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 PbmMetadata.ProtoReflect.Descriptor instead. -func (*PbmMetadata) Descriptor() ([]byte, []int) { - return file_backup_v1_common_proto_rawDescGZIP(), []int{1} -} - -func (x *PbmMetadata) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -// Metadata contains extra artifact data like files it consists of, tool specific data, etc. -type Metadata struct { - state protoimpl.MessageState `protogen:"open.v1"` - // List of files backup consists of. - FileList []*File `protobuf:"bytes,1,rep,name=file_list,json=fileList,proto3" json:"file_list,omitempty"` - // Exact time DB can be restored to. - RestoreTo *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=restore_to,json=restoreTo,proto3" json:"restore_to,omitempty"` - // Extra data for backup tools. - // - // Types that are valid to be assigned to BackupToolMetadata: - // - // *Metadata_PbmMetadata - BackupToolMetadata isMetadata_BackupToolMetadata `protobuf_oneof:"backup_tool_metadata"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Metadata) Reset() { - *x = Metadata{} - mi := &file_backup_v1_common_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Metadata) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Metadata) ProtoMessage() {} - -func (x *Metadata) ProtoReflect() protoreflect.Message { - mi := &file_backup_v1_common_proto_msgTypes[2] - 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 Metadata.ProtoReflect.Descriptor instead. -func (*Metadata) Descriptor() ([]byte, []int) { - return file_backup_v1_common_proto_rawDescGZIP(), []int{2} -} - -func (x *Metadata) GetFileList() []*File { - if x != nil { - return x.FileList - } - return nil -} - -func (x *Metadata) GetRestoreTo() *timestamppb.Timestamp { - if x != nil { - return x.RestoreTo - } - return nil -} - -func (x *Metadata) GetBackupToolMetadata() isMetadata_BackupToolMetadata { - if x != nil { - return x.BackupToolMetadata - } - return nil -} - -func (x *Metadata) GetPbmMetadata() *PbmMetadata { - if x != nil { - if x, ok := x.BackupToolMetadata.(*Metadata_PbmMetadata); ok { - return x.PbmMetadata - } - } - return nil -} - -type isMetadata_BackupToolMetadata interface { - isMetadata_BackupToolMetadata() -} - -type Metadata_PbmMetadata struct { - PbmMetadata *PbmMetadata `protobuf:"bytes,3,opt,name=pbm_metadata,json=pbmMetadata,proto3,oneof"` -} - -func (*Metadata_PbmMetadata) isMetadata_BackupToolMetadata() {} - -// LogChunk represent one chunk of logs. -type LogChunk struct { - state protoimpl.MessageState `protogen:"open.v1"` - ChunkId uint32 `protobuf:"varint,1,opt,name=chunk_id,json=chunkId,proto3" json:"chunk_id,omitempty"` - Data string `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *LogChunk) Reset() { - *x = LogChunk{} - mi := &file_backup_v1_common_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *LogChunk) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*LogChunk) ProtoMessage() {} - -func (x *LogChunk) ProtoReflect() protoreflect.Message { - mi := &file_backup_v1_common_proto_msgTypes[3] - 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 LogChunk.ProtoReflect.Descriptor instead. -func (*LogChunk) Descriptor() ([]byte, []int) { - return file_backup_v1_common_proto_rawDescGZIP(), []int{3} -} - -func (x *LogChunk) GetChunkId() uint32 { - if x != nil { - return x.ChunkId - } - return 0 -} - -func (x *LogChunk) GetData() string { - if x != nil { - return x.Data - } - return "" -} - -var File_backup_v1_common_proto protoreflect.FileDescriptor - -const file_backup_v1_common_proto_rawDesc = "" + - "\n" + - "\x16backup/v1/common.proto\x12\tbackup.v1\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17validate/validate.proto\"F\n" + - "\x04File\x12\x1b\n" + - "\x04name\x18\x01 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\x04name\x12!\n" + - "\fis_directory\x18\x02 \x01(\bR\visDirectory\"!\n" + - "\vPbmMetadata\x12\x12\n" + - "\x04name\x18\x01 \x01(\tR\x04name\"\xc8\x01\n" + - "\bMetadata\x12,\n" + - "\tfile_list\x18\x01 \x03(\v2\x0f.backup.v1.FileR\bfileList\x129\n" + - "\n" + - "restore_to\x18\x02 \x01(\v2\x1a.google.protobuf.TimestampR\trestoreTo\x12;\n" + - "\fpbm_metadata\x18\x03 \x01(\v2\x16.backup.v1.PbmMetadataH\x00R\vpbmMetadataB\x16\n" + - "\x14backup_tool_metadata\"9\n" + - "\bLogChunk\x12\x19\n" + - "\bchunk_id\x18\x01 \x01(\rR\achunkId\x12\x12\n" + - "\x04data\x18\x02 \x01(\tR\x04data*X\n" + - "\tDataModel\x12\x1a\n" + - "\x16DATA_MODEL_UNSPECIFIED\x10\x00\x12\x17\n" + - "\x13DATA_MODEL_PHYSICAL\x10\x01\x12\x16\n" + - "\x12DATA_MODEL_LOGICAL\x10\x02*v\n" + - "\n" + - "BackupMode\x12\x1b\n" + - "\x17BACKUP_MODE_UNSPECIFIED\x10\x00\x12\x18\n" + - "\x14BACKUP_MODE_SNAPSHOT\x10\x01\x12\x1b\n" + - "\x17BACKUP_MODE_INCREMENTAL\x10\x02\x12\x14\n" + - "\x10BACKUP_MODE_PITR\x10\x03B\x90\x01\n" + - "\rcom.backup.v1B\vCommonProtoP\x01Z-github.com/percona/pmm/api/backup/v1;backupv1\xa2\x02\x03BXX\xaa\x02\tBackup.V1\xca\x02\tBackup\\V1\xe2\x02\x15Backup\\V1\\GPBMetadata\xea\x02\n" + - "Backup::V1b\x06proto3" - -var ( - file_backup_v1_common_proto_rawDescOnce sync.Once - file_backup_v1_common_proto_rawDescData []byte -) - -func file_backup_v1_common_proto_rawDescGZIP() []byte { - file_backup_v1_common_proto_rawDescOnce.Do(func() { - file_backup_v1_common_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_backup_v1_common_proto_rawDesc), len(file_backup_v1_common_proto_rawDesc))) - }) - 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_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 - 3, // 2: backup.v1.Metadata.pbm_metadata:type_name -> backup.v1.PbmMetadata - 3, // [3:3] is the sub-list for method output_type - 3, // [3:3] is the sub-list for method input_type - 3, // [3:3] is the sub-list for extension type_name - 3, // [3:3] is the sub-list for extension extendee - 0, // [0:3] is the sub-list for field type_name -} - -func init() { file_backup_v1_common_proto_init() } -func file_backup_v1_common_proto_init() { - if File_backup_v1_common_proto != nil { - return - } - file_backup_v1_common_proto_msgTypes[2].OneofWrappers = []any{ - (*Metadata_PbmMetadata)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_backup_v1_common_proto_rawDesc), len(file_backup_v1_common_proto_rawDesc)), - NumEnums: 2, - NumMessages: 4, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_backup_v1_common_proto_goTypes, - DependencyIndexes: file_backup_v1_common_proto_depIdxs, - EnumInfos: file_backup_v1_common_proto_enumTypes, - MessageInfos: file_backup_v1_common_proto_msgTypes, - }.Build() - File_backup_v1_common_proto = out.File - file_backup_v1_common_proto_goTypes = nil - file_backup_v1_common_proto_depIdxs = nil -} diff --git a/api/backup/v1/common.pb.validate.go b/api/backup/v1/common.pb.validate.go deleted file mode 100644 index 20835ce8c7f..00000000000 --- a/api/backup/v1/common.pb.validate.go +++ /dev/null @@ -1,559 +0,0 @@ -// Code generated by protoc-gen-validate. DO NOT EDIT. -// source: backup/v1/common.proto - -package backupv1 - -import ( - "bytes" - "errors" - "fmt" - "net" - "net/mail" - "net/url" - "regexp" - "sort" - "strings" - "time" - "unicode/utf8" - - "google.golang.org/protobuf/types/known/anypb" -) - -// ensure the imports are used -var ( - _ = bytes.MinRead - _ = errors.New("") - _ = fmt.Print - _ = utf8.UTFMax - _ = (*regexp.Regexp)(nil) - _ = (*strings.Reader)(nil) - _ = net.IPv4len - _ = time.Duration(0) - _ = (*url.URL)(nil) - _ = (*mail.Address)(nil) - _ = anypb.Any{} - _ = sort.Sort -) - -// Validate checks the field values on File 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 *File) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on File 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 FileMultiError, or nil if none found. -func (m *File) ValidateAll() error { - return m.validate(true) -} - -func (m *File) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetName()) < 1 { - err := FileValidationError{ - field: "Name", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for IsDirectory - - if len(errors) > 0 { - return FileMultiError(errors) - } - - return nil -} - -// FileMultiError is an error wrapping multiple validation errors returned by -// File.ValidateAll() if the designated constraints aren't met. -type FileMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m FileMultiError) 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 FileMultiError) AllErrors() []error { return m } - -// FileValidationError is the validation error returned by File.Validate if the -// designated constraints aren't met. -type FileValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e FileValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e FileValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e FileValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e FileValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e FileValidationError) ErrorName() string { return "FileValidationError" } - -// Error satisfies the builtin error interface -func (e FileValidationError) 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 %sFile.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = FileValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = FileValidationError{} - -// Validate checks the field values on PbmMetadata 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 *PbmMetadata) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on PbmMetadata 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 PbmMetadataMultiError, or -// nil if none found. -func (m *PbmMetadata) ValidateAll() error { - return m.validate(true) -} - -func (m *PbmMetadata) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Name - - if len(errors) > 0 { - return PbmMetadataMultiError(errors) - } - - return nil -} - -// PbmMetadataMultiError is an error wrapping multiple validation errors -// returned by PbmMetadata.ValidateAll() if the designated constraints aren't met. -type PbmMetadataMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m PbmMetadataMultiError) 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 PbmMetadataMultiError) AllErrors() []error { return m } - -// PbmMetadataValidationError is the validation error returned by -// PbmMetadata.Validate if the designated constraints aren't met. -type PbmMetadataValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e PbmMetadataValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e PbmMetadataValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e PbmMetadataValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e PbmMetadataValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e PbmMetadataValidationError) ErrorName() string { return "PbmMetadataValidationError" } - -// Error satisfies the builtin error interface -func (e PbmMetadataValidationError) 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 %sPbmMetadata.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = PbmMetadataValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = PbmMetadataValidationError{} - -// Validate checks the field values on Metadata 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 *Metadata) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on Metadata 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 MetadataMultiError, or nil -// if none found. -func (m *Metadata) ValidateAll() error { - return m.validate(true) -} - -func (m *Metadata) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - for idx, item := range m.GetFileList() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, MetadataValidationError{ - field: fmt.Sprintf("FileList[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, MetadataValidationError{ - field: fmt.Sprintf("FileList[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return MetadataValidationError{ - field: fmt.Sprintf("FileList[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - if all { - switch v := interface{}(m.GetRestoreTo()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, MetadataValidationError{ - field: "RestoreTo", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, MetadataValidationError{ - field: "RestoreTo", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetRestoreTo()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return MetadataValidationError{ - field: "RestoreTo", - reason: "embedded message failed validation", - cause: err, - } - } - } - - switch v := m.BackupToolMetadata.(type) { - case *Metadata_PbmMetadata: - if v == nil { - err := MetadataValidationError{ - field: "BackupToolMetadata", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetPbmMetadata()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, MetadataValidationError{ - field: "PbmMetadata", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, MetadataValidationError{ - field: "PbmMetadata", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetPbmMetadata()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return MetadataValidationError{ - field: "PbmMetadata", - reason: "embedded message failed validation", - cause: err, - } - } - } - - default: - _ = v // ensures v is used - } - - if len(errors) > 0 { - return MetadataMultiError(errors) - } - - return nil -} - -// MetadataMultiError is an error wrapping multiple validation errors returned -// by Metadata.ValidateAll() if the designated constraints aren't met. -type MetadataMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m MetadataMultiError) 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 MetadataMultiError) AllErrors() []error { return m } - -// MetadataValidationError is the validation error returned by -// Metadata.Validate if the designated constraints aren't met. -type MetadataValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e MetadataValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e MetadataValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e MetadataValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e MetadataValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e MetadataValidationError) ErrorName() string { return "MetadataValidationError" } - -// Error satisfies the builtin error interface -func (e MetadataValidationError) 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 %sMetadata.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = MetadataValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = MetadataValidationError{} - -// Validate checks the field values on LogChunk 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 *LogChunk) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on LogChunk 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 LogChunkMultiError, or nil -// if none found. -func (m *LogChunk) ValidateAll() error { - return m.validate(true) -} - -func (m *LogChunk) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for ChunkId - - // no validation rules for Data - - if len(errors) > 0 { - return LogChunkMultiError(errors) - } - - return nil -} - -// LogChunkMultiError is an error wrapping multiple validation errors returned -// by LogChunk.ValidateAll() if the designated constraints aren't met. -type LogChunkMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m LogChunkMultiError) 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 LogChunkMultiError) AllErrors() []error { return m } - -// LogChunkValidationError is the validation error returned by -// LogChunk.Validate if the designated constraints aren't met. -type LogChunkValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e LogChunkValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e LogChunkValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e LogChunkValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e LogChunkValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e LogChunkValidationError) ErrorName() string { return "LogChunkValidationError" } - -// Error satisfies the builtin error interface -func (e LogChunkValidationError) 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 %sLogChunk.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = LogChunkValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = LogChunkValidationError{} diff --git a/api/backup/v1/errors.pb.go b/api/backup/v1/errors.pb.go deleted file mode 100644 index 7ba4b5668a1..00000000000 --- a/api/backup/v1/errors.pb.go +++ /dev/null @@ -1,205 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.10 -// protoc (unknown) -// source: backup/v1/errors.proto - -package backupv1 - -import ( - reflect "reflect" - sync "sync" - unsafe "unsafe" - - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// ErrorCode is a set of specific errors that are not present in the standard set of errors -// and returned in the details field of the response. -type ErrorCode int32 - -const ( - ErrorCode_ERROR_CODE_UNSPECIFIED ErrorCode = 0 - // ERROR_CODE_XTRABACKUP_NOT_INSTALLED is returned if some xtrabackup component is missing. - ErrorCode_ERROR_CODE_XTRABACKUP_NOT_INSTALLED ErrorCode = 1 - // ERROR_CODE_INVALID_XTRABACKUP is returned if xtrabackup components have different version. - ErrorCode_ERROR_CODE_INVALID_XTRABACKUP ErrorCode = 2 - // ERROR_CODE_INCOMPATIBLE_XTRABACKUP is returned if xtrabackup is not compatible with the MySQL. - ErrorCode_ERROR_CODE_INCOMPATIBLE_XTRABACKUP ErrorCode = 3 - // ERROR_CODE_INCOMPATIBLE_TARGET_MYSQL is returned if target version of MySQL is not compatible for restoring selected artifact. - ErrorCode_ERROR_CODE_INCOMPATIBLE_TARGET_MYSQL ErrorCode = 4 - // ERROR_CODE_INCOMPATIBLE_TARGET_MONGODB is returned if target version of MongoDB is not compatible for restoring selected artifact. - ErrorCode_ERROR_CODE_INCOMPATIBLE_TARGET_MONGODB ErrorCode = 5 -) - -// Enum value maps for ErrorCode. -var ( - ErrorCode_name = map[int32]string{ - 0: "ERROR_CODE_UNSPECIFIED", - 1: "ERROR_CODE_XTRABACKUP_NOT_INSTALLED", - 2: "ERROR_CODE_INVALID_XTRABACKUP", - 3: "ERROR_CODE_INCOMPATIBLE_XTRABACKUP", - 4: "ERROR_CODE_INCOMPATIBLE_TARGET_MYSQL", - 5: "ERROR_CODE_INCOMPATIBLE_TARGET_MONGODB", - } - ErrorCode_value = map[string]int32{ - "ERROR_CODE_UNSPECIFIED": 0, - "ERROR_CODE_XTRABACKUP_NOT_INSTALLED": 1, - "ERROR_CODE_INVALID_XTRABACKUP": 2, - "ERROR_CODE_INCOMPATIBLE_XTRABACKUP": 3, - "ERROR_CODE_INCOMPATIBLE_TARGET_MYSQL": 4, - "ERROR_CODE_INCOMPATIBLE_TARGET_MONGODB": 5, - } -) - -func (x ErrorCode) Enum() *ErrorCode { - p := new(ErrorCode) - *p = x - return p -} - -func (x ErrorCode) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (ErrorCode) Descriptor() protoreflect.EnumDescriptor { - return file_backup_v1_errors_proto_enumTypes[0].Descriptor() -} - -func (ErrorCode) Type() protoreflect.EnumType { - return &file_backup_v1_errors_proto_enumTypes[0] -} - -func (x ErrorCode) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use ErrorCode.Descriptor instead. -func (ErrorCode) EnumDescriptor() ([]byte, []int) { - return file_backup_v1_errors_proto_rawDescGZIP(), []int{0} -} - -// Error represents error message returned in the details field in the response. -type Error struct { - state protoimpl.MessageState `protogen:"open.v1"` - Code ErrorCode `protobuf:"varint,1,opt,name=code,proto3,enum=backup.v1.ErrorCode" json:"code,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Error) Reset() { - *x = Error{} - mi := &file_backup_v1_errors_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Error) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Error) ProtoMessage() {} - -func (x *Error) ProtoReflect() protoreflect.Message { - mi := &file_backup_v1_errors_proto_msgTypes[0] - 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 Error.ProtoReflect.Descriptor instead. -func (*Error) Descriptor() ([]byte, []int) { - return file_backup_v1_errors_proto_rawDescGZIP(), []int{0} -} - -func (x *Error) GetCode() ErrorCode { - if x != nil { - return x.Code - } - return ErrorCode_ERROR_CODE_UNSPECIFIED -} - -var File_backup_v1_errors_proto protoreflect.FileDescriptor - -const file_backup_v1_errors_proto_rawDesc = "" + - "\n" + - "\x16backup/v1/errors.proto\x12\tbackup.v1\"1\n" + - "\x05Error\x12(\n" + - "\x04code\x18\x01 \x01(\x0e2\x14.backup.v1.ErrorCodeR\x04code*\xf1\x01\n" + - "\tErrorCode\x12\x1a\n" + - "\x16ERROR_CODE_UNSPECIFIED\x10\x00\x12'\n" + - "#ERROR_CODE_XTRABACKUP_NOT_INSTALLED\x10\x01\x12!\n" + - "\x1dERROR_CODE_INVALID_XTRABACKUP\x10\x02\x12&\n" + - "\"ERROR_CODE_INCOMPATIBLE_XTRABACKUP\x10\x03\x12(\n" + - "$ERROR_CODE_INCOMPATIBLE_TARGET_MYSQL\x10\x04\x12*\n" + - "&ERROR_CODE_INCOMPATIBLE_TARGET_MONGODB\x10\x05B\x90\x01\n" + - "\rcom.backup.v1B\vErrorsProtoP\x01Z-github.com/percona/pmm/api/backup/v1;backupv1\xa2\x02\x03BXX\xaa\x02\tBackup.V1\xca\x02\tBackup\\V1\xe2\x02\x15Backup\\V1\\GPBMetadata\xea\x02\n" + - "Backup::V1b\x06proto3" - -var ( - file_backup_v1_errors_proto_rawDescOnce sync.Once - file_backup_v1_errors_proto_rawDescData []byte -) - -func file_backup_v1_errors_proto_rawDescGZIP() []byte { - file_backup_v1_errors_proto_rawDescOnce.Do(func() { - file_backup_v1_errors_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_backup_v1_errors_proto_rawDesc), len(file_backup_v1_errors_proto_rawDesc))) - }) - 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_depIdxs = []int32{ - 0, // 0: backup.v1.Error.code:type_name -> backup.v1.ErrorCode - 1, // [1:1] is the sub-list for method output_type - 1, // [1:1] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name -} - -func init() { file_backup_v1_errors_proto_init() } -func file_backup_v1_errors_proto_init() { - if File_backup_v1_errors_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_backup_v1_errors_proto_rawDesc), len(file_backup_v1_errors_proto_rawDesc)), - NumEnums: 1, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_backup_v1_errors_proto_goTypes, - DependencyIndexes: file_backup_v1_errors_proto_depIdxs, - EnumInfos: file_backup_v1_errors_proto_enumTypes, - MessageInfos: file_backup_v1_errors_proto_msgTypes, - }.Build() - File_backup_v1_errors_proto = out.File - file_backup_v1_errors_proto_goTypes = nil - file_backup_v1_errors_proto_depIdxs = nil -} diff --git a/api/backup/v1/errors.pb.validate.go b/api/backup/v1/errors.pb.validate.go deleted file mode 100644 index 9aebb9d7648..00000000000 --- a/api/backup/v1/errors.pb.validate.go +++ /dev/null @@ -1,136 +0,0 @@ -// Code generated by protoc-gen-validate. DO NOT EDIT. -// source: backup/v1/errors.proto - -package backupv1 - -import ( - "bytes" - "errors" - "fmt" - "net" - "net/mail" - "net/url" - "regexp" - "sort" - "strings" - "time" - "unicode/utf8" - - "google.golang.org/protobuf/types/known/anypb" -) - -// ensure the imports are used -var ( - _ = bytes.MinRead - _ = errors.New("") - _ = fmt.Print - _ = utf8.UTFMax - _ = (*regexp.Regexp)(nil) - _ = (*strings.Reader)(nil) - _ = net.IPv4len - _ = time.Duration(0) - _ = (*url.URL)(nil) - _ = (*mail.Address)(nil) - _ = anypb.Any{} - _ = sort.Sort -) - -// Validate checks the field values on Error 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 *Error) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on Error 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 ErrorMultiError, or nil if none found. -func (m *Error) ValidateAll() error { - return m.validate(true) -} - -func (m *Error) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Code - - if len(errors) > 0 { - return ErrorMultiError(errors) - } - - return nil -} - -// ErrorMultiError is an error wrapping multiple validation errors returned by -// Error.ValidateAll() if the designated constraints aren't met. -type ErrorMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ErrorMultiError) 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 ErrorMultiError) AllErrors() []error { return m } - -// ErrorValidationError is the validation error returned by Error.Validate if -// the designated constraints aren't met. -type ErrorValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ErrorValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ErrorValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ErrorValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ErrorValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ErrorValidationError) ErrorName() string { return "ErrorValidationError" } - -// Error satisfies the builtin error interface -func (e ErrorValidationError) 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 %sError.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ErrorValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ErrorValidationError{} diff --git a/api/backup/v1/json/client/backup_service/backup_service_client.go b/api/backup/v1/json/client/backup_service/backup_service_client.go deleted file mode 100644 index a3417653225..00000000000 --- a/api/backup/v1/json/client/backup_service/backup_service_client.go +++ /dev/null @@ -1,527 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package backup_service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// New creates a new backup service API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -// New creates a new backup service API client with basic auth credentials. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - user: user for basic authentication header. -// - password: password for basic authentication header. -func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BasicAuth(user, password) - return &Client{transport: transport, formats: strfmt.Default} -} - -// New creates a new backup service API client with a bearer token for authentication. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - bearerToken: bearer token for Bearer authentication header. -func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BearerToken(bearerToken) - return &Client{transport: transport, formats: strfmt.Default} -} - -/* -Client for backup service API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption may be used to customize the behavior of Client methods. -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - ChangeScheduledBackup(params *ChangeScheduledBackupParams, opts ...ClientOption) (*ChangeScheduledBackupOK, error) - - DeleteArtifact(params *DeleteArtifactParams, opts ...ClientOption) (*DeleteArtifactOK, error) - - GetLogs(params *GetLogsParams, opts ...ClientOption) (*GetLogsOK, error) - - ListArtifactCompatibleServices(params *ListArtifactCompatibleServicesParams, opts ...ClientOption) (*ListArtifactCompatibleServicesOK, error) - - ListArtifacts(params *ListArtifactsParams, opts ...ClientOption) (*ListArtifactsOK, error) - - ListPitrTimeranges(params *ListPitrTimerangesParams, opts ...ClientOption) (*ListPitrTimerangesOK, error) - - ListScheduledBackups(params *ListScheduledBackupsParams, opts ...ClientOption) (*ListScheduledBackupsOK, error) - - RemoveScheduledBackup(params *RemoveScheduledBackupParams, opts ...ClientOption) (*RemoveScheduledBackupOK, error) - - ScheduleBackup(params *ScheduleBackupParams, opts ...ClientOption) (*ScheduleBackupOK, error) - - StartBackup(params *StartBackupParams, opts ...ClientOption) (*StartBackupOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -ChangeScheduledBackup changes a scheduled backup - -Change a scheduled backup. -*/ -func (a *Client) ChangeScheduledBackup(params *ChangeScheduledBackupParams, opts ...ClientOption) (*ChangeScheduledBackupOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewChangeScheduledBackupParams() - } - op := &runtime.ClientOperation{ - ID: "ChangeScheduledBackup", - Method: "PUT", - PathPattern: "/v1/backups:changeScheduled", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &ChangeScheduledBackupReader{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.(*ChangeScheduledBackupOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*ChangeScheduledBackupDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -DeleteArtifact deletes artifact - -Deletes an artifact. -*/ -func (a *Client) DeleteArtifact(params *DeleteArtifactParams, opts ...ClientOption) (*DeleteArtifactOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewDeleteArtifactParams() - } - op := &runtime.ClientOperation{ - ID: "DeleteArtifact", - Method: "DELETE", - PathPattern: "/v1/backups/artifacts/{artifact_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &DeleteArtifactReader{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.(*DeleteArtifactOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*DeleteArtifactDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -GetLogs gets logs - -Get logs from the underlying tools for a backup/restore job. -*/ -func (a *Client) GetLogs(params *GetLogsParams, opts ...ClientOption) (*GetLogsOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewGetLogsParams() - } - op := &runtime.ClientOperation{ - ID: "GetLogs", - Method: "GET", - PathPattern: "/v1/backups/{artifact_id}/logs", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &GetLogsReader{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.(*GetLogsOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*GetLogsDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -ListArtifactCompatibleServices lists compatible services - -List services that are compatible with the backup artifact. -*/ -func (a *Client) ListArtifactCompatibleServices(params *ListArtifactCompatibleServicesParams, opts ...ClientOption) (*ListArtifactCompatibleServicesOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewListArtifactCompatibleServicesParams() - } - op := &runtime.ClientOperation{ - ID: "ListArtifactCompatibleServices", - Method: "GET", - PathPattern: "/v1/backups/{artifact_id}/compatible-services", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &ListArtifactCompatibleServicesReader{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.(*ListArtifactCompatibleServicesOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*ListArtifactCompatibleServicesDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -ListArtifacts lists artifacts - -Return a list of backup artifacts. -*/ -func (a *Client) ListArtifacts(params *ListArtifactsParams, opts ...ClientOption) (*ListArtifactsOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewListArtifactsParams() - } - op := &runtime.ClientOperation{ - ID: "ListArtifacts", - Method: "GET", - PathPattern: "/v1/backups/artifacts", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &ListArtifactsReader{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.(*ListArtifactsOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*ListArtifactsDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -ListPitrTimeranges lists p i t r timeranges - -Return a list of available MongoDB point-in-time-recovery timeranges. -*/ -func (a *Client) ListPitrTimeranges(params *ListPitrTimerangesParams, opts ...ClientOption) (*ListPitrTimerangesOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewListPitrTimerangesParams() - } - op := &runtime.ClientOperation{ - ID: "ListPitrTimeranges", - Method: "GET", - PathPattern: "/v1/backups/artifacts/{artifact_id}/pitr-timeranges", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &ListPitrTimerangesReader{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.(*ListPitrTimerangesOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*ListPitrTimerangesDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -ListScheduledBackups lists scheduled backups - -List all scheduled backups. -*/ -func (a *Client) ListScheduledBackups(params *ListScheduledBackupsParams, opts ...ClientOption) (*ListScheduledBackupsOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewListScheduledBackupsParams() - } - op := &runtime.ClientOperation{ - ID: "ListScheduledBackups", - Method: "GET", - PathPattern: "/v1/backups/scheduled", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &ListScheduledBackupsReader{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.(*ListScheduledBackupsOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*ListScheduledBackupsDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -RemoveScheduledBackup removes a scheduled backup - -Remove a scheduled backup. -*/ -func (a *Client) RemoveScheduledBackup(params *RemoveScheduledBackupParams, opts ...ClientOption) (*RemoveScheduledBackupOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewRemoveScheduledBackupParams() - } - op := &runtime.ClientOperation{ - ID: "RemoveScheduledBackup", - Method: "DELETE", - PathPattern: "/v1/backups/{scheduled_backup_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &RemoveScheduledBackupReader{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.(*RemoveScheduledBackupOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*RemoveScheduledBackupDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -ScheduleBackup schedules a backup - -Schedule a backup to run at a specified time. -*/ -func (a *Client) ScheduleBackup(params *ScheduleBackupParams, opts ...ClientOption) (*ScheduleBackupOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewScheduleBackupParams() - } - op := &runtime.ClientOperation{ - ID: "ScheduleBackup", - Method: "POST", - PathPattern: "/v1/backups:schedule", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &ScheduleBackupReader{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.(*ScheduleBackupOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*ScheduleBackupDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* - StartBackup starts a backup - - Could return the Error message in the details containing specific ErrorCode indicating failure reason: - -ERROR_CODE_XTRABACKUP_NOT_INSTALLED - xtrabackup is not installed on the service -ERROR_CODE_INVALID_XTRABACKUP - different versions of xtrabackup and xbcloud -ERROR_CODE_INCOMPATIBLE_XTRABACKUP - xtrabackup is not compatible with MySQL for taking a backup -*/ -func (a *Client) StartBackup(params *StartBackupParams, opts ...ClientOption) (*StartBackupOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewStartBackupParams() - } - op := &runtime.ClientOperation{ - ID: "StartBackup", - Method: "POST", - PathPattern: "/v1/backups:start", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &StartBackupReader{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.(*StartBackupOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*StartBackupDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/api/backup/v1/json/client/backup_service/change_scheduled_backup_parameters.go b/api/backup/v1/json/client/backup_service/change_scheduled_backup_parameters.go deleted file mode 100644 index 484dc341fb1..00000000000 --- a/api/backup/v1/json/client/backup_service/change_scheduled_backup_parameters.go +++ /dev/null @@ -1,144 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package backup_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" -) - -// NewChangeScheduledBackupParams creates a new ChangeScheduledBackupParams 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 NewChangeScheduledBackupParams() *ChangeScheduledBackupParams { - return &ChangeScheduledBackupParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewChangeScheduledBackupParamsWithTimeout creates a new ChangeScheduledBackupParams object -// with the ability to set a timeout on a request. -func NewChangeScheduledBackupParamsWithTimeout(timeout time.Duration) *ChangeScheduledBackupParams { - return &ChangeScheduledBackupParams{ - timeout: timeout, - } -} - -// NewChangeScheduledBackupParamsWithContext creates a new ChangeScheduledBackupParams object -// with the ability to set a context for a request. -func NewChangeScheduledBackupParamsWithContext(ctx context.Context) *ChangeScheduledBackupParams { - return &ChangeScheduledBackupParams{ - Context: ctx, - } -} - -// NewChangeScheduledBackupParamsWithHTTPClient creates a new ChangeScheduledBackupParams object -// with the ability to set a custom HTTPClient for a request. -func NewChangeScheduledBackupParamsWithHTTPClient(client *http.Client) *ChangeScheduledBackupParams { - return &ChangeScheduledBackupParams{ - HTTPClient: client, - } -} - -/* -ChangeScheduledBackupParams contains all the parameters to send to the API endpoint - - for the change scheduled backup operation. - - Typically these are written to a http.Request. -*/ -type ChangeScheduledBackupParams struct { - // Body. - Body ChangeScheduledBackupBody - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the change scheduled backup params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ChangeScheduledBackupParams) WithDefaults() *ChangeScheduledBackupParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the change scheduled backup params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ChangeScheduledBackupParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the change scheduled backup params -func (o *ChangeScheduledBackupParams) WithTimeout(timeout time.Duration) *ChangeScheduledBackupParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the change scheduled backup params -func (o *ChangeScheduledBackupParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the change scheduled backup params -func (o *ChangeScheduledBackupParams) WithContext(ctx context.Context) *ChangeScheduledBackupParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the change scheduled backup params -func (o *ChangeScheduledBackupParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the change scheduled backup params -func (o *ChangeScheduledBackupParams) WithHTTPClient(client *http.Client) *ChangeScheduledBackupParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the change scheduled backup params -func (o *ChangeScheduledBackupParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the change scheduled backup params -func (o *ChangeScheduledBackupParams) WithBody(body ChangeScheduledBackupBody) *ChangeScheduledBackupParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the change scheduled backup params -func (o *ChangeScheduledBackupParams) SetBody(body ChangeScheduledBackupBody) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *ChangeScheduledBackupParams) 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/backup/v1/json/client/backup_service/change_scheduled_backup_responses.go b/api/backup/v1/json/client/backup_service/change_scheduled_backup_responses.go deleted file mode 100644 index 1c742c07f14..00000000000 --- a/api/backup/v1/json/client/backup_service/change_scheduled_backup_responses.go +++ /dev/null @@ -1,498 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package backup_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" -) - -// ChangeScheduledBackupReader is a Reader for the ChangeScheduledBackup structure. -type ChangeScheduledBackupReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ChangeScheduledBackupReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewChangeScheduledBackupOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewChangeScheduledBackupDefault(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 - } -} - -// NewChangeScheduledBackupOK creates a ChangeScheduledBackupOK with default headers values -func NewChangeScheduledBackupOK() *ChangeScheduledBackupOK { - return &ChangeScheduledBackupOK{} -} - -/* -ChangeScheduledBackupOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type ChangeScheduledBackupOK struct { - Payload any -} - -// IsSuccess returns true when this change scheduled backup Ok response has a 2xx status code -func (o *ChangeScheduledBackupOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this change scheduled backup Ok response has a 3xx status code -func (o *ChangeScheduledBackupOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this change scheduled backup Ok response has a 4xx status code -func (o *ChangeScheduledBackupOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this change scheduled backup Ok response has a 5xx status code -func (o *ChangeScheduledBackupOK) IsServerError() bool { - return false -} - -// IsCode returns true when this change scheduled backup Ok response a status code equal to that given -func (o *ChangeScheduledBackupOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the change scheduled backup Ok response -func (o *ChangeScheduledBackupOK) Code() int { - return 200 -} - -func (o *ChangeScheduledBackupOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/backups:changeScheduled][%d] changeScheduledBackupOk %s", 200, payload) -} - -func (o *ChangeScheduledBackupOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/backups:changeScheduled][%d] changeScheduledBackupOk %s", 200, payload) -} - -func (o *ChangeScheduledBackupOK) GetPayload() any { - return o.Payload -} - -func (o *ChangeScheduledBackupOK) 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) { - return err - } - - return nil -} - -// NewChangeScheduledBackupDefault creates a ChangeScheduledBackupDefault with default headers values -func NewChangeScheduledBackupDefault(code int) *ChangeScheduledBackupDefault { - return &ChangeScheduledBackupDefault{ - _statusCode: code, - } -} - -/* -ChangeScheduledBackupDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type ChangeScheduledBackupDefault struct { - _statusCode int - - Payload *ChangeScheduledBackupDefaultBody -} - -// IsSuccess returns true when this change scheduled backup default response has a 2xx status code -func (o *ChangeScheduledBackupDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this change scheduled backup default response has a 3xx status code -func (o *ChangeScheduledBackupDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this change scheduled backup default response has a 4xx status code -func (o *ChangeScheduledBackupDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this change scheduled backup default response has a 5xx status code -func (o *ChangeScheduledBackupDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this change scheduled backup default response a status code equal to that given -func (o *ChangeScheduledBackupDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the change scheduled backup default response -func (o *ChangeScheduledBackupDefault) Code() int { - return o._statusCode -} - -func (o *ChangeScheduledBackupDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/backups:changeScheduled][%d] ChangeScheduledBackup default %s", o._statusCode, payload) -} - -func (o *ChangeScheduledBackupDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/backups:changeScheduled][%d] ChangeScheduledBackup default %s", o._statusCode, payload) -} - -func (o *ChangeScheduledBackupDefault) GetPayload() *ChangeScheduledBackupDefaultBody { - return o.Payload -} - -func (o *ChangeScheduledBackupDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(ChangeScheduledBackupDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -ChangeScheduledBackupBody change scheduled backup body -swagger:model ChangeScheduledBackupBody -*/ -type ChangeScheduledBackupBody struct { - // scheduled backup id - ScheduledBackupID string `json:"scheduled_backup_id,omitempty"` - - // enabled - Enabled *bool `json:"enabled,omitempty"` - - // How often backup should be run in cron format. - CronExpression *string `json:"cron_expression,omitempty"` - - // First backup wouldn't happen before this time. - // Format: date-time - StartTime strfmt.DateTime `json:"start_time,omitempty"` - - // Name of backup. - Name *string `json:"name,omitempty"` - - // Human-readable description. - Description *string `json:"description,omitempty"` - - // How many times to retry a failed backup before giving up. - Retries *int64 `json:"retries,omitempty"` - - // Delay between each retry. Should have a suffix in JSON: 1s, 1m, 1h. - RetryInterval string `json:"retry_interval,omitempty"` - - // How many artifacts keep. 0 - unlimited. - Retention *int64 `json:"retention,omitempty"` -} - -// Validate validates this change scheduled backup body -func (o *ChangeScheduledBackupBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateStartTime(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ChangeScheduledBackupBody) validateStartTime(formats strfmt.Registry) error { - if swag.IsZero(o.StartTime) { // not required - return nil - } - - if err := validate.FormatOf("body"+"."+"start_time", "body", "date-time", o.StartTime.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this change scheduled backup body based on context it is used -func (o *ChangeScheduledBackupBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeScheduledBackupBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeScheduledBackupBody) UnmarshalBinary(b []byte) error { - var res ChangeScheduledBackupBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeScheduledBackupDefaultBody change scheduled backup default body -swagger:model ChangeScheduledBackupDefaultBody -*/ -type ChangeScheduledBackupDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*ChangeScheduledBackupDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this change scheduled backup default body -func (o *ChangeScheduledBackupDefaultBody) 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 *ChangeScheduledBackupDefaultBody) 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("ChangeScheduledBackup default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("ChangeScheduledBackup default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this change scheduled backup default body based on the context it is used -func (o *ChangeScheduledBackupDefaultBody) 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 *ChangeScheduledBackupDefaultBody) 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("ChangeScheduledBackup default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("ChangeScheduledBackup default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeScheduledBackupDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeScheduledBackupDefaultBody) UnmarshalBinary(b []byte) error { - var res ChangeScheduledBackupDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeScheduledBackupDefaultBodyDetailsItems0 change scheduled backup default body details items0 -swagger:model ChangeScheduledBackupDefaultBodyDetailsItems0 -*/ -type ChangeScheduledBackupDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` - - // change scheduled backup default body details items0 - ChangeScheduledBackupDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *ChangeScheduledBackupDefaultBodyDetailsItems0) 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 ChangeScheduledBackupDefaultBodyDetailsItems0 - - 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.ChangeScheduledBackupDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o ChangeScheduledBackupDefaultBodyDetailsItems0) 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.ChangeScheduledBackupDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.ChangeScheduledBackupDefaultBodyDetailsItems0) - 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 change scheduled backup default body details items0 -func (o *ChangeScheduledBackupDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this change scheduled backup default body details items0 based on context it is used -func (o *ChangeScheduledBackupDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeScheduledBackupDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeScheduledBackupDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res ChangeScheduledBackupDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/backup/v1/json/client/backup_service/delete_artifact_parameters.go b/api/backup/v1/json/client/backup_service/delete_artifact_parameters.go deleted file mode 100644 index 865c2d19370..00000000000 --- a/api/backup/v1/json/client/backup_service/delete_artifact_parameters.go +++ /dev/null @@ -1,183 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package backup_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" - "github.com/go-openapi/swag" -) - -// NewDeleteArtifactParams creates a new DeleteArtifactParams 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 NewDeleteArtifactParams() *DeleteArtifactParams { - return &DeleteArtifactParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDeleteArtifactParamsWithTimeout creates a new DeleteArtifactParams object -// with the ability to set a timeout on a request. -func NewDeleteArtifactParamsWithTimeout(timeout time.Duration) *DeleteArtifactParams { - return &DeleteArtifactParams{ - timeout: timeout, - } -} - -// NewDeleteArtifactParamsWithContext creates a new DeleteArtifactParams object -// with the ability to set a context for a request. -func NewDeleteArtifactParamsWithContext(ctx context.Context) *DeleteArtifactParams { - return &DeleteArtifactParams{ - Context: ctx, - } -} - -// NewDeleteArtifactParamsWithHTTPClient creates a new DeleteArtifactParams object -// with the ability to set a custom HTTPClient for a request. -func NewDeleteArtifactParamsWithHTTPClient(client *http.Client) *DeleteArtifactParams { - return &DeleteArtifactParams{ - HTTPClient: client, - } -} - -/* -DeleteArtifactParams contains all the parameters to send to the API endpoint - - for the delete artifact operation. - - Typically these are written to a http.Request. -*/ -type DeleteArtifactParams struct { - /* ArtifactID. - - Machine-readable artifact ID. - */ - ArtifactID string - - /* RemoveFiles. - - Removes all the backup files associated with artifact if flag is set. - */ - RemoveFiles *bool - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the delete artifact params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteArtifactParams) WithDefaults() *DeleteArtifactParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the delete artifact params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteArtifactParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the delete artifact params -func (o *DeleteArtifactParams) WithTimeout(timeout time.Duration) *DeleteArtifactParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the delete artifact params -func (o *DeleteArtifactParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the delete artifact params -func (o *DeleteArtifactParams) WithContext(ctx context.Context) *DeleteArtifactParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the delete artifact params -func (o *DeleteArtifactParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the delete artifact params -func (o *DeleteArtifactParams) WithHTTPClient(client *http.Client) *DeleteArtifactParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the delete artifact params -func (o *DeleteArtifactParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithArtifactID adds the artifactID to the delete artifact params -func (o *DeleteArtifactParams) WithArtifactID(artifactID string) *DeleteArtifactParams { - o.SetArtifactID(artifactID) - return o -} - -// SetArtifactID adds the artifactId to the delete artifact params -func (o *DeleteArtifactParams) SetArtifactID(artifactID string) { - o.ArtifactID = artifactID -} - -// WithRemoveFiles adds the removeFiles to the delete artifact params -func (o *DeleteArtifactParams) WithRemoveFiles(removeFiles *bool) *DeleteArtifactParams { - o.SetRemoveFiles(removeFiles) - return o -} - -// SetRemoveFiles adds the removeFiles to the delete artifact params -func (o *DeleteArtifactParams) SetRemoveFiles(removeFiles *bool) { - o.RemoveFiles = removeFiles -} - -// WriteToRequest writes these params to a swagger request -func (o *DeleteArtifactParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param artifact_id - if err := r.SetPathParam("artifact_id", o.ArtifactID); err != nil { - return err - } - - if o.RemoveFiles != nil { - - // query param remove_files - var qrRemoveFiles bool - - if o.RemoveFiles != nil { - qrRemoveFiles = *o.RemoveFiles - } - qRemoveFiles := swag.FormatBool(qrRemoveFiles) - if qRemoveFiles != "" { - if err := r.SetQueryParam("remove_files", qRemoveFiles); err != nil { - return err - } - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/api/backup/v1/json/client/backup_service/delete_artifact_responses.go b/api/backup/v1/json/client/backup_service/delete_artifact_responses.go deleted file mode 100644 index 2d1ede4bc15..00000000000 --- a/api/backup/v1/json/client/backup_service/delete_artifact_responses.go +++ /dev/null @@ -1,414 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package backup_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" -) - -// DeleteArtifactReader is a Reader for the DeleteArtifact structure. -type DeleteArtifactReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DeleteArtifactReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewDeleteArtifactOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewDeleteArtifactDefault(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 - } -} - -// NewDeleteArtifactOK creates a DeleteArtifactOK with default headers values -func NewDeleteArtifactOK() *DeleteArtifactOK { - return &DeleteArtifactOK{} -} - -/* -DeleteArtifactOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type DeleteArtifactOK struct { - Payload any -} - -// IsSuccess returns true when this delete artifact Ok response has a 2xx status code -func (o *DeleteArtifactOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this delete artifact Ok response has a 3xx status code -func (o *DeleteArtifactOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this delete artifact Ok response has a 4xx status code -func (o *DeleteArtifactOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this delete artifact Ok response has a 5xx status code -func (o *DeleteArtifactOK) IsServerError() bool { - return false -} - -// IsCode returns true when this delete artifact Ok response a status code equal to that given -func (o *DeleteArtifactOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the delete artifact Ok response -func (o *DeleteArtifactOK) Code() int { - return 200 -} - -func (o *DeleteArtifactOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/backups/artifacts/{artifact_id}][%d] deleteArtifactOk %s", 200, payload) -} - -func (o *DeleteArtifactOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/backups/artifacts/{artifact_id}][%d] deleteArtifactOk %s", 200, payload) -} - -func (o *DeleteArtifactOK) GetPayload() any { - return o.Payload -} - -func (o *DeleteArtifactOK) 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) { - return err - } - - return nil -} - -// NewDeleteArtifactDefault creates a DeleteArtifactDefault with default headers values -func NewDeleteArtifactDefault(code int) *DeleteArtifactDefault { - return &DeleteArtifactDefault{ - _statusCode: code, - } -} - -/* -DeleteArtifactDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type DeleteArtifactDefault struct { - _statusCode int - - Payload *DeleteArtifactDefaultBody -} - -// IsSuccess returns true when this delete artifact default response has a 2xx status code -func (o *DeleteArtifactDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this delete artifact default response has a 3xx status code -func (o *DeleteArtifactDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this delete artifact default response has a 4xx status code -func (o *DeleteArtifactDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this delete artifact default response has a 5xx status code -func (o *DeleteArtifactDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this delete artifact default response a status code equal to that given -func (o *DeleteArtifactDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the delete artifact default response -func (o *DeleteArtifactDefault) Code() int { - return o._statusCode -} - -func (o *DeleteArtifactDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/backups/artifacts/{artifact_id}][%d] DeleteArtifact default %s", o._statusCode, payload) -} - -func (o *DeleteArtifactDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/backups/artifacts/{artifact_id}][%d] DeleteArtifact default %s", o._statusCode, payload) -} - -func (o *DeleteArtifactDefault) GetPayload() *DeleteArtifactDefaultBody { - return o.Payload -} - -func (o *DeleteArtifactDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(DeleteArtifactDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -DeleteArtifactDefaultBody delete artifact default body -swagger:model DeleteArtifactDefaultBody -*/ -type DeleteArtifactDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*DeleteArtifactDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this delete artifact default body -func (o *DeleteArtifactDefaultBody) 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 *DeleteArtifactDefaultBody) 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("DeleteArtifact default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("DeleteArtifact default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this delete artifact default body based on the context it is used -func (o *DeleteArtifactDefaultBody) 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 *DeleteArtifactDefaultBody) 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("DeleteArtifact default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("DeleteArtifact default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *DeleteArtifactDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *DeleteArtifactDefaultBody) UnmarshalBinary(b []byte) error { - var res DeleteArtifactDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -DeleteArtifactDefaultBodyDetailsItems0 delete artifact default body details items0 -swagger:model DeleteArtifactDefaultBodyDetailsItems0 -*/ -type DeleteArtifactDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` - - // delete artifact default body details items0 - DeleteArtifactDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *DeleteArtifactDefaultBodyDetailsItems0) 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 DeleteArtifactDefaultBodyDetailsItems0 - - 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.DeleteArtifactDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o DeleteArtifactDefaultBodyDetailsItems0) 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.DeleteArtifactDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.DeleteArtifactDefaultBodyDetailsItems0) - 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 delete artifact default body details items0 -func (o *DeleteArtifactDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this delete artifact default body details items0 based on context it is used -func (o *DeleteArtifactDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *DeleteArtifactDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *DeleteArtifactDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res DeleteArtifactDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/backup/v1/json/client/backup_service/get_logs_parameters.go b/api/backup/v1/json/client/backup_service/get_logs_parameters.go deleted file mode 100644 index d65124e93df..00000000000 --- a/api/backup/v1/json/client/backup_service/get_logs_parameters.go +++ /dev/null @@ -1,211 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package backup_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" - "github.com/go-openapi/swag" -) - -// NewGetLogsParams creates a new GetLogsParams 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 NewGetLogsParams() *GetLogsParams { - return &GetLogsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetLogsParamsWithTimeout creates a new GetLogsParams object -// with the ability to set a timeout on a request. -func NewGetLogsParamsWithTimeout(timeout time.Duration) *GetLogsParams { - return &GetLogsParams{ - timeout: timeout, - } -} - -// NewGetLogsParamsWithContext creates a new GetLogsParams object -// with the ability to set a context for a request. -func NewGetLogsParamsWithContext(ctx context.Context) *GetLogsParams { - return &GetLogsParams{ - Context: ctx, - } -} - -// NewGetLogsParamsWithHTTPClient creates a new GetLogsParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetLogsParamsWithHTTPClient(client *http.Client) *GetLogsParams { - return &GetLogsParams{ - HTTPClient: client, - } -} - -/* -GetLogsParams contains all the parameters to send to the API endpoint - - for the get logs operation. - - Typically these are written to a http.Request. -*/ -type GetLogsParams struct { - // ArtifactID. - ArtifactID string - - // Limit. - // - // Format: int64 - Limit *int64 - - // Offset. - // - // Format: int64 - Offset *int64 - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get logs params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetLogsParams) WithDefaults() *GetLogsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get logs params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetLogsParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the get logs params -func (o *GetLogsParams) WithTimeout(timeout time.Duration) *GetLogsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get logs params -func (o *GetLogsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get logs params -func (o *GetLogsParams) WithContext(ctx context.Context) *GetLogsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get logs params -func (o *GetLogsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get logs params -func (o *GetLogsParams) WithHTTPClient(client *http.Client) *GetLogsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get logs params -func (o *GetLogsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithArtifactID adds the artifactID to the get logs params -func (o *GetLogsParams) WithArtifactID(artifactID string) *GetLogsParams { - o.SetArtifactID(artifactID) - return o -} - -// SetArtifactID adds the artifactId to the get logs params -func (o *GetLogsParams) SetArtifactID(artifactID string) { - o.ArtifactID = artifactID -} - -// WithLimit adds the limit to the get logs params -func (o *GetLogsParams) WithLimit(limit *int64) *GetLogsParams { - o.SetLimit(limit) - return o -} - -// SetLimit adds the limit to the get logs params -func (o *GetLogsParams) SetLimit(limit *int64) { - o.Limit = limit -} - -// WithOffset adds the offset to the get logs params -func (o *GetLogsParams) WithOffset(offset *int64) *GetLogsParams { - o.SetOffset(offset) - return o -} - -// SetOffset adds the offset to the get logs params -func (o *GetLogsParams) SetOffset(offset *int64) { - o.Offset = offset -} - -// WriteToRequest writes these params to a swagger request -func (o *GetLogsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param artifact_id - if err := r.SetPathParam("artifact_id", o.ArtifactID); err != nil { - return err - } - - if o.Limit != nil { - - // query param limit - var qrLimit int64 - - if o.Limit != nil { - qrLimit = *o.Limit - } - qLimit := swag.FormatInt64(qrLimit) - if qLimit != "" { - if err := r.SetQueryParam("limit", qLimit); err != nil { - return err - } - } - } - - if o.Offset != nil { - - // query param offset - var qrOffset int64 - - if o.Offset != nil { - qrOffset = *o.Offset - } - qOffset := swag.FormatInt64(qrOffset) - if qOffset != "" { - if err := r.SetQueryParam("offset", qOffset); err != nil { - return err - } - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/api/backup/v1/json/client/backup_service/get_logs_responses.go b/api/backup/v1/json/client/backup_service/get_logs_responses.go deleted file mode 100644 index a3a59102f58..00000000000 --- a/api/backup/v1/json/client/backup_service/get_logs_responses.go +++ /dev/null @@ -1,570 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package backup_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" -) - -// GetLogsReader is a Reader for the GetLogs structure. -type GetLogsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetLogsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewGetLogsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewGetLogsDefault(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 - } -} - -// NewGetLogsOK creates a GetLogsOK with default headers values -func NewGetLogsOK() *GetLogsOK { - return &GetLogsOK{} -} - -/* -GetLogsOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type GetLogsOK struct { - Payload *GetLogsOKBody -} - -// IsSuccess returns true when this get logs Ok response has a 2xx status code -func (o *GetLogsOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this get logs Ok response has a 3xx status code -func (o *GetLogsOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this get logs Ok response has a 4xx status code -func (o *GetLogsOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this get logs Ok response has a 5xx status code -func (o *GetLogsOK) IsServerError() bool { - return false -} - -// IsCode returns true when this get logs Ok response a status code equal to that given -func (o *GetLogsOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the get logs Ok response -func (o *GetLogsOK) Code() int { - return 200 -} - -func (o *GetLogsOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/backups/{artifact_id}/logs][%d] getLogsOk %s", 200, payload) -} - -func (o *GetLogsOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/backups/{artifact_id}/logs][%d] getLogsOk %s", 200, payload) -} - -func (o *GetLogsOK) GetPayload() *GetLogsOKBody { - return o.Payload -} - -func (o *GetLogsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(GetLogsOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -// NewGetLogsDefault creates a GetLogsDefault with default headers values -func NewGetLogsDefault(code int) *GetLogsDefault { - return &GetLogsDefault{ - _statusCode: code, - } -} - -/* -GetLogsDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type GetLogsDefault struct { - _statusCode int - - Payload *GetLogsDefaultBody -} - -// IsSuccess returns true when this get logs default response has a 2xx status code -func (o *GetLogsDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this get logs default response has a 3xx status code -func (o *GetLogsDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this get logs default response has a 4xx status code -func (o *GetLogsDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this get logs default response has a 5xx status code -func (o *GetLogsDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this get logs default response a status code equal to that given -func (o *GetLogsDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the get logs default response -func (o *GetLogsDefault) Code() int { - return o._statusCode -} - -func (o *GetLogsDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/backups/{artifact_id}/logs][%d] GetLogs default %s", o._statusCode, payload) -} - -func (o *GetLogsDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/backups/{artifact_id}/logs][%d] GetLogs default %s", o._statusCode, payload) -} - -func (o *GetLogsDefault) GetPayload() *GetLogsDefaultBody { - return o.Payload -} - -func (o *GetLogsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(GetLogsDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -GetLogsDefaultBody get logs default body -swagger:model GetLogsDefaultBody -*/ -type GetLogsDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*GetLogsDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this get logs default body -func (o *GetLogsDefaultBody) 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 *GetLogsDefaultBody) 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("GetLogs default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("GetLogs default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this get logs default body based on the context it is used -func (o *GetLogsDefaultBody) 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 *GetLogsDefaultBody) 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("GetLogs default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("GetLogs default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetLogsDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetLogsDefaultBody) UnmarshalBinary(b []byte) error { - var res GetLogsDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetLogsDefaultBodyDetailsItems0 get logs default body details items0 -swagger:model GetLogsDefaultBodyDetailsItems0 -*/ -type GetLogsDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` - - // get logs default body details items0 - GetLogsDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *GetLogsDefaultBodyDetailsItems0) 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 GetLogsDefaultBodyDetailsItems0 - - 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.GetLogsDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o GetLogsDefaultBodyDetailsItems0) 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.GetLogsDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.GetLogsDefaultBodyDetailsItems0) - 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 get logs default body details items0 -func (o *GetLogsDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get logs default body details items0 based on context it is used -func (o *GetLogsDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetLogsDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetLogsDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res GetLogsDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetLogsOKBody get logs OK body -swagger:model GetLogsOKBody -*/ -type GetLogsOKBody struct { - // logs - Logs []*GetLogsOKBodyLogsItems0 `json:"logs"` - - // end - End bool `json:"end,omitempty"` -} - -// Validate validates this get logs OK body -func (o *GetLogsOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateLogs(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetLogsOKBody) validateLogs(formats strfmt.Registry) error { - if swag.IsZero(o.Logs) { // not required - return nil - } - - for i := 0; i < len(o.Logs); i++ { - if swag.IsZero(o.Logs[i]) { // not required - continue - } - - if o.Logs[i] != nil { - if err := o.Logs[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getLogsOk" + "." + "logs" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getLogsOk" + "." + "logs" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this get logs OK body based on the context it is used -func (o *GetLogsOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateLogs(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetLogsOKBody) contextValidateLogs(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Logs); i++ { - if o.Logs[i] != nil { - - if swag.IsZero(o.Logs[i]) { // not required - return nil - } - - if err := o.Logs[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getLogsOk" + "." + "logs" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getLogsOk" + "." + "logs" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetLogsOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetLogsOKBody) UnmarshalBinary(b []byte) error { - var res GetLogsOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetLogsOKBodyLogsItems0 LogChunk represent one chunk of logs. -swagger:model GetLogsOKBodyLogsItems0 -*/ -type GetLogsOKBodyLogsItems0 struct { - // chunk id - ChunkID int64 `json:"chunk_id,omitempty"` - - // data - Data string `json:"data,omitempty"` -} - -// Validate validates this get logs OK body logs items0 -func (o *GetLogsOKBodyLogsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get logs OK body logs items0 based on context it is used -func (o *GetLogsOKBodyLogsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetLogsOKBodyLogsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetLogsOKBodyLogsItems0) UnmarshalBinary(b []byte) error { - var res GetLogsOKBodyLogsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/backup/v1/json/client/backup_service/list_artifact_compatible_services_parameters.go b/api/backup/v1/json/client/backup_service/list_artifact_compatible_services_parameters.go deleted file mode 100644 index 77f127caee5..00000000000 --- a/api/backup/v1/json/client/backup_service/list_artifact_compatible_services_parameters.go +++ /dev/null @@ -1,149 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package backup_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" -) - -// NewListArtifactCompatibleServicesParams creates a new ListArtifactCompatibleServicesParams 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 NewListArtifactCompatibleServicesParams() *ListArtifactCompatibleServicesParams { - return &ListArtifactCompatibleServicesParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListArtifactCompatibleServicesParamsWithTimeout creates a new ListArtifactCompatibleServicesParams object -// with the ability to set a timeout on a request. -func NewListArtifactCompatibleServicesParamsWithTimeout(timeout time.Duration) *ListArtifactCompatibleServicesParams { - return &ListArtifactCompatibleServicesParams{ - timeout: timeout, - } -} - -// NewListArtifactCompatibleServicesParamsWithContext creates a new ListArtifactCompatibleServicesParams object -// with the ability to set a context for a request. -func NewListArtifactCompatibleServicesParamsWithContext(ctx context.Context) *ListArtifactCompatibleServicesParams { - return &ListArtifactCompatibleServicesParams{ - Context: ctx, - } -} - -// NewListArtifactCompatibleServicesParamsWithHTTPClient creates a new ListArtifactCompatibleServicesParams object -// with the ability to set a custom HTTPClient for a request. -func NewListArtifactCompatibleServicesParamsWithHTTPClient(client *http.Client) *ListArtifactCompatibleServicesParams { - return &ListArtifactCompatibleServicesParams{ - HTTPClient: client, - } -} - -/* -ListArtifactCompatibleServicesParams contains all the parameters to send to the API endpoint - - for the list artifact compatible services operation. - - Typically these are written to a http.Request. -*/ -type ListArtifactCompatibleServicesParams struct { - /* ArtifactID. - - Artifact id used to determine restore compatibility. - */ - ArtifactID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list artifact compatible services params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListArtifactCompatibleServicesParams) WithDefaults() *ListArtifactCompatibleServicesParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list artifact compatible services params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListArtifactCompatibleServicesParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list artifact compatible services params -func (o *ListArtifactCompatibleServicesParams) WithTimeout(timeout time.Duration) *ListArtifactCompatibleServicesParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list artifact compatible services params -func (o *ListArtifactCompatibleServicesParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list artifact compatible services params -func (o *ListArtifactCompatibleServicesParams) WithContext(ctx context.Context) *ListArtifactCompatibleServicesParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list artifact compatible services params -func (o *ListArtifactCompatibleServicesParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list artifact compatible services params -func (o *ListArtifactCompatibleServicesParams) WithHTTPClient(client *http.Client) *ListArtifactCompatibleServicesParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list artifact compatible services params -func (o *ListArtifactCompatibleServicesParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithArtifactID adds the artifactID to the list artifact compatible services params -func (o *ListArtifactCompatibleServicesParams) WithArtifactID(artifactID string) *ListArtifactCompatibleServicesParams { - o.SetArtifactID(artifactID) - return o -} - -// SetArtifactID adds the artifactId to the list artifact compatible services params -func (o *ListArtifactCompatibleServicesParams) SetArtifactID(artifactID string) { - o.ArtifactID = artifactID -} - -// WriteToRequest writes these params to a swagger request -func (o *ListArtifactCompatibleServicesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param artifact_id - if err := r.SetPathParam("artifact_id", o.ArtifactID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/api/backup/v1/json/client/backup_service/list_artifact_compatible_services_responses.go b/api/backup/v1/json/client/backup_service/list_artifact_compatible_services_responses.go deleted file mode 100644 index cb6169a7f4b..00000000000 --- a/api/backup/v1/json/client/backup_service/list_artifact_compatible_services_responses.go +++ /dev/null @@ -1,737 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package backup_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" -) - -// ListArtifactCompatibleServicesReader is a Reader for the ListArtifactCompatibleServices structure. -type ListArtifactCompatibleServicesReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListArtifactCompatibleServicesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewListArtifactCompatibleServicesOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewListArtifactCompatibleServicesDefault(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 - } -} - -// NewListArtifactCompatibleServicesOK creates a ListArtifactCompatibleServicesOK with default headers values -func NewListArtifactCompatibleServicesOK() *ListArtifactCompatibleServicesOK { - return &ListArtifactCompatibleServicesOK{} -} - -/* -ListArtifactCompatibleServicesOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type ListArtifactCompatibleServicesOK struct { - Payload *ListArtifactCompatibleServicesOKBody -} - -// IsSuccess returns true when this list artifact compatible services Ok response has a 2xx status code -func (o *ListArtifactCompatibleServicesOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this list artifact compatible services Ok response has a 3xx status code -func (o *ListArtifactCompatibleServicesOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this list artifact compatible services Ok response has a 4xx status code -func (o *ListArtifactCompatibleServicesOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this list artifact compatible services Ok response has a 5xx status code -func (o *ListArtifactCompatibleServicesOK) IsServerError() bool { - return false -} - -// IsCode returns true when this list artifact compatible services Ok response a status code equal to that given -func (o *ListArtifactCompatibleServicesOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the list artifact compatible services Ok response -func (o *ListArtifactCompatibleServicesOK) Code() int { - return 200 -} - -func (o *ListArtifactCompatibleServicesOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/backups/{artifact_id}/compatible-services][%d] listArtifactCompatibleServicesOk %s", 200, payload) -} - -func (o *ListArtifactCompatibleServicesOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/backups/{artifact_id}/compatible-services][%d] listArtifactCompatibleServicesOk %s", 200, payload) -} - -func (o *ListArtifactCompatibleServicesOK) GetPayload() *ListArtifactCompatibleServicesOKBody { - return o.Payload -} - -func (o *ListArtifactCompatibleServicesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(ListArtifactCompatibleServicesOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -// NewListArtifactCompatibleServicesDefault creates a ListArtifactCompatibleServicesDefault with default headers values -func NewListArtifactCompatibleServicesDefault(code int) *ListArtifactCompatibleServicesDefault { - return &ListArtifactCompatibleServicesDefault{ - _statusCode: code, - } -} - -/* -ListArtifactCompatibleServicesDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type ListArtifactCompatibleServicesDefault struct { - _statusCode int - - Payload *ListArtifactCompatibleServicesDefaultBody -} - -// IsSuccess returns true when this list artifact compatible services default response has a 2xx status code -func (o *ListArtifactCompatibleServicesDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this list artifact compatible services default response has a 3xx status code -func (o *ListArtifactCompatibleServicesDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this list artifact compatible services default response has a 4xx status code -func (o *ListArtifactCompatibleServicesDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this list artifact compatible services default response has a 5xx status code -func (o *ListArtifactCompatibleServicesDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this list artifact compatible services default response a status code equal to that given -func (o *ListArtifactCompatibleServicesDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the list artifact compatible services default response -func (o *ListArtifactCompatibleServicesDefault) Code() int { - return o._statusCode -} - -func (o *ListArtifactCompatibleServicesDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/backups/{artifact_id}/compatible-services][%d] ListArtifactCompatibleServices default %s", o._statusCode, payload) -} - -func (o *ListArtifactCompatibleServicesDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/backups/{artifact_id}/compatible-services][%d] ListArtifactCompatibleServices default %s", o._statusCode, payload) -} - -func (o *ListArtifactCompatibleServicesDefault) GetPayload() *ListArtifactCompatibleServicesDefaultBody { - return o.Payload -} - -func (o *ListArtifactCompatibleServicesDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(ListArtifactCompatibleServicesDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -ListArtifactCompatibleServicesDefaultBody list artifact compatible services default body -swagger:model ListArtifactCompatibleServicesDefaultBody -*/ -type ListArtifactCompatibleServicesDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*ListArtifactCompatibleServicesDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this list artifact compatible services default body -func (o *ListArtifactCompatibleServicesDefaultBody) 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 *ListArtifactCompatibleServicesDefaultBody) 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("ListArtifactCompatibleServices default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("ListArtifactCompatibleServices default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this list artifact compatible services default body based on the context it is used -func (o *ListArtifactCompatibleServicesDefaultBody) 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 *ListArtifactCompatibleServicesDefaultBody) 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("ListArtifactCompatibleServices default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("ListArtifactCompatibleServices default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListArtifactCompatibleServicesDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListArtifactCompatibleServicesDefaultBody) UnmarshalBinary(b []byte) error { - var res ListArtifactCompatibleServicesDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListArtifactCompatibleServicesDefaultBodyDetailsItems0 list artifact compatible services default body details items0 -swagger:model ListArtifactCompatibleServicesDefaultBodyDetailsItems0 -*/ -type ListArtifactCompatibleServicesDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` - - // list artifact compatible services default body details items0 - ListArtifactCompatibleServicesDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *ListArtifactCompatibleServicesDefaultBodyDetailsItems0) 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 ListArtifactCompatibleServicesDefaultBodyDetailsItems0 - - 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.ListArtifactCompatibleServicesDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o ListArtifactCompatibleServicesDefaultBodyDetailsItems0) 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.ListArtifactCompatibleServicesDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.ListArtifactCompatibleServicesDefaultBodyDetailsItems0) - 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 list artifact compatible services default body details items0 -func (o *ListArtifactCompatibleServicesDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list artifact compatible services default body details items0 based on context it is used -func (o *ListArtifactCompatibleServicesDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListArtifactCompatibleServicesDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListArtifactCompatibleServicesDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res ListArtifactCompatibleServicesDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListArtifactCompatibleServicesOKBody list artifact compatible services OK body -swagger:model ListArtifactCompatibleServicesOKBody -*/ -type ListArtifactCompatibleServicesOKBody struct { - // mysql - Mysql []*ListArtifactCompatibleServicesOKBodyMysqlItems0 `json:"mysql"` - - // mongodb - Mongodb []*ListArtifactCompatibleServicesOKBodyMongodbItems0 `json:"mongodb"` -} - -// Validate validates this list artifact compatible services OK body -func (o *ListArtifactCompatibleServicesOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateMysql(formats); err != nil { - res = append(res, err) - } - - if err := o.validateMongodb(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListArtifactCompatibleServicesOKBody) validateMysql(formats strfmt.Registry) error { - if swag.IsZero(o.Mysql) { // not required - return nil - } - - for i := 0; i < len(o.Mysql); i++ { - if swag.IsZero(o.Mysql[i]) { // not required - continue - } - - if o.Mysql[i] != nil { - if err := o.Mysql[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listArtifactCompatibleServicesOk" + "." + "mysql" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listArtifactCompatibleServicesOk" + "." + "mysql" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -func (o *ListArtifactCompatibleServicesOKBody) validateMongodb(formats strfmt.Registry) error { - if swag.IsZero(o.Mongodb) { // not required - return nil - } - - for i := 0; i < len(o.Mongodb); i++ { - if swag.IsZero(o.Mongodb[i]) { // not required - continue - } - - if o.Mongodb[i] != nil { - if err := o.Mongodb[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listArtifactCompatibleServicesOk" + "." + "mongodb" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listArtifactCompatibleServicesOk" + "." + "mongodb" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this list artifact compatible services OK body based on the context it is used -func (o *ListArtifactCompatibleServicesOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateMysql(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateMongodb(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListArtifactCompatibleServicesOKBody) contextValidateMysql(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Mysql); i++ { - if o.Mysql[i] != nil { - - if swag.IsZero(o.Mysql[i]) { // not required - return nil - } - - if err := o.Mysql[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listArtifactCompatibleServicesOk" + "." + "mysql" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listArtifactCompatibleServicesOk" + "." + "mysql" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -func (o *ListArtifactCompatibleServicesOKBody) contextValidateMongodb(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Mongodb); i++ { - if o.Mongodb[i] != nil { - - if swag.IsZero(o.Mongodb[i]) { // not required - return nil - } - - if err := o.Mongodb[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listArtifactCompatibleServicesOk" + "." + "mongodb" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listArtifactCompatibleServicesOk" + "." + "mongodb" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListArtifactCompatibleServicesOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListArtifactCompatibleServicesOKBody) UnmarshalBinary(b []byte) error { - var res ListArtifactCompatibleServicesOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListArtifactCompatibleServicesOKBodyMongodbItems0 MongoDBService represents a generic MongoDB instance. -swagger:model ListArtifactCompatibleServicesOKBodyMongodbItems0 -*/ -type ListArtifactCompatibleServicesOKBodyMongodbItems0 struct { - // Unique randomly generated instance identifier. - ServiceID string `json:"service_id,omitempty"` - - // Unique across all Services user-defined name. - ServiceName string `json:"service_name,omitempty"` - - // Node identifier where this instance runs. - NodeID string `json:"node_id,omitempty"` - - // Access address (DNS name or IP). - // Address (and port) or socket is required. - Address string `json:"address,omitempty"` - - // Access port. - // Port is required when the address present. - Port int64 `json:"port,omitempty"` - - // Access unix socket. - // Address (and port) or socket is required. - Socket string `json:"socket,omitempty"` - - // Environment name. - Environment string `json:"environment,omitempty"` - - // Cluster name. - Cluster string `json:"cluster,omitempty"` - - // Replication set name. - ReplicationSet string `json:"replication_set,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // MongoDB version. - Version string `json:"version,omitempty"` -} - -// Validate validates this list artifact compatible services OK body mongodb items0 -func (o *ListArtifactCompatibleServicesOKBodyMongodbItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list artifact compatible services OK body mongodb items0 based on context it is used -func (o *ListArtifactCompatibleServicesOKBodyMongodbItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListArtifactCompatibleServicesOKBodyMongodbItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListArtifactCompatibleServicesOKBodyMongodbItems0) UnmarshalBinary(b []byte) error { - var res ListArtifactCompatibleServicesOKBodyMongodbItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListArtifactCompatibleServicesOKBodyMysqlItems0 MySQLService represents a generic MySQL instance. -swagger:model ListArtifactCompatibleServicesOKBodyMysqlItems0 -*/ -type ListArtifactCompatibleServicesOKBodyMysqlItems0 struct { - // Unique randomly generated instance identifier. - ServiceID string `json:"service_id,omitempty"` - - // Unique across all Services user-defined name. - ServiceName string `json:"service_name,omitempty"` - - // Node identifier where this instance runs. - NodeID string `json:"node_id,omitempty"` - - // Access address (DNS name or IP). - // Address (and port) or socket is required. - Address string `json:"address,omitempty"` - - // Access port. - // Port is required when the address present. - Port int64 `json:"port,omitempty"` - - // Access unix socket. - // Address (and port) or socket is required. - Socket string `json:"socket,omitempty"` - - // Environment name. - Environment string `json:"environment,omitempty"` - - // Cluster name. - Cluster string `json:"cluster,omitempty"` - - // Replication set name. - ReplicationSet string `json:"replication_set,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // MySQL version. - Version string `json:"version,omitempty"` - - // Extra parameters to be added to the DSN. - ExtraDsnParams map[string]string `json:"extra_dsn_params,omitempty"` -} - -// Validate validates this list artifact compatible services OK body mysql items0 -func (o *ListArtifactCompatibleServicesOKBodyMysqlItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list artifact compatible services OK body mysql items0 based on context it is used -func (o *ListArtifactCompatibleServicesOKBodyMysqlItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListArtifactCompatibleServicesOKBodyMysqlItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListArtifactCompatibleServicesOKBodyMysqlItems0) UnmarshalBinary(b []byte) error { - var res ListArtifactCompatibleServicesOKBodyMysqlItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/backup/v1/json/client/backup_service/list_artifacts_parameters.go b/api/backup/v1/json/client/backup_service/list_artifacts_parameters.go deleted file mode 100644 index c22d1264781..00000000000 --- a/api/backup/v1/json/client/backup_service/list_artifacts_parameters.go +++ /dev/null @@ -1,127 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package backup_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" -) - -// NewListArtifactsParams creates a new ListArtifactsParams 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 NewListArtifactsParams() *ListArtifactsParams { - return &ListArtifactsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListArtifactsParamsWithTimeout creates a new ListArtifactsParams object -// with the ability to set a timeout on a request. -func NewListArtifactsParamsWithTimeout(timeout time.Duration) *ListArtifactsParams { - return &ListArtifactsParams{ - timeout: timeout, - } -} - -// NewListArtifactsParamsWithContext creates a new ListArtifactsParams object -// with the ability to set a context for a request. -func NewListArtifactsParamsWithContext(ctx context.Context) *ListArtifactsParams { - return &ListArtifactsParams{ - Context: ctx, - } -} - -// NewListArtifactsParamsWithHTTPClient creates a new ListArtifactsParams object -// with the ability to set a custom HTTPClient for a request. -func NewListArtifactsParamsWithHTTPClient(client *http.Client) *ListArtifactsParams { - return &ListArtifactsParams{ - HTTPClient: client, - } -} - -/* -ListArtifactsParams contains all the parameters to send to the API endpoint - - for the list artifacts operation. - - Typically these are written to a http.Request. -*/ -type ListArtifactsParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list artifacts params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListArtifactsParams) WithDefaults() *ListArtifactsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list artifacts params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListArtifactsParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list artifacts params -func (o *ListArtifactsParams) WithTimeout(timeout time.Duration) *ListArtifactsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list artifacts params -func (o *ListArtifactsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list artifacts params -func (o *ListArtifactsParams) WithContext(ctx context.Context) *ListArtifactsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list artifacts params -func (o *ListArtifactsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list artifacts params -func (o *ListArtifactsParams) WithHTTPClient(client *http.Client) *ListArtifactsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list artifacts params -func (o *ListArtifactsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *ListArtifactsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/api/backup/v1/json/client/backup_service/list_artifacts_responses.go b/api/backup/v1/json/client/backup_service/list_artifacts_responses.go deleted file mode 100644 index 36316157438..00000000000 --- a/api/backup/v1/json/client/backup_service/list_artifacts_responses.go +++ /dev/null @@ -1,1132 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package backup_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" -) - -// ListArtifactsReader is a Reader for the ListArtifacts structure. -type ListArtifactsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListArtifactsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewListArtifactsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewListArtifactsDefault(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 - } -} - -// NewListArtifactsOK creates a ListArtifactsOK with default headers values -func NewListArtifactsOK() *ListArtifactsOK { - return &ListArtifactsOK{} -} - -/* -ListArtifactsOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type ListArtifactsOK struct { - Payload *ListArtifactsOKBody -} - -// IsSuccess returns true when this list artifacts Ok response has a 2xx status code -func (o *ListArtifactsOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this list artifacts Ok response has a 3xx status code -func (o *ListArtifactsOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this list artifacts Ok response has a 4xx status code -func (o *ListArtifactsOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this list artifacts Ok response has a 5xx status code -func (o *ListArtifactsOK) IsServerError() bool { - return false -} - -// IsCode returns true when this list artifacts Ok response a status code equal to that given -func (o *ListArtifactsOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the list artifacts Ok response -func (o *ListArtifactsOK) Code() int { - return 200 -} - -func (o *ListArtifactsOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/backups/artifacts][%d] listArtifactsOk %s", 200, payload) -} - -func (o *ListArtifactsOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/backups/artifacts][%d] listArtifactsOk %s", 200, payload) -} - -func (o *ListArtifactsOK) GetPayload() *ListArtifactsOKBody { - return o.Payload -} - -func (o *ListArtifactsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(ListArtifactsOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -// NewListArtifactsDefault creates a ListArtifactsDefault with default headers values -func NewListArtifactsDefault(code int) *ListArtifactsDefault { - return &ListArtifactsDefault{ - _statusCode: code, - } -} - -/* -ListArtifactsDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type ListArtifactsDefault struct { - _statusCode int - - Payload *ListArtifactsDefaultBody -} - -// IsSuccess returns true when this list artifacts default response has a 2xx status code -func (o *ListArtifactsDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this list artifacts default response has a 3xx status code -func (o *ListArtifactsDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this list artifacts default response has a 4xx status code -func (o *ListArtifactsDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this list artifacts default response has a 5xx status code -func (o *ListArtifactsDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this list artifacts default response a status code equal to that given -func (o *ListArtifactsDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the list artifacts default response -func (o *ListArtifactsDefault) Code() int { - return o._statusCode -} - -func (o *ListArtifactsDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/backups/artifacts][%d] ListArtifacts default %s", o._statusCode, payload) -} - -func (o *ListArtifactsDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/backups/artifacts][%d] ListArtifacts default %s", o._statusCode, payload) -} - -func (o *ListArtifactsDefault) GetPayload() *ListArtifactsDefaultBody { - return o.Payload -} - -func (o *ListArtifactsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(ListArtifactsDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -ListArtifactsDefaultBody list artifacts default body -swagger:model ListArtifactsDefaultBody -*/ -type ListArtifactsDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*ListArtifactsDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this list artifacts default body -func (o *ListArtifactsDefaultBody) 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 *ListArtifactsDefaultBody) 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("ListArtifacts default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("ListArtifacts default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this list artifacts default body based on the context it is used -func (o *ListArtifactsDefaultBody) 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 *ListArtifactsDefaultBody) 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("ListArtifacts default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("ListArtifacts default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListArtifactsDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListArtifactsDefaultBody) UnmarshalBinary(b []byte) error { - var res ListArtifactsDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListArtifactsDefaultBodyDetailsItems0 list artifacts default body details items0 -swagger:model ListArtifactsDefaultBodyDetailsItems0 -*/ -type ListArtifactsDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` - - // list artifacts default body details items0 - ListArtifactsDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *ListArtifactsDefaultBodyDetailsItems0) 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 ListArtifactsDefaultBodyDetailsItems0 - - 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.ListArtifactsDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o ListArtifactsDefaultBodyDetailsItems0) 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.ListArtifactsDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.ListArtifactsDefaultBodyDetailsItems0) - 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 list artifacts default body details items0 -func (o *ListArtifactsDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list artifacts default body details items0 based on context it is used -func (o *ListArtifactsDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListArtifactsDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListArtifactsDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res ListArtifactsDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListArtifactsOKBody list artifacts OK body -swagger:model ListArtifactsOKBody -*/ -type ListArtifactsOKBody struct { - // artifacts - Artifacts []*ListArtifactsOKBodyArtifactsItems0 `json:"artifacts"` -} - -// Validate validates this list artifacts OK body -func (o *ListArtifactsOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateArtifacts(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListArtifactsOKBody) validateArtifacts(formats strfmt.Registry) error { - if swag.IsZero(o.Artifacts) { // not required - return nil - } - - for i := 0; i < len(o.Artifacts); i++ { - if swag.IsZero(o.Artifacts[i]) { // not required - continue - } - - if o.Artifacts[i] != nil { - if err := o.Artifacts[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listArtifactsOk" + "." + "artifacts" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listArtifactsOk" + "." + "artifacts" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this list artifacts OK body based on the context it is used -func (o *ListArtifactsOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateArtifacts(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListArtifactsOKBody) contextValidateArtifacts(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Artifacts); i++ { - if o.Artifacts[i] != nil { - - if swag.IsZero(o.Artifacts[i]) { // not required - return nil - } - - if err := o.Artifacts[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listArtifactsOk" + "." + "artifacts" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listArtifactsOk" + "." + "artifacts" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListArtifactsOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListArtifactsOKBody) UnmarshalBinary(b []byte) error { - var res ListArtifactsOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListArtifactsOKBodyArtifactsItems0 Artifact represents single backup artifact. -swagger:model ListArtifactsOKBodyArtifactsItems0 -*/ -type ListArtifactsOKBodyArtifactsItems0 struct { - // Machine-readable artifact ID. - ArtifactID string `json:"artifact_id,omitempty"` - - // Artifact name - Name string `json:"name,omitempty"` - - // Database vendor e.g. PostgreSQL, MongoDB, MySQL. - Vendor string `json:"vendor,omitempty"` - - // Machine-readable location ID. - LocationID string `json:"location_id,omitempty"` - - // Location name. - LocationName string `json:"location_name,omitempty"` - - // Machine-readable service ID. - ServiceID string `json:"service_id,omitempty"` - - // Service name. - ServiceName string `json:"service_name,omitempty"` - - // DataModel is a model used for performing a backup. - // Enum: ["DATA_MODEL_UNSPECIFIED","DATA_MODEL_PHYSICAL","DATA_MODEL_LOGICAL"] - DataModel *string `json:"data_model,omitempty"` - - // BackupStatus shows the current status of execution of backup. - // 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"] - Status *string `json:"status,omitempty"` - - // Artifact creation time. - // Format: date-time - CreatedAt strfmt.DateTime `json:"created_at,omitempty"` - - // BackupMode specifies backup mode. - // Enum: ["BACKUP_MODE_UNSPECIFIED","BACKUP_MODE_SNAPSHOT","BACKUP_MODE_INCREMENTAL","BACKUP_MODE_PITR"] - Mode *string `json:"mode,omitempty"` - - // Source database setup type. - IsShardedCluster bool `json:"is_sharded_cluster,omitempty"` - - // Folder to store artifact on a storage. - Folder string `json:"folder,omitempty"` - - // List of artifact metadata. - MetadataList []*ListArtifactsOKBodyArtifactsItems0MetadataListItems0 `json:"metadata_list"` -} - -// Validate validates this list artifacts OK body artifacts items0 -func (o *ListArtifactsOKBodyArtifactsItems0) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateDataModel(formats); err != nil { - res = append(res, err) - } - - if err := o.validateStatus(formats); err != nil { - res = append(res, err) - } - - if err := o.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := o.validateMode(formats); err != nil { - res = append(res, err) - } - - if err := o.validateMetadataList(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var listArtifactsOkBodyArtifactsItems0TypeDataModelPropEnum []any - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["DATA_MODEL_UNSPECIFIED","DATA_MODEL_PHYSICAL","DATA_MODEL_LOGICAL"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - listArtifactsOkBodyArtifactsItems0TypeDataModelPropEnum = append(listArtifactsOkBodyArtifactsItems0TypeDataModelPropEnum, v) - } -} - -const ( - - // ListArtifactsOKBodyArtifactsItems0DataModelDATAMODELUNSPECIFIED captures enum value "DATA_MODEL_UNSPECIFIED" - ListArtifactsOKBodyArtifactsItems0DataModelDATAMODELUNSPECIFIED string = "DATA_MODEL_UNSPECIFIED" - - // ListArtifactsOKBodyArtifactsItems0DataModelDATAMODELPHYSICAL captures enum value "DATA_MODEL_PHYSICAL" - ListArtifactsOKBodyArtifactsItems0DataModelDATAMODELPHYSICAL string = "DATA_MODEL_PHYSICAL" - - // ListArtifactsOKBodyArtifactsItems0DataModelDATAMODELLOGICAL captures enum value "DATA_MODEL_LOGICAL" - ListArtifactsOKBodyArtifactsItems0DataModelDATAMODELLOGICAL string = "DATA_MODEL_LOGICAL" -) - -// prop value enum -func (o *ListArtifactsOKBodyArtifactsItems0) validateDataModelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, listArtifactsOkBodyArtifactsItems0TypeDataModelPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ListArtifactsOKBodyArtifactsItems0) validateDataModel(formats strfmt.Registry) error { - if swag.IsZero(o.DataModel) { // not required - return nil - } - - // value enum - if err := o.validateDataModelEnum("data_model", "body", *o.DataModel); err != nil { - return err - } - - return nil -} - -var listArtifactsOkBodyArtifactsItems0TypeStatusPropEnum []any - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["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"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - listArtifactsOkBodyArtifactsItems0TypeStatusPropEnum = append(listArtifactsOkBodyArtifactsItems0TypeStatusPropEnum, v) - } -} - -const ( - - // ListArtifactsOKBodyArtifactsItems0StatusBACKUPSTATUSUNSPECIFIED captures enum value "BACKUP_STATUS_UNSPECIFIED" - ListArtifactsOKBodyArtifactsItems0StatusBACKUPSTATUSUNSPECIFIED string = "BACKUP_STATUS_UNSPECIFIED" - - // ListArtifactsOKBodyArtifactsItems0StatusBACKUPSTATUSPENDING captures enum value "BACKUP_STATUS_PENDING" - ListArtifactsOKBodyArtifactsItems0StatusBACKUPSTATUSPENDING string = "BACKUP_STATUS_PENDING" - - // ListArtifactsOKBodyArtifactsItems0StatusBACKUPSTATUSINPROGRESS captures enum value "BACKUP_STATUS_IN_PROGRESS" - ListArtifactsOKBodyArtifactsItems0StatusBACKUPSTATUSINPROGRESS string = "BACKUP_STATUS_IN_PROGRESS" - - // ListArtifactsOKBodyArtifactsItems0StatusBACKUPSTATUSPAUSED captures enum value "BACKUP_STATUS_PAUSED" - ListArtifactsOKBodyArtifactsItems0StatusBACKUPSTATUSPAUSED string = "BACKUP_STATUS_PAUSED" - - // ListArtifactsOKBodyArtifactsItems0StatusBACKUPSTATUSSUCCESS captures enum value "BACKUP_STATUS_SUCCESS" - ListArtifactsOKBodyArtifactsItems0StatusBACKUPSTATUSSUCCESS string = "BACKUP_STATUS_SUCCESS" - - // ListArtifactsOKBodyArtifactsItems0StatusBACKUPSTATUSERROR captures enum value "BACKUP_STATUS_ERROR" - ListArtifactsOKBodyArtifactsItems0StatusBACKUPSTATUSERROR string = "BACKUP_STATUS_ERROR" - - // ListArtifactsOKBodyArtifactsItems0StatusBACKUPSTATUSDELETING captures enum value "BACKUP_STATUS_DELETING" - ListArtifactsOKBodyArtifactsItems0StatusBACKUPSTATUSDELETING string = "BACKUP_STATUS_DELETING" - - // ListArtifactsOKBodyArtifactsItems0StatusBACKUPSTATUSFAILEDTODELETE captures enum value "BACKUP_STATUS_FAILED_TO_DELETE" - ListArtifactsOKBodyArtifactsItems0StatusBACKUPSTATUSFAILEDTODELETE string = "BACKUP_STATUS_FAILED_TO_DELETE" - - // ListArtifactsOKBodyArtifactsItems0StatusBACKUPSTATUSCLEANUPINPROGRESS captures enum value "BACKUP_STATUS_CLEANUP_IN_PROGRESS" - ListArtifactsOKBodyArtifactsItems0StatusBACKUPSTATUSCLEANUPINPROGRESS string = "BACKUP_STATUS_CLEANUP_IN_PROGRESS" -) - -// prop value enum -func (o *ListArtifactsOKBodyArtifactsItems0) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, listArtifactsOkBodyArtifactsItems0TypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ListArtifactsOKBodyArtifactsItems0) 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 *ListArtifactsOKBodyArtifactsItems0) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(o.CreatedAt) { // not required - return nil - } - - if err := validate.FormatOf("created_at", "body", "date-time", o.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -var listArtifactsOkBodyArtifactsItems0TypeModePropEnum []any - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["BACKUP_MODE_UNSPECIFIED","BACKUP_MODE_SNAPSHOT","BACKUP_MODE_INCREMENTAL","BACKUP_MODE_PITR"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - listArtifactsOkBodyArtifactsItems0TypeModePropEnum = append(listArtifactsOkBodyArtifactsItems0TypeModePropEnum, v) - } -} - -const ( - - // ListArtifactsOKBodyArtifactsItems0ModeBACKUPMODEUNSPECIFIED captures enum value "BACKUP_MODE_UNSPECIFIED" - ListArtifactsOKBodyArtifactsItems0ModeBACKUPMODEUNSPECIFIED string = "BACKUP_MODE_UNSPECIFIED" - - // ListArtifactsOKBodyArtifactsItems0ModeBACKUPMODESNAPSHOT captures enum value "BACKUP_MODE_SNAPSHOT" - ListArtifactsOKBodyArtifactsItems0ModeBACKUPMODESNAPSHOT string = "BACKUP_MODE_SNAPSHOT" - - // ListArtifactsOKBodyArtifactsItems0ModeBACKUPMODEINCREMENTAL captures enum value "BACKUP_MODE_INCREMENTAL" - ListArtifactsOKBodyArtifactsItems0ModeBACKUPMODEINCREMENTAL string = "BACKUP_MODE_INCREMENTAL" - - // ListArtifactsOKBodyArtifactsItems0ModeBACKUPMODEPITR captures enum value "BACKUP_MODE_PITR" - ListArtifactsOKBodyArtifactsItems0ModeBACKUPMODEPITR string = "BACKUP_MODE_PITR" -) - -// prop value enum -func (o *ListArtifactsOKBodyArtifactsItems0) validateModeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, listArtifactsOkBodyArtifactsItems0TypeModePropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ListArtifactsOKBodyArtifactsItems0) validateMode(formats strfmt.Registry) error { - if swag.IsZero(o.Mode) { // not required - return nil - } - - // value enum - if err := o.validateModeEnum("mode", "body", *o.Mode); err != nil { - return err - } - - return nil -} - -func (o *ListArtifactsOKBodyArtifactsItems0) validateMetadataList(formats strfmt.Registry) error { - if swag.IsZero(o.MetadataList) { // not required - return nil - } - - for i := 0; i < len(o.MetadataList); i++ { - if swag.IsZero(o.MetadataList[i]) { // not required - continue - } - - if o.MetadataList[i] != nil { - if err := o.MetadataList[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("metadata_list" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("metadata_list" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this list artifacts OK body artifacts items0 based on the context it is used -func (o *ListArtifactsOKBodyArtifactsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateMetadataList(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListArtifactsOKBodyArtifactsItems0) contextValidateMetadataList(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.MetadataList); i++ { - if o.MetadataList[i] != nil { - - if swag.IsZero(o.MetadataList[i]) { // not required - return nil - } - - if err := o.MetadataList[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("metadata_list" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("metadata_list" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListArtifactsOKBodyArtifactsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListArtifactsOKBodyArtifactsItems0) UnmarshalBinary(b []byte) error { - var res ListArtifactsOKBodyArtifactsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListArtifactsOKBodyArtifactsItems0MetadataListItems0 Metadata contains extra artifact data like files it consists of, tool specific data, etc. -swagger:model ListArtifactsOKBodyArtifactsItems0MetadataListItems0 -*/ -type ListArtifactsOKBodyArtifactsItems0MetadataListItems0 struct { - // List of files backup consists of. - FileList []*ListArtifactsOKBodyArtifactsItems0MetadataListItems0FileListItems0 `json:"file_list"` - - // Exact time DB can be restored to. - // Format: date-time - RestoreTo strfmt.DateTime `json:"restore_to,omitempty"` - - // pbm metadata - PbmMetadata *ListArtifactsOKBodyArtifactsItems0MetadataListItems0PbmMetadata `json:"pbm_metadata,omitempty"` -} - -// Validate validates this list artifacts OK body artifacts items0 metadata list items0 -func (o *ListArtifactsOKBodyArtifactsItems0MetadataListItems0) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateFileList(formats); err != nil { - res = append(res, err) - } - - if err := o.validateRestoreTo(formats); err != nil { - res = append(res, err) - } - - if err := o.validatePbmMetadata(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListArtifactsOKBodyArtifactsItems0MetadataListItems0) validateFileList(formats strfmt.Registry) error { - if swag.IsZero(o.FileList) { // not required - return nil - } - - for i := 0; i < len(o.FileList); i++ { - if swag.IsZero(o.FileList[i]) { // not required - continue - } - - if o.FileList[i] != nil { - if err := o.FileList[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("file_list" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("file_list" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -func (o *ListArtifactsOKBodyArtifactsItems0MetadataListItems0) validateRestoreTo(formats strfmt.Registry) error { - if swag.IsZero(o.RestoreTo) { // not required - return nil - } - - if err := validate.FormatOf("restore_to", "body", "date-time", o.RestoreTo.String(), formats); err != nil { - return err - } - - return nil -} - -func (o *ListArtifactsOKBodyArtifactsItems0MetadataListItems0) validatePbmMetadata(formats strfmt.Registry) error { - if swag.IsZero(o.PbmMetadata) { // not required - return nil - } - - if o.PbmMetadata != nil { - if err := o.PbmMetadata.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("pbm_metadata") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("pbm_metadata") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this list artifacts OK body artifacts items0 metadata list items0 based on the context it is used -func (o *ListArtifactsOKBodyArtifactsItems0MetadataListItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateFileList(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidatePbmMetadata(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListArtifactsOKBodyArtifactsItems0MetadataListItems0) contextValidateFileList(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.FileList); i++ { - if o.FileList[i] != nil { - - if swag.IsZero(o.FileList[i]) { // not required - return nil - } - - if err := o.FileList[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("file_list" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("file_list" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -func (o *ListArtifactsOKBodyArtifactsItems0MetadataListItems0) contextValidatePbmMetadata(ctx context.Context, formats strfmt.Registry) error { - if o.PbmMetadata != nil { - - if swag.IsZero(o.PbmMetadata) { // not required - return nil - } - - if err := o.PbmMetadata.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("pbm_metadata") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("pbm_metadata") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListArtifactsOKBodyArtifactsItems0MetadataListItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListArtifactsOKBodyArtifactsItems0MetadataListItems0) UnmarshalBinary(b []byte) error { - var res ListArtifactsOKBodyArtifactsItems0MetadataListItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListArtifactsOKBodyArtifactsItems0MetadataListItems0FileListItems0 File represents file or folder on a storage. -swagger:model ListArtifactsOKBodyArtifactsItems0MetadataListItems0FileListItems0 -*/ -type ListArtifactsOKBodyArtifactsItems0MetadataListItems0FileListItems0 struct { - // name - Name string `json:"name,omitempty"` - - // is directory - IsDirectory bool `json:"is_directory,omitempty"` -} - -// Validate validates this list artifacts OK body artifacts items0 metadata list items0 file list items0 -func (o *ListArtifactsOKBodyArtifactsItems0MetadataListItems0FileListItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list artifacts OK body artifacts items0 metadata list items0 file list items0 based on context it is used -func (o *ListArtifactsOKBodyArtifactsItems0MetadataListItems0FileListItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListArtifactsOKBodyArtifactsItems0MetadataListItems0FileListItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListArtifactsOKBodyArtifactsItems0MetadataListItems0FileListItems0) UnmarshalBinary(b []byte) error { - var res ListArtifactsOKBodyArtifactsItems0MetadataListItems0FileListItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListArtifactsOKBodyArtifactsItems0MetadataListItems0PbmMetadata PbmMetadata contains additional data for pbm cli tools. -swagger:model ListArtifactsOKBodyArtifactsItems0MetadataListItems0PbmMetadata -*/ -type ListArtifactsOKBodyArtifactsItems0MetadataListItems0PbmMetadata struct { - // Name of backup in backup tool representation. - Name string `json:"name,omitempty"` -} - -// Validate validates this list artifacts OK body artifacts items0 metadata list items0 pbm metadata -func (o *ListArtifactsOKBodyArtifactsItems0MetadataListItems0PbmMetadata) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list artifacts OK body artifacts items0 metadata list items0 pbm metadata based on context it is used -func (o *ListArtifactsOKBodyArtifactsItems0MetadataListItems0PbmMetadata) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListArtifactsOKBodyArtifactsItems0MetadataListItems0PbmMetadata) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListArtifactsOKBodyArtifactsItems0MetadataListItems0PbmMetadata) UnmarshalBinary(b []byte) error { - var res ListArtifactsOKBodyArtifactsItems0MetadataListItems0PbmMetadata - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/backup/v1/json/client/backup_service/list_pitr_timeranges_parameters.go b/api/backup/v1/json/client/backup_service/list_pitr_timeranges_parameters.go deleted file mode 100644 index 069308b4635..00000000000 --- a/api/backup/v1/json/client/backup_service/list_pitr_timeranges_parameters.go +++ /dev/null @@ -1,149 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package backup_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" -) - -// NewListPitrTimerangesParams creates a new ListPitrTimerangesParams 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 NewListPitrTimerangesParams() *ListPitrTimerangesParams { - return &ListPitrTimerangesParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListPitrTimerangesParamsWithTimeout creates a new ListPitrTimerangesParams object -// with the ability to set a timeout on a request. -func NewListPitrTimerangesParamsWithTimeout(timeout time.Duration) *ListPitrTimerangesParams { - return &ListPitrTimerangesParams{ - timeout: timeout, - } -} - -// NewListPitrTimerangesParamsWithContext creates a new ListPitrTimerangesParams object -// with the ability to set a context for a request. -func NewListPitrTimerangesParamsWithContext(ctx context.Context) *ListPitrTimerangesParams { - return &ListPitrTimerangesParams{ - Context: ctx, - } -} - -// NewListPitrTimerangesParamsWithHTTPClient creates a new ListPitrTimerangesParams object -// with the ability to set a custom HTTPClient for a request. -func NewListPitrTimerangesParamsWithHTTPClient(client *http.Client) *ListPitrTimerangesParams { - return &ListPitrTimerangesParams{ - HTTPClient: client, - } -} - -/* -ListPitrTimerangesParams contains all the parameters to send to the API endpoint - - for the list pitr timeranges operation. - - Typically these are written to a http.Request. -*/ -type ListPitrTimerangesParams struct { - /* ArtifactID. - - Artifact ID represents artifact whose location has PITR timeranges to be retrieved. - */ - ArtifactID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list pitr timeranges params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListPitrTimerangesParams) WithDefaults() *ListPitrTimerangesParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list pitr timeranges params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListPitrTimerangesParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list pitr timeranges params -func (o *ListPitrTimerangesParams) WithTimeout(timeout time.Duration) *ListPitrTimerangesParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list pitr timeranges params -func (o *ListPitrTimerangesParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list pitr timeranges params -func (o *ListPitrTimerangesParams) WithContext(ctx context.Context) *ListPitrTimerangesParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list pitr timeranges params -func (o *ListPitrTimerangesParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list pitr timeranges params -func (o *ListPitrTimerangesParams) WithHTTPClient(client *http.Client) *ListPitrTimerangesParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list pitr timeranges params -func (o *ListPitrTimerangesParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithArtifactID adds the artifactID to the list pitr timeranges params -func (o *ListPitrTimerangesParams) WithArtifactID(artifactID string) *ListPitrTimerangesParams { - o.SetArtifactID(artifactID) - return o -} - -// SetArtifactID adds the artifactId to the list pitr timeranges params -func (o *ListPitrTimerangesParams) SetArtifactID(artifactID string) { - o.ArtifactID = artifactID -} - -// WriteToRequest writes these params to a swagger request -func (o *ListPitrTimerangesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param artifact_id - if err := r.SetPathParam("artifact_id", o.ArtifactID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/api/backup/v1/json/client/backup_service/list_pitr_timeranges_responses.go b/api/backup/v1/json/client/backup_service/list_pitr_timeranges_responses.go deleted file mode 100644 index f67370539e5..00000000000 --- a/api/backup/v1/json/client/backup_service/list_pitr_timeranges_responses.go +++ /dev/null @@ -1,607 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package backup_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" -) - -// ListPitrTimerangesReader is a Reader for the ListPitrTimeranges structure. -type ListPitrTimerangesReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListPitrTimerangesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewListPitrTimerangesOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewListPitrTimerangesDefault(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 - } -} - -// NewListPitrTimerangesOK creates a ListPitrTimerangesOK with default headers values -func NewListPitrTimerangesOK() *ListPitrTimerangesOK { - return &ListPitrTimerangesOK{} -} - -/* -ListPitrTimerangesOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type ListPitrTimerangesOK struct { - Payload *ListPitrTimerangesOKBody -} - -// IsSuccess returns true when this list pitr timeranges Ok response has a 2xx status code -func (o *ListPitrTimerangesOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this list pitr timeranges Ok response has a 3xx status code -func (o *ListPitrTimerangesOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this list pitr timeranges Ok response has a 4xx status code -func (o *ListPitrTimerangesOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this list pitr timeranges Ok response has a 5xx status code -func (o *ListPitrTimerangesOK) IsServerError() bool { - return false -} - -// IsCode returns true when this list pitr timeranges Ok response a status code equal to that given -func (o *ListPitrTimerangesOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the list pitr timeranges Ok response -func (o *ListPitrTimerangesOK) Code() int { - return 200 -} - -func (o *ListPitrTimerangesOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/backups/artifacts/{artifact_id}/pitr-timeranges][%d] listPitrTimerangesOk %s", 200, payload) -} - -func (o *ListPitrTimerangesOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/backups/artifacts/{artifact_id}/pitr-timeranges][%d] listPitrTimerangesOk %s", 200, payload) -} - -func (o *ListPitrTimerangesOK) GetPayload() *ListPitrTimerangesOKBody { - return o.Payload -} - -func (o *ListPitrTimerangesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(ListPitrTimerangesOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -// NewListPitrTimerangesDefault creates a ListPitrTimerangesDefault with default headers values -func NewListPitrTimerangesDefault(code int) *ListPitrTimerangesDefault { - return &ListPitrTimerangesDefault{ - _statusCode: code, - } -} - -/* -ListPitrTimerangesDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type ListPitrTimerangesDefault struct { - _statusCode int - - Payload *ListPitrTimerangesDefaultBody -} - -// IsSuccess returns true when this list pitr timeranges default response has a 2xx status code -func (o *ListPitrTimerangesDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this list pitr timeranges default response has a 3xx status code -func (o *ListPitrTimerangesDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this list pitr timeranges default response has a 4xx status code -func (o *ListPitrTimerangesDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this list pitr timeranges default response has a 5xx status code -func (o *ListPitrTimerangesDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this list pitr timeranges default response a status code equal to that given -func (o *ListPitrTimerangesDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the list pitr timeranges default response -func (o *ListPitrTimerangesDefault) Code() int { - return o._statusCode -} - -func (o *ListPitrTimerangesDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/backups/artifacts/{artifact_id}/pitr-timeranges][%d] ListPitrTimeranges default %s", o._statusCode, payload) -} - -func (o *ListPitrTimerangesDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/backups/artifacts/{artifact_id}/pitr-timeranges][%d] ListPitrTimeranges default %s", o._statusCode, payload) -} - -func (o *ListPitrTimerangesDefault) GetPayload() *ListPitrTimerangesDefaultBody { - return o.Payload -} - -func (o *ListPitrTimerangesDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(ListPitrTimerangesDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -ListPitrTimerangesDefaultBody list pitr timeranges default body -swagger:model ListPitrTimerangesDefaultBody -*/ -type ListPitrTimerangesDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*ListPitrTimerangesDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this list pitr timeranges default body -func (o *ListPitrTimerangesDefaultBody) 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 *ListPitrTimerangesDefaultBody) 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("ListPitrTimeranges default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("ListPitrTimeranges default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this list pitr timeranges default body based on the context it is used -func (o *ListPitrTimerangesDefaultBody) 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 *ListPitrTimerangesDefaultBody) 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("ListPitrTimeranges default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("ListPitrTimeranges default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListPitrTimerangesDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListPitrTimerangesDefaultBody) UnmarshalBinary(b []byte) error { - var res ListPitrTimerangesDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListPitrTimerangesDefaultBodyDetailsItems0 list pitr timeranges default body details items0 -swagger:model ListPitrTimerangesDefaultBodyDetailsItems0 -*/ -type ListPitrTimerangesDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` - - // list pitr timeranges default body details items0 - ListPitrTimerangesDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *ListPitrTimerangesDefaultBodyDetailsItems0) 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 ListPitrTimerangesDefaultBodyDetailsItems0 - - 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.ListPitrTimerangesDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o ListPitrTimerangesDefaultBodyDetailsItems0) 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.ListPitrTimerangesDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.ListPitrTimerangesDefaultBodyDetailsItems0) - 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 list pitr timeranges default body details items0 -func (o *ListPitrTimerangesDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list pitr timeranges default body details items0 based on context it is used -func (o *ListPitrTimerangesDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListPitrTimerangesDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListPitrTimerangesDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res ListPitrTimerangesDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListPitrTimerangesOKBody list pitr timeranges OK body -swagger:model ListPitrTimerangesOKBody -*/ -type ListPitrTimerangesOKBody struct { - // timeranges - Timeranges []*ListPitrTimerangesOKBodyTimerangesItems0 `json:"timeranges"` -} - -// Validate validates this list pitr timeranges OK body -func (o *ListPitrTimerangesOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateTimeranges(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListPitrTimerangesOKBody) validateTimeranges(formats strfmt.Registry) error { - if swag.IsZero(o.Timeranges) { // not required - return nil - } - - for i := 0; i < len(o.Timeranges); i++ { - if swag.IsZero(o.Timeranges[i]) { // not required - continue - } - - if o.Timeranges[i] != nil { - if err := o.Timeranges[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listPitrTimerangesOk" + "." + "timeranges" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listPitrTimerangesOk" + "." + "timeranges" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this list pitr timeranges OK body based on the context it is used -func (o *ListPitrTimerangesOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateTimeranges(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListPitrTimerangesOKBody) contextValidateTimeranges(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Timeranges); i++ { - if o.Timeranges[i] != nil { - - if swag.IsZero(o.Timeranges[i]) { // not required - return nil - } - - if err := o.Timeranges[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listPitrTimerangesOk" + "." + "timeranges" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listPitrTimerangesOk" + "." + "timeranges" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListPitrTimerangesOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListPitrTimerangesOKBody) UnmarshalBinary(b []byte) error { - var res ListPitrTimerangesOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListPitrTimerangesOKBodyTimerangesItems0 list pitr timeranges OK body timeranges items0 -swagger:model ListPitrTimerangesOKBodyTimerangesItems0 -*/ -type ListPitrTimerangesOKBodyTimerangesItems0 struct { - // start_timestamp is the time of the first event in the PITR chunk. - // Format: date-time - StartTimestamp strfmt.DateTime `json:"start_timestamp,omitempty"` - - // end_timestamp is the time of the last event in the PITR chunk. - // Format: date-time - EndTimestamp strfmt.DateTime `json:"end_timestamp,omitempty"` -} - -// Validate validates this list pitr timeranges OK body timeranges items0 -func (o *ListPitrTimerangesOKBodyTimerangesItems0) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateStartTimestamp(formats); err != nil { - res = append(res, err) - } - - if err := o.validateEndTimestamp(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListPitrTimerangesOKBodyTimerangesItems0) validateStartTimestamp(formats strfmt.Registry) error { - if swag.IsZero(o.StartTimestamp) { // not required - return nil - } - - if err := validate.FormatOf("start_timestamp", "body", "date-time", o.StartTimestamp.String(), formats); err != nil { - return err - } - - return nil -} - -func (o *ListPitrTimerangesOKBodyTimerangesItems0) validateEndTimestamp(formats strfmt.Registry) error { - if swag.IsZero(o.EndTimestamp) { // not required - return nil - } - - if err := validate.FormatOf("end_timestamp", "body", "date-time", o.EndTimestamp.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this list pitr timeranges OK body timeranges items0 based on context it is used -func (o *ListPitrTimerangesOKBodyTimerangesItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListPitrTimerangesOKBodyTimerangesItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListPitrTimerangesOKBodyTimerangesItems0) UnmarshalBinary(b []byte) error { - var res ListPitrTimerangesOKBodyTimerangesItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/backup/v1/json/client/backup_service/list_scheduled_backups_parameters.go b/api/backup/v1/json/client/backup_service/list_scheduled_backups_parameters.go deleted file mode 100644 index e87207a6d84..00000000000 --- a/api/backup/v1/json/client/backup_service/list_scheduled_backups_parameters.go +++ /dev/null @@ -1,127 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package backup_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" -) - -// NewListScheduledBackupsParams creates a new ListScheduledBackupsParams 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 NewListScheduledBackupsParams() *ListScheduledBackupsParams { - return &ListScheduledBackupsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListScheduledBackupsParamsWithTimeout creates a new ListScheduledBackupsParams object -// with the ability to set a timeout on a request. -func NewListScheduledBackupsParamsWithTimeout(timeout time.Duration) *ListScheduledBackupsParams { - return &ListScheduledBackupsParams{ - timeout: timeout, - } -} - -// NewListScheduledBackupsParamsWithContext creates a new ListScheduledBackupsParams object -// with the ability to set a context for a request. -func NewListScheduledBackupsParamsWithContext(ctx context.Context) *ListScheduledBackupsParams { - return &ListScheduledBackupsParams{ - Context: ctx, - } -} - -// NewListScheduledBackupsParamsWithHTTPClient creates a new ListScheduledBackupsParams object -// with the ability to set a custom HTTPClient for a request. -func NewListScheduledBackupsParamsWithHTTPClient(client *http.Client) *ListScheduledBackupsParams { - return &ListScheduledBackupsParams{ - HTTPClient: client, - } -} - -/* -ListScheduledBackupsParams contains all the parameters to send to the API endpoint - - for the list scheduled backups operation. - - Typically these are written to a http.Request. -*/ -type ListScheduledBackupsParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list scheduled backups params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListScheduledBackupsParams) WithDefaults() *ListScheduledBackupsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list scheduled backups params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListScheduledBackupsParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list scheduled backups params -func (o *ListScheduledBackupsParams) WithTimeout(timeout time.Duration) *ListScheduledBackupsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list scheduled backups params -func (o *ListScheduledBackupsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list scheduled backups params -func (o *ListScheduledBackupsParams) WithContext(ctx context.Context) *ListScheduledBackupsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list scheduled backups params -func (o *ListScheduledBackupsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list scheduled backups params -func (o *ListScheduledBackupsParams) WithHTTPClient(client *http.Client) *ListScheduledBackupsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list scheduled backups params -func (o *ListScheduledBackupsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *ListScheduledBackupsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/api/backup/v1/json/client/backup_service/list_scheduled_backups_responses.go b/api/backup/v1/json/client/backup_service/list_scheduled_backups_responses.go deleted file mode 100644 index 838aafb1637..00000000000 --- a/api/backup/v1/json/client/backup_service/list_scheduled_backups_responses.go +++ /dev/null @@ -1,778 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package backup_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" -) - -// ListScheduledBackupsReader is a Reader for the ListScheduledBackups structure. -type ListScheduledBackupsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListScheduledBackupsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewListScheduledBackupsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewListScheduledBackupsDefault(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 - } -} - -// NewListScheduledBackupsOK creates a ListScheduledBackupsOK with default headers values -func NewListScheduledBackupsOK() *ListScheduledBackupsOK { - return &ListScheduledBackupsOK{} -} - -/* -ListScheduledBackupsOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type ListScheduledBackupsOK struct { - Payload *ListScheduledBackupsOKBody -} - -// IsSuccess returns true when this list scheduled backups Ok response has a 2xx status code -func (o *ListScheduledBackupsOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this list scheduled backups Ok response has a 3xx status code -func (o *ListScheduledBackupsOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this list scheduled backups Ok response has a 4xx status code -func (o *ListScheduledBackupsOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this list scheduled backups Ok response has a 5xx status code -func (o *ListScheduledBackupsOK) IsServerError() bool { - return false -} - -// IsCode returns true when this list scheduled backups Ok response a status code equal to that given -func (o *ListScheduledBackupsOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the list scheduled backups Ok response -func (o *ListScheduledBackupsOK) Code() int { - return 200 -} - -func (o *ListScheduledBackupsOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/backups/scheduled][%d] listScheduledBackupsOk %s", 200, payload) -} - -func (o *ListScheduledBackupsOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/backups/scheduled][%d] listScheduledBackupsOk %s", 200, payload) -} - -func (o *ListScheduledBackupsOK) GetPayload() *ListScheduledBackupsOKBody { - return o.Payload -} - -func (o *ListScheduledBackupsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(ListScheduledBackupsOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -// NewListScheduledBackupsDefault creates a ListScheduledBackupsDefault with default headers values -func NewListScheduledBackupsDefault(code int) *ListScheduledBackupsDefault { - return &ListScheduledBackupsDefault{ - _statusCode: code, - } -} - -/* -ListScheduledBackupsDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type ListScheduledBackupsDefault struct { - _statusCode int - - Payload *ListScheduledBackupsDefaultBody -} - -// IsSuccess returns true when this list scheduled backups default response has a 2xx status code -func (o *ListScheduledBackupsDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this list scheduled backups default response has a 3xx status code -func (o *ListScheduledBackupsDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this list scheduled backups default response has a 4xx status code -func (o *ListScheduledBackupsDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this list scheduled backups default response has a 5xx status code -func (o *ListScheduledBackupsDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this list scheduled backups default response a status code equal to that given -func (o *ListScheduledBackupsDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the list scheduled backups default response -func (o *ListScheduledBackupsDefault) Code() int { - return o._statusCode -} - -func (o *ListScheduledBackupsDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/backups/scheduled][%d] ListScheduledBackups default %s", o._statusCode, payload) -} - -func (o *ListScheduledBackupsDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/backups/scheduled][%d] ListScheduledBackups default %s", o._statusCode, payload) -} - -func (o *ListScheduledBackupsDefault) GetPayload() *ListScheduledBackupsDefaultBody { - return o.Payload -} - -func (o *ListScheduledBackupsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(ListScheduledBackupsDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -ListScheduledBackupsDefaultBody list scheduled backups default body -swagger:model ListScheduledBackupsDefaultBody -*/ -type ListScheduledBackupsDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*ListScheduledBackupsDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this list scheduled backups default body -func (o *ListScheduledBackupsDefaultBody) 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 *ListScheduledBackupsDefaultBody) 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("ListScheduledBackups default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("ListScheduledBackups default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this list scheduled backups default body based on the context it is used -func (o *ListScheduledBackupsDefaultBody) 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 *ListScheduledBackupsDefaultBody) 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("ListScheduledBackups default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("ListScheduledBackups default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListScheduledBackupsDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListScheduledBackupsDefaultBody) UnmarshalBinary(b []byte) error { - var res ListScheduledBackupsDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListScheduledBackupsDefaultBodyDetailsItems0 list scheduled backups default body details items0 -swagger:model ListScheduledBackupsDefaultBodyDetailsItems0 -*/ -type ListScheduledBackupsDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` - - // list scheduled backups default body details items0 - ListScheduledBackupsDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *ListScheduledBackupsDefaultBodyDetailsItems0) 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 ListScheduledBackupsDefaultBodyDetailsItems0 - - 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.ListScheduledBackupsDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o ListScheduledBackupsDefaultBodyDetailsItems0) 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.ListScheduledBackupsDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.ListScheduledBackupsDefaultBodyDetailsItems0) - 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 list scheduled backups default body details items0 -func (o *ListScheduledBackupsDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list scheduled backups default body details items0 based on context it is used -func (o *ListScheduledBackupsDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListScheduledBackupsDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListScheduledBackupsDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res ListScheduledBackupsDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListScheduledBackupsOKBody list scheduled backups OK body -swagger:model ListScheduledBackupsOKBody -*/ -type ListScheduledBackupsOKBody struct { - // scheduled backups - ScheduledBackups []*ListScheduledBackupsOKBodyScheduledBackupsItems0 `json:"scheduled_backups"` -} - -// Validate validates this list scheduled backups OK body -func (o *ListScheduledBackupsOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateScheduledBackups(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListScheduledBackupsOKBody) validateScheduledBackups(formats strfmt.Registry) error { - if swag.IsZero(o.ScheduledBackups) { // not required - return nil - } - - for i := 0; i < len(o.ScheduledBackups); i++ { - if swag.IsZero(o.ScheduledBackups[i]) { // not required - continue - } - - if o.ScheduledBackups[i] != nil { - if err := o.ScheduledBackups[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listScheduledBackupsOk" + "." + "scheduled_backups" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listScheduledBackupsOk" + "." + "scheduled_backups" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this list scheduled backups OK body based on the context it is used -func (o *ListScheduledBackupsOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateScheduledBackups(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListScheduledBackupsOKBody) contextValidateScheduledBackups(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.ScheduledBackups); i++ { - if o.ScheduledBackups[i] != nil { - - if swag.IsZero(o.ScheduledBackups[i]) { // not required - return nil - } - - if err := o.ScheduledBackups[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listScheduledBackupsOk" + "." + "scheduled_backups" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listScheduledBackupsOk" + "." + "scheduled_backups" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListScheduledBackupsOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListScheduledBackupsOKBody) UnmarshalBinary(b []byte) error { - var res ListScheduledBackupsOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListScheduledBackupsOKBodyScheduledBackupsItems0 ScheduledBackup represents scheduled task for backup. -swagger:model ListScheduledBackupsOKBodyScheduledBackupsItems0 -*/ -type ListScheduledBackupsOKBodyScheduledBackupsItems0 struct { - // Machine-readable ID. - ScheduledBackupID string `json:"scheduled_backup_id,omitempty"` - - // Machine-readable service ID. - ServiceID string `json:"service_id,omitempty"` - - // Service name. - ServiceName string `json:"service_name,omitempty"` - - // Machine-readable location ID. - LocationID string `json:"location_id,omitempty"` - - // Location name. - LocationName string `json:"location_name,omitempty"` - - // Folder on storage for artifact. - Folder string `json:"folder,omitempty"` - - // How often backup will be run in cron format. - CronExpression string `json:"cron_expression,omitempty"` - - // First backup wouldn't happen before this time. - // Format: date-time - StartTime strfmt.DateTime `json:"start_time,omitempty"` - - // Artifact name. - Name string `json:"name,omitempty"` - - // Description. - Description string `json:"description,omitempty"` - - // If scheduling is enabled. - Enabled bool `json:"enabled,omitempty"` - - // How many times to retry a failed backup before giving up. - Retries int64 `json:"retries,omitempty"` - - // Delay between each retry. Should have a suffix in JSON: 2s, 1m, 1h. - RetryInterval string `json:"retry_interval,omitempty"` - - // DataModel is a model used for performing a backup. - // Enum: ["DATA_MODEL_UNSPECIFIED","DATA_MODEL_PHYSICAL","DATA_MODEL_LOGICAL"] - DataModel *string `json:"data_model,omitempty"` - - // BackupMode specifies backup mode. - // Enum: ["BACKUP_MODE_UNSPECIFIED","BACKUP_MODE_SNAPSHOT","BACKUP_MODE_INCREMENTAL","BACKUP_MODE_PITR"] - Mode *string `json:"mode,omitempty"` - - // Database vendor e.g. PostgreSQL, MongoDB, MySQL. - Vendor string `json:"vendor,omitempty"` - - // Last run. - // Format: date-time - LastRun strfmt.DateTime `json:"last_run,omitempty"` - - // Next run. - // Format: date-time - NextRun strfmt.DateTime `json:"next_run,omitempty"` - - // How many artifacts keep. 0 - unlimited. - Retention int64 `json:"retention,omitempty"` -} - -// Validate validates this list scheduled backups OK body scheduled backups items0 -func (o *ListScheduledBackupsOKBodyScheduledBackupsItems0) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateStartTime(formats); err != nil { - res = append(res, err) - } - - if err := o.validateDataModel(formats); err != nil { - res = append(res, err) - } - - if err := o.validateMode(formats); err != nil { - res = append(res, err) - } - - if err := o.validateLastRun(formats); err != nil { - res = append(res, err) - } - - if err := o.validateNextRun(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListScheduledBackupsOKBodyScheduledBackupsItems0) validateStartTime(formats strfmt.Registry) error { - if swag.IsZero(o.StartTime) { // not required - return nil - } - - if err := validate.FormatOf("start_time", "body", "date-time", o.StartTime.String(), formats); err != nil { - return err - } - - return nil -} - -var listScheduledBackupsOkBodyScheduledBackupsItems0TypeDataModelPropEnum []any - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["DATA_MODEL_UNSPECIFIED","DATA_MODEL_PHYSICAL","DATA_MODEL_LOGICAL"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - listScheduledBackupsOkBodyScheduledBackupsItems0TypeDataModelPropEnum = append(listScheduledBackupsOkBodyScheduledBackupsItems0TypeDataModelPropEnum, v) - } -} - -const ( - - // ListScheduledBackupsOKBodyScheduledBackupsItems0DataModelDATAMODELUNSPECIFIED captures enum value "DATA_MODEL_UNSPECIFIED" - ListScheduledBackupsOKBodyScheduledBackupsItems0DataModelDATAMODELUNSPECIFIED string = "DATA_MODEL_UNSPECIFIED" - - // ListScheduledBackupsOKBodyScheduledBackupsItems0DataModelDATAMODELPHYSICAL captures enum value "DATA_MODEL_PHYSICAL" - ListScheduledBackupsOKBodyScheduledBackupsItems0DataModelDATAMODELPHYSICAL string = "DATA_MODEL_PHYSICAL" - - // ListScheduledBackupsOKBodyScheduledBackupsItems0DataModelDATAMODELLOGICAL captures enum value "DATA_MODEL_LOGICAL" - ListScheduledBackupsOKBodyScheduledBackupsItems0DataModelDATAMODELLOGICAL string = "DATA_MODEL_LOGICAL" -) - -// prop value enum -func (o *ListScheduledBackupsOKBodyScheduledBackupsItems0) validateDataModelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, listScheduledBackupsOkBodyScheduledBackupsItems0TypeDataModelPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ListScheduledBackupsOKBodyScheduledBackupsItems0) validateDataModel(formats strfmt.Registry) error { - if swag.IsZero(o.DataModel) { // not required - return nil - } - - // value enum - if err := o.validateDataModelEnum("data_model", "body", *o.DataModel); err != nil { - return err - } - - return nil -} - -var listScheduledBackupsOkBodyScheduledBackupsItems0TypeModePropEnum []any - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["BACKUP_MODE_UNSPECIFIED","BACKUP_MODE_SNAPSHOT","BACKUP_MODE_INCREMENTAL","BACKUP_MODE_PITR"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - listScheduledBackupsOkBodyScheduledBackupsItems0TypeModePropEnum = append(listScheduledBackupsOkBodyScheduledBackupsItems0TypeModePropEnum, v) - } -} - -const ( - - // ListScheduledBackupsOKBodyScheduledBackupsItems0ModeBACKUPMODEUNSPECIFIED captures enum value "BACKUP_MODE_UNSPECIFIED" - ListScheduledBackupsOKBodyScheduledBackupsItems0ModeBACKUPMODEUNSPECIFIED string = "BACKUP_MODE_UNSPECIFIED" - - // ListScheduledBackupsOKBodyScheduledBackupsItems0ModeBACKUPMODESNAPSHOT captures enum value "BACKUP_MODE_SNAPSHOT" - ListScheduledBackupsOKBodyScheduledBackupsItems0ModeBACKUPMODESNAPSHOT string = "BACKUP_MODE_SNAPSHOT" - - // ListScheduledBackupsOKBodyScheduledBackupsItems0ModeBACKUPMODEINCREMENTAL captures enum value "BACKUP_MODE_INCREMENTAL" - ListScheduledBackupsOKBodyScheduledBackupsItems0ModeBACKUPMODEINCREMENTAL string = "BACKUP_MODE_INCREMENTAL" - - // ListScheduledBackupsOKBodyScheduledBackupsItems0ModeBACKUPMODEPITR captures enum value "BACKUP_MODE_PITR" - ListScheduledBackupsOKBodyScheduledBackupsItems0ModeBACKUPMODEPITR string = "BACKUP_MODE_PITR" -) - -// prop value enum -func (o *ListScheduledBackupsOKBodyScheduledBackupsItems0) validateModeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, listScheduledBackupsOkBodyScheduledBackupsItems0TypeModePropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ListScheduledBackupsOKBodyScheduledBackupsItems0) validateMode(formats strfmt.Registry) error { - if swag.IsZero(o.Mode) { // not required - return nil - } - - // value enum - if err := o.validateModeEnum("mode", "body", *o.Mode); err != nil { - return err - } - - return nil -} - -func (o *ListScheduledBackupsOKBodyScheduledBackupsItems0) validateLastRun(formats strfmt.Registry) error { - if swag.IsZero(o.LastRun) { // not required - return nil - } - - if err := validate.FormatOf("last_run", "body", "date-time", o.LastRun.String(), formats); err != nil { - return err - } - - return nil -} - -func (o *ListScheduledBackupsOKBodyScheduledBackupsItems0) validateNextRun(formats strfmt.Registry) error { - if swag.IsZero(o.NextRun) { // not required - return nil - } - - if err := validate.FormatOf("next_run", "body", "date-time", o.NextRun.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this list scheduled backups OK body scheduled backups items0 based on context it is used -func (o *ListScheduledBackupsOKBodyScheduledBackupsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListScheduledBackupsOKBodyScheduledBackupsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListScheduledBackupsOKBodyScheduledBackupsItems0) UnmarshalBinary(b []byte) error { - var res ListScheduledBackupsOKBodyScheduledBackupsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/backup/v1/json/client/backup_service/remove_scheduled_backup_parameters.go b/api/backup/v1/json/client/backup_service/remove_scheduled_backup_parameters.go deleted file mode 100644 index d1848495013..00000000000 --- a/api/backup/v1/json/client/backup_service/remove_scheduled_backup_parameters.go +++ /dev/null @@ -1,146 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package backup_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" -) - -// NewRemoveScheduledBackupParams creates a new RemoveScheduledBackupParams 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 NewRemoveScheduledBackupParams() *RemoveScheduledBackupParams { - return &RemoveScheduledBackupParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewRemoveScheduledBackupParamsWithTimeout creates a new RemoveScheduledBackupParams object -// with the ability to set a timeout on a request. -func NewRemoveScheduledBackupParamsWithTimeout(timeout time.Duration) *RemoveScheduledBackupParams { - return &RemoveScheduledBackupParams{ - timeout: timeout, - } -} - -// NewRemoveScheduledBackupParamsWithContext creates a new RemoveScheduledBackupParams object -// with the ability to set a context for a request. -func NewRemoveScheduledBackupParamsWithContext(ctx context.Context) *RemoveScheduledBackupParams { - return &RemoveScheduledBackupParams{ - Context: ctx, - } -} - -// NewRemoveScheduledBackupParamsWithHTTPClient creates a new RemoveScheduledBackupParams object -// with the ability to set a custom HTTPClient for a request. -func NewRemoveScheduledBackupParamsWithHTTPClient(client *http.Client) *RemoveScheduledBackupParams { - return &RemoveScheduledBackupParams{ - HTTPClient: client, - } -} - -/* -RemoveScheduledBackupParams contains all the parameters to send to the API endpoint - - for the remove scheduled backup operation. - - Typically these are written to a http.Request. -*/ -type RemoveScheduledBackupParams struct { - // ScheduledBackupID. - ScheduledBackupID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the remove scheduled backup params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *RemoveScheduledBackupParams) WithDefaults() *RemoveScheduledBackupParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the remove scheduled backup params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *RemoveScheduledBackupParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the remove scheduled backup params -func (o *RemoveScheduledBackupParams) WithTimeout(timeout time.Duration) *RemoveScheduledBackupParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the remove scheduled backup params -func (o *RemoveScheduledBackupParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the remove scheduled backup params -func (o *RemoveScheduledBackupParams) WithContext(ctx context.Context) *RemoveScheduledBackupParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the remove scheduled backup params -func (o *RemoveScheduledBackupParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the remove scheduled backup params -func (o *RemoveScheduledBackupParams) WithHTTPClient(client *http.Client) *RemoveScheduledBackupParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the remove scheduled backup params -func (o *RemoveScheduledBackupParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithScheduledBackupID adds the scheduledBackupID to the remove scheduled backup params -func (o *RemoveScheduledBackupParams) WithScheduledBackupID(scheduledBackupID string) *RemoveScheduledBackupParams { - o.SetScheduledBackupID(scheduledBackupID) - return o -} - -// SetScheduledBackupID adds the scheduledBackupId to the remove scheduled backup params -func (o *RemoveScheduledBackupParams) SetScheduledBackupID(scheduledBackupID string) { - o.ScheduledBackupID = scheduledBackupID -} - -// WriteToRequest writes these params to a swagger request -func (o *RemoveScheduledBackupParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param scheduled_backup_id - if err := r.SetPathParam("scheduled_backup_id", o.ScheduledBackupID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/api/backup/v1/json/client/backup_service/remove_scheduled_backup_responses.go b/api/backup/v1/json/client/backup_service/remove_scheduled_backup_responses.go deleted file mode 100644 index 0a157b49f34..00000000000 --- a/api/backup/v1/json/client/backup_service/remove_scheduled_backup_responses.go +++ /dev/null @@ -1,414 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package backup_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" -) - -// RemoveScheduledBackupReader is a Reader for the RemoveScheduledBackup structure. -type RemoveScheduledBackupReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *RemoveScheduledBackupReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewRemoveScheduledBackupOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewRemoveScheduledBackupDefault(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 - } -} - -// NewRemoveScheduledBackupOK creates a RemoveScheduledBackupOK with default headers values -func NewRemoveScheduledBackupOK() *RemoveScheduledBackupOK { - return &RemoveScheduledBackupOK{} -} - -/* -RemoveScheduledBackupOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type RemoveScheduledBackupOK struct { - Payload any -} - -// IsSuccess returns true when this remove scheduled backup Ok response has a 2xx status code -func (o *RemoveScheduledBackupOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this remove scheduled backup Ok response has a 3xx status code -func (o *RemoveScheduledBackupOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this remove scheduled backup Ok response has a 4xx status code -func (o *RemoveScheduledBackupOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this remove scheduled backup Ok response has a 5xx status code -func (o *RemoveScheduledBackupOK) IsServerError() bool { - return false -} - -// IsCode returns true when this remove scheduled backup Ok response a status code equal to that given -func (o *RemoveScheduledBackupOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the remove scheduled backup Ok response -func (o *RemoveScheduledBackupOK) Code() int { - return 200 -} - -func (o *RemoveScheduledBackupOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/backups/{scheduled_backup_id}][%d] removeScheduledBackupOk %s", 200, payload) -} - -func (o *RemoveScheduledBackupOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/backups/{scheduled_backup_id}][%d] removeScheduledBackupOk %s", 200, payload) -} - -func (o *RemoveScheduledBackupOK) GetPayload() any { - return o.Payload -} - -func (o *RemoveScheduledBackupOK) 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) { - return err - } - - return nil -} - -// NewRemoveScheduledBackupDefault creates a RemoveScheduledBackupDefault with default headers values -func NewRemoveScheduledBackupDefault(code int) *RemoveScheduledBackupDefault { - return &RemoveScheduledBackupDefault{ - _statusCode: code, - } -} - -/* -RemoveScheduledBackupDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type RemoveScheduledBackupDefault struct { - _statusCode int - - Payload *RemoveScheduledBackupDefaultBody -} - -// IsSuccess returns true when this remove scheduled backup default response has a 2xx status code -func (o *RemoveScheduledBackupDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this remove scheduled backup default response has a 3xx status code -func (o *RemoveScheduledBackupDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this remove scheduled backup default response has a 4xx status code -func (o *RemoveScheduledBackupDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this remove scheduled backup default response has a 5xx status code -func (o *RemoveScheduledBackupDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this remove scheduled backup default response a status code equal to that given -func (o *RemoveScheduledBackupDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the remove scheduled backup default response -func (o *RemoveScheduledBackupDefault) Code() int { - return o._statusCode -} - -func (o *RemoveScheduledBackupDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/backups/{scheduled_backup_id}][%d] RemoveScheduledBackup default %s", o._statusCode, payload) -} - -func (o *RemoveScheduledBackupDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/backups/{scheduled_backup_id}][%d] RemoveScheduledBackup default %s", o._statusCode, payload) -} - -func (o *RemoveScheduledBackupDefault) GetPayload() *RemoveScheduledBackupDefaultBody { - return o.Payload -} - -func (o *RemoveScheduledBackupDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(RemoveScheduledBackupDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -RemoveScheduledBackupDefaultBody remove scheduled backup default body -swagger:model RemoveScheduledBackupDefaultBody -*/ -type RemoveScheduledBackupDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*RemoveScheduledBackupDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this remove scheduled backup default body -func (o *RemoveScheduledBackupDefaultBody) 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 *RemoveScheduledBackupDefaultBody) 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("RemoveScheduledBackup default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("RemoveScheduledBackup default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this remove scheduled backup default body based on the context it is used -func (o *RemoveScheduledBackupDefaultBody) 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 *RemoveScheduledBackupDefaultBody) 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("RemoveScheduledBackup default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("RemoveScheduledBackup default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *RemoveScheduledBackupDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *RemoveScheduledBackupDefaultBody) UnmarshalBinary(b []byte) error { - var res RemoveScheduledBackupDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -RemoveScheduledBackupDefaultBodyDetailsItems0 remove scheduled backup default body details items0 -swagger:model RemoveScheduledBackupDefaultBodyDetailsItems0 -*/ -type RemoveScheduledBackupDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` - - // remove scheduled backup default body details items0 - RemoveScheduledBackupDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *RemoveScheduledBackupDefaultBodyDetailsItems0) 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 RemoveScheduledBackupDefaultBodyDetailsItems0 - - 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.RemoveScheduledBackupDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o RemoveScheduledBackupDefaultBodyDetailsItems0) 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.RemoveScheduledBackupDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.RemoveScheduledBackupDefaultBodyDetailsItems0) - 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 remove scheduled backup default body details items0 -func (o *RemoveScheduledBackupDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this remove scheduled backup default body details items0 based on context it is used -func (o *RemoveScheduledBackupDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *RemoveScheduledBackupDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *RemoveScheduledBackupDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res RemoveScheduledBackupDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/backup/v1/json/client/backup_service/schedule_backup_parameters.go b/api/backup/v1/json/client/backup_service/schedule_backup_parameters.go deleted file mode 100644 index 843f97f8cdb..00000000000 --- a/api/backup/v1/json/client/backup_service/schedule_backup_parameters.go +++ /dev/null @@ -1,144 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package backup_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" -) - -// NewScheduleBackupParams creates a new ScheduleBackupParams 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 NewScheduleBackupParams() *ScheduleBackupParams { - return &ScheduleBackupParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewScheduleBackupParamsWithTimeout creates a new ScheduleBackupParams object -// with the ability to set a timeout on a request. -func NewScheduleBackupParamsWithTimeout(timeout time.Duration) *ScheduleBackupParams { - return &ScheduleBackupParams{ - timeout: timeout, - } -} - -// NewScheduleBackupParamsWithContext creates a new ScheduleBackupParams object -// with the ability to set a context for a request. -func NewScheduleBackupParamsWithContext(ctx context.Context) *ScheduleBackupParams { - return &ScheduleBackupParams{ - Context: ctx, - } -} - -// NewScheduleBackupParamsWithHTTPClient creates a new ScheduleBackupParams object -// with the ability to set a custom HTTPClient for a request. -func NewScheduleBackupParamsWithHTTPClient(client *http.Client) *ScheduleBackupParams { - return &ScheduleBackupParams{ - HTTPClient: client, - } -} - -/* -ScheduleBackupParams contains all the parameters to send to the API endpoint - - for the schedule backup operation. - - Typically these are written to a http.Request. -*/ -type ScheduleBackupParams struct { - // Body. - Body ScheduleBackupBody - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the schedule backup params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ScheduleBackupParams) WithDefaults() *ScheduleBackupParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the schedule backup params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ScheduleBackupParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the schedule backup params -func (o *ScheduleBackupParams) WithTimeout(timeout time.Duration) *ScheduleBackupParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the schedule backup params -func (o *ScheduleBackupParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the schedule backup params -func (o *ScheduleBackupParams) WithContext(ctx context.Context) *ScheduleBackupParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the schedule backup params -func (o *ScheduleBackupParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the schedule backup params -func (o *ScheduleBackupParams) WithHTTPClient(client *http.Client) *ScheduleBackupParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the schedule backup params -func (o *ScheduleBackupParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the schedule backup params -func (o *ScheduleBackupParams) WithBody(body ScheduleBackupBody) *ScheduleBackupParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the schedule backup params -func (o *ScheduleBackupParams) SetBody(body ScheduleBackupBody) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *ScheduleBackupParams) 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/backup/v1/json/client/backup_service/schedule_backup_responses.go b/api/backup/v1/json/client/backup_service/schedule_backup_responses.go deleted file mode 100644 index 84b170cf30d..00000000000 --- a/api/backup/v1/json/client/backup_service/schedule_backup_responses.go +++ /dev/null @@ -1,653 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package backup_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" -) - -// ScheduleBackupReader is a Reader for the ScheduleBackup structure. -type ScheduleBackupReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ScheduleBackupReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewScheduleBackupOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewScheduleBackupDefault(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 - } -} - -// NewScheduleBackupOK creates a ScheduleBackupOK with default headers values -func NewScheduleBackupOK() *ScheduleBackupOK { - return &ScheduleBackupOK{} -} - -/* -ScheduleBackupOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type ScheduleBackupOK struct { - Payload *ScheduleBackupOKBody -} - -// IsSuccess returns true when this schedule backup Ok response has a 2xx status code -func (o *ScheduleBackupOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this schedule backup Ok response has a 3xx status code -func (o *ScheduleBackupOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this schedule backup Ok response has a 4xx status code -func (o *ScheduleBackupOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this schedule backup Ok response has a 5xx status code -func (o *ScheduleBackupOK) IsServerError() bool { - return false -} - -// IsCode returns true when this schedule backup Ok response a status code equal to that given -func (o *ScheduleBackupOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the schedule backup Ok response -func (o *ScheduleBackupOK) Code() int { - return 200 -} - -func (o *ScheduleBackupOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/backups:schedule][%d] scheduleBackupOk %s", 200, payload) -} - -func (o *ScheduleBackupOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/backups:schedule][%d] scheduleBackupOk %s", 200, payload) -} - -func (o *ScheduleBackupOK) GetPayload() *ScheduleBackupOKBody { - return o.Payload -} - -func (o *ScheduleBackupOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(ScheduleBackupOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -// NewScheduleBackupDefault creates a ScheduleBackupDefault with default headers values -func NewScheduleBackupDefault(code int) *ScheduleBackupDefault { - return &ScheduleBackupDefault{ - _statusCode: code, - } -} - -/* -ScheduleBackupDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type ScheduleBackupDefault struct { - _statusCode int - - Payload *ScheduleBackupDefaultBody -} - -// IsSuccess returns true when this schedule backup default response has a 2xx status code -func (o *ScheduleBackupDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this schedule backup default response has a 3xx status code -func (o *ScheduleBackupDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this schedule backup default response has a 4xx status code -func (o *ScheduleBackupDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this schedule backup default response has a 5xx status code -func (o *ScheduleBackupDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this schedule backup default response a status code equal to that given -func (o *ScheduleBackupDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the schedule backup default response -func (o *ScheduleBackupDefault) Code() int { - return o._statusCode -} - -func (o *ScheduleBackupDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/backups:schedule][%d] ScheduleBackup default %s", o._statusCode, payload) -} - -func (o *ScheduleBackupDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/backups:schedule][%d] ScheduleBackup default %s", o._statusCode, payload) -} - -func (o *ScheduleBackupDefault) GetPayload() *ScheduleBackupDefaultBody { - return o.Payload -} - -func (o *ScheduleBackupDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(ScheduleBackupDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -ScheduleBackupBody schedule backup body -swagger:model ScheduleBackupBody -*/ -type ScheduleBackupBody struct { - // Service identifier where backup should be performed. - ServiceID string `json:"service_id,omitempty"` - - // Machine-readable location ID. - LocationID string `json:"location_id,omitempty"` - - // How often backup should be run in cron format. - // Folder on storage for artifact. - Folder string `json:"folder,omitempty"` - - // cron expression - CronExpression string `json:"cron_expression,omitempty"` - - // First backup wouldn't happen before this time. - // Format: date-time - StartTime strfmt.DateTime `json:"start_time,omitempty"` - - // Name of backup. - Name string `json:"name,omitempty"` - - // Human-readable description. - Description string `json:"description,omitempty"` - - // If scheduling is enabled. - Enabled bool `json:"enabled,omitempty"` - - // How many times to retry a failed backup before giving up. - Retries int64 `json:"retries,omitempty"` - - // Delay between each retry. Should have a suffix in JSON: 1s, 1m, 1h. - RetryInterval string `json:"retry_interval,omitempty"` - - // BackupMode specifies backup mode. - // Enum: ["BACKUP_MODE_UNSPECIFIED","BACKUP_MODE_SNAPSHOT","BACKUP_MODE_INCREMENTAL","BACKUP_MODE_PITR"] - Mode *string `json:"mode,omitempty"` - - // DataModel is a model used for performing a backup. - // Enum: ["DATA_MODEL_UNSPECIFIED","DATA_MODEL_PHYSICAL","DATA_MODEL_LOGICAL"] - DataModel *string `json:"data_model,omitempty"` - - // How many artifacts keep. 0 - unlimited. - Retention int64 `json:"retention,omitempty"` -} - -// Validate validates this schedule backup body -func (o *ScheduleBackupBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateStartTime(formats); err != nil { - res = append(res, err) - } - - if err := o.validateMode(formats); err != nil { - res = append(res, err) - } - - if err := o.validateDataModel(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ScheduleBackupBody) validateStartTime(formats strfmt.Registry) error { - if swag.IsZero(o.StartTime) { // not required - return nil - } - - if err := validate.FormatOf("body"+"."+"start_time", "body", "date-time", o.StartTime.String(), formats); err != nil { - return err - } - - return nil -} - -var scheduleBackupBodyTypeModePropEnum []any - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["BACKUP_MODE_UNSPECIFIED","BACKUP_MODE_SNAPSHOT","BACKUP_MODE_INCREMENTAL","BACKUP_MODE_PITR"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - scheduleBackupBodyTypeModePropEnum = append(scheduleBackupBodyTypeModePropEnum, v) - } -} - -const ( - - // ScheduleBackupBodyModeBACKUPMODEUNSPECIFIED captures enum value "BACKUP_MODE_UNSPECIFIED" - ScheduleBackupBodyModeBACKUPMODEUNSPECIFIED string = "BACKUP_MODE_UNSPECIFIED" - - // ScheduleBackupBodyModeBACKUPMODESNAPSHOT captures enum value "BACKUP_MODE_SNAPSHOT" - ScheduleBackupBodyModeBACKUPMODESNAPSHOT string = "BACKUP_MODE_SNAPSHOT" - - // ScheduleBackupBodyModeBACKUPMODEINCREMENTAL captures enum value "BACKUP_MODE_INCREMENTAL" - ScheduleBackupBodyModeBACKUPMODEINCREMENTAL string = "BACKUP_MODE_INCREMENTAL" - - // ScheduleBackupBodyModeBACKUPMODEPITR captures enum value "BACKUP_MODE_PITR" - ScheduleBackupBodyModeBACKUPMODEPITR string = "BACKUP_MODE_PITR" -) - -// prop value enum -func (o *ScheduleBackupBody) validateModeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, scheduleBackupBodyTypeModePropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ScheduleBackupBody) validateMode(formats strfmt.Registry) error { - if swag.IsZero(o.Mode) { // not required - return nil - } - - // value enum - if err := o.validateModeEnum("body"+"."+"mode", "body", *o.Mode); err != nil { - return err - } - - return nil -} - -var scheduleBackupBodyTypeDataModelPropEnum []any - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["DATA_MODEL_UNSPECIFIED","DATA_MODEL_PHYSICAL","DATA_MODEL_LOGICAL"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - scheduleBackupBodyTypeDataModelPropEnum = append(scheduleBackupBodyTypeDataModelPropEnum, v) - } -} - -const ( - - // ScheduleBackupBodyDataModelDATAMODELUNSPECIFIED captures enum value "DATA_MODEL_UNSPECIFIED" - ScheduleBackupBodyDataModelDATAMODELUNSPECIFIED string = "DATA_MODEL_UNSPECIFIED" - - // ScheduleBackupBodyDataModelDATAMODELPHYSICAL captures enum value "DATA_MODEL_PHYSICAL" - ScheduleBackupBodyDataModelDATAMODELPHYSICAL string = "DATA_MODEL_PHYSICAL" - - // ScheduleBackupBodyDataModelDATAMODELLOGICAL captures enum value "DATA_MODEL_LOGICAL" - ScheduleBackupBodyDataModelDATAMODELLOGICAL string = "DATA_MODEL_LOGICAL" -) - -// prop value enum -func (o *ScheduleBackupBody) validateDataModelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, scheduleBackupBodyTypeDataModelPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ScheduleBackupBody) validateDataModel(formats strfmt.Registry) error { - if swag.IsZero(o.DataModel) { // not required - return nil - } - - // value enum - if err := o.validateDataModelEnum("body"+"."+"data_model", "body", *o.DataModel); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this schedule backup body based on context it is used -func (o *ScheduleBackupBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ScheduleBackupBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ScheduleBackupBody) UnmarshalBinary(b []byte) error { - var res ScheduleBackupBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ScheduleBackupDefaultBody schedule backup default body -swagger:model ScheduleBackupDefaultBody -*/ -type ScheduleBackupDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*ScheduleBackupDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this schedule backup default body -func (o *ScheduleBackupDefaultBody) 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 *ScheduleBackupDefaultBody) 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("ScheduleBackup default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("ScheduleBackup default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this schedule backup default body based on the context it is used -func (o *ScheduleBackupDefaultBody) 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 *ScheduleBackupDefaultBody) 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("ScheduleBackup default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("ScheduleBackup default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ScheduleBackupDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ScheduleBackupDefaultBody) UnmarshalBinary(b []byte) error { - var res ScheduleBackupDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ScheduleBackupDefaultBodyDetailsItems0 schedule backup default body details items0 -swagger:model ScheduleBackupDefaultBodyDetailsItems0 -*/ -type ScheduleBackupDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` - - // schedule backup default body details items0 - ScheduleBackupDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *ScheduleBackupDefaultBodyDetailsItems0) 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 ScheduleBackupDefaultBodyDetailsItems0 - - 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.ScheduleBackupDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o ScheduleBackupDefaultBodyDetailsItems0) 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.ScheduleBackupDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.ScheduleBackupDefaultBodyDetailsItems0) - 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 schedule backup default body details items0 -func (o *ScheduleBackupDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this schedule backup default body details items0 based on context it is used -func (o *ScheduleBackupDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ScheduleBackupDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ScheduleBackupDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res ScheduleBackupDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ScheduleBackupOKBody schedule backup OK body -swagger:model ScheduleBackupOKBody -*/ -type ScheduleBackupOKBody struct { - // scheduled backup id - ScheduledBackupID string `json:"scheduled_backup_id,omitempty"` -} - -// Validate validates this schedule backup OK body -func (o *ScheduleBackupOKBody) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this schedule backup OK body based on context it is used -func (o *ScheduleBackupOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ScheduleBackupOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ScheduleBackupOKBody) UnmarshalBinary(b []byte) error { - var res ScheduleBackupOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/backup/v1/json/client/backup_service/start_backup_parameters.go b/api/backup/v1/json/client/backup_service/start_backup_parameters.go deleted file mode 100644 index c886e6520d6..00000000000 --- a/api/backup/v1/json/client/backup_service/start_backup_parameters.go +++ /dev/null @@ -1,144 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package backup_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" -) - -// NewStartBackupParams creates a new StartBackupParams 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 NewStartBackupParams() *StartBackupParams { - return &StartBackupParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewStartBackupParamsWithTimeout creates a new StartBackupParams object -// with the ability to set a timeout on a request. -func NewStartBackupParamsWithTimeout(timeout time.Duration) *StartBackupParams { - return &StartBackupParams{ - timeout: timeout, - } -} - -// NewStartBackupParamsWithContext creates a new StartBackupParams object -// with the ability to set a context for a request. -func NewStartBackupParamsWithContext(ctx context.Context) *StartBackupParams { - return &StartBackupParams{ - Context: ctx, - } -} - -// NewStartBackupParamsWithHTTPClient creates a new StartBackupParams object -// with the ability to set a custom HTTPClient for a request. -func NewStartBackupParamsWithHTTPClient(client *http.Client) *StartBackupParams { - return &StartBackupParams{ - HTTPClient: client, - } -} - -/* -StartBackupParams contains all the parameters to send to the API endpoint - - for the start backup operation. - - Typically these are written to a http.Request. -*/ -type StartBackupParams struct { - // Body. - Body StartBackupBody - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the start backup params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *StartBackupParams) WithDefaults() *StartBackupParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the start backup params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *StartBackupParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the start backup params -func (o *StartBackupParams) WithTimeout(timeout time.Duration) *StartBackupParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the start backup params -func (o *StartBackupParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the start backup params -func (o *StartBackupParams) WithContext(ctx context.Context) *StartBackupParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the start backup params -func (o *StartBackupParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the start backup params -func (o *StartBackupParams) WithHTTPClient(client *http.Client) *StartBackupParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the start backup params -func (o *StartBackupParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the start backup params -func (o *StartBackupParams) WithBody(body StartBackupBody) *StartBackupParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the start backup params -func (o *StartBackupParams) SetBody(body StartBackupBody) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *StartBackupParams) 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/backup/v1/json/client/backup_service/start_backup_responses.go b/api/backup/v1/json/client/backup_service/start_backup_responses.go deleted file mode 100644 index 3137ce1bc85..00000000000 --- a/api/backup/v1/json/client/backup_service/start_backup_responses.go +++ /dev/null @@ -1,567 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package backup_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" -) - -// StartBackupReader is a Reader for the StartBackup structure. -type StartBackupReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *StartBackupReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewStartBackupOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewStartBackupDefault(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 - } -} - -// NewStartBackupOK creates a StartBackupOK with default headers values -func NewStartBackupOK() *StartBackupOK { - return &StartBackupOK{} -} - -/* -StartBackupOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type StartBackupOK struct { - Payload *StartBackupOKBody -} - -// IsSuccess returns true when this start backup Ok response has a 2xx status code -func (o *StartBackupOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this start backup Ok response has a 3xx status code -func (o *StartBackupOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this start backup Ok response has a 4xx status code -func (o *StartBackupOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this start backup Ok response has a 5xx status code -func (o *StartBackupOK) IsServerError() bool { - return false -} - -// IsCode returns true when this start backup Ok response a status code equal to that given -func (o *StartBackupOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the start backup Ok response -func (o *StartBackupOK) Code() int { - return 200 -} - -func (o *StartBackupOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/backups:start][%d] startBackupOk %s", 200, payload) -} - -func (o *StartBackupOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/backups:start][%d] startBackupOk %s", 200, payload) -} - -func (o *StartBackupOK) GetPayload() *StartBackupOKBody { - return o.Payload -} - -func (o *StartBackupOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(StartBackupOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -// NewStartBackupDefault creates a StartBackupDefault with default headers values -func NewStartBackupDefault(code int) *StartBackupDefault { - return &StartBackupDefault{ - _statusCode: code, - } -} - -/* -StartBackupDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type StartBackupDefault struct { - _statusCode int - - Payload *StartBackupDefaultBody -} - -// IsSuccess returns true when this start backup default response has a 2xx status code -func (o *StartBackupDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this start backup default response has a 3xx status code -func (o *StartBackupDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this start backup default response has a 4xx status code -func (o *StartBackupDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this start backup default response has a 5xx status code -func (o *StartBackupDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this start backup default response a status code equal to that given -func (o *StartBackupDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the start backup default response -func (o *StartBackupDefault) Code() int { - return o._statusCode -} - -func (o *StartBackupDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/backups:start][%d] StartBackup default %s", o._statusCode, payload) -} - -func (o *StartBackupDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/backups:start][%d] StartBackup default %s", o._statusCode, payload) -} - -func (o *StartBackupDefault) GetPayload() *StartBackupDefaultBody { - return o.Payload -} - -func (o *StartBackupDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(StartBackupDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -StartBackupBody start backup body -swagger:model StartBackupBody -*/ -type StartBackupBody struct { - // Service identifier. - ServiceID string `json:"service_id,omitempty"` - - // Machine-readable location ID. - LocationID string `json:"location_id,omitempty"` - - // If empty then name is auto-generated. - Name string `json:"name,omitempty"` - - // Human-readable description. - Description string `json:"description,omitempty"` - - // Delay between each retry. Should have a suffix in JSON: 1s, 1m, 1h. - RetryInterval string `json:"retry_interval,omitempty"` - - // How many times to retry a failed backup before giving up. - Retries int64 `json:"retries,omitempty"` - - // DataModel is a model used for performing a backup. - // Enum: ["DATA_MODEL_UNSPECIFIED","DATA_MODEL_PHYSICAL","DATA_MODEL_LOGICAL"] - DataModel *string `json:"data_model,omitempty"` - - // Folder on storage for artifact. - Folder string `json:"folder,omitempty"` -} - -// Validate validates this start backup body -func (o *StartBackupBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateDataModel(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var startBackupBodyTypeDataModelPropEnum []any - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["DATA_MODEL_UNSPECIFIED","DATA_MODEL_PHYSICAL","DATA_MODEL_LOGICAL"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - startBackupBodyTypeDataModelPropEnum = append(startBackupBodyTypeDataModelPropEnum, v) - } -} - -const ( - - // StartBackupBodyDataModelDATAMODELUNSPECIFIED captures enum value "DATA_MODEL_UNSPECIFIED" - StartBackupBodyDataModelDATAMODELUNSPECIFIED string = "DATA_MODEL_UNSPECIFIED" - - // StartBackupBodyDataModelDATAMODELPHYSICAL captures enum value "DATA_MODEL_PHYSICAL" - StartBackupBodyDataModelDATAMODELPHYSICAL string = "DATA_MODEL_PHYSICAL" - - // StartBackupBodyDataModelDATAMODELLOGICAL captures enum value "DATA_MODEL_LOGICAL" - StartBackupBodyDataModelDATAMODELLOGICAL string = "DATA_MODEL_LOGICAL" -) - -// prop value enum -func (o *StartBackupBody) validateDataModelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, startBackupBodyTypeDataModelPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *StartBackupBody) validateDataModel(formats strfmt.Registry) error { - if swag.IsZero(o.DataModel) { // not required - return nil - } - - // value enum - if err := o.validateDataModelEnum("body"+"."+"data_model", "body", *o.DataModel); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this start backup body based on context it is used -func (o *StartBackupBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *StartBackupBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *StartBackupBody) UnmarshalBinary(b []byte) error { - var res StartBackupBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -StartBackupDefaultBody start backup default body -swagger:model StartBackupDefaultBody -*/ -type StartBackupDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*StartBackupDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this start backup default body -func (o *StartBackupDefaultBody) 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 *StartBackupDefaultBody) 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("StartBackup default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("StartBackup default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this start backup default body based on the context it is used -func (o *StartBackupDefaultBody) 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 *StartBackupDefaultBody) 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("StartBackup default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("StartBackup default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *StartBackupDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *StartBackupDefaultBody) UnmarshalBinary(b []byte) error { - var res StartBackupDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -StartBackupDefaultBodyDetailsItems0 start backup default body details items0 -swagger:model StartBackupDefaultBodyDetailsItems0 -*/ -type StartBackupDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` - - // start backup default body details items0 - StartBackupDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *StartBackupDefaultBodyDetailsItems0) 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 StartBackupDefaultBodyDetailsItems0 - - 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.StartBackupDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o StartBackupDefaultBodyDetailsItems0) 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.StartBackupDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.StartBackupDefaultBodyDetailsItems0) - 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 start backup default body details items0 -func (o *StartBackupDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this start backup default body details items0 based on context it is used -func (o *StartBackupDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *StartBackupDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *StartBackupDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res StartBackupDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -StartBackupOKBody start backup OK body -swagger:model StartBackupOKBody -*/ -type StartBackupOKBody struct { - // Unique identifier. - ArtifactID string `json:"artifact_id,omitempty"` -} - -// Validate validates this start backup OK body -func (o *StartBackupOKBody) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this start backup OK body based on context it is used -func (o *StartBackupOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *StartBackupOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *StartBackupOKBody) UnmarshalBinary(b []byte) error { - var res StartBackupOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/backup/v1/json/client/locations_service/add_location_parameters.go b/api/backup/v1/json/client/locations_service/add_location_parameters.go deleted file mode 100644 index a6fe1c12370..00000000000 --- a/api/backup/v1/json/client/locations_service/add_location_parameters.go +++ /dev/null @@ -1,144 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package locations_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" -) - -// NewAddLocationParams creates a new AddLocationParams 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 NewAddLocationParams() *AddLocationParams { - return &AddLocationParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewAddLocationParamsWithTimeout creates a new AddLocationParams object -// with the ability to set a timeout on a request. -func NewAddLocationParamsWithTimeout(timeout time.Duration) *AddLocationParams { - return &AddLocationParams{ - timeout: timeout, - } -} - -// NewAddLocationParamsWithContext creates a new AddLocationParams object -// with the ability to set a context for a request. -func NewAddLocationParamsWithContext(ctx context.Context) *AddLocationParams { - return &AddLocationParams{ - Context: ctx, - } -} - -// NewAddLocationParamsWithHTTPClient creates a new AddLocationParams object -// with the ability to set a custom HTTPClient for a request. -func NewAddLocationParamsWithHTTPClient(client *http.Client) *AddLocationParams { - return &AddLocationParams{ - HTTPClient: client, - } -} - -/* -AddLocationParams contains all the parameters to send to the API endpoint - - for the add location operation. - - Typically these are written to a http.Request. -*/ -type AddLocationParams struct { - // Body. - Body AddLocationBody - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the add location params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *AddLocationParams) WithDefaults() *AddLocationParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the add location params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *AddLocationParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the add location params -func (o *AddLocationParams) WithTimeout(timeout time.Duration) *AddLocationParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the add location params -func (o *AddLocationParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the add location params -func (o *AddLocationParams) WithContext(ctx context.Context) *AddLocationParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the add location params -func (o *AddLocationParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the add location params -func (o *AddLocationParams) WithHTTPClient(client *http.Client) *AddLocationParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the add location params -func (o *AddLocationParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the add location params -func (o *AddLocationParams) WithBody(body AddLocationBody) *AddLocationParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the add location params -func (o *AddLocationParams) SetBody(body AddLocationBody) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *AddLocationParams) 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/backup/v1/json/client/locations_service/add_location_responses.go b/api/backup/v1/json/client/locations_service/add_location_responses.go deleted file mode 100644 index fc373eed126..00000000000 --- a/api/backup/v1/json/client/locations_service/add_location_responses.go +++ /dev/null @@ -1,702 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package locations_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" -) - -// AddLocationReader is a Reader for the AddLocation structure. -type AddLocationReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *AddLocationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewAddLocationOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewAddLocationDefault(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 - } -} - -// NewAddLocationOK creates a AddLocationOK with default headers values -func NewAddLocationOK() *AddLocationOK { - return &AddLocationOK{} -} - -/* -AddLocationOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type AddLocationOK struct { - Payload *AddLocationOKBody -} - -// IsSuccess returns true when this add location Ok response has a 2xx status code -func (o *AddLocationOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this add location Ok response has a 3xx status code -func (o *AddLocationOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this add location Ok response has a 4xx status code -func (o *AddLocationOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this add location Ok response has a 5xx status code -func (o *AddLocationOK) IsServerError() bool { - return false -} - -// IsCode returns true when this add location Ok response a status code equal to that given -func (o *AddLocationOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the add location Ok response -func (o *AddLocationOK) Code() int { - return 200 -} - -func (o *AddLocationOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/backups/locations][%d] addLocationOk %s", 200, payload) -} - -func (o *AddLocationOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/backups/locations][%d] addLocationOk %s", 200, payload) -} - -func (o *AddLocationOK) GetPayload() *AddLocationOKBody { - return o.Payload -} - -func (o *AddLocationOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(AddLocationOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -// NewAddLocationDefault creates a AddLocationDefault with default headers values -func NewAddLocationDefault(code int) *AddLocationDefault { - return &AddLocationDefault{ - _statusCode: code, - } -} - -/* -AddLocationDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type AddLocationDefault struct { - _statusCode int - - Payload *AddLocationDefaultBody -} - -// IsSuccess returns true when this add location default response has a 2xx status code -func (o *AddLocationDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this add location default response has a 3xx status code -func (o *AddLocationDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this add location default response has a 4xx status code -func (o *AddLocationDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this add location default response has a 5xx status code -func (o *AddLocationDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this add location default response a status code equal to that given -func (o *AddLocationDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the add location default response -func (o *AddLocationDefault) Code() int { - return o._statusCode -} - -func (o *AddLocationDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/backups/locations][%d] AddLocation default %s", o._statusCode, payload) -} - -func (o *AddLocationDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/backups/locations][%d] AddLocation default %s", o._statusCode, payload) -} - -func (o *AddLocationDefault) GetPayload() *AddLocationDefaultBody { - return o.Payload -} - -func (o *AddLocationDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(AddLocationDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -AddLocationBody add location body -swagger:model AddLocationBody -*/ -type AddLocationBody struct { - // Location name - Name string `json:"name,omitempty"` - - // description - Description string `json:"description,omitempty"` - - // filesystem config - FilesystemConfig *AddLocationParamsBodyFilesystemConfig `json:"filesystem_config,omitempty"` - - // s3 config - S3Config *AddLocationParamsBodyS3Config `json:"s3_config,omitempty"` -} - -// Validate validates this add location body -func (o *AddLocationBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateFilesystemConfig(formats); err != nil { - res = append(res, err) - } - - if err := o.validateS3Config(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *AddLocationBody) validateFilesystemConfig(formats strfmt.Registry) error { - if swag.IsZero(o.FilesystemConfig) { // not required - return nil - } - - if o.FilesystemConfig != nil { - if err := o.FilesystemConfig.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "filesystem_config") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "filesystem_config") - } - - return err - } - } - - return nil -} - -func (o *AddLocationBody) validateS3Config(formats strfmt.Registry) error { - if swag.IsZero(o.S3Config) { // not required - return nil - } - - if o.S3Config != nil { - if err := o.S3Config.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "s3_config") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "s3_config") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this add location body based on the context it is used -func (o *AddLocationBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateFilesystemConfig(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateS3Config(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *AddLocationBody) contextValidateFilesystemConfig(ctx context.Context, formats strfmt.Registry) error { - if o.FilesystemConfig != nil { - - if swag.IsZero(o.FilesystemConfig) { // not required - return nil - } - - if err := o.FilesystemConfig.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "filesystem_config") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "filesystem_config") - } - - return err - } - } - - return nil -} - -func (o *AddLocationBody) contextValidateS3Config(ctx context.Context, formats strfmt.Registry) error { - if o.S3Config != nil { - - if swag.IsZero(o.S3Config) { // not required - return nil - } - - if err := o.S3Config.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "s3_config") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "s3_config") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *AddLocationBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddLocationBody) UnmarshalBinary(b []byte) error { - var res AddLocationBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddLocationDefaultBody add location default body -swagger:model AddLocationDefaultBody -*/ -type AddLocationDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*AddLocationDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this add location default body -func (o *AddLocationDefaultBody) 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 *AddLocationDefaultBody) 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("AddLocation default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("AddLocation default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this add location default body based on the context it is used -func (o *AddLocationDefaultBody) 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 *AddLocationDefaultBody) 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("AddLocation default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("AddLocation default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *AddLocationDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddLocationDefaultBody) UnmarshalBinary(b []byte) error { - var res AddLocationDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddLocationDefaultBodyDetailsItems0 add location default body details items0 -swagger:model AddLocationDefaultBodyDetailsItems0 -*/ -type AddLocationDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` - - // add location default body details items0 - AddLocationDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *AddLocationDefaultBodyDetailsItems0) 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 AddLocationDefaultBodyDetailsItems0 - - 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.AddLocationDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o AddLocationDefaultBodyDetailsItems0) 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.AddLocationDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.AddLocationDefaultBodyDetailsItems0) - 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 add location default body details items0 -func (o *AddLocationDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this add location default body details items0 based on context it is used -func (o *AddLocationDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddLocationDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddLocationDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res AddLocationDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddLocationOKBody add location OK body -swagger:model AddLocationOKBody -*/ -type AddLocationOKBody struct { - // Machine-readable ID. - LocationID string `json:"location_id,omitempty"` -} - -// Validate validates this add location OK body -func (o *AddLocationOKBody) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this add location OK body based on context it is used -func (o *AddLocationOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddLocationOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddLocationOKBody) UnmarshalBinary(b []byte) error { - var res AddLocationOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddLocationParamsBodyFilesystemConfig FilesystemLocationConfig represents file system location config. -swagger:model AddLocationParamsBodyFilesystemConfig -*/ -type AddLocationParamsBodyFilesystemConfig struct { - // path - Path string `json:"path,omitempty"` -} - -// Validate validates this add location params body filesystem config -func (o *AddLocationParamsBodyFilesystemConfig) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this add location params body filesystem config based on context it is used -func (o *AddLocationParamsBodyFilesystemConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddLocationParamsBodyFilesystemConfig) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddLocationParamsBodyFilesystemConfig) UnmarshalBinary(b []byte) error { - var res AddLocationParamsBodyFilesystemConfig - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddLocationParamsBodyS3Config S3LocationConfig represents S3 bucket configuration. -swagger:model AddLocationParamsBodyS3Config -*/ -type AddLocationParamsBodyS3Config struct { - // endpoint - Endpoint string `json:"endpoint,omitempty"` - - // access key - AccessKey string `json:"access_key,omitempty"` - - // secret key - SecretKey string `json:"secret_key,omitempty"` - - // bucket name - BucketName string `json:"bucket_name,omitempty"` -} - -// Validate validates this add location params body s3 config -func (o *AddLocationParamsBodyS3Config) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this add location params body s3 config based on context it is used -func (o *AddLocationParamsBodyS3Config) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddLocationParamsBodyS3Config) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddLocationParamsBodyS3Config) UnmarshalBinary(b []byte) error { - var res AddLocationParamsBodyS3Config - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/backup/v1/json/client/locations_service/change_location_parameters.go b/api/backup/v1/json/client/locations_service/change_location_parameters.go deleted file mode 100644 index 1b0e5bef6b0..00000000000 --- a/api/backup/v1/json/client/locations_service/change_location_parameters.go +++ /dev/null @@ -1,166 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package locations_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" -) - -// NewChangeLocationParams creates a new ChangeLocationParams 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 NewChangeLocationParams() *ChangeLocationParams { - return &ChangeLocationParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewChangeLocationParamsWithTimeout creates a new ChangeLocationParams object -// with the ability to set a timeout on a request. -func NewChangeLocationParamsWithTimeout(timeout time.Duration) *ChangeLocationParams { - return &ChangeLocationParams{ - timeout: timeout, - } -} - -// NewChangeLocationParamsWithContext creates a new ChangeLocationParams object -// with the ability to set a context for a request. -func NewChangeLocationParamsWithContext(ctx context.Context) *ChangeLocationParams { - return &ChangeLocationParams{ - Context: ctx, - } -} - -// NewChangeLocationParamsWithHTTPClient creates a new ChangeLocationParams object -// with the ability to set a custom HTTPClient for a request. -func NewChangeLocationParamsWithHTTPClient(client *http.Client) *ChangeLocationParams { - return &ChangeLocationParams{ - HTTPClient: client, - } -} - -/* -ChangeLocationParams contains all the parameters to send to the API endpoint - - for the change location operation. - - Typically these are written to a http.Request. -*/ -type ChangeLocationParams struct { - // Body. - Body ChangeLocationBody - - /* LocationID. - - Machine-readable ID. - */ - LocationID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the change location params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ChangeLocationParams) WithDefaults() *ChangeLocationParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the change location params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ChangeLocationParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the change location params -func (o *ChangeLocationParams) WithTimeout(timeout time.Duration) *ChangeLocationParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the change location params -func (o *ChangeLocationParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the change location params -func (o *ChangeLocationParams) WithContext(ctx context.Context) *ChangeLocationParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the change location params -func (o *ChangeLocationParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the change location params -func (o *ChangeLocationParams) WithHTTPClient(client *http.Client) *ChangeLocationParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the change location params -func (o *ChangeLocationParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the change location params -func (o *ChangeLocationParams) WithBody(body ChangeLocationBody) *ChangeLocationParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the change location params -func (o *ChangeLocationParams) SetBody(body ChangeLocationBody) { - o.Body = body -} - -// WithLocationID adds the locationID to the change location params -func (o *ChangeLocationParams) WithLocationID(locationID string) *ChangeLocationParams { - o.SetLocationID(locationID) - return o -} - -// SetLocationID adds the locationId to the change location params -func (o *ChangeLocationParams) SetLocationID(locationID string) { - o.LocationID = locationID -} - -// WriteToRequest writes these params to a swagger request -func (o *ChangeLocationParams) 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 - } - - // path param location_id - if err := r.SetPathParam("location_id", o.LocationID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/api/backup/v1/json/client/locations_service/change_location_responses.go b/api/backup/v1/json/client/locations_service/change_location_responses.go deleted file mode 100644 index 54f0b55f31b..00000000000 --- a/api/backup/v1/json/client/locations_service/change_location_responses.go +++ /dev/null @@ -1,663 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package locations_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" -) - -// ChangeLocationReader is a Reader for the ChangeLocation structure. -type ChangeLocationReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ChangeLocationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewChangeLocationOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewChangeLocationDefault(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 - } -} - -// NewChangeLocationOK creates a ChangeLocationOK with default headers values -func NewChangeLocationOK() *ChangeLocationOK { - return &ChangeLocationOK{} -} - -/* -ChangeLocationOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type ChangeLocationOK struct { - Payload any -} - -// IsSuccess returns true when this change location Ok response has a 2xx status code -func (o *ChangeLocationOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this change location Ok response has a 3xx status code -func (o *ChangeLocationOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this change location Ok response has a 4xx status code -func (o *ChangeLocationOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this change location Ok response has a 5xx status code -func (o *ChangeLocationOK) IsServerError() bool { - return false -} - -// IsCode returns true when this change location Ok response a status code equal to that given -func (o *ChangeLocationOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the change location Ok response -func (o *ChangeLocationOK) Code() int { - return 200 -} - -func (o *ChangeLocationOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/backups/locations/{location_id}][%d] changeLocationOk %s", 200, payload) -} - -func (o *ChangeLocationOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/backups/locations/{location_id}][%d] changeLocationOk %s", 200, payload) -} - -func (o *ChangeLocationOK) GetPayload() any { - return o.Payload -} - -func (o *ChangeLocationOK) 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) { - return err - } - - return nil -} - -// NewChangeLocationDefault creates a ChangeLocationDefault with default headers values -func NewChangeLocationDefault(code int) *ChangeLocationDefault { - return &ChangeLocationDefault{ - _statusCode: code, - } -} - -/* -ChangeLocationDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type ChangeLocationDefault struct { - _statusCode int - - Payload *ChangeLocationDefaultBody -} - -// IsSuccess returns true when this change location default response has a 2xx status code -func (o *ChangeLocationDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this change location default response has a 3xx status code -func (o *ChangeLocationDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this change location default response has a 4xx status code -func (o *ChangeLocationDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this change location default response has a 5xx status code -func (o *ChangeLocationDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this change location default response a status code equal to that given -func (o *ChangeLocationDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the change location default response -func (o *ChangeLocationDefault) Code() int { - return o._statusCode -} - -func (o *ChangeLocationDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/backups/locations/{location_id}][%d] ChangeLocation default %s", o._statusCode, payload) -} - -func (o *ChangeLocationDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/backups/locations/{location_id}][%d] ChangeLocation default %s", o._statusCode, payload) -} - -func (o *ChangeLocationDefault) GetPayload() *ChangeLocationDefaultBody { - return o.Payload -} - -func (o *ChangeLocationDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(ChangeLocationDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -ChangeLocationBody change location body -swagger:model ChangeLocationBody -*/ -type ChangeLocationBody struct { - // Location name - Name string `json:"name,omitempty"` - - // description - Description string `json:"description,omitempty"` - - // filesystem config - FilesystemConfig *ChangeLocationParamsBodyFilesystemConfig `json:"filesystem_config,omitempty"` - - // s3 config - S3Config *ChangeLocationParamsBodyS3Config `json:"s3_config,omitempty"` -} - -// Validate validates this change location body -func (o *ChangeLocationBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateFilesystemConfig(formats); err != nil { - res = append(res, err) - } - - if err := o.validateS3Config(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ChangeLocationBody) validateFilesystemConfig(formats strfmt.Registry) error { - if swag.IsZero(o.FilesystemConfig) { // not required - return nil - } - - if o.FilesystemConfig != nil { - if err := o.FilesystemConfig.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "filesystem_config") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "filesystem_config") - } - - return err - } - } - - return nil -} - -func (o *ChangeLocationBody) validateS3Config(formats strfmt.Registry) error { - if swag.IsZero(o.S3Config) { // not required - return nil - } - - if o.S3Config != nil { - if err := o.S3Config.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "s3_config") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "s3_config") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this change location body based on the context it is used -func (o *ChangeLocationBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateFilesystemConfig(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateS3Config(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ChangeLocationBody) contextValidateFilesystemConfig(ctx context.Context, formats strfmt.Registry) error { - if o.FilesystemConfig != nil { - - if swag.IsZero(o.FilesystemConfig) { // not required - return nil - } - - if err := o.FilesystemConfig.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "filesystem_config") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "filesystem_config") - } - - return err - } - } - - return nil -} - -func (o *ChangeLocationBody) contextValidateS3Config(ctx context.Context, formats strfmt.Registry) error { - if o.S3Config != nil { - - if swag.IsZero(o.S3Config) { // not required - return nil - } - - if err := o.S3Config.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "s3_config") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "s3_config") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeLocationBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeLocationBody) UnmarshalBinary(b []byte) error { - var res ChangeLocationBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeLocationDefaultBody change location default body -swagger:model ChangeLocationDefaultBody -*/ -type ChangeLocationDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*ChangeLocationDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this change location default body -func (o *ChangeLocationDefaultBody) 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 *ChangeLocationDefaultBody) 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("ChangeLocation default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("ChangeLocation default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this change location default body based on the context it is used -func (o *ChangeLocationDefaultBody) 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 *ChangeLocationDefaultBody) 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("ChangeLocation default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("ChangeLocation default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeLocationDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeLocationDefaultBody) UnmarshalBinary(b []byte) error { - var res ChangeLocationDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeLocationDefaultBodyDetailsItems0 change location default body details items0 -swagger:model ChangeLocationDefaultBodyDetailsItems0 -*/ -type ChangeLocationDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` - - // change location default body details items0 - ChangeLocationDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *ChangeLocationDefaultBodyDetailsItems0) 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 ChangeLocationDefaultBodyDetailsItems0 - - 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.ChangeLocationDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o ChangeLocationDefaultBodyDetailsItems0) 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.ChangeLocationDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.ChangeLocationDefaultBodyDetailsItems0) - 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 change location default body details items0 -func (o *ChangeLocationDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this change location default body details items0 based on context it is used -func (o *ChangeLocationDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeLocationDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeLocationDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res ChangeLocationDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeLocationParamsBodyFilesystemConfig FilesystemLocationConfig represents file system location config. -swagger:model ChangeLocationParamsBodyFilesystemConfig -*/ -type ChangeLocationParamsBodyFilesystemConfig struct { - // path - Path string `json:"path,omitempty"` -} - -// Validate validates this change location params body filesystem config -func (o *ChangeLocationParamsBodyFilesystemConfig) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this change location params body filesystem config based on context it is used -func (o *ChangeLocationParamsBodyFilesystemConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeLocationParamsBodyFilesystemConfig) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeLocationParamsBodyFilesystemConfig) UnmarshalBinary(b []byte) error { - var res ChangeLocationParamsBodyFilesystemConfig - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeLocationParamsBodyS3Config S3LocationConfig represents S3 bucket configuration. -swagger:model ChangeLocationParamsBodyS3Config -*/ -type ChangeLocationParamsBodyS3Config struct { - // endpoint - Endpoint string `json:"endpoint,omitempty"` - - // access key - AccessKey string `json:"access_key,omitempty"` - - // secret key - SecretKey string `json:"secret_key,omitempty"` - - // bucket name - BucketName string `json:"bucket_name,omitempty"` -} - -// Validate validates this change location params body s3 config -func (o *ChangeLocationParamsBodyS3Config) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this change location params body s3 config based on context it is used -func (o *ChangeLocationParamsBodyS3Config) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeLocationParamsBodyS3Config) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeLocationParamsBodyS3Config) UnmarshalBinary(b []byte) error { - var res ChangeLocationParamsBodyS3Config - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/backup/v1/json/client/locations_service/list_locations_parameters.go b/api/backup/v1/json/client/locations_service/list_locations_parameters.go deleted file mode 100644 index 263117d982d..00000000000 --- a/api/backup/v1/json/client/locations_service/list_locations_parameters.go +++ /dev/null @@ -1,127 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package locations_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" -) - -// NewListLocationsParams creates a new ListLocationsParams 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 NewListLocationsParams() *ListLocationsParams { - return &ListLocationsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListLocationsParamsWithTimeout creates a new ListLocationsParams object -// with the ability to set a timeout on a request. -func NewListLocationsParamsWithTimeout(timeout time.Duration) *ListLocationsParams { - return &ListLocationsParams{ - timeout: timeout, - } -} - -// NewListLocationsParamsWithContext creates a new ListLocationsParams object -// with the ability to set a context for a request. -func NewListLocationsParamsWithContext(ctx context.Context) *ListLocationsParams { - return &ListLocationsParams{ - Context: ctx, - } -} - -// NewListLocationsParamsWithHTTPClient creates a new ListLocationsParams object -// with the ability to set a custom HTTPClient for a request. -func NewListLocationsParamsWithHTTPClient(client *http.Client) *ListLocationsParams { - return &ListLocationsParams{ - HTTPClient: client, - } -} - -/* -ListLocationsParams contains all the parameters to send to the API endpoint - - for the list locations operation. - - Typically these are written to a http.Request. -*/ -type ListLocationsParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list locations params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListLocationsParams) WithDefaults() *ListLocationsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list locations params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListLocationsParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list locations params -func (o *ListLocationsParams) WithTimeout(timeout time.Duration) *ListLocationsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list locations params -func (o *ListLocationsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list locations params -func (o *ListLocationsParams) WithContext(ctx context.Context) *ListLocationsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list locations params -func (o *ListLocationsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list locations params -func (o *ListLocationsParams) WithHTTPClient(client *http.Client) *ListLocationsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list locations params -func (o *ListLocationsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *ListLocationsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/api/backup/v1/json/client/locations_service/list_locations_responses.go b/api/backup/v1/json/client/locations_service/list_locations_responses.go deleted file mode 100644 index 8d799fec0df..00000000000 --- a/api/backup/v1/json/client/locations_service/list_locations_responses.go +++ /dev/null @@ -1,779 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package locations_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" -) - -// ListLocationsReader is a Reader for the ListLocations structure. -type ListLocationsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListLocationsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewListLocationsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewListLocationsDefault(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 - } -} - -// NewListLocationsOK creates a ListLocationsOK with default headers values -func NewListLocationsOK() *ListLocationsOK { - return &ListLocationsOK{} -} - -/* -ListLocationsOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type ListLocationsOK struct { - Payload *ListLocationsOKBody -} - -// IsSuccess returns true when this list locations Ok response has a 2xx status code -func (o *ListLocationsOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this list locations Ok response has a 3xx status code -func (o *ListLocationsOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this list locations Ok response has a 4xx status code -func (o *ListLocationsOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this list locations Ok response has a 5xx status code -func (o *ListLocationsOK) IsServerError() bool { - return false -} - -// IsCode returns true when this list locations Ok response a status code equal to that given -func (o *ListLocationsOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the list locations Ok response -func (o *ListLocationsOK) Code() int { - return 200 -} - -func (o *ListLocationsOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/backups/locations][%d] listLocationsOk %s", 200, payload) -} - -func (o *ListLocationsOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/backups/locations][%d] listLocationsOk %s", 200, payload) -} - -func (o *ListLocationsOK) GetPayload() *ListLocationsOKBody { - return o.Payload -} - -func (o *ListLocationsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(ListLocationsOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -// NewListLocationsDefault creates a ListLocationsDefault with default headers values -func NewListLocationsDefault(code int) *ListLocationsDefault { - return &ListLocationsDefault{ - _statusCode: code, - } -} - -/* -ListLocationsDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type ListLocationsDefault struct { - _statusCode int - - Payload *ListLocationsDefaultBody -} - -// IsSuccess returns true when this list locations default response has a 2xx status code -func (o *ListLocationsDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this list locations default response has a 3xx status code -func (o *ListLocationsDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this list locations default response has a 4xx status code -func (o *ListLocationsDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this list locations default response has a 5xx status code -func (o *ListLocationsDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this list locations default response a status code equal to that given -func (o *ListLocationsDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the list locations default response -func (o *ListLocationsDefault) Code() int { - return o._statusCode -} - -func (o *ListLocationsDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/backups/locations][%d] ListLocations default %s", o._statusCode, payload) -} - -func (o *ListLocationsDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/backups/locations][%d] ListLocations default %s", o._statusCode, payload) -} - -func (o *ListLocationsDefault) GetPayload() *ListLocationsDefaultBody { - return o.Payload -} - -func (o *ListLocationsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(ListLocationsDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -ListLocationsDefaultBody list locations default body -swagger:model ListLocationsDefaultBody -*/ -type ListLocationsDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*ListLocationsDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this list locations default body -func (o *ListLocationsDefaultBody) 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 *ListLocationsDefaultBody) 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("ListLocations default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("ListLocations default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this list locations default body based on the context it is used -func (o *ListLocationsDefaultBody) 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 *ListLocationsDefaultBody) 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("ListLocations default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("ListLocations default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListLocationsDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListLocationsDefaultBody) UnmarshalBinary(b []byte) error { - var res ListLocationsDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListLocationsDefaultBodyDetailsItems0 list locations default body details items0 -swagger:model ListLocationsDefaultBodyDetailsItems0 -*/ -type ListLocationsDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` - - // list locations default body details items0 - ListLocationsDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *ListLocationsDefaultBodyDetailsItems0) 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 ListLocationsDefaultBodyDetailsItems0 - - 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.ListLocationsDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o ListLocationsDefaultBodyDetailsItems0) 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.ListLocationsDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.ListLocationsDefaultBodyDetailsItems0) - 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 list locations default body details items0 -func (o *ListLocationsDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list locations default body details items0 based on context it is used -func (o *ListLocationsDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListLocationsDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListLocationsDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res ListLocationsDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListLocationsOKBody list locations OK body -swagger:model ListLocationsOKBody -*/ -type ListLocationsOKBody struct { - // locations - Locations []*ListLocationsOKBodyLocationsItems0 `json:"locations"` -} - -// Validate validates this list locations OK body -func (o *ListLocationsOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateLocations(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListLocationsOKBody) validateLocations(formats strfmt.Registry) error { - if swag.IsZero(o.Locations) { // not required - return nil - } - - for i := 0; i < len(o.Locations); i++ { - if swag.IsZero(o.Locations[i]) { // not required - continue - } - - if o.Locations[i] != nil { - if err := o.Locations[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listLocationsOk" + "." + "locations" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listLocationsOk" + "." + "locations" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this list locations OK body based on the context it is used -func (o *ListLocationsOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateLocations(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListLocationsOKBody) contextValidateLocations(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Locations); i++ { - if o.Locations[i] != nil { - - if swag.IsZero(o.Locations[i]) { // not required - return nil - } - - if err := o.Locations[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listLocationsOk" + "." + "locations" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listLocationsOk" + "." + "locations" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListLocationsOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListLocationsOKBody) UnmarshalBinary(b []byte) error { - var res ListLocationsOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListLocationsOKBodyLocationsItems0 Location represents single Backup Location. -swagger:model ListLocationsOKBodyLocationsItems0 -*/ -type ListLocationsOKBodyLocationsItems0 struct { - // Machine-readable ID. - LocationID string `json:"location_id,omitempty"` - - // Location name - Name string `json:"name,omitempty"` - - // Short description - Description string `json:"description,omitempty"` - - // filesystem config - FilesystemConfig *ListLocationsOKBodyLocationsItems0FilesystemConfig `json:"filesystem_config,omitempty"` - - // s3 config - S3Config *ListLocationsOKBodyLocationsItems0S3Config `json:"s3_config,omitempty"` -} - -// Validate validates this list locations OK body locations items0 -func (o *ListLocationsOKBodyLocationsItems0) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateFilesystemConfig(formats); err != nil { - res = append(res, err) - } - - if err := o.validateS3Config(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListLocationsOKBodyLocationsItems0) validateFilesystemConfig(formats strfmt.Registry) error { - if swag.IsZero(o.FilesystemConfig) { // not required - return nil - } - - if o.FilesystemConfig != nil { - if err := o.FilesystemConfig.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("filesystem_config") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("filesystem_config") - } - - return err - } - } - - return nil -} - -func (o *ListLocationsOKBodyLocationsItems0) validateS3Config(formats strfmt.Registry) error { - if swag.IsZero(o.S3Config) { // not required - return nil - } - - if o.S3Config != nil { - if err := o.S3Config.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("s3_config") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("s3_config") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this list locations OK body locations items0 based on the context it is used -func (o *ListLocationsOKBodyLocationsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateFilesystemConfig(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateS3Config(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListLocationsOKBodyLocationsItems0) contextValidateFilesystemConfig(ctx context.Context, formats strfmt.Registry) error { - if o.FilesystemConfig != nil { - - if swag.IsZero(o.FilesystemConfig) { // not required - return nil - } - - if err := o.FilesystemConfig.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("filesystem_config") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("filesystem_config") - } - - return err - } - } - - return nil -} - -func (o *ListLocationsOKBodyLocationsItems0) contextValidateS3Config(ctx context.Context, formats strfmt.Registry) error { - if o.S3Config != nil { - - if swag.IsZero(o.S3Config) { // not required - return nil - } - - if err := o.S3Config.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("s3_config") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("s3_config") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListLocationsOKBodyLocationsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListLocationsOKBodyLocationsItems0) UnmarshalBinary(b []byte) error { - var res ListLocationsOKBodyLocationsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListLocationsOKBodyLocationsItems0FilesystemConfig FilesystemLocationConfig represents file system location config. -swagger:model ListLocationsOKBodyLocationsItems0FilesystemConfig -*/ -type ListLocationsOKBodyLocationsItems0FilesystemConfig struct { - // path - Path string `json:"path,omitempty"` -} - -// Validate validates this list locations OK body locations items0 filesystem config -func (o *ListLocationsOKBodyLocationsItems0FilesystemConfig) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list locations OK body locations items0 filesystem config based on context it is used -func (o *ListLocationsOKBodyLocationsItems0FilesystemConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListLocationsOKBodyLocationsItems0FilesystemConfig) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListLocationsOKBodyLocationsItems0FilesystemConfig) UnmarshalBinary(b []byte) error { - var res ListLocationsOKBodyLocationsItems0FilesystemConfig - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListLocationsOKBodyLocationsItems0S3Config S3LocationConfig represents S3 bucket configuration. -swagger:model ListLocationsOKBodyLocationsItems0S3Config -*/ -type ListLocationsOKBodyLocationsItems0S3Config struct { - // endpoint - Endpoint string `json:"endpoint,omitempty"` - - // access key - AccessKey string `json:"access_key,omitempty"` - - // secret key - SecretKey string `json:"secret_key,omitempty"` - - // bucket name - BucketName string `json:"bucket_name,omitempty"` -} - -// Validate validates this list locations OK body locations items0 s3 config -func (o *ListLocationsOKBodyLocationsItems0S3Config) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list locations OK body locations items0 s3 config based on context it is used -func (o *ListLocationsOKBodyLocationsItems0S3Config) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListLocationsOKBodyLocationsItems0S3Config) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListLocationsOKBodyLocationsItems0S3Config) UnmarshalBinary(b []byte) error { - var res ListLocationsOKBodyLocationsItems0S3Config - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/backup/v1/json/client/locations_service/locations_service_client.go b/api/backup/v1/json/client/locations_service/locations_service_client.go deleted file mode 100644 index baf52eaa89e..00000000000 --- a/api/backup/v1/json/client/locations_service/locations_service_client.go +++ /dev/null @@ -1,293 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package locations_service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// New creates a new locations service API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -// New creates a new locations service API client with basic auth credentials. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - user: user for basic authentication header. -// - password: password for basic authentication header. -func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BasicAuth(user, password) - return &Client{transport: transport, formats: strfmt.Default} -} - -// New creates a new locations service API client with a bearer token for authentication. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - bearerToken: bearer token for Bearer authentication header. -func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BearerToken(bearerToken) - return &Client{transport: transport, formats: strfmt.Default} -} - -/* -Client for locations service API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption may be used to customize the behavior of Client methods. -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - AddLocation(params *AddLocationParams, opts ...ClientOption) (*AddLocationOK, error) - - ChangeLocation(params *ChangeLocationParams, opts ...ClientOption) (*ChangeLocationOK, error) - - ListLocations(params *ListLocationsParams, opts ...ClientOption) (*ListLocationsOK, error) - - RemoveLocation(params *RemoveLocationParams, opts ...ClientOption) (*RemoveLocationOK, error) - - TestLocationConfig(params *TestLocationConfigParams, opts ...ClientOption) (*TestLocationConfigOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -AddLocation adds a backup location - -Add a backup location. -*/ -func (a *Client) AddLocation(params *AddLocationParams, opts ...ClientOption) (*AddLocationOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewAddLocationParams() - } - op := &runtime.ClientOperation{ - ID: "AddLocation", - Method: "POST", - PathPattern: "/v1/backups/locations", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &AddLocationReader{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.(*AddLocationOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*AddLocationDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -ChangeLocation changes a backup location - -Change a backup location. -*/ -func (a *Client) ChangeLocation(params *ChangeLocationParams, opts ...ClientOption) (*ChangeLocationOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewChangeLocationParams() - } - op := &runtime.ClientOperation{ - ID: "ChangeLocation", - Method: "PUT", - PathPattern: "/v1/backups/locations/{location_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &ChangeLocationReader{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.(*ChangeLocationOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*ChangeLocationDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -ListLocations lists backup locations - -List backup locations. -*/ -func (a *Client) ListLocations(params *ListLocationsParams, opts ...ClientOption) (*ListLocationsOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewListLocationsParams() - } - op := &runtime.ClientOperation{ - ID: "ListLocations", - Method: "GET", - PathPattern: "/v1/backups/locations", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &ListLocationsReader{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.(*ListLocationsOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*ListLocationsDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -RemoveLocation removes a scheduled backup - -Remove a backup location. -*/ -func (a *Client) RemoveLocation(params *RemoveLocationParams, opts ...ClientOption) (*RemoveLocationOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewRemoveLocationParams() - } - op := &runtime.ClientOperation{ - ID: "RemoveLocation", - Method: "DELETE", - PathPattern: "/v1/backups/locations/{location_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &RemoveLocationReader{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.(*RemoveLocationOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*RemoveLocationDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -TestLocationConfig tests a backup location and credentials - -Test a backup location and credentials. -*/ -func (a *Client) TestLocationConfig(params *TestLocationConfigParams, opts ...ClientOption) (*TestLocationConfigOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewTestLocationConfigParams() - } - op := &runtime.ClientOperation{ - ID: "TestLocationConfig", - Method: "POST", - PathPattern: "/v1/backups/locations:testConfig", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &TestLocationConfigReader{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.(*TestLocationConfigOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*TestLocationConfigDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/api/backup/v1/json/client/locations_service/remove_location_parameters.go b/api/backup/v1/json/client/locations_service/remove_location_parameters.go deleted file mode 100644 index 3a4a644edd2..00000000000 --- a/api/backup/v1/json/client/locations_service/remove_location_parameters.go +++ /dev/null @@ -1,183 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package locations_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" - "github.com/go-openapi/swag" -) - -// NewRemoveLocationParams creates a new RemoveLocationParams 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 NewRemoveLocationParams() *RemoveLocationParams { - return &RemoveLocationParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewRemoveLocationParamsWithTimeout creates a new RemoveLocationParams object -// with the ability to set a timeout on a request. -func NewRemoveLocationParamsWithTimeout(timeout time.Duration) *RemoveLocationParams { - return &RemoveLocationParams{ - timeout: timeout, - } -} - -// NewRemoveLocationParamsWithContext creates a new RemoveLocationParams object -// with the ability to set a context for a request. -func NewRemoveLocationParamsWithContext(ctx context.Context) *RemoveLocationParams { - return &RemoveLocationParams{ - Context: ctx, - } -} - -// NewRemoveLocationParamsWithHTTPClient creates a new RemoveLocationParams object -// with the ability to set a custom HTTPClient for a request. -func NewRemoveLocationParamsWithHTTPClient(client *http.Client) *RemoveLocationParams { - return &RemoveLocationParams{ - HTTPClient: client, - } -} - -/* -RemoveLocationParams contains all the parameters to send to the API endpoint - - for the remove location operation. - - Typically these are written to a http.Request. -*/ -type RemoveLocationParams struct { - /* Force. - - Force mode - */ - Force *bool - - /* LocationID. - - Machine-readable ID. - */ - LocationID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the remove location params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *RemoveLocationParams) WithDefaults() *RemoveLocationParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the remove location params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *RemoveLocationParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the remove location params -func (o *RemoveLocationParams) WithTimeout(timeout time.Duration) *RemoveLocationParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the remove location params -func (o *RemoveLocationParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the remove location params -func (o *RemoveLocationParams) WithContext(ctx context.Context) *RemoveLocationParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the remove location params -func (o *RemoveLocationParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the remove location params -func (o *RemoveLocationParams) WithHTTPClient(client *http.Client) *RemoveLocationParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the remove location params -func (o *RemoveLocationParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithForce adds the force to the remove location params -func (o *RemoveLocationParams) WithForce(force *bool) *RemoveLocationParams { - o.SetForce(force) - return o -} - -// SetForce adds the force to the remove location params -func (o *RemoveLocationParams) SetForce(force *bool) { - o.Force = force -} - -// WithLocationID adds the locationID to the remove location params -func (o *RemoveLocationParams) WithLocationID(locationID string) *RemoveLocationParams { - o.SetLocationID(locationID) - return o -} - -// SetLocationID adds the locationId to the remove location params -func (o *RemoveLocationParams) SetLocationID(locationID string) { - o.LocationID = locationID -} - -// WriteToRequest writes these params to a swagger request -func (o *RemoveLocationParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.Force != nil { - - // query param force - var qrForce bool - - if o.Force != nil { - qrForce = *o.Force - } - qForce := swag.FormatBool(qrForce) - if qForce != "" { - if err := r.SetQueryParam("force", qForce); err != nil { - return err - } - } - } - - // path param location_id - if err := r.SetPathParam("location_id", o.LocationID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/api/backup/v1/json/client/locations_service/remove_location_responses.go b/api/backup/v1/json/client/locations_service/remove_location_responses.go deleted file mode 100644 index 7ae1a7821fc..00000000000 --- a/api/backup/v1/json/client/locations_service/remove_location_responses.go +++ /dev/null @@ -1,414 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package locations_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" -) - -// RemoveLocationReader is a Reader for the RemoveLocation structure. -type RemoveLocationReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *RemoveLocationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewRemoveLocationOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewRemoveLocationDefault(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 - } -} - -// NewRemoveLocationOK creates a RemoveLocationOK with default headers values -func NewRemoveLocationOK() *RemoveLocationOK { - return &RemoveLocationOK{} -} - -/* -RemoveLocationOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type RemoveLocationOK struct { - Payload any -} - -// IsSuccess returns true when this remove location Ok response has a 2xx status code -func (o *RemoveLocationOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this remove location Ok response has a 3xx status code -func (o *RemoveLocationOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this remove location Ok response has a 4xx status code -func (o *RemoveLocationOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this remove location Ok response has a 5xx status code -func (o *RemoveLocationOK) IsServerError() bool { - return false -} - -// IsCode returns true when this remove location Ok response a status code equal to that given -func (o *RemoveLocationOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the remove location Ok response -func (o *RemoveLocationOK) Code() int { - return 200 -} - -func (o *RemoveLocationOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/backups/locations/{location_id}][%d] removeLocationOk %s", 200, payload) -} - -func (o *RemoveLocationOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/backups/locations/{location_id}][%d] removeLocationOk %s", 200, payload) -} - -func (o *RemoveLocationOK) GetPayload() any { - return o.Payload -} - -func (o *RemoveLocationOK) 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) { - return err - } - - return nil -} - -// NewRemoveLocationDefault creates a RemoveLocationDefault with default headers values -func NewRemoveLocationDefault(code int) *RemoveLocationDefault { - return &RemoveLocationDefault{ - _statusCode: code, - } -} - -/* -RemoveLocationDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type RemoveLocationDefault struct { - _statusCode int - - Payload *RemoveLocationDefaultBody -} - -// IsSuccess returns true when this remove location default response has a 2xx status code -func (o *RemoveLocationDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this remove location default response has a 3xx status code -func (o *RemoveLocationDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this remove location default response has a 4xx status code -func (o *RemoveLocationDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this remove location default response has a 5xx status code -func (o *RemoveLocationDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this remove location default response a status code equal to that given -func (o *RemoveLocationDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the remove location default response -func (o *RemoveLocationDefault) Code() int { - return o._statusCode -} - -func (o *RemoveLocationDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/backups/locations/{location_id}][%d] RemoveLocation default %s", o._statusCode, payload) -} - -func (o *RemoveLocationDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/backups/locations/{location_id}][%d] RemoveLocation default %s", o._statusCode, payload) -} - -func (o *RemoveLocationDefault) GetPayload() *RemoveLocationDefaultBody { - return o.Payload -} - -func (o *RemoveLocationDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(RemoveLocationDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -RemoveLocationDefaultBody remove location default body -swagger:model RemoveLocationDefaultBody -*/ -type RemoveLocationDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*RemoveLocationDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this remove location default body -func (o *RemoveLocationDefaultBody) 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 *RemoveLocationDefaultBody) 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("RemoveLocation default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("RemoveLocation default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this remove location default body based on the context it is used -func (o *RemoveLocationDefaultBody) 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 *RemoveLocationDefaultBody) 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("RemoveLocation default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("RemoveLocation default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *RemoveLocationDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *RemoveLocationDefaultBody) UnmarshalBinary(b []byte) error { - var res RemoveLocationDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -RemoveLocationDefaultBodyDetailsItems0 remove location default body details items0 -swagger:model RemoveLocationDefaultBodyDetailsItems0 -*/ -type RemoveLocationDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` - - // remove location default body details items0 - RemoveLocationDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *RemoveLocationDefaultBodyDetailsItems0) 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 RemoveLocationDefaultBodyDetailsItems0 - - 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.RemoveLocationDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o RemoveLocationDefaultBodyDetailsItems0) 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.RemoveLocationDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.RemoveLocationDefaultBodyDetailsItems0) - 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 remove location default body details items0 -func (o *RemoveLocationDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this remove location default body details items0 based on context it is used -func (o *RemoveLocationDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *RemoveLocationDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *RemoveLocationDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res RemoveLocationDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/backup/v1/json/client/locations_service/test_location_config_parameters.go b/api/backup/v1/json/client/locations_service/test_location_config_parameters.go deleted file mode 100644 index 1856fe0f364..00000000000 --- a/api/backup/v1/json/client/locations_service/test_location_config_parameters.go +++ /dev/null @@ -1,144 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package locations_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" -) - -// NewTestLocationConfigParams creates a new TestLocationConfigParams 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 NewTestLocationConfigParams() *TestLocationConfigParams { - return &TestLocationConfigParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewTestLocationConfigParamsWithTimeout creates a new TestLocationConfigParams object -// with the ability to set a timeout on a request. -func NewTestLocationConfigParamsWithTimeout(timeout time.Duration) *TestLocationConfigParams { - return &TestLocationConfigParams{ - timeout: timeout, - } -} - -// NewTestLocationConfigParamsWithContext creates a new TestLocationConfigParams object -// with the ability to set a context for a request. -func NewTestLocationConfigParamsWithContext(ctx context.Context) *TestLocationConfigParams { - return &TestLocationConfigParams{ - Context: ctx, - } -} - -// NewTestLocationConfigParamsWithHTTPClient creates a new TestLocationConfigParams object -// with the ability to set a custom HTTPClient for a request. -func NewTestLocationConfigParamsWithHTTPClient(client *http.Client) *TestLocationConfigParams { - return &TestLocationConfigParams{ - HTTPClient: client, - } -} - -/* -TestLocationConfigParams contains all the parameters to send to the API endpoint - - for the test location config operation. - - Typically these are written to a http.Request. -*/ -type TestLocationConfigParams struct { - // Body. - Body TestLocationConfigBody - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the test location config params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *TestLocationConfigParams) WithDefaults() *TestLocationConfigParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the test location config params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *TestLocationConfigParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the test location config params -func (o *TestLocationConfigParams) WithTimeout(timeout time.Duration) *TestLocationConfigParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the test location config params -func (o *TestLocationConfigParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the test location config params -func (o *TestLocationConfigParams) WithContext(ctx context.Context) *TestLocationConfigParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the test location config params -func (o *TestLocationConfigParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the test location config params -func (o *TestLocationConfigParams) WithHTTPClient(client *http.Client) *TestLocationConfigParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the test location config params -func (o *TestLocationConfigParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the test location config params -func (o *TestLocationConfigParams) WithBody(body TestLocationConfigBody) *TestLocationConfigParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the test location config params -func (o *TestLocationConfigParams) SetBody(body TestLocationConfigBody) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *TestLocationConfigParams) 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/backup/v1/json/client/locations_service/test_location_config_responses.go b/api/backup/v1/json/client/locations_service/test_location_config_responses.go deleted file mode 100644 index 70d3fc4eca0..00000000000 --- a/api/backup/v1/json/client/locations_service/test_location_config_responses.go +++ /dev/null @@ -1,657 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package locations_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" -) - -// TestLocationConfigReader is a Reader for the TestLocationConfig structure. -type TestLocationConfigReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *TestLocationConfigReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewTestLocationConfigOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewTestLocationConfigDefault(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 - } -} - -// NewTestLocationConfigOK creates a TestLocationConfigOK with default headers values -func NewTestLocationConfigOK() *TestLocationConfigOK { - return &TestLocationConfigOK{} -} - -/* -TestLocationConfigOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type TestLocationConfigOK struct { - Payload any -} - -// IsSuccess returns true when this test location config Ok response has a 2xx status code -func (o *TestLocationConfigOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this test location config Ok response has a 3xx status code -func (o *TestLocationConfigOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this test location config Ok response has a 4xx status code -func (o *TestLocationConfigOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this test location config Ok response has a 5xx status code -func (o *TestLocationConfigOK) IsServerError() bool { - return false -} - -// IsCode returns true when this test location config Ok response a status code equal to that given -func (o *TestLocationConfigOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the test location config Ok response -func (o *TestLocationConfigOK) Code() int { - return 200 -} - -func (o *TestLocationConfigOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/backups/locations:testConfig][%d] testLocationConfigOk %s", 200, payload) -} - -func (o *TestLocationConfigOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/backups/locations:testConfig][%d] testLocationConfigOk %s", 200, payload) -} - -func (o *TestLocationConfigOK) GetPayload() any { - return o.Payload -} - -func (o *TestLocationConfigOK) 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) { - return err - } - - return nil -} - -// NewTestLocationConfigDefault creates a TestLocationConfigDefault with default headers values -func NewTestLocationConfigDefault(code int) *TestLocationConfigDefault { - return &TestLocationConfigDefault{ - _statusCode: code, - } -} - -/* -TestLocationConfigDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type TestLocationConfigDefault struct { - _statusCode int - - Payload *TestLocationConfigDefaultBody -} - -// IsSuccess returns true when this test location config default response has a 2xx status code -func (o *TestLocationConfigDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this test location config default response has a 3xx status code -func (o *TestLocationConfigDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this test location config default response has a 4xx status code -func (o *TestLocationConfigDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this test location config default response has a 5xx status code -func (o *TestLocationConfigDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this test location config default response a status code equal to that given -func (o *TestLocationConfigDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the test location config default response -func (o *TestLocationConfigDefault) Code() int { - return o._statusCode -} - -func (o *TestLocationConfigDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/backups/locations:testConfig][%d] TestLocationConfig default %s", o._statusCode, payload) -} - -func (o *TestLocationConfigDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/backups/locations:testConfig][%d] TestLocationConfig default %s", o._statusCode, payload) -} - -func (o *TestLocationConfigDefault) GetPayload() *TestLocationConfigDefaultBody { - return o.Payload -} - -func (o *TestLocationConfigDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(TestLocationConfigDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -TestLocationConfigBody test location config body -swagger:model TestLocationConfigBody -*/ -type TestLocationConfigBody struct { - // filesystem config - FilesystemConfig *TestLocationConfigParamsBodyFilesystemConfig `json:"filesystem_config,omitempty"` - - // s3 config - S3Config *TestLocationConfigParamsBodyS3Config `json:"s3_config,omitempty"` -} - -// Validate validates this test location config body -func (o *TestLocationConfigBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateFilesystemConfig(formats); err != nil { - res = append(res, err) - } - - if err := o.validateS3Config(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *TestLocationConfigBody) validateFilesystemConfig(formats strfmt.Registry) error { - if swag.IsZero(o.FilesystemConfig) { // not required - return nil - } - - if o.FilesystemConfig != nil { - if err := o.FilesystemConfig.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "filesystem_config") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "filesystem_config") - } - - return err - } - } - - return nil -} - -func (o *TestLocationConfigBody) validateS3Config(formats strfmt.Registry) error { - if swag.IsZero(o.S3Config) { // not required - return nil - } - - if o.S3Config != nil { - if err := o.S3Config.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "s3_config") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "s3_config") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this test location config body based on the context it is used -func (o *TestLocationConfigBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateFilesystemConfig(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateS3Config(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *TestLocationConfigBody) contextValidateFilesystemConfig(ctx context.Context, formats strfmt.Registry) error { - if o.FilesystemConfig != nil { - - if swag.IsZero(o.FilesystemConfig) { // not required - return nil - } - - if err := o.FilesystemConfig.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "filesystem_config") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "filesystem_config") - } - - return err - } - } - - return nil -} - -func (o *TestLocationConfigBody) contextValidateS3Config(ctx context.Context, formats strfmt.Registry) error { - if o.S3Config != nil { - - if swag.IsZero(o.S3Config) { // not required - return nil - } - - if err := o.S3Config.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "s3_config") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "s3_config") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *TestLocationConfigBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *TestLocationConfigBody) UnmarshalBinary(b []byte) error { - var res TestLocationConfigBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -TestLocationConfigDefaultBody test location config default body -swagger:model TestLocationConfigDefaultBody -*/ -type TestLocationConfigDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*TestLocationConfigDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this test location config default body -func (o *TestLocationConfigDefaultBody) 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 *TestLocationConfigDefaultBody) 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("TestLocationConfig default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("TestLocationConfig default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this test location config default body based on the context it is used -func (o *TestLocationConfigDefaultBody) 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 *TestLocationConfigDefaultBody) 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("TestLocationConfig default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("TestLocationConfig default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *TestLocationConfigDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *TestLocationConfigDefaultBody) UnmarshalBinary(b []byte) error { - var res TestLocationConfigDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -TestLocationConfigDefaultBodyDetailsItems0 test location config default body details items0 -swagger:model TestLocationConfigDefaultBodyDetailsItems0 -*/ -type TestLocationConfigDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` - - // test location config default body details items0 - TestLocationConfigDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *TestLocationConfigDefaultBodyDetailsItems0) 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 TestLocationConfigDefaultBodyDetailsItems0 - - 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.TestLocationConfigDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o TestLocationConfigDefaultBodyDetailsItems0) 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.TestLocationConfigDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.TestLocationConfigDefaultBodyDetailsItems0) - 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 test location config default body details items0 -func (o *TestLocationConfigDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this test location config default body details items0 based on context it is used -func (o *TestLocationConfigDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *TestLocationConfigDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *TestLocationConfigDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res TestLocationConfigDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -TestLocationConfigParamsBodyFilesystemConfig FilesystemLocationConfig represents file system location config. -swagger:model TestLocationConfigParamsBodyFilesystemConfig -*/ -type TestLocationConfigParamsBodyFilesystemConfig struct { - // path - Path string `json:"path,omitempty"` -} - -// Validate validates this test location config params body filesystem config -func (o *TestLocationConfigParamsBodyFilesystemConfig) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this test location config params body filesystem config based on context it is used -func (o *TestLocationConfigParamsBodyFilesystemConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *TestLocationConfigParamsBodyFilesystemConfig) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *TestLocationConfigParamsBodyFilesystemConfig) UnmarshalBinary(b []byte) error { - var res TestLocationConfigParamsBodyFilesystemConfig - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -TestLocationConfigParamsBodyS3Config S3LocationConfig represents S3 bucket configuration. -swagger:model TestLocationConfigParamsBodyS3Config -*/ -type TestLocationConfigParamsBodyS3Config struct { - // endpoint - Endpoint string `json:"endpoint,omitempty"` - - // access key - AccessKey string `json:"access_key,omitempty"` - - // secret key - SecretKey string `json:"secret_key,omitempty"` - - // bucket name - BucketName string `json:"bucket_name,omitempty"` -} - -// Validate validates this test location config params body s3 config -func (o *TestLocationConfigParamsBodyS3Config) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this test location config params body s3 config based on context it is used -func (o *TestLocationConfigParamsBodyS3Config) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *TestLocationConfigParamsBodyS3Config) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *TestLocationConfigParamsBodyS3Config) UnmarshalBinary(b []byte) error { - var res TestLocationConfigParamsBodyS3Config - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/backup/v1/json/client/pmm_backup_management_api_client.go b/api/backup/v1/json/client/pmm_backup_management_api_client.go deleted file mode 100644 index c525b6cfc01..00000000000 --- a/api/backup/v1/json/client/pmm_backup_management_api_client.go +++ /dev/null @@ -1,122 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package client - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/percona/pmm/api/backup/v1/json/client/backup_service" - "github.com/percona/pmm/api/backup/v1/json/client/locations_service" - "github.com/percona/pmm/api/backup/v1/json/client/restore_service" -) - -// Default PMM backup management API HTTP client. -var Default = NewHTTPClient(nil) - -const ( - // DefaultHost is the default Host - // found in Meta (info) section of spec file - DefaultHost string = "localhost" - // DefaultBasePath is the default BasePath - // found in Meta (info) section of spec file - DefaultBasePath string = "/" -) - -// DefaultSchemes are the default schemes found in Meta (info) section of spec file -var DefaultSchemes = []string{"http", "https"} - -// NewHTTPClient creates a new PMM backup management API HTTP client. -func NewHTTPClient(formats strfmt.Registry) *PMMBackupManagementAPI { - return NewHTTPClientWithConfig(formats, nil) -} - -// NewHTTPClientWithConfig creates a new PMM backup management API HTTP client, -// using a customizable transport config. -func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *PMMBackupManagementAPI { - // ensure nullable parameters have default - if cfg == nil { - cfg = DefaultTransportConfig() - } - - // create transport and client - transport := httptransport.New(cfg.Host, cfg.BasePath, cfg.Schemes) - return New(transport, formats) -} - -// New creates a new PMM backup management API client -func New(transport runtime.ClientTransport, formats strfmt.Registry) *PMMBackupManagementAPI { - // ensure nullable parameters have default - if formats == nil { - formats = strfmt.Default - } - - cli := new(PMMBackupManagementAPI) - cli.Transport = transport - cli.BackupService = backup_service.New(transport, formats) - cli.LocationsService = locations_service.New(transport, formats) - cli.RestoreService = restore_service.New(transport, formats) - return cli -} - -// DefaultTransportConfig creates a TransportConfig with the -// default settings taken from the meta section of the spec file. -func DefaultTransportConfig() *TransportConfig { - return &TransportConfig{ - Host: DefaultHost, - BasePath: DefaultBasePath, - Schemes: DefaultSchemes, - } -} - -// TransportConfig contains the transport related info, -// found in the meta section of the spec file. -type TransportConfig struct { - Host string - BasePath string - Schemes []string -} - -// WithHost overrides the default host, -// provided by the meta section of the spec file. -func (cfg *TransportConfig) WithHost(host string) *TransportConfig { - cfg.Host = host - return cfg -} - -// WithBasePath overrides the default basePath, -// provided by the meta section of the spec file. -func (cfg *TransportConfig) WithBasePath(basePath string) *TransportConfig { - cfg.BasePath = basePath - return cfg -} - -// WithSchemes overrides the default schemes, -// provided by the meta section of the spec file. -func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig { - cfg.Schemes = schemes - return cfg -} - -// PMMBackupManagementAPI is a client for PMM backup management API -type PMMBackupManagementAPI struct { - BackupService backup_service.ClientService - - LocationsService locations_service.ClientService - - RestoreService restore_service.ClientService - - Transport runtime.ClientTransport -} - -// SetTransport changes the transport on the client and all its subresources -func (c *PMMBackupManagementAPI) SetTransport(transport runtime.ClientTransport) { - c.Transport = transport - c.BackupService.SetTransport(transport) - c.LocationsService.SetTransport(transport) - c.RestoreService.SetTransport(transport) -} diff --git a/api/backup/v1/json/client/restore_service/get_logs_mixin5_parameters.go b/api/backup/v1/json/client/restore_service/get_logs_mixin5_parameters.go deleted file mode 100644 index b621fbb6800..00000000000 --- a/api/backup/v1/json/client/restore_service/get_logs_mixin5_parameters.go +++ /dev/null @@ -1,211 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package restore_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" - "github.com/go-openapi/swag" -) - -// NewGetLogsMixin5Params creates a new GetLogsMixin5Params 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 NewGetLogsMixin5Params() *GetLogsMixin5Params { - return &GetLogsMixin5Params{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetLogsMixin5ParamsWithTimeout creates a new GetLogsMixin5Params object -// with the ability to set a timeout on a request. -func NewGetLogsMixin5ParamsWithTimeout(timeout time.Duration) *GetLogsMixin5Params { - return &GetLogsMixin5Params{ - timeout: timeout, - } -} - -// NewGetLogsMixin5ParamsWithContext creates a new GetLogsMixin5Params object -// with the ability to set a context for a request. -func NewGetLogsMixin5ParamsWithContext(ctx context.Context) *GetLogsMixin5Params { - return &GetLogsMixin5Params{ - Context: ctx, - } -} - -// NewGetLogsMixin5ParamsWithHTTPClient creates a new GetLogsMixin5Params object -// with the ability to set a custom HTTPClient for a request. -func NewGetLogsMixin5ParamsWithHTTPClient(client *http.Client) *GetLogsMixin5Params { - return &GetLogsMixin5Params{ - HTTPClient: client, - } -} - -/* -GetLogsMixin5Params contains all the parameters to send to the API endpoint - - for the get logs mixin5 operation. - - Typically these are written to a http.Request. -*/ -type GetLogsMixin5Params struct { - // Limit. - // - // Format: int64 - Limit *int64 - - // Offset. - // - // Format: int64 - Offset *int64 - - // RestoreID. - RestoreID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get logs mixin5 params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetLogsMixin5Params) WithDefaults() *GetLogsMixin5Params { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get logs mixin5 params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetLogsMixin5Params) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the get logs mixin5 params -func (o *GetLogsMixin5Params) WithTimeout(timeout time.Duration) *GetLogsMixin5Params { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get logs mixin5 params -func (o *GetLogsMixin5Params) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get logs mixin5 params -func (o *GetLogsMixin5Params) WithContext(ctx context.Context) *GetLogsMixin5Params { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get logs mixin5 params -func (o *GetLogsMixin5Params) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get logs mixin5 params -func (o *GetLogsMixin5Params) WithHTTPClient(client *http.Client) *GetLogsMixin5Params { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get logs mixin5 params -func (o *GetLogsMixin5Params) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithLimit adds the limit to the get logs mixin5 params -func (o *GetLogsMixin5Params) WithLimit(limit *int64) *GetLogsMixin5Params { - o.SetLimit(limit) - return o -} - -// SetLimit adds the limit to the get logs mixin5 params -func (o *GetLogsMixin5Params) SetLimit(limit *int64) { - o.Limit = limit -} - -// WithOffset adds the offset to the get logs mixin5 params -func (o *GetLogsMixin5Params) WithOffset(offset *int64) *GetLogsMixin5Params { - o.SetOffset(offset) - return o -} - -// SetOffset adds the offset to the get logs mixin5 params -func (o *GetLogsMixin5Params) SetOffset(offset *int64) { - o.Offset = offset -} - -// WithRestoreID adds the restoreID to the get logs mixin5 params -func (o *GetLogsMixin5Params) WithRestoreID(restoreID string) *GetLogsMixin5Params { - o.SetRestoreID(restoreID) - return o -} - -// SetRestoreID adds the restoreId to the get logs mixin5 params -func (o *GetLogsMixin5Params) SetRestoreID(restoreID string) { - o.RestoreID = restoreID -} - -// WriteToRequest writes these params to a swagger request -func (o *GetLogsMixin5Params) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.Limit != nil { - - // query param limit - var qrLimit int64 - - if o.Limit != nil { - qrLimit = *o.Limit - } - qLimit := swag.FormatInt64(qrLimit) - if qLimit != "" { - if err := r.SetQueryParam("limit", qLimit); err != nil { - return err - } - } - } - - if o.Offset != nil { - - // query param offset - var qrOffset int64 - - if o.Offset != nil { - qrOffset = *o.Offset - } - qOffset := swag.FormatInt64(qrOffset) - if qOffset != "" { - if err := r.SetQueryParam("offset", qOffset); err != nil { - return err - } - } - } - - // path param restore_id - if err := r.SetPathParam("restore_id", o.RestoreID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/api/backup/v1/json/client/restore_service/get_logs_mixin5_responses.go b/api/backup/v1/json/client/restore_service/get_logs_mixin5_responses.go deleted file mode 100644 index 8adf159cd53..00000000000 --- a/api/backup/v1/json/client/restore_service/get_logs_mixin5_responses.go +++ /dev/null @@ -1,570 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package restore_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" -) - -// GetLogsMixin5Reader is a Reader for the GetLogsMixin5 structure. -type GetLogsMixin5Reader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetLogsMixin5Reader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewGetLogsMixin5OK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewGetLogsMixin5Default(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 - } -} - -// NewGetLogsMixin5OK creates a GetLogsMixin5OK with default headers values -func NewGetLogsMixin5OK() *GetLogsMixin5OK { - return &GetLogsMixin5OK{} -} - -/* -GetLogsMixin5OK describes a response with status code 200, with default header values. - -A successful response. -*/ -type GetLogsMixin5OK struct { - Payload *GetLogsMixin5OKBody -} - -// IsSuccess returns true when this get logs mixin5 Ok response has a 2xx status code -func (o *GetLogsMixin5OK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this get logs mixin5 Ok response has a 3xx status code -func (o *GetLogsMixin5OK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this get logs mixin5 Ok response has a 4xx status code -func (o *GetLogsMixin5OK) IsClientError() bool { - return false -} - -// IsServerError returns true when this get logs mixin5 Ok response has a 5xx status code -func (o *GetLogsMixin5OK) IsServerError() bool { - return false -} - -// IsCode returns true when this get logs mixin5 Ok response a status code equal to that given -func (o *GetLogsMixin5OK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the get logs mixin5 Ok response -func (o *GetLogsMixin5OK) Code() int { - return 200 -} - -func (o *GetLogsMixin5OK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/backups/restores/{restore_id}/logs][%d] getLogsMixin5Ok %s", 200, payload) -} - -func (o *GetLogsMixin5OK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/backups/restores/{restore_id}/logs][%d] getLogsMixin5Ok %s", 200, payload) -} - -func (o *GetLogsMixin5OK) GetPayload() *GetLogsMixin5OKBody { - return o.Payload -} - -func (o *GetLogsMixin5OK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(GetLogsMixin5OKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -// NewGetLogsMixin5Default creates a GetLogsMixin5Default with default headers values -func NewGetLogsMixin5Default(code int) *GetLogsMixin5Default { - return &GetLogsMixin5Default{ - _statusCode: code, - } -} - -/* -GetLogsMixin5Default describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type GetLogsMixin5Default struct { - _statusCode int - - Payload *GetLogsMixin5DefaultBody -} - -// IsSuccess returns true when this get logs mixin5 default response has a 2xx status code -func (o *GetLogsMixin5Default) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this get logs mixin5 default response has a 3xx status code -func (o *GetLogsMixin5Default) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this get logs mixin5 default response has a 4xx status code -func (o *GetLogsMixin5Default) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this get logs mixin5 default response has a 5xx status code -func (o *GetLogsMixin5Default) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this get logs mixin5 default response a status code equal to that given -func (o *GetLogsMixin5Default) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the get logs mixin5 default response -func (o *GetLogsMixin5Default) Code() int { - return o._statusCode -} - -func (o *GetLogsMixin5Default) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/backups/restores/{restore_id}/logs][%d] GetLogsMixin5 default %s", o._statusCode, payload) -} - -func (o *GetLogsMixin5Default) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/backups/restores/{restore_id}/logs][%d] GetLogsMixin5 default %s", o._statusCode, payload) -} - -func (o *GetLogsMixin5Default) GetPayload() *GetLogsMixin5DefaultBody { - return o.Payload -} - -func (o *GetLogsMixin5Default) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(GetLogsMixin5DefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -GetLogsMixin5DefaultBody get logs mixin5 default body -swagger:model GetLogsMixin5DefaultBody -*/ -type GetLogsMixin5DefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*GetLogsMixin5DefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this get logs mixin5 default body -func (o *GetLogsMixin5DefaultBody) 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 *GetLogsMixin5DefaultBody) 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("GetLogsMixin5 default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("GetLogsMixin5 default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this get logs mixin5 default body based on the context it is used -func (o *GetLogsMixin5DefaultBody) 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 *GetLogsMixin5DefaultBody) 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("GetLogsMixin5 default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("GetLogsMixin5 default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetLogsMixin5DefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetLogsMixin5DefaultBody) UnmarshalBinary(b []byte) error { - var res GetLogsMixin5DefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetLogsMixin5DefaultBodyDetailsItems0 get logs mixin5 default body details items0 -swagger:model GetLogsMixin5DefaultBodyDetailsItems0 -*/ -type GetLogsMixin5DefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` - - // get logs mixin5 default body details items0 - GetLogsMixin5DefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *GetLogsMixin5DefaultBodyDetailsItems0) 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 GetLogsMixin5DefaultBodyDetailsItems0 - - 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.GetLogsMixin5DefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o GetLogsMixin5DefaultBodyDetailsItems0) 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.GetLogsMixin5DefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.GetLogsMixin5DefaultBodyDetailsItems0) - 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 get logs mixin5 default body details items0 -func (o *GetLogsMixin5DefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get logs mixin5 default body details items0 based on context it is used -func (o *GetLogsMixin5DefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetLogsMixin5DefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetLogsMixin5DefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res GetLogsMixin5DefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetLogsMixin5OKBody get logs mixin5 OK body -swagger:model GetLogsMixin5OKBody -*/ -type GetLogsMixin5OKBody struct { - // logs - Logs []*GetLogsMixin5OKBodyLogsItems0 `json:"logs"` - - // end - End bool `json:"end,omitempty"` -} - -// Validate validates this get logs mixin5 OK body -func (o *GetLogsMixin5OKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateLogs(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetLogsMixin5OKBody) validateLogs(formats strfmt.Registry) error { - if swag.IsZero(o.Logs) { // not required - return nil - } - - for i := 0; i < len(o.Logs); i++ { - if swag.IsZero(o.Logs[i]) { // not required - continue - } - - if o.Logs[i] != nil { - if err := o.Logs[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getLogsMixin5Ok" + "." + "logs" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getLogsMixin5Ok" + "." + "logs" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this get logs mixin5 OK body based on the context it is used -func (o *GetLogsMixin5OKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateLogs(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetLogsMixin5OKBody) contextValidateLogs(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Logs); i++ { - if o.Logs[i] != nil { - - if swag.IsZero(o.Logs[i]) { // not required - return nil - } - - if err := o.Logs[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getLogsMixin5Ok" + "." + "logs" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getLogsMixin5Ok" + "." + "logs" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetLogsMixin5OKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetLogsMixin5OKBody) UnmarshalBinary(b []byte) error { - var res GetLogsMixin5OKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetLogsMixin5OKBodyLogsItems0 LogChunk represent one chunk of logs. -swagger:model GetLogsMixin5OKBodyLogsItems0 -*/ -type GetLogsMixin5OKBodyLogsItems0 struct { - // chunk id - ChunkID int64 `json:"chunk_id,omitempty"` - - // data - Data string `json:"data,omitempty"` -} - -// Validate validates this get logs mixin5 OK body logs items0 -func (o *GetLogsMixin5OKBodyLogsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get logs mixin5 OK body logs items0 based on context it is used -func (o *GetLogsMixin5OKBodyLogsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetLogsMixin5OKBodyLogsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetLogsMixin5OKBodyLogsItems0) UnmarshalBinary(b []byte) error { - var res GetLogsMixin5OKBodyLogsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/backup/v1/json/client/restore_service/list_restores_parameters.go b/api/backup/v1/json/client/restore_service/list_restores_parameters.go deleted file mode 100644 index d46fd70f9e4..00000000000 --- a/api/backup/v1/json/client/restore_service/list_restores_parameters.go +++ /dev/null @@ -1,127 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package restore_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" -) - -// NewListRestoresParams creates a new ListRestoresParams 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 NewListRestoresParams() *ListRestoresParams { - return &ListRestoresParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListRestoresParamsWithTimeout creates a new ListRestoresParams object -// with the ability to set a timeout on a request. -func NewListRestoresParamsWithTimeout(timeout time.Duration) *ListRestoresParams { - return &ListRestoresParams{ - timeout: timeout, - } -} - -// NewListRestoresParamsWithContext creates a new ListRestoresParams object -// with the ability to set a context for a request. -func NewListRestoresParamsWithContext(ctx context.Context) *ListRestoresParams { - return &ListRestoresParams{ - Context: ctx, - } -} - -// NewListRestoresParamsWithHTTPClient creates a new ListRestoresParams object -// with the ability to set a custom HTTPClient for a request. -func NewListRestoresParamsWithHTTPClient(client *http.Client) *ListRestoresParams { - return &ListRestoresParams{ - HTTPClient: client, - } -} - -/* -ListRestoresParams contains all the parameters to send to the API endpoint - - for the list restores operation. - - Typically these are written to a http.Request. -*/ -type ListRestoresParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list restores params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListRestoresParams) WithDefaults() *ListRestoresParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list restores params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListRestoresParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list restores params -func (o *ListRestoresParams) WithTimeout(timeout time.Duration) *ListRestoresParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list restores params -func (o *ListRestoresParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list restores params -func (o *ListRestoresParams) WithContext(ctx context.Context) *ListRestoresParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list restores params -func (o *ListRestoresParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list restores params -func (o *ListRestoresParams) WithHTTPClient(client *http.Client) *ListRestoresParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list restores params -func (o *ListRestoresParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *ListRestoresParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/api/backup/v1/json/client/restore_service/list_restores_responses.go b/api/backup/v1/json/client/restore_service/list_restores_responses.go deleted file mode 100644 index d3b45468b2f..00000000000 --- a/api/backup/v1/json/client/restore_service/list_restores_responses.go +++ /dev/null @@ -1,760 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package restore_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" -) - -// ListRestoresReader is a Reader for the ListRestores structure. -type ListRestoresReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListRestoresReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewListRestoresOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewListRestoresDefault(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 - } -} - -// NewListRestoresOK creates a ListRestoresOK with default headers values -func NewListRestoresOK() *ListRestoresOK { - return &ListRestoresOK{} -} - -/* -ListRestoresOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type ListRestoresOK struct { - Payload *ListRestoresOKBody -} - -// IsSuccess returns true when this list restores Ok response has a 2xx status code -func (o *ListRestoresOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this list restores Ok response has a 3xx status code -func (o *ListRestoresOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this list restores Ok response has a 4xx status code -func (o *ListRestoresOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this list restores Ok response has a 5xx status code -func (o *ListRestoresOK) IsServerError() bool { - return false -} - -// IsCode returns true when this list restores Ok response a status code equal to that given -func (o *ListRestoresOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the list restores Ok response -func (o *ListRestoresOK) Code() int { - return 200 -} - -func (o *ListRestoresOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/backups/restores][%d] listRestoresOk %s", 200, payload) -} - -func (o *ListRestoresOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/backups/restores][%d] listRestoresOk %s", 200, payload) -} - -func (o *ListRestoresOK) GetPayload() *ListRestoresOKBody { - return o.Payload -} - -func (o *ListRestoresOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(ListRestoresOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -// NewListRestoresDefault creates a ListRestoresDefault with default headers values -func NewListRestoresDefault(code int) *ListRestoresDefault { - return &ListRestoresDefault{ - _statusCode: code, - } -} - -/* -ListRestoresDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type ListRestoresDefault struct { - _statusCode int - - Payload *ListRestoresDefaultBody -} - -// IsSuccess returns true when this list restores default response has a 2xx status code -func (o *ListRestoresDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this list restores default response has a 3xx status code -func (o *ListRestoresDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this list restores default response has a 4xx status code -func (o *ListRestoresDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this list restores default response has a 5xx status code -func (o *ListRestoresDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this list restores default response a status code equal to that given -func (o *ListRestoresDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the list restores default response -func (o *ListRestoresDefault) Code() int { - return o._statusCode -} - -func (o *ListRestoresDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/backups/restores][%d] ListRestores default %s", o._statusCode, payload) -} - -func (o *ListRestoresDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/backups/restores][%d] ListRestores default %s", o._statusCode, payload) -} - -func (o *ListRestoresDefault) GetPayload() *ListRestoresDefaultBody { - return o.Payload -} - -func (o *ListRestoresDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(ListRestoresDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -ListRestoresDefaultBody list restores default body -swagger:model ListRestoresDefaultBody -*/ -type ListRestoresDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*ListRestoresDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this list restores default body -func (o *ListRestoresDefaultBody) 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 *ListRestoresDefaultBody) 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("ListRestores default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("ListRestores default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this list restores default body based on the context it is used -func (o *ListRestoresDefaultBody) 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 *ListRestoresDefaultBody) 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("ListRestores default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("ListRestores default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListRestoresDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListRestoresDefaultBody) UnmarshalBinary(b []byte) error { - var res ListRestoresDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListRestoresDefaultBodyDetailsItems0 list restores default body details items0 -swagger:model ListRestoresDefaultBodyDetailsItems0 -*/ -type ListRestoresDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` - - // list restores default body details items0 - ListRestoresDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *ListRestoresDefaultBodyDetailsItems0) 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 ListRestoresDefaultBodyDetailsItems0 - - 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.ListRestoresDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o ListRestoresDefaultBodyDetailsItems0) 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.ListRestoresDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.ListRestoresDefaultBodyDetailsItems0) - 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 list restores default body details items0 -func (o *ListRestoresDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list restores default body details items0 based on context it is used -func (o *ListRestoresDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListRestoresDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListRestoresDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res ListRestoresDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListRestoresOKBody list restores OK body -swagger:model ListRestoresOKBody -*/ -type ListRestoresOKBody struct { - // items - Items []*ListRestoresOKBodyItemsItems0 `json:"items"` -} - -// Validate validates this list restores OK body -func (o *ListRestoresOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateItems(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListRestoresOKBody) validateItems(formats strfmt.Registry) error { - if swag.IsZero(o.Items) { // not required - return nil - } - - for i := 0; i < len(o.Items); i++ { - if swag.IsZero(o.Items[i]) { // not required - continue - } - - if o.Items[i] != nil { - if err := o.Items[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listRestoresOk" + "." + "items" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listRestoresOk" + "." + "items" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this list restores OK body based on the context it is used -func (o *ListRestoresOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateItems(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListRestoresOKBody) contextValidateItems(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Items); i++ { - if o.Items[i] != nil { - - if swag.IsZero(o.Items[i]) { // not required - return nil - } - - if err := o.Items[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listRestoresOk" + "." + "items" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listRestoresOk" + "." + "items" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListRestoresOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListRestoresOKBody) UnmarshalBinary(b []byte) error { - var res ListRestoresOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListRestoresOKBodyItemsItems0 RestoreHistoryItem represents single backup restore item. -swagger:model ListRestoresOKBodyItemsItems0 -*/ -type ListRestoresOKBodyItemsItems0 struct { - // Machine-readable restore id. - RestoreID string `json:"restore_id,omitempty"` - - // ID of the artifact used for restore. - ArtifactID string `json:"artifact_id,omitempty"` - - // Artifact name used for restore. - Name string `json:"name,omitempty"` - - // Database vendor e.g. PostgreSQL, MongoDB, MySQL. - Vendor string `json:"vendor,omitempty"` - - // Machine-readable location ID. - LocationID string `json:"location_id,omitempty"` - - // Location name. - LocationName string `json:"location_name,omitempty"` - - // Machine-readable service ID. - ServiceID string `json:"service_id,omitempty"` - - // Service name. - ServiceName string `json:"service_name,omitempty"` - - // DataModel is a model used for performing a backup. - // Enum: ["DATA_MODEL_UNSPECIFIED","DATA_MODEL_PHYSICAL","DATA_MODEL_LOGICAL"] - DataModel *string `json:"data_model,omitempty"` - - // RestoreStatus shows the current status of execution of restore. - // Enum: ["RESTORE_STATUS_UNSPECIFIED","RESTORE_STATUS_IN_PROGRESS","RESTORE_STATUS_SUCCESS","RESTORE_STATUS_ERROR"] - Status *string `json:"status,omitempty"` - - // Restore start time. - // Format: date-time - StartedAt strfmt.DateTime `json:"started_at,omitempty"` - - // Restore finish time. - // Format: date-time - FinishedAt strfmt.DateTime `json:"finished_at,omitempty"` - - // PITR timestamp is filled for PITR restores, empty otherwise. - // Format: date-time - PitrTimestamp strfmt.DateTime `json:"pitr_timestamp,omitempty"` -} - -// Validate validates this list restores OK body items items0 -func (o *ListRestoresOKBodyItemsItems0) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateDataModel(formats); err != nil { - res = append(res, err) - } - - if err := o.validateStatus(formats); err != nil { - res = append(res, err) - } - - if err := o.validateStartedAt(formats); err != nil { - res = append(res, err) - } - - if err := o.validateFinishedAt(formats); err != nil { - res = append(res, err) - } - - if err := o.validatePitrTimestamp(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var listRestoresOkBodyItemsItems0TypeDataModelPropEnum []any - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["DATA_MODEL_UNSPECIFIED","DATA_MODEL_PHYSICAL","DATA_MODEL_LOGICAL"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - listRestoresOkBodyItemsItems0TypeDataModelPropEnum = append(listRestoresOkBodyItemsItems0TypeDataModelPropEnum, v) - } -} - -const ( - - // ListRestoresOKBodyItemsItems0DataModelDATAMODELUNSPECIFIED captures enum value "DATA_MODEL_UNSPECIFIED" - ListRestoresOKBodyItemsItems0DataModelDATAMODELUNSPECIFIED string = "DATA_MODEL_UNSPECIFIED" - - // ListRestoresOKBodyItemsItems0DataModelDATAMODELPHYSICAL captures enum value "DATA_MODEL_PHYSICAL" - ListRestoresOKBodyItemsItems0DataModelDATAMODELPHYSICAL string = "DATA_MODEL_PHYSICAL" - - // ListRestoresOKBodyItemsItems0DataModelDATAMODELLOGICAL captures enum value "DATA_MODEL_LOGICAL" - ListRestoresOKBodyItemsItems0DataModelDATAMODELLOGICAL string = "DATA_MODEL_LOGICAL" -) - -// prop value enum -func (o *ListRestoresOKBodyItemsItems0) validateDataModelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, listRestoresOkBodyItemsItems0TypeDataModelPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ListRestoresOKBodyItemsItems0) validateDataModel(formats strfmt.Registry) error { - if swag.IsZero(o.DataModel) { // not required - return nil - } - - // value enum - if err := o.validateDataModelEnum("data_model", "body", *o.DataModel); err != nil { - return err - } - - return nil -} - -var listRestoresOkBodyItemsItems0TypeStatusPropEnum []any - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["RESTORE_STATUS_UNSPECIFIED","RESTORE_STATUS_IN_PROGRESS","RESTORE_STATUS_SUCCESS","RESTORE_STATUS_ERROR"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - listRestoresOkBodyItemsItems0TypeStatusPropEnum = append(listRestoresOkBodyItemsItems0TypeStatusPropEnum, v) - } -} - -const ( - - // ListRestoresOKBodyItemsItems0StatusRESTORESTATUSUNSPECIFIED captures enum value "RESTORE_STATUS_UNSPECIFIED" - ListRestoresOKBodyItemsItems0StatusRESTORESTATUSUNSPECIFIED string = "RESTORE_STATUS_UNSPECIFIED" - - // ListRestoresOKBodyItemsItems0StatusRESTORESTATUSINPROGRESS captures enum value "RESTORE_STATUS_IN_PROGRESS" - ListRestoresOKBodyItemsItems0StatusRESTORESTATUSINPROGRESS string = "RESTORE_STATUS_IN_PROGRESS" - - // ListRestoresOKBodyItemsItems0StatusRESTORESTATUSSUCCESS captures enum value "RESTORE_STATUS_SUCCESS" - ListRestoresOKBodyItemsItems0StatusRESTORESTATUSSUCCESS string = "RESTORE_STATUS_SUCCESS" - - // ListRestoresOKBodyItemsItems0StatusRESTORESTATUSERROR captures enum value "RESTORE_STATUS_ERROR" - ListRestoresOKBodyItemsItems0StatusRESTORESTATUSERROR string = "RESTORE_STATUS_ERROR" -) - -// prop value enum -func (o *ListRestoresOKBodyItemsItems0) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, listRestoresOkBodyItemsItems0TypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ListRestoresOKBodyItemsItems0) 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 *ListRestoresOKBodyItemsItems0) validateStartedAt(formats strfmt.Registry) error { - if swag.IsZero(o.StartedAt) { // not required - return nil - } - - if err := validate.FormatOf("started_at", "body", "date-time", o.StartedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (o *ListRestoresOKBodyItemsItems0) validateFinishedAt(formats strfmt.Registry) error { - if swag.IsZero(o.FinishedAt) { // not required - return nil - } - - if err := validate.FormatOf("finished_at", "body", "date-time", o.FinishedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (o *ListRestoresOKBodyItemsItems0) validatePitrTimestamp(formats strfmt.Registry) error { - if swag.IsZero(o.PitrTimestamp) { // not required - return nil - } - - if err := validate.FormatOf("pitr_timestamp", "body", "date-time", o.PitrTimestamp.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this list restores OK body items items0 based on context it is used -func (o *ListRestoresOKBodyItemsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListRestoresOKBodyItemsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListRestoresOKBodyItemsItems0) UnmarshalBinary(b []byte) error { - var res ListRestoresOKBodyItemsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/backup/v1/json/client/restore_service/restore_backup_parameters.go b/api/backup/v1/json/client/restore_service/restore_backup_parameters.go deleted file mode 100644 index 4d6b7d7f955..00000000000 --- a/api/backup/v1/json/client/restore_service/restore_backup_parameters.go +++ /dev/null @@ -1,144 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package restore_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" -) - -// NewRestoreBackupParams creates a new RestoreBackupParams 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 NewRestoreBackupParams() *RestoreBackupParams { - return &RestoreBackupParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewRestoreBackupParamsWithTimeout creates a new RestoreBackupParams object -// with the ability to set a timeout on a request. -func NewRestoreBackupParamsWithTimeout(timeout time.Duration) *RestoreBackupParams { - return &RestoreBackupParams{ - timeout: timeout, - } -} - -// NewRestoreBackupParamsWithContext creates a new RestoreBackupParams object -// with the ability to set a context for a request. -func NewRestoreBackupParamsWithContext(ctx context.Context) *RestoreBackupParams { - return &RestoreBackupParams{ - Context: ctx, - } -} - -// NewRestoreBackupParamsWithHTTPClient creates a new RestoreBackupParams object -// with the ability to set a custom HTTPClient for a request. -func NewRestoreBackupParamsWithHTTPClient(client *http.Client) *RestoreBackupParams { - return &RestoreBackupParams{ - HTTPClient: client, - } -} - -/* -RestoreBackupParams contains all the parameters to send to the API endpoint - - for the restore backup operation. - - Typically these are written to a http.Request. -*/ -type RestoreBackupParams struct { - // Body. - Body RestoreBackupBody - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the restore backup params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *RestoreBackupParams) WithDefaults() *RestoreBackupParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the restore backup params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *RestoreBackupParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the restore backup params -func (o *RestoreBackupParams) WithTimeout(timeout time.Duration) *RestoreBackupParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the restore backup params -func (o *RestoreBackupParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the restore backup params -func (o *RestoreBackupParams) WithContext(ctx context.Context) *RestoreBackupParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the restore backup params -func (o *RestoreBackupParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the restore backup params -func (o *RestoreBackupParams) WithHTTPClient(client *http.Client) *RestoreBackupParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the restore backup params -func (o *RestoreBackupParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the restore backup params -func (o *RestoreBackupParams) WithBody(body RestoreBackupBody) *RestoreBackupParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the restore backup params -func (o *RestoreBackupParams) SetBody(body RestoreBackupBody) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *RestoreBackupParams) 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/backup/v1/json/client/restore_service/restore_backup_responses.go b/api/backup/v1/json/client/restore_service/restore_backup_responses.go deleted file mode 100644 index 1aa57a61322..00000000000 --- a/api/backup/v1/json/client/restore_service/restore_backup_responses.go +++ /dev/null @@ -1,519 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package restore_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" -) - -// RestoreBackupReader is a Reader for the RestoreBackup structure. -type RestoreBackupReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *RestoreBackupReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewRestoreBackupOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewRestoreBackupDefault(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 - } -} - -// NewRestoreBackupOK creates a RestoreBackupOK with default headers values -func NewRestoreBackupOK() *RestoreBackupOK { - return &RestoreBackupOK{} -} - -/* -RestoreBackupOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type RestoreBackupOK struct { - Payload *RestoreBackupOKBody -} - -// IsSuccess returns true when this restore backup Ok response has a 2xx status code -func (o *RestoreBackupOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this restore backup Ok response has a 3xx status code -func (o *RestoreBackupOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this restore backup Ok response has a 4xx status code -func (o *RestoreBackupOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this restore backup Ok response has a 5xx status code -func (o *RestoreBackupOK) IsServerError() bool { - return false -} - -// IsCode returns true when this restore backup Ok response a status code equal to that given -func (o *RestoreBackupOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the restore backup Ok response -func (o *RestoreBackupOK) Code() int { - return 200 -} - -func (o *RestoreBackupOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/backups/restores:start][%d] restoreBackupOk %s", 200, payload) -} - -func (o *RestoreBackupOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/backups/restores:start][%d] restoreBackupOk %s", 200, payload) -} - -func (o *RestoreBackupOK) GetPayload() *RestoreBackupOKBody { - return o.Payload -} - -func (o *RestoreBackupOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(RestoreBackupOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -// NewRestoreBackupDefault creates a RestoreBackupDefault with default headers values -func NewRestoreBackupDefault(code int) *RestoreBackupDefault { - return &RestoreBackupDefault{ - _statusCode: code, - } -} - -/* -RestoreBackupDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type RestoreBackupDefault struct { - _statusCode int - - Payload *RestoreBackupDefaultBody -} - -// IsSuccess returns true when this restore backup default response has a 2xx status code -func (o *RestoreBackupDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this restore backup default response has a 3xx status code -func (o *RestoreBackupDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this restore backup default response has a 4xx status code -func (o *RestoreBackupDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this restore backup default response has a 5xx status code -func (o *RestoreBackupDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this restore backup default response a status code equal to that given -func (o *RestoreBackupDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the restore backup default response -func (o *RestoreBackupDefault) Code() int { - return o._statusCode -} - -func (o *RestoreBackupDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/backups/restores:start][%d] RestoreBackup default %s", o._statusCode, payload) -} - -func (o *RestoreBackupDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/backups/restores:start][%d] RestoreBackup default %s", o._statusCode, payload) -} - -func (o *RestoreBackupDefault) GetPayload() *RestoreBackupDefaultBody { - return o.Payload -} - -func (o *RestoreBackupDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(RestoreBackupDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -RestoreBackupBody restore backup body -swagger:model RestoreBackupBody -*/ -type RestoreBackupBody struct { - // Service identifier where backup should be restored. - ServiceID string `json:"service_id,omitempty"` - - // Artifact id to restore. - ArtifactID string `json:"artifact_id,omitempty"` - - // Timestamp of PITR to restore to - // Format: date-time - PitrTimestamp strfmt.DateTime `json:"pitr_timestamp,omitempty"` -} - -// Validate validates this restore backup body -func (o *RestoreBackupBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validatePitrTimestamp(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *RestoreBackupBody) validatePitrTimestamp(formats strfmt.Registry) error { - if swag.IsZero(o.PitrTimestamp) { // not required - return nil - } - - if err := validate.FormatOf("body"+"."+"pitr_timestamp", "body", "date-time", o.PitrTimestamp.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this restore backup body based on context it is used -func (o *RestoreBackupBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *RestoreBackupBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *RestoreBackupBody) UnmarshalBinary(b []byte) error { - var res RestoreBackupBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -RestoreBackupDefaultBody restore backup default body -swagger:model RestoreBackupDefaultBody -*/ -type RestoreBackupDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*RestoreBackupDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this restore backup default body -func (o *RestoreBackupDefaultBody) 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 *RestoreBackupDefaultBody) 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("RestoreBackup default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("RestoreBackup default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this restore backup default body based on the context it is used -func (o *RestoreBackupDefaultBody) 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 *RestoreBackupDefaultBody) 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("RestoreBackup default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("RestoreBackup default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *RestoreBackupDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *RestoreBackupDefaultBody) UnmarshalBinary(b []byte) error { - var res RestoreBackupDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -RestoreBackupDefaultBodyDetailsItems0 restore backup default body details items0 -swagger:model RestoreBackupDefaultBodyDetailsItems0 -*/ -type RestoreBackupDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` - - // restore backup default body details items0 - RestoreBackupDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *RestoreBackupDefaultBodyDetailsItems0) 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 RestoreBackupDefaultBodyDetailsItems0 - - 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.RestoreBackupDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o RestoreBackupDefaultBodyDetailsItems0) 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.RestoreBackupDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.RestoreBackupDefaultBodyDetailsItems0) - 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 restore backup default body details items0 -func (o *RestoreBackupDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this restore backup default body details items0 based on context it is used -func (o *RestoreBackupDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *RestoreBackupDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *RestoreBackupDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res RestoreBackupDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -RestoreBackupOKBody restore backup OK body -swagger:model RestoreBackupOKBody -*/ -type RestoreBackupOKBody struct { - // Unique restore identifier. - RestoreID string `json:"restore_id,omitempty"` -} - -// Validate validates this restore backup OK body -func (o *RestoreBackupOKBody) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this restore backup OK body based on context it is used -func (o *RestoreBackupOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *RestoreBackupOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *RestoreBackupOKBody) UnmarshalBinary(b []byte) error { - var res RestoreBackupOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/backup/v1/json/client/restore_service/restore_service_client.go b/api/backup/v1/json/client/restore_service/restore_service_client.go deleted file mode 100644 index 0fa30ec13e0..00000000000 --- a/api/backup/v1/json/client/restore_service/restore_service_client.go +++ /dev/null @@ -1,206 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package restore_service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// New creates a new restore service API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -// New creates a new restore service API client with basic auth credentials. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - user: user for basic authentication header. -// - password: password for basic authentication header. -func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BasicAuth(user, password) - return &Client{transport: transport, formats: strfmt.Default} -} - -// New creates a new restore service API client with a bearer token for authentication. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - bearerToken: bearer token for Bearer authentication header. -func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BearerToken(bearerToken) - return &Client{transport: transport, formats: strfmt.Default} -} - -/* -Client for restore service API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption may be used to customize the behavior of Client methods. -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - GetLogsMixin5(params *GetLogsMixin5Params, opts ...ClientOption) (*GetLogsMixin5OK, error) - - ListRestores(params *ListRestoresParams, opts ...ClientOption) (*ListRestoresOK, error) - - RestoreBackup(params *RestoreBackupParams, opts ...ClientOption) (*RestoreBackupOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -GetLogsMixin5 gets logs - -Get logs from the underlying tools for a restore job -*/ -func (a *Client) GetLogsMixin5(params *GetLogsMixin5Params, opts ...ClientOption) (*GetLogsMixin5OK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewGetLogsMixin5Params() - } - op := &runtime.ClientOperation{ - ID: "GetLogsMixin5", - Method: "GET", - PathPattern: "/v1/backups/restores/{restore_id}/logs", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &GetLogsMixin5Reader{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.(*GetLogsMixin5OK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*GetLogsMixin5Default) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -ListRestores lists restore history - -List all backup restore history items -*/ -func (a *Client) ListRestores(params *ListRestoresParams, opts ...ClientOption) (*ListRestoresOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewListRestoresParams() - } - op := &runtime.ClientOperation{ - ID: "ListRestores", - Method: "GET", - PathPattern: "/v1/backups/restores", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &ListRestoresReader{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.(*ListRestoresOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*ListRestoresDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* - RestoreBackup restores from a backup - - Could return the Error message in the details containing specific ErrorCode indicating failure reason: - -ERROR_CODE_XTRABACKUP_NOT_INSTALLED - xtrabackup is not installed on the service -ERROR_CODE_INVALID_XTRABACKUP - different versions of xtrabackup and xbcloud -ERROR_CODE_INCOMPATIBLE_XTRABACKUP - xtrabackup is not compatible with MySQL for taking a backup -ERROR_CODE_INCOMPATIBLE_TARGET_MYSQL - target MySQL version is not compatible with the artifact for performing a restore of the backup -*/ -func (a *Client) RestoreBackup(params *RestoreBackupParams, opts ...ClientOption) (*RestoreBackupOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewRestoreBackupParams() - } - op := &runtime.ClientOperation{ - ID: "RestoreBackup", - Method: "POST", - PathPattern: "/v1/backups/restores:start", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &RestoreBackupReader{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.(*RestoreBackupOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*RestoreBackupDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/api/backup/v1/json/v1.json b/api/backup/v1/json/v1.json deleted file mode 100644 index c599ce356ce..00000000000 --- a/api/backup/v1/json/v1.json +++ /dev/null @@ -1,2088 +0,0 @@ -{ - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "schemes": [ - "https", - "http" - ], - "swagger": "2.0", - "info": { - "title": "PMM Backup Management API", - "version": "v1beta1" - }, - "paths": { - "/v1/backups/artifacts": { - "get": { - "description": "Return a list of backup artifacts.", - "tags": [ - "BackupService" - ], - "summary": "List artifacts", - "operationId": "ListArtifacts", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "artifacts": { - "type": "array", - "items": { - "description": "Artifact represents single backup artifact.", - "type": "object", - "properties": { - "artifact_id": { - "description": "Machine-readable artifact ID.", - "type": "string", - "x-order": 0 - }, - "name": { - "type": "string", - "title": "Artifact name", - "x-order": 1 - }, - "vendor": { - "description": "Database vendor e.g. PostgreSQL, MongoDB, MySQL.", - "type": "string", - "x-order": 2 - }, - "location_id": { - "description": "Machine-readable location ID.", - "type": "string", - "x-order": 3 - }, - "location_name": { - "description": "Location name.", - "type": "string", - "x-order": 4 - }, - "service_id": { - "description": "Machine-readable service ID.", - "type": "string", - "x-order": 5 - }, - "service_name": { - "description": "Service name.", - "type": "string", - "x-order": 6 - }, - "data_model": { - "description": "DataModel is a model used for performing a backup.", - "type": "string", - "default": "DATA_MODEL_UNSPECIFIED", - "enum": [ - "DATA_MODEL_UNSPECIFIED", - "DATA_MODEL_PHYSICAL", - "DATA_MODEL_LOGICAL" - ], - "x-order": 7 - }, - "status": { - "description": "BackupStatus shows the current status of execution of backup.", - "type": "string", - "default": "BACKUP_STATUS_UNSPECIFIED", - "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" - ], - "x-order": 8 - }, - "created_at": { - "description": "Artifact creation time.", - "type": "string", - "format": "date-time", - "x-order": 9 - }, - "mode": { - "description": "BackupMode specifies backup mode.", - "type": "string", - "default": "BACKUP_MODE_UNSPECIFIED", - "enum": [ - "BACKUP_MODE_UNSPECIFIED", - "BACKUP_MODE_SNAPSHOT", - "BACKUP_MODE_INCREMENTAL", - "BACKUP_MODE_PITR" - ], - "x-order": 10 - }, - "is_sharded_cluster": { - "description": "Source database setup type.", - "type": "boolean", - "x-order": 11 - }, - "folder": { - "description": "Folder to store artifact on a storage.", - "type": "string", - "x-order": 12 - }, - "metadata_list": { - "description": "List of artifact metadata.", - "type": "array", - "items": { - "description": "Metadata contains extra artifact data like files it consists of, tool specific data, etc.", - "type": "object", - "properties": { - "file_list": { - "description": "List of files backup consists of.", - "type": "array", - "items": { - "description": "File represents file or folder on a storage.", - "type": "object", - "properties": { - "name": { - "type": "string", - "x-order": 0 - }, - "is_directory": { - "type": "boolean", - "x-order": 1 - } - } - }, - "x-order": 0 - }, - "restore_to": { - "description": "Exact time DB can be restored to.", - "type": "string", - "format": "date-time", - "x-order": 1 - }, - "pbm_metadata": { - "description": "PbmMetadata contains additional data for pbm cli tools.", - "type": "object", - "properties": { - "name": { - "description": "Name of backup in backup tool representation.", - "type": "string", - "x-order": 0 - } - }, - "x-order": 2 - } - } - }, - "x-order": 13 - } - } - }, - "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/backups/artifacts/{artifact_id}": { - "delete": { - "description": "Deletes an artifact.", - "tags": [ - "BackupService" - ], - "summary": "Delete Artifact", - "operationId": "DeleteArtifact", - "parameters": [ - { - "type": "string", - "description": "Machine-readable artifact ID.", - "name": "artifact_id", - "in": "path", - "required": true - }, - { - "type": "boolean", - "description": "Removes all the backup files associated with artifact if flag is set.", - "name": "remove_files", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/backups/artifacts/{artifact_id}/pitr-timeranges": { - "get": { - "description": "Return a list of available MongoDB point-in-time-recovery timeranges.", - "tags": [ - "BackupService" - ], - "summary": "List PITR Timeranges", - "operationId": "ListPitrTimeranges", - "parameters": [ - { - "type": "string", - "description": "Artifact ID represents artifact whose location has PITR timeranges to be retrieved.", - "name": "artifact_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "timeranges": { - "type": "array", - "items": { - "type": "object", - "properties": { - "start_timestamp": { - "description": "start_timestamp is the time of the first event in the PITR chunk.", - "type": "string", - "format": "date-time", - "x-order": 0 - }, - "end_timestamp": { - "description": "end_timestamp is the time of the last event in the PITR chunk.", - "type": "string", - "format": "date-time", - "x-order": 1 - } - } - }, - "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/backups/locations": { - "get": { - "description": "List backup locations.", - "tags": [ - "LocationsService" - ], - "summary": "List Backup Locations", - "operationId": "ListLocations", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "locations": { - "type": "array", - "items": { - "description": "Location represents single Backup Location.", - "type": "object", - "properties": { - "location_id": { - "description": "Machine-readable ID.", - "type": "string", - "x-order": 0 - }, - "name": { - "type": "string", - "title": "Location name", - "x-order": 1 - }, - "description": { - "type": "string", - "title": "Short description", - "x-order": 2 - }, - "filesystem_config": { - "description": "FilesystemLocationConfig represents file system location config.", - "type": "object", - "properties": { - "path": { - "type": "string", - "x-order": 0 - } - }, - "x-order": 3 - }, - "s3_config": { - "description": "S3LocationConfig represents S3 bucket configuration.", - "type": "object", - "properties": { - "endpoint": { - "type": "string", - "x-order": 0 - }, - "access_key": { - "type": "string", - "x-order": 1 - }, - "secret_key": { - "type": "string", - "x-order": 2 - }, - "bucket_name": { - "type": "string", - "x-order": 3 - } - }, - "x-order": 4 - } - } - }, - "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 - } - } - } - } - } - }, - "post": { - "description": "Add a backup location.", - "tags": [ - "LocationsService" - ], - "summary": "Add a Backup Location", - "operationId": "AddLocation", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "name": { - "type": "string", - "title": "Location name", - "x-order": 0 - }, - "description": { - "type": "string", - "x-order": 1 - }, - "filesystem_config": { - "description": "FilesystemLocationConfig represents file system location config.", - "type": "object", - "properties": { - "path": { - "type": "string", - "x-order": 0 - } - }, - "x-order": 2 - }, - "s3_config": { - "description": "S3LocationConfig represents S3 bucket configuration.", - "type": "object", - "properties": { - "endpoint": { - "type": "string", - "x-order": 0 - }, - "access_key": { - "type": "string", - "x-order": 1 - }, - "secret_key": { - "type": "string", - "x-order": 2 - }, - "bucket_name": { - "type": "string", - "x-order": 3 - } - }, - "x-order": 3 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "location_id": { - "description": "Machine-readable ID.", - "type": "string", - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/backups/locations/{location_id}": { - "put": { - "description": "Change a backup location.", - "tags": [ - "LocationsService" - ], - "summary": "Change a Backup Location", - "operationId": "ChangeLocation", - "parameters": [ - { - "type": "string", - "description": "Machine-readable ID.", - "name": "location_id", - "in": "path", - "required": true - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "name": { - "type": "string", - "title": "Location name", - "x-order": 0 - }, - "description": { - "type": "string", - "x-order": 1 - }, - "filesystem_config": { - "description": "FilesystemLocationConfig represents file system location config.", - "type": "object", - "properties": { - "path": { - "type": "string", - "x-order": 0 - } - }, - "x-order": 2 - }, - "s3_config": { - "description": "S3LocationConfig represents S3 bucket configuration.", - "type": "object", - "properties": { - "endpoint": { - "type": "string", - "x-order": 0 - }, - "access_key": { - "type": "string", - "x-order": 1 - }, - "secret_key": { - "type": "string", - "x-order": 2 - }, - "bucket_name": { - "type": "string", - "x-order": 3 - } - }, - "x-order": 3 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - }, - "delete": { - "description": "Remove a backup location.", - "tags": [ - "LocationsService" - ], - "summary": "Remove a Scheduled Backup", - "operationId": "RemoveLocation", - "parameters": [ - { - "type": "string", - "description": "Machine-readable ID.", - "name": "location_id", - "in": "path", - "required": true - }, - { - "type": "boolean", - "description": "Force mode", - "name": "force", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/backups/locations:testConfig": { - "post": { - "description": "Test a backup location and credentials.", - "tags": [ - "LocationsService" - ], - "summary": "Test a Backup Location and Credentials", - "operationId": "TestLocationConfig", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "filesystem_config": { - "description": "FilesystemLocationConfig represents file system location config.", - "type": "object", - "properties": { - "path": { - "type": "string", - "x-order": 0 - } - }, - "x-order": 0 - }, - "s3_config": { - "description": "S3LocationConfig represents S3 bucket configuration.", - "type": "object", - "properties": { - "endpoint": { - "type": "string", - "x-order": 0 - }, - "access_key": { - "type": "string", - "x-order": 1 - }, - "secret_key": { - "type": "string", - "x-order": 2 - }, - "bucket_name": { - "type": "string", - "x-order": 3 - } - }, - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/backups/restores": { - "get": { - "description": "List all backup restore history items", - "tags": [ - "RestoreService" - ], - "summary": "List Restore History", - "operationId": "ListRestores", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "items": { - "type": "array", - "items": { - "description": "RestoreHistoryItem represents single backup restore item.", - "type": "object", - "properties": { - "restore_id": { - "description": "Machine-readable restore id.", - "type": "string", - "x-order": 0 - }, - "artifact_id": { - "description": "ID of the artifact used for restore.", - "type": "string", - "x-order": 1 - }, - "name": { - "description": "Artifact name used for restore.", - "type": "string", - "x-order": 2 - }, - "vendor": { - "description": "Database vendor e.g. PostgreSQL, MongoDB, MySQL.", - "type": "string", - "x-order": 3 - }, - "location_id": { - "description": "Machine-readable location ID.", - "type": "string", - "x-order": 4 - }, - "location_name": { - "description": "Location name.", - "type": "string", - "x-order": 5 - }, - "service_id": { - "description": "Machine-readable service ID.", - "type": "string", - "x-order": 6 - }, - "service_name": { - "description": "Service name.", - "type": "string", - "x-order": 7 - }, - "data_model": { - "description": "DataModel is a model used for performing a backup.", - "type": "string", - "default": "DATA_MODEL_UNSPECIFIED", - "enum": [ - "DATA_MODEL_UNSPECIFIED", - "DATA_MODEL_PHYSICAL", - "DATA_MODEL_LOGICAL" - ], - "x-order": 8 - }, - "status": { - "description": "RestoreStatus shows the current status of execution of restore.", - "type": "string", - "default": "RESTORE_STATUS_UNSPECIFIED", - "enum": [ - "RESTORE_STATUS_UNSPECIFIED", - "RESTORE_STATUS_IN_PROGRESS", - "RESTORE_STATUS_SUCCESS", - "RESTORE_STATUS_ERROR" - ], - "x-order": 9 - }, - "started_at": { - "description": "Restore start time.", - "type": "string", - "format": "date-time", - "x-order": 10 - }, - "finished_at": { - "description": "Restore finish time.", - "type": "string", - "format": "date-time", - "x-order": 11 - }, - "pitr_timestamp": { - "description": "PITR timestamp is filled for PITR restores, empty otherwise.", - "type": "string", - "format": "date-time", - "x-order": 12 - } - } - }, - "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/backups/restores/{restore_id}/logs": { - "get": { - "description": "Get logs from the underlying tools for a restore job", - "tags": [ - "RestoreService" - ], - "summary": "Get Logs", - "operationId": "GetLogsMixin5", - "parameters": [ - { - "type": "string", - "name": "restore_id", - "in": "path", - "required": true - }, - { - "type": "integer", - "format": "int64", - "name": "offset", - "in": "query" - }, - { - "type": "integer", - "format": "int64", - "name": "limit", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "logs": { - "type": "array", - "items": { - "description": "LogChunk represent one chunk of logs.", - "type": "object", - "properties": { - "chunk_id": { - "type": "integer", - "format": "int64", - "x-order": 0 - }, - "data": { - "type": "string", - "x-order": 1 - } - } - }, - "x-order": 0 - }, - "end": { - "type": "boolean", - "x-order": 1 - } - } - } - }, - "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/backups/restores:start": { - "post": { - "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", - "tags": [ - "RestoreService" - ], - "summary": "Restore from a Backup", - "operationId": "RestoreBackup", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "service_id": { - "description": "Service identifier where backup should be restored.", - "type": "string", - "x-order": 0 - }, - "artifact_id": { - "description": "Artifact id to restore.", - "type": "string", - "x-order": 1 - }, - "pitr_timestamp": { - "type": "string", - "format": "date-time", - "title": "Timestamp of PITR to restore to", - "x-order": 2 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "restore_id": { - "description": "Unique restore identifier.", - "type": "string", - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/backups/scheduled": { - "get": { - "description": "List all scheduled backups.", - "tags": [ - "BackupService" - ], - "summary": "List Scheduled Backups", - "operationId": "ListScheduledBackups", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "scheduled_backups": { - "type": "array", - "items": { - "description": "ScheduledBackup represents scheduled task for backup.", - "type": "object", - "properties": { - "scheduled_backup_id": { - "description": "Machine-readable ID.", - "type": "string", - "x-order": 0 - }, - "service_id": { - "description": "Machine-readable service ID.", - "type": "string", - "x-order": 1 - }, - "service_name": { - "description": "Service name.", - "type": "string", - "x-order": 2 - }, - "location_id": { - "description": "Machine-readable location ID.", - "type": "string", - "x-order": 3 - }, - "location_name": { - "description": "Location name.", - "type": "string", - "x-order": 4 - }, - "folder": { - "description": "Folder on storage for artifact.", - "type": "string", - "x-order": 5 - }, - "cron_expression": { - "description": "How often backup will be run in cron format.", - "type": "string", - "x-order": 6 - }, - "start_time": { - "description": "First backup wouldn't happen before this time.", - "type": "string", - "format": "date-time", - "x-order": 7 - }, - "name": { - "description": "Artifact name.", - "type": "string", - "x-order": 8 - }, - "description": { - "description": "Description.", - "type": "string", - "x-order": 9 - }, - "enabled": { - "description": "If scheduling is enabled.", - "type": "boolean", - "x-order": 10 - }, - "retries": { - "description": "How many times to retry a failed backup before giving up.", - "type": "integer", - "format": "int64", - "x-order": 11 - }, - "retry_interval": { - "description": "Delay between each retry. Should have a suffix in JSON: 2s, 1m, 1h.", - "type": "string", - "x-order": 12 - }, - "data_model": { - "description": "DataModel is a model used for performing a backup.", - "type": "string", - "default": "DATA_MODEL_UNSPECIFIED", - "enum": [ - "DATA_MODEL_UNSPECIFIED", - "DATA_MODEL_PHYSICAL", - "DATA_MODEL_LOGICAL" - ], - "x-order": 13 - }, - "mode": { - "description": "BackupMode specifies backup mode.", - "type": "string", - "default": "BACKUP_MODE_UNSPECIFIED", - "enum": [ - "BACKUP_MODE_UNSPECIFIED", - "BACKUP_MODE_SNAPSHOT", - "BACKUP_MODE_INCREMENTAL", - "BACKUP_MODE_PITR" - ], - "x-order": 14 - }, - "vendor": { - "description": "Database vendor e.g. PostgreSQL, MongoDB, MySQL.", - "type": "string", - "x-order": 15 - }, - "last_run": { - "description": "Last run.", - "type": "string", - "format": "date-time", - "x-order": 16 - }, - "next_run": { - "description": "Next run.", - "type": "string", - "format": "date-time", - "x-order": 17 - }, - "retention": { - "description": "How many artifacts keep. 0 - unlimited.", - "type": "integer", - "format": "int64", - "x-order": 18 - } - } - }, - "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/backups/{artifact_id}/compatible-services": { - "get": { - "description": "List services that are compatible with the backup artifact.", - "tags": [ - "BackupService" - ], - "summary": "List Compatible Services", - "operationId": "ListArtifactCompatibleServices", - "parameters": [ - { - "type": "string", - "description": "Artifact id used to determine restore compatibility.", - "name": "artifact_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "mysql": { - "type": "array", - "items": { - "description": "MySQLService represents a generic MySQL 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": "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 - }, - "mongodb": { - "type": "array", - "items": { - "description": "MongoDBService represents a generic MongoDB 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": "MongoDB version.", - "type": "string", - "x-order": 10 - } - } - }, - "x-order": 1 - } - } - } - }, - "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/backups/{artifact_id}/logs": { - "get": { - "description": "Get logs from the underlying tools for a backup/restore job.", - "tags": [ - "BackupService" - ], - "summary": "Get Logs", - "operationId": "GetLogs", - "parameters": [ - { - "type": "string", - "name": "artifact_id", - "in": "path", - "required": true - }, - { - "type": "integer", - "format": "int64", - "name": "offset", - "in": "query" - }, - { - "type": "integer", - "format": "int64", - "name": "limit", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "logs": { - "type": "array", - "items": { - "description": "LogChunk represent one chunk of logs.", - "type": "object", - "properties": { - "chunk_id": { - "type": "integer", - "format": "int64", - "x-order": 0 - }, - "data": { - "type": "string", - "x-order": 1 - } - } - }, - "x-order": 0 - }, - "end": { - "type": "boolean", - "x-order": 1 - } - } - } - }, - "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/backups/{scheduled_backup_id}": { - "delete": { - "description": "Remove a scheduled backup.", - "tags": [ - "BackupService" - ], - "summary": "Remove a Scheduled Backup", - "operationId": "RemoveScheduledBackup", - "parameters": [ - { - "type": "string", - "name": "scheduled_backup_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/backups:changeScheduled": { - "put": { - "description": "Change a scheduled backup.", - "tags": [ - "BackupService" - ], - "summary": "Change a Scheduled Backup", - "operationId": "ChangeScheduledBackup", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "scheduled_backup_id": { - "type": "string", - "x-order": 0 - }, - "enabled": { - "type": "boolean", - "x-nullable": true, - "x-order": 1 - }, - "cron_expression": { - "description": "How often backup should be run in cron format.", - "type": "string", - "x-nullable": true, - "x-order": 2 - }, - "start_time": { - "description": "First backup wouldn't happen before this time.", - "type": "string", - "format": "date-time", - "x-order": 3 - }, - "name": { - "description": "Name of backup.", - "type": "string", - "x-nullable": true, - "x-order": 4 - }, - "description": { - "description": "Human-readable description.", - "type": "string", - "x-nullable": true, - "x-order": 5 - }, - "retries": { - "description": "How many times to retry a failed backup before giving up.", - "type": "integer", - "format": "int64", - "x-nullable": true, - "x-order": 6 - }, - "retry_interval": { - "description": "Delay between each retry. Should have a suffix in JSON: 1s, 1m, 1h.", - "type": "string", - "x-order": 7 - }, - "retention": { - "description": "How many artifacts keep. 0 - unlimited.", - "type": "integer", - "format": "int64", - "x-nullable": true, - "x-order": 8 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/backups:schedule": { - "post": { - "description": "Schedule a backup to run at a specified time.", - "tags": [ - "BackupService" - ], - "summary": "Schedule a Backup", - "operationId": "ScheduleBackup", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "service_id": { - "description": "Service identifier where backup should be performed.", - "type": "string", - "x-order": 0 - }, - "location_id": { - "description": "Machine-readable location ID.", - "type": "string", - "x-order": 1 - }, - "folder": { - "description": "How often backup should be run in cron format.\nFolder on storage for artifact.", - "type": "string", - "x-order": 2 - }, - "cron_expression": { - "type": "string", - "x-order": 3 - }, - "start_time": { - "description": "First backup wouldn't happen before this time.", - "type": "string", - "format": "date-time", - "x-order": 4 - }, - "name": { - "description": "Name of backup.", - "type": "string", - "x-order": 5 - }, - "description": { - "description": "Human-readable description.", - "type": "string", - "x-order": 6 - }, - "enabled": { - "description": "If scheduling is enabled.", - "type": "boolean", - "x-order": 7 - }, - "retries": { - "description": "How many times to retry a failed backup before giving up.", - "type": "integer", - "format": "int64", - "x-order": 8 - }, - "retry_interval": { - "description": "Delay between each retry. Should have a suffix in JSON: 1s, 1m, 1h.", - "type": "string", - "x-order": 9 - }, - "mode": { - "description": "BackupMode specifies backup mode.", - "type": "string", - "default": "BACKUP_MODE_UNSPECIFIED", - "enum": [ - "BACKUP_MODE_UNSPECIFIED", - "BACKUP_MODE_SNAPSHOT", - "BACKUP_MODE_INCREMENTAL", - "BACKUP_MODE_PITR" - ], - "x-order": 10 - }, - "data_model": { - "description": "DataModel is a model used for performing a backup.", - "type": "string", - "default": "DATA_MODEL_UNSPECIFIED", - "enum": [ - "DATA_MODEL_UNSPECIFIED", - "DATA_MODEL_PHYSICAL", - "DATA_MODEL_LOGICAL" - ], - "x-order": 11 - }, - "retention": { - "description": "How many artifacts keep. 0 - unlimited.", - "type": "integer", - "format": "int64", - "x-order": 12 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "scheduled_backup_id": { - "type": "string", - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/backups:start": { - "post": { - "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", - "tags": [ - "BackupService" - ], - "summary": "Start a Backup", - "operationId": "StartBackup", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "service_id": { - "description": "Service identifier.", - "type": "string", - "x-order": 0 - }, - "location_id": { - "description": "Machine-readable location ID.", - "type": "string", - "x-order": 1 - }, - "name": { - "description": "If empty then name is auto-generated.", - "type": "string", - "x-order": 2 - }, - "description": { - "description": "Human-readable description.", - "type": "string", - "x-order": 3 - }, - "retry_interval": { - "description": "Delay between each retry. Should have a suffix in JSON: 1s, 1m, 1h.", - "type": "string", - "x-order": 4 - }, - "retries": { - "description": "How many times to retry a failed backup before giving up.", - "type": "integer", - "format": "int64", - "x-order": 5 - }, - "data_model": { - "description": "DataModel is a model used for performing a backup.", - "type": "string", - "default": "DATA_MODEL_UNSPECIFIED", - "enum": [ - "DATA_MODEL_UNSPECIFIED", - "DATA_MODEL_PHYSICAL", - "DATA_MODEL_LOGICAL" - ], - "x-order": 6 - }, - "folder": { - "description": "Folder on storage for artifact.", - "type": "string", - "x-order": 7 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "artifact_id": { - "description": "Unique identifier.", - "type": "string", - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - } - }, - "tags": [ - { - "name": "BackupService" - }, - { - "name": "LocationsService" - }, - { - "name": "RestoreService" - } - ] -} \ No newline at end of file diff --git a/api/backup/v1/locations.pb.go b/api/backup/v1/locations.pb.go deleted file mode 100644 index 17d17178c51..00000000000 --- a/api/backup/v1/locations.pb.go +++ /dev/null @@ -1,888 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.10 -// protoc (unknown) -// source: backup/v1/locations.proto - -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" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// FilesystemLocationConfig represents file system location config. -type FilesystemLocationConfig struct { - state protoimpl.MessageState `protogen:"open.v1"` - Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *FilesystemLocationConfig) Reset() { - *x = FilesystemLocationConfig{} - mi := &file_backup_v1_locations_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *FilesystemLocationConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FilesystemLocationConfig) ProtoMessage() {} - -func (x *FilesystemLocationConfig) ProtoReflect() protoreflect.Message { - mi := &file_backup_v1_locations_proto_msgTypes[0] - 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 FilesystemLocationConfig.ProtoReflect.Descriptor instead. -func (*FilesystemLocationConfig) Descriptor() ([]byte, []int) { - return file_backup_v1_locations_proto_rawDescGZIP(), []int{0} -} - -func (x *FilesystemLocationConfig) GetPath() string { - if x != nil { - return x.Path - } - return "" -} - -// S3LocationConfig represents S3 bucket configuration. -type S3LocationConfig struct { - state protoimpl.MessageState `protogen:"open.v1"` - Endpoint string `protobuf:"bytes,1,opt,name=endpoint,proto3" json:"endpoint,omitempty"` - AccessKey string `protobuf:"bytes,2,opt,name=access_key,json=accessKey,proto3" json:"access_key,omitempty"` - SecretKey string `protobuf:"bytes,3,opt,name=secret_key,json=secretKey,proto3" json:"secret_key,omitempty"` - BucketName string `protobuf:"bytes,4,opt,name=bucket_name,json=bucketName,proto3" json:"bucket_name,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *S3LocationConfig) Reset() { - *x = S3LocationConfig{} - mi := &file_backup_v1_locations_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *S3LocationConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*S3LocationConfig) ProtoMessage() {} - -func (x *S3LocationConfig) ProtoReflect() protoreflect.Message { - mi := &file_backup_v1_locations_proto_msgTypes[1] - 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 S3LocationConfig.ProtoReflect.Descriptor instead. -func (*S3LocationConfig) Descriptor() ([]byte, []int) { - return file_backup_v1_locations_proto_rawDescGZIP(), []int{1} -} - -func (x *S3LocationConfig) GetEndpoint() string { - if x != nil { - return x.Endpoint - } - return "" -} - -func (x *S3LocationConfig) GetAccessKey() string { - if x != nil { - return x.AccessKey - } - return "" -} - -func (x *S3LocationConfig) GetSecretKey() string { - if x != nil { - return x.SecretKey - } - return "" -} - -func (x *S3LocationConfig) GetBucketName() string { - if x != nil { - return x.BucketName - } - return "" -} - -// Location represents single Backup Location. -type Location struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Machine-readable ID. - LocationId string `protobuf:"bytes,1,opt,name=location_id,json=locationId,proto3" json:"location_id,omitempty"` - // Location name - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - // Short description - Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` - // Types that are valid to be assigned to Config: - // - // *Location_FilesystemConfig - // *Location_S3Config - Config isLocation_Config `protobuf_oneof:"config"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Location) Reset() { - *x = Location{} - mi := &file_backup_v1_locations_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Location) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Location) ProtoMessage() {} - -func (x *Location) ProtoReflect() protoreflect.Message { - mi := &file_backup_v1_locations_proto_msgTypes[2] - 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 Location.ProtoReflect.Descriptor instead. -func (*Location) Descriptor() ([]byte, []int) { - return file_backup_v1_locations_proto_rawDescGZIP(), []int{2} -} - -func (x *Location) GetLocationId() string { - if x != nil { - return x.LocationId - } - return "" -} - -func (x *Location) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *Location) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *Location) GetConfig() isLocation_Config { - if x != nil { - return x.Config - } - return nil -} - -func (x *Location) GetFilesystemConfig() *FilesystemLocationConfig { - if x != nil { - if x, ok := x.Config.(*Location_FilesystemConfig); ok { - return x.FilesystemConfig - } - } - return nil -} - -func (x *Location) GetS3Config() *S3LocationConfig { - if x != nil { - if x, ok := x.Config.(*Location_S3Config); ok { - return x.S3Config - } - } - return nil -} - -type isLocation_Config interface { - isLocation_Config() -} - -type Location_FilesystemConfig struct { - FilesystemConfig *FilesystemLocationConfig `protobuf:"bytes,4,opt,name=filesystem_config,json=filesystemConfig,proto3,oneof"` -} - -type Location_S3Config struct { - S3Config *S3LocationConfig `protobuf:"bytes,5,opt,name=s3_config,json=s3Config,proto3,oneof"` -} - -func (*Location_FilesystemConfig) isLocation_Config() {} - -func (*Location_S3Config) isLocation_Config() {} - -type ListLocationsRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ListLocationsRequest) Reset() { - *x = ListLocationsRequest{} - mi := &file_backup_v1_locations_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ListLocationsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListLocationsRequest) ProtoMessage() {} - -func (x *ListLocationsRequest) ProtoReflect() protoreflect.Message { - mi := &file_backup_v1_locations_proto_msgTypes[3] - 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 ListLocationsRequest.ProtoReflect.Descriptor instead. -func (*ListLocationsRequest) Descriptor() ([]byte, []int) { - return file_backup_v1_locations_proto_rawDescGZIP(), []int{3} -} - -type ListLocationsResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Locations []*Location `protobuf:"bytes,1,rep,name=locations,proto3" json:"locations,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ListLocationsResponse) Reset() { - *x = ListLocationsResponse{} - mi := &file_backup_v1_locations_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ListLocationsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListLocationsResponse) ProtoMessage() {} - -func (x *ListLocationsResponse) ProtoReflect() protoreflect.Message { - mi := &file_backup_v1_locations_proto_msgTypes[4] - 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 ListLocationsResponse.ProtoReflect.Descriptor instead. -func (*ListLocationsResponse) Descriptor() ([]byte, []int) { - return file_backup_v1_locations_proto_rawDescGZIP(), []int{4} -} - -func (x *ListLocationsResponse) GetLocations() []*Location { - if x != nil { - return x.Locations - } - return nil -} - -type AddLocationRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Location name - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` - // Filesystem location configuration. Exactly one config should be set. - FilesystemConfig *FilesystemLocationConfig `protobuf:"bytes,3,opt,name=filesystem_config,json=filesystemConfig,proto3" json:"filesystem_config,omitempty"` - // S3 Bucket configuration. Exactly one config should be set. - S3Config *S3LocationConfig `protobuf:"bytes,4,opt,name=s3_config,json=s3Config,proto3" json:"s3_config,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AddLocationRequest) Reset() { - *x = AddLocationRequest{} - mi := &file_backup_v1_locations_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AddLocationRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddLocationRequest) ProtoMessage() {} - -func (x *AddLocationRequest) ProtoReflect() protoreflect.Message { - mi := &file_backup_v1_locations_proto_msgTypes[5] - 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 AddLocationRequest.ProtoReflect.Descriptor instead. -func (*AddLocationRequest) Descriptor() ([]byte, []int) { - return file_backup_v1_locations_proto_rawDescGZIP(), []int{5} -} - -func (x *AddLocationRequest) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *AddLocationRequest) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *AddLocationRequest) GetFilesystemConfig() *FilesystemLocationConfig { - if x != nil { - return x.FilesystemConfig - } - return nil -} - -func (x *AddLocationRequest) GetS3Config() *S3LocationConfig { - if x != nil { - return x.S3Config - } - return nil -} - -type AddLocationResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Machine-readable ID. - LocationId string `protobuf:"bytes,1,opt,name=location_id,json=locationId,proto3" json:"location_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AddLocationResponse) Reset() { - *x = AddLocationResponse{} - mi := &file_backup_v1_locations_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AddLocationResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddLocationResponse) ProtoMessage() {} - -func (x *AddLocationResponse) ProtoReflect() protoreflect.Message { - mi := &file_backup_v1_locations_proto_msgTypes[6] - 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 AddLocationResponse.ProtoReflect.Descriptor instead. -func (*AddLocationResponse) Descriptor() ([]byte, []int) { - return file_backup_v1_locations_proto_rawDescGZIP(), []int{6} -} - -func (x *AddLocationResponse) GetLocationId() string { - if x != nil { - return x.LocationId - } - return "" -} - -type ChangeLocationRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Machine-readable ID. - LocationId string `protobuf:"bytes,1,opt,name=location_id,json=locationId,proto3" json:"location_id,omitempty"` - // Location name - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` - // Filesystem location configuration. Exactly one config should be set. - FilesystemConfig *FilesystemLocationConfig `protobuf:"bytes,4,opt,name=filesystem_config,json=filesystemConfig,proto3" json:"filesystem_config,omitempty"` - // S3 Bucket configuration. Exactly one config should be set. - S3Config *S3LocationConfig `protobuf:"bytes,5,opt,name=s3_config,json=s3Config,proto3" json:"s3_config,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ChangeLocationRequest) Reset() { - *x = ChangeLocationRequest{} - mi := &file_backup_v1_locations_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ChangeLocationRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ChangeLocationRequest) ProtoMessage() {} - -func (x *ChangeLocationRequest) ProtoReflect() protoreflect.Message { - mi := &file_backup_v1_locations_proto_msgTypes[7] - 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 ChangeLocationRequest.ProtoReflect.Descriptor instead. -func (*ChangeLocationRequest) Descriptor() ([]byte, []int) { - return file_backup_v1_locations_proto_rawDescGZIP(), []int{7} -} - -func (x *ChangeLocationRequest) GetLocationId() string { - if x != nil { - return x.LocationId - } - return "" -} - -func (x *ChangeLocationRequest) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *ChangeLocationRequest) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *ChangeLocationRequest) GetFilesystemConfig() *FilesystemLocationConfig { - if x != nil { - return x.FilesystemConfig - } - return nil -} - -func (x *ChangeLocationRequest) GetS3Config() *S3LocationConfig { - if x != nil { - return x.S3Config - } - return nil -} - -type ChangeLocationResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ChangeLocationResponse) Reset() { - *x = ChangeLocationResponse{} - mi := &file_backup_v1_locations_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ChangeLocationResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ChangeLocationResponse) ProtoMessage() {} - -func (x *ChangeLocationResponse) ProtoReflect() protoreflect.Message { - mi := &file_backup_v1_locations_proto_msgTypes[8] - 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 ChangeLocationResponse.ProtoReflect.Descriptor instead. -func (*ChangeLocationResponse) Descriptor() ([]byte, []int) { - return file_backup_v1_locations_proto_rawDescGZIP(), []int{8} -} - -type RemoveLocationRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Machine-readable ID. - LocationId string `protobuf:"bytes,1,opt,name=location_id,json=locationId,proto3" json:"location_id,omitempty"` - // Force mode - Force bool `protobuf:"varint,2,opt,name=force,proto3" json:"force,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *RemoveLocationRequest) Reset() { - *x = RemoveLocationRequest{} - mi := &file_backup_v1_locations_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *RemoveLocationRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RemoveLocationRequest) ProtoMessage() {} - -func (x *RemoveLocationRequest) ProtoReflect() protoreflect.Message { - mi := &file_backup_v1_locations_proto_msgTypes[9] - 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 RemoveLocationRequest.ProtoReflect.Descriptor instead. -func (*RemoveLocationRequest) Descriptor() ([]byte, []int) { - return file_backup_v1_locations_proto_rawDescGZIP(), []int{9} -} - -func (x *RemoveLocationRequest) GetLocationId() string { - if x != nil { - return x.LocationId - } - return "" -} - -func (x *RemoveLocationRequest) GetForce() bool { - if x != nil { - return x.Force - } - return false -} - -type RemoveLocationResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *RemoveLocationResponse) Reset() { - *x = RemoveLocationResponse{} - mi := &file_backup_v1_locations_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *RemoveLocationResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RemoveLocationResponse) ProtoMessage() {} - -func (x *RemoveLocationResponse) ProtoReflect() protoreflect.Message { - mi := &file_backup_v1_locations_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 RemoveLocationResponse.ProtoReflect.Descriptor instead. -func (*RemoveLocationResponse) Descriptor() ([]byte, []int) { - return file_backup_v1_locations_proto_rawDescGZIP(), []int{10} -} - -type TestLocationConfigRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Filesystem location configuration. Exactly one config should be set. - FilesystemConfig *FilesystemLocationConfig `protobuf:"bytes,1,opt,name=filesystem_config,json=filesystemConfig,proto3" json:"filesystem_config,omitempty"` - // S3 Bucket configuration. Exactly one config should be set. - S3Config *S3LocationConfig `protobuf:"bytes,2,opt,name=s3_config,json=s3Config,proto3" json:"s3_config,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *TestLocationConfigRequest) Reset() { - *x = TestLocationConfigRequest{} - mi := &file_backup_v1_locations_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *TestLocationConfigRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*TestLocationConfigRequest) ProtoMessage() {} - -func (x *TestLocationConfigRequest) ProtoReflect() protoreflect.Message { - mi := &file_backup_v1_locations_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 TestLocationConfigRequest.ProtoReflect.Descriptor instead. -func (*TestLocationConfigRequest) Descriptor() ([]byte, []int) { - return file_backup_v1_locations_proto_rawDescGZIP(), []int{11} -} - -func (x *TestLocationConfigRequest) GetFilesystemConfig() *FilesystemLocationConfig { - if x != nil { - return x.FilesystemConfig - } - return nil -} - -func (x *TestLocationConfigRequest) GetS3Config() *S3LocationConfig { - if x != nil { - return x.S3Config - } - return nil -} - -type TestLocationConfigResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *TestLocationConfigResponse) Reset() { - *x = TestLocationConfigResponse{} - mi := &file_backup_v1_locations_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *TestLocationConfigResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*TestLocationConfigResponse) ProtoMessage() {} - -func (x *TestLocationConfigResponse) ProtoReflect() protoreflect.Message { - mi := &file_backup_v1_locations_proto_msgTypes[12] - 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 TestLocationConfigResponse.ProtoReflect.Descriptor instead. -func (*TestLocationConfigResponse) Descriptor() ([]byte, []int) { - return file_backup_v1_locations_proto_rawDescGZIP(), []int{12} -} - -var File_backup_v1_locations_proto protoreflect.FileDescriptor - -const file_backup_v1_locations_proto_rawDesc = "" + - "\n" + - "\x19backup/v1/locations.proto\x12\tbackup.v1\x1a\x1cgoogle/api/annotations.proto\x1a.protoc-gen-openapiv2/options/annotations.proto\x1a\x17validate/validate.proto\"7\n" + - "\x18FilesystemLocationConfig\x12\x1b\n" + - "\x04path\x18\x01 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\x04path\"\xb1\x01\n" + - "\x10S3LocationConfig\x12#\n" + - "\bendpoint\x18\x01 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\bendpoint\x12&\n" + - "\n" + - "access_key\x18\x02 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\taccessKey\x12&\n" + - "\n" + - "secret_key\x18\x03 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\tsecretKey\x12(\n" + - "\vbucket_name\x18\x04 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\n" + - "bucketName\"\xfb\x01\n" + - "\bLocation\x12\x1f\n" + - "\vlocation_id\x18\x01 \x01(\tR\n" + - "locationId\x12\x12\n" + - "\x04name\x18\x02 \x01(\tR\x04name\x12 \n" + - "\vdescription\x18\x03 \x01(\tR\vdescription\x12R\n" + - "\x11filesystem_config\x18\x04 \x01(\v2#.backup.v1.FilesystemLocationConfigH\x00R\x10filesystemConfig\x12:\n" + - "\ts3_config\x18\x05 \x01(\v2\x1b.backup.v1.S3LocationConfigH\x00R\bs3ConfigB\b\n" + - "\x06config\"\x16\n" + - "\x14ListLocationsRequest\"J\n" + - "\x15ListLocationsResponse\x121\n" + - "\tlocations\x18\x01 \x03(\v2\x13.backup.v1.LocationR\tlocations\"\xdf\x01\n" + - "\x12AddLocationRequest\x12\x1b\n" + - "\x04name\x18\x01 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\x04name\x12 \n" + - "\vdescription\x18\x02 \x01(\tR\vdescription\x12P\n" + - "\x11filesystem_config\x18\x03 \x01(\v2#.backup.v1.FilesystemLocationConfigR\x10filesystemConfig\x128\n" + - "\ts3_config\x18\x04 \x01(\v2\x1b.backup.v1.S3LocationConfigR\bs3Config\"6\n" + - "\x13AddLocationResponse\x12\x1f\n" + - "\vlocation_id\x18\x01 \x01(\tR\n" + - "locationId\"\x83\x02\n" + - "\x15ChangeLocationRequest\x12(\n" + - "\vlocation_id\x18\x01 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\n" + - "locationId\x12\x12\n" + - "\x04name\x18\x02 \x01(\tR\x04name\x12 \n" + - "\vdescription\x18\x03 \x01(\tR\vdescription\x12P\n" + - "\x11filesystem_config\x18\x04 \x01(\v2#.backup.v1.FilesystemLocationConfigR\x10filesystemConfig\x128\n" + - "\ts3_config\x18\x05 \x01(\v2\x1b.backup.v1.S3LocationConfigR\bs3Config\"\x18\n" + - "\x16ChangeLocationResponse\"N\n" + - "\x15RemoveLocationRequest\x12\x1f\n" + - "\vlocation_id\x18\x01 \x01(\tR\n" + - "locationId\x12\x14\n" + - "\x05force\x18\x02 \x01(\bR\x05force\"\x18\n" + - "\x16RemoveLocationResponse\"\xa7\x01\n" + - "\x19TestLocationConfigRequest\x12P\n" + - "\x11filesystem_config\x18\x01 \x01(\v2#.backup.v1.FilesystemLocationConfigR\x10filesystemConfig\x128\n" + - "\ts3_config\x18\x02 \x01(\v2\x1b.backup.v1.S3LocationConfigR\bs3Config\"\x1c\n" + - "\x1aTestLocationConfigResponse2\xbe\a\n" + - "\x10LocationsService\x12\xa3\x01\n" + - "\rListLocations\x12\x1f.backup.v1.ListLocationsRequest\x1a .backup.v1.ListLocationsResponse\"O\x92A/\x12\x15List Backup Locations\x1a\x16List backup locations.\x82\xd3\xe4\x93\x02\x17\x12\x15/v1/backups/locations\x12\xa0\x01\n" + - "\vAddLocation\x12\x1d.backup.v1.AddLocationRequest\x1a\x1e.backup.v1.AddLocationResponse\"R\x92A/\x12\x15Add a Backup Location\x1a\x16Add a backup location.\x82\xd3\xe4\x93\x02\x1a:\x01*\"\x15/v1/backups/locations\x12\xbd\x01\n" + - "\x0eChangeLocation\x12 .backup.v1.ChangeLocationRequest\x1a!.backup.v1.ChangeLocationResponse\"f\x92A5\x12\x18Change a Backup Location\x1a\x19Change a backup location.\x82\xd3\xe4\x93\x02(:\x01*\x1a#/v1/backups/locations/{location_id}\x12\xbb\x01\n" + - "\x0eRemoveLocation\x12 .backup.v1.RemoveLocationRequest\x1a!.backup.v1.RemoveLocationResponse\"d\x92A6\x12\x19Remove a Scheduled Backup\x1a\x19Remove a backup location.\x82\xd3\xe4\x93\x02%*#/v1/backups/locations/{location_id}\x12\xe2\x01\n" + - "\x12TestLocationConfig\x12$.backup.v1.TestLocationConfigRequest\x1a%.backup.v1.TestLocationConfigResponse\"\x7f\x92AQ\x12&Test a Backup Location and Credentials\x1a'Test a backup location and credentials.\x82\xd3\xe4\x93\x02%:\x01*\" /v1/backups/locations:testConfigB\x93\x01\n" + - "\rcom.backup.v1B\x0eLocationsProtoP\x01Z-github.com/percona/pmm/api/backup/v1;backupv1\xa2\x02\x03BXX\xaa\x02\tBackup.V1\xca\x02\tBackup\\V1\xe2\x02\x15Backup\\V1\\GPBMetadata\xea\x02\n" + - "Backup::V1b\x06proto3" - -var ( - file_backup_v1_locations_proto_rawDescOnce sync.Once - file_backup_v1_locations_proto_rawDescData []byte -) - -func file_backup_v1_locations_proto_rawDescGZIP() []byte { - file_backup_v1_locations_proto_rawDescOnce.Do(func() { - file_backup_v1_locations_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_backup_v1_locations_proto_rawDesc), len(file_backup_v1_locations_proto_rawDesc))) - }) - 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_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 - 2, // 2: backup.v1.ListLocationsResponse.locations:type_name -> backup.v1.Location - 0, // 3: backup.v1.AddLocationRequest.filesystem_config:type_name -> backup.v1.FilesystemLocationConfig - 1, // 4: backup.v1.AddLocationRequest.s3_config:type_name -> backup.v1.S3LocationConfig - 0, // 5: backup.v1.ChangeLocationRequest.filesystem_config:type_name -> backup.v1.FilesystemLocationConfig - 1, // 6: backup.v1.ChangeLocationRequest.s3_config:type_name -> backup.v1.S3LocationConfig - 0, // 7: backup.v1.TestLocationConfigRequest.filesystem_config:type_name -> backup.v1.FilesystemLocationConfig - 1, // 8: backup.v1.TestLocationConfigRequest.s3_config:type_name -> backup.v1.S3LocationConfig - 3, // 9: backup.v1.LocationsService.ListLocations:input_type -> backup.v1.ListLocationsRequest - 5, // 10: backup.v1.LocationsService.AddLocation:input_type -> backup.v1.AddLocationRequest - 7, // 11: backup.v1.LocationsService.ChangeLocation:input_type -> backup.v1.ChangeLocationRequest - 9, // 12: backup.v1.LocationsService.RemoveLocation:input_type -> backup.v1.RemoveLocationRequest - 11, // 13: backup.v1.LocationsService.TestLocationConfig:input_type -> backup.v1.TestLocationConfigRequest - 4, // 14: backup.v1.LocationsService.ListLocations:output_type -> backup.v1.ListLocationsResponse - 6, // 15: backup.v1.LocationsService.AddLocation:output_type -> backup.v1.AddLocationResponse - 8, // 16: backup.v1.LocationsService.ChangeLocation:output_type -> backup.v1.ChangeLocationResponse - 10, // 17: backup.v1.LocationsService.RemoveLocation:output_type -> backup.v1.RemoveLocationResponse - 12, // 18: backup.v1.LocationsService.TestLocationConfig:output_type -> backup.v1.TestLocationConfigResponse - 14, // [14:19] is the sub-list for method output_type - 9, // [9:14] is the sub-list for method input_type - 9, // [9:9] is the sub-list for extension type_name - 9, // [9:9] is the sub-list for extension extendee - 0, // [0:9] is the sub-list for field type_name -} - -func init() { file_backup_v1_locations_proto_init() } -func file_backup_v1_locations_proto_init() { - if File_backup_v1_locations_proto != nil { - return - } - file_backup_v1_locations_proto_msgTypes[2].OneofWrappers = []any{ - (*Location_FilesystemConfig)(nil), - (*Location_S3Config)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_backup_v1_locations_proto_rawDesc), len(file_backup_v1_locations_proto_rawDesc)), - NumEnums: 0, - NumMessages: 13, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_backup_v1_locations_proto_goTypes, - DependencyIndexes: file_backup_v1_locations_proto_depIdxs, - MessageInfos: file_backup_v1_locations_proto_msgTypes, - }.Build() - File_backup_v1_locations_proto = out.File - file_backup_v1_locations_proto_goTypes = nil - file_backup_v1_locations_proto_depIdxs = nil -} diff --git a/api/backup/v1/locations.pb.gw.go b/api/backup/v1/locations.pb.gw.go deleted file mode 100644 index c64c3d1176a..00000000000 --- a/api/backup/v1/locations.pb.gw.go +++ /dev/null @@ -1,459 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: backup/v1/locations.proto - -/* -Package backupv1 is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package backupv1 - -import ( - "context" - "errors" - "io" - "net/http" - - "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" - "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" - "google.golang.org/protobuf/proto" -) - -// Suppress "imported and not used" errors -var ( - _ codes.Code - _ io.Reader - _ status.Status - _ = errors.New - _ = runtime.String - _ = utilities.NewDoubleArray - _ = metadata.Join -) - -func request_LocationsService_ListLocations_0(ctx context.Context, marshaler runtime.Marshaler, client LocationsServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq ListLocationsRequest - metadata runtime.ServerMetadata - ) - if req.Body != nil { - _, _ = io.Copy(io.Discard, req.Body) - } - msg, err := client.ListLocations(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_LocationsService_ListLocations_0(ctx context.Context, marshaler runtime.Marshaler, server LocationsServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq ListLocationsRequest - metadata runtime.ServerMetadata - ) - msg, err := server.ListLocations(ctx, &protoReq) - return msg, metadata, err -} - -func request_LocationsService_AddLocation_0(ctx context.Context, marshaler runtime.Marshaler, client LocationsServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq AddLocationRequest - 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.AddLocation(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_LocationsService_AddLocation_0(ctx context.Context, marshaler runtime.Marshaler, server LocationsServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq AddLocationRequest - 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.AddLocation(ctx, &protoReq) - return msg, metadata, err -} - -func request_LocationsService_ChangeLocation_0(ctx context.Context, marshaler runtime.Marshaler, client LocationsServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq ChangeLocationRequest - metadata runtime.ServerMetadata - err error - ) - 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) - } - val, ok := pathParams["location_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "location_id") - } - protoReq.LocationId, err = runtime.String(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "location_id", err) - } - msg, err := client.ChangeLocation(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_LocationsService_ChangeLocation_0(ctx context.Context, marshaler runtime.Marshaler, server LocationsServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq ChangeLocationRequest - metadata runtime.ServerMetadata - err error - ) - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - val, ok := pathParams["location_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "location_id") - } - protoReq.LocationId, err = runtime.String(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "location_id", err) - } - msg, err := server.ChangeLocation(ctx, &protoReq) - return msg, metadata, err -} - -var filter_LocationsService_RemoveLocation_0 = &utilities.DoubleArray{Encoding: map[string]int{"location_id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} - -func request_LocationsService_RemoveLocation_0(ctx context.Context, marshaler runtime.Marshaler, client LocationsServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq RemoveLocationRequest - metadata runtime.ServerMetadata - err error - ) - if req.Body != nil { - _, _ = io.Copy(io.Discard, req.Body) - } - val, ok := pathParams["location_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "location_id") - } - protoReq.LocationId, err = runtime.String(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "location_id", err) - } - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_LocationsService_RemoveLocation_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - msg, err := client.RemoveLocation(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_LocationsService_RemoveLocation_0(ctx context.Context, marshaler runtime.Marshaler, server LocationsServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq RemoveLocationRequest - metadata runtime.ServerMetadata - err error - ) - val, ok := pathParams["location_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "location_id") - } - protoReq.LocationId, err = runtime.String(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "location_id", err) - } - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_LocationsService_RemoveLocation_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - msg, err := server.RemoveLocation(ctx, &protoReq) - return msg, metadata, err -} - -func request_LocationsService_TestLocationConfig_0(ctx context.Context, marshaler runtime.Marshaler, client LocationsServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq TestLocationConfigRequest - 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.TestLocationConfig(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_LocationsService_TestLocationConfig_0(ctx context.Context, marshaler runtime.Marshaler, server LocationsServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq TestLocationConfigRequest - 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.TestLocationConfig(ctx, &protoReq) - return msg, metadata, err -} - -// RegisterLocationsServiceHandlerServer registers the http handlers for service LocationsService to "mux". -// UnaryRPC :call LocationsServiceServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterLocationsServiceHandlerFromEndpoint instead. -// GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call. -func RegisterLocationsServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server LocationsServiceServer) error { - mux.Handle(http.MethodGet, pattern_LocationsService_ListLocations_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, "/backup.v1.LocationsService/ListLocations", runtime.WithHTTPPathPattern("/v1/backups/locations")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_LocationsService_ListLocations_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_LocationsService_ListLocations_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPost, pattern_LocationsService_AddLocation_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, "/backup.v1.LocationsService/AddLocation", runtime.WithHTTPPathPattern("/v1/backups/locations")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_LocationsService_AddLocation_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_LocationsService_AddLocation_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPut, pattern_LocationsService_ChangeLocation_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, "/backup.v1.LocationsService/ChangeLocation", runtime.WithHTTPPathPattern("/v1/backups/locations/{location_id}")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_LocationsService_ChangeLocation_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_LocationsService_ChangeLocation_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodDelete, pattern_LocationsService_RemoveLocation_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, "/backup.v1.LocationsService/RemoveLocation", runtime.WithHTTPPathPattern("/v1/backups/locations/{location_id}")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_LocationsService_RemoveLocation_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_LocationsService_RemoveLocation_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPost, pattern_LocationsService_TestLocationConfig_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, "/backup.v1.LocationsService/TestLocationConfig", runtime.WithHTTPPathPattern("/v1/backups/locations:testConfig")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_LocationsService_TestLocationConfig_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_LocationsService_TestLocationConfig_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - return nil -} - -// RegisterLocationsServiceHandlerFromEndpoint is same as RegisterLocationsServiceHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterLocationsServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.NewClient(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - return RegisterLocationsServiceHandler(ctx, mux, conn) -} - -// RegisterLocationsServiceHandler registers the http handlers for service LocationsService to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterLocationsServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterLocationsServiceHandlerClient(ctx, mux, NewLocationsServiceClient(conn)) -} - -// RegisterLocationsServiceHandlerClient registers the http handlers for service LocationsService -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "LocationsServiceClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "LocationsServiceClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "LocationsServiceClient" to call the correct interceptors. This client ignores the HTTP middlewares. -func RegisterLocationsServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client LocationsServiceClient) error { - mux.Handle(http.MethodGet, pattern_LocationsService_ListLocations_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, "/backup.v1.LocationsService/ListLocations", runtime.WithHTTPPathPattern("/v1/backups/locations")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_LocationsService_ListLocations_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_LocationsService_ListLocations_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPost, pattern_LocationsService_AddLocation_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, "/backup.v1.LocationsService/AddLocation", runtime.WithHTTPPathPattern("/v1/backups/locations")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_LocationsService_AddLocation_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_LocationsService_AddLocation_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPut, pattern_LocationsService_ChangeLocation_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, "/backup.v1.LocationsService/ChangeLocation", runtime.WithHTTPPathPattern("/v1/backups/locations/{location_id}")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_LocationsService_ChangeLocation_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_LocationsService_ChangeLocation_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodDelete, pattern_LocationsService_RemoveLocation_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, "/backup.v1.LocationsService/RemoveLocation", runtime.WithHTTPPathPattern("/v1/backups/locations/{location_id}")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_LocationsService_RemoveLocation_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_LocationsService_RemoveLocation_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPost, pattern_LocationsService_TestLocationConfig_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, "/backup.v1.LocationsService/TestLocationConfig", runtime.WithHTTPPathPattern("/v1/backups/locations:testConfig")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_LocationsService_TestLocationConfig_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_LocationsService_TestLocationConfig_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - return nil -} - -var ( - pattern_LocationsService_ListLocations_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "backups", "locations"}, "")) - pattern_LocationsService_AddLocation_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "backups", "locations"}, "")) - pattern_LocationsService_ChangeLocation_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "backups", "locations", "location_id"}, "")) - pattern_LocationsService_RemoveLocation_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "backups", "locations", "location_id"}, "")) - pattern_LocationsService_TestLocationConfig_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "backups", "locations"}, "testConfig")) -) - -var ( - forward_LocationsService_ListLocations_0 = runtime.ForwardResponseMessage - forward_LocationsService_AddLocation_0 = runtime.ForwardResponseMessage - forward_LocationsService_ChangeLocation_0 = runtime.ForwardResponseMessage - forward_LocationsService_RemoveLocation_0 = runtime.ForwardResponseMessage - forward_LocationsService_TestLocationConfig_0 = runtime.ForwardResponseMessage -) diff --git a/api/backup/v1/locations.pb.validate.go b/api/backup/v1/locations.pb.validate.go deleted file mode 100644 index 04d465b6e6c..00000000000 --- a/api/backup/v1/locations.pb.validate.go +++ /dev/null @@ -1,1747 +0,0 @@ -// Code generated by protoc-gen-validate. DO NOT EDIT. -// source: backup/v1/locations.proto - -package backupv1 - -import ( - "bytes" - "errors" - "fmt" - "net" - "net/mail" - "net/url" - "regexp" - "sort" - "strings" - "time" - "unicode/utf8" - - "google.golang.org/protobuf/types/known/anypb" -) - -// ensure the imports are used -var ( - _ = bytes.MinRead - _ = errors.New("") - _ = fmt.Print - _ = utf8.UTFMax - _ = (*regexp.Regexp)(nil) - _ = (*strings.Reader)(nil) - _ = net.IPv4len - _ = time.Duration(0) - _ = (*url.URL)(nil) - _ = (*mail.Address)(nil) - _ = anypb.Any{} - _ = sort.Sort -) - -// Validate checks the field values on FilesystemLocationConfig 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 *FilesystemLocationConfig) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on FilesystemLocationConfig 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 -// FilesystemLocationConfigMultiError, or nil if none found. -func (m *FilesystemLocationConfig) ValidateAll() error { - return m.validate(true) -} - -func (m *FilesystemLocationConfig) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetPath()) < 1 { - err := FilesystemLocationConfigValidationError{ - field: "Path", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if len(errors) > 0 { - return FilesystemLocationConfigMultiError(errors) - } - - return nil -} - -// FilesystemLocationConfigMultiError is an error wrapping multiple validation -// errors returned by FilesystemLocationConfig.ValidateAll() if the designated -// constraints aren't met. -type FilesystemLocationConfigMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m FilesystemLocationConfigMultiError) 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 FilesystemLocationConfigMultiError) AllErrors() []error { return m } - -// FilesystemLocationConfigValidationError is the validation error returned by -// FilesystemLocationConfig.Validate if the designated constraints aren't met. -type FilesystemLocationConfigValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e FilesystemLocationConfigValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e FilesystemLocationConfigValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e FilesystemLocationConfigValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e FilesystemLocationConfigValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e FilesystemLocationConfigValidationError) ErrorName() string { - return "FilesystemLocationConfigValidationError" -} - -// Error satisfies the builtin error interface -func (e FilesystemLocationConfigValidationError) 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 %sFilesystemLocationConfig.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = FilesystemLocationConfigValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = FilesystemLocationConfigValidationError{} - -// Validate checks the field values on S3LocationConfig 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 *S3LocationConfig) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on S3LocationConfig 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 -// S3LocationConfigMultiError, or nil if none found. -func (m *S3LocationConfig) ValidateAll() error { - return m.validate(true) -} - -func (m *S3LocationConfig) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetEndpoint()) < 1 { - err := S3LocationConfigValidationError{ - field: "Endpoint", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if utf8.RuneCountInString(m.GetAccessKey()) < 1 { - err := S3LocationConfigValidationError{ - field: "AccessKey", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if utf8.RuneCountInString(m.GetSecretKey()) < 1 { - err := S3LocationConfigValidationError{ - field: "SecretKey", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if utf8.RuneCountInString(m.GetBucketName()) < 1 { - err := S3LocationConfigValidationError{ - field: "BucketName", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if len(errors) > 0 { - return S3LocationConfigMultiError(errors) - } - - return nil -} - -// S3LocationConfigMultiError is an error wrapping multiple validation errors -// returned by S3LocationConfig.ValidateAll() if the designated constraints -// aren't met. -type S3LocationConfigMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m S3LocationConfigMultiError) 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 S3LocationConfigMultiError) AllErrors() []error { return m } - -// S3LocationConfigValidationError is the validation error returned by -// S3LocationConfig.Validate if the designated constraints aren't met. -type S3LocationConfigValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e S3LocationConfigValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e S3LocationConfigValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e S3LocationConfigValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e S3LocationConfigValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e S3LocationConfigValidationError) ErrorName() string { return "S3LocationConfigValidationError" } - -// Error satisfies the builtin error interface -func (e S3LocationConfigValidationError) 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 %sS3LocationConfig.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = S3LocationConfigValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = S3LocationConfigValidationError{} - -// Validate checks the field values on Location 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 *Location) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on Location 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 LocationMultiError, or nil -// if none found. -func (m *Location) ValidateAll() error { - return m.validate(true) -} - -func (m *Location) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for LocationId - - // no validation rules for Name - - // no validation rules for Description - - switch v := m.Config.(type) { - case *Location_FilesystemConfig: - if v == nil { - err := LocationValidationError{ - field: "Config", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetFilesystemConfig()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, LocationValidationError{ - field: "FilesystemConfig", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, LocationValidationError{ - field: "FilesystemConfig", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetFilesystemConfig()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return LocationValidationError{ - field: "FilesystemConfig", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *Location_S3Config: - if v == nil { - err := LocationValidationError{ - field: "Config", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetS3Config()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, LocationValidationError{ - field: "S3Config", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, LocationValidationError{ - field: "S3Config", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetS3Config()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return LocationValidationError{ - field: "S3Config", - reason: "embedded message failed validation", - cause: err, - } - } - } - - default: - _ = v // ensures v is used - } - - if len(errors) > 0 { - return LocationMultiError(errors) - } - - return nil -} - -// LocationMultiError is an error wrapping multiple validation errors returned -// by Location.ValidateAll() if the designated constraints aren't met. -type LocationMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m LocationMultiError) 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 LocationMultiError) AllErrors() []error { return m } - -// LocationValidationError is the validation error returned by -// Location.Validate if the designated constraints aren't met. -type LocationValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e LocationValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e LocationValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e LocationValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e LocationValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e LocationValidationError) ErrorName() string { return "LocationValidationError" } - -// Error satisfies the builtin error interface -func (e LocationValidationError) 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 %sLocation.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = LocationValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = LocationValidationError{} - -// Validate checks the field values on ListLocationsRequest 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 *ListLocationsRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ListLocationsRequest 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 -// ListLocationsRequestMultiError, or nil if none found. -func (m *ListLocationsRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *ListLocationsRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return ListLocationsRequestMultiError(errors) - } - - return nil -} - -// ListLocationsRequestMultiError is an error wrapping multiple validation -// errors returned by ListLocationsRequest.ValidateAll() if the designated -// constraints aren't met. -type ListLocationsRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ListLocationsRequestMultiError) 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 ListLocationsRequestMultiError) AllErrors() []error { return m } - -// ListLocationsRequestValidationError is the validation error returned by -// ListLocationsRequest.Validate if the designated constraints aren't met. -type ListLocationsRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ListLocationsRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ListLocationsRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ListLocationsRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ListLocationsRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ListLocationsRequestValidationError) ErrorName() string { - return "ListLocationsRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e ListLocationsRequestValidationError) 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 %sListLocationsRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ListLocationsRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ListLocationsRequestValidationError{} - -// Validate checks the field values on ListLocationsResponse 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 *ListLocationsResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ListLocationsResponse 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 -// ListLocationsResponseMultiError, or nil if none found. -func (m *ListLocationsResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *ListLocationsResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - for idx, item := range m.GetLocations() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ListLocationsResponseValidationError{ - field: fmt.Sprintf("Locations[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ListLocationsResponseValidationError{ - field: fmt.Sprintf("Locations[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ListLocationsResponseValidationError{ - field: fmt.Sprintf("Locations[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - if len(errors) > 0 { - return ListLocationsResponseMultiError(errors) - } - - return nil -} - -// ListLocationsResponseMultiError is an error wrapping multiple validation -// errors returned by ListLocationsResponse.ValidateAll() if the designated -// constraints aren't met. -type ListLocationsResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ListLocationsResponseMultiError) 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 ListLocationsResponseMultiError) AllErrors() []error { return m } - -// ListLocationsResponseValidationError is the validation error returned by -// ListLocationsResponse.Validate if the designated constraints aren't met. -type ListLocationsResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ListLocationsResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ListLocationsResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ListLocationsResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ListLocationsResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ListLocationsResponseValidationError) ErrorName() string { - return "ListLocationsResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e ListLocationsResponseValidationError) 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 %sListLocationsResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ListLocationsResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ListLocationsResponseValidationError{} - -// Validate checks the field values on AddLocationRequest 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 *AddLocationRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on AddLocationRequest 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 -// AddLocationRequestMultiError, or nil if none found. -func (m *AddLocationRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *AddLocationRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetName()) < 1 { - err := AddLocationRequestValidationError{ - field: "Name", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for Description - - if all { - switch v := interface{}(m.GetFilesystemConfig()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AddLocationRequestValidationError{ - field: "FilesystemConfig", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AddLocationRequestValidationError{ - field: "FilesystemConfig", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetFilesystemConfig()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AddLocationRequestValidationError{ - field: "FilesystemConfig", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetS3Config()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AddLocationRequestValidationError{ - field: "S3Config", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AddLocationRequestValidationError{ - field: "S3Config", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetS3Config()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AddLocationRequestValidationError{ - field: "S3Config", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if len(errors) > 0 { - return AddLocationRequestMultiError(errors) - } - - return nil -} - -// AddLocationRequestMultiError is an error wrapping multiple validation errors -// returned by AddLocationRequest.ValidateAll() if the designated constraints -// aren't met. -type AddLocationRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m AddLocationRequestMultiError) 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 AddLocationRequestMultiError) AllErrors() []error { return m } - -// AddLocationRequestValidationError is the validation error returned by -// AddLocationRequest.Validate if the designated constraints aren't met. -type AddLocationRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e AddLocationRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e AddLocationRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e AddLocationRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e AddLocationRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e AddLocationRequestValidationError) ErrorName() string { - return "AddLocationRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e AddLocationRequestValidationError) 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 %sAddLocationRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = AddLocationRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = AddLocationRequestValidationError{} - -// Validate checks the field values on AddLocationResponse 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 *AddLocationResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on AddLocationResponse 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 -// AddLocationResponseMultiError, or nil if none found. -func (m *AddLocationResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *AddLocationResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for LocationId - - if len(errors) > 0 { - return AddLocationResponseMultiError(errors) - } - - return nil -} - -// AddLocationResponseMultiError is an error wrapping multiple validation -// errors returned by AddLocationResponse.ValidateAll() if the designated -// constraints aren't met. -type AddLocationResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m AddLocationResponseMultiError) 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 AddLocationResponseMultiError) AllErrors() []error { return m } - -// AddLocationResponseValidationError is the validation error returned by -// AddLocationResponse.Validate if the designated constraints aren't met. -type AddLocationResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e AddLocationResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e AddLocationResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e AddLocationResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e AddLocationResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e AddLocationResponseValidationError) ErrorName() string { - return "AddLocationResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e AddLocationResponseValidationError) 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 %sAddLocationResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = AddLocationResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = AddLocationResponseValidationError{} - -// Validate checks the field values on ChangeLocationRequest 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 *ChangeLocationRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ChangeLocationRequest 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 -// ChangeLocationRequestMultiError, or nil if none found. -func (m *ChangeLocationRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *ChangeLocationRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetLocationId()) < 1 { - err := ChangeLocationRequestValidationError{ - field: "LocationId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for Name - - // no validation rules for Description - - if all { - switch v := interface{}(m.GetFilesystemConfig()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeLocationRequestValidationError{ - field: "FilesystemConfig", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeLocationRequestValidationError{ - field: "FilesystemConfig", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetFilesystemConfig()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeLocationRequestValidationError{ - field: "FilesystemConfig", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetS3Config()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeLocationRequestValidationError{ - field: "S3Config", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeLocationRequestValidationError{ - field: "S3Config", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetS3Config()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeLocationRequestValidationError{ - field: "S3Config", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if len(errors) > 0 { - return ChangeLocationRequestMultiError(errors) - } - - return nil -} - -// ChangeLocationRequestMultiError is an error wrapping multiple validation -// errors returned by ChangeLocationRequest.ValidateAll() if the designated -// constraints aren't met. -type ChangeLocationRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ChangeLocationRequestMultiError) 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 ChangeLocationRequestMultiError) AllErrors() []error { return m } - -// ChangeLocationRequestValidationError is the validation error returned by -// ChangeLocationRequest.Validate if the designated constraints aren't met. -type ChangeLocationRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ChangeLocationRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ChangeLocationRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ChangeLocationRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ChangeLocationRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ChangeLocationRequestValidationError) ErrorName() string { - return "ChangeLocationRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e ChangeLocationRequestValidationError) 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 %sChangeLocationRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ChangeLocationRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ChangeLocationRequestValidationError{} - -// Validate checks the field values on ChangeLocationResponse 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 *ChangeLocationResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ChangeLocationResponse 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 -// ChangeLocationResponseMultiError, or nil if none found. -func (m *ChangeLocationResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *ChangeLocationResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return ChangeLocationResponseMultiError(errors) - } - - return nil -} - -// ChangeLocationResponseMultiError is an error wrapping multiple validation -// errors returned by ChangeLocationResponse.ValidateAll() if the designated -// constraints aren't met. -type ChangeLocationResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ChangeLocationResponseMultiError) 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 ChangeLocationResponseMultiError) AllErrors() []error { return m } - -// ChangeLocationResponseValidationError is the validation error returned by -// ChangeLocationResponse.Validate if the designated constraints aren't met. -type ChangeLocationResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ChangeLocationResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ChangeLocationResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ChangeLocationResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ChangeLocationResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ChangeLocationResponseValidationError) ErrorName() string { - return "ChangeLocationResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e ChangeLocationResponseValidationError) 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 %sChangeLocationResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ChangeLocationResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ChangeLocationResponseValidationError{} - -// Validate checks the field values on RemoveLocationRequest 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 *RemoveLocationRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on RemoveLocationRequest 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 -// RemoveLocationRequestMultiError, or nil if none found. -func (m *RemoveLocationRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *RemoveLocationRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for LocationId - - // no validation rules for Force - - if len(errors) > 0 { - return RemoveLocationRequestMultiError(errors) - } - - return nil -} - -// RemoveLocationRequestMultiError is an error wrapping multiple validation -// errors returned by RemoveLocationRequest.ValidateAll() if the designated -// constraints aren't met. -type RemoveLocationRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m RemoveLocationRequestMultiError) 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 RemoveLocationRequestMultiError) AllErrors() []error { return m } - -// RemoveLocationRequestValidationError is the validation error returned by -// RemoveLocationRequest.Validate if the designated constraints aren't met. -type RemoveLocationRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e RemoveLocationRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e RemoveLocationRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e RemoveLocationRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e RemoveLocationRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e RemoveLocationRequestValidationError) ErrorName() string { - return "RemoveLocationRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e RemoveLocationRequestValidationError) 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 %sRemoveLocationRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = RemoveLocationRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = RemoveLocationRequestValidationError{} - -// Validate checks the field values on RemoveLocationResponse 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 *RemoveLocationResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on RemoveLocationResponse 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 -// RemoveLocationResponseMultiError, or nil if none found. -func (m *RemoveLocationResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *RemoveLocationResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return RemoveLocationResponseMultiError(errors) - } - - return nil -} - -// RemoveLocationResponseMultiError is an error wrapping multiple validation -// errors returned by RemoveLocationResponse.ValidateAll() if the designated -// constraints aren't met. -type RemoveLocationResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m RemoveLocationResponseMultiError) 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 RemoveLocationResponseMultiError) AllErrors() []error { return m } - -// RemoveLocationResponseValidationError is the validation error returned by -// RemoveLocationResponse.Validate if the designated constraints aren't met. -type RemoveLocationResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e RemoveLocationResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e RemoveLocationResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e RemoveLocationResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e RemoveLocationResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e RemoveLocationResponseValidationError) ErrorName() string { - return "RemoveLocationResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e RemoveLocationResponseValidationError) 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 %sRemoveLocationResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = RemoveLocationResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = RemoveLocationResponseValidationError{} - -// Validate checks the field values on TestLocationConfigRequest 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 *TestLocationConfigRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on TestLocationConfigRequest 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 -// TestLocationConfigRequestMultiError, or nil if none found. -func (m *TestLocationConfigRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *TestLocationConfigRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if all { - switch v := interface{}(m.GetFilesystemConfig()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, TestLocationConfigRequestValidationError{ - field: "FilesystemConfig", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, TestLocationConfigRequestValidationError{ - field: "FilesystemConfig", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetFilesystemConfig()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return TestLocationConfigRequestValidationError{ - field: "FilesystemConfig", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetS3Config()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, TestLocationConfigRequestValidationError{ - field: "S3Config", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, TestLocationConfigRequestValidationError{ - field: "S3Config", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetS3Config()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return TestLocationConfigRequestValidationError{ - field: "S3Config", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if len(errors) > 0 { - return TestLocationConfigRequestMultiError(errors) - } - - return nil -} - -// TestLocationConfigRequestMultiError is an error wrapping multiple validation -// errors returned by TestLocationConfigRequest.ValidateAll() if the -// designated constraints aren't met. -type TestLocationConfigRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m TestLocationConfigRequestMultiError) 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 TestLocationConfigRequestMultiError) AllErrors() []error { return m } - -// TestLocationConfigRequestValidationError is the validation error returned by -// TestLocationConfigRequest.Validate if the designated constraints aren't met. -type TestLocationConfigRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e TestLocationConfigRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e TestLocationConfigRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e TestLocationConfigRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e TestLocationConfigRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e TestLocationConfigRequestValidationError) ErrorName() string { - return "TestLocationConfigRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e TestLocationConfigRequestValidationError) 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 %sTestLocationConfigRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = TestLocationConfigRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = TestLocationConfigRequestValidationError{} - -// Validate checks the field values on TestLocationConfigResponse 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 *TestLocationConfigResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on TestLocationConfigResponse 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 -// TestLocationConfigResponseMultiError, or nil if none found. -func (m *TestLocationConfigResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *TestLocationConfigResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return TestLocationConfigResponseMultiError(errors) - } - - return nil -} - -// TestLocationConfigResponseMultiError is an error wrapping multiple -// validation errors returned by TestLocationConfigResponse.ValidateAll() if -// the designated constraints aren't met. -type TestLocationConfigResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m TestLocationConfigResponseMultiError) 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 TestLocationConfigResponseMultiError) AllErrors() []error { return m } - -// TestLocationConfigResponseValidationError is the validation error returned -// by TestLocationConfigResponse.Validate if the designated constraints aren't met. -type TestLocationConfigResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e TestLocationConfigResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e TestLocationConfigResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e TestLocationConfigResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e TestLocationConfigResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e TestLocationConfigResponseValidationError) ErrorName() string { - return "TestLocationConfigResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e TestLocationConfigResponseValidationError) 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 %sTestLocationConfigResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = TestLocationConfigResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = TestLocationConfigResponseValidationError{} diff --git a/api/backup/v1/locations_grpc.pb.go b/api/backup/v1/locations_grpc.pb.go deleted file mode 100644 index 15b1c781046..00000000000 --- a/api/backup/v1/locations_grpc.pb.go +++ /dev/null @@ -1,292 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.6.0 -// - protoc (unknown) -// source: backup/v1/locations.proto - -package backupv1 - -import ( - context "context" - - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.64.0 or later. -const _ = grpc.SupportPackageIsVersion9 - -const ( - LocationsService_ListLocations_FullMethodName = "/backup.v1.LocationsService/ListLocations" - LocationsService_AddLocation_FullMethodName = "/backup.v1.LocationsService/AddLocation" - LocationsService_ChangeLocation_FullMethodName = "/backup.v1.LocationsService/ChangeLocation" - LocationsService_RemoveLocation_FullMethodName = "/backup.v1.LocationsService/RemoveLocation" - LocationsService_TestLocationConfig_FullMethodName = "/backup.v1.LocationsService/TestLocationConfig" -) - -// LocationsServiceClient is the client API for LocationsService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -// -// Locations service provides access to Backup Locations. -type LocationsServiceClient interface { - // ListLocations returns a list of all backup locations. - ListLocations(ctx context.Context, in *ListLocationsRequest, opts ...grpc.CallOption) (*ListLocationsResponse, error) - // AddLocation adds backup location. - AddLocation(ctx context.Context, in *AddLocationRequest, opts ...grpc.CallOption) (*AddLocationResponse, error) - // ChangeLocation changes backup location. - ChangeLocation(ctx context.Context, in *ChangeLocationRequest, opts ...grpc.CallOption) (*ChangeLocationResponse, error) - // RemoveLocation removes existing backup location. - RemoveLocation(ctx context.Context, in *RemoveLocationRequest, opts ...grpc.CallOption) (*RemoveLocationResponse, error) - // TestLocationConfig tests backup location and credentials. - TestLocationConfig(ctx context.Context, in *TestLocationConfigRequest, opts ...grpc.CallOption) (*TestLocationConfigResponse, error) -} - -type locationsServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewLocationsServiceClient(cc grpc.ClientConnInterface) LocationsServiceClient { - return &locationsServiceClient{cc} -} - -func (c *locationsServiceClient) ListLocations(ctx context.Context, in *ListLocationsRequest, opts ...grpc.CallOption) (*ListLocationsResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(ListLocationsResponse) - err := c.cc.Invoke(ctx, LocationsService_ListLocations_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *locationsServiceClient) AddLocation(ctx context.Context, in *AddLocationRequest, opts ...grpc.CallOption) (*AddLocationResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(AddLocationResponse) - err := c.cc.Invoke(ctx, LocationsService_AddLocation_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *locationsServiceClient) ChangeLocation(ctx context.Context, in *ChangeLocationRequest, opts ...grpc.CallOption) (*ChangeLocationResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(ChangeLocationResponse) - err := c.cc.Invoke(ctx, LocationsService_ChangeLocation_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *locationsServiceClient) RemoveLocation(ctx context.Context, in *RemoveLocationRequest, opts ...grpc.CallOption) (*RemoveLocationResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(RemoveLocationResponse) - err := c.cc.Invoke(ctx, LocationsService_RemoveLocation_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *locationsServiceClient) TestLocationConfig(ctx context.Context, in *TestLocationConfigRequest, opts ...grpc.CallOption) (*TestLocationConfigResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(TestLocationConfigResponse) - err := c.cc.Invoke(ctx, LocationsService_TestLocationConfig_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -// LocationsServiceServer is the server API for LocationsService service. -// All implementations must embed UnimplementedLocationsServiceServer -// for forward compatibility. -// -// Locations service provides access to Backup Locations. -type LocationsServiceServer interface { - // ListLocations returns a list of all backup locations. - ListLocations(context.Context, *ListLocationsRequest) (*ListLocationsResponse, error) - // AddLocation adds backup location. - AddLocation(context.Context, *AddLocationRequest) (*AddLocationResponse, error) - // ChangeLocation changes backup location. - ChangeLocation(context.Context, *ChangeLocationRequest) (*ChangeLocationResponse, error) - // RemoveLocation removes existing backup location. - RemoveLocation(context.Context, *RemoveLocationRequest) (*RemoveLocationResponse, error) - // TestLocationConfig tests backup location and credentials. - TestLocationConfig(context.Context, *TestLocationConfigRequest) (*TestLocationConfigResponse, error) - mustEmbedUnimplementedLocationsServiceServer() -} - -// UnimplementedLocationsServiceServer must be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -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") -} -func (UnimplementedLocationsServiceServer) mustEmbedUnimplementedLocationsServiceServer() {} -func (UnimplementedLocationsServiceServer) testEmbeddedByValue() {} - -// UnsafeLocationsServiceServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to LocationsServiceServer will -// result in compilation errors. -type UnsafeLocationsServiceServer interface { - mustEmbedUnimplementedLocationsServiceServer() -} - -func RegisterLocationsServiceServer(s grpc.ServiceRegistrar, srv LocationsServiceServer) { - // If the following call panics, it indicates UnimplementedLocationsServiceServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } - s.RegisterService(&LocationsService_ServiceDesc, srv) -} - -func _LocationsService_ListLocations_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListLocationsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(LocationsServiceServer).ListLocations(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: LocationsService_ListLocations_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(LocationsServiceServer).ListLocations(ctx, req.(*ListLocationsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _LocationsService_AddLocation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AddLocationRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(LocationsServiceServer).AddLocation(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: LocationsService_AddLocation_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(LocationsServiceServer).AddLocation(ctx, req.(*AddLocationRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _LocationsService_ChangeLocation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ChangeLocationRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(LocationsServiceServer).ChangeLocation(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: LocationsService_ChangeLocation_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(LocationsServiceServer).ChangeLocation(ctx, req.(*ChangeLocationRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _LocationsService_RemoveLocation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RemoveLocationRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(LocationsServiceServer).RemoveLocation(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: LocationsService_RemoveLocation_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(LocationsServiceServer).RemoveLocation(ctx, req.(*RemoveLocationRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _LocationsService_TestLocationConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(TestLocationConfigRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(LocationsServiceServer).TestLocationConfig(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: LocationsService_TestLocationConfig_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(LocationsServiceServer).TestLocationConfig(ctx, req.(*TestLocationConfigRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// LocationsService_ServiceDesc is the grpc.ServiceDesc for LocationsService service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var LocationsService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "backup.v1.LocationsService", - HandlerType: (*LocationsServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "ListLocations", - Handler: _LocationsService_ListLocations_Handler, - }, - { - MethodName: "AddLocation", - Handler: _LocationsService_AddLocation_Handler, - }, - { - MethodName: "ChangeLocation", - Handler: _LocationsService_ChangeLocation_Handler, - }, - { - MethodName: "RemoveLocation", - Handler: _LocationsService_RemoveLocation_Handler, - }, - { - MethodName: "TestLocationConfig", - Handler: _LocationsService_TestLocationConfig_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "backup/v1/locations.proto", -} diff --git a/api/backup/v1/restores.pb.go b/api/backup/v1/restores.pb.go deleted file mode 100644 index 756d4b373bf..00000000000 --- a/api/backup/v1/restores.pb.go +++ /dev/null @@ -1,675 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.10 -// protoc (unknown) -// source: backup/v1/restores.proto - -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" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// RestoreStatus shows the current status of execution of restore. -type RestoreStatus int32 - -const ( - RestoreStatus_RESTORE_STATUS_UNSPECIFIED RestoreStatus = 0 - RestoreStatus_RESTORE_STATUS_IN_PROGRESS RestoreStatus = 1 - RestoreStatus_RESTORE_STATUS_SUCCESS RestoreStatus = 2 - RestoreStatus_RESTORE_STATUS_ERROR RestoreStatus = 3 -) - -// Enum value maps for RestoreStatus. -var ( - RestoreStatus_name = map[int32]string{ - 0: "RESTORE_STATUS_UNSPECIFIED", - 1: "RESTORE_STATUS_IN_PROGRESS", - 2: "RESTORE_STATUS_SUCCESS", - 3: "RESTORE_STATUS_ERROR", - } - RestoreStatus_value = map[string]int32{ - "RESTORE_STATUS_UNSPECIFIED": 0, - "RESTORE_STATUS_IN_PROGRESS": 1, - "RESTORE_STATUS_SUCCESS": 2, - "RESTORE_STATUS_ERROR": 3, - } -) - -func (x RestoreStatus) Enum() *RestoreStatus { - p := new(RestoreStatus) - *p = x - return p -} - -func (x RestoreStatus) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (RestoreStatus) Descriptor() protoreflect.EnumDescriptor { - return file_backup_v1_restores_proto_enumTypes[0].Descriptor() -} - -func (RestoreStatus) Type() protoreflect.EnumType { - return &file_backup_v1_restores_proto_enumTypes[0] -} - -func (x RestoreStatus) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use RestoreStatus.Descriptor instead. -func (RestoreStatus) EnumDescriptor() ([]byte, []int) { - return file_backup_v1_restores_proto_rawDescGZIP(), []int{0} -} - -// RestoreHistoryItem represents single backup restore item. -type RestoreHistoryItem struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Machine-readable restore id. - RestoreId string `protobuf:"bytes,1,opt,name=restore_id,json=restoreId,proto3" json:"restore_id,omitempty"` - // ID of the artifact used for restore. - ArtifactId string `protobuf:"bytes,2,opt,name=artifact_id,json=artifactId,proto3" json:"artifact_id,omitempty"` - // Artifact name used for restore. - Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` - // Database vendor e.g. PostgreSQL, MongoDB, MySQL. - Vendor string `protobuf:"bytes,4,opt,name=vendor,proto3" json:"vendor,omitempty"` - // Machine-readable location ID. - LocationId string `protobuf:"bytes,5,opt,name=location_id,json=locationId,proto3" json:"location_id,omitempty"` - // Location name. - LocationName string `protobuf:"bytes,6,opt,name=location_name,json=locationName,proto3" json:"location_name,omitempty"` - // Machine-readable service ID. - ServiceId string `protobuf:"bytes,7,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` - // Service name. - ServiceName string `protobuf:"bytes,8,opt,name=service_name,json=serviceName,proto3" json:"service_name,omitempty"` - // Backup data model. - DataModel DataModel `protobuf:"varint,9,opt,name=data_model,json=dataModel,proto3,enum=backup.v1.DataModel" json:"data_model,omitempty"` - // Restore status. - Status RestoreStatus `protobuf:"varint,10,opt,name=status,proto3,enum=backup.v1.RestoreStatus" json:"status,omitempty"` - // Restore start time. - StartedAt *timestamppb.Timestamp `protobuf:"bytes,11,opt,name=started_at,json=startedAt,proto3" json:"started_at,omitempty"` - // Restore finish time. - FinishedAt *timestamppb.Timestamp `protobuf:"bytes,12,opt,name=finished_at,json=finishedAt,proto3" json:"finished_at,omitempty"` - // PITR timestamp is filled for PITR restores, empty otherwise. - PitrTimestamp *timestamppb.Timestamp `protobuf:"bytes,13,opt,name=pitr_timestamp,json=pitrTimestamp,proto3" json:"pitr_timestamp,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *RestoreHistoryItem) Reset() { - *x = RestoreHistoryItem{} - mi := &file_backup_v1_restores_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *RestoreHistoryItem) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RestoreHistoryItem) ProtoMessage() {} - -func (x *RestoreHistoryItem) ProtoReflect() protoreflect.Message { - mi := &file_backup_v1_restores_proto_msgTypes[0] - 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 RestoreHistoryItem.ProtoReflect.Descriptor instead. -func (*RestoreHistoryItem) Descriptor() ([]byte, []int) { - return file_backup_v1_restores_proto_rawDescGZIP(), []int{0} -} - -func (x *RestoreHistoryItem) GetRestoreId() string { - if x != nil { - return x.RestoreId - } - return "" -} - -func (x *RestoreHistoryItem) GetArtifactId() string { - if x != nil { - return x.ArtifactId - } - return "" -} - -func (x *RestoreHistoryItem) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *RestoreHistoryItem) GetVendor() string { - if x != nil { - return x.Vendor - } - return "" -} - -func (x *RestoreHistoryItem) GetLocationId() string { - if x != nil { - return x.LocationId - } - return "" -} - -func (x *RestoreHistoryItem) GetLocationName() string { - if x != nil { - return x.LocationName - } - return "" -} - -func (x *RestoreHistoryItem) GetServiceId() string { - if x != nil { - return x.ServiceId - } - return "" -} - -func (x *RestoreHistoryItem) GetServiceName() string { - if x != nil { - return x.ServiceName - } - return "" -} - -func (x *RestoreHistoryItem) GetDataModel() DataModel { - if x != nil { - return x.DataModel - } - return DataModel_DATA_MODEL_UNSPECIFIED -} - -func (x *RestoreHistoryItem) GetStatus() RestoreStatus { - if x != nil { - return x.Status - } - return RestoreStatus_RESTORE_STATUS_UNSPECIFIED -} - -func (x *RestoreHistoryItem) GetStartedAt() *timestamppb.Timestamp { - if x != nil { - return x.StartedAt - } - return nil -} - -func (x *RestoreHistoryItem) GetFinishedAt() *timestamppb.Timestamp { - if x != nil { - return x.FinishedAt - } - return nil -} - -func (x *RestoreHistoryItem) GetPitrTimestamp() *timestamppb.Timestamp { - if x != nil { - return x.PitrTimestamp - } - return nil -} - -type ListRestoresRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ListRestoresRequest) Reset() { - *x = ListRestoresRequest{} - mi := &file_backup_v1_restores_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ListRestoresRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListRestoresRequest) ProtoMessage() {} - -func (x *ListRestoresRequest) ProtoReflect() protoreflect.Message { - mi := &file_backup_v1_restores_proto_msgTypes[1] - 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 ListRestoresRequest.ProtoReflect.Descriptor instead. -func (*ListRestoresRequest) Descriptor() ([]byte, []int) { - return file_backup_v1_restores_proto_rawDescGZIP(), []int{1} -} - -type ListRestoresResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Items []*RestoreHistoryItem `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ListRestoresResponse) Reset() { - *x = ListRestoresResponse{} - mi := &file_backup_v1_restores_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ListRestoresResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListRestoresResponse) ProtoMessage() {} - -func (x *ListRestoresResponse) ProtoReflect() protoreflect.Message { - mi := &file_backup_v1_restores_proto_msgTypes[2] - 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 ListRestoresResponse.ProtoReflect.Descriptor instead. -func (*ListRestoresResponse) Descriptor() ([]byte, []int) { - return file_backup_v1_restores_proto_rawDescGZIP(), []int{2} -} - -func (x *ListRestoresResponse) GetItems() []*RestoreHistoryItem { - if x != nil { - return x.Items - } - return nil -} - -type RestoreServiceGetLogsRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - RestoreId string `protobuf:"bytes,1,opt,name=restore_id,json=restoreId,proto3" json:"restore_id,omitempty"` - Offset uint32 `protobuf:"varint,2,opt,name=offset,proto3" json:"offset,omitempty"` - Limit uint32 `protobuf:"varint,3,opt,name=limit,proto3" json:"limit,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *RestoreServiceGetLogsRequest) Reset() { - *x = RestoreServiceGetLogsRequest{} - mi := &file_backup_v1_restores_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *RestoreServiceGetLogsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RestoreServiceGetLogsRequest) ProtoMessage() {} - -func (x *RestoreServiceGetLogsRequest) ProtoReflect() protoreflect.Message { - mi := &file_backup_v1_restores_proto_msgTypes[3] - 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 RestoreServiceGetLogsRequest.ProtoReflect.Descriptor instead. -func (*RestoreServiceGetLogsRequest) Descriptor() ([]byte, []int) { - return file_backup_v1_restores_proto_rawDescGZIP(), []int{3} -} - -func (x *RestoreServiceGetLogsRequest) GetRestoreId() string { - if x != nil { - return x.RestoreId - } - return "" -} - -func (x *RestoreServiceGetLogsRequest) GetOffset() uint32 { - if x != nil { - return x.Offset - } - return 0 -} - -func (x *RestoreServiceGetLogsRequest) GetLimit() uint32 { - if x != nil { - return x.Limit - } - return 0 -} - -type RestoreServiceGetLogsResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Logs []*LogChunk `protobuf:"bytes,1,rep,name=logs,proto3" json:"logs,omitempty"` - End bool `protobuf:"varint,2,opt,name=end,proto3" json:"end,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *RestoreServiceGetLogsResponse) Reset() { - *x = RestoreServiceGetLogsResponse{} - mi := &file_backup_v1_restores_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *RestoreServiceGetLogsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RestoreServiceGetLogsResponse) ProtoMessage() {} - -func (x *RestoreServiceGetLogsResponse) ProtoReflect() protoreflect.Message { - mi := &file_backup_v1_restores_proto_msgTypes[4] - 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 RestoreServiceGetLogsResponse.ProtoReflect.Descriptor instead. -func (*RestoreServiceGetLogsResponse) Descriptor() ([]byte, []int) { - return file_backup_v1_restores_proto_rawDescGZIP(), []int{4} -} - -func (x *RestoreServiceGetLogsResponse) GetLogs() []*LogChunk { - if x != nil { - return x.Logs - } - return nil -} - -func (x *RestoreServiceGetLogsResponse) GetEnd() bool { - if x != nil { - return x.End - } - return false -} - -type RestoreBackupRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Service identifier where backup should be restored. - ServiceId string `protobuf:"bytes,1,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` - // Artifact id to restore. - ArtifactId string `protobuf:"bytes,2,opt,name=artifact_id,json=artifactId,proto3" json:"artifact_id,omitempty"` - // Timestamp of PITR to restore to - PitrTimestamp *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=pitr_timestamp,json=pitrTimestamp,proto3" json:"pitr_timestamp,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *RestoreBackupRequest) Reset() { - *x = RestoreBackupRequest{} - mi := &file_backup_v1_restores_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *RestoreBackupRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RestoreBackupRequest) ProtoMessage() {} - -func (x *RestoreBackupRequest) ProtoReflect() protoreflect.Message { - mi := &file_backup_v1_restores_proto_msgTypes[5] - 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 RestoreBackupRequest.ProtoReflect.Descriptor instead. -func (*RestoreBackupRequest) Descriptor() ([]byte, []int) { - return file_backup_v1_restores_proto_rawDescGZIP(), []int{5} -} - -func (x *RestoreBackupRequest) GetServiceId() string { - if x != nil { - return x.ServiceId - } - return "" -} - -func (x *RestoreBackupRequest) GetArtifactId() string { - if x != nil { - return x.ArtifactId - } - return "" -} - -func (x *RestoreBackupRequest) GetPitrTimestamp() *timestamppb.Timestamp { - if x != nil { - return x.PitrTimestamp - } - return nil -} - -type RestoreBackupResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Unique restore identifier. - RestoreId string `protobuf:"bytes,1,opt,name=restore_id,json=restoreId,proto3" json:"restore_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *RestoreBackupResponse) Reset() { - *x = RestoreBackupResponse{} - mi := &file_backup_v1_restores_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *RestoreBackupResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RestoreBackupResponse) ProtoMessage() {} - -func (x *RestoreBackupResponse) ProtoReflect() protoreflect.Message { - mi := &file_backup_v1_restores_proto_msgTypes[6] - 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 RestoreBackupResponse.ProtoReflect.Descriptor instead. -func (*RestoreBackupResponse) Descriptor() ([]byte, []int) { - return file_backup_v1_restores_proto_rawDescGZIP(), []int{6} -} - -func (x *RestoreBackupResponse) GetRestoreId() string { - if x != nil { - return x.RestoreId - } - return "" -} - -var File_backup_v1_restores_proto protoreflect.FileDescriptor - -const file_backup_v1_restores_proto_rawDesc = "" + - "\n" + - "\x18backup/v1/restores.proto\x12\tbackup.v1\x1a\x16backup/v1/common.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a.protoc-gen-openapiv2/options/annotations.proto\x1a\x17validate/validate.proto\"\xaa\x04\n" + - "\x12RestoreHistoryItem\x12\x1d\n" + - "\n" + - "restore_id\x18\x01 \x01(\tR\trestoreId\x12\x1f\n" + - "\vartifact_id\x18\x02 \x01(\tR\n" + - "artifactId\x12\x12\n" + - "\x04name\x18\x03 \x01(\tR\x04name\x12\x16\n" + - "\x06vendor\x18\x04 \x01(\tR\x06vendor\x12\x1f\n" + - "\vlocation_id\x18\x05 \x01(\tR\n" + - "locationId\x12#\n" + - "\rlocation_name\x18\x06 \x01(\tR\flocationName\x12\x1d\n" + - "\n" + - "service_id\x18\a \x01(\tR\tserviceId\x12!\n" + - "\fservice_name\x18\b \x01(\tR\vserviceName\x123\n" + - "\n" + - "data_model\x18\t \x01(\x0e2\x14.backup.v1.DataModelR\tdataModel\x120\n" + - "\x06status\x18\n" + - " \x01(\x0e2\x18.backup.v1.RestoreStatusR\x06status\x129\n" + - "\n" + - "started_at\x18\v \x01(\v2\x1a.google.protobuf.TimestampR\tstartedAt\x12;\n" + - "\vfinished_at\x18\f \x01(\v2\x1a.google.protobuf.TimestampR\n" + - "finishedAt\x12A\n" + - "\x0epitr_timestamp\x18\r \x01(\v2\x1a.google.protobuf.TimestampR\rpitrTimestamp\"\x15\n" + - "\x13ListRestoresRequest\"K\n" + - "\x14ListRestoresResponse\x123\n" + - "\x05items\x18\x01 \x03(\v2\x1d.backup.v1.RestoreHistoryItemR\x05items\"t\n" + - "\x1cRestoreServiceGetLogsRequest\x12&\n" + - "\n" + - "restore_id\x18\x01 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\trestoreId\x12\x16\n" + - "\x06offset\x18\x02 \x01(\rR\x06offset\x12\x14\n" + - "\x05limit\x18\x03 \x01(\rR\x05limit\"Z\n" + - "\x1dRestoreServiceGetLogsResponse\x12'\n" + - "\x04logs\x18\x01 \x03(\v2\x13.backup.v1.LogChunkR\x04logs\x12\x10\n" + - "\x03end\x18\x02 \x01(\bR\x03end\"\xab\x01\n" + - "\x14RestoreBackupRequest\x12&\n" + - "\n" + - "service_id\x18\x01 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\tserviceId\x12(\n" + - "\vartifact_id\x18\x02 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\n" + - "artifactId\x12A\n" + - "\x0epitr_timestamp\x18\x03 \x01(\v2\x1a.google.protobuf.TimestampR\rpitrTimestamp\"6\n" + - "\x15RestoreBackupResponse\x12\x1d\n" + - "\n" + - "restore_id\x18\x01 \x01(\tR\trestoreId*\x85\x01\n" + - "\rRestoreStatus\x12\x1e\n" + - "\x1aRESTORE_STATUS_UNSPECIFIED\x10\x00\x12\x1e\n" + - "\x1aRESTORE_STATUS_IN_PROGRESS\x10\x01\x12\x1a\n" + - "\x16RESTORE_STATUS_SUCCESS\x10\x02\x12\x18\n" + - "\x14RESTORE_STATUS_ERROR\x10\x032\x99\b\n" + - "\x0eRestoreService\x12\xad\x01\n" + - "\fListRestores\x12\x1e.backup.v1.ListRestoresRequest\x1a\x1f.backup.v1.ListRestoresResponse\"\\\x92A=\x12\x14List Restore History\x1a%List all backup restore history items\x82\xd3\xe4\x93\x02\x16\x12\x14/v1/backups/restores\x12\xcf\x01\n" + - "\aGetLogs\x12'.backup.v1.RestoreServiceGetLogsRequest\x1a(.backup.v1.RestoreServiceGetLogsResponse\"q\x92A@\x12\bGet Logs\x1a4Get logs from the underlying tools for a restore job\x82\xd3\xe4\x93\x02(\x12&/v1/backups/restores/{restore_id}/logs\x12\x84\x05\n" + - "\rRestoreBackup\x12\x1f.backup.v1.RestoreBackupRequest\x1a .backup.v1.RestoreBackupResponse\"\xaf\x04\x92A\x86\x04\x12\x15Restore from a Backup\x1a\xec\x03Could return the Error message in the details containing specific ErrorCode indicating failure reason:\n" + - "ERROR_CODE_XTRABACKUP_NOT_INSTALLED - xtrabackup is not installed on the service\n" + - "ERROR_CODE_INVALID_XTRABACKUP - different versions of xtrabackup and xbcloud\n" + - "ERROR_CODE_INCOMPATIBLE_XTRABACKUP - xtrabackup is not compatible with MySQL for taking a backup\n" + - "ERROR_CODE_INCOMPATIBLE_TARGET_MYSQL - target MySQL version is not compatible with the artifact for performing a restore of the backup\x82\xd3\xe4\x93\x02\x1f:\x01*\"\x1a/v1/backups/restores:startB\x92\x01\n" + - "\rcom.backup.v1B\rRestoresProtoP\x01Z-github.com/percona/pmm/api/backup/v1;backupv1\xa2\x02\x03BXX\xaa\x02\tBackup.V1\xca\x02\tBackup\\V1\xe2\x02\x15Backup\\V1\\GPBMetadata\xea\x02\n" + - "Backup::V1b\x06proto3" - -var ( - file_backup_v1_restores_proto_rawDescOnce sync.Once - file_backup_v1_restores_proto_rawDescData []byte -) - -func file_backup_v1_restores_proto_rawDescGZIP() []byte { - file_backup_v1_restores_proto_rawDescOnce.Do(func() { - file_backup_v1_restores_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_backup_v1_restores_proto_rawDesc), len(file_backup_v1_restores_proto_rawDesc))) - }) - 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_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 - 9, // 2: backup.v1.RestoreHistoryItem.started_at:type_name -> google.protobuf.Timestamp - 9, // 3: backup.v1.RestoreHistoryItem.finished_at:type_name -> google.protobuf.Timestamp - 9, // 4: backup.v1.RestoreHistoryItem.pitr_timestamp:type_name -> google.protobuf.Timestamp - 1, // 5: backup.v1.ListRestoresResponse.items:type_name -> backup.v1.RestoreHistoryItem - 10, // 6: backup.v1.RestoreServiceGetLogsResponse.logs:type_name -> backup.v1.LogChunk - 9, // 7: backup.v1.RestoreBackupRequest.pitr_timestamp:type_name -> google.protobuf.Timestamp - 2, // 8: backup.v1.RestoreService.ListRestores:input_type -> backup.v1.ListRestoresRequest - 4, // 9: backup.v1.RestoreService.GetLogs:input_type -> backup.v1.RestoreServiceGetLogsRequest - 6, // 10: backup.v1.RestoreService.RestoreBackup:input_type -> backup.v1.RestoreBackupRequest - 3, // 11: backup.v1.RestoreService.ListRestores:output_type -> backup.v1.ListRestoresResponse - 5, // 12: backup.v1.RestoreService.GetLogs:output_type -> backup.v1.RestoreServiceGetLogsResponse - 7, // 13: backup.v1.RestoreService.RestoreBackup:output_type -> backup.v1.RestoreBackupResponse - 11, // [11:14] is the sub-list for method output_type - 8, // [8:11] is the sub-list for method input_type - 8, // [8:8] is the sub-list for extension type_name - 8, // [8:8] is the sub-list for extension extendee - 0, // [0:8] is the sub-list for field type_name -} - -func init() { file_backup_v1_restores_proto_init() } -func file_backup_v1_restores_proto_init() { - if File_backup_v1_restores_proto != nil { - return - } - file_backup_v1_common_proto_init() - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_backup_v1_restores_proto_rawDesc), len(file_backup_v1_restores_proto_rawDesc)), - NumEnums: 1, - NumMessages: 7, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_backup_v1_restores_proto_goTypes, - DependencyIndexes: file_backup_v1_restores_proto_depIdxs, - EnumInfos: file_backup_v1_restores_proto_enumTypes, - MessageInfos: file_backup_v1_restores_proto_msgTypes, - }.Build() - File_backup_v1_restores_proto = out.File - file_backup_v1_restores_proto_goTypes = nil - file_backup_v1_restores_proto_depIdxs = nil -} diff --git a/api/backup/v1/restores.pb.gw.go b/api/backup/v1/restores.pb.gw.go deleted file mode 100644 index 71ff900c8f2..00000000000 --- a/api/backup/v1/restores.pb.gw.go +++ /dev/null @@ -1,309 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: backup/v1/restores.proto - -/* -Package backupv1 is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package backupv1 - -import ( - "context" - "errors" - "io" - "net/http" - - "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" - "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" - "google.golang.org/protobuf/proto" -) - -// Suppress "imported and not used" errors -var ( - _ codes.Code - _ io.Reader - _ status.Status - _ = errors.New - _ = runtime.String - _ = utilities.NewDoubleArray - _ = metadata.Join -) - -func request_RestoreService_ListRestores_0(ctx context.Context, marshaler runtime.Marshaler, client RestoreServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq ListRestoresRequest - metadata runtime.ServerMetadata - ) - if req.Body != nil { - _, _ = io.Copy(io.Discard, req.Body) - } - msg, err := client.ListRestores(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_RestoreService_ListRestores_0(ctx context.Context, marshaler runtime.Marshaler, server RestoreServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq ListRestoresRequest - metadata runtime.ServerMetadata - ) - msg, err := server.ListRestores(ctx, &protoReq) - return msg, metadata, err -} - -var filter_RestoreService_GetLogs_0 = &utilities.DoubleArray{Encoding: map[string]int{"restore_id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} - -func request_RestoreService_GetLogs_0(ctx context.Context, marshaler runtime.Marshaler, client RestoreServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq RestoreServiceGetLogsRequest - metadata runtime.ServerMetadata - err error - ) - if req.Body != nil { - _, _ = io.Copy(io.Discard, req.Body) - } - val, ok := pathParams["restore_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "restore_id") - } - protoReq.RestoreId, err = runtime.String(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "restore_id", err) - } - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_RestoreService_GetLogs_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - msg, err := client.GetLogs(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_RestoreService_GetLogs_0(ctx context.Context, marshaler runtime.Marshaler, server RestoreServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq RestoreServiceGetLogsRequest - metadata runtime.ServerMetadata - err error - ) - val, ok := pathParams["restore_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "restore_id") - } - protoReq.RestoreId, err = runtime.String(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "restore_id", err) - } - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_RestoreService_GetLogs_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - msg, err := server.GetLogs(ctx, &protoReq) - return msg, metadata, err -} - -func request_RestoreService_RestoreBackup_0(ctx context.Context, marshaler runtime.Marshaler, client RestoreServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq RestoreBackupRequest - 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.RestoreBackup(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_RestoreService_RestoreBackup_0(ctx context.Context, marshaler runtime.Marshaler, server RestoreServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq RestoreBackupRequest - 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.RestoreBackup(ctx, &protoReq) - return msg, metadata, err -} - -// RegisterRestoreServiceHandlerServer registers the http handlers for service RestoreService to "mux". -// UnaryRPC :call RestoreServiceServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterRestoreServiceHandlerFromEndpoint instead. -// GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call. -func RegisterRestoreServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server RestoreServiceServer) error { - mux.Handle(http.MethodGet, pattern_RestoreService_ListRestores_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, "/backup.v1.RestoreService/ListRestores", runtime.WithHTTPPathPattern("/v1/backups/restores")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_RestoreService_ListRestores_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_RestoreService_ListRestores_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodGet, pattern_RestoreService_GetLogs_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, "/backup.v1.RestoreService/GetLogs", runtime.WithHTTPPathPattern("/v1/backups/restores/{restore_id}/logs")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_RestoreService_GetLogs_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_RestoreService_GetLogs_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPost, pattern_RestoreService_RestoreBackup_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, "/backup.v1.RestoreService/RestoreBackup", runtime.WithHTTPPathPattern("/v1/backups/restores:start")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_RestoreService_RestoreBackup_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_RestoreService_RestoreBackup_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - return nil -} - -// RegisterRestoreServiceHandlerFromEndpoint is same as RegisterRestoreServiceHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterRestoreServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.NewClient(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - return RegisterRestoreServiceHandler(ctx, mux, conn) -} - -// RegisterRestoreServiceHandler registers the http handlers for service RestoreService to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterRestoreServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterRestoreServiceHandlerClient(ctx, mux, NewRestoreServiceClient(conn)) -} - -// RegisterRestoreServiceHandlerClient registers the http handlers for service RestoreService -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "RestoreServiceClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "RestoreServiceClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "RestoreServiceClient" to call the correct interceptors. This client ignores the HTTP middlewares. -func RegisterRestoreServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client RestoreServiceClient) error { - mux.Handle(http.MethodGet, pattern_RestoreService_ListRestores_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, "/backup.v1.RestoreService/ListRestores", runtime.WithHTTPPathPattern("/v1/backups/restores")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_RestoreService_ListRestores_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_RestoreService_ListRestores_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodGet, pattern_RestoreService_GetLogs_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, "/backup.v1.RestoreService/GetLogs", runtime.WithHTTPPathPattern("/v1/backups/restores/{restore_id}/logs")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_RestoreService_GetLogs_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_RestoreService_GetLogs_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPost, pattern_RestoreService_RestoreBackup_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, "/backup.v1.RestoreService/RestoreBackup", runtime.WithHTTPPathPattern("/v1/backups/restores:start")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_RestoreService_RestoreBackup_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_RestoreService_RestoreBackup_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - return nil -} - -var ( - pattern_RestoreService_ListRestores_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "backups", "restores"}, "")) - pattern_RestoreService_GetLogs_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"v1", "backups", "restores", "restore_id", "logs"}, "")) - pattern_RestoreService_RestoreBackup_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "backups", "restores"}, "start")) -) - -var ( - forward_RestoreService_ListRestores_0 = runtime.ForwardResponseMessage - forward_RestoreService_GetLogs_0 = runtime.ForwardResponseMessage - forward_RestoreService_RestoreBackup_0 = runtime.ForwardResponseMessage -) diff --git a/api/backup/v1/restores.pb.validate.go b/api/backup/v1/restores.pb.validate.go deleted file mode 100644 index 0f530c1fc99..00000000000 --- a/api/backup/v1/restores.pb.validate.go +++ /dev/null @@ -1,997 +0,0 @@ -// Code generated by protoc-gen-validate. DO NOT EDIT. -// source: backup/v1/restores.proto - -package backupv1 - -import ( - "bytes" - "errors" - "fmt" - "net" - "net/mail" - "net/url" - "regexp" - "sort" - "strings" - "time" - "unicode/utf8" - - "google.golang.org/protobuf/types/known/anypb" -) - -// ensure the imports are used -var ( - _ = bytes.MinRead - _ = errors.New("") - _ = fmt.Print - _ = utf8.UTFMax - _ = (*regexp.Regexp)(nil) - _ = (*strings.Reader)(nil) - _ = net.IPv4len - _ = time.Duration(0) - _ = (*url.URL)(nil) - _ = (*mail.Address)(nil) - _ = anypb.Any{} - _ = sort.Sort -) - -// Validate checks the field values on RestoreHistoryItem 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 *RestoreHistoryItem) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on RestoreHistoryItem 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 -// RestoreHistoryItemMultiError, or nil if none found. -func (m *RestoreHistoryItem) ValidateAll() error { - return m.validate(true) -} - -func (m *RestoreHistoryItem) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for RestoreId - - // no validation rules for ArtifactId - - // no validation rules for Name - - // no validation rules for Vendor - - // no validation rules for LocationId - - // no validation rules for LocationName - - // no validation rules for ServiceId - - // no validation rules for ServiceName - - // no validation rules for DataModel - - // no validation rules for Status - - if all { - switch v := interface{}(m.GetStartedAt()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, RestoreHistoryItemValidationError{ - field: "StartedAt", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, RestoreHistoryItemValidationError{ - field: "StartedAt", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetStartedAt()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return RestoreHistoryItemValidationError{ - field: "StartedAt", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetFinishedAt()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, RestoreHistoryItemValidationError{ - field: "FinishedAt", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, RestoreHistoryItemValidationError{ - field: "FinishedAt", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetFinishedAt()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return RestoreHistoryItemValidationError{ - field: "FinishedAt", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetPitrTimestamp()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, RestoreHistoryItemValidationError{ - field: "PitrTimestamp", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, RestoreHistoryItemValidationError{ - field: "PitrTimestamp", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetPitrTimestamp()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return RestoreHistoryItemValidationError{ - field: "PitrTimestamp", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if len(errors) > 0 { - return RestoreHistoryItemMultiError(errors) - } - - return nil -} - -// RestoreHistoryItemMultiError is an error wrapping multiple validation errors -// returned by RestoreHistoryItem.ValidateAll() if the designated constraints -// aren't met. -type RestoreHistoryItemMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m RestoreHistoryItemMultiError) 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 RestoreHistoryItemMultiError) AllErrors() []error { return m } - -// RestoreHistoryItemValidationError is the validation error returned by -// RestoreHistoryItem.Validate if the designated constraints aren't met. -type RestoreHistoryItemValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e RestoreHistoryItemValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e RestoreHistoryItemValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e RestoreHistoryItemValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e RestoreHistoryItemValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e RestoreHistoryItemValidationError) ErrorName() string { - return "RestoreHistoryItemValidationError" -} - -// Error satisfies the builtin error interface -func (e RestoreHistoryItemValidationError) 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 %sRestoreHistoryItem.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = RestoreHistoryItemValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = RestoreHistoryItemValidationError{} - -// Validate checks the field values on ListRestoresRequest 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 *ListRestoresRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ListRestoresRequest 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 -// ListRestoresRequestMultiError, or nil if none found. -func (m *ListRestoresRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *ListRestoresRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return ListRestoresRequestMultiError(errors) - } - - return nil -} - -// ListRestoresRequestMultiError is an error wrapping multiple validation -// errors returned by ListRestoresRequest.ValidateAll() if the designated -// constraints aren't met. -type ListRestoresRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ListRestoresRequestMultiError) 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 ListRestoresRequestMultiError) AllErrors() []error { return m } - -// ListRestoresRequestValidationError is the validation error returned by -// ListRestoresRequest.Validate if the designated constraints aren't met. -type ListRestoresRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ListRestoresRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ListRestoresRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ListRestoresRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ListRestoresRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ListRestoresRequestValidationError) ErrorName() string { - return "ListRestoresRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e ListRestoresRequestValidationError) 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 %sListRestoresRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ListRestoresRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ListRestoresRequestValidationError{} - -// Validate checks the field values on ListRestoresResponse 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 *ListRestoresResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ListRestoresResponse 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 -// ListRestoresResponseMultiError, or nil if none found. -func (m *ListRestoresResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *ListRestoresResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - for idx, item := range m.GetItems() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ListRestoresResponseValidationError{ - field: fmt.Sprintf("Items[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ListRestoresResponseValidationError{ - field: fmt.Sprintf("Items[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ListRestoresResponseValidationError{ - field: fmt.Sprintf("Items[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - if len(errors) > 0 { - return ListRestoresResponseMultiError(errors) - } - - return nil -} - -// ListRestoresResponseMultiError is an error wrapping multiple validation -// errors returned by ListRestoresResponse.ValidateAll() if the designated -// constraints aren't met. -type ListRestoresResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ListRestoresResponseMultiError) 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 ListRestoresResponseMultiError) AllErrors() []error { return m } - -// ListRestoresResponseValidationError is the validation error returned by -// ListRestoresResponse.Validate if the designated constraints aren't met. -type ListRestoresResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ListRestoresResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ListRestoresResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ListRestoresResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ListRestoresResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ListRestoresResponseValidationError) ErrorName() string { - return "ListRestoresResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e ListRestoresResponseValidationError) 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 %sListRestoresResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ListRestoresResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ListRestoresResponseValidationError{} - -// Validate checks the field values on RestoreServiceGetLogsRequest 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 *RestoreServiceGetLogsRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on RestoreServiceGetLogsRequest 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 -// RestoreServiceGetLogsRequestMultiError, or nil if none found. -func (m *RestoreServiceGetLogsRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *RestoreServiceGetLogsRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetRestoreId()) < 1 { - err := RestoreServiceGetLogsRequestValidationError{ - field: "RestoreId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for Offset - - // no validation rules for Limit - - if len(errors) > 0 { - return RestoreServiceGetLogsRequestMultiError(errors) - } - - return nil -} - -// RestoreServiceGetLogsRequestMultiError is an error wrapping multiple -// validation errors returned by RestoreServiceGetLogsRequest.ValidateAll() if -// the designated constraints aren't met. -type RestoreServiceGetLogsRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m RestoreServiceGetLogsRequestMultiError) 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 RestoreServiceGetLogsRequestMultiError) AllErrors() []error { return m } - -// RestoreServiceGetLogsRequestValidationError is the validation error returned -// by RestoreServiceGetLogsRequest.Validate if the designated constraints -// aren't met. -type RestoreServiceGetLogsRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e RestoreServiceGetLogsRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e RestoreServiceGetLogsRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e RestoreServiceGetLogsRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e RestoreServiceGetLogsRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e RestoreServiceGetLogsRequestValidationError) ErrorName() string { - return "RestoreServiceGetLogsRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e RestoreServiceGetLogsRequestValidationError) 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 %sRestoreServiceGetLogsRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = RestoreServiceGetLogsRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = RestoreServiceGetLogsRequestValidationError{} - -// Validate checks the field values on RestoreServiceGetLogsResponse 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 *RestoreServiceGetLogsResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on RestoreServiceGetLogsResponse 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 -// RestoreServiceGetLogsResponseMultiError, or nil if none found. -func (m *RestoreServiceGetLogsResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *RestoreServiceGetLogsResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - for idx, item := range m.GetLogs() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, RestoreServiceGetLogsResponseValidationError{ - field: fmt.Sprintf("Logs[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, RestoreServiceGetLogsResponseValidationError{ - field: fmt.Sprintf("Logs[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return RestoreServiceGetLogsResponseValidationError{ - field: fmt.Sprintf("Logs[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - // no validation rules for End - - if len(errors) > 0 { - return RestoreServiceGetLogsResponseMultiError(errors) - } - - return nil -} - -// RestoreServiceGetLogsResponseMultiError is an error wrapping multiple -// validation errors returned by RestoreServiceGetLogsResponse.ValidateAll() -// if the designated constraints aren't met. -type RestoreServiceGetLogsResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m RestoreServiceGetLogsResponseMultiError) 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 RestoreServiceGetLogsResponseMultiError) AllErrors() []error { return m } - -// RestoreServiceGetLogsResponseValidationError is the validation error -// returned by RestoreServiceGetLogsResponse.Validate if the designated -// constraints aren't met. -type RestoreServiceGetLogsResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e RestoreServiceGetLogsResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e RestoreServiceGetLogsResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e RestoreServiceGetLogsResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e RestoreServiceGetLogsResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e RestoreServiceGetLogsResponseValidationError) ErrorName() string { - return "RestoreServiceGetLogsResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e RestoreServiceGetLogsResponseValidationError) 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 %sRestoreServiceGetLogsResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = RestoreServiceGetLogsResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = RestoreServiceGetLogsResponseValidationError{} - -// Validate checks the field values on RestoreBackupRequest 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 *RestoreBackupRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on RestoreBackupRequest 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 -// RestoreBackupRequestMultiError, or nil if none found. -func (m *RestoreBackupRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *RestoreBackupRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetServiceId()) < 1 { - err := RestoreBackupRequestValidationError{ - field: "ServiceId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if utf8.RuneCountInString(m.GetArtifactId()) < 1 { - err := RestoreBackupRequestValidationError{ - field: "ArtifactId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetPitrTimestamp()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, RestoreBackupRequestValidationError{ - field: "PitrTimestamp", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, RestoreBackupRequestValidationError{ - field: "PitrTimestamp", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetPitrTimestamp()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return RestoreBackupRequestValidationError{ - field: "PitrTimestamp", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if len(errors) > 0 { - return RestoreBackupRequestMultiError(errors) - } - - return nil -} - -// RestoreBackupRequestMultiError is an error wrapping multiple validation -// errors returned by RestoreBackupRequest.ValidateAll() if the designated -// constraints aren't met. -type RestoreBackupRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m RestoreBackupRequestMultiError) 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 RestoreBackupRequestMultiError) AllErrors() []error { return m } - -// RestoreBackupRequestValidationError is the validation error returned by -// RestoreBackupRequest.Validate if the designated constraints aren't met. -type RestoreBackupRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e RestoreBackupRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e RestoreBackupRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e RestoreBackupRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e RestoreBackupRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e RestoreBackupRequestValidationError) ErrorName() string { - return "RestoreBackupRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e RestoreBackupRequestValidationError) 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 %sRestoreBackupRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = RestoreBackupRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = RestoreBackupRequestValidationError{} - -// Validate checks the field values on RestoreBackupResponse 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 *RestoreBackupResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on RestoreBackupResponse 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 -// RestoreBackupResponseMultiError, or nil if none found. -func (m *RestoreBackupResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *RestoreBackupResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for RestoreId - - if len(errors) > 0 { - return RestoreBackupResponseMultiError(errors) - } - - return nil -} - -// RestoreBackupResponseMultiError is an error wrapping multiple validation -// errors returned by RestoreBackupResponse.ValidateAll() if the designated -// constraints aren't met. -type RestoreBackupResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m RestoreBackupResponseMultiError) 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 RestoreBackupResponseMultiError) AllErrors() []error { return m } - -// RestoreBackupResponseValidationError is the validation error returned by -// RestoreBackupResponse.Validate if the designated constraints aren't met. -type RestoreBackupResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e RestoreBackupResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e RestoreBackupResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e RestoreBackupResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e RestoreBackupResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e RestoreBackupResponseValidationError) ErrorName() string { - return "RestoreBackupResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e RestoreBackupResponseValidationError) 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 %sRestoreBackupResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = RestoreBackupResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = RestoreBackupResponseValidationError{} diff --git a/api/backup/v1/restores_grpc.pb.go b/api/backup/v1/restores_grpc.pb.go deleted file mode 100644 index c27c45e9f4e..00000000000 --- a/api/backup/v1/restores_grpc.pb.go +++ /dev/null @@ -1,210 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.6.0 -// - protoc (unknown) -// source: backup/v1/restores.proto - -package backupv1 - -import ( - context "context" - - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.64.0 or later. -const _ = grpc.SupportPackageIsVersion9 - -const ( - RestoreService_ListRestores_FullMethodName = "/backup.v1.RestoreService/ListRestores" - RestoreService_GetLogs_FullMethodName = "/backup.v1.RestoreService/GetLogs" - RestoreService_RestoreBackup_FullMethodName = "/backup.v1.RestoreService/RestoreBackup" -) - -// RestoreServiceClient is the client API for RestoreService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -// -// RestoreService provides public methods for managing backup restore history. -type RestoreServiceClient interface { - // ListRestores returns a list of all backup restore history items. - ListRestores(ctx context.Context, in *ListRestoresRequest, opts ...grpc.CallOption) (*ListRestoresResponse, error) - // GetLogs returns logs from the underlying tools for a restore job. - GetLogs(ctx context.Context, in *RestoreServiceGetLogsRequest, opts ...grpc.CallOption) (*RestoreServiceGetLogsResponse, error) - // RestoreBackup requests the backup restore. - RestoreBackup(ctx context.Context, in *RestoreBackupRequest, opts ...grpc.CallOption) (*RestoreBackupResponse, error) -} - -type restoreServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewRestoreServiceClient(cc grpc.ClientConnInterface) RestoreServiceClient { - return &restoreServiceClient{cc} -} - -func (c *restoreServiceClient) ListRestores(ctx context.Context, in *ListRestoresRequest, opts ...grpc.CallOption) (*ListRestoresResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(ListRestoresResponse) - err := c.cc.Invoke(ctx, RestoreService_ListRestores_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *restoreServiceClient) GetLogs(ctx context.Context, in *RestoreServiceGetLogsRequest, opts ...grpc.CallOption) (*RestoreServiceGetLogsResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(RestoreServiceGetLogsResponse) - err := c.cc.Invoke(ctx, RestoreService_GetLogs_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *restoreServiceClient) RestoreBackup(ctx context.Context, in *RestoreBackupRequest, opts ...grpc.CallOption) (*RestoreBackupResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(RestoreBackupResponse) - err := c.cc.Invoke(ctx, RestoreService_RestoreBackup_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -// RestoreServiceServer is the server API for RestoreService service. -// All implementations must embed UnimplementedRestoreServiceServer -// for forward compatibility. -// -// RestoreService provides public methods for managing backup restore history. -type RestoreServiceServer interface { - // ListRestores returns a list of all backup restore history items. - ListRestores(context.Context, *ListRestoresRequest) (*ListRestoresResponse, error) - // GetLogs returns logs from the underlying tools for a restore job. - GetLogs(context.Context, *RestoreServiceGetLogsRequest) (*RestoreServiceGetLogsResponse, error) - // RestoreBackup requests the backup restore. - RestoreBackup(context.Context, *RestoreBackupRequest) (*RestoreBackupResponse, error) - mustEmbedUnimplementedRestoreServiceServer() -} - -// UnimplementedRestoreServiceServer must be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -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") -} -func (UnimplementedRestoreServiceServer) mustEmbedUnimplementedRestoreServiceServer() {} -func (UnimplementedRestoreServiceServer) testEmbeddedByValue() {} - -// UnsafeRestoreServiceServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to RestoreServiceServer will -// result in compilation errors. -type UnsafeRestoreServiceServer interface { - mustEmbedUnimplementedRestoreServiceServer() -} - -func RegisterRestoreServiceServer(s grpc.ServiceRegistrar, srv RestoreServiceServer) { - // If the following call panics, it indicates UnimplementedRestoreServiceServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } - s.RegisterService(&RestoreService_ServiceDesc, srv) -} - -func _RestoreService_ListRestores_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListRestoresRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RestoreServiceServer).ListRestores(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: RestoreService_ListRestores_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RestoreServiceServer).ListRestores(ctx, req.(*ListRestoresRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _RestoreService_GetLogs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RestoreServiceGetLogsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RestoreServiceServer).GetLogs(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: RestoreService_GetLogs_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RestoreServiceServer).GetLogs(ctx, req.(*RestoreServiceGetLogsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _RestoreService_RestoreBackup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RestoreBackupRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RestoreServiceServer).RestoreBackup(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: RestoreService_RestoreBackup_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RestoreServiceServer).RestoreBackup(ctx, req.(*RestoreBackupRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// RestoreService_ServiceDesc is the grpc.ServiceDesc for RestoreService service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var RestoreService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "backup.v1.RestoreService", - HandlerType: (*RestoreServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "ListRestores", - Handler: _RestoreService_ListRestores_Handler, - }, - { - MethodName: "GetLogs", - Handler: _RestoreService_GetLogs_Handler, - }, - { - MethodName: "RestoreBackup", - Handler: _RestoreService_RestoreBackup_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "backup/v1/restores.proto", -} diff --git a/api/common/common.pb.go b/api/common/common.pb.go deleted file mode 100644 index c675501246e..00000000000 --- a/api/common/common.pb.go +++ /dev/null @@ -1,182 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.10 -// protoc (unknown) -// source: common/common.proto - -package common - -import ( - reflect "reflect" - sync "sync" - unsafe "unsafe" - - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// A wrapper for a string array. This type allows to distinguish between an empty array and a null value. -type StringArray struct { - state protoimpl.MessageState `protogen:"open.v1"` - Values []string `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StringArray) Reset() { - *x = StringArray{} - mi := &file_common_common_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StringArray) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StringArray) ProtoMessage() {} - -func (x *StringArray) ProtoReflect() protoreflect.Message { - mi := &file_common_common_proto_msgTypes[0] - 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 StringArray.ProtoReflect.Descriptor instead. -func (*StringArray) Descriptor() ([]byte, []int) { - return file_common_common_proto_rawDescGZIP(), []int{0} -} - -func (x *StringArray) GetValues() []string { - if x != nil { - return x.Values - } - return nil -} - -// A wrapper for map[string]string. This type allows to distinguish between an empty map and a null value. -type StringMap struct { - state protoimpl.MessageState `protogen:"open.v1"` - Values map[string]string `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StringMap) Reset() { - *x = StringMap{} - mi := &file_common_common_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StringMap) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StringMap) ProtoMessage() {} - -func (x *StringMap) ProtoReflect() protoreflect.Message { - mi := &file_common_common_proto_msgTypes[1] - 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 StringMap.ProtoReflect.Descriptor instead. -func (*StringMap) Descriptor() ([]byte, []int) { - return file_common_common_proto_rawDescGZIP(), []int{1} -} - -func (x *StringMap) GetValues() map[string]string { - if x != nil { - return x.Values - } - return nil -} - -var File_common_common_proto protoreflect.FileDescriptor - -const file_common_common_proto_rawDesc = "" + - "\n" + - "\x13common/common.proto\x12\x06common\"%\n" + - "\vStringArray\x12\x16\n" + - "\x06values\x18\x01 \x03(\tR\x06values\"}\n" + - "\tStringMap\x125\n" + - "\x06values\x18\x01 \x03(\v2\x1d.common.StringMap.ValuesEntryR\x06values\x1a9\n" + - "\vValuesEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01Bt\n" + - "\n" + - "com.commonB\vCommonProtoP\x01Z!github.com/percona/pmm/api/common\xa2\x02\x03CXX\xaa\x02\x06Common\xca\x02\x06Common\xe2\x02\x12Common\\GPBMetadata\xea\x02\x06Commonb\x06proto3" - -var ( - file_common_common_proto_rawDescOnce sync.Once - file_common_common_proto_rawDescData []byte -) - -func file_common_common_proto_rawDescGZIP() []byte { - file_common_common_proto_rawDescOnce.Do(func() { - file_common_common_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_common_common_proto_rawDesc), len(file_common_common_proto_rawDesc))) - }) - 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_depIdxs = []int32{ - 2, // 0: common.StringMap.values:type_name -> common.StringMap.ValuesEntry - 1, // [1:1] is the sub-list for method output_type - 1, // [1:1] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name -} - -func init() { file_common_common_proto_init() } -func file_common_common_proto_init() { - if File_common_common_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_common_common_proto_rawDesc), len(file_common_common_proto_rawDesc)), - NumEnums: 0, - NumMessages: 3, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_common_common_proto_goTypes, - DependencyIndexes: file_common_common_proto_depIdxs, - MessageInfos: file_common_common_proto_msgTypes, - }.Build() - File_common_common_proto = out.File - file_common_common_proto_goTypes = nil - file_common_common_proto_depIdxs = nil -} diff --git a/api/common/common.pb.validate.go b/api/common/common.pb.validate.go deleted file mode 100644 index 9caff2dff61..00000000000 --- a/api/common/common.pb.validate.go +++ /dev/null @@ -1,236 +0,0 @@ -// Code generated by protoc-gen-validate. DO NOT EDIT. -// source: common/common.proto - -package common - -import ( - "bytes" - "errors" - "fmt" - "net" - "net/mail" - "net/url" - "regexp" - "sort" - "strings" - "time" - "unicode/utf8" - - "google.golang.org/protobuf/types/known/anypb" -) - -// ensure the imports are used -var ( - _ = bytes.MinRead - _ = errors.New("") - _ = fmt.Print - _ = utf8.UTFMax - _ = (*regexp.Regexp)(nil) - _ = (*strings.Reader)(nil) - _ = net.IPv4len - _ = time.Duration(0) - _ = (*url.URL)(nil) - _ = (*mail.Address)(nil) - _ = anypb.Any{} - _ = sort.Sort -) - -// Validate checks the field values on StringArray 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 *StringArray) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on StringArray 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 StringArrayMultiError, or -// nil if none found. -func (m *StringArray) ValidateAll() error { - return m.validate(true) -} - -func (m *StringArray) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return StringArrayMultiError(errors) - } - - return nil -} - -// StringArrayMultiError is an error wrapping multiple validation errors -// returned by StringArray.ValidateAll() if the designated constraints aren't met. -type StringArrayMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m StringArrayMultiError) 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 StringArrayMultiError) AllErrors() []error { return m } - -// StringArrayValidationError is the validation error returned by -// StringArray.Validate if the designated constraints aren't met. -type StringArrayValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e StringArrayValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e StringArrayValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e StringArrayValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e StringArrayValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e StringArrayValidationError) ErrorName() string { return "StringArrayValidationError" } - -// Error satisfies the builtin error interface -func (e StringArrayValidationError) 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 %sStringArray.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = StringArrayValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = StringArrayValidationError{} - -// Validate checks the field values on StringMap 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 *StringMap) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on StringMap 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 StringMapMultiError, or nil -// if none found. -func (m *StringMap) ValidateAll() error { - return m.validate(true) -} - -func (m *StringMap) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Values - - if len(errors) > 0 { - return StringMapMultiError(errors) - } - - return nil -} - -// StringMapMultiError is an error wrapping multiple validation errors returned -// by StringMap.ValidateAll() if the designated constraints aren't met. -type StringMapMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m StringMapMultiError) 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 StringMapMultiError) AllErrors() []error { return m } - -// StringMapValidationError is the validation error returned by -// StringMap.Validate if the designated constraints aren't met. -type StringMapValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e StringMapValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e StringMapValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e StringMapValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e StringMapValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e StringMapValidationError) ErrorName() string { return "StringMapValidationError" } - -// Error satisfies the builtin error interface -func (e StringMapValidationError) 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 %sStringMap.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = StringMapValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = StringMapValidationError{} diff --git a/api/common/metrics_resolutions.pb.go b/api/common/metrics_resolutions.pb.go deleted file mode 100644 index 6b04e5848a3..00000000000 --- a/api/common/metrics_resolutions.pb.go +++ /dev/null @@ -1,155 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.10 -// protoc (unknown) -// source: common/metrics_resolutions.proto - -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" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// MetricsResolutions represents Prometheus exporters metrics resolutions. -type MetricsResolutions struct { - state protoimpl.MessageState `protogen:"open.v1"` - // High resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Hr *durationpb.Duration `protobuf:"bytes,1,opt,name=hr,proto3" json:"hr,omitempty"` - // Medium resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Mr *durationpb.Duration `protobuf:"bytes,2,opt,name=mr,proto3" json:"mr,omitempty"` - // Low resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Lr *durationpb.Duration `protobuf:"bytes,3,opt,name=lr,proto3" json:"lr,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *MetricsResolutions) Reset() { - *x = MetricsResolutions{} - mi := &file_common_metrics_resolutions_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *MetricsResolutions) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MetricsResolutions) ProtoMessage() {} - -func (x *MetricsResolutions) ProtoReflect() protoreflect.Message { - mi := &file_common_metrics_resolutions_proto_msgTypes[0] - 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 MetricsResolutions.ProtoReflect.Descriptor instead. -func (*MetricsResolutions) Descriptor() ([]byte, []int) { - return file_common_metrics_resolutions_proto_rawDescGZIP(), []int{0} -} - -func (x *MetricsResolutions) GetHr() *durationpb.Duration { - if x != nil { - return x.Hr - } - return nil -} - -func (x *MetricsResolutions) GetMr() *durationpb.Duration { - if x != nil { - return x.Mr - } - return nil -} - -func (x *MetricsResolutions) GetLr() *durationpb.Duration { - if x != nil { - return x.Lr - } - return nil -} - -var File_common_metrics_resolutions_proto protoreflect.FileDescriptor - -const file_common_metrics_resolutions_proto_rawDesc = "" + - "\n" + - " common/metrics_resolutions.proto\x12\x06common\x1a\x1egoogle/protobuf/duration.proto\"\x95\x01\n" + - "\x12MetricsResolutions\x12)\n" + - "\x02hr\x18\x01 \x01(\v2\x19.google.protobuf.DurationR\x02hr\x12)\n" + - "\x02mr\x18\x02 \x01(\v2\x19.google.protobuf.DurationR\x02mr\x12)\n" + - "\x02lr\x18\x03 \x01(\v2\x19.google.protobuf.DurationR\x02lrB\x80\x01\n" + - "\n" + - "com.commonB\x17MetricsResolutionsProtoP\x01Z!github.com/percona/pmm/api/common\xa2\x02\x03CXX\xaa\x02\x06Common\xca\x02\x06Common\xe2\x02\x12Common\\GPBMetadata\xea\x02\x06Commonb\x06proto3" - -var ( - file_common_metrics_resolutions_proto_rawDescOnce sync.Once - file_common_metrics_resolutions_proto_rawDescData []byte -) - -func file_common_metrics_resolutions_proto_rawDescGZIP() []byte { - file_common_metrics_resolutions_proto_rawDescOnce.Do(func() { - file_common_metrics_resolutions_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_common_metrics_resolutions_proto_rawDesc), len(file_common_metrics_resolutions_proto_rawDesc))) - }) - 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_depIdxs = []int32{ - 1, // 0: common.MetricsResolutions.hr:type_name -> google.protobuf.Duration - 1, // 1: common.MetricsResolutions.mr:type_name -> google.protobuf.Duration - 1, // 2: common.MetricsResolutions.lr:type_name -> google.protobuf.Duration - 3, // [3:3] is the sub-list for method output_type - 3, // [3:3] is the sub-list for method input_type - 3, // [3:3] is the sub-list for extension type_name - 3, // [3:3] is the sub-list for extension extendee - 0, // [0:3] is the sub-list for field type_name -} - -func init() { file_common_metrics_resolutions_proto_init() } -func file_common_metrics_resolutions_proto_init() { - if File_common_metrics_resolutions_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_common_metrics_resolutions_proto_rawDesc), len(file_common_metrics_resolutions_proto_rawDesc)), - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_common_metrics_resolutions_proto_goTypes, - DependencyIndexes: file_common_metrics_resolutions_proto_depIdxs, - MessageInfos: file_common_metrics_resolutions_proto_msgTypes, - }.Build() - File_common_metrics_resolutions_proto = out.File - file_common_metrics_resolutions_proto_goTypes = nil - file_common_metrics_resolutions_proto_depIdxs = nil -} diff --git a/api/common/metrics_resolutions.pb.validate.go b/api/common/metrics_resolutions.pb.validate.go deleted file mode 100644 index 0668c224e6f..00000000000 --- a/api/common/metrics_resolutions.pb.validate.go +++ /dev/null @@ -1,225 +0,0 @@ -// Code generated by protoc-gen-validate. DO NOT EDIT. -// source: common/metrics_resolutions.proto - -package common - -import ( - "bytes" - "errors" - "fmt" - "net" - "net/mail" - "net/url" - "regexp" - "sort" - "strings" - "time" - "unicode/utf8" - - "google.golang.org/protobuf/types/known/anypb" -) - -// ensure the imports are used -var ( - _ = bytes.MinRead - _ = errors.New("") - _ = fmt.Print - _ = utf8.UTFMax - _ = (*regexp.Regexp)(nil) - _ = (*strings.Reader)(nil) - _ = net.IPv4len - _ = time.Duration(0) - _ = (*url.URL)(nil) - _ = (*mail.Address)(nil) - _ = anypb.Any{} - _ = sort.Sort -) - -// Validate checks the field values on MetricsResolutions 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 *MetricsResolutions) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on MetricsResolutions 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 -// MetricsResolutionsMultiError, or nil if none found. -func (m *MetricsResolutions) ValidateAll() error { - return m.validate(true) -} - -func (m *MetricsResolutions) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if all { - switch v := interface{}(m.GetHr()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, MetricsResolutionsValidationError{ - field: "Hr", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, MetricsResolutionsValidationError{ - field: "Hr", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetHr()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return MetricsResolutionsValidationError{ - field: "Hr", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetMr()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, MetricsResolutionsValidationError{ - field: "Mr", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, MetricsResolutionsValidationError{ - field: "Mr", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMr()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return MetricsResolutionsValidationError{ - field: "Mr", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetLr()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, MetricsResolutionsValidationError{ - field: "Lr", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, MetricsResolutionsValidationError{ - field: "Lr", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetLr()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return MetricsResolutionsValidationError{ - field: "Lr", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if len(errors) > 0 { - return MetricsResolutionsMultiError(errors) - } - - return nil -} - -// MetricsResolutionsMultiError is an error wrapping multiple validation errors -// returned by MetricsResolutions.ValidateAll() if the designated constraints -// aren't met. -type MetricsResolutionsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m MetricsResolutionsMultiError) 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 MetricsResolutionsMultiError) AllErrors() []error { return m } - -// MetricsResolutionsValidationError is the validation error returned by -// MetricsResolutions.Validate if the designated constraints aren't met. -type MetricsResolutionsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e MetricsResolutionsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e MetricsResolutionsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e MetricsResolutionsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e MetricsResolutionsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e MetricsResolutionsValidationError) ErrorName() string { - return "MetricsResolutionsValidationError" -} - -// Error satisfies the builtin error interface -func (e MetricsResolutionsValidationError) 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 %sMetricsResolutions.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = MetricsResolutionsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = MetricsResolutionsValidationError{} diff --git a/api/dump/v1beta1/dump.pb.go b/api/dump/v1beta1/dump.pb.go deleted file mode 100644 index c41b91fc421..00000000000 --- a/api/dump/v1beta1/dump.pb.go +++ /dev/null @@ -1,919 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.10 -// protoc (unknown) -// source: dump/v1beta1/dump.proto - -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" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type DumpStatus int32 - -const ( - DumpStatus_DUMP_STATUS_UNSPECIFIED DumpStatus = 0 - DumpStatus_DUMP_STATUS_IN_PROGRESS DumpStatus = 1 - DumpStatus_DUMP_STATUS_SUCCESS DumpStatus = 2 - DumpStatus_DUMP_STATUS_ERROR DumpStatus = 3 -) - -// Enum value maps for DumpStatus. -var ( - DumpStatus_name = map[int32]string{ - 0: "DUMP_STATUS_UNSPECIFIED", - 1: "DUMP_STATUS_IN_PROGRESS", - 2: "DUMP_STATUS_SUCCESS", - 3: "DUMP_STATUS_ERROR", - } - DumpStatus_value = map[string]int32{ - "DUMP_STATUS_UNSPECIFIED": 0, - "DUMP_STATUS_IN_PROGRESS": 1, - "DUMP_STATUS_SUCCESS": 2, - "DUMP_STATUS_ERROR": 3, - } -) - -func (x DumpStatus) Enum() *DumpStatus { - p := new(DumpStatus) - *p = x - return p -} - -func (x DumpStatus) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (DumpStatus) Descriptor() protoreflect.EnumDescriptor { - return file_dump_v1beta1_dump_proto_enumTypes[0].Descriptor() -} - -func (DumpStatus) Type() protoreflect.EnumType { - return &file_dump_v1beta1_dump_proto_enumTypes[0] -} - -func (x DumpStatus) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use DumpStatus.Descriptor instead. -func (DumpStatus) EnumDescriptor() ([]byte, []int) { - return file_dump_v1beta1_dump_proto_rawDescGZIP(), []int{0} -} - -type Dump struct { - state protoimpl.MessageState `protogen:"open.v1"` - DumpId string `protobuf:"bytes,1,opt,name=dump_id,json=dumpId,proto3" json:"dump_id,omitempty"` - Status DumpStatus `protobuf:"varint,2,opt,name=status,proto3,enum=dump.v1beta1.DumpStatus" json:"status,omitempty"` - ServiceNames []string `protobuf:"bytes,3,rep,name=service_names,json=serviceNames,proto3" json:"service_names,omitempty"` - StartTime *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` - EndTime *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"` - CreatedAt *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Dump) Reset() { - *x = Dump{} - mi := &file_dump_v1beta1_dump_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Dump) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Dump) ProtoMessage() {} - -func (x *Dump) ProtoReflect() protoreflect.Message { - mi := &file_dump_v1beta1_dump_proto_msgTypes[0] - 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 Dump.ProtoReflect.Descriptor instead. -func (*Dump) Descriptor() ([]byte, []int) { - return file_dump_v1beta1_dump_proto_rawDescGZIP(), []int{0} -} - -func (x *Dump) GetDumpId() string { - if x != nil { - return x.DumpId - } - return "" -} - -func (x *Dump) GetStatus() DumpStatus { - if x != nil { - return x.Status - } - return DumpStatus_DUMP_STATUS_UNSPECIFIED -} - -func (x *Dump) GetServiceNames() []string { - if x != nil { - return x.ServiceNames - } - return nil -} - -func (x *Dump) GetStartTime() *timestamppb.Timestamp { - if x != nil { - return x.StartTime - } - return nil -} - -func (x *Dump) GetEndTime() *timestamppb.Timestamp { - if x != nil { - return x.EndTime - } - return nil -} - -func (x *Dump) GetCreatedAt() *timestamppb.Timestamp { - if x != nil { - return x.CreatedAt - } - return nil -} - -type StartDumpRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - ServiceNames []string `protobuf:"bytes,1,rep,name=service_names,json=serviceNames,proto3" json:"service_names,omitempty"` - StartTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` - EndTime *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"` - ExportQan bool `protobuf:"varint,4,opt,name=export_qan,json=exportQan,proto3" json:"export_qan,omitempty"` - IgnoreLoad bool `protobuf:"varint,5,opt,name=ignore_load,json=ignoreLoad,proto3" json:"ignore_load,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StartDumpRequest) Reset() { - *x = StartDumpRequest{} - mi := &file_dump_v1beta1_dump_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StartDumpRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StartDumpRequest) ProtoMessage() {} - -func (x *StartDumpRequest) ProtoReflect() protoreflect.Message { - mi := &file_dump_v1beta1_dump_proto_msgTypes[1] - 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 StartDumpRequest.ProtoReflect.Descriptor instead. -func (*StartDumpRequest) Descriptor() ([]byte, []int) { - return file_dump_v1beta1_dump_proto_rawDescGZIP(), []int{1} -} - -func (x *StartDumpRequest) GetServiceNames() []string { - if x != nil { - return x.ServiceNames - } - return nil -} - -func (x *StartDumpRequest) GetStartTime() *timestamppb.Timestamp { - if x != nil { - return x.StartTime - } - return nil -} - -func (x *StartDumpRequest) GetEndTime() *timestamppb.Timestamp { - if x != nil { - return x.EndTime - } - return nil -} - -func (x *StartDumpRequest) GetExportQan() bool { - if x != nil { - return x.ExportQan - } - return false -} - -func (x *StartDumpRequest) GetIgnoreLoad() bool { - if x != nil { - return x.IgnoreLoad - } - return false -} - -type StartDumpResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - DumpId string `protobuf:"bytes,1,opt,name=dump_id,json=dumpId,proto3" json:"dump_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StartDumpResponse) Reset() { - *x = StartDumpResponse{} - mi := &file_dump_v1beta1_dump_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StartDumpResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StartDumpResponse) ProtoMessage() {} - -func (x *StartDumpResponse) ProtoReflect() protoreflect.Message { - mi := &file_dump_v1beta1_dump_proto_msgTypes[2] - 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 StartDumpResponse.ProtoReflect.Descriptor instead. -func (*StartDumpResponse) Descriptor() ([]byte, []int) { - return file_dump_v1beta1_dump_proto_rawDescGZIP(), []int{2} -} - -func (x *StartDumpResponse) GetDumpId() string { - if x != nil { - return x.DumpId - } - return "" -} - -type ListDumpsRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ListDumpsRequest) Reset() { - *x = ListDumpsRequest{} - mi := &file_dump_v1beta1_dump_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ListDumpsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListDumpsRequest) ProtoMessage() {} - -func (x *ListDumpsRequest) ProtoReflect() protoreflect.Message { - mi := &file_dump_v1beta1_dump_proto_msgTypes[3] - 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 ListDumpsRequest.ProtoReflect.Descriptor instead. -func (*ListDumpsRequest) Descriptor() ([]byte, []int) { - return file_dump_v1beta1_dump_proto_rawDescGZIP(), []int{3} -} - -type ListDumpsResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Dumps []*Dump `protobuf:"bytes,1,rep,name=dumps,proto3" json:"dumps,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ListDumpsResponse) Reset() { - *x = ListDumpsResponse{} - mi := &file_dump_v1beta1_dump_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ListDumpsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListDumpsResponse) ProtoMessage() {} - -func (x *ListDumpsResponse) ProtoReflect() protoreflect.Message { - mi := &file_dump_v1beta1_dump_proto_msgTypes[4] - 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 ListDumpsResponse.ProtoReflect.Descriptor instead. -func (*ListDumpsResponse) Descriptor() ([]byte, []int) { - return file_dump_v1beta1_dump_proto_rawDescGZIP(), []int{4} -} - -func (x *ListDumpsResponse) GetDumps() []*Dump { - if x != nil { - return x.Dumps - } - return nil -} - -type DeleteDumpRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - DumpIds []string `protobuf:"bytes,1,rep,name=dump_ids,json=dumpIds,proto3" json:"dump_ids,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DeleteDumpRequest) Reset() { - *x = DeleteDumpRequest{} - mi := &file_dump_v1beta1_dump_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DeleteDumpRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteDumpRequest) ProtoMessage() {} - -func (x *DeleteDumpRequest) ProtoReflect() protoreflect.Message { - mi := &file_dump_v1beta1_dump_proto_msgTypes[5] - 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 DeleteDumpRequest.ProtoReflect.Descriptor instead. -func (*DeleteDumpRequest) Descriptor() ([]byte, []int) { - return file_dump_v1beta1_dump_proto_rawDescGZIP(), []int{5} -} - -func (x *DeleteDumpRequest) GetDumpIds() []string { - if x != nil { - return x.DumpIds - } - return nil -} - -type DeleteDumpResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DeleteDumpResponse) Reset() { - *x = DeleteDumpResponse{} - mi := &file_dump_v1beta1_dump_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DeleteDumpResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteDumpResponse) ProtoMessage() {} - -func (x *DeleteDumpResponse) ProtoReflect() protoreflect.Message { - mi := &file_dump_v1beta1_dump_proto_msgTypes[6] - 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 DeleteDumpResponse.ProtoReflect.Descriptor instead. -func (*DeleteDumpResponse) Descriptor() ([]byte, []int) { - return file_dump_v1beta1_dump_proto_rawDescGZIP(), []int{6} -} - -type GetDumpLogsRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - DumpId string `protobuf:"bytes,1,opt,name=dump_id,json=dumpId,proto3" json:"dump_id,omitempty"` - Offset uint32 `protobuf:"varint,2,opt,name=offset,proto3" json:"offset,omitempty"` - Limit uint32 `protobuf:"varint,3,opt,name=limit,proto3" json:"limit,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetDumpLogsRequest) Reset() { - *x = GetDumpLogsRequest{} - mi := &file_dump_v1beta1_dump_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetDumpLogsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetDumpLogsRequest) ProtoMessage() {} - -func (x *GetDumpLogsRequest) ProtoReflect() protoreflect.Message { - mi := &file_dump_v1beta1_dump_proto_msgTypes[7] - 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 GetDumpLogsRequest.ProtoReflect.Descriptor instead. -func (*GetDumpLogsRequest) Descriptor() ([]byte, []int) { - return file_dump_v1beta1_dump_proto_rawDescGZIP(), []int{7} -} - -func (x *GetDumpLogsRequest) GetDumpId() string { - if x != nil { - return x.DumpId - } - return "" -} - -func (x *GetDumpLogsRequest) GetOffset() uint32 { - if x != nil { - return x.Offset - } - return 0 -} - -func (x *GetDumpLogsRequest) GetLimit() uint32 { - if x != nil { - return x.Limit - } - return 0 -} - -type GetDumpLogsResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Logs []*LogChunk `protobuf:"bytes,1,rep,name=logs,proto3" json:"logs,omitempty"` - End bool `protobuf:"varint,2,opt,name=end,proto3" json:"end,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetDumpLogsResponse) Reset() { - *x = GetDumpLogsResponse{} - mi := &file_dump_v1beta1_dump_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetDumpLogsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetDumpLogsResponse) ProtoMessage() {} - -func (x *GetDumpLogsResponse) ProtoReflect() protoreflect.Message { - mi := &file_dump_v1beta1_dump_proto_msgTypes[8] - 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 GetDumpLogsResponse.ProtoReflect.Descriptor instead. -func (*GetDumpLogsResponse) Descriptor() ([]byte, []int) { - return file_dump_v1beta1_dump_proto_rawDescGZIP(), []int{8} -} - -func (x *GetDumpLogsResponse) GetLogs() []*LogChunk { - if x != nil { - return x.Logs - } - return nil -} - -func (x *GetDumpLogsResponse) GetEnd() bool { - if x != nil { - return x.End - } - return false -} - -// LogChunk represent one chunk of logs. -type LogChunk struct { - state protoimpl.MessageState `protogen:"open.v1"` - ChunkId uint32 `protobuf:"varint,1,opt,name=chunk_id,json=chunkId,proto3" json:"chunk_id,omitempty"` - Data string `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *LogChunk) Reset() { - *x = LogChunk{} - mi := &file_dump_v1beta1_dump_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *LogChunk) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*LogChunk) ProtoMessage() {} - -func (x *LogChunk) ProtoReflect() protoreflect.Message { - mi := &file_dump_v1beta1_dump_proto_msgTypes[9] - 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 LogChunk.ProtoReflect.Descriptor instead. -func (*LogChunk) Descriptor() ([]byte, []int) { - return file_dump_v1beta1_dump_proto_rawDescGZIP(), []int{9} -} - -func (x *LogChunk) GetChunkId() uint32 { - if x != nil { - return x.ChunkId - } - return 0 -} - -func (x *LogChunk) GetData() string { - if x != nil { - return x.Data - } - return "" -} - -type SFTPParameters struct { - state protoimpl.MessageState `protogen:"open.v1"` - Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - User string `protobuf:"bytes,2,opt,name=user,proto3" json:"user,omitempty"` - Password string `protobuf:"bytes,3,opt,name=password,proto3" json:"password,omitempty"` - Directory string `protobuf:"bytes,4,opt,name=directory,proto3" json:"directory,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SFTPParameters) Reset() { - *x = SFTPParameters{} - mi := &file_dump_v1beta1_dump_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SFTPParameters) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SFTPParameters) ProtoMessage() {} - -func (x *SFTPParameters) ProtoReflect() protoreflect.Message { - mi := &file_dump_v1beta1_dump_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 SFTPParameters.ProtoReflect.Descriptor instead. -func (*SFTPParameters) Descriptor() ([]byte, []int) { - return file_dump_v1beta1_dump_proto_rawDescGZIP(), []int{10} -} - -func (x *SFTPParameters) GetAddress() string { - if x != nil { - return x.Address - } - return "" -} - -func (x *SFTPParameters) GetUser() string { - if x != nil { - return x.User - } - return "" -} - -func (x *SFTPParameters) GetPassword() string { - if x != nil { - return x.Password - } - return "" -} - -func (x *SFTPParameters) GetDirectory() string { - if x != nil { - return x.Directory - } - return "" -} - -type UploadDumpRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - DumpIds []string `protobuf:"bytes,1,rep,name=dump_ids,json=dumpIds,proto3" json:"dump_ids,omitempty"` - // SFTP upload parameters. - SftpParameters *SFTPParameters `protobuf:"bytes,2,opt,name=sftp_parameters,json=sftpParameters,proto3" json:"sftp_parameters,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *UploadDumpRequest) Reset() { - *x = UploadDumpRequest{} - mi := &file_dump_v1beta1_dump_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *UploadDumpRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UploadDumpRequest) ProtoMessage() {} - -func (x *UploadDumpRequest) ProtoReflect() protoreflect.Message { - mi := &file_dump_v1beta1_dump_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 UploadDumpRequest.ProtoReflect.Descriptor instead. -func (*UploadDumpRequest) Descriptor() ([]byte, []int) { - return file_dump_v1beta1_dump_proto_rawDescGZIP(), []int{11} -} - -func (x *UploadDumpRequest) GetDumpIds() []string { - if x != nil { - return x.DumpIds - } - return nil -} - -func (x *UploadDumpRequest) GetSftpParameters() *SFTPParameters { - if x != nil { - return x.SftpParameters - } - return nil -} - -type UploadDumpResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *UploadDumpResponse) Reset() { - *x = UploadDumpResponse{} - mi := &file_dump_v1beta1_dump_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *UploadDumpResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UploadDumpResponse) ProtoMessage() {} - -func (x *UploadDumpResponse) ProtoReflect() protoreflect.Message { - mi := &file_dump_v1beta1_dump_proto_msgTypes[12] - 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 UploadDumpResponse.ProtoReflect.Descriptor instead. -func (*UploadDumpResponse) Descriptor() ([]byte, []int) { - return file_dump_v1beta1_dump_proto_rawDescGZIP(), []int{12} -} - -var File_dump_v1beta1_dump_proto protoreflect.FileDescriptor - -const file_dump_v1beta1_dump_proto_rawDesc = "" + - "\n" + - "\x17dump/v1beta1/dump.proto\x12\fdump.v1beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a.protoc-gen-openapiv2/options/annotations.proto\x1a\x17validate/validate.proto\"\xa3\x02\n" + - "\x04Dump\x12\x17\n" + - "\adump_id\x18\x01 \x01(\tR\x06dumpId\x120\n" + - "\x06status\x18\x02 \x01(\x0e2\x18.dump.v1beta1.DumpStatusR\x06status\x12#\n" + - "\rservice_names\x18\x03 \x03(\tR\fserviceNames\x129\n" + - "\n" + - "start_time\x18\x04 \x01(\v2\x1a.google.protobuf.TimestampR\tstartTime\x125\n" + - "\bend_time\x18\x05 \x01(\v2\x1a.google.protobuf.TimestampR\aendTime\x129\n" + - "\n" + - "created_at\x18\a \x01(\v2\x1a.google.protobuf.TimestampR\tcreatedAt\"\xe9\x01\n" + - "\x10StartDumpRequest\x12#\n" + - "\rservice_names\x18\x01 \x03(\tR\fserviceNames\x129\n" + - "\n" + - "start_time\x18\x02 \x01(\v2\x1a.google.protobuf.TimestampR\tstartTime\x125\n" + - "\bend_time\x18\x03 \x01(\v2\x1a.google.protobuf.TimestampR\aendTime\x12\x1d\n" + - "\n" + - "export_qan\x18\x04 \x01(\bR\texportQan\x12\x1f\n" + - "\vignore_load\x18\x05 \x01(\bR\n" + - "ignoreLoad\",\n" + - "\x11StartDumpResponse\x12\x17\n" + - "\adump_id\x18\x01 \x01(\tR\x06dumpId\"\x12\n" + - "\x10ListDumpsRequest\"=\n" + - "\x11ListDumpsResponse\x12(\n" + - "\x05dumps\x18\x01 \x03(\v2\x12.dump.v1beta1.DumpR\x05dumps\":\n" + - "\x11DeleteDumpRequest\x12%\n" + - "\bdump_ids\x18\x01 \x03(\tB\n" + - "\xfaB\a\x92\x01\x04\b\x01\x18\x01R\adumpIds\"\x14\n" + - "\x12DeleteDumpResponse\"d\n" + - "\x12GetDumpLogsRequest\x12 \n" + - "\adump_id\x18\x01 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\x06dumpId\x12\x16\n" + - "\x06offset\x18\x02 \x01(\rR\x06offset\x12\x14\n" + - "\x05limit\x18\x03 \x01(\rR\x05limit\"S\n" + - "\x13GetDumpLogsResponse\x12*\n" + - "\x04logs\x18\x01 \x03(\v2\x16.dump.v1beta1.LogChunkR\x04logs\x12\x10\n" + - "\x03end\x18\x02 \x01(\bR\x03end\"9\n" + - "\bLogChunk\x12\x19\n" + - "\bchunk_id\x18\x01 \x01(\rR\achunkId\x12\x12\n" + - "\x04data\x18\x02 \x01(\tR\x04data\"\x93\x01\n" + - "\x0eSFTPParameters\x12!\n" + - "\aaddress\x18\x01 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\aaddress\x12\x1b\n" + - "\x04user\x18\x02 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\x04user\x12#\n" + - "\bpassword\x18\x03 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\bpassword\x12\x1c\n" + - "\tdirectory\x18\x04 \x01(\tR\tdirectory\"\x8b\x01\n" + - "\x11UploadDumpRequest\x12%\n" + - "\bdump_ids\x18\x01 \x03(\tB\n" + - "\xfaB\a\x92\x01\x04\b\x01\x18\x01R\adumpIds\x12O\n" + - "\x0fsftp_parameters\x18\x02 \x01(\v2\x1c.dump.v1beta1.SFTPParametersB\b\xfaB\x05\x8a\x01\x02\x10\x01R\x0esftpParameters\"\x14\n" + - "\x12UploadDumpResponse*v\n" + - "\n" + - "DumpStatus\x12\x1b\n" + - "\x17DUMP_STATUS_UNSPECIFIED\x10\x00\x12\x1b\n" + - "\x17DUMP_STATUS_IN_PROGRESS\x10\x01\x12\x17\n" + - "\x13DUMP_STATUS_SUCCESS\x10\x02\x12\x15\n" + - "\x11DUMP_STATUS_ERROR\x10\x032\x94\x06\n" + - "\vDumpService\x12\x90\x01\n" + - "\tStartDump\x12\x1e.dump.v1beta1.StartDumpRequest\x1a\x1f.dump.v1beta1.StartDumpResponse\"B\x92A%\x12\x10Start a New Dump\x1a\x11Start a new dump.\x82\xd3\xe4\x93\x02\x14:\x01*\"\x0f/v1/dumps:start\x12\x82\x01\n" + - "\tListDumps\x12\x1e.dump.v1beta1.ListDumpsRequest\x1a\x1f.dump.v1beta1.ListDumpsResponse\"4\x92A \x12\x0eList All Dumps\x1a\x0eList all dumps\x82\xd3\xe4\x93\x02\v\x12\t/v1/dumps\x12\x9a\x01\n" + - "\n" + - "DeleteDump\x12\x1f.dump.v1beta1.DeleteDumpRequest\x1a .dump.v1beta1.DeleteDumpResponse\"I\x92A&\x12\fDelete Dumps\x1a\x16Delete selected dumps.\x82\xd3\xe4\x93\x02\x1a:\x01*\"\x15/v1/dumps:batchDelete\x12\xa4\x01\n" + - "\vGetDumpLogs\x12 .dump.v1beta1.GetDumpLogsRequest\x1a!.dump.v1beta1.GetDumpLogsResponse\"P\x92A-\x12\rGet Dump Logs\x1a\x1cGet logs of a selected dump.\x82\xd3\xe4\x93\x02\x1a\x12\x18/v1/dumps/{dump_id}/logs\x12\xa8\x01\n" + - "\n" + - "UploadDump\x12\x1f.dump.v1beta1.UploadDumpRequest\x1a .dump.v1beta1.UploadDumpResponse\"W\x92A9\x12\fUpload Dumps\x1a)Upload selected dumps to a remote server.\x82\xd3\xe4\x93\x02\x15:\x01*\"\x10/v1/dumps:uploadB\xa3\x01\n" + - "\x10com.dump.v1beta1B\tDumpProtoP\x01Z3github.com/percona/pmm/api/dump/v1beta1;dumpv1beta1\xa2\x02\x03DXX\xaa\x02\fDump.V1beta1\xca\x02\fDump\\V1beta1\xe2\x02\x18Dump\\V1beta1\\GPBMetadata\xea\x02\rDump::V1beta1b\x06proto3" - -var ( - file_dump_v1beta1_dump_proto_rawDescOnce sync.Once - file_dump_v1beta1_dump_proto_rawDescData []byte -) - -func file_dump_v1beta1_dump_proto_rawDescGZIP() []byte { - file_dump_v1beta1_dump_proto_rawDescOnce.Do(func() { - file_dump_v1beta1_dump_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_dump_v1beta1_dump_proto_rawDesc), len(file_dump_v1beta1_dump_proto_rawDesc))) - }) - 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_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 - 14, // 2: dump.v1beta1.Dump.end_time:type_name -> google.protobuf.Timestamp - 14, // 3: dump.v1beta1.Dump.created_at:type_name -> google.protobuf.Timestamp - 14, // 4: dump.v1beta1.StartDumpRequest.start_time:type_name -> google.protobuf.Timestamp - 14, // 5: dump.v1beta1.StartDumpRequest.end_time:type_name -> google.protobuf.Timestamp - 1, // 6: dump.v1beta1.ListDumpsResponse.dumps:type_name -> dump.v1beta1.Dump - 10, // 7: dump.v1beta1.GetDumpLogsResponse.logs:type_name -> dump.v1beta1.LogChunk - 11, // 8: dump.v1beta1.UploadDumpRequest.sftp_parameters:type_name -> dump.v1beta1.SFTPParameters - 2, // 9: dump.v1beta1.DumpService.StartDump:input_type -> dump.v1beta1.StartDumpRequest - 4, // 10: dump.v1beta1.DumpService.ListDumps:input_type -> dump.v1beta1.ListDumpsRequest - 6, // 11: dump.v1beta1.DumpService.DeleteDump:input_type -> dump.v1beta1.DeleteDumpRequest - 8, // 12: dump.v1beta1.DumpService.GetDumpLogs:input_type -> dump.v1beta1.GetDumpLogsRequest - 12, // 13: dump.v1beta1.DumpService.UploadDump:input_type -> dump.v1beta1.UploadDumpRequest - 3, // 14: dump.v1beta1.DumpService.StartDump:output_type -> dump.v1beta1.StartDumpResponse - 5, // 15: dump.v1beta1.DumpService.ListDumps:output_type -> dump.v1beta1.ListDumpsResponse - 7, // 16: dump.v1beta1.DumpService.DeleteDump:output_type -> dump.v1beta1.DeleteDumpResponse - 9, // 17: dump.v1beta1.DumpService.GetDumpLogs:output_type -> dump.v1beta1.GetDumpLogsResponse - 13, // 18: dump.v1beta1.DumpService.UploadDump:output_type -> dump.v1beta1.UploadDumpResponse - 14, // [14:19] is the sub-list for method output_type - 9, // [9:14] is the sub-list for method input_type - 9, // [9:9] is the sub-list for extension type_name - 9, // [9:9] is the sub-list for extension extendee - 0, // [0:9] is the sub-list for field type_name -} - -func init() { file_dump_v1beta1_dump_proto_init() } -func file_dump_v1beta1_dump_proto_init() { - if File_dump_v1beta1_dump_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_dump_v1beta1_dump_proto_rawDesc), len(file_dump_v1beta1_dump_proto_rawDesc)), - NumEnums: 1, - NumMessages: 13, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_dump_v1beta1_dump_proto_goTypes, - DependencyIndexes: file_dump_v1beta1_dump_proto_depIdxs, - EnumInfos: file_dump_v1beta1_dump_proto_enumTypes, - MessageInfos: file_dump_v1beta1_dump_proto_msgTypes, - }.Build() - File_dump_v1beta1_dump_proto = out.File - file_dump_v1beta1_dump_proto_goTypes = nil - file_dump_v1beta1_dump_proto_depIdxs = nil -} diff --git a/api/dump/v1beta1/dump.pb.gw.go b/api/dump/v1beta1/dump.pb.gw.go deleted file mode 100644 index 81e4a968972..00000000000 --- a/api/dump/v1beta1/dump.pb.gw.go +++ /dev/null @@ -1,441 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: dump/v1beta1/dump.proto - -/* -Package dumpv1beta1 is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package dumpv1beta1 - -import ( - "context" - "errors" - "io" - "net/http" - - "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" - "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" - "google.golang.org/protobuf/proto" -) - -// Suppress "imported and not used" errors -var ( - _ codes.Code - _ io.Reader - _ status.Status - _ = errors.New - _ = runtime.String - _ = utilities.NewDoubleArray - _ = metadata.Join -) - -func request_DumpService_StartDump_0(ctx context.Context, marshaler runtime.Marshaler, client DumpServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq StartDumpRequest - 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.StartDump(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_DumpService_StartDump_0(ctx context.Context, marshaler runtime.Marshaler, server DumpServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq StartDumpRequest - 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.StartDump(ctx, &protoReq) - return msg, metadata, err -} - -func request_DumpService_ListDumps_0(ctx context.Context, marshaler runtime.Marshaler, client DumpServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq ListDumpsRequest - metadata runtime.ServerMetadata - ) - if req.Body != nil { - _, _ = io.Copy(io.Discard, req.Body) - } - msg, err := client.ListDumps(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_DumpService_ListDumps_0(ctx context.Context, marshaler runtime.Marshaler, server DumpServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq ListDumpsRequest - metadata runtime.ServerMetadata - ) - msg, err := server.ListDumps(ctx, &protoReq) - return msg, metadata, err -} - -func request_DumpService_DeleteDump_0(ctx context.Context, marshaler runtime.Marshaler, client DumpServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq DeleteDumpRequest - 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.DeleteDump(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_DumpService_DeleteDump_0(ctx context.Context, marshaler runtime.Marshaler, server DumpServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq DeleteDumpRequest - 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.DeleteDump(ctx, &protoReq) - return msg, metadata, err -} - -var filter_DumpService_GetDumpLogs_0 = &utilities.DoubleArray{Encoding: map[string]int{"dump_id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} - -func request_DumpService_GetDumpLogs_0(ctx context.Context, marshaler runtime.Marshaler, client DumpServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq GetDumpLogsRequest - metadata runtime.ServerMetadata - err error - ) - if req.Body != nil { - _, _ = io.Copy(io.Discard, req.Body) - } - val, ok := pathParams["dump_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "dump_id") - } - protoReq.DumpId, err = runtime.String(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "dump_id", err) - } - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_DumpService_GetDumpLogs_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - msg, err := client.GetDumpLogs(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_DumpService_GetDumpLogs_0(ctx context.Context, marshaler runtime.Marshaler, server DumpServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq GetDumpLogsRequest - metadata runtime.ServerMetadata - err error - ) - val, ok := pathParams["dump_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "dump_id") - } - protoReq.DumpId, err = runtime.String(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "dump_id", err) - } - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_DumpService_GetDumpLogs_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - msg, err := server.GetDumpLogs(ctx, &protoReq) - return msg, metadata, err -} - -func request_DumpService_UploadDump_0(ctx context.Context, marshaler runtime.Marshaler, client DumpServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq UploadDumpRequest - 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.UploadDump(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_DumpService_UploadDump_0(ctx context.Context, marshaler runtime.Marshaler, server DumpServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq UploadDumpRequest - 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.UploadDump(ctx, &protoReq) - return msg, metadata, err -} - -// RegisterDumpServiceHandlerServer registers the http handlers for service DumpService to "mux". -// UnaryRPC :call DumpServiceServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterDumpServiceHandlerFromEndpoint instead. -// GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call. -func RegisterDumpServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server DumpServiceServer) error { - mux.Handle(http.MethodPost, pattern_DumpService_StartDump_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, "/dump.v1beta1.DumpService/StartDump", runtime.WithHTTPPathPattern("/v1/dumps:start")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_DumpService_StartDump_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_DumpService_StartDump_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodGet, pattern_DumpService_ListDumps_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, "/dump.v1beta1.DumpService/ListDumps", runtime.WithHTTPPathPattern("/v1/dumps")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_DumpService_ListDumps_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_DumpService_ListDumps_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPost, pattern_DumpService_DeleteDump_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, "/dump.v1beta1.DumpService/DeleteDump", runtime.WithHTTPPathPattern("/v1/dumps:batchDelete")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_DumpService_DeleteDump_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_DumpService_DeleteDump_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodGet, pattern_DumpService_GetDumpLogs_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, "/dump.v1beta1.DumpService/GetDumpLogs", runtime.WithHTTPPathPattern("/v1/dumps/{dump_id}/logs")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_DumpService_GetDumpLogs_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_DumpService_GetDumpLogs_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPost, pattern_DumpService_UploadDump_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, "/dump.v1beta1.DumpService/UploadDump", runtime.WithHTTPPathPattern("/v1/dumps:upload")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_DumpService_UploadDump_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_DumpService_UploadDump_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - return nil -} - -// RegisterDumpServiceHandlerFromEndpoint is same as RegisterDumpServiceHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterDumpServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.NewClient(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - return RegisterDumpServiceHandler(ctx, mux, conn) -} - -// RegisterDumpServiceHandler registers the http handlers for service DumpService to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterDumpServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterDumpServiceHandlerClient(ctx, mux, NewDumpServiceClient(conn)) -} - -// RegisterDumpServiceHandlerClient registers the http handlers for service DumpService -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "DumpServiceClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "DumpServiceClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "DumpServiceClient" to call the correct interceptors. This client ignores the HTTP middlewares. -func RegisterDumpServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client DumpServiceClient) error { - mux.Handle(http.MethodPost, pattern_DumpService_StartDump_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, "/dump.v1beta1.DumpService/StartDump", runtime.WithHTTPPathPattern("/v1/dumps:start")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_DumpService_StartDump_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_DumpService_StartDump_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodGet, pattern_DumpService_ListDumps_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, "/dump.v1beta1.DumpService/ListDumps", runtime.WithHTTPPathPattern("/v1/dumps")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_DumpService_ListDumps_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_DumpService_ListDumps_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPost, pattern_DumpService_DeleteDump_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, "/dump.v1beta1.DumpService/DeleteDump", runtime.WithHTTPPathPattern("/v1/dumps:batchDelete")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_DumpService_DeleteDump_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_DumpService_DeleteDump_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodGet, pattern_DumpService_GetDumpLogs_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, "/dump.v1beta1.DumpService/GetDumpLogs", runtime.WithHTTPPathPattern("/v1/dumps/{dump_id}/logs")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_DumpService_GetDumpLogs_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_DumpService_GetDumpLogs_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPost, pattern_DumpService_UploadDump_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, "/dump.v1beta1.DumpService/UploadDump", runtime.WithHTTPPathPattern("/v1/dumps:upload")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_DumpService_UploadDump_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_DumpService_UploadDump_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - return nil -} - -var ( - pattern_DumpService_StartDump_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "dumps"}, "start")) - pattern_DumpService_ListDumps_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "dumps"}, "")) - pattern_DumpService_DeleteDump_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "dumps"}, "batchDelete")) - pattern_DumpService_GetDumpLogs_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3}, []string{"v1", "dumps", "dump_id", "logs"}, "")) - pattern_DumpService_UploadDump_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "dumps"}, "upload")) -) - -var ( - forward_DumpService_StartDump_0 = runtime.ForwardResponseMessage - forward_DumpService_ListDumps_0 = runtime.ForwardResponseMessage - forward_DumpService_DeleteDump_0 = runtime.ForwardResponseMessage - forward_DumpService_GetDumpLogs_0 = runtime.ForwardResponseMessage - forward_DumpService_UploadDump_0 = runtime.ForwardResponseMessage -) diff --git a/api/dump/v1beta1/dump.pb.validate.go b/api/dump/v1beta1/dump.pb.validate.go deleted file mode 100644 index 6ff806abc21..00000000000 --- a/api/dump/v1beta1/dump.pb.validate.go +++ /dev/null @@ -1,1732 +0,0 @@ -// Code generated by protoc-gen-validate. DO NOT EDIT. -// source: dump/v1beta1/dump.proto - -package dumpv1beta1 - -import ( - "bytes" - "errors" - "fmt" - "net" - "net/mail" - "net/url" - "regexp" - "sort" - "strings" - "time" - "unicode/utf8" - - "google.golang.org/protobuf/types/known/anypb" -) - -// ensure the imports are used -var ( - _ = bytes.MinRead - _ = errors.New("") - _ = fmt.Print - _ = utf8.UTFMax - _ = (*regexp.Regexp)(nil) - _ = (*strings.Reader)(nil) - _ = net.IPv4len - _ = time.Duration(0) - _ = (*url.URL)(nil) - _ = (*mail.Address)(nil) - _ = anypb.Any{} - _ = sort.Sort -) - -// Validate checks the field values on Dump 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 *Dump) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on Dump 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 DumpMultiError, or nil if none found. -func (m *Dump) ValidateAll() error { - return m.validate(true) -} - -func (m *Dump) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for DumpId - - // no validation rules for Status - - if all { - switch v := interface{}(m.GetStartTime()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, DumpValidationError{ - field: "StartTime", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, DumpValidationError{ - field: "StartTime", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetStartTime()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return DumpValidationError{ - field: "StartTime", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetEndTime()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, DumpValidationError{ - field: "EndTime", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, DumpValidationError{ - field: "EndTime", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetEndTime()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return DumpValidationError{ - field: "EndTime", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetCreatedAt()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, DumpValidationError{ - field: "CreatedAt", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, DumpValidationError{ - field: "CreatedAt", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetCreatedAt()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return DumpValidationError{ - field: "CreatedAt", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if len(errors) > 0 { - return DumpMultiError(errors) - } - - return nil -} - -// DumpMultiError is an error wrapping multiple validation errors returned by -// Dump.ValidateAll() if the designated constraints aren't met. -type DumpMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m DumpMultiError) 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 DumpMultiError) AllErrors() []error { return m } - -// DumpValidationError is the validation error returned by Dump.Validate if the -// designated constraints aren't met. -type DumpValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e DumpValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e DumpValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e DumpValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e DumpValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e DumpValidationError) ErrorName() string { return "DumpValidationError" } - -// Error satisfies the builtin error interface -func (e DumpValidationError) 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 %sDump.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = DumpValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = DumpValidationError{} - -// Validate checks the field values on StartDumpRequest 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 *StartDumpRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on StartDumpRequest 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 -// StartDumpRequestMultiError, or nil if none found. -func (m *StartDumpRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *StartDumpRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if all { - switch v := interface{}(m.GetStartTime()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, StartDumpRequestValidationError{ - field: "StartTime", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, StartDumpRequestValidationError{ - field: "StartTime", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetStartTime()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return StartDumpRequestValidationError{ - field: "StartTime", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetEndTime()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, StartDumpRequestValidationError{ - field: "EndTime", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, StartDumpRequestValidationError{ - field: "EndTime", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetEndTime()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return StartDumpRequestValidationError{ - field: "EndTime", - reason: "embedded message failed validation", - cause: err, - } - } - } - - // no validation rules for ExportQan - - // no validation rules for IgnoreLoad - - if len(errors) > 0 { - return StartDumpRequestMultiError(errors) - } - - return nil -} - -// StartDumpRequestMultiError is an error wrapping multiple validation errors -// returned by StartDumpRequest.ValidateAll() if the designated constraints -// aren't met. -type StartDumpRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m StartDumpRequestMultiError) 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 StartDumpRequestMultiError) AllErrors() []error { return m } - -// StartDumpRequestValidationError is the validation error returned by -// StartDumpRequest.Validate if the designated constraints aren't met. -type StartDumpRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e StartDumpRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e StartDumpRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e StartDumpRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e StartDumpRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e StartDumpRequestValidationError) ErrorName() string { return "StartDumpRequestValidationError" } - -// Error satisfies the builtin error interface -func (e StartDumpRequestValidationError) 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 %sStartDumpRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = StartDumpRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = StartDumpRequestValidationError{} - -// Validate checks the field values on StartDumpResponse 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 *StartDumpResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on StartDumpResponse 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 -// StartDumpResponseMultiError, or nil if none found. -func (m *StartDumpResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *StartDumpResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for DumpId - - if len(errors) > 0 { - return StartDumpResponseMultiError(errors) - } - - return nil -} - -// StartDumpResponseMultiError is an error wrapping multiple validation errors -// returned by StartDumpResponse.ValidateAll() if the designated constraints -// aren't met. -type StartDumpResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m StartDumpResponseMultiError) 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 StartDumpResponseMultiError) AllErrors() []error { return m } - -// StartDumpResponseValidationError is the validation error returned by -// StartDumpResponse.Validate if the designated constraints aren't met. -type StartDumpResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e StartDumpResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e StartDumpResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e StartDumpResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e StartDumpResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e StartDumpResponseValidationError) ErrorName() string { - return "StartDumpResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e StartDumpResponseValidationError) 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 %sStartDumpResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = StartDumpResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = StartDumpResponseValidationError{} - -// Validate checks the field values on ListDumpsRequest 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 *ListDumpsRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ListDumpsRequest 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 -// ListDumpsRequestMultiError, or nil if none found. -func (m *ListDumpsRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *ListDumpsRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return ListDumpsRequestMultiError(errors) - } - - return nil -} - -// ListDumpsRequestMultiError is an error wrapping multiple validation errors -// returned by ListDumpsRequest.ValidateAll() if the designated constraints -// aren't met. -type ListDumpsRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ListDumpsRequestMultiError) 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 ListDumpsRequestMultiError) AllErrors() []error { return m } - -// ListDumpsRequestValidationError is the validation error returned by -// ListDumpsRequest.Validate if the designated constraints aren't met. -type ListDumpsRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ListDumpsRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ListDumpsRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ListDumpsRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ListDumpsRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ListDumpsRequestValidationError) ErrorName() string { return "ListDumpsRequestValidationError" } - -// Error satisfies the builtin error interface -func (e ListDumpsRequestValidationError) 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 %sListDumpsRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ListDumpsRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ListDumpsRequestValidationError{} - -// Validate checks the field values on ListDumpsResponse 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 *ListDumpsResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ListDumpsResponse 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 -// ListDumpsResponseMultiError, or nil if none found. -func (m *ListDumpsResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *ListDumpsResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - for idx, item := range m.GetDumps() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ListDumpsResponseValidationError{ - field: fmt.Sprintf("Dumps[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ListDumpsResponseValidationError{ - field: fmt.Sprintf("Dumps[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ListDumpsResponseValidationError{ - field: fmt.Sprintf("Dumps[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - if len(errors) > 0 { - return ListDumpsResponseMultiError(errors) - } - - return nil -} - -// ListDumpsResponseMultiError is an error wrapping multiple validation errors -// returned by ListDumpsResponse.ValidateAll() if the designated constraints -// aren't met. -type ListDumpsResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ListDumpsResponseMultiError) 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 ListDumpsResponseMultiError) AllErrors() []error { return m } - -// ListDumpsResponseValidationError is the validation error returned by -// ListDumpsResponse.Validate if the designated constraints aren't met. -type ListDumpsResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ListDumpsResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ListDumpsResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ListDumpsResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ListDumpsResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ListDumpsResponseValidationError) ErrorName() string { - return "ListDumpsResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e ListDumpsResponseValidationError) 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 %sListDumpsResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ListDumpsResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ListDumpsResponseValidationError{} - -// Validate checks the field values on DeleteDumpRequest 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 *DeleteDumpRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on DeleteDumpRequest 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 -// DeleteDumpRequestMultiError, or nil if none found. -func (m *DeleteDumpRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *DeleteDumpRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(m.GetDumpIds()) < 1 { - err := DeleteDumpRequestValidationError{ - field: "DumpIds", - reason: "value must contain at least 1 item(s)", - } - if !all { - return err - } - errors = append(errors, err) - } - - _DeleteDumpRequest_DumpIds_Unique := make(map[string]struct{}, len(m.GetDumpIds())) - - for idx, item := range m.GetDumpIds() { - _, _ = idx, item - - if _, exists := _DeleteDumpRequest_DumpIds_Unique[item]; exists { - err := DeleteDumpRequestValidationError{ - field: fmt.Sprintf("DumpIds[%v]", idx), - reason: "repeated value must contain unique items", - } - if !all { - return err - } - errors = append(errors, err) - } else { - _DeleteDumpRequest_DumpIds_Unique[item] = struct{}{} - } - - // no validation rules for DumpIds[idx] - } - - if len(errors) > 0 { - return DeleteDumpRequestMultiError(errors) - } - - return nil -} - -// DeleteDumpRequestMultiError is an error wrapping multiple validation errors -// returned by DeleteDumpRequest.ValidateAll() if the designated constraints -// aren't met. -type DeleteDumpRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m DeleteDumpRequestMultiError) 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 DeleteDumpRequestMultiError) AllErrors() []error { return m } - -// DeleteDumpRequestValidationError is the validation error returned by -// DeleteDumpRequest.Validate if the designated constraints aren't met. -type DeleteDumpRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e DeleteDumpRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e DeleteDumpRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e DeleteDumpRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e DeleteDumpRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e DeleteDumpRequestValidationError) ErrorName() string { - return "DeleteDumpRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e DeleteDumpRequestValidationError) 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 %sDeleteDumpRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = DeleteDumpRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = DeleteDumpRequestValidationError{} - -// Validate checks the field values on DeleteDumpResponse 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 *DeleteDumpResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on DeleteDumpResponse 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 -// DeleteDumpResponseMultiError, or nil if none found. -func (m *DeleteDumpResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *DeleteDumpResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return DeleteDumpResponseMultiError(errors) - } - - return nil -} - -// DeleteDumpResponseMultiError is an error wrapping multiple validation errors -// returned by DeleteDumpResponse.ValidateAll() if the designated constraints -// aren't met. -type DeleteDumpResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m DeleteDumpResponseMultiError) 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 DeleteDumpResponseMultiError) AllErrors() []error { return m } - -// DeleteDumpResponseValidationError is the validation error returned by -// DeleteDumpResponse.Validate if the designated constraints aren't met. -type DeleteDumpResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e DeleteDumpResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e DeleteDumpResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e DeleteDumpResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e DeleteDumpResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e DeleteDumpResponseValidationError) ErrorName() string { - return "DeleteDumpResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e DeleteDumpResponseValidationError) 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 %sDeleteDumpResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = DeleteDumpResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = DeleteDumpResponseValidationError{} - -// Validate checks the field values on GetDumpLogsRequest 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 *GetDumpLogsRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on GetDumpLogsRequest 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 -// GetDumpLogsRequestMultiError, or nil if none found. -func (m *GetDumpLogsRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *GetDumpLogsRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetDumpId()) < 1 { - err := GetDumpLogsRequestValidationError{ - field: "DumpId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for Offset - - // no validation rules for Limit - - if len(errors) > 0 { - return GetDumpLogsRequestMultiError(errors) - } - - return nil -} - -// GetDumpLogsRequestMultiError is an error wrapping multiple validation errors -// returned by GetDumpLogsRequest.ValidateAll() if the designated constraints -// aren't met. -type GetDumpLogsRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m GetDumpLogsRequestMultiError) 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 GetDumpLogsRequestMultiError) AllErrors() []error { return m } - -// GetDumpLogsRequestValidationError is the validation error returned by -// GetDumpLogsRequest.Validate if the designated constraints aren't met. -type GetDumpLogsRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e GetDumpLogsRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e GetDumpLogsRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e GetDumpLogsRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e GetDumpLogsRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e GetDumpLogsRequestValidationError) ErrorName() string { - return "GetDumpLogsRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e GetDumpLogsRequestValidationError) 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 %sGetDumpLogsRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = GetDumpLogsRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = GetDumpLogsRequestValidationError{} - -// Validate checks the field values on GetDumpLogsResponse 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 *GetDumpLogsResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on GetDumpLogsResponse 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 -// GetDumpLogsResponseMultiError, or nil if none found. -func (m *GetDumpLogsResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *GetDumpLogsResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - for idx, item := range m.GetLogs() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GetDumpLogsResponseValidationError{ - field: fmt.Sprintf("Logs[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GetDumpLogsResponseValidationError{ - field: fmt.Sprintf("Logs[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GetDumpLogsResponseValidationError{ - field: fmt.Sprintf("Logs[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - // no validation rules for End - - if len(errors) > 0 { - return GetDumpLogsResponseMultiError(errors) - } - - return nil -} - -// GetDumpLogsResponseMultiError is an error wrapping multiple validation -// errors returned by GetDumpLogsResponse.ValidateAll() if the designated -// constraints aren't met. -type GetDumpLogsResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m GetDumpLogsResponseMultiError) 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 GetDumpLogsResponseMultiError) AllErrors() []error { return m } - -// GetDumpLogsResponseValidationError is the validation error returned by -// GetDumpLogsResponse.Validate if the designated constraints aren't met. -type GetDumpLogsResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e GetDumpLogsResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e GetDumpLogsResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e GetDumpLogsResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e GetDumpLogsResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e GetDumpLogsResponseValidationError) ErrorName() string { - return "GetDumpLogsResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e GetDumpLogsResponseValidationError) 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 %sGetDumpLogsResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = GetDumpLogsResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = GetDumpLogsResponseValidationError{} - -// Validate checks the field values on LogChunk 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 *LogChunk) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on LogChunk 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 LogChunkMultiError, or nil -// if none found. -func (m *LogChunk) ValidateAll() error { - return m.validate(true) -} - -func (m *LogChunk) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for ChunkId - - // no validation rules for Data - - if len(errors) > 0 { - return LogChunkMultiError(errors) - } - - return nil -} - -// LogChunkMultiError is an error wrapping multiple validation errors returned -// by LogChunk.ValidateAll() if the designated constraints aren't met. -type LogChunkMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m LogChunkMultiError) 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 LogChunkMultiError) AllErrors() []error { return m } - -// LogChunkValidationError is the validation error returned by -// LogChunk.Validate if the designated constraints aren't met. -type LogChunkValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e LogChunkValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e LogChunkValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e LogChunkValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e LogChunkValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e LogChunkValidationError) ErrorName() string { return "LogChunkValidationError" } - -// Error satisfies the builtin error interface -func (e LogChunkValidationError) 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 %sLogChunk.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = LogChunkValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = LogChunkValidationError{} - -// Validate checks the field values on SFTPParameters 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 *SFTPParameters) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on SFTPParameters 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 SFTPParametersMultiError, -// or nil if none found. -func (m *SFTPParameters) ValidateAll() error { - return m.validate(true) -} - -func (m *SFTPParameters) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetAddress()) < 1 { - err := SFTPParametersValidationError{ - field: "Address", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if utf8.RuneCountInString(m.GetUser()) < 1 { - err := SFTPParametersValidationError{ - field: "User", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if utf8.RuneCountInString(m.GetPassword()) < 1 { - err := SFTPParametersValidationError{ - field: "Password", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for Directory - - if len(errors) > 0 { - return SFTPParametersMultiError(errors) - } - - return nil -} - -// SFTPParametersMultiError is an error wrapping multiple validation errors -// returned by SFTPParameters.ValidateAll() if the designated constraints -// aren't met. -type SFTPParametersMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m SFTPParametersMultiError) 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 SFTPParametersMultiError) AllErrors() []error { return m } - -// SFTPParametersValidationError is the validation error returned by -// SFTPParameters.Validate if the designated constraints aren't met. -type SFTPParametersValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e SFTPParametersValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e SFTPParametersValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e SFTPParametersValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e SFTPParametersValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e SFTPParametersValidationError) ErrorName() string { return "SFTPParametersValidationError" } - -// Error satisfies the builtin error interface -func (e SFTPParametersValidationError) 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 %sSFTPParameters.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = SFTPParametersValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = SFTPParametersValidationError{} - -// Validate checks the field values on UploadDumpRequest 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 *UploadDumpRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on UploadDumpRequest 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 -// UploadDumpRequestMultiError, or nil if none found. -func (m *UploadDumpRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *UploadDumpRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(m.GetDumpIds()) < 1 { - err := UploadDumpRequestValidationError{ - field: "DumpIds", - reason: "value must contain at least 1 item(s)", - } - if !all { - return err - } - errors = append(errors, err) - } - - _UploadDumpRequest_DumpIds_Unique := make(map[string]struct{}, len(m.GetDumpIds())) - - for idx, item := range m.GetDumpIds() { - _, _ = idx, item - - if _, exists := _UploadDumpRequest_DumpIds_Unique[item]; exists { - err := UploadDumpRequestValidationError{ - field: fmt.Sprintf("DumpIds[%v]", idx), - reason: "repeated value must contain unique items", - } - if !all { - return err - } - errors = append(errors, err) - } else { - _UploadDumpRequest_DumpIds_Unique[item] = struct{}{} - } - - // no validation rules for DumpIds[idx] - } - - if m.GetSftpParameters() == nil { - err := UploadDumpRequestValidationError{ - field: "SftpParameters", - reason: "value is required", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetSftpParameters()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, UploadDumpRequestValidationError{ - field: "SftpParameters", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, UploadDumpRequestValidationError{ - field: "SftpParameters", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetSftpParameters()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return UploadDumpRequestValidationError{ - field: "SftpParameters", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if len(errors) > 0 { - return UploadDumpRequestMultiError(errors) - } - - return nil -} - -// UploadDumpRequestMultiError is an error wrapping multiple validation errors -// returned by UploadDumpRequest.ValidateAll() if the designated constraints -// aren't met. -type UploadDumpRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m UploadDumpRequestMultiError) 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 UploadDumpRequestMultiError) AllErrors() []error { return m } - -// UploadDumpRequestValidationError is the validation error returned by -// UploadDumpRequest.Validate if the designated constraints aren't met. -type UploadDumpRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e UploadDumpRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e UploadDumpRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e UploadDumpRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e UploadDumpRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e UploadDumpRequestValidationError) ErrorName() string { - return "UploadDumpRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e UploadDumpRequestValidationError) 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 %sUploadDumpRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = UploadDumpRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = UploadDumpRequestValidationError{} - -// Validate checks the field values on UploadDumpResponse 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 *UploadDumpResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on UploadDumpResponse 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 -// UploadDumpResponseMultiError, or nil if none found. -func (m *UploadDumpResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *UploadDumpResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return UploadDumpResponseMultiError(errors) - } - - return nil -} - -// UploadDumpResponseMultiError is an error wrapping multiple validation errors -// returned by UploadDumpResponse.ValidateAll() if the designated constraints -// aren't met. -type UploadDumpResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m UploadDumpResponseMultiError) 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 UploadDumpResponseMultiError) AllErrors() []error { return m } - -// UploadDumpResponseValidationError is the validation error returned by -// UploadDumpResponse.Validate if the designated constraints aren't met. -type UploadDumpResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e UploadDumpResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e UploadDumpResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e UploadDumpResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e UploadDumpResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e UploadDumpResponseValidationError) ErrorName() string { - return "UploadDumpResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e UploadDumpResponseValidationError) 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 %sUploadDumpResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = UploadDumpResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = UploadDumpResponseValidationError{} diff --git a/api/dump/v1beta1/dump_grpc.pb.go b/api/dump/v1beta1/dump_grpc.pb.go deleted file mode 100644 index 987f75bd579..00000000000 --- a/api/dump/v1beta1/dump_grpc.pb.go +++ /dev/null @@ -1,288 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.6.0 -// - protoc (unknown) -// source: dump/v1beta1/dump.proto - -package dumpv1beta1 - -import ( - context "context" - - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.64.0 or later. -const _ = grpc.SupportPackageIsVersion9 - -const ( - DumpService_StartDump_FullMethodName = "/dump.v1beta1.DumpService/StartDump" - DumpService_ListDumps_FullMethodName = "/dump.v1beta1.DumpService/ListDumps" - DumpService_DeleteDump_FullMethodName = "/dump.v1beta1.DumpService/DeleteDump" - DumpService_GetDumpLogs_FullMethodName = "/dump.v1beta1.DumpService/GetDumpLogs" - DumpService_UploadDump_FullMethodName = "/dump.v1beta1.DumpService/UploadDump" -) - -// DumpServiceClient is the client API for DumpService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type DumpServiceClient interface { - // StartDump request creates pmm dump. - StartDump(ctx context.Context, in *StartDumpRequest, opts ...grpc.CallOption) (*StartDumpResponse, error) - // ListDumps returns a list of all pmm dumps. - ListDumps(ctx context.Context, in *ListDumpsRequest, opts ...grpc.CallOption) (*ListDumpsResponse, error) - // DeleteDump deletes specified pmm dump. - DeleteDump(ctx context.Context, in *DeleteDumpRequest, opts ...grpc.CallOption) (*DeleteDumpResponse, error) - // GetLogs returns logs from pmm-dump tool. - GetDumpLogs(ctx context.Context, in *GetDumpLogsRequest, opts ...grpc.CallOption) (*GetDumpLogsResponse, error) - // UploadDump uploads selected dumps to a remote server. - UploadDump(ctx context.Context, in *UploadDumpRequest, opts ...grpc.CallOption) (*UploadDumpResponse, error) -} - -type dumpServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewDumpServiceClient(cc grpc.ClientConnInterface) DumpServiceClient { - return &dumpServiceClient{cc} -} - -func (c *dumpServiceClient) StartDump(ctx context.Context, in *StartDumpRequest, opts ...grpc.CallOption) (*StartDumpResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(StartDumpResponse) - err := c.cc.Invoke(ctx, DumpService_StartDump_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *dumpServiceClient) ListDumps(ctx context.Context, in *ListDumpsRequest, opts ...grpc.CallOption) (*ListDumpsResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(ListDumpsResponse) - err := c.cc.Invoke(ctx, DumpService_ListDumps_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *dumpServiceClient) DeleteDump(ctx context.Context, in *DeleteDumpRequest, opts ...grpc.CallOption) (*DeleteDumpResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(DeleteDumpResponse) - err := c.cc.Invoke(ctx, DumpService_DeleteDump_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *dumpServiceClient) GetDumpLogs(ctx context.Context, in *GetDumpLogsRequest, opts ...grpc.CallOption) (*GetDumpLogsResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetDumpLogsResponse) - err := c.cc.Invoke(ctx, DumpService_GetDumpLogs_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *dumpServiceClient) UploadDump(ctx context.Context, in *UploadDumpRequest, opts ...grpc.CallOption) (*UploadDumpResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(UploadDumpResponse) - err := c.cc.Invoke(ctx, DumpService_UploadDump_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -// DumpServiceServer is the server API for DumpService service. -// All implementations must embed UnimplementedDumpServiceServer -// for forward compatibility. -type DumpServiceServer interface { - // StartDump request creates pmm dump. - StartDump(context.Context, *StartDumpRequest) (*StartDumpResponse, error) - // ListDumps returns a list of all pmm dumps. - ListDumps(context.Context, *ListDumpsRequest) (*ListDumpsResponse, error) - // DeleteDump deletes specified pmm dump. - DeleteDump(context.Context, *DeleteDumpRequest) (*DeleteDumpResponse, error) - // GetLogs returns logs from pmm-dump tool. - GetDumpLogs(context.Context, *GetDumpLogsRequest) (*GetDumpLogsResponse, error) - // UploadDump uploads selected dumps to a remote server. - UploadDump(context.Context, *UploadDumpRequest) (*UploadDumpResponse, error) - mustEmbedUnimplementedDumpServiceServer() -} - -// UnimplementedDumpServiceServer must be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -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") -} -func (UnimplementedDumpServiceServer) mustEmbedUnimplementedDumpServiceServer() {} -func (UnimplementedDumpServiceServer) testEmbeddedByValue() {} - -// UnsafeDumpServiceServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to DumpServiceServer will -// result in compilation errors. -type UnsafeDumpServiceServer interface { - mustEmbedUnimplementedDumpServiceServer() -} - -func RegisterDumpServiceServer(s grpc.ServiceRegistrar, srv DumpServiceServer) { - // If the following call panics, it indicates UnimplementedDumpServiceServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } - s.RegisterService(&DumpService_ServiceDesc, srv) -} - -func _DumpService_StartDump_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(StartDumpRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(DumpServiceServer).StartDump(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: DumpService_StartDump_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DumpServiceServer).StartDump(ctx, req.(*StartDumpRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _DumpService_ListDumps_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListDumpsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(DumpServiceServer).ListDumps(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: DumpService_ListDumps_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DumpServiceServer).ListDumps(ctx, req.(*ListDumpsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _DumpService_DeleteDump_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteDumpRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(DumpServiceServer).DeleteDump(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: DumpService_DeleteDump_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DumpServiceServer).DeleteDump(ctx, req.(*DeleteDumpRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _DumpService_GetDumpLogs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetDumpLogsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(DumpServiceServer).GetDumpLogs(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: DumpService_GetDumpLogs_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DumpServiceServer).GetDumpLogs(ctx, req.(*GetDumpLogsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _DumpService_UploadDump_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UploadDumpRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(DumpServiceServer).UploadDump(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: DumpService_UploadDump_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DumpServiceServer).UploadDump(ctx, req.(*UploadDumpRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// DumpService_ServiceDesc is the grpc.ServiceDesc for DumpService service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var DumpService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "dump.v1beta1.DumpService", - HandlerType: (*DumpServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "StartDump", - Handler: _DumpService_StartDump_Handler, - }, - { - MethodName: "ListDumps", - Handler: _DumpService_ListDumps_Handler, - }, - { - MethodName: "DeleteDump", - Handler: _DumpService_DeleteDump_Handler, - }, - { - MethodName: "GetDumpLogs", - Handler: _DumpService_GetDumpLogs_Handler, - }, - { - MethodName: "UploadDump", - Handler: _DumpService_UploadDump_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "dump/v1beta1/dump.proto", -} diff --git a/api/dump/v1beta1/json/client/dump_service/delete_dump_parameters.go b/api/dump/v1beta1/json/client/dump_service/delete_dump_parameters.go deleted file mode 100644 index 0c83d67b573..00000000000 --- a/api/dump/v1beta1/json/client/dump_service/delete_dump_parameters.go +++ /dev/null @@ -1,144 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package dump_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" -) - -// NewDeleteDumpParams creates a new DeleteDumpParams 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 NewDeleteDumpParams() *DeleteDumpParams { - return &DeleteDumpParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDeleteDumpParamsWithTimeout creates a new DeleteDumpParams object -// with the ability to set a timeout on a request. -func NewDeleteDumpParamsWithTimeout(timeout time.Duration) *DeleteDumpParams { - return &DeleteDumpParams{ - timeout: timeout, - } -} - -// NewDeleteDumpParamsWithContext creates a new DeleteDumpParams object -// with the ability to set a context for a request. -func NewDeleteDumpParamsWithContext(ctx context.Context) *DeleteDumpParams { - return &DeleteDumpParams{ - Context: ctx, - } -} - -// NewDeleteDumpParamsWithHTTPClient creates a new DeleteDumpParams object -// with the ability to set a custom HTTPClient for a request. -func NewDeleteDumpParamsWithHTTPClient(client *http.Client) *DeleteDumpParams { - return &DeleteDumpParams{ - HTTPClient: client, - } -} - -/* -DeleteDumpParams contains all the parameters to send to the API endpoint - - for the delete dump operation. - - Typically these are written to a http.Request. -*/ -type DeleteDumpParams struct { - // Body. - Body DeleteDumpBody - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the delete dump params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteDumpParams) WithDefaults() *DeleteDumpParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the delete dump params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteDumpParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the delete dump params -func (o *DeleteDumpParams) WithTimeout(timeout time.Duration) *DeleteDumpParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the delete dump params -func (o *DeleteDumpParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the delete dump params -func (o *DeleteDumpParams) WithContext(ctx context.Context) *DeleteDumpParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the delete dump params -func (o *DeleteDumpParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the delete dump params -func (o *DeleteDumpParams) WithHTTPClient(client *http.Client) *DeleteDumpParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the delete dump params -func (o *DeleteDumpParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the delete dump params -func (o *DeleteDumpParams) WithBody(body DeleteDumpBody) *DeleteDumpParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the delete dump params -func (o *DeleteDumpParams) SetBody(body DeleteDumpBody) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *DeleteDumpParams) 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/dump/v1beta1/json/client/dump_service/delete_dump_responses.go b/api/dump/v1beta1/json/client/dump_service/delete_dump_responses.go deleted file mode 100644 index d703d60a325..00000000000 --- a/api/dump/v1beta1/json/client/dump_service/delete_dump_responses.go +++ /dev/null @@ -1,451 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package dump_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" -) - -// DeleteDumpReader is a Reader for the DeleteDump structure. -type DeleteDumpReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DeleteDumpReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewDeleteDumpOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewDeleteDumpDefault(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 - } -} - -// NewDeleteDumpOK creates a DeleteDumpOK with default headers values -func NewDeleteDumpOK() *DeleteDumpOK { - return &DeleteDumpOK{} -} - -/* -DeleteDumpOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type DeleteDumpOK struct { - Payload any -} - -// IsSuccess returns true when this delete dump Ok response has a 2xx status code -func (o *DeleteDumpOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this delete dump Ok response has a 3xx status code -func (o *DeleteDumpOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this delete dump Ok response has a 4xx status code -func (o *DeleteDumpOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this delete dump Ok response has a 5xx status code -func (o *DeleteDumpOK) IsServerError() bool { - return false -} - -// IsCode returns true when this delete dump Ok response a status code equal to that given -func (o *DeleteDumpOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the delete dump Ok response -func (o *DeleteDumpOK) Code() int { - return 200 -} - -func (o *DeleteDumpOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/dumps:batchDelete][%d] deleteDumpOk %s", 200, payload) -} - -func (o *DeleteDumpOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/dumps:batchDelete][%d] deleteDumpOk %s", 200, payload) -} - -func (o *DeleteDumpOK) GetPayload() any { - return o.Payload -} - -func (o *DeleteDumpOK) 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) { - return err - } - - return nil -} - -// NewDeleteDumpDefault creates a DeleteDumpDefault with default headers values -func NewDeleteDumpDefault(code int) *DeleteDumpDefault { - return &DeleteDumpDefault{ - _statusCode: code, - } -} - -/* -DeleteDumpDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type DeleteDumpDefault struct { - _statusCode int - - Payload *DeleteDumpDefaultBody -} - -// IsSuccess returns true when this delete dump default response has a 2xx status code -func (o *DeleteDumpDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this delete dump default response has a 3xx status code -func (o *DeleteDumpDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this delete dump default response has a 4xx status code -func (o *DeleteDumpDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this delete dump default response has a 5xx status code -func (o *DeleteDumpDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this delete dump default response a status code equal to that given -func (o *DeleteDumpDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the delete dump default response -func (o *DeleteDumpDefault) Code() int { - return o._statusCode -} - -func (o *DeleteDumpDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/dumps:batchDelete][%d] DeleteDump default %s", o._statusCode, payload) -} - -func (o *DeleteDumpDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/dumps:batchDelete][%d] DeleteDump default %s", o._statusCode, payload) -} - -func (o *DeleteDumpDefault) GetPayload() *DeleteDumpDefaultBody { - return o.Payload -} - -func (o *DeleteDumpDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(DeleteDumpDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -DeleteDumpBody delete dump body -swagger:model DeleteDumpBody -*/ -type DeleteDumpBody struct { - // dump ids - DumpIds []string `json:"dump_ids"` -} - -// Validate validates this delete dump body -func (o *DeleteDumpBody) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this delete dump body based on context it is used -func (o *DeleteDumpBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *DeleteDumpBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *DeleteDumpBody) UnmarshalBinary(b []byte) error { - var res DeleteDumpBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -DeleteDumpDefaultBody delete dump default body -swagger:model DeleteDumpDefaultBody -*/ -type DeleteDumpDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*DeleteDumpDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this delete dump default body -func (o *DeleteDumpDefaultBody) 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 *DeleteDumpDefaultBody) 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("DeleteDump default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("DeleteDump default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this delete dump default body based on the context it is used -func (o *DeleteDumpDefaultBody) 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 *DeleteDumpDefaultBody) 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("DeleteDump default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("DeleteDump default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *DeleteDumpDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *DeleteDumpDefaultBody) UnmarshalBinary(b []byte) error { - var res DeleteDumpDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -DeleteDumpDefaultBodyDetailsItems0 delete dump default body details items0 -swagger:model DeleteDumpDefaultBodyDetailsItems0 -*/ -type DeleteDumpDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` - - // delete dump default body details items0 - DeleteDumpDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *DeleteDumpDefaultBodyDetailsItems0) 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 DeleteDumpDefaultBodyDetailsItems0 - - 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.DeleteDumpDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o DeleteDumpDefaultBodyDetailsItems0) 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.DeleteDumpDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.DeleteDumpDefaultBodyDetailsItems0) - 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 delete dump default body details items0 -func (o *DeleteDumpDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this delete dump default body details items0 based on context it is used -func (o *DeleteDumpDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *DeleteDumpDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *DeleteDumpDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res DeleteDumpDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/dump/v1beta1/json/client/dump_service/dump_service_client.go b/api/dump/v1beta1/json/client/dump_service/dump_service_client.go deleted file mode 100644 index df0f3a0ae3d..00000000000 --- a/api/dump/v1beta1/json/client/dump_service/dump_service_client.go +++ /dev/null @@ -1,293 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package dump_service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// New creates a new dump service API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -// New creates a new dump service API client with basic auth credentials. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - user: user for basic authentication header. -// - password: password for basic authentication header. -func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BasicAuth(user, password) - return &Client{transport: transport, formats: strfmt.Default} -} - -// New creates a new dump service API client with a bearer token for authentication. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - bearerToken: bearer token for Bearer authentication header. -func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BearerToken(bearerToken) - return &Client{transport: transport, formats: strfmt.Default} -} - -/* -Client for dump service API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption may be used to customize the behavior of Client methods. -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - DeleteDump(params *DeleteDumpParams, opts ...ClientOption) (*DeleteDumpOK, error) - - GetDumpLogs(params *GetDumpLogsParams, opts ...ClientOption) (*GetDumpLogsOK, error) - - ListDumps(params *ListDumpsParams, opts ...ClientOption) (*ListDumpsOK, error) - - StartDump(params *StartDumpParams, opts ...ClientOption) (*StartDumpOK, error) - - UploadDump(params *UploadDumpParams, opts ...ClientOption) (*UploadDumpOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -DeleteDump deletes dumps - -Delete selected dumps. -*/ -func (a *Client) DeleteDump(params *DeleteDumpParams, opts ...ClientOption) (*DeleteDumpOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewDeleteDumpParams() - } - op := &runtime.ClientOperation{ - ID: "DeleteDump", - Method: "POST", - PathPattern: "/v1/dumps:batchDelete", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &DeleteDumpReader{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.(*DeleteDumpOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*DeleteDumpDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -GetDumpLogs gets dump logs - -Get logs of a selected dump. -*/ -func (a *Client) GetDumpLogs(params *GetDumpLogsParams, opts ...ClientOption) (*GetDumpLogsOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewGetDumpLogsParams() - } - op := &runtime.ClientOperation{ - ID: "GetDumpLogs", - Method: "GET", - PathPattern: "/v1/dumps/{dump_id}/logs", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &GetDumpLogsReader{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.(*GetDumpLogsOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*GetDumpLogsDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -ListDumps lists all dumps - -List all dumps -*/ -func (a *Client) ListDumps(params *ListDumpsParams, opts ...ClientOption) (*ListDumpsOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewListDumpsParams() - } - op := &runtime.ClientOperation{ - ID: "ListDumps", - Method: "GET", - PathPattern: "/v1/dumps", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &ListDumpsReader{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.(*ListDumpsOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*ListDumpsDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -StartDump starts a new dump - -Start a new dump. -*/ -func (a *Client) StartDump(params *StartDumpParams, opts ...ClientOption) (*StartDumpOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewStartDumpParams() - } - op := &runtime.ClientOperation{ - ID: "StartDump", - Method: "POST", - PathPattern: "/v1/dumps:start", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &StartDumpReader{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.(*StartDumpOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*StartDumpDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -UploadDump uploads dumps - -Upload selected dumps to a remote server. -*/ -func (a *Client) UploadDump(params *UploadDumpParams, opts ...ClientOption) (*UploadDumpOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewUploadDumpParams() - } - op := &runtime.ClientOperation{ - ID: "UploadDump", - Method: "POST", - PathPattern: "/v1/dumps:upload", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &UploadDumpReader{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.(*UploadDumpOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*UploadDumpDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/api/dump/v1beta1/json/client/dump_service/get_dump_logs_parameters.go b/api/dump/v1beta1/json/client/dump_service/get_dump_logs_parameters.go deleted file mode 100644 index 82ed2997d2d..00000000000 --- a/api/dump/v1beta1/json/client/dump_service/get_dump_logs_parameters.go +++ /dev/null @@ -1,211 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package dump_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" - "github.com/go-openapi/swag" -) - -// NewGetDumpLogsParams creates a new GetDumpLogsParams 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 NewGetDumpLogsParams() *GetDumpLogsParams { - return &GetDumpLogsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetDumpLogsParamsWithTimeout creates a new GetDumpLogsParams object -// with the ability to set a timeout on a request. -func NewGetDumpLogsParamsWithTimeout(timeout time.Duration) *GetDumpLogsParams { - return &GetDumpLogsParams{ - timeout: timeout, - } -} - -// NewGetDumpLogsParamsWithContext creates a new GetDumpLogsParams object -// with the ability to set a context for a request. -func NewGetDumpLogsParamsWithContext(ctx context.Context) *GetDumpLogsParams { - return &GetDumpLogsParams{ - Context: ctx, - } -} - -// NewGetDumpLogsParamsWithHTTPClient creates a new GetDumpLogsParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetDumpLogsParamsWithHTTPClient(client *http.Client) *GetDumpLogsParams { - return &GetDumpLogsParams{ - HTTPClient: client, - } -} - -/* -GetDumpLogsParams contains all the parameters to send to the API endpoint - - for the get dump logs operation. - - Typically these are written to a http.Request. -*/ -type GetDumpLogsParams struct { - // DumpID. - DumpID string - - // Limit. - // - // Format: int64 - Limit *int64 - - // Offset. - // - // Format: int64 - Offset *int64 - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get dump logs params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetDumpLogsParams) WithDefaults() *GetDumpLogsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get dump logs params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetDumpLogsParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the get dump logs params -func (o *GetDumpLogsParams) WithTimeout(timeout time.Duration) *GetDumpLogsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get dump logs params -func (o *GetDumpLogsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get dump logs params -func (o *GetDumpLogsParams) WithContext(ctx context.Context) *GetDumpLogsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get dump logs params -func (o *GetDumpLogsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get dump logs params -func (o *GetDumpLogsParams) WithHTTPClient(client *http.Client) *GetDumpLogsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get dump logs params -func (o *GetDumpLogsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithDumpID adds the dumpID to the get dump logs params -func (o *GetDumpLogsParams) WithDumpID(dumpID string) *GetDumpLogsParams { - o.SetDumpID(dumpID) - return o -} - -// SetDumpID adds the dumpId to the get dump logs params -func (o *GetDumpLogsParams) SetDumpID(dumpID string) { - o.DumpID = dumpID -} - -// WithLimit adds the limit to the get dump logs params -func (o *GetDumpLogsParams) WithLimit(limit *int64) *GetDumpLogsParams { - o.SetLimit(limit) - return o -} - -// SetLimit adds the limit to the get dump logs params -func (o *GetDumpLogsParams) SetLimit(limit *int64) { - o.Limit = limit -} - -// WithOffset adds the offset to the get dump logs params -func (o *GetDumpLogsParams) WithOffset(offset *int64) *GetDumpLogsParams { - o.SetOffset(offset) - return o -} - -// SetOffset adds the offset to the get dump logs params -func (o *GetDumpLogsParams) SetOffset(offset *int64) { - o.Offset = offset -} - -// WriteToRequest writes these params to a swagger request -func (o *GetDumpLogsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param dump_id - if err := r.SetPathParam("dump_id", o.DumpID); err != nil { - return err - } - - if o.Limit != nil { - - // query param limit - var qrLimit int64 - - if o.Limit != nil { - qrLimit = *o.Limit - } - qLimit := swag.FormatInt64(qrLimit) - if qLimit != "" { - if err := r.SetQueryParam("limit", qLimit); err != nil { - return err - } - } - } - - if o.Offset != nil { - - // query param offset - var qrOffset int64 - - if o.Offset != nil { - qrOffset = *o.Offset - } - qOffset := swag.FormatInt64(qrOffset) - if qOffset != "" { - if err := r.SetQueryParam("offset", qOffset); err != nil { - return err - } - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/api/dump/v1beta1/json/client/dump_service/get_dump_logs_responses.go b/api/dump/v1beta1/json/client/dump_service/get_dump_logs_responses.go deleted file mode 100644 index 8a0e0c45bef..00000000000 --- a/api/dump/v1beta1/json/client/dump_service/get_dump_logs_responses.go +++ /dev/null @@ -1,570 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package dump_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" -) - -// GetDumpLogsReader is a Reader for the GetDumpLogs structure. -type GetDumpLogsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetDumpLogsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewGetDumpLogsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewGetDumpLogsDefault(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 - } -} - -// NewGetDumpLogsOK creates a GetDumpLogsOK with default headers values -func NewGetDumpLogsOK() *GetDumpLogsOK { - return &GetDumpLogsOK{} -} - -/* -GetDumpLogsOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type GetDumpLogsOK struct { - Payload *GetDumpLogsOKBody -} - -// IsSuccess returns true when this get dump logs Ok response has a 2xx status code -func (o *GetDumpLogsOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this get dump logs Ok response has a 3xx status code -func (o *GetDumpLogsOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this get dump logs Ok response has a 4xx status code -func (o *GetDumpLogsOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this get dump logs Ok response has a 5xx status code -func (o *GetDumpLogsOK) IsServerError() bool { - return false -} - -// IsCode returns true when this get dump logs Ok response a status code equal to that given -func (o *GetDumpLogsOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the get dump logs Ok response -func (o *GetDumpLogsOK) Code() int { - return 200 -} - -func (o *GetDumpLogsOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/dumps/{dump_id}/logs][%d] getDumpLogsOk %s", 200, payload) -} - -func (o *GetDumpLogsOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/dumps/{dump_id}/logs][%d] getDumpLogsOk %s", 200, payload) -} - -func (o *GetDumpLogsOK) GetPayload() *GetDumpLogsOKBody { - return o.Payload -} - -func (o *GetDumpLogsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(GetDumpLogsOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -// NewGetDumpLogsDefault creates a GetDumpLogsDefault with default headers values -func NewGetDumpLogsDefault(code int) *GetDumpLogsDefault { - return &GetDumpLogsDefault{ - _statusCode: code, - } -} - -/* -GetDumpLogsDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type GetDumpLogsDefault struct { - _statusCode int - - Payload *GetDumpLogsDefaultBody -} - -// IsSuccess returns true when this get dump logs default response has a 2xx status code -func (o *GetDumpLogsDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this get dump logs default response has a 3xx status code -func (o *GetDumpLogsDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this get dump logs default response has a 4xx status code -func (o *GetDumpLogsDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this get dump logs default response has a 5xx status code -func (o *GetDumpLogsDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this get dump logs default response a status code equal to that given -func (o *GetDumpLogsDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the get dump logs default response -func (o *GetDumpLogsDefault) Code() int { - return o._statusCode -} - -func (o *GetDumpLogsDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/dumps/{dump_id}/logs][%d] GetDumpLogs default %s", o._statusCode, payload) -} - -func (o *GetDumpLogsDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/dumps/{dump_id}/logs][%d] GetDumpLogs default %s", o._statusCode, payload) -} - -func (o *GetDumpLogsDefault) GetPayload() *GetDumpLogsDefaultBody { - return o.Payload -} - -func (o *GetDumpLogsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(GetDumpLogsDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -GetDumpLogsDefaultBody get dump logs default body -swagger:model GetDumpLogsDefaultBody -*/ -type GetDumpLogsDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*GetDumpLogsDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this get dump logs default body -func (o *GetDumpLogsDefaultBody) 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 *GetDumpLogsDefaultBody) 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("GetDumpLogs default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("GetDumpLogs default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this get dump logs default body based on the context it is used -func (o *GetDumpLogsDefaultBody) 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 *GetDumpLogsDefaultBody) 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("GetDumpLogs default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("GetDumpLogs default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetDumpLogsDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetDumpLogsDefaultBody) UnmarshalBinary(b []byte) error { - var res GetDumpLogsDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetDumpLogsDefaultBodyDetailsItems0 get dump logs default body details items0 -swagger:model GetDumpLogsDefaultBodyDetailsItems0 -*/ -type GetDumpLogsDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` - - // get dump logs default body details items0 - GetDumpLogsDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *GetDumpLogsDefaultBodyDetailsItems0) 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 GetDumpLogsDefaultBodyDetailsItems0 - - 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.GetDumpLogsDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o GetDumpLogsDefaultBodyDetailsItems0) 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.GetDumpLogsDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.GetDumpLogsDefaultBodyDetailsItems0) - 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 get dump logs default body details items0 -func (o *GetDumpLogsDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get dump logs default body details items0 based on context it is used -func (o *GetDumpLogsDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetDumpLogsDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetDumpLogsDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res GetDumpLogsDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetDumpLogsOKBody get dump logs OK body -swagger:model GetDumpLogsOKBody -*/ -type GetDumpLogsOKBody struct { - // logs - Logs []*GetDumpLogsOKBodyLogsItems0 `json:"logs"` - - // end - End bool `json:"end,omitempty"` -} - -// Validate validates this get dump logs OK body -func (o *GetDumpLogsOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateLogs(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetDumpLogsOKBody) validateLogs(formats strfmt.Registry) error { - if swag.IsZero(o.Logs) { // not required - return nil - } - - for i := 0; i < len(o.Logs); i++ { - if swag.IsZero(o.Logs[i]) { // not required - continue - } - - if o.Logs[i] != nil { - if err := o.Logs[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getDumpLogsOk" + "." + "logs" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getDumpLogsOk" + "." + "logs" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this get dump logs OK body based on the context it is used -func (o *GetDumpLogsOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateLogs(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetDumpLogsOKBody) contextValidateLogs(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Logs); i++ { - if o.Logs[i] != nil { - - if swag.IsZero(o.Logs[i]) { // not required - return nil - } - - if err := o.Logs[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getDumpLogsOk" + "." + "logs" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getDumpLogsOk" + "." + "logs" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetDumpLogsOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetDumpLogsOKBody) UnmarshalBinary(b []byte) error { - var res GetDumpLogsOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetDumpLogsOKBodyLogsItems0 LogChunk represent one chunk of logs. -swagger:model GetDumpLogsOKBodyLogsItems0 -*/ -type GetDumpLogsOKBodyLogsItems0 struct { - // chunk id - ChunkID int64 `json:"chunk_id,omitempty"` - - // data - Data string `json:"data,omitempty"` -} - -// Validate validates this get dump logs OK body logs items0 -func (o *GetDumpLogsOKBodyLogsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get dump logs OK body logs items0 based on context it is used -func (o *GetDumpLogsOKBodyLogsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetDumpLogsOKBodyLogsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetDumpLogsOKBodyLogsItems0) UnmarshalBinary(b []byte) error { - var res GetDumpLogsOKBodyLogsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/dump/v1beta1/json/client/dump_service/list_dumps_parameters.go b/api/dump/v1beta1/json/client/dump_service/list_dumps_parameters.go deleted file mode 100644 index dc28a36ad42..00000000000 --- a/api/dump/v1beta1/json/client/dump_service/list_dumps_parameters.go +++ /dev/null @@ -1,127 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package dump_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" -) - -// NewListDumpsParams creates a new ListDumpsParams 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 NewListDumpsParams() *ListDumpsParams { - return &ListDumpsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListDumpsParamsWithTimeout creates a new ListDumpsParams object -// with the ability to set a timeout on a request. -func NewListDumpsParamsWithTimeout(timeout time.Duration) *ListDumpsParams { - return &ListDumpsParams{ - timeout: timeout, - } -} - -// NewListDumpsParamsWithContext creates a new ListDumpsParams object -// with the ability to set a context for a request. -func NewListDumpsParamsWithContext(ctx context.Context) *ListDumpsParams { - return &ListDumpsParams{ - Context: ctx, - } -} - -// NewListDumpsParamsWithHTTPClient creates a new ListDumpsParams object -// with the ability to set a custom HTTPClient for a request. -func NewListDumpsParamsWithHTTPClient(client *http.Client) *ListDumpsParams { - return &ListDumpsParams{ - HTTPClient: client, - } -} - -/* -ListDumpsParams contains all the parameters to send to the API endpoint - - for the list dumps operation. - - Typically these are written to a http.Request. -*/ -type ListDumpsParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list dumps params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListDumpsParams) WithDefaults() *ListDumpsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list dumps params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListDumpsParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list dumps params -func (o *ListDumpsParams) WithTimeout(timeout time.Duration) *ListDumpsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list dumps params -func (o *ListDumpsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list dumps params -func (o *ListDumpsParams) WithContext(ctx context.Context) *ListDumpsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list dumps params -func (o *ListDumpsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list dumps params -func (o *ListDumpsParams) WithHTTPClient(client *http.Client) *ListDumpsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list dumps params -func (o *ListDumpsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *ListDumpsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/api/dump/v1beta1/json/client/dump_service/list_dumps_responses.go b/api/dump/v1beta1/json/client/dump_service/list_dumps_responses.go deleted file mode 100644 index 6e37793be89..00000000000 --- a/api/dump/v1beta1/json/client/dump_service/list_dumps_responses.go +++ /dev/null @@ -1,689 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package dump_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" -) - -// ListDumpsReader is a Reader for the ListDumps structure. -type ListDumpsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListDumpsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewListDumpsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewListDumpsDefault(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 - } -} - -// NewListDumpsOK creates a ListDumpsOK with default headers values -func NewListDumpsOK() *ListDumpsOK { - return &ListDumpsOK{} -} - -/* -ListDumpsOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type ListDumpsOK struct { - Payload *ListDumpsOKBody -} - -// IsSuccess returns true when this list dumps Ok response has a 2xx status code -func (o *ListDumpsOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this list dumps Ok response has a 3xx status code -func (o *ListDumpsOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this list dumps Ok response has a 4xx status code -func (o *ListDumpsOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this list dumps Ok response has a 5xx status code -func (o *ListDumpsOK) IsServerError() bool { - return false -} - -// IsCode returns true when this list dumps Ok response a status code equal to that given -func (o *ListDumpsOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the list dumps Ok response -func (o *ListDumpsOK) Code() int { - return 200 -} - -func (o *ListDumpsOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/dumps][%d] listDumpsOk %s", 200, payload) -} - -func (o *ListDumpsOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/dumps][%d] listDumpsOk %s", 200, payload) -} - -func (o *ListDumpsOK) GetPayload() *ListDumpsOKBody { - return o.Payload -} - -func (o *ListDumpsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(ListDumpsOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -// NewListDumpsDefault creates a ListDumpsDefault with default headers values -func NewListDumpsDefault(code int) *ListDumpsDefault { - return &ListDumpsDefault{ - _statusCode: code, - } -} - -/* -ListDumpsDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type ListDumpsDefault struct { - _statusCode int - - Payload *ListDumpsDefaultBody -} - -// IsSuccess returns true when this list dumps default response has a 2xx status code -func (o *ListDumpsDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this list dumps default response has a 3xx status code -func (o *ListDumpsDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this list dumps default response has a 4xx status code -func (o *ListDumpsDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this list dumps default response has a 5xx status code -func (o *ListDumpsDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this list dumps default response a status code equal to that given -func (o *ListDumpsDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the list dumps default response -func (o *ListDumpsDefault) Code() int { - return o._statusCode -} - -func (o *ListDumpsDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/dumps][%d] ListDumps default %s", o._statusCode, payload) -} - -func (o *ListDumpsDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/dumps][%d] ListDumps default %s", o._statusCode, payload) -} - -func (o *ListDumpsDefault) GetPayload() *ListDumpsDefaultBody { - return o.Payload -} - -func (o *ListDumpsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(ListDumpsDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -ListDumpsDefaultBody list dumps default body -swagger:model ListDumpsDefaultBody -*/ -type ListDumpsDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*ListDumpsDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this list dumps default body -func (o *ListDumpsDefaultBody) 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 *ListDumpsDefaultBody) 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("ListDumps default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("ListDumps default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this list dumps default body based on the context it is used -func (o *ListDumpsDefaultBody) 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 *ListDumpsDefaultBody) 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("ListDumps default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("ListDumps default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListDumpsDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListDumpsDefaultBody) UnmarshalBinary(b []byte) error { - var res ListDumpsDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListDumpsDefaultBodyDetailsItems0 list dumps default body details items0 -swagger:model ListDumpsDefaultBodyDetailsItems0 -*/ -type ListDumpsDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` - - // list dumps default body details items0 - ListDumpsDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *ListDumpsDefaultBodyDetailsItems0) 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 ListDumpsDefaultBodyDetailsItems0 - - 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.ListDumpsDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o ListDumpsDefaultBodyDetailsItems0) 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.ListDumpsDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.ListDumpsDefaultBodyDetailsItems0) - 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 list dumps default body details items0 -func (o *ListDumpsDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list dumps default body details items0 based on context it is used -func (o *ListDumpsDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListDumpsDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListDumpsDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res ListDumpsDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListDumpsOKBody list dumps OK body -swagger:model ListDumpsOKBody -*/ -type ListDumpsOKBody struct { - // dumps - Dumps []*ListDumpsOKBodyDumpsItems0 `json:"dumps"` -} - -// Validate validates this list dumps OK body -func (o *ListDumpsOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateDumps(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListDumpsOKBody) validateDumps(formats strfmt.Registry) error { - if swag.IsZero(o.Dumps) { // not required - return nil - } - - for i := 0; i < len(o.Dumps); i++ { - if swag.IsZero(o.Dumps[i]) { // not required - continue - } - - if o.Dumps[i] != nil { - if err := o.Dumps[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listDumpsOk" + "." + "dumps" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listDumpsOk" + "." + "dumps" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this list dumps OK body based on the context it is used -func (o *ListDumpsOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateDumps(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListDumpsOKBody) contextValidateDumps(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Dumps); i++ { - if o.Dumps[i] != nil { - - if swag.IsZero(o.Dumps[i]) { // not required - return nil - } - - if err := o.Dumps[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listDumpsOk" + "." + "dumps" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listDumpsOk" + "." + "dumps" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListDumpsOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListDumpsOKBody) UnmarshalBinary(b []byte) error { - var res ListDumpsOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListDumpsOKBodyDumpsItems0 list dumps OK body dumps items0 -swagger:model ListDumpsOKBodyDumpsItems0 -*/ -type ListDumpsOKBodyDumpsItems0 struct { - // dump id - DumpID string `json:"dump_id,omitempty"` - - // status - // Enum: ["DUMP_STATUS_UNSPECIFIED","DUMP_STATUS_IN_PROGRESS","DUMP_STATUS_SUCCESS","DUMP_STATUS_ERROR"] - Status *string `json:"status,omitempty"` - - // service names - ServiceNames []string `json:"service_names"` - - // start time - // Format: date-time - StartTime strfmt.DateTime `json:"start_time,omitempty"` - - // end time - // Format: date-time - EndTime strfmt.DateTime `json:"end_time,omitempty"` - - // created at - // Format: date-time - CreatedAt strfmt.DateTime `json:"created_at,omitempty"` -} - -// Validate validates this list dumps OK body dumps items0 -func (o *ListDumpsOKBodyDumpsItems0) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateStatus(formats); err != nil { - res = append(res, err) - } - - if err := o.validateStartTime(formats); err != nil { - res = append(res, err) - } - - if err := o.validateEndTime(formats); err != nil { - res = append(res, err) - } - - if err := o.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var listDumpsOkBodyDumpsItems0TypeStatusPropEnum []any - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["DUMP_STATUS_UNSPECIFIED","DUMP_STATUS_IN_PROGRESS","DUMP_STATUS_SUCCESS","DUMP_STATUS_ERROR"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - listDumpsOkBodyDumpsItems0TypeStatusPropEnum = append(listDumpsOkBodyDumpsItems0TypeStatusPropEnum, v) - } -} - -const ( - - // ListDumpsOKBodyDumpsItems0StatusDUMPSTATUSUNSPECIFIED captures enum value "DUMP_STATUS_UNSPECIFIED" - ListDumpsOKBodyDumpsItems0StatusDUMPSTATUSUNSPECIFIED string = "DUMP_STATUS_UNSPECIFIED" - - // ListDumpsOKBodyDumpsItems0StatusDUMPSTATUSINPROGRESS captures enum value "DUMP_STATUS_IN_PROGRESS" - ListDumpsOKBodyDumpsItems0StatusDUMPSTATUSINPROGRESS string = "DUMP_STATUS_IN_PROGRESS" - - // ListDumpsOKBodyDumpsItems0StatusDUMPSTATUSSUCCESS captures enum value "DUMP_STATUS_SUCCESS" - ListDumpsOKBodyDumpsItems0StatusDUMPSTATUSSUCCESS string = "DUMP_STATUS_SUCCESS" - - // ListDumpsOKBodyDumpsItems0StatusDUMPSTATUSERROR captures enum value "DUMP_STATUS_ERROR" - ListDumpsOKBodyDumpsItems0StatusDUMPSTATUSERROR string = "DUMP_STATUS_ERROR" -) - -// prop value enum -func (o *ListDumpsOKBodyDumpsItems0) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, listDumpsOkBodyDumpsItems0TypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ListDumpsOKBodyDumpsItems0) 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 *ListDumpsOKBodyDumpsItems0) validateStartTime(formats strfmt.Registry) error { - if swag.IsZero(o.StartTime) { // not required - return nil - } - - if err := validate.FormatOf("start_time", "body", "date-time", o.StartTime.String(), formats); err != nil { - return err - } - - return nil -} - -func (o *ListDumpsOKBodyDumpsItems0) validateEndTime(formats strfmt.Registry) error { - if swag.IsZero(o.EndTime) { // not required - return nil - } - - if err := validate.FormatOf("end_time", "body", "date-time", o.EndTime.String(), formats); err != nil { - return err - } - - return nil -} - -func (o *ListDumpsOKBodyDumpsItems0) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(o.CreatedAt) { // not required - return nil - } - - if err := validate.FormatOf("created_at", "body", "date-time", o.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this list dumps OK body dumps items0 based on context it is used -func (o *ListDumpsOKBodyDumpsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListDumpsOKBodyDumpsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListDumpsOKBodyDumpsItems0) UnmarshalBinary(b []byte) error { - var res ListDumpsOKBodyDumpsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/dump/v1beta1/json/client/dump_service/start_dump_parameters.go b/api/dump/v1beta1/json/client/dump_service/start_dump_parameters.go deleted file mode 100644 index ac9f2ba90e8..00000000000 --- a/api/dump/v1beta1/json/client/dump_service/start_dump_parameters.go +++ /dev/null @@ -1,144 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package dump_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" -) - -// NewStartDumpParams creates a new StartDumpParams 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 NewStartDumpParams() *StartDumpParams { - return &StartDumpParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewStartDumpParamsWithTimeout creates a new StartDumpParams object -// with the ability to set a timeout on a request. -func NewStartDumpParamsWithTimeout(timeout time.Duration) *StartDumpParams { - return &StartDumpParams{ - timeout: timeout, - } -} - -// NewStartDumpParamsWithContext creates a new StartDumpParams object -// with the ability to set a context for a request. -func NewStartDumpParamsWithContext(ctx context.Context) *StartDumpParams { - return &StartDumpParams{ - Context: ctx, - } -} - -// NewStartDumpParamsWithHTTPClient creates a new StartDumpParams object -// with the ability to set a custom HTTPClient for a request. -func NewStartDumpParamsWithHTTPClient(client *http.Client) *StartDumpParams { - return &StartDumpParams{ - HTTPClient: client, - } -} - -/* -StartDumpParams contains all the parameters to send to the API endpoint - - for the start dump operation. - - Typically these are written to a http.Request. -*/ -type StartDumpParams struct { - // Body. - Body StartDumpBody - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the start dump params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *StartDumpParams) WithDefaults() *StartDumpParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the start dump params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *StartDumpParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the start dump params -func (o *StartDumpParams) WithTimeout(timeout time.Duration) *StartDumpParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the start dump params -func (o *StartDumpParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the start dump params -func (o *StartDumpParams) WithContext(ctx context.Context) *StartDumpParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the start dump params -func (o *StartDumpParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the start dump params -func (o *StartDumpParams) WithHTTPClient(client *http.Client) *StartDumpParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the start dump params -func (o *StartDumpParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the start dump params -func (o *StartDumpParams) WithBody(body StartDumpBody) *StartDumpParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the start dump params -func (o *StartDumpParams) SetBody(body StartDumpBody) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *StartDumpParams) 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/dump/v1beta1/json/client/dump_service/start_dump_responses.go b/api/dump/v1beta1/json/client/dump_service/start_dump_responses.go deleted file mode 100644 index 4e34e022214..00000000000 --- a/api/dump/v1beta1/json/client/dump_service/start_dump_responses.go +++ /dev/null @@ -1,542 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package dump_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" -) - -// StartDumpReader is a Reader for the StartDump structure. -type StartDumpReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *StartDumpReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewStartDumpOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewStartDumpDefault(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 - } -} - -// NewStartDumpOK creates a StartDumpOK with default headers values -func NewStartDumpOK() *StartDumpOK { - return &StartDumpOK{} -} - -/* -StartDumpOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type StartDumpOK struct { - Payload *StartDumpOKBody -} - -// IsSuccess returns true when this start dump Ok response has a 2xx status code -func (o *StartDumpOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this start dump Ok response has a 3xx status code -func (o *StartDumpOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this start dump Ok response has a 4xx status code -func (o *StartDumpOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this start dump Ok response has a 5xx status code -func (o *StartDumpOK) IsServerError() bool { - return false -} - -// IsCode returns true when this start dump Ok response a status code equal to that given -func (o *StartDumpOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the start dump Ok response -func (o *StartDumpOK) Code() int { - return 200 -} - -func (o *StartDumpOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/dumps:start][%d] startDumpOk %s", 200, payload) -} - -func (o *StartDumpOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/dumps:start][%d] startDumpOk %s", 200, payload) -} - -func (o *StartDumpOK) GetPayload() *StartDumpOKBody { - return o.Payload -} - -func (o *StartDumpOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(StartDumpOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -// NewStartDumpDefault creates a StartDumpDefault with default headers values -func NewStartDumpDefault(code int) *StartDumpDefault { - return &StartDumpDefault{ - _statusCode: code, - } -} - -/* -StartDumpDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type StartDumpDefault struct { - _statusCode int - - Payload *StartDumpDefaultBody -} - -// IsSuccess returns true when this start dump default response has a 2xx status code -func (o *StartDumpDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this start dump default response has a 3xx status code -func (o *StartDumpDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this start dump default response has a 4xx status code -func (o *StartDumpDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this start dump default response has a 5xx status code -func (o *StartDumpDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this start dump default response a status code equal to that given -func (o *StartDumpDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the start dump default response -func (o *StartDumpDefault) Code() int { - return o._statusCode -} - -func (o *StartDumpDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/dumps:start][%d] StartDump default %s", o._statusCode, payload) -} - -func (o *StartDumpDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/dumps:start][%d] StartDump default %s", o._statusCode, payload) -} - -func (o *StartDumpDefault) GetPayload() *StartDumpDefaultBody { - return o.Payload -} - -func (o *StartDumpDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(StartDumpDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -StartDumpBody start dump body -swagger:model StartDumpBody -*/ -type StartDumpBody struct { - // service names - ServiceNames []string `json:"service_names"` - - // start time - // Format: date-time - StartTime strfmt.DateTime `json:"start_time,omitempty"` - - // end time - // Format: date-time - EndTime strfmt.DateTime `json:"end_time,omitempty"` - - // export qan - ExportQAN bool `json:"export_qan,omitempty"` - - // ignore load - IgnoreLoad bool `json:"ignore_load,omitempty"` -} - -// Validate validates this start dump body -func (o *StartDumpBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateStartTime(formats); err != nil { - res = append(res, err) - } - - if err := o.validateEndTime(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *StartDumpBody) validateStartTime(formats strfmt.Registry) error { - if swag.IsZero(o.StartTime) { // not required - return nil - } - - if err := validate.FormatOf("body"+"."+"start_time", "body", "date-time", o.StartTime.String(), formats); err != nil { - return err - } - - return nil -} - -func (o *StartDumpBody) validateEndTime(formats strfmt.Registry) error { - if swag.IsZero(o.EndTime) { // not required - return nil - } - - if err := validate.FormatOf("body"+"."+"end_time", "body", "date-time", o.EndTime.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this start dump body based on context it is used -func (o *StartDumpBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *StartDumpBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *StartDumpBody) UnmarshalBinary(b []byte) error { - var res StartDumpBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -StartDumpDefaultBody start dump default body -swagger:model StartDumpDefaultBody -*/ -type StartDumpDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*StartDumpDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this start dump default body -func (o *StartDumpDefaultBody) 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 *StartDumpDefaultBody) 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("StartDump default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("StartDump default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this start dump default body based on the context it is used -func (o *StartDumpDefaultBody) 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 *StartDumpDefaultBody) 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("StartDump default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("StartDump default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *StartDumpDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *StartDumpDefaultBody) UnmarshalBinary(b []byte) error { - var res StartDumpDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -StartDumpDefaultBodyDetailsItems0 start dump default body details items0 -swagger:model StartDumpDefaultBodyDetailsItems0 -*/ -type StartDumpDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` - - // start dump default body details items0 - StartDumpDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *StartDumpDefaultBodyDetailsItems0) 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 StartDumpDefaultBodyDetailsItems0 - - 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.StartDumpDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o StartDumpDefaultBodyDetailsItems0) 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.StartDumpDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.StartDumpDefaultBodyDetailsItems0) - 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 start dump default body details items0 -func (o *StartDumpDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this start dump default body details items0 based on context it is used -func (o *StartDumpDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *StartDumpDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *StartDumpDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res StartDumpDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -StartDumpOKBody start dump OK body -swagger:model StartDumpOKBody -*/ -type StartDumpOKBody struct { - // dump id - DumpID string `json:"dump_id,omitempty"` -} - -// Validate validates this start dump OK body -func (o *StartDumpOKBody) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this start dump OK body based on context it is used -func (o *StartDumpOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *StartDumpOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *StartDumpOKBody) UnmarshalBinary(b []byte) error { - var res StartDumpOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/dump/v1beta1/json/client/dump_service/upload_dump_parameters.go b/api/dump/v1beta1/json/client/dump_service/upload_dump_parameters.go deleted file mode 100644 index 0be24f481a8..00000000000 --- a/api/dump/v1beta1/json/client/dump_service/upload_dump_parameters.go +++ /dev/null @@ -1,144 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package dump_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" -) - -// NewUploadDumpParams creates a new UploadDumpParams 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 NewUploadDumpParams() *UploadDumpParams { - return &UploadDumpParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewUploadDumpParamsWithTimeout creates a new UploadDumpParams object -// with the ability to set a timeout on a request. -func NewUploadDumpParamsWithTimeout(timeout time.Duration) *UploadDumpParams { - return &UploadDumpParams{ - timeout: timeout, - } -} - -// NewUploadDumpParamsWithContext creates a new UploadDumpParams object -// with the ability to set a context for a request. -func NewUploadDumpParamsWithContext(ctx context.Context) *UploadDumpParams { - return &UploadDumpParams{ - Context: ctx, - } -} - -// NewUploadDumpParamsWithHTTPClient creates a new UploadDumpParams object -// with the ability to set a custom HTTPClient for a request. -func NewUploadDumpParamsWithHTTPClient(client *http.Client) *UploadDumpParams { - return &UploadDumpParams{ - HTTPClient: client, - } -} - -/* -UploadDumpParams contains all the parameters to send to the API endpoint - - for the upload dump operation. - - Typically these are written to a http.Request. -*/ -type UploadDumpParams struct { - // Body. - Body UploadDumpBody - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the upload dump params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UploadDumpParams) WithDefaults() *UploadDumpParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the upload dump params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UploadDumpParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the upload dump params -func (o *UploadDumpParams) WithTimeout(timeout time.Duration) *UploadDumpParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the upload dump params -func (o *UploadDumpParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the upload dump params -func (o *UploadDumpParams) WithContext(ctx context.Context) *UploadDumpParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the upload dump params -func (o *UploadDumpParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the upload dump params -func (o *UploadDumpParams) WithHTTPClient(client *http.Client) *UploadDumpParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the upload dump params -func (o *UploadDumpParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the upload dump params -func (o *UploadDumpParams) WithBody(body UploadDumpBody) *UploadDumpParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the upload dump params -func (o *UploadDumpParams) SetBody(body UploadDumpBody) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *UploadDumpParams) 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/dump/v1beta1/json/client/dump_service/upload_dump_responses.go b/api/dump/v1beta1/json/client/dump_service/upload_dump_responses.go deleted file mode 100644 index 19cdb3631ac..00000000000 --- a/api/dump/v1beta1/json/client/dump_service/upload_dump_responses.go +++ /dev/null @@ -1,565 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package dump_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" -) - -// UploadDumpReader is a Reader for the UploadDump structure. -type UploadDumpReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *UploadDumpReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewUploadDumpOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewUploadDumpDefault(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 - } -} - -// NewUploadDumpOK creates a UploadDumpOK with default headers values -func NewUploadDumpOK() *UploadDumpOK { - return &UploadDumpOK{} -} - -/* -UploadDumpOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type UploadDumpOK struct { - Payload any -} - -// IsSuccess returns true when this upload dump Ok response has a 2xx status code -func (o *UploadDumpOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this upload dump Ok response has a 3xx status code -func (o *UploadDumpOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this upload dump Ok response has a 4xx status code -func (o *UploadDumpOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this upload dump Ok response has a 5xx status code -func (o *UploadDumpOK) IsServerError() bool { - return false -} - -// IsCode returns true when this upload dump Ok response a status code equal to that given -func (o *UploadDumpOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the upload dump Ok response -func (o *UploadDumpOK) Code() int { - return 200 -} - -func (o *UploadDumpOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/dumps:upload][%d] uploadDumpOk %s", 200, payload) -} - -func (o *UploadDumpOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/dumps:upload][%d] uploadDumpOk %s", 200, payload) -} - -func (o *UploadDumpOK) GetPayload() any { - return o.Payload -} - -func (o *UploadDumpOK) 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) { - return err - } - - return nil -} - -// NewUploadDumpDefault creates a UploadDumpDefault with default headers values -func NewUploadDumpDefault(code int) *UploadDumpDefault { - return &UploadDumpDefault{ - _statusCode: code, - } -} - -/* -UploadDumpDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type UploadDumpDefault struct { - _statusCode int - - Payload *UploadDumpDefaultBody -} - -// IsSuccess returns true when this upload dump default response has a 2xx status code -func (o *UploadDumpDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this upload dump default response has a 3xx status code -func (o *UploadDumpDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this upload dump default response has a 4xx status code -func (o *UploadDumpDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this upload dump default response has a 5xx status code -func (o *UploadDumpDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this upload dump default response a status code equal to that given -func (o *UploadDumpDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the upload dump default response -func (o *UploadDumpDefault) Code() int { - return o._statusCode -} - -func (o *UploadDumpDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/dumps:upload][%d] UploadDump default %s", o._statusCode, payload) -} - -func (o *UploadDumpDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/dumps:upload][%d] UploadDump default %s", o._statusCode, payload) -} - -func (o *UploadDumpDefault) GetPayload() *UploadDumpDefaultBody { - return o.Payload -} - -func (o *UploadDumpDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(UploadDumpDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -UploadDumpBody upload dump body -swagger:model UploadDumpBody -*/ -type UploadDumpBody struct { - // dump ids - DumpIds []string `json:"dump_ids"` - - // sftp parameters - SftpParameters *UploadDumpParamsBodySftpParameters `json:"sftp_parameters,omitempty"` -} - -// Validate validates this upload dump body -func (o *UploadDumpBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateSftpParameters(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *UploadDumpBody) validateSftpParameters(formats strfmt.Registry) error { - if swag.IsZero(o.SftpParameters) { // not required - return nil - } - - if o.SftpParameters != nil { - if err := o.SftpParameters.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "sftp_parameters") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "sftp_parameters") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this upload dump body based on the context it is used -func (o *UploadDumpBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateSftpParameters(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *UploadDumpBody) contextValidateSftpParameters(ctx context.Context, formats strfmt.Registry) error { - if o.SftpParameters != nil { - - if swag.IsZero(o.SftpParameters) { // not required - return nil - } - - if err := o.SftpParameters.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "sftp_parameters") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "sftp_parameters") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *UploadDumpBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *UploadDumpBody) UnmarshalBinary(b []byte) error { - var res UploadDumpBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -UploadDumpDefaultBody upload dump default body -swagger:model UploadDumpDefaultBody -*/ -type UploadDumpDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*UploadDumpDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this upload dump default body -func (o *UploadDumpDefaultBody) 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 *UploadDumpDefaultBody) 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("UploadDump default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("UploadDump default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this upload dump default body based on the context it is used -func (o *UploadDumpDefaultBody) 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 *UploadDumpDefaultBody) 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("UploadDump default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("UploadDump default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *UploadDumpDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *UploadDumpDefaultBody) UnmarshalBinary(b []byte) error { - var res UploadDumpDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -UploadDumpDefaultBodyDetailsItems0 upload dump default body details items0 -swagger:model UploadDumpDefaultBodyDetailsItems0 -*/ -type UploadDumpDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` - - // upload dump default body details items0 - UploadDumpDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *UploadDumpDefaultBodyDetailsItems0) 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 UploadDumpDefaultBodyDetailsItems0 - - 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.UploadDumpDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o UploadDumpDefaultBodyDetailsItems0) 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.UploadDumpDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.UploadDumpDefaultBodyDetailsItems0) - 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 upload dump default body details items0 -func (o *UploadDumpDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this upload dump default body details items0 based on context it is used -func (o *UploadDumpDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *UploadDumpDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *UploadDumpDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res UploadDumpDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -UploadDumpParamsBodySftpParameters upload dump params body sftp parameters -swagger:model UploadDumpParamsBodySftpParameters -*/ -type UploadDumpParamsBodySftpParameters struct { - // address - Address string `json:"address,omitempty"` - - // user - User string `json:"user,omitempty"` - - // password - Password string `json:"password,omitempty"` - - // directory - Directory string `json:"directory,omitempty"` -} - -// Validate validates this upload dump params body sftp parameters -func (o *UploadDumpParamsBodySftpParameters) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this upload dump params body sftp parameters based on context it is used -func (o *UploadDumpParamsBodySftpParameters) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *UploadDumpParamsBodySftpParameters) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *UploadDumpParamsBodySftpParameters) UnmarshalBinary(b []byte) error { - var res UploadDumpParamsBodySftpParameters - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/dump/v1beta1/json/client/pmm_dump_api_client.go b/api/dump/v1beta1/json/client/pmm_dump_api_client.go deleted file mode 100644 index 4c4daa7c90b..00000000000 --- a/api/dump/v1beta1/json/client/pmm_dump_api_client.go +++ /dev/null @@ -1,112 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package client - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/percona/pmm/api/dump/v1beta1/json/client/dump_service" -) - -// Default PMM dump API HTTP client. -var Default = NewHTTPClient(nil) - -const ( - // DefaultHost is the default Host - // found in Meta (info) section of spec file - DefaultHost string = "localhost" - // DefaultBasePath is the default BasePath - // found in Meta (info) section of spec file - DefaultBasePath string = "/" -) - -// DefaultSchemes are the default schemes found in Meta (info) section of spec file -var DefaultSchemes = []string{"http", "https"} - -// NewHTTPClient creates a new PMM dump API HTTP client. -func NewHTTPClient(formats strfmt.Registry) *PMMDumpAPI { - return NewHTTPClientWithConfig(formats, nil) -} - -// NewHTTPClientWithConfig creates a new PMM dump API HTTP client, -// using a customizable transport config. -func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *PMMDumpAPI { - // ensure nullable parameters have default - if cfg == nil { - cfg = DefaultTransportConfig() - } - - // create transport and client - transport := httptransport.New(cfg.Host, cfg.BasePath, cfg.Schemes) - return New(transport, formats) -} - -// New creates a new PMM dump API client -func New(transport runtime.ClientTransport, formats strfmt.Registry) *PMMDumpAPI { - // ensure nullable parameters have default - if formats == nil { - formats = strfmt.Default - } - - cli := new(PMMDumpAPI) - cli.Transport = transport - cli.DumpService = dump_service.New(transport, formats) - return cli -} - -// DefaultTransportConfig creates a TransportConfig with the -// default settings taken from the meta section of the spec file. -func DefaultTransportConfig() *TransportConfig { - return &TransportConfig{ - Host: DefaultHost, - BasePath: DefaultBasePath, - Schemes: DefaultSchemes, - } -} - -// TransportConfig contains the transport related info, -// found in the meta section of the spec file. -type TransportConfig struct { - Host string - BasePath string - Schemes []string -} - -// WithHost overrides the default host, -// provided by the meta section of the spec file. -func (cfg *TransportConfig) WithHost(host string) *TransportConfig { - cfg.Host = host - return cfg -} - -// WithBasePath overrides the default basePath, -// provided by the meta section of the spec file. -func (cfg *TransportConfig) WithBasePath(basePath string) *TransportConfig { - cfg.BasePath = basePath - return cfg -} - -// WithSchemes overrides the default schemes, -// provided by the meta section of the spec file. -func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig { - cfg.Schemes = schemes - return cfg -} - -// PMMDumpAPI is a client for PMM dump API -type PMMDumpAPI struct { - DumpService dump_service.ClientService - - Transport runtime.ClientTransport -} - -// SetTransport changes the transport on the client and all its subresources -func (c *PMMDumpAPI) SetTransport(transport runtime.ClientTransport) { - c.Transport = transport - c.DumpService.SetTransport(transport) -} diff --git a/api/dump/v1beta1/json/v1beta1.json b/api/dump/v1beta1/json/v1beta1.json deleted file mode 100644 index c36e0941f48..00000000000 --- a/api/dump/v1beta1/json/v1beta1.json +++ /dev/null @@ -1,465 +0,0 @@ -{ - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "schemes": [ - "https", - "http" - ], - "swagger": "2.0", - "info": { - "title": "PMM Dump API", - "version": "v1beta1" - }, - "paths": { - "/v1/dumps": { - "get": { - "description": "List all dumps", - "tags": [ - "DumpService" - ], - "summary": "List All Dumps", - "operationId": "ListDumps", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "dumps": { - "type": "array", - "items": { - "type": "object", - "properties": { - "dump_id": { - "type": "string", - "x-order": 0 - }, - "status": { - "type": "string", - "default": "DUMP_STATUS_UNSPECIFIED", - "enum": [ - "DUMP_STATUS_UNSPECIFIED", - "DUMP_STATUS_IN_PROGRESS", - "DUMP_STATUS_SUCCESS", - "DUMP_STATUS_ERROR" - ], - "x-order": 1 - }, - "service_names": { - "type": "array", - "items": { - "type": "string" - }, - "x-order": 2 - }, - "start_time": { - "type": "string", - "format": "date-time", - "x-order": 3 - }, - "end_time": { - "type": "string", - "format": "date-time", - "x-order": 4 - }, - "created_at": { - "type": "string", - "format": "date-time", - "x-order": 5 - } - } - }, - "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/dumps/{dump_id}/logs": { - "get": { - "description": "Get logs of a selected dump.", - "tags": [ - "DumpService" - ], - "summary": "Get Dump Logs", - "operationId": "GetDumpLogs", - "parameters": [ - { - "type": "string", - "name": "dump_id", - "in": "path", - "required": true - }, - { - "type": "integer", - "format": "int64", - "name": "offset", - "in": "query" - }, - { - "type": "integer", - "format": "int64", - "name": "limit", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "logs": { - "type": "array", - "items": { - "description": "LogChunk represent one chunk of logs.", - "type": "object", - "properties": { - "chunk_id": { - "type": "integer", - "format": "int64", - "x-order": 0 - }, - "data": { - "type": "string", - "x-order": 1 - } - } - }, - "x-order": 0 - }, - "end": { - "type": "boolean", - "x-order": 1 - } - } - } - }, - "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/dumps:batchDelete": { - "post": { - "description": "Delete selected dumps.", - "tags": [ - "DumpService" - ], - "summary": "Delete Dumps", - "operationId": "DeleteDump", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "dump_ids": { - "type": "array", - "items": { - "type": "string" - }, - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/dumps:start": { - "post": { - "description": "Start a new dump.", - "tags": [ - "DumpService" - ], - "summary": "Start a New Dump", - "operationId": "StartDump", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "service_names": { - "type": "array", - "items": { - "type": "string" - }, - "x-order": 0 - }, - "start_time": { - "type": "string", - "format": "date-time", - "x-order": 1 - }, - "end_time": { - "type": "string", - "format": "date-time", - "x-order": 2 - }, - "export_qan": { - "type": "boolean", - "x-order": 3 - }, - "ignore_load": { - "type": "boolean", - "x-order": 4 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "dump_id": { - "type": "string", - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/dumps:upload": { - "post": { - "description": "Upload selected dumps to a remote server.", - "tags": [ - "DumpService" - ], - "summary": "Upload Dumps", - "operationId": "UploadDump", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "dump_ids": { - "type": "array", - "items": { - "type": "string" - }, - "x-order": 0 - }, - "sftp_parameters": { - "type": "object", - "properties": { - "address": { - "type": "string", - "x-order": 0 - }, - "user": { - "type": "string", - "x-order": 1 - }, - "password": { - "type": "string", - "x-order": 2 - }, - "directory": { - "type": "string", - "x-order": 3 - } - }, - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - } - }, - "tags": [ - { - "name": "DumpService" - } - ] -} \ No newline at end of file diff --git a/api/inventory/v1/agent_status.pb.go b/api/inventory/v1/agent_status.pb.go deleted file mode 100644 index d3f15c753dd..00000000000 --- a/api/inventory/v1/agent_status.pb.go +++ /dev/null @@ -1,162 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.10 -// protoc (unknown) -// source: inventory/v1/agent_status.proto - -package inventoryv1 - -import ( - reflect "reflect" - sync "sync" - unsafe "unsafe" - - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// AgentStatus represents actual Agent status. -type AgentStatus int32 - -const ( - AgentStatus_AGENT_STATUS_UNSPECIFIED AgentStatus = 0 - // Agent is starting. - AgentStatus_AGENT_STATUS_STARTING AgentStatus = 1 - // Agent encountered error when starting. - AgentStatus_AGENT_STATUS_INITIALIZATION_ERROR AgentStatus = 7 - // Agent is running. - AgentStatus_AGENT_STATUS_RUNNING AgentStatus = 2 - // Agent encountered error and will be restarted automatically soon. - AgentStatus_AGENT_STATUS_WAITING AgentStatus = 3 - // Agent is stopping. - AgentStatus_AGENT_STATUS_STOPPING AgentStatus = 4 - // Agent has been stopped or disabled. - AgentStatus_AGENT_STATUS_DONE AgentStatus = 5 - // Agent is not connected, we don't know anything about it's state. - AgentStatus_AGENT_STATUS_UNKNOWN AgentStatus = 6 -) - -// Enum value maps for AgentStatus. -var ( - AgentStatus_name = map[int32]string{ - 0: "AGENT_STATUS_UNSPECIFIED", - 1: "AGENT_STATUS_STARTING", - 7: "AGENT_STATUS_INITIALIZATION_ERROR", - 2: "AGENT_STATUS_RUNNING", - 3: "AGENT_STATUS_WAITING", - 4: "AGENT_STATUS_STOPPING", - 5: "AGENT_STATUS_DONE", - 6: "AGENT_STATUS_UNKNOWN", - } - AgentStatus_value = map[string]int32{ - "AGENT_STATUS_UNSPECIFIED": 0, - "AGENT_STATUS_STARTING": 1, - "AGENT_STATUS_INITIALIZATION_ERROR": 7, - "AGENT_STATUS_RUNNING": 2, - "AGENT_STATUS_WAITING": 3, - "AGENT_STATUS_STOPPING": 4, - "AGENT_STATUS_DONE": 5, - "AGENT_STATUS_UNKNOWN": 6, - } -) - -func (x AgentStatus) Enum() *AgentStatus { - p := new(AgentStatus) - *p = x - return p -} - -func (x AgentStatus) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (AgentStatus) Descriptor() protoreflect.EnumDescriptor { - return file_inventory_v1_agent_status_proto_enumTypes[0].Descriptor() -} - -func (AgentStatus) Type() protoreflect.EnumType { - return &file_inventory_v1_agent_status_proto_enumTypes[0] -} - -func (x AgentStatus) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use AgentStatus.Descriptor instead. -func (AgentStatus) EnumDescriptor() ([]byte, []int) { - return file_inventory_v1_agent_status_proto_rawDescGZIP(), []int{0} -} - -var File_inventory_v1_agent_status_proto protoreflect.FileDescriptor - -const file_inventory_v1_agent_status_proto_rawDesc = "" + - "\n" + - "\x1finventory/v1/agent_status.proto\x12\finventory.v1*\xed\x01\n" + - "\vAgentStatus\x12\x1c\n" + - "\x18AGENT_STATUS_UNSPECIFIED\x10\x00\x12\x19\n" + - "\x15AGENT_STATUS_STARTING\x10\x01\x12%\n" + - "!AGENT_STATUS_INITIALIZATION_ERROR\x10\a\x12\x18\n" + - "\x14AGENT_STATUS_RUNNING\x10\x02\x12\x18\n" + - "\x14AGENT_STATUS_WAITING\x10\x03\x12\x19\n" + - "\x15AGENT_STATUS_STOPPING\x10\x04\x12\x15\n" + - "\x11AGENT_STATUS_DONE\x10\x05\x12\x18\n" + - "\x14AGENT_STATUS_UNKNOWN\x10\x06B\xaa\x01\n" + - "\x10com.inventory.v1B\x10AgentStatusProtoP\x01Z3github.com/percona/pmm/api/inventory/v1;inventoryv1\xa2\x02\x03IXX\xaa\x02\fInventory.V1\xca\x02\fInventory\\V1\xe2\x02\x18Inventory\\V1\\GPBMetadata\xea\x02\rInventory::V1b\x06proto3" - -var ( - file_inventory_v1_agent_status_proto_rawDescOnce sync.Once - file_inventory_v1_agent_status_proto_rawDescData []byte -) - -func file_inventory_v1_agent_status_proto_rawDescGZIP() []byte { - file_inventory_v1_agent_status_proto_rawDescOnce.Do(func() { - file_inventory_v1_agent_status_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_inventory_v1_agent_status_proto_rawDesc), len(file_inventory_v1_agent_status_proto_rawDesc))) - }) - 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_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_inventory_v1_agent_status_proto_init() } -func file_inventory_v1_agent_status_proto_init() { - if File_inventory_v1_agent_status_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_inventory_v1_agent_status_proto_rawDesc), len(file_inventory_v1_agent_status_proto_rawDesc)), - NumEnums: 1, - NumMessages: 0, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_inventory_v1_agent_status_proto_goTypes, - DependencyIndexes: file_inventory_v1_agent_status_proto_depIdxs, - EnumInfos: file_inventory_v1_agent_status_proto_enumTypes, - }.Build() - File_inventory_v1_agent_status_proto = out.File - file_inventory_v1_agent_status_proto_goTypes = nil - file_inventory_v1_agent_status_proto_depIdxs = nil -} diff --git a/api/inventory/v1/agent_status.pb.validate.go b/api/inventory/v1/agent_status.pb.validate.go deleted file mode 100644 index cbf8387634d..00000000000 --- a/api/inventory/v1/agent_status.pb.validate.go +++ /dev/null @@ -1,36 +0,0 @@ -// Code generated by protoc-gen-validate. DO NOT EDIT. -// source: inventory/v1/agent_status.proto - -package inventoryv1 - -import ( - "bytes" - "errors" - "fmt" - "net" - "net/mail" - "net/url" - "regexp" - "sort" - "strings" - "time" - "unicode/utf8" - - "google.golang.org/protobuf/types/known/anypb" -) - -// ensure the imports are used -var ( - _ = bytes.MinRead - _ = errors.New("") - _ = fmt.Print - _ = utf8.UTFMax - _ = (*regexp.Regexp)(nil) - _ = (*strings.Reader)(nil) - _ = net.IPv4len - _ = time.Duration(0) - _ = (*url.URL)(nil) - _ = (*mail.Address)(nil) - _ = anypb.Any{} - _ = sort.Sort -) diff --git a/api/inventory/v1/agents.pb.go b/api/inventory/v1/agents.pb.go deleted file mode 100644 index 24b803d5959..00000000000 --- a/api/inventory/v1/agents.pb.go +++ /dev/null @@ -1,10345 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.10 -// protoc (unknown) -// source: inventory/v1/agents.proto - -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" - - common "github.com/percona/pmm/api/common" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// AgentType describes supported Agent types. -type AgentType int32 - -const ( - AgentType_AGENT_TYPE_UNSPECIFIED AgentType = 0 - AgentType_AGENT_TYPE_PMM_AGENT AgentType = 1 - AgentType_AGENT_TYPE_VM_AGENT AgentType = 14 - AgentType_AGENT_TYPE_NODE_EXPORTER AgentType = 2 - AgentType_AGENT_TYPE_MYSQLD_EXPORTER AgentType = 3 - AgentType_AGENT_TYPE_MONGODB_EXPORTER AgentType = 4 - AgentType_AGENT_TYPE_POSTGRES_EXPORTER AgentType = 5 - AgentType_AGENT_TYPE_PROXYSQL_EXPORTER AgentType = 6 - AgentType_AGENT_TYPE_VALKEY_EXPORTER AgentType = 17 - AgentType_AGENT_TYPE_QAN_MYSQL_PERFSCHEMA_AGENT AgentType = 7 - AgentType_AGENT_TYPE_QAN_MYSQL_SLOWLOG_AGENT AgentType = 8 - AgentType_AGENT_TYPE_QAN_MONGODB_PROFILER_AGENT AgentType = 9 - AgentType_AGENT_TYPE_QAN_MONGODB_MONGOLOG_AGENT AgentType = 18 - AgentType_AGENT_TYPE_QAN_POSTGRESQL_PGSTATEMENTS_AGENT AgentType = 10 - AgentType_AGENT_TYPE_QAN_POSTGRESQL_PGSTATMONITOR_AGENT AgentType = 13 - AgentType_AGENT_TYPE_EXTERNAL_EXPORTER AgentType = 12 - AgentType_AGENT_TYPE_RDS_EXPORTER AgentType = 11 - AgentType_AGENT_TYPE_AZURE_DATABASE_EXPORTER AgentType = 15 - AgentType_AGENT_TYPE_NOMAD_AGENT AgentType = 16 -) - -// Enum value maps for AgentType. -var ( - AgentType_name = map[int32]string{ - 0: "AGENT_TYPE_UNSPECIFIED", - 1: "AGENT_TYPE_PMM_AGENT", - 14: "AGENT_TYPE_VM_AGENT", - 2: "AGENT_TYPE_NODE_EXPORTER", - 3: "AGENT_TYPE_MYSQLD_EXPORTER", - 4: "AGENT_TYPE_MONGODB_EXPORTER", - 5: "AGENT_TYPE_POSTGRES_EXPORTER", - 6: "AGENT_TYPE_PROXYSQL_EXPORTER", - 17: "AGENT_TYPE_VALKEY_EXPORTER", - 7: "AGENT_TYPE_QAN_MYSQL_PERFSCHEMA_AGENT", - 8: "AGENT_TYPE_QAN_MYSQL_SLOWLOG_AGENT", - 9: "AGENT_TYPE_QAN_MONGODB_PROFILER_AGENT", - 18: "AGENT_TYPE_QAN_MONGODB_MONGOLOG_AGENT", - 10: "AGENT_TYPE_QAN_POSTGRESQL_PGSTATEMENTS_AGENT", - 13: "AGENT_TYPE_QAN_POSTGRESQL_PGSTATMONITOR_AGENT", - 12: "AGENT_TYPE_EXTERNAL_EXPORTER", - 11: "AGENT_TYPE_RDS_EXPORTER", - 15: "AGENT_TYPE_AZURE_DATABASE_EXPORTER", - 16: "AGENT_TYPE_NOMAD_AGENT", - } - AgentType_value = map[string]int32{ - "AGENT_TYPE_UNSPECIFIED": 0, - "AGENT_TYPE_PMM_AGENT": 1, - "AGENT_TYPE_VM_AGENT": 14, - "AGENT_TYPE_NODE_EXPORTER": 2, - "AGENT_TYPE_MYSQLD_EXPORTER": 3, - "AGENT_TYPE_MONGODB_EXPORTER": 4, - "AGENT_TYPE_POSTGRES_EXPORTER": 5, - "AGENT_TYPE_PROXYSQL_EXPORTER": 6, - "AGENT_TYPE_VALKEY_EXPORTER": 17, - "AGENT_TYPE_QAN_MYSQL_PERFSCHEMA_AGENT": 7, - "AGENT_TYPE_QAN_MYSQL_SLOWLOG_AGENT": 8, - "AGENT_TYPE_QAN_MONGODB_PROFILER_AGENT": 9, - "AGENT_TYPE_QAN_MONGODB_MONGOLOG_AGENT": 18, - "AGENT_TYPE_QAN_POSTGRESQL_PGSTATEMENTS_AGENT": 10, - "AGENT_TYPE_QAN_POSTGRESQL_PGSTATMONITOR_AGENT": 13, - "AGENT_TYPE_EXTERNAL_EXPORTER": 12, - "AGENT_TYPE_RDS_EXPORTER": 11, - "AGENT_TYPE_AZURE_DATABASE_EXPORTER": 15, - "AGENT_TYPE_NOMAD_AGENT": 16, - } -) - -func (x AgentType) Enum() *AgentType { - p := new(AgentType) - *p = x - return p -} - -func (x AgentType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (AgentType) Descriptor() protoreflect.EnumDescriptor { - return file_inventory_v1_agents_proto_enumTypes[0].Descriptor() -} - -func (AgentType) Type() protoreflect.EnumType { - return &file_inventory_v1_agents_proto_enumTypes[0] -} - -func (x AgentType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use AgentType.Descriptor instead. -func (AgentType) EnumDescriptor() ([]byte, []int) { - return file_inventory_v1_agents_proto_rawDescGZIP(), []int{0} -} - -// PMMAgent runs on Generic or Container Node. -type PMMAgent struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Unique randomly generated instance identifier. - AgentId string `protobuf:"bytes,1,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"` - // Node identifier where this instance runs. - RunsOnNodeId string `protobuf:"bytes,2,opt,name=runs_on_node_id,json=runsOnNodeId,proto3" json:"runs_on_node_id,omitempty"` - // Custom user-assigned labels. - CustomLabels map[string]string `protobuf:"bytes,3,rep,name=custom_labels,json=customLabels,proto3" json:"custom_labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - // True if Agent is running and connected to pmm-managed. - Connected bool `protobuf:"varint,10,opt,name=connected,proto3" json:"connected,omitempty"` - // Path to exec process. - ProcessExecPath string `protobuf:"bytes,11,opt,name=process_exec_path,json=processExecPath,proto3" json:"process_exec_path,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *PMMAgent) Reset() { - *x = PMMAgent{} - mi := &file_inventory_v1_agents_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *PMMAgent) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PMMAgent) ProtoMessage() {} - -func (x *PMMAgent) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_agents_proto_msgTypes[0] - 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 PMMAgent.ProtoReflect.Descriptor instead. -func (*PMMAgent) Descriptor() ([]byte, []int) { - return file_inventory_v1_agents_proto_rawDescGZIP(), []int{0} -} - -func (x *PMMAgent) GetAgentId() string { - if x != nil { - return x.AgentId - } - return "" -} - -func (x *PMMAgent) GetRunsOnNodeId() string { - if x != nil { - return x.RunsOnNodeId - } - return "" -} - -func (x *PMMAgent) GetCustomLabels() map[string]string { - if x != nil { - return x.CustomLabels - } - return nil -} - -func (x *PMMAgent) GetConnected() bool { - if x != nil { - return x.Connected - } - return false -} - -func (x *PMMAgent) GetProcessExecPath() string { - if x != nil { - return x.ProcessExecPath - } - return "" -} - -// VMAgent runs on Generic or Container Node alongside pmm-agent. -// It scrapes other exporter Agents that are configured with push_metrics_enabled -// and uses Prometheus remote write protocol to push metrics to PMM Server. -type VMAgent struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Unique randomly generated instance identifier. - AgentId string `protobuf:"bytes,1,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"` - // The pmm-agent identifier which runs this instance. - PmmAgentId string `protobuf:"bytes,2,opt,name=pmm_agent_id,json=pmmAgentId,proto3" json:"pmm_agent_id,omitempty"` - // Actual Agent status. - Status AgentStatus `protobuf:"varint,10,opt,name=status,proto3,enum=inventory.v1.AgentStatus" json:"status,omitempty"` - // Path to exec process. - ProcessExecPath string `protobuf:"bytes,11,opt,name=process_exec_path,json=processExecPath,proto3" json:"process_exec_path,omitempty"` - // Listen port for scraping metrics. - ListenPort uint32 `protobuf:"varint,12,opt,name=listen_port,json=listenPort,proto3" json:"listen_port,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *VMAgent) Reset() { - *x = VMAgent{} - mi := &file_inventory_v1_agents_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *VMAgent) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*VMAgent) ProtoMessage() {} - -func (x *VMAgent) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_agents_proto_msgTypes[1] - 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 VMAgent.ProtoReflect.Descriptor instead. -func (*VMAgent) Descriptor() ([]byte, []int) { - return file_inventory_v1_agents_proto_rawDescGZIP(), []int{1} -} - -func (x *VMAgent) GetAgentId() string { - if x != nil { - return x.AgentId - } - return "" -} - -func (x *VMAgent) GetPmmAgentId() string { - if x != nil { - return x.PmmAgentId - } - return "" -} - -func (x *VMAgent) GetStatus() AgentStatus { - if x != nil { - return x.Status - } - return AgentStatus_AGENT_STATUS_UNSPECIFIED -} - -func (x *VMAgent) GetProcessExecPath() string { - if x != nil { - return x.ProcessExecPath - } - return "" -} - -func (x *VMAgent) GetListenPort() uint32 { - if x != nil { - return x.ListenPort - } - return 0 -} - -type NomadAgent struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Unique randomly generated instance identifier. - AgentId string `protobuf:"bytes,1,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"` - // The pmm-agent identifier which runs this instance. - PmmAgentId string `protobuf:"bytes,2,opt,name=pmm_agent_id,json=pmmAgentId,proto3" json:"pmm_agent_id,omitempty"` - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `protobuf:"varint,3,opt,name=disabled,proto3" json:"disabled,omitempty"` - // Actual Agent status. - Status AgentStatus `protobuf:"varint,10,opt,name=status,proto3,enum=inventory.v1.AgentStatus" json:"status,omitempty"` - // Path to exec process. - ProcessExecPath string `protobuf:"bytes,11,opt,name=process_exec_path,json=processExecPath,proto3" json:"process_exec_path,omitempty"` - // Listen port for scraping metrics. - ListenPort uint32 `protobuf:"varint,12,opt,name=listen_port,json=listenPort,proto3" json:"listen_port,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *NomadAgent) Reset() { - *x = NomadAgent{} - mi := &file_inventory_v1_agents_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *NomadAgent) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*NomadAgent) ProtoMessage() {} - -func (x *NomadAgent) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_agents_proto_msgTypes[2] - 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 NomadAgent.ProtoReflect.Descriptor instead. -func (*NomadAgent) Descriptor() ([]byte, []int) { - return file_inventory_v1_agents_proto_rawDescGZIP(), []int{2} -} - -func (x *NomadAgent) GetAgentId() string { - if x != nil { - return x.AgentId - } - return "" -} - -func (x *NomadAgent) GetPmmAgentId() string { - if x != nil { - return x.PmmAgentId - } - return "" -} - -func (x *NomadAgent) GetDisabled() bool { - if x != nil { - return x.Disabled - } - return false -} - -func (x *NomadAgent) GetStatus() AgentStatus { - if x != nil { - return x.Status - } - return AgentStatus_AGENT_STATUS_UNSPECIFIED -} - -func (x *NomadAgent) GetProcessExecPath() string { - if x != nil { - return x.ProcessExecPath - } - return "" -} - -func (x *NomadAgent) GetListenPort() uint32 { - if x != nil { - return x.ListenPort - } - return 0 -} - -// NodeExporter runs on Generic or Container Node and exposes its metrics. -type NodeExporter struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Unique randomly generated instance identifier. - AgentId string `protobuf:"bytes,1,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"` - // The pmm-agent identifier which runs this instance. - PmmAgentId string `protobuf:"bytes,2,opt,name=pmm_agent_id,json=pmmAgentId,proto3" json:"pmm_agent_id,omitempty"` - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `protobuf:"varint,3,opt,name=disabled,proto3" json:"disabled,omitempty"` - // Custom user-assigned labels. - CustomLabels map[string]string `protobuf:"bytes,4,rep,name=custom_labels,json=customLabels,proto3" json:"custom_labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - // True if exporter uses push metrics mode. - PushMetricsEnabled bool `protobuf:"varint,5,opt,name=push_metrics_enabled,json=pushMetricsEnabled,proto3" json:"push_metrics_enabled,omitempty"` - // List of disabled collector names. - DisabledCollectors []string `protobuf:"bytes,6,rep,name=disabled_collectors,json=disabledCollectors,proto3" json:"disabled_collectors,omitempty"` - // Actual Agent status. - Status AgentStatus `protobuf:"varint,10,opt,name=status,proto3,enum=inventory.v1.AgentStatus" json:"status,omitempty"` - // Listen port for scraping metrics. - ListenPort uint32 `protobuf:"varint,11,opt,name=listen_port,json=listenPort,proto3" json:"listen_port,omitempty"` - // Path to exec process. - ProcessExecPath string `protobuf:"bytes,12,opt,name=process_exec_path,json=processExecPath,proto3" json:"process_exec_path,omitempty"` - // Log level for exporter. - LogLevel LogLevel `protobuf:"varint,13,opt,name=log_level,json=logLevel,proto3,enum=inventory.v1.LogLevel" json:"log_level,omitempty"` - // Optionally expose the exporter process on all public interfaces - ExposeExporter bool `protobuf:"varint,14,opt,name=expose_exporter,json=exposeExporter,proto3" json:"expose_exporter,omitempty"` - // Metrics resolution for this agent. - MetricsResolutions *common.MetricsResolutions `protobuf:"bytes,15,opt,name=metrics_resolutions,json=metricsResolutions,proto3" json:"metrics_resolutions,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *NodeExporter) Reset() { - *x = NodeExporter{} - mi := &file_inventory_v1_agents_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *NodeExporter) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*NodeExporter) ProtoMessage() {} - -func (x *NodeExporter) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_agents_proto_msgTypes[3] - 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 NodeExporter.ProtoReflect.Descriptor instead. -func (*NodeExporter) Descriptor() ([]byte, []int) { - return file_inventory_v1_agents_proto_rawDescGZIP(), []int{3} -} - -func (x *NodeExporter) GetAgentId() string { - if x != nil { - return x.AgentId - } - return "" -} - -func (x *NodeExporter) GetPmmAgentId() string { - if x != nil { - return x.PmmAgentId - } - return "" -} - -func (x *NodeExporter) GetDisabled() bool { - if x != nil { - return x.Disabled - } - return false -} - -func (x *NodeExporter) GetCustomLabels() map[string]string { - if x != nil { - return x.CustomLabels - } - return nil -} - -func (x *NodeExporter) GetPushMetricsEnabled() bool { - if x != nil { - return x.PushMetricsEnabled - } - return false -} - -func (x *NodeExporter) GetDisabledCollectors() []string { - if x != nil { - return x.DisabledCollectors - } - return nil -} - -func (x *NodeExporter) GetStatus() AgentStatus { - if x != nil { - return x.Status - } - return AgentStatus_AGENT_STATUS_UNSPECIFIED -} - -func (x *NodeExporter) GetListenPort() uint32 { - if x != nil { - return x.ListenPort - } - return 0 -} - -func (x *NodeExporter) GetProcessExecPath() string { - if x != nil { - return x.ProcessExecPath - } - return "" -} - -func (x *NodeExporter) GetLogLevel() LogLevel { - if x != nil { - return x.LogLevel - } - return LogLevel_LOG_LEVEL_UNSPECIFIED -} - -func (x *NodeExporter) GetExposeExporter() bool { - if x != nil { - return x.ExposeExporter - } - return false -} - -func (x *NodeExporter) GetMetricsResolutions() *common.MetricsResolutions { - if x != nil { - return x.MetricsResolutions - } - return nil -} - -// MySQLdExporter runs on Generic or Container Node and exposes MySQL Service metrics. -type MySQLdExporter struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Unique randomly generated instance identifier. - AgentId string `protobuf:"bytes,1,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"` - // The pmm-agent identifier which runs this instance. - PmmAgentId string `protobuf:"bytes,2,opt,name=pmm_agent_id,json=pmmAgentId,proto3" json:"pmm_agent_id,omitempty"` - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `protobuf:"varint,3,opt,name=disabled,proto3" json:"disabled,omitempty"` - // Service identifier. - ServiceId string `protobuf:"bytes,4,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` - // MySQL username for scraping metrics. - Username string `protobuf:"bytes,5,opt,name=username,proto3" json:"username,omitempty"` - // Use TLS for database connections. - Tls bool `protobuf:"varint,6,opt,name=tls,proto3" json:"tls,omitempty"` - // Skip TLS certificate and hostname validation. - TlsSkipVerify bool `protobuf:"varint,7,opt,name=tls_skip_verify,json=tlsSkipVerify,proto3" json:"tls_skip_verify,omitempty"` - // Certificate Authority certificate chain. - TlsCa string `protobuf:"bytes,8,opt,name=tls_ca,json=tlsCa,proto3" json:"tls_ca,omitempty"` - // Client certificate. - TlsCert string `protobuf:"bytes,9,opt,name=tls_cert,json=tlsCert,proto3" json:"tls_cert,omitempty"` - // Password for decrypting tls_cert. - TlsKey string `protobuf:"bytes,10,opt,name=tls_key,json=tlsKey,proto3" json:"tls_key,omitempty"` - // Tablestats group collectors are disabled if there are more than that number of tables. - // 0 means tablestats group collectors are always enabled (no limit). - // Negative value means tablestats group collectors are always disabled. - TablestatsGroupTableLimit int32 `protobuf:"varint,11,opt,name=tablestats_group_table_limit,json=tablestatsGroupTableLimit,proto3" json:"tablestats_group_table_limit,omitempty"` - // Custom user-assigned labels. - CustomLabels map[string]string `protobuf:"bytes,12,rep,name=custom_labels,json=customLabels,proto3" json:"custom_labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - // True if exporter uses push metrics mode. - PushMetricsEnabled bool `protobuf:"varint,13,opt,name=push_metrics_enabled,json=pushMetricsEnabled,proto3" json:"push_metrics_enabled,omitempty"` - // List of disabled collector names. - DisabledCollectors []string `protobuf:"bytes,14,rep,name=disabled_collectors,json=disabledCollectors,proto3" json:"disabled_collectors,omitempty"` - // Actual table count at the moment of adding. - TableCount int32 `protobuf:"varint,15,opt,name=table_count,json=tableCount,proto3" json:"table_count,omitempty"` - // Actual Agent status. - Status AgentStatus `protobuf:"varint,20,opt,name=status,proto3,enum=inventory.v1.AgentStatus" json:"status,omitempty"` - // Listen port for scraping metrics. - ListenPort uint32 `protobuf:"varint,21,opt,name=listen_port,json=listenPort,proto3" json:"listen_port,omitempty"` - // True if tablestats group collectors are currently disabled. - TablestatsGroupDisabled bool `protobuf:"varint,22,opt,name=tablestats_group_disabled,json=tablestatsGroupDisabled,proto3" json:"tablestats_group_disabled,omitempty"` - // Path to exec process. - ProcessExecPath string `protobuf:"bytes,23,opt,name=process_exec_path,json=processExecPath,proto3" json:"process_exec_path,omitempty"` - // Log level for exporter. - LogLevel LogLevel `protobuf:"varint,24,opt,name=log_level,json=logLevel,proto3,enum=inventory.v1.LogLevel" json:"log_level,omitempty"` - // Optionally expose the exporter process on all public interfaces - ExposeExporter bool `protobuf:"varint,25,opt,name=expose_exporter,json=exposeExporter,proto3" json:"expose_exporter,omitempty"` - // Metrics resolution for this agent. - MetricsResolutions *common.MetricsResolutions `protobuf:"bytes,26,opt,name=metrics_resolutions,json=metricsResolutions,proto3" json:"metrics_resolutions,omitempty"` - // Extra DSN parameters for MySQL connection. - ExtraDsnParams map[string]string `protobuf:"bytes,27,rep,name=extra_dsn_params,json=extraDsnParams,proto3" json:"extra_dsn_params,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *MySQLdExporter) Reset() { - *x = MySQLdExporter{} - mi := &file_inventory_v1_agents_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *MySQLdExporter) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MySQLdExporter) ProtoMessage() {} - -func (x *MySQLdExporter) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_agents_proto_msgTypes[4] - 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 MySQLdExporter.ProtoReflect.Descriptor instead. -func (*MySQLdExporter) Descriptor() ([]byte, []int) { - return file_inventory_v1_agents_proto_rawDescGZIP(), []int{4} -} - -func (x *MySQLdExporter) GetAgentId() string { - if x != nil { - return x.AgentId - } - return "" -} - -func (x *MySQLdExporter) GetPmmAgentId() string { - if x != nil { - return x.PmmAgentId - } - return "" -} - -func (x *MySQLdExporter) GetDisabled() bool { - if x != nil { - return x.Disabled - } - return false -} - -func (x *MySQLdExporter) GetServiceId() string { - if x != nil { - return x.ServiceId - } - return "" -} - -func (x *MySQLdExporter) GetUsername() string { - if x != nil { - return x.Username - } - return "" -} - -func (x *MySQLdExporter) GetTls() bool { - if x != nil { - return x.Tls - } - return false -} - -func (x *MySQLdExporter) GetTlsSkipVerify() bool { - if x != nil { - return x.TlsSkipVerify - } - return false -} - -func (x *MySQLdExporter) GetTlsCa() string { - if x != nil { - return x.TlsCa - } - return "" -} - -func (x *MySQLdExporter) GetTlsCert() string { - if x != nil { - return x.TlsCert - } - return "" -} - -func (x *MySQLdExporter) GetTlsKey() string { - if x != nil { - return x.TlsKey - } - return "" -} - -func (x *MySQLdExporter) GetTablestatsGroupTableLimit() int32 { - if x != nil { - return x.TablestatsGroupTableLimit - } - return 0 -} - -func (x *MySQLdExporter) GetCustomLabels() map[string]string { - if x != nil { - return x.CustomLabels - } - return nil -} - -func (x *MySQLdExporter) GetPushMetricsEnabled() bool { - if x != nil { - return x.PushMetricsEnabled - } - return false -} - -func (x *MySQLdExporter) GetDisabledCollectors() []string { - if x != nil { - return x.DisabledCollectors - } - return nil -} - -func (x *MySQLdExporter) GetTableCount() int32 { - if x != nil { - return x.TableCount - } - return 0 -} - -func (x *MySQLdExporter) GetStatus() AgentStatus { - if x != nil { - return x.Status - } - return AgentStatus_AGENT_STATUS_UNSPECIFIED -} - -func (x *MySQLdExporter) GetListenPort() uint32 { - if x != nil { - return x.ListenPort - } - return 0 -} - -func (x *MySQLdExporter) GetTablestatsGroupDisabled() bool { - if x != nil { - return x.TablestatsGroupDisabled - } - return false -} - -func (x *MySQLdExporter) GetProcessExecPath() string { - if x != nil { - return x.ProcessExecPath - } - return "" -} - -func (x *MySQLdExporter) GetLogLevel() LogLevel { - if x != nil { - return x.LogLevel - } - return LogLevel_LOG_LEVEL_UNSPECIFIED -} - -func (x *MySQLdExporter) GetExposeExporter() bool { - if x != nil { - return x.ExposeExporter - } - return false -} - -func (x *MySQLdExporter) GetMetricsResolutions() *common.MetricsResolutions { - if x != nil { - return x.MetricsResolutions - } - return nil -} - -func (x *MySQLdExporter) GetExtraDsnParams() map[string]string { - if x != nil { - return x.ExtraDsnParams - } - return nil -} - -// MongoDBExporter runs on Generic or Container Node and exposes MongoDB Service metrics. -type MongoDBExporter struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Unique randomly generated instance identifier. - AgentId string `protobuf:"bytes,1,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"` - // The pmm-agent identifier which runs this instance. - PmmAgentId string `protobuf:"bytes,2,opt,name=pmm_agent_id,json=pmmAgentId,proto3" json:"pmm_agent_id,omitempty"` - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `protobuf:"varint,3,opt,name=disabled,proto3" json:"disabled,omitempty"` - // Service identifier. - ServiceId string `protobuf:"bytes,4,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` - // MongoDB username for scraping metrics. - Username string `protobuf:"bytes,5,opt,name=username,proto3" json:"username,omitempty"` - // Use TLS for database connections. - Tls bool `protobuf:"varint,6,opt,name=tls,proto3" json:"tls,omitempty"` - // Skip TLS certificate and hostname validation. - TlsSkipVerify bool `protobuf:"varint,7,opt,name=tls_skip_verify,json=tlsSkipVerify,proto3" json:"tls_skip_verify,omitempty"` - // Custom user-assigned labels. - CustomLabels map[string]string `protobuf:"bytes,8,rep,name=custom_labels,json=customLabels,proto3" json:"custom_labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - // True if exporter uses push metrics mode. - PushMetricsEnabled bool `protobuf:"varint,9,opt,name=push_metrics_enabled,json=pushMetricsEnabled,proto3" json:"push_metrics_enabled,omitempty"` - // List of disabled collector names. - DisabledCollectors []string `protobuf:"bytes,10,rep,name=disabled_collectors,json=disabledCollectors,proto3" json:"disabled_collectors,omitempty"` - // Actual Agent status. - Status AgentStatus `protobuf:"varint,20,opt,name=status,proto3,enum=inventory.v1.AgentStatus" json:"status,omitempty"` - // Listen port for scraping metrics. - ListenPort uint32 `protobuf:"varint,21,opt,name=listen_port,json=listenPort,proto3" json:"listen_port,omitempty"` - // List of colletions to get stats from. Can use * - StatsCollections []string `protobuf:"bytes,22,rep,name=stats_collections,json=statsCollections,proto3" json:"stats_collections,omitempty"` - // 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 `protobuf:"varint,23,opt,name=collections_limit,json=collectionsLimit,proto3" json:"collections_limit,omitempty"` - // Enable All collectors. - EnableAllCollectors bool `protobuf:"varint,24,opt,name=enable_all_collectors,json=enableAllCollectors,proto3" json:"enable_all_collectors,omitempty"` - // Path to exec process. - ProcessExecPath string `protobuf:"bytes,25,opt,name=process_exec_path,json=processExecPath,proto3" json:"process_exec_path,omitempty"` - // Log level for exporter. - LogLevel LogLevel `protobuf:"varint,26,opt,name=log_level,json=logLevel,proto3,enum=inventory.v1.LogLevel" json:"log_level,omitempty"` - // Optionally expose the exporter process on all public interfaces - ExposeExporter bool `protobuf:"varint,27,opt,name=expose_exporter,json=exposeExporter,proto3" json:"expose_exporter,omitempty"` - // Metrics resolution for this agent. - MetricsResolutions *common.MetricsResolutions `protobuf:"bytes,28,opt,name=metrics_resolutions,json=metricsResolutions,proto3" json:"metrics_resolutions,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *MongoDBExporter) Reset() { - *x = MongoDBExporter{} - mi := &file_inventory_v1_agents_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *MongoDBExporter) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MongoDBExporter) ProtoMessage() {} - -func (x *MongoDBExporter) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_agents_proto_msgTypes[5] - 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 MongoDBExporter.ProtoReflect.Descriptor instead. -func (*MongoDBExporter) Descriptor() ([]byte, []int) { - return file_inventory_v1_agents_proto_rawDescGZIP(), []int{5} -} - -func (x *MongoDBExporter) GetAgentId() string { - if x != nil { - return x.AgentId - } - return "" -} - -func (x *MongoDBExporter) GetPmmAgentId() string { - if x != nil { - return x.PmmAgentId - } - return "" -} - -func (x *MongoDBExporter) GetDisabled() bool { - if x != nil { - return x.Disabled - } - return false -} - -func (x *MongoDBExporter) GetServiceId() string { - if x != nil { - return x.ServiceId - } - return "" -} - -func (x *MongoDBExporter) GetUsername() string { - if x != nil { - return x.Username - } - return "" -} - -func (x *MongoDBExporter) GetTls() bool { - if x != nil { - return x.Tls - } - return false -} - -func (x *MongoDBExporter) GetTlsSkipVerify() bool { - if x != nil { - return x.TlsSkipVerify - } - return false -} - -func (x *MongoDBExporter) GetCustomLabels() map[string]string { - if x != nil { - return x.CustomLabels - } - return nil -} - -func (x *MongoDBExporter) GetPushMetricsEnabled() bool { - if x != nil { - return x.PushMetricsEnabled - } - return false -} - -func (x *MongoDBExporter) GetDisabledCollectors() []string { - if x != nil { - return x.DisabledCollectors - } - return nil -} - -func (x *MongoDBExporter) GetStatus() AgentStatus { - if x != nil { - return x.Status - } - return AgentStatus_AGENT_STATUS_UNSPECIFIED -} - -func (x *MongoDBExporter) GetListenPort() uint32 { - if x != nil { - return x.ListenPort - } - return 0 -} - -func (x *MongoDBExporter) GetStatsCollections() []string { - if x != nil { - return x.StatsCollections - } - return nil -} - -func (x *MongoDBExporter) GetCollectionsLimit() int32 { - if x != nil { - return x.CollectionsLimit - } - return 0 -} - -func (x *MongoDBExporter) GetEnableAllCollectors() bool { - if x != nil { - return x.EnableAllCollectors - } - return false -} - -func (x *MongoDBExporter) GetProcessExecPath() string { - if x != nil { - return x.ProcessExecPath - } - return "" -} - -func (x *MongoDBExporter) GetLogLevel() LogLevel { - if x != nil { - return x.LogLevel - } - return LogLevel_LOG_LEVEL_UNSPECIFIED -} - -func (x *MongoDBExporter) GetExposeExporter() bool { - if x != nil { - return x.ExposeExporter - } - return false -} - -func (x *MongoDBExporter) GetMetricsResolutions() *common.MetricsResolutions { - if x != nil { - return x.MetricsResolutions - } - return nil -} - -// PostgresExporter runs on Generic or Container Node and exposes PostgreSQL Service metrics. -type PostgresExporter struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Unique randomly generated instance identifier. - AgentId string `protobuf:"bytes,1,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"` - // The pmm-agent identifier which runs this instance. - PmmAgentId string `protobuf:"bytes,2,opt,name=pmm_agent_id,json=pmmAgentId,proto3" json:"pmm_agent_id,omitempty"` - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `protobuf:"varint,3,opt,name=disabled,proto3" json:"disabled,omitempty"` - // Service identifier. - ServiceId string `protobuf:"bytes,4,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` - // PostgreSQL username for scraping metrics. - Username string `protobuf:"bytes,5,opt,name=username,proto3" json:"username,omitempty"` - // Use TLS for database connections. - Tls bool `protobuf:"varint,6,opt,name=tls,proto3" json:"tls,omitempty"` - // Skip TLS certificate and hostname validation. Uses sslmode=required instead of verify-full. - TlsSkipVerify bool `protobuf:"varint,7,opt,name=tls_skip_verify,json=tlsSkipVerify,proto3" json:"tls_skip_verify,omitempty"` - // Custom user-assigned labels. - CustomLabels map[string]string `protobuf:"bytes,8,rep,name=custom_labels,json=customLabels,proto3" json:"custom_labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - // True if exporter uses push metrics mode. - PushMetricsEnabled bool `protobuf:"varint,9,opt,name=push_metrics_enabled,json=pushMetricsEnabled,proto3" json:"push_metrics_enabled,omitempty"` - // List of disabled collector names. - DisabledCollectors []string `protobuf:"bytes,10,rep,name=disabled_collectors,json=disabledCollectors,proto3" json:"disabled_collectors,omitempty"` - // Actual Agent status. - Status AgentStatus `protobuf:"varint,20,opt,name=status,proto3,enum=inventory.v1.AgentStatus" json:"status,omitempty"` - // Listen port for scraping metrics. - ListenPort uint32 `protobuf:"varint,21,opt,name=listen_port,json=listenPort,proto3" json:"listen_port,omitempty"` - // Path to exec process. - ProcessExecPath string `protobuf:"bytes,22,opt,name=process_exec_path,json=processExecPath,proto3" json:"process_exec_path,omitempty"` - // Log level for exporter. - LogLevel LogLevel `protobuf:"varint,23,opt,name=log_level,json=logLevel,proto3,enum=inventory.v1.LogLevel" json:"log_level,omitempty"` - // Limit of databases for auto-discovery. - AutoDiscoveryLimit int32 `protobuf:"varint,24,opt,name=auto_discovery_limit,json=autoDiscoveryLimit,proto3" json:"auto_discovery_limit,omitempty"` - // Optionally expose the exporter process on all public interfaces - ExposeExporter bool `protobuf:"varint,25,opt,name=expose_exporter,json=exposeExporter,proto3" json:"expose_exporter,omitempty"` - // Maximum number of connections that exporter can open to the database instance. - MaxExporterConnections int32 `protobuf:"varint,26,opt,name=max_exporter_connections,json=maxExporterConnections,proto3" json:"max_exporter_connections,omitempty"` - // Metrics resolution for this agent. - MetricsResolutions *common.MetricsResolutions `protobuf:"bytes,27,opt,name=metrics_resolutions,json=metricsResolutions,proto3" json:"metrics_resolutions,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *PostgresExporter) Reset() { - *x = PostgresExporter{} - mi := &file_inventory_v1_agents_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *PostgresExporter) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PostgresExporter) ProtoMessage() {} - -func (x *PostgresExporter) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_agents_proto_msgTypes[6] - 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 PostgresExporter.ProtoReflect.Descriptor instead. -func (*PostgresExporter) Descriptor() ([]byte, []int) { - return file_inventory_v1_agents_proto_rawDescGZIP(), []int{6} -} - -func (x *PostgresExporter) GetAgentId() string { - if x != nil { - return x.AgentId - } - return "" -} - -func (x *PostgresExporter) GetPmmAgentId() string { - if x != nil { - return x.PmmAgentId - } - return "" -} - -func (x *PostgresExporter) GetDisabled() bool { - if x != nil { - return x.Disabled - } - return false -} - -func (x *PostgresExporter) GetServiceId() string { - if x != nil { - return x.ServiceId - } - return "" -} - -func (x *PostgresExporter) GetUsername() string { - if x != nil { - return x.Username - } - return "" -} - -func (x *PostgresExporter) GetTls() bool { - if x != nil { - return x.Tls - } - return false -} - -func (x *PostgresExporter) GetTlsSkipVerify() bool { - if x != nil { - return x.TlsSkipVerify - } - return false -} - -func (x *PostgresExporter) GetCustomLabels() map[string]string { - if x != nil { - return x.CustomLabels - } - return nil -} - -func (x *PostgresExporter) GetPushMetricsEnabled() bool { - if x != nil { - return x.PushMetricsEnabled - } - return false -} - -func (x *PostgresExporter) GetDisabledCollectors() []string { - if x != nil { - return x.DisabledCollectors - } - return nil -} - -func (x *PostgresExporter) GetStatus() AgentStatus { - if x != nil { - return x.Status - } - return AgentStatus_AGENT_STATUS_UNSPECIFIED -} - -func (x *PostgresExporter) GetListenPort() uint32 { - if x != nil { - return x.ListenPort - } - return 0 -} - -func (x *PostgresExporter) GetProcessExecPath() string { - if x != nil { - return x.ProcessExecPath - } - return "" -} - -func (x *PostgresExporter) GetLogLevel() LogLevel { - if x != nil { - return x.LogLevel - } - return LogLevel_LOG_LEVEL_UNSPECIFIED -} - -func (x *PostgresExporter) GetAutoDiscoveryLimit() int32 { - if x != nil { - return x.AutoDiscoveryLimit - } - return 0 -} - -func (x *PostgresExporter) GetExposeExporter() bool { - if x != nil { - return x.ExposeExporter - } - return false -} - -func (x *PostgresExporter) GetMaxExporterConnections() int32 { - if x != nil { - return x.MaxExporterConnections - } - return 0 -} - -func (x *PostgresExporter) GetMetricsResolutions() *common.MetricsResolutions { - if x != nil { - return x.MetricsResolutions - } - return nil -} - -// ProxySQLExporter runs on Generic or Container Node and exposes ProxySQL Service metrics. -type ProxySQLExporter struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Unique randomly generated instance identifier. - AgentId string `protobuf:"bytes,1,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"` - // The pmm-agent identifier which runs this instance. - PmmAgentId string `protobuf:"bytes,2,opt,name=pmm_agent_id,json=pmmAgentId,proto3" json:"pmm_agent_id,omitempty"` - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `protobuf:"varint,3,opt,name=disabled,proto3" json:"disabled,omitempty"` - // Service identifier. - ServiceId string `protobuf:"bytes,4,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` - // ProxySQL username for scraping metrics. - Username string `protobuf:"bytes,5,opt,name=username,proto3" json:"username,omitempty"` - // Use TLS for database connections. - Tls bool `protobuf:"varint,6,opt,name=tls,proto3" json:"tls,omitempty"` - // Skip TLS certificate and hostname validation. - TlsSkipVerify bool `protobuf:"varint,7,opt,name=tls_skip_verify,json=tlsSkipVerify,proto3" json:"tls_skip_verify,omitempty"` - // Custom user-assigned labels. - CustomLabels map[string]string `protobuf:"bytes,8,rep,name=custom_labels,json=customLabels,proto3" json:"custom_labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - // True if exporter uses push metrics mode. - PushMetricsEnabled bool `protobuf:"varint,9,opt,name=push_metrics_enabled,json=pushMetricsEnabled,proto3" json:"push_metrics_enabled,omitempty"` - // List of disabled collector names. - DisabledCollectors []string `protobuf:"bytes,10,rep,name=disabled_collectors,json=disabledCollectors,proto3" json:"disabled_collectors,omitempty"` - // Actual Agent status. - Status AgentStatus `protobuf:"varint,20,opt,name=status,proto3,enum=inventory.v1.AgentStatus" json:"status,omitempty"` - // Listen port for scraping metrics. - ListenPort uint32 `protobuf:"varint,21,opt,name=listen_port,json=listenPort,proto3" json:"listen_port,omitempty"` - // Path to exec process. - ProcessExecPath string `protobuf:"bytes,22,opt,name=process_exec_path,json=processExecPath,proto3" json:"process_exec_path,omitempty"` - // Log level for exporter. - LogLevel LogLevel `protobuf:"varint,23,opt,name=log_level,json=logLevel,proto3,enum=inventory.v1.LogLevel" json:"log_level,omitempty"` - // Optionally expose the exporter process on all public interfaces - ExposeExporter bool `protobuf:"varint,24,opt,name=expose_exporter,json=exposeExporter,proto3" json:"expose_exporter,omitempty"` - // Metrics resolution for this agent. - MetricsResolutions *common.MetricsResolutions `protobuf:"bytes,25,opt,name=metrics_resolutions,json=metricsResolutions,proto3" json:"metrics_resolutions,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ProxySQLExporter) Reset() { - *x = ProxySQLExporter{} - mi := &file_inventory_v1_agents_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ProxySQLExporter) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ProxySQLExporter) ProtoMessage() {} - -func (x *ProxySQLExporter) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_agents_proto_msgTypes[7] - 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 ProxySQLExporter.ProtoReflect.Descriptor instead. -func (*ProxySQLExporter) Descriptor() ([]byte, []int) { - return file_inventory_v1_agents_proto_rawDescGZIP(), []int{7} -} - -func (x *ProxySQLExporter) GetAgentId() string { - if x != nil { - return x.AgentId - } - return "" -} - -func (x *ProxySQLExporter) GetPmmAgentId() string { - if x != nil { - return x.PmmAgentId - } - return "" -} - -func (x *ProxySQLExporter) GetDisabled() bool { - if x != nil { - return x.Disabled - } - return false -} - -func (x *ProxySQLExporter) GetServiceId() string { - if x != nil { - return x.ServiceId - } - return "" -} - -func (x *ProxySQLExporter) GetUsername() string { - if x != nil { - return x.Username - } - return "" -} - -func (x *ProxySQLExporter) GetTls() bool { - if x != nil { - return x.Tls - } - return false -} - -func (x *ProxySQLExporter) GetTlsSkipVerify() bool { - if x != nil { - return x.TlsSkipVerify - } - return false -} - -func (x *ProxySQLExporter) GetCustomLabels() map[string]string { - if x != nil { - return x.CustomLabels - } - return nil -} - -func (x *ProxySQLExporter) GetPushMetricsEnabled() bool { - if x != nil { - return x.PushMetricsEnabled - } - return false -} - -func (x *ProxySQLExporter) GetDisabledCollectors() []string { - if x != nil { - return x.DisabledCollectors - } - return nil -} - -func (x *ProxySQLExporter) GetStatus() AgentStatus { - if x != nil { - return x.Status - } - return AgentStatus_AGENT_STATUS_UNSPECIFIED -} - -func (x *ProxySQLExporter) GetListenPort() uint32 { - if x != nil { - return x.ListenPort - } - return 0 -} - -func (x *ProxySQLExporter) GetProcessExecPath() string { - if x != nil { - return x.ProcessExecPath - } - return "" -} - -func (x *ProxySQLExporter) GetLogLevel() LogLevel { - if x != nil { - return x.LogLevel - } - return LogLevel_LOG_LEVEL_UNSPECIFIED -} - -func (x *ProxySQLExporter) GetExposeExporter() bool { - if x != nil { - return x.ExposeExporter - } - return false -} - -func (x *ProxySQLExporter) GetMetricsResolutions() *common.MetricsResolutions { - if x != nil { - return x.MetricsResolutions - } - return nil -} - -// ValkeyExporter runs on Generic or Container Node and exposes Valkey Service metrics. -type ValkeyExporter struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Unique randomly generated instance identifier. - AgentId string `protobuf:"bytes,1,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"` - // The pmm-agent identifier which runs this instance. - PmmAgentId string `protobuf:"bytes,2,opt,name=pmm_agent_id,json=pmmAgentId,proto3" json:"pmm_agent_id,omitempty"` - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `protobuf:"varint,3,opt,name=disabled,proto3" json:"disabled,omitempty"` - // Service identifier. - ServiceId string `protobuf:"bytes,4,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` - // Valkey username for scraping metrics. - Username string `protobuf:"bytes,5,opt,name=username,proto3" json:"username,omitempty"` - // Use TLS for database connections. - Tls bool `protobuf:"varint,6,opt,name=tls,proto3" json:"tls,omitempty"` - // Skip TLS certificate and hostname verification. - TlsSkipVerify bool `protobuf:"varint,7,opt,name=tls_skip_verify,json=tlsSkipVerify,proto3" json:"tls_skip_verify,omitempty"` - // Custom user-assigned labels. - CustomLabels map[string]string `protobuf:"bytes,8,rep,name=custom_labels,json=customLabels,proto3" json:"custom_labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - // True if exporter uses push metrics mode. - PushMetricsEnabled bool `protobuf:"varint,9,opt,name=push_metrics_enabled,json=pushMetricsEnabled,proto3" json:"push_metrics_enabled,omitempty"` - // List of disabled collector names. - DisabledCollectors []string `protobuf:"bytes,10,rep,name=disabled_collectors,json=disabledCollectors,proto3" json:"disabled_collectors,omitempty"` - // Actual Agent status. - Status AgentStatus `protobuf:"varint,20,opt,name=status,proto3,enum=inventory.v1.AgentStatus" json:"status,omitempty"` - // Listen port for scraping metrics. - ListenPort uint32 `protobuf:"varint,21,opt,name=listen_port,json=listenPort,proto3" json:"listen_port,omitempty"` - // Path to exec process. - ProcessExecPath string `protobuf:"bytes,22,opt,name=process_exec_path,json=processExecPath,proto3" json:"process_exec_path,omitempty"` - // Optionally expose the exporter process on all public interfaces - ExposeExporter bool `protobuf:"varint,23,opt,name=expose_exporter,json=exposeExporter,proto3" json:"expose_exporter,omitempty"` - // Metrics resolution for this agent. - MetricsResolutions *common.MetricsResolutions `protobuf:"bytes,24,opt,name=metrics_resolutions,json=metricsResolutions,proto3" json:"metrics_resolutions,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ValkeyExporter) Reset() { - *x = ValkeyExporter{} - mi := &file_inventory_v1_agents_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ValkeyExporter) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ValkeyExporter) ProtoMessage() {} - -func (x *ValkeyExporter) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_agents_proto_msgTypes[8] - 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 ValkeyExporter.ProtoReflect.Descriptor instead. -func (*ValkeyExporter) Descriptor() ([]byte, []int) { - return file_inventory_v1_agents_proto_rawDescGZIP(), []int{8} -} - -func (x *ValkeyExporter) GetAgentId() string { - if x != nil { - return x.AgentId - } - return "" -} - -func (x *ValkeyExporter) GetPmmAgentId() string { - if x != nil { - return x.PmmAgentId - } - return "" -} - -func (x *ValkeyExporter) GetDisabled() bool { - if x != nil { - return x.Disabled - } - return false -} - -func (x *ValkeyExporter) GetServiceId() string { - if x != nil { - return x.ServiceId - } - return "" -} - -func (x *ValkeyExporter) GetUsername() string { - if x != nil { - return x.Username - } - return "" -} - -func (x *ValkeyExporter) GetTls() bool { - if x != nil { - return x.Tls - } - return false -} - -func (x *ValkeyExporter) GetTlsSkipVerify() bool { - if x != nil { - return x.TlsSkipVerify - } - return false -} - -func (x *ValkeyExporter) GetCustomLabels() map[string]string { - if x != nil { - return x.CustomLabels - } - return nil -} - -func (x *ValkeyExporter) GetPushMetricsEnabled() bool { - if x != nil { - return x.PushMetricsEnabled - } - return false -} - -func (x *ValkeyExporter) GetDisabledCollectors() []string { - if x != nil { - return x.DisabledCollectors - } - return nil -} - -func (x *ValkeyExporter) GetStatus() AgentStatus { - if x != nil { - return x.Status - } - return AgentStatus_AGENT_STATUS_UNSPECIFIED -} - -func (x *ValkeyExporter) GetListenPort() uint32 { - if x != nil { - return x.ListenPort - } - return 0 -} - -func (x *ValkeyExporter) GetProcessExecPath() string { - if x != nil { - return x.ProcessExecPath - } - return "" -} - -func (x *ValkeyExporter) GetExposeExporter() bool { - if x != nil { - return x.ExposeExporter - } - return false -} - -func (x *ValkeyExporter) GetMetricsResolutions() *common.MetricsResolutions { - if x != nil { - return x.MetricsResolutions - } - return nil -} - -// QANMySQLPerfSchemaAgent runs within pmm-agent and sends MySQL Query Analytics data to the PMM Server. -type QANMySQLPerfSchemaAgent struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Unique randomly generated instance identifier. - AgentId string `protobuf:"bytes,1,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"` - // The pmm-agent identifier which runs this instance. - PmmAgentId string `protobuf:"bytes,2,opt,name=pmm_agent_id,json=pmmAgentId,proto3" json:"pmm_agent_id,omitempty"` - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `protobuf:"varint,3,opt,name=disabled,proto3" json:"disabled,omitempty"` - // Service identifier. - ServiceId string `protobuf:"bytes,4,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` - // MySQL username for getting performance data. - Username string `protobuf:"bytes,5,opt,name=username,proto3" json:"username,omitempty"` - // Use TLS for database connections. - Tls bool `protobuf:"varint,6,opt,name=tls,proto3" json:"tls,omitempty"` - // Skip TLS certificate and hostname validation. - TlsSkipVerify bool `protobuf:"varint,7,opt,name=tls_skip_verify,json=tlsSkipVerify,proto3" json:"tls_skip_verify,omitempty"` - // Certificate Authority certificate chain. - TlsCa string `protobuf:"bytes,8,opt,name=tls_ca,json=tlsCa,proto3" json:"tls_ca,omitempty"` - // Client certificate. - TlsCert string `protobuf:"bytes,9,opt,name=tls_cert,json=tlsCert,proto3" json:"tls_cert,omitempty"` - // Password for decrypting tls_cert. - TlsKey string `protobuf:"bytes,10,opt,name=tls_key,json=tlsKey,proto3" json:"tls_key,omitempty"` - // Disable parsing comments from queries and showing them in QAN. - DisableCommentsParsing bool `protobuf:"varint,11,opt,name=disable_comments_parsing,json=disableCommentsParsing,proto3" json:"disable_comments_parsing,omitempty"` - // Limit query length in QAN (default: server-defined; -1: no limit). - MaxQueryLength int32 `protobuf:"varint,12,opt,name=max_query_length,json=maxQueryLength,proto3" json:"max_query_length,omitempty"` - // True if query examples are disabled. - QueryExamplesDisabled bool `protobuf:"varint,13,opt,name=query_examples_disabled,json=queryExamplesDisabled,proto3" json:"query_examples_disabled,omitempty"` - // Custom user-assigned labels. - CustomLabels map[string]string `protobuf:"bytes,14,rep,name=custom_labels,json=customLabels,proto3" json:"custom_labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - // Actual Agent status. - Status AgentStatus `protobuf:"varint,20,opt,name=status,proto3,enum=inventory.v1.AgentStatus" json:"status,omitempty"` - // Path to exec process. - ProcessExecPath string `protobuf:"bytes,21,opt,name=process_exec_path,json=processExecPath,proto3" json:"process_exec_path,omitempty"` - // Log level for exporter. - LogLevel LogLevel `protobuf:"varint,22,opt,name=log_level,json=logLevel,proto3,enum=inventory.v1.LogLevel" json:"log_level,omitempty"` - // Extra DSN parameters for MySQL connection. - ExtraDsnParams map[string]string `protobuf:"bytes,23,rep,name=extra_dsn_params,json=extraDsnParams,proto3" json:"extra_dsn_params,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *QANMySQLPerfSchemaAgent) Reset() { - *x = QANMySQLPerfSchemaAgent{} - mi := &file_inventory_v1_agents_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *QANMySQLPerfSchemaAgent) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*QANMySQLPerfSchemaAgent) ProtoMessage() {} - -func (x *QANMySQLPerfSchemaAgent) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_agents_proto_msgTypes[9] - 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 QANMySQLPerfSchemaAgent.ProtoReflect.Descriptor instead. -func (*QANMySQLPerfSchemaAgent) Descriptor() ([]byte, []int) { - return file_inventory_v1_agents_proto_rawDescGZIP(), []int{9} -} - -func (x *QANMySQLPerfSchemaAgent) GetAgentId() string { - if x != nil { - return x.AgentId - } - return "" -} - -func (x *QANMySQLPerfSchemaAgent) GetPmmAgentId() string { - if x != nil { - return x.PmmAgentId - } - return "" -} - -func (x *QANMySQLPerfSchemaAgent) GetDisabled() bool { - if x != nil { - return x.Disabled - } - return false -} - -func (x *QANMySQLPerfSchemaAgent) GetServiceId() string { - if x != nil { - return x.ServiceId - } - return "" -} - -func (x *QANMySQLPerfSchemaAgent) GetUsername() string { - if x != nil { - return x.Username - } - return "" -} - -func (x *QANMySQLPerfSchemaAgent) GetTls() bool { - if x != nil { - return x.Tls - } - return false -} - -func (x *QANMySQLPerfSchemaAgent) GetTlsSkipVerify() bool { - if x != nil { - return x.TlsSkipVerify - } - return false -} - -func (x *QANMySQLPerfSchemaAgent) GetTlsCa() string { - if x != nil { - return x.TlsCa - } - return "" -} - -func (x *QANMySQLPerfSchemaAgent) GetTlsCert() string { - if x != nil { - return x.TlsCert - } - return "" -} - -func (x *QANMySQLPerfSchemaAgent) GetTlsKey() string { - if x != nil { - return x.TlsKey - } - return "" -} - -func (x *QANMySQLPerfSchemaAgent) GetDisableCommentsParsing() bool { - if x != nil { - return x.DisableCommentsParsing - } - return false -} - -func (x *QANMySQLPerfSchemaAgent) GetMaxQueryLength() int32 { - if x != nil { - return x.MaxQueryLength - } - return 0 -} - -func (x *QANMySQLPerfSchemaAgent) GetQueryExamplesDisabled() bool { - if x != nil { - return x.QueryExamplesDisabled - } - return false -} - -func (x *QANMySQLPerfSchemaAgent) GetCustomLabels() map[string]string { - if x != nil { - return x.CustomLabels - } - return nil -} - -func (x *QANMySQLPerfSchemaAgent) GetStatus() AgentStatus { - if x != nil { - return x.Status - } - return AgentStatus_AGENT_STATUS_UNSPECIFIED -} - -func (x *QANMySQLPerfSchemaAgent) GetProcessExecPath() string { - if x != nil { - return x.ProcessExecPath - } - return "" -} - -func (x *QANMySQLPerfSchemaAgent) GetLogLevel() LogLevel { - if x != nil { - return x.LogLevel - } - return LogLevel_LOG_LEVEL_UNSPECIFIED -} - -func (x *QANMySQLPerfSchemaAgent) GetExtraDsnParams() map[string]string { - if x != nil { - return x.ExtraDsnParams - } - return nil -} - -// QANMySQLSlowlogAgent runs within pmm-agent and sends MySQL Query Analytics data to the PMM Server. -type QANMySQLSlowlogAgent struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Unique randomly generated instance identifier. - AgentId string `protobuf:"bytes,1,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"` - // The pmm-agent identifier which runs this instance. - PmmAgentId string `protobuf:"bytes,2,opt,name=pmm_agent_id,json=pmmAgentId,proto3" json:"pmm_agent_id,omitempty"` - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `protobuf:"varint,3,opt,name=disabled,proto3" json:"disabled,omitempty"` - // Service identifier. - ServiceId string `protobuf:"bytes,4,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` - // MySQL username for getting performance data. - Username string `protobuf:"bytes,5,opt,name=username,proto3" json:"username,omitempty"` - // Use TLS for database connections. - Tls bool `protobuf:"varint,6,opt,name=tls,proto3" json:"tls,omitempty"` - // Skip TLS certificate and hostname validation. - TlsSkipVerify bool `protobuf:"varint,7,opt,name=tls_skip_verify,json=tlsSkipVerify,proto3" json:"tls_skip_verify,omitempty"` - // Certificate Authority certificate chain. - TlsCa string `protobuf:"bytes,8,opt,name=tls_ca,json=tlsCa,proto3" json:"tls_ca,omitempty"` - // Client certificate. - TlsCert string `protobuf:"bytes,9,opt,name=tls_cert,json=tlsCert,proto3" json:"tls_cert,omitempty"` - // Password for decrypting tls_cert. - TlsKey string `protobuf:"bytes,10,opt,name=tls_key,json=tlsKey,proto3" json:"tls_key,omitempty"` - // Disable parsing comments from queries and showing them in QAN. - DisableCommentsParsing bool `protobuf:"varint,11,opt,name=disable_comments_parsing,json=disableCommentsParsing,proto3" json:"disable_comments_parsing,omitempty"` - // Limit query length in QAN (default: server-defined; -1: no limit) - MaxQueryLength int32 `protobuf:"varint,12,opt,name=max_query_length,json=maxQueryLength,proto3" json:"max_query_length,omitempty"` - // True if query examples are disabled. - QueryExamplesDisabled bool `protobuf:"varint,13,opt,name=query_examples_disabled,json=queryExamplesDisabled,proto3" json:"query_examples_disabled,omitempty"` - // Slowlog file is rotated at this size if > 0. - MaxSlowlogFileSize int64 `protobuf:"varint,14,opt,name=max_slowlog_file_size,json=maxSlowlogFileSize,proto3" json:"max_slowlog_file_size,omitempty"` - // Custom user-assigned labels. - CustomLabels map[string]string `protobuf:"bytes,15,rep,name=custom_labels,json=customLabels,proto3" json:"custom_labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - // Actual Agent status. - Status AgentStatus `protobuf:"varint,20,opt,name=status,proto3,enum=inventory.v1.AgentStatus" json:"status,omitempty"` - // mod tidy - ProcessExecPath string `protobuf:"bytes,21,opt,name=process_exec_path,json=processExecPath,proto3" json:"process_exec_path,omitempty"` - // Log level for exporter. - LogLevel LogLevel `protobuf:"varint,22,opt,name=log_level,json=logLevel,proto3,enum=inventory.v1.LogLevel" json:"log_level,omitempty"` - // Extra DSN parameters for MySQL connection. - ExtraDsnParams map[string]string `protobuf:"bytes,23,rep,name=extra_dsn_params,json=extraDsnParams,proto3" json:"extra_dsn_params,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *QANMySQLSlowlogAgent) Reset() { - *x = QANMySQLSlowlogAgent{} - mi := &file_inventory_v1_agents_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *QANMySQLSlowlogAgent) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*QANMySQLSlowlogAgent) ProtoMessage() {} - -func (x *QANMySQLSlowlogAgent) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_agents_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 QANMySQLSlowlogAgent.ProtoReflect.Descriptor instead. -func (*QANMySQLSlowlogAgent) Descriptor() ([]byte, []int) { - return file_inventory_v1_agents_proto_rawDescGZIP(), []int{10} -} - -func (x *QANMySQLSlowlogAgent) GetAgentId() string { - if x != nil { - return x.AgentId - } - return "" -} - -func (x *QANMySQLSlowlogAgent) GetPmmAgentId() string { - if x != nil { - return x.PmmAgentId - } - return "" -} - -func (x *QANMySQLSlowlogAgent) GetDisabled() bool { - if x != nil { - return x.Disabled - } - return false -} - -func (x *QANMySQLSlowlogAgent) GetServiceId() string { - if x != nil { - return x.ServiceId - } - return "" -} - -func (x *QANMySQLSlowlogAgent) GetUsername() string { - if x != nil { - return x.Username - } - return "" -} - -func (x *QANMySQLSlowlogAgent) GetTls() bool { - if x != nil { - return x.Tls - } - return false -} - -func (x *QANMySQLSlowlogAgent) GetTlsSkipVerify() bool { - if x != nil { - return x.TlsSkipVerify - } - return false -} - -func (x *QANMySQLSlowlogAgent) GetTlsCa() string { - if x != nil { - return x.TlsCa - } - return "" -} - -func (x *QANMySQLSlowlogAgent) GetTlsCert() string { - if x != nil { - return x.TlsCert - } - return "" -} - -func (x *QANMySQLSlowlogAgent) GetTlsKey() string { - if x != nil { - return x.TlsKey - } - return "" -} - -func (x *QANMySQLSlowlogAgent) GetDisableCommentsParsing() bool { - if x != nil { - return x.DisableCommentsParsing - } - return false -} - -func (x *QANMySQLSlowlogAgent) GetMaxQueryLength() int32 { - if x != nil { - return x.MaxQueryLength - } - return 0 -} - -func (x *QANMySQLSlowlogAgent) GetQueryExamplesDisabled() bool { - if x != nil { - return x.QueryExamplesDisabled - } - return false -} - -func (x *QANMySQLSlowlogAgent) GetMaxSlowlogFileSize() int64 { - if x != nil { - return x.MaxSlowlogFileSize - } - return 0 -} - -func (x *QANMySQLSlowlogAgent) GetCustomLabels() map[string]string { - if x != nil { - return x.CustomLabels - } - return nil -} - -func (x *QANMySQLSlowlogAgent) GetStatus() AgentStatus { - if x != nil { - return x.Status - } - return AgentStatus_AGENT_STATUS_UNSPECIFIED -} - -func (x *QANMySQLSlowlogAgent) GetProcessExecPath() string { - if x != nil { - return x.ProcessExecPath - } - return "" -} - -func (x *QANMySQLSlowlogAgent) GetLogLevel() LogLevel { - if x != nil { - return x.LogLevel - } - return LogLevel_LOG_LEVEL_UNSPECIFIED -} - -func (x *QANMySQLSlowlogAgent) GetExtraDsnParams() map[string]string { - if x != nil { - return x.ExtraDsnParams - } - return nil -} - -// QANMongoDBProfilerAgent runs within pmm-agent and sends MongoDB Query Analytics data to the PMM Server. -type QANMongoDBProfilerAgent struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Unique randomly generated instance identifier. - AgentId string `protobuf:"bytes,1,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"` - // The pmm-agent identifier which runs this instance. - PmmAgentId string `protobuf:"bytes,2,opt,name=pmm_agent_id,json=pmmAgentId,proto3" json:"pmm_agent_id,omitempty"` - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `protobuf:"varint,3,opt,name=disabled,proto3" json:"disabled,omitempty"` - // Service identifier. - ServiceId string `protobuf:"bytes,4,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` - // MongoDB username for getting profiler data. - Username string `protobuf:"bytes,5,opt,name=username,proto3" json:"username,omitempty"` - // Use TLS for database connections. - Tls bool `protobuf:"varint,6,opt,name=tls,proto3" json:"tls,omitempty"` - // Skip TLS certificate and hostname validation. - TlsSkipVerify bool `protobuf:"varint,7,opt,name=tls_skip_verify,json=tlsSkipVerify,proto3" json:"tls_skip_verify,omitempty"` - // Limit query length in QAN (default: server-defined; -1: no limit). - MaxQueryLength int32 `protobuf:"varint,9,opt,name=max_query_length,json=maxQueryLength,proto3" json:"max_query_length,omitempty"` - // Custom user-assigned labels. - CustomLabels map[string]string `protobuf:"bytes,10,rep,name=custom_labels,json=customLabels,proto3" json:"custom_labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - // Actual Agent status. - Status AgentStatus `protobuf:"varint,20,opt,name=status,proto3,enum=inventory.v1.AgentStatus" json:"status,omitempty"` - // Path to exec process. - ProcessExecPath string `protobuf:"bytes,21,opt,name=process_exec_path,json=processExecPath,proto3" json:"process_exec_path,omitempty"` - // Log level for exporter. - LogLevel LogLevel `protobuf:"varint,22,opt,name=log_level,json=logLevel,proto3,enum=inventory.v1.LogLevel" json:"log_level,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *QANMongoDBProfilerAgent) Reset() { - *x = QANMongoDBProfilerAgent{} - mi := &file_inventory_v1_agents_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *QANMongoDBProfilerAgent) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*QANMongoDBProfilerAgent) ProtoMessage() {} - -func (x *QANMongoDBProfilerAgent) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_agents_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 QANMongoDBProfilerAgent.ProtoReflect.Descriptor instead. -func (*QANMongoDBProfilerAgent) Descriptor() ([]byte, []int) { - return file_inventory_v1_agents_proto_rawDescGZIP(), []int{11} -} - -func (x *QANMongoDBProfilerAgent) GetAgentId() string { - if x != nil { - return x.AgentId - } - return "" -} - -func (x *QANMongoDBProfilerAgent) GetPmmAgentId() string { - if x != nil { - return x.PmmAgentId - } - return "" -} - -func (x *QANMongoDBProfilerAgent) GetDisabled() bool { - if x != nil { - return x.Disabled - } - return false -} - -func (x *QANMongoDBProfilerAgent) GetServiceId() string { - if x != nil { - return x.ServiceId - } - return "" -} - -func (x *QANMongoDBProfilerAgent) GetUsername() string { - if x != nil { - return x.Username - } - return "" -} - -func (x *QANMongoDBProfilerAgent) GetTls() bool { - if x != nil { - return x.Tls - } - return false -} - -func (x *QANMongoDBProfilerAgent) GetTlsSkipVerify() bool { - if x != nil { - return x.TlsSkipVerify - } - return false -} - -func (x *QANMongoDBProfilerAgent) GetMaxQueryLength() int32 { - if x != nil { - return x.MaxQueryLength - } - return 0 -} - -func (x *QANMongoDBProfilerAgent) GetCustomLabels() map[string]string { - if x != nil { - return x.CustomLabels - } - return nil -} - -func (x *QANMongoDBProfilerAgent) GetStatus() AgentStatus { - if x != nil { - return x.Status - } - return AgentStatus_AGENT_STATUS_UNSPECIFIED -} - -func (x *QANMongoDBProfilerAgent) GetProcessExecPath() string { - if x != nil { - return x.ProcessExecPath - } - return "" -} - -func (x *QANMongoDBProfilerAgent) GetLogLevel() LogLevel { - if x != nil { - return x.LogLevel - } - return LogLevel_LOG_LEVEL_UNSPECIFIED -} - -// QANMongoDBMongologAgent runs within pmm-agent and sends MongoDB Query Analytics data to the PMM Server. -type QANMongoDBMongologAgent struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Unique randomly generated instance identifier. - AgentId string `protobuf:"bytes,1,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"` - // The pmm-agent identifier which runs this instance. - PmmAgentId string `protobuf:"bytes,2,opt,name=pmm_agent_id,json=pmmAgentId,proto3" json:"pmm_agent_id,omitempty"` - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `protobuf:"varint,3,opt,name=disabled,proto3" json:"disabled,omitempty"` - // Service identifier. - ServiceId string `protobuf:"bytes,4,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` - // MongoDB username for getting profiler data. - Username string `protobuf:"bytes,5,opt,name=username,proto3" json:"username,omitempty"` - // Use TLS for database connections. - Tls bool `protobuf:"varint,6,opt,name=tls,proto3" json:"tls,omitempty"` - // Skip TLS certificate and hostname validation. - TlsSkipVerify bool `protobuf:"varint,7,opt,name=tls_skip_verify,json=tlsSkipVerify,proto3" json:"tls_skip_verify,omitempty"` - // Limit query length in QAN (default: server-defined; -1: no limit). - MaxQueryLength int32 `protobuf:"varint,9,opt,name=max_query_length,json=maxQueryLength,proto3" json:"max_query_length,omitempty"` - // Custom user-assigned labels. - CustomLabels map[string]string `protobuf:"bytes,10,rep,name=custom_labels,json=customLabels,proto3" json:"custom_labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - // Actual Agent status. - Status AgentStatus `protobuf:"varint,20,opt,name=status,proto3,enum=inventory.v1.AgentStatus" json:"status,omitempty"` - // Path to exec process. - ProcessExecPath string `protobuf:"bytes,21,opt,name=process_exec_path,json=processExecPath,proto3" json:"process_exec_path,omitempty"` - // Log level for exporter. - LogLevel LogLevel `protobuf:"varint,22,opt,name=log_level,json=logLevel,proto3,enum=inventory.v1.LogLevel" json:"log_level,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *QANMongoDBMongologAgent) Reset() { - *x = QANMongoDBMongologAgent{} - mi := &file_inventory_v1_agents_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *QANMongoDBMongologAgent) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*QANMongoDBMongologAgent) ProtoMessage() {} - -func (x *QANMongoDBMongologAgent) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_agents_proto_msgTypes[12] - 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 QANMongoDBMongologAgent.ProtoReflect.Descriptor instead. -func (*QANMongoDBMongologAgent) Descriptor() ([]byte, []int) { - return file_inventory_v1_agents_proto_rawDescGZIP(), []int{12} -} - -func (x *QANMongoDBMongologAgent) GetAgentId() string { - if x != nil { - return x.AgentId - } - return "" -} - -func (x *QANMongoDBMongologAgent) GetPmmAgentId() string { - if x != nil { - return x.PmmAgentId - } - return "" -} - -func (x *QANMongoDBMongologAgent) GetDisabled() bool { - if x != nil { - return x.Disabled - } - return false -} - -func (x *QANMongoDBMongologAgent) GetServiceId() string { - if x != nil { - return x.ServiceId - } - return "" -} - -func (x *QANMongoDBMongologAgent) GetUsername() string { - if x != nil { - return x.Username - } - return "" -} - -func (x *QANMongoDBMongologAgent) GetTls() bool { - if x != nil { - return x.Tls - } - return false -} - -func (x *QANMongoDBMongologAgent) GetTlsSkipVerify() bool { - if x != nil { - return x.TlsSkipVerify - } - return false -} - -func (x *QANMongoDBMongologAgent) GetMaxQueryLength() int32 { - if x != nil { - return x.MaxQueryLength - } - return 0 -} - -func (x *QANMongoDBMongologAgent) GetCustomLabels() map[string]string { - if x != nil { - return x.CustomLabels - } - return nil -} - -func (x *QANMongoDBMongologAgent) GetStatus() AgentStatus { - if x != nil { - return x.Status - } - return AgentStatus_AGENT_STATUS_UNSPECIFIED -} - -func (x *QANMongoDBMongologAgent) GetProcessExecPath() string { - if x != nil { - return x.ProcessExecPath - } - return "" -} - -func (x *QANMongoDBMongologAgent) GetLogLevel() LogLevel { - if x != nil { - return x.LogLevel - } - return LogLevel_LOG_LEVEL_UNSPECIFIED -} - -// QANPostgreSQLPgStatementsAgent runs within pmm-agent and sends PostgreSQL Query Analytics data to the PMM Server. -type QANPostgreSQLPgStatementsAgent struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Unique randomly generated instance identifier. - AgentId string `protobuf:"bytes,1,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"` - // The pmm-agent identifier which runs this instance. - PmmAgentId string `protobuf:"bytes,2,opt,name=pmm_agent_id,json=pmmAgentId,proto3" json:"pmm_agent_id,omitempty"` - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `protobuf:"varint,3,opt,name=disabled,proto3" json:"disabled,omitempty"` - // Service identifier. - ServiceId string `protobuf:"bytes,4,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` - // PostgreSQL username for getting pg stat statements data. - Username string `protobuf:"bytes,5,opt,name=username,proto3" json:"username,omitempty"` - // Disable parsing comments from queries and showing them in QAN. - DisableCommentsParsing bool `protobuf:"varint,6,opt,name=disable_comments_parsing,json=disableCommentsParsing,proto3" json:"disable_comments_parsing,omitempty"` - // Limit query length in QAN (default: server-defined; -1: no limit). - MaxQueryLength int32 `protobuf:"varint,7,opt,name=max_query_length,json=maxQueryLength,proto3" json:"max_query_length,omitempty"` - // Use TLS for database connections. - Tls bool `protobuf:"varint,8,opt,name=tls,proto3" json:"tls,omitempty"` - // Skip TLS certificate and hostname validation. - TlsSkipVerify bool `protobuf:"varint,9,opt,name=tls_skip_verify,json=tlsSkipVerify,proto3" json:"tls_skip_verify,omitempty"` - // Custom user-assigned labels. - CustomLabels map[string]string `protobuf:"bytes,10,rep,name=custom_labels,json=customLabels,proto3" json:"custom_labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - // Actual Agent status. - Status AgentStatus `protobuf:"varint,20,opt,name=status,proto3,enum=inventory.v1.AgentStatus" json:"status,omitempty"` - // Path to exec process. - ProcessExecPath string `protobuf:"bytes,21,opt,name=process_exec_path,json=processExecPath,proto3" json:"process_exec_path,omitempty"` - // Log level for exporter. - LogLevel LogLevel `protobuf:"varint,22,opt,name=log_level,json=logLevel,proto3,enum=inventory.v1.LogLevel" json:"log_level,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *QANPostgreSQLPgStatementsAgent) Reset() { - *x = QANPostgreSQLPgStatementsAgent{} - mi := &file_inventory_v1_agents_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *QANPostgreSQLPgStatementsAgent) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*QANPostgreSQLPgStatementsAgent) ProtoMessage() {} - -func (x *QANPostgreSQLPgStatementsAgent) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_agents_proto_msgTypes[13] - 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 QANPostgreSQLPgStatementsAgent.ProtoReflect.Descriptor instead. -func (*QANPostgreSQLPgStatementsAgent) Descriptor() ([]byte, []int) { - return file_inventory_v1_agents_proto_rawDescGZIP(), []int{13} -} - -func (x *QANPostgreSQLPgStatementsAgent) GetAgentId() string { - if x != nil { - return x.AgentId - } - return "" -} - -func (x *QANPostgreSQLPgStatementsAgent) GetPmmAgentId() string { - if x != nil { - return x.PmmAgentId - } - return "" -} - -func (x *QANPostgreSQLPgStatementsAgent) GetDisabled() bool { - if x != nil { - return x.Disabled - } - return false -} - -func (x *QANPostgreSQLPgStatementsAgent) GetServiceId() string { - if x != nil { - return x.ServiceId - } - return "" -} - -func (x *QANPostgreSQLPgStatementsAgent) GetUsername() string { - if x != nil { - return x.Username - } - return "" -} - -func (x *QANPostgreSQLPgStatementsAgent) GetDisableCommentsParsing() bool { - if x != nil { - return x.DisableCommentsParsing - } - return false -} - -func (x *QANPostgreSQLPgStatementsAgent) GetMaxQueryLength() int32 { - if x != nil { - return x.MaxQueryLength - } - return 0 -} - -func (x *QANPostgreSQLPgStatementsAgent) GetTls() bool { - if x != nil { - return x.Tls - } - return false -} - -func (x *QANPostgreSQLPgStatementsAgent) GetTlsSkipVerify() bool { - if x != nil { - return x.TlsSkipVerify - } - return false -} - -func (x *QANPostgreSQLPgStatementsAgent) GetCustomLabels() map[string]string { - if x != nil { - return x.CustomLabels - } - return nil -} - -func (x *QANPostgreSQLPgStatementsAgent) GetStatus() AgentStatus { - if x != nil { - return x.Status - } - return AgentStatus_AGENT_STATUS_UNSPECIFIED -} - -func (x *QANPostgreSQLPgStatementsAgent) GetProcessExecPath() string { - if x != nil { - return x.ProcessExecPath - } - return "" -} - -func (x *QANPostgreSQLPgStatementsAgent) GetLogLevel() LogLevel { - if x != nil { - return x.LogLevel - } - return LogLevel_LOG_LEVEL_UNSPECIFIED -} - -// QANPostgreSQLPgStatMonitorAgent runs within pmm-agent and sends PostgreSQL Query Analytics data to the PMM Server. -type QANPostgreSQLPgStatMonitorAgent struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Unique randomly generated instance identifier. - AgentId string `protobuf:"bytes,1,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"` - // The pmm-agent identifier which runs this instance. - PmmAgentId string `protobuf:"bytes,2,opt,name=pmm_agent_id,json=pmmAgentId,proto3" json:"pmm_agent_id,omitempty"` - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `protobuf:"varint,3,opt,name=disabled,proto3" json:"disabled,omitempty"` - // Service identifier. - ServiceId string `protobuf:"bytes,4,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` - // PostgreSQL username for getting pg stat monitor data. - Username string `protobuf:"bytes,5,opt,name=username,proto3" json:"username,omitempty"` - // Use TLS for database connections. - Tls bool `protobuf:"varint,6,opt,name=tls,proto3" json:"tls,omitempty"` - // Skip TLS certificate and hostname validation. - TlsSkipVerify bool `protobuf:"varint,7,opt,name=tls_skip_verify,json=tlsSkipVerify,proto3" json:"tls_skip_verify,omitempty"` - // Disable parsing comments from queries and showing them in QAN. - DisableCommentsParsing bool `protobuf:"varint,8,opt,name=disable_comments_parsing,json=disableCommentsParsing,proto3" json:"disable_comments_parsing,omitempty"` - // Limit query length in QAN (default: server-defined; -1: no limit). - MaxQueryLength int32 `protobuf:"varint,9,opt,name=max_query_length,json=maxQueryLength,proto3" json:"max_query_length,omitempty"` - // True if query examples are disabled. - QueryExamplesDisabled bool `protobuf:"varint,10,opt,name=query_examples_disabled,json=queryExamplesDisabled,proto3" json:"query_examples_disabled,omitempty"` - // Custom user-assigned labels. - CustomLabels map[string]string `protobuf:"bytes,11,rep,name=custom_labels,json=customLabels,proto3" json:"custom_labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - // Actual Agent status. - Status AgentStatus `protobuf:"varint,20,opt,name=status,proto3,enum=inventory.v1.AgentStatus" json:"status,omitempty"` - // Path to exec process. - ProcessExecPath string `protobuf:"bytes,21,opt,name=process_exec_path,json=processExecPath,proto3" json:"process_exec_path,omitempty"` - // Log level for exporter. - LogLevel LogLevel `protobuf:"varint,22,opt,name=log_level,json=logLevel,proto3,enum=inventory.v1.LogLevel" json:"log_level,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *QANPostgreSQLPgStatMonitorAgent) Reset() { - *x = QANPostgreSQLPgStatMonitorAgent{} - mi := &file_inventory_v1_agents_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *QANPostgreSQLPgStatMonitorAgent) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*QANPostgreSQLPgStatMonitorAgent) ProtoMessage() {} - -func (x *QANPostgreSQLPgStatMonitorAgent) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_agents_proto_msgTypes[14] - 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 QANPostgreSQLPgStatMonitorAgent.ProtoReflect.Descriptor instead. -func (*QANPostgreSQLPgStatMonitorAgent) Descriptor() ([]byte, []int) { - return file_inventory_v1_agents_proto_rawDescGZIP(), []int{14} -} - -func (x *QANPostgreSQLPgStatMonitorAgent) GetAgentId() string { - if x != nil { - return x.AgentId - } - return "" -} - -func (x *QANPostgreSQLPgStatMonitorAgent) GetPmmAgentId() string { - if x != nil { - return x.PmmAgentId - } - return "" -} - -func (x *QANPostgreSQLPgStatMonitorAgent) GetDisabled() bool { - if x != nil { - return x.Disabled - } - return false -} - -func (x *QANPostgreSQLPgStatMonitorAgent) GetServiceId() string { - if x != nil { - return x.ServiceId - } - return "" -} - -func (x *QANPostgreSQLPgStatMonitorAgent) GetUsername() string { - if x != nil { - return x.Username - } - return "" -} - -func (x *QANPostgreSQLPgStatMonitorAgent) GetTls() bool { - if x != nil { - return x.Tls - } - return false -} - -func (x *QANPostgreSQLPgStatMonitorAgent) GetTlsSkipVerify() bool { - if x != nil { - return x.TlsSkipVerify - } - return false -} - -func (x *QANPostgreSQLPgStatMonitorAgent) GetDisableCommentsParsing() bool { - if x != nil { - return x.DisableCommentsParsing - } - return false -} - -func (x *QANPostgreSQLPgStatMonitorAgent) GetMaxQueryLength() int32 { - if x != nil { - return x.MaxQueryLength - } - return 0 -} - -func (x *QANPostgreSQLPgStatMonitorAgent) GetQueryExamplesDisabled() bool { - if x != nil { - return x.QueryExamplesDisabled - } - return false -} - -func (x *QANPostgreSQLPgStatMonitorAgent) GetCustomLabels() map[string]string { - if x != nil { - return x.CustomLabels - } - return nil -} - -func (x *QANPostgreSQLPgStatMonitorAgent) GetStatus() AgentStatus { - if x != nil { - return x.Status - } - return AgentStatus_AGENT_STATUS_UNSPECIFIED -} - -func (x *QANPostgreSQLPgStatMonitorAgent) GetProcessExecPath() string { - if x != nil { - return x.ProcessExecPath - } - return "" -} - -func (x *QANPostgreSQLPgStatMonitorAgent) GetLogLevel() LogLevel { - if x != nil { - return x.LogLevel - } - return LogLevel_LOG_LEVEL_UNSPECIFIED -} - -// RDSExporter runs on Generic or Container Node and exposes RemoteRDS Node metrics. -type RDSExporter struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Unique randomly generated instance identifier. - AgentId string `protobuf:"bytes,1,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"` - // The pmm-agent identifier which runs this instance. - PmmAgentId string `protobuf:"bytes,2,opt,name=pmm_agent_id,json=pmmAgentId,proto3" json:"pmm_agent_id,omitempty"` - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `protobuf:"varint,3,opt,name=disabled,proto3" json:"disabled,omitempty"` - // Node identifier. - NodeId string `protobuf:"bytes,4,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` - // AWS Access Key. - AwsAccessKey string `protobuf:"bytes,5,opt,name=aws_access_key,json=awsAccessKey,proto3" json:"aws_access_key,omitempty"` - // Custom user-assigned labels. - CustomLabels map[string]string `protobuf:"bytes,6,rep,name=custom_labels,json=customLabels,proto3" json:"custom_labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - // Actual Agent status (the same for several configurations). - Status AgentStatus `protobuf:"varint,10,opt,name=status,proto3,enum=inventory.v1.AgentStatus" json:"status,omitempty"` - // Listen port for scraping metrics (the same for several configurations). - ListenPort uint32 `protobuf:"varint,11,opt,name=listen_port,json=listenPort,proto3" json:"listen_port,omitempty"` - // Basic metrics are disabled. - BasicMetricsDisabled bool `protobuf:"varint,20,opt,name=basic_metrics_disabled,json=basicMetricsDisabled,proto3" json:"basic_metrics_disabled,omitempty"` - // Enhanced metrics are disabled. - EnhancedMetricsDisabled bool `protobuf:"varint,21,opt,name=enhanced_metrics_disabled,json=enhancedMetricsDisabled,proto3" json:"enhanced_metrics_disabled,omitempty"` - // True if exporter uses push metrics mode. - PushMetricsEnabled bool `protobuf:"varint,22,opt,name=push_metrics_enabled,json=pushMetricsEnabled,proto3" json:"push_metrics_enabled,omitempty"` - // Path to exec process. - ProcessExecPath string `protobuf:"bytes,23,opt,name=process_exec_path,json=processExecPath,proto3" json:"process_exec_path,omitempty"` - // Log level for exporter. - LogLevel LogLevel `protobuf:"varint,24,opt,name=log_level,json=logLevel,proto3,enum=inventory.v1.LogLevel" json:"log_level,omitempty"` - // Limit of databases for auto-discovery. - AutoDiscoveryLimit int32 `protobuf:"varint,25,opt,name=auto_discovery_limit,json=autoDiscoveryLimit,proto3" json:"auto_discovery_limit,omitempty"` - // Metrics resolution for this agent. - MetricsResolutions *common.MetricsResolutions `protobuf:"bytes,26,opt,name=metrics_resolutions,json=metricsResolutions,proto3" json:"metrics_resolutions,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *RDSExporter) Reset() { - *x = RDSExporter{} - mi := &file_inventory_v1_agents_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *RDSExporter) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RDSExporter) ProtoMessage() {} - -func (x *RDSExporter) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_agents_proto_msgTypes[15] - 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 RDSExporter.ProtoReflect.Descriptor instead. -func (*RDSExporter) Descriptor() ([]byte, []int) { - return file_inventory_v1_agents_proto_rawDescGZIP(), []int{15} -} - -func (x *RDSExporter) GetAgentId() string { - if x != nil { - return x.AgentId - } - return "" -} - -func (x *RDSExporter) GetPmmAgentId() string { - if x != nil { - return x.PmmAgentId - } - return "" -} - -func (x *RDSExporter) GetDisabled() bool { - if x != nil { - return x.Disabled - } - return false -} - -func (x *RDSExporter) GetNodeId() string { - if x != nil { - return x.NodeId - } - return "" -} - -func (x *RDSExporter) GetAwsAccessKey() string { - if x != nil { - return x.AwsAccessKey - } - return "" -} - -func (x *RDSExporter) GetCustomLabels() map[string]string { - if x != nil { - return x.CustomLabels - } - return nil -} - -func (x *RDSExporter) GetStatus() AgentStatus { - if x != nil { - return x.Status - } - return AgentStatus_AGENT_STATUS_UNSPECIFIED -} - -func (x *RDSExporter) GetListenPort() uint32 { - if x != nil { - return x.ListenPort - } - return 0 -} - -func (x *RDSExporter) GetBasicMetricsDisabled() bool { - if x != nil { - return x.BasicMetricsDisabled - } - return false -} - -func (x *RDSExporter) GetEnhancedMetricsDisabled() bool { - if x != nil { - return x.EnhancedMetricsDisabled - } - return false -} - -func (x *RDSExporter) GetPushMetricsEnabled() bool { - if x != nil { - return x.PushMetricsEnabled - } - return false -} - -func (x *RDSExporter) GetProcessExecPath() string { - if x != nil { - return x.ProcessExecPath - } - return "" -} - -func (x *RDSExporter) GetLogLevel() LogLevel { - if x != nil { - return x.LogLevel - } - return LogLevel_LOG_LEVEL_UNSPECIFIED -} - -func (x *RDSExporter) GetAutoDiscoveryLimit() int32 { - if x != nil { - return x.AutoDiscoveryLimit - } - return 0 -} - -func (x *RDSExporter) GetMetricsResolutions() *common.MetricsResolutions { - if x != nil { - return x.MetricsResolutions - } - return nil -} - -// ExternalExporter runs on any Node type, including Remote Node. -type ExternalExporter struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Unique randomly generated instance identifier. - AgentId string `protobuf:"bytes,1,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"` - // Node identifier where this instance runs. - RunsOnNodeId string `protobuf:"bytes,2,opt,name=runs_on_node_id,json=runsOnNodeId,proto3" json:"runs_on_node_id,omitempty"` - // If disabled, metrics from this exporter will not be collected. - Disabled bool `protobuf:"varint,3,opt,name=disabled,proto3" json:"disabled,omitempty"` - // Service identifier. - ServiceId string `protobuf:"bytes,4,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` - // HTTP basic auth username for collecting metrics. - Username string `protobuf:"bytes,5,opt,name=username,proto3" json:"username,omitempty"` - // Scheme to generate URI to exporter metrics endpoints. - Scheme string `protobuf:"bytes,6,opt,name=scheme,proto3" json:"scheme,omitempty"` - // Path under which metrics are exposed, used to generate URI. - MetricsPath string `protobuf:"bytes,7,opt,name=metrics_path,json=metricsPath,proto3" json:"metrics_path,omitempty"` - // Custom user-assigned labels. - CustomLabels map[string]string `protobuf:"bytes,8,rep,name=custom_labels,json=customLabels,proto3" json:"custom_labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - // Listen port for scraping metrics. - ListenPort uint32 `protobuf:"varint,9,opt,name=listen_port,json=listenPort,proto3" json:"listen_port,omitempty"` - // True if exporter uses push metrics mode. - PushMetricsEnabled bool `protobuf:"varint,10,opt,name=push_metrics_enabled,json=pushMetricsEnabled,proto3" json:"push_metrics_enabled,omitempty"` - // Path to exec process. - ProcessExecPath string `protobuf:"bytes,11,opt,name=process_exec_path,json=processExecPath,proto3" json:"process_exec_path,omitempty"` - // Metrics resolution for this agent. - MetricsResolutions *common.MetricsResolutions `protobuf:"bytes,12,opt,name=metrics_resolutions,json=metricsResolutions,proto3" json:"metrics_resolutions,omitempty"` - // Skip TLS certificate and hostname verification. - TlsSkipVerify bool `protobuf:"varint,13,opt,name=tls_skip_verify,json=tlsSkipVerify,proto3" json:"tls_skip_verify,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ExternalExporter) Reset() { - *x = ExternalExporter{} - mi := &file_inventory_v1_agents_proto_msgTypes[16] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ExternalExporter) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ExternalExporter) ProtoMessage() {} - -func (x *ExternalExporter) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_agents_proto_msgTypes[16] - 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 ExternalExporter.ProtoReflect.Descriptor instead. -func (*ExternalExporter) Descriptor() ([]byte, []int) { - return file_inventory_v1_agents_proto_rawDescGZIP(), []int{16} -} - -func (x *ExternalExporter) GetAgentId() string { - if x != nil { - return x.AgentId - } - return "" -} - -func (x *ExternalExporter) GetRunsOnNodeId() string { - if x != nil { - return x.RunsOnNodeId - } - return "" -} - -func (x *ExternalExporter) GetDisabled() bool { - if x != nil { - return x.Disabled - } - return false -} - -func (x *ExternalExporter) GetServiceId() string { - if x != nil { - return x.ServiceId - } - return "" -} - -func (x *ExternalExporter) GetUsername() string { - if x != nil { - return x.Username - } - return "" -} - -func (x *ExternalExporter) GetScheme() string { - if x != nil { - return x.Scheme - } - return "" -} - -func (x *ExternalExporter) GetMetricsPath() string { - if x != nil { - return x.MetricsPath - } - return "" -} - -func (x *ExternalExporter) GetCustomLabels() map[string]string { - if x != nil { - return x.CustomLabels - } - return nil -} - -func (x *ExternalExporter) GetListenPort() uint32 { - if x != nil { - return x.ListenPort - } - return 0 -} - -func (x *ExternalExporter) GetPushMetricsEnabled() bool { - if x != nil { - return x.PushMetricsEnabled - } - return false -} - -func (x *ExternalExporter) GetProcessExecPath() string { - if x != nil { - return x.ProcessExecPath - } - return "" -} - -func (x *ExternalExporter) GetMetricsResolutions() *common.MetricsResolutions { - if x != nil { - return x.MetricsResolutions - } - return nil -} - -func (x *ExternalExporter) GetTlsSkipVerify() bool { - if x != nil { - return x.TlsSkipVerify - } - return false -} - -// AzureDatabaseExporter runs on Generic or Container Node and exposes RemoteAzure Node metrics. -type AzureDatabaseExporter struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Unique randomly generated instance identifier. - AgentId string `protobuf:"bytes,1,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"` - // The pmm-agent identifier which runs this instance. - PmmAgentId string `protobuf:"bytes,2,opt,name=pmm_agent_id,json=pmmAgentId,proto3" json:"pmm_agent_id,omitempty"` - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `protobuf:"varint,3,opt,name=disabled,proto3" json:"disabled,omitempty"` - // Node identifier. - NodeId string `protobuf:"bytes,4,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` - // Azure database subscription ID. - AzureDatabaseSubscriptionId string `protobuf:"bytes,5,opt,name=azure_database_subscription_id,json=azureDatabaseSubscriptionId,proto3" json:"azure_database_subscription_id,omitempty"` - // Azure database resource type (mysql, maria, postgres) - AzureDatabaseResourceType string `protobuf:"bytes,6,opt,name=azure_database_resource_type,json=azureDatabaseResourceType,proto3" json:"azure_database_resource_type,omitempty"` - // Custom user-assigned labels. - CustomLabels map[string]string `protobuf:"bytes,7,rep,name=custom_labels,json=customLabels,proto3" json:"custom_labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - // Actual Agent status (the same for several configurations). - Status AgentStatus `protobuf:"varint,10,opt,name=status,proto3,enum=inventory.v1.AgentStatus" json:"status,omitempty"` - // Listen port for scraping metrics (the same for several configurations). - ListenPort uint32 `protobuf:"varint,11,opt,name=listen_port,json=listenPort,proto3" json:"listen_port,omitempty"` - // True if the exporter operates in push metrics mode. - PushMetricsEnabled bool `protobuf:"varint,12,opt,name=push_metrics_enabled,json=pushMetricsEnabled,proto3" json:"push_metrics_enabled,omitempty"` - // Path to exec process. - ProcessExecPath string `protobuf:"bytes,13,opt,name=process_exec_path,json=processExecPath,proto3" json:"process_exec_path,omitempty"` - // Log level for exporter. - LogLevel LogLevel `protobuf:"varint,14,opt,name=log_level,json=logLevel,proto3,enum=inventory.v1.LogLevel" json:"log_level,omitempty"` - // Metrics resolution for this agent. - MetricsResolutions *common.MetricsResolutions `protobuf:"bytes,15,opt,name=metrics_resolutions,json=metricsResolutions,proto3" json:"metrics_resolutions,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AzureDatabaseExporter) Reset() { - *x = AzureDatabaseExporter{} - mi := &file_inventory_v1_agents_proto_msgTypes[17] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AzureDatabaseExporter) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AzureDatabaseExporter) ProtoMessage() {} - -func (x *AzureDatabaseExporter) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_agents_proto_msgTypes[17] - 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 AzureDatabaseExporter.ProtoReflect.Descriptor instead. -func (*AzureDatabaseExporter) Descriptor() ([]byte, []int) { - return file_inventory_v1_agents_proto_rawDescGZIP(), []int{17} -} - -func (x *AzureDatabaseExporter) GetAgentId() string { - if x != nil { - return x.AgentId - } - return "" -} - -func (x *AzureDatabaseExporter) GetPmmAgentId() string { - if x != nil { - return x.PmmAgentId - } - return "" -} - -func (x *AzureDatabaseExporter) GetDisabled() bool { - if x != nil { - return x.Disabled - } - return false -} - -func (x *AzureDatabaseExporter) GetNodeId() string { - if x != nil { - return x.NodeId - } - return "" -} - -func (x *AzureDatabaseExporter) GetAzureDatabaseSubscriptionId() string { - if x != nil { - return x.AzureDatabaseSubscriptionId - } - return "" -} - -func (x *AzureDatabaseExporter) GetAzureDatabaseResourceType() string { - if x != nil { - return x.AzureDatabaseResourceType - } - return "" -} - -func (x *AzureDatabaseExporter) GetCustomLabels() map[string]string { - if x != nil { - return x.CustomLabels - } - return nil -} - -func (x *AzureDatabaseExporter) GetStatus() AgentStatus { - if x != nil { - return x.Status - } - return AgentStatus_AGENT_STATUS_UNSPECIFIED -} - -func (x *AzureDatabaseExporter) GetListenPort() uint32 { - if x != nil { - return x.ListenPort - } - return 0 -} - -func (x *AzureDatabaseExporter) GetPushMetricsEnabled() bool { - if x != nil { - return x.PushMetricsEnabled - } - return false -} - -func (x *AzureDatabaseExporter) GetProcessExecPath() string { - if x != nil { - return x.ProcessExecPath - } - return "" -} - -func (x *AzureDatabaseExporter) GetLogLevel() LogLevel { - if x != nil { - return x.LogLevel - } - return LogLevel_LOG_LEVEL_UNSPECIFIED -} - -func (x *AzureDatabaseExporter) GetMetricsResolutions() *common.MetricsResolutions { - if x != nil { - return x.MetricsResolutions - } - return nil -} - -// ChangeCommonAgentParams contains parameters that can be changed for all Agents. -type ChangeCommonAgentParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Enable this Agent. Agents are enabled by default when they get added. - Enable *bool `protobuf:"varint,1,opt,name=enable,proto3,oneof" json:"enable,omitempty"` - // Replace all custom user-assigned labels. - CustomLabels *common.StringMap `protobuf:"bytes,2,opt,name=custom_labels,json=customLabels,proto3,oneof" json:"custom_labels,omitempty"` - // Enables push metrics with vmagent. - EnablePushMetrics *bool `protobuf:"varint,3,opt,name=enable_push_metrics,json=enablePushMetrics,proto3,oneof" json:"enable_push_metrics,omitempty"` - // Metrics resolution for this agent. - MetricsResolutions *common.MetricsResolutions `protobuf:"bytes,4,opt,name=metrics_resolutions,json=metricsResolutions,proto3" json:"metrics_resolutions,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ChangeCommonAgentParams) Reset() { - *x = ChangeCommonAgentParams{} - mi := &file_inventory_v1_agents_proto_msgTypes[18] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ChangeCommonAgentParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ChangeCommonAgentParams) ProtoMessage() {} - -func (x *ChangeCommonAgentParams) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_agents_proto_msgTypes[18] - 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 ChangeCommonAgentParams.ProtoReflect.Descriptor instead. -func (*ChangeCommonAgentParams) Descriptor() ([]byte, []int) { - return file_inventory_v1_agents_proto_rawDescGZIP(), []int{18} -} - -func (x *ChangeCommonAgentParams) GetEnable() bool { - if x != nil && x.Enable != nil { - return *x.Enable - } - return false -} - -func (x *ChangeCommonAgentParams) GetCustomLabels() *common.StringMap { - if x != nil { - return x.CustomLabels - } - return nil -} - -func (x *ChangeCommonAgentParams) GetEnablePushMetrics() bool { - if x != nil && x.EnablePushMetrics != nil { - return *x.EnablePushMetrics - } - return false -} - -func (x *ChangeCommonAgentParams) GetMetricsResolutions() *common.MetricsResolutions { - if x != nil { - return x.MetricsResolutions - } - return nil -} - -type ListAgentsRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Return only Agents started by this pmm-agent. - // Exactly one of these parameters should be present: pmm_agent_id, node_id, service_id. - PmmAgentId string `protobuf:"bytes,1,opt,name=pmm_agent_id,json=pmmAgentId,proto3" json:"pmm_agent_id,omitempty"` - // Return only Agents that provide insights for that Node. - // Exactly one of these parameters should be present: pmm_agent_id, node_id, service_id. - NodeId string `protobuf:"bytes,2,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` - // Return only Agents that provide insights for that Service. - // Exactly one of these parameters should be present: pmm_agent_id, node_id, service_id. - ServiceId string `protobuf:"bytes,3,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` - // Return only agents of a particular type. - AgentType AgentType `protobuf:"varint,4,opt,name=agent_type,json=agentType,proto3,enum=inventory.v1.AgentType" json:"agent_type,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ListAgentsRequest) Reset() { - *x = ListAgentsRequest{} - mi := &file_inventory_v1_agents_proto_msgTypes[19] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ListAgentsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListAgentsRequest) ProtoMessage() {} - -func (x *ListAgentsRequest) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_agents_proto_msgTypes[19] - 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 ListAgentsRequest.ProtoReflect.Descriptor instead. -func (*ListAgentsRequest) Descriptor() ([]byte, []int) { - return file_inventory_v1_agents_proto_rawDescGZIP(), []int{19} -} - -func (x *ListAgentsRequest) GetPmmAgentId() string { - if x != nil { - return x.PmmAgentId - } - return "" -} - -func (x *ListAgentsRequest) GetNodeId() string { - if x != nil { - return x.NodeId - } - return "" -} - -func (x *ListAgentsRequest) GetServiceId() string { - if x != nil { - return x.ServiceId - } - return "" -} - -func (x *ListAgentsRequest) GetAgentType() AgentType { - if x != nil { - return x.AgentType - } - return AgentType_AGENT_TYPE_UNSPECIFIED -} - -type ListAgentsResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - PmmAgent []*PMMAgent `protobuf:"bytes,1,rep,name=pmm_agent,json=pmmAgent,proto3" json:"pmm_agent,omitempty"` - VmAgent []*VMAgent `protobuf:"bytes,2,rep,name=vm_agent,json=vmAgent,proto3" json:"vm_agent,omitempty"` - NodeExporter []*NodeExporter `protobuf:"bytes,3,rep,name=node_exporter,json=nodeExporter,proto3" json:"node_exporter,omitempty"` - MysqldExporter []*MySQLdExporter `protobuf:"bytes,4,rep,name=mysqld_exporter,json=mysqldExporter,proto3" json:"mysqld_exporter,omitempty"` - MongodbExporter []*MongoDBExporter `protobuf:"bytes,5,rep,name=mongodb_exporter,json=mongodbExporter,proto3" json:"mongodb_exporter,omitempty"` - PostgresExporter []*PostgresExporter `protobuf:"bytes,6,rep,name=postgres_exporter,json=postgresExporter,proto3" json:"postgres_exporter,omitempty"` - ProxysqlExporter []*ProxySQLExporter `protobuf:"bytes,7,rep,name=proxysql_exporter,json=proxysqlExporter,proto3" json:"proxysql_exporter,omitempty"` - QanMysqlPerfschemaAgent []*QANMySQLPerfSchemaAgent `protobuf:"bytes,8,rep,name=qan_mysql_perfschema_agent,json=qanMysqlPerfschemaAgent,proto3" json:"qan_mysql_perfschema_agent,omitempty"` - QanMysqlSlowlogAgent []*QANMySQLSlowlogAgent `protobuf:"bytes,9,rep,name=qan_mysql_slowlog_agent,json=qanMysqlSlowlogAgent,proto3" json:"qan_mysql_slowlog_agent,omitempty"` - QanMongodbProfilerAgent []*QANMongoDBProfilerAgent `protobuf:"bytes,10,rep,name=qan_mongodb_profiler_agent,json=qanMongodbProfilerAgent,proto3" json:"qan_mongodb_profiler_agent,omitempty"` - QanMongodbMongologAgent []*QANMongoDBMongologAgent `protobuf:"bytes,18,rep,name=qan_mongodb_mongolog_agent,json=qanMongodbMongologAgent,proto3" json:"qan_mongodb_mongolog_agent,omitempty"` - QanPostgresqlPgstatementsAgent []*QANPostgreSQLPgStatementsAgent `protobuf:"bytes,11,rep,name=qan_postgresql_pgstatements_agent,json=qanPostgresqlPgstatementsAgent,proto3" json:"qan_postgresql_pgstatements_agent,omitempty"` - QanPostgresqlPgstatmonitorAgent []*QANPostgreSQLPgStatMonitorAgent `protobuf:"bytes,12,rep,name=qan_postgresql_pgstatmonitor_agent,json=qanPostgresqlPgstatmonitorAgent,proto3" json:"qan_postgresql_pgstatmonitor_agent,omitempty"` - ExternalExporter []*ExternalExporter `protobuf:"bytes,13,rep,name=external_exporter,json=externalExporter,proto3" json:"external_exporter,omitempty"` - RdsExporter []*RDSExporter `protobuf:"bytes,14,rep,name=rds_exporter,json=rdsExporter,proto3" json:"rds_exporter,omitempty"` - AzureDatabaseExporter []*AzureDatabaseExporter `protobuf:"bytes,15,rep,name=azure_database_exporter,json=azureDatabaseExporter,proto3" json:"azure_database_exporter,omitempty"` - NomadAgent []*NomadAgent `protobuf:"bytes,16,rep,name=nomad_agent,json=nomadAgent,proto3" json:"nomad_agent,omitempty"` - ValkeyExporter []*ValkeyExporter `protobuf:"bytes,17,rep,name=valkey_exporter,json=valkeyExporter,proto3" json:"valkey_exporter,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ListAgentsResponse) Reset() { - *x = ListAgentsResponse{} - mi := &file_inventory_v1_agents_proto_msgTypes[20] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ListAgentsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListAgentsResponse) ProtoMessage() {} - -func (x *ListAgentsResponse) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_agents_proto_msgTypes[20] - 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 ListAgentsResponse.ProtoReflect.Descriptor instead. -func (*ListAgentsResponse) Descriptor() ([]byte, []int) { - return file_inventory_v1_agents_proto_rawDescGZIP(), []int{20} -} - -func (x *ListAgentsResponse) GetPmmAgent() []*PMMAgent { - if x != nil { - return x.PmmAgent - } - return nil -} - -func (x *ListAgentsResponse) GetVmAgent() []*VMAgent { - if x != nil { - return x.VmAgent - } - return nil -} - -func (x *ListAgentsResponse) GetNodeExporter() []*NodeExporter { - if x != nil { - return x.NodeExporter - } - return nil -} - -func (x *ListAgentsResponse) GetMysqldExporter() []*MySQLdExporter { - if x != nil { - return x.MysqldExporter - } - return nil -} - -func (x *ListAgentsResponse) GetMongodbExporter() []*MongoDBExporter { - if x != nil { - return x.MongodbExporter - } - return nil -} - -func (x *ListAgentsResponse) GetPostgresExporter() []*PostgresExporter { - if x != nil { - return x.PostgresExporter - } - return nil -} - -func (x *ListAgentsResponse) GetProxysqlExporter() []*ProxySQLExporter { - if x != nil { - return x.ProxysqlExporter - } - return nil -} - -func (x *ListAgentsResponse) GetQanMysqlPerfschemaAgent() []*QANMySQLPerfSchemaAgent { - if x != nil { - return x.QanMysqlPerfschemaAgent - } - return nil -} - -func (x *ListAgentsResponse) GetQanMysqlSlowlogAgent() []*QANMySQLSlowlogAgent { - if x != nil { - return x.QanMysqlSlowlogAgent - } - return nil -} - -func (x *ListAgentsResponse) GetQanMongodbProfilerAgent() []*QANMongoDBProfilerAgent { - if x != nil { - return x.QanMongodbProfilerAgent - } - return nil -} - -func (x *ListAgentsResponse) GetQanMongodbMongologAgent() []*QANMongoDBMongologAgent { - if x != nil { - return x.QanMongodbMongologAgent - } - return nil -} - -func (x *ListAgentsResponse) GetQanPostgresqlPgstatementsAgent() []*QANPostgreSQLPgStatementsAgent { - if x != nil { - return x.QanPostgresqlPgstatementsAgent - } - return nil -} - -func (x *ListAgentsResponse) GetQanPostgresqlPgstatmonitorAgent() []*QANPostgreSQLPgStatMonitorAgent { - if x != nil { - return x.QanPostgresqlPgstatmonitorAgent - } - return nil -} - -func (x *ListAgentsResponse) GetExternalExporter() []*ExternalExporter { - if x != nil { - return x.ExternalExporter - } - return nil -} - -func (x *ListAgentsResponse) GetRdsExporter() []*RDSExporter { - if x != nil { - return x.RdsExporter - } - return nil -} - -func (x *ListAgentsResponse) GetAzureDatabaseExporter() []*AzureDatabaseExporter { - if x != nil { - return x.AzureDatabaseExporter - } - return nil -} - -func (x *ListAgentsResponse) GetNomadAgent() []*NomadAgent { - if x != nil { - return x.NomadAgent - } - return nil -} - -func (x *ListAgentsResponse) GetValkeyExporter() []*ValkeyExporter { - if x != nil { - return x.ValkeyExporter - } - return nil -} - -type GetAgentRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Unique randomly generated instance identifier. - AgentId string `protobuf:"bytes,1,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetAgentRequest) Reset() { - *x = GetAgentRequest{} - mi := &file_inventory_v1_agents_proto_msgTypes[21] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetAgentRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetAgentRequest) ProtoMessage() {} - -func (x *GetAgentRequest) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_agents_proto_msgTypes[21] - 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 GetAgentRequest.ProtoReflect.Descriptor instead. -func (*GetAgentRequest) Descriptor() ([]byte, []int) { - return file_inventory_v1_agents_proto_rawDescGZIP(), []int{21} -} - -func (x *GetAgentRequest) GetAgentId() string { - if x != nil { - return x.AgentId - } - return "" -} - -type GetAgentResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Agent: - // - // *GetAgentResponse_PmmAgent - // *GetAgentResponse_Vmagent - // *GetAgentResponse_NodeExporter - // *GetAgentResponse_MysqldExporter - // *GetAgentResponse_MongodbExporter - // *GetAgentResponse_PostgresExporter - // *GetAgentResponse_ProxysqlExporter - // *GetAgentResponse_QanMysqlPerfschemaAgent - // *GetAgentResponse_QanMysqlSlowlogAgent - // *GetAgentResponse_QanMongodbProfilerAgent - // *GetAgentResponse_QanMongodbMongologAgent - // *GetAgentResponse_QanPostgresqlPgstatementsAgent - // *GetAgentResponse_QanPostgresqlPgstatmonitorAgent - // *GetAgentResponse_ExternalExporter - // *GetAgentResponse_RdsExporter - // *GetAgentResponse_AzureDatabaseExporter - // *GetAgentResponse_NomadAgent - // *GetAgentResponse_ValkeyExporter - Agent isGetAgentResponse_Agent `protobuf_oneof:"agent"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetAgentResponse) Reset() { - *x = GetAgentResponse{} - mi := &file_inventory_v1_agents_proto_msgTypes[22] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetAgentResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetAgentResponse) ProtoMessage() {} - -func (x *GetAgentResponse) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_agents_proto_msgTypes[22] - 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 GetAgentResponse.ProtoReflect.Descriptor instead. -func (*GetAgentResponse) Descriptor() ([]byte, []int) { - return file_inventory_v1_agents_proto_rawDescGZIP(), []int{22} -} - -func (x *GetAgentResponse) GetAgent() isGetAgentResponse_Agent { - if x != nil { - return x.Agent - } - return nil -} - -func (x *GetAgentResponse) GetPmmAgent() *PMMAgent { - if x != nil { - if x, ok := x.Agent.(*GetAgentResponse_PmmAgent); ok { - return x.PmmAgent - } - } - return nil -} - -func (x *GetAgentResponse) GetVmagent() *VMAgent { - if x != nil { - if x, ok := x.Agent.(*GetAgentResponse_Vmagent); ok { - return x.Vmagent - } - } - return nil -} - -func (x *GetAgentResponse) GetNodeExporter() *NodeExporter { - if x != nil { - if x, ok := x.Agent.(*GetAgentResponse_NodeExporter); ok { - return x.NodeExporter - } - } - return nil -} - -func (x *GetAgentResponse) GetMysqldExporter() *MySQLdExporter { - if x != nil { - if x, ok := x.Agent.(*GetAgentResponse_MysqldExporter); ok { - return x.MysqldExporter - } - } - return nil -} - -func (x *GetAgentResponse) GetMongodbExporter() *MongoDBExporter { - if x != nil { - if x, ok := x.Agent.(*GetAgentResponse_MongodbExporter); ok { - return x.MongodbExporter - } - } - return nil -} - -func (x *GetAgentResponse) GetPostgresExporter() *PostgresExporter { - if x != nil { - if x, ok := x.Agent.(*GetAgentResponse_PostgresExporter); ok { - return x.PostgresExporter - } - } - return nil -} - -func (x *GetAgentResponse) GetProxysqlExporter() *ProxySQLExporter { - if x != nil { - if x, ok := x.Agent.(*GetAgentResponse_ProxysqlExporter); ok { - return x.ProxysqlExporter - } - } - return nil -} - -func (x *GetAgentResponse) GetQanMysqlPerfschemaAgent() *QANMySQLPerfSchemaAgent { - if x != nil { - if x, ok := x.Agent.(*GetAgentResponse_QanMysqlPerfschemaAgent); ok { - return x.QanMysqlPerfschemaAgent - } - } - return nil -} - -func (x *GetAgentResponse) GetQanMysqlSlowlogAgent() *QANMySQLSlowlogAgent { - if x != nil { - if x, ok := x.Agent.(*GetAgentResponse_QanMysqlSlowlogAgent); ok { - return x.QanMysqlSlowlogAgent - } - } - return nil -} - -func (x *GetAgentResponse) GetQanMongodbProfilerAgent() *QANMongoDBProfilerAgent { - if x != nil { - if x, ok := x.Agent.(*GetAgentResponse_QanMongodbProfilerAgent); ok { - return x.QanMongodbProfilerAgent - } - } - return nil -} - -func (x *GetAgentResponse) GetQanMongodbMongologAgent() *QANMongoDBMongologAgent { - if x != nil { - if x, ok := x.Agent.(*GetAgentResponse_QanMongodbMongologAgent); ok { - return x.QanMongodbMongologAgent - } - } - return nil -} - -func (x *GetAgentResponse) GetQanPostgresqlPgstatementsAgent() *QANPostgreSQLPgStatementsAgent { - if x != nil { - if x, ok := x.Agent.(*GetAgentResponse_QanPostgresqlPgstatementsAgent); ok { - return x.QanPostgresqlPgstatementsAgent - } - } - return nil -} - -func (x *GetAgentResponse) GetQanPostgresqlPgstatmonitorAgent() *QANPostgreSQLPgStatMonitorAgent { - if x != nil { - if x, ok := x.Agent.(*GetAgentResponse_QanPostgresqlPgstatmonitorAgent); ok { - return x.QanPostgresqlPgstatmonitorAgent - } - } - return nil -} - -func (x *GetAgentResponse) GetExternalExporter() *ExternalExporter { - if x != nil { - if x, ok := x.Agent.(*GetAgentResponse_ExternalExporter); ok { - return x.ExternalExporter - } - } - return nil -} - -func (x *GetAgentResponse) GetRdsExporter() *RDSExporter { - if x != nil { - if x, ok := x.Agent.(*GetAgentResponse_RdsExporter); ok { - return x.RdsExporter - } - } - return nil -} - -func (x *GetAgentResponse) GetAzureDatabaseExporter() *AzureDatabaseExporter { - if x != nil { - if x, ok := x.Agent.(*GetAgentResponse_AzureDatabaseExporter); ok { - return x.AzureDatabaseExporter - } - } - return nil -} - -func (x *GetAgentResponse) GetNomadAgent() *NomadAgent { - if x != nil { - if x, ok := x.Agent.(*GetAgentResponse_NomadAgent); ok { - return x.NomadAgent - } - } - return nil -} - -func (x *GetAgentResponse) GetValkeyExporter() *ValkeyExporter { - if x != nil { - if x, ok := x.Agent.(*GetAgentResponse_ValkeyExporter); ok { - return x.ValkeyExporter - } - } - return nil -} - -type isGetAgentResponse_Agent interface { - isGetAgentResponse_Agent() -} - -type GetAgentResponse_PmmAgent struct { - PmmAgent *PMMAgent `protobuf:"bytes,1,opt,name=pmm_agent,json=pmmAgent,proto3,oneof"` -} - -type GetAgentResponse_Vmagent struct { - Vmagent *VMAgent `protobuf:"bytes,2,opt,name=vmagent,proto3,oneof"` -} - -type GetAgentResponse_NodeExporter struct { - NodeExporter *NodeExporter `protobuf:"bytes,3,opt,name=node_exporter,json=nodeExporter,proto3,oneof"` -} - -type GetAgentResponse_MysqldExporter struct { - MysqldExporter *MySQLdExporter `protobuf:"bytes,4,opt,name=mysqld_exporter,json=mysqldExporter,proto3,oneof"` -} - -type GetAgentResponse_MongodbExporter struct { - MongodbExporter *MongoDBExporter `protobuf:"bytes,5,opt,name=mongodb_exporter,json=mongodbExporter,proto3,oneof"` -} - -type GetAgentResponse_PostgresExporter struct { - PostgresExporter *PostgresExporter `protobuf:"bytes,6,opt,name=postgres_exporter,json=postgresExporter,proto3,oneof"` -} - -type GetAgentResponse_ProxysqlExporter struct { - ProxysqlExporter *ProxySQLExporter `protobuf:"bytes,7,opt,name=proxysql_exporter,json=proxysqlExporter,proto3,oneof"` -} - -type GetAgentResponse_QanMysqlPerfschemaAgent struct { - QanMysqlPerfschemaAgent *QANMySQLPerfSchemaAgent `protobuf:"bytes,8,opt,name=qan_mysql_perfschema_agent,json=qanMysqlPerfschemaAgent,proto3,oneof"` -} - -type GetAgentResponse_QanMysqlSlowlogAgent struct { - QanMysqlSlowlogAgent *QANMySQLSlowlogAgent `protobuf:"bytes,9,opt,name=qan_mysql_slowlog_agent,json=qanMysqlSlowlogAgent,proto3,oneof"` -} - -type GetAgentResponse_QanMongodbProfilerAgent struct { - QanMongodbProfilerAgent *QANMongoDBProfilerAgent `protobuf:"bytes,10,opt,name=qan_mongodb_profiler_agent,json=qanMongodbProfilerAgent,proto3,oneof"` -} - -type GetAgentResponse_QanMongodbMongologAgent struct { - QanMongodbMongologAgent *QANMongoDBMongologAgent `protobuf:"bytes,18,opt,name=qan_mongodb_mongolog_agent,json=qanMongodbMongologAgent,proto3,oneof"` -} - -type GetAgentResponse_QanPostgresqlPgstatementsAgent struct { - QanPostgresqlPgstatementsAgent *QANPostgreSQLPgStatementsAgent `protobuf:"bytes,11,opt,name=qan_postgresql_pgstatements_agent,json=qanPostgresqlPgstatementsAgent,proto3,oneof"` -} - -type GetAgentResponse_QanPostgresqlPgstatmonitorAgent struct { - QanPostgresqlPgstatmonitorAgent *QANPostgreSQLPgStatMonitorAgent `protobuf:"bytes,12,opt,name=qan_postgresql_pgstatmonitor_agent,json=qanPostgresqlPgstatmonitorAgent,proto3,oneof"` -} - -type GetAgentResponse_ExternalExporter struct { - ExternalExporter *ExternalExporter `protobuf:"bytes,13,opt,name=external_exporter,json=externalExporter,proto3,oneof"` -} - -type GetAgentResponse_RdsExporter struct { - RdsExporter *RDSExporter `protobuf:"bytes,14,opt,name=rds_exporter,json=rdsExporter,proto3,oneof"` -} - -type GetAgentResponse_AzureDatabaseExporter struct { - AzureDatabaseExporter *AzureDatabaseExporter `protobuf:"bytes,15,opt,name=azure_database_exporter,json=azureDatabaseExporter,proto3,oneof"` -} - -type GetAgentResponse_NomadAgent struct { - NomadAgent *NomadAgent `protobuf:"bytes,16,opt,name=nomad_agent,json=nomadAgent,proto3,oneof"` -} - -type GetAgentResponse_ValkeyExporter struct { - ValkeyExporter *ValkeyExporter `protobuf:"bytes,17,opt,name=valkey_exporter,json=valkeyExporter,proto3,oneof"` -} - -func (*GetAgentResponse_PmmAgent) isGetAgentResponse_Agent() {} - -func (*GetAgentResponse_Vmagent) isGetAgentResponse_Agent() {} - -func (*GetAgentResponse_NodeExporter) isGetAgentResponse_Agent() {} - -func (*GetAgentResponse_MysqldExporter) isGetAgentResponse_Agent() {} - -func (*GetAgentResponse_MongodbExporter) isGetAgentResponse_Agent() {} - -func (*GetAgentResponse_PostgresExporter) isGetAgentResponse_Agent() {} - -func (*GetAgentResponse_ProxysqlExporter) isGetAgentResponse_Agent() {} - -func (*GetAgentResponse_QanMysqlPerfschemaAgent) isGetAgentResponse_Agent() {} - -func (*GetAgentResponse_QanMysqlSlowlogAgent) isGetAgentResponse_Agent() {} - -func (*GetAgentResponse_QanMongodbProfilerAgent) isGetAgentResponse_Agent() {} - -func (*GetAgentResponse_QanMongodbMongologAgent) isGetAgentResponse_Agent() {} - -func (*GetAgentResponse_QanPostgresqlPgstatementsAgent) isGetAgentResponse_Agent() {} - -func (*GetAgentResponse_QanPostgresqlPgstatmonitorAgent) isGetAgentResponse_Agent() {} - -func (*GetAgentResponse_ExternalExporter) isGetAgentResponse_Agent() {} - -func (*GetAgentResponse_RdsExporter) isGetAgentResponse_Agent() {} - -func (*GetAgentResponse_AzureDatabaseExporter) isGetAgentResponse_Agent() {} - -func (*GetAgentResponse_NomadAgent) isGetAgentResponse_Agent() {} - -func (*GetAgentResponse_ValkeyExporter) isGetAgentResponse_Agent() {} - -type GetAgentLogsRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Unique randomly generated instance identifier. - AgentId string `protobuf:"bytes,1,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"` - // Limit the number of log lines to this value. Pass 0 for no limit. - Limit uint32 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetAgentLogsRequest) Reset() { - *x = GetAgentLogsRequest{} - mi := &file_inventory_v1_agents_proto_msgTypes[23] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetAgentLogsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetAgentLogsRequest) ProtoMessage() {} - -func (x *GetAgentLogsRequest) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_agents_proto_msgTypes[23] - 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 GetAgentLogsRequest.ProtoReflect.Descriptor instead. -func (*GetAgentLogsRequest) Descriptor() ([]byte, []int) { - return file_inventory_v1_agents_proto_rawDescGZIP(), []int{23} -} - -func (x *GetAgentLogsRequest) GetAgentId() string { - if x != nil { - return x.AgentId - } - return "" -} - -func (x *GetAgentLogsRequest) GetLimit() uint32 { - if x != nil { - return x.Limit - } - return 0 -} - -type GetAgentLogsResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Logs []string `protobuf:"bytes,1,rep,name=logs,proto3" json:"logs,omitempty"` - AgentConfigLogLinesCount uint32 `protobuf:"varint,2,opt,name=agent_config_log_lines_count,json=agentConfigLogLinesCount,proto3" json:"agent_config_log_lines_count,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetAgentLogsResponse) Reset() { - *x = GetAgentLogsResponse{} - mi := &file_inventory_v1_agents_proto_msgTypes[24] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetAgentLogsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetAgentLogsResponse) ProtoMessage() {} - -func (x *GetAgentLogsResponse) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_agents_proto_msgTypes[24] - 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 GetAgentLogsResponse.ProtoReflect.Descriptor instead. -func (*GetAgentLogsResponse) Descriptor() ([]byte, []int) { - return file_inventory_v1_agents_proto_rawDescGZIP(), []int{24} -} - -func (x *GetAgentLogsResponse) GetLogs() []string { - if x != nil { - return x.Logs - } - return nil -} - -func (x *GetAgentLogsResponse) GetAgentConfigLogLinesCount() uint32 { - if x != nil { - return x.AgentConfigLogLinesCount - } - return 0 -} - -type AddAgentRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Agent: - // - // *AddAgentRequest_PmmAgent - // *AddAgentRequest_NodeExporter - // *AddAgentRequest_MysqldExporter - // *AddAgentRequest_MongodbExporter - // *AddAgentRequest_PostgresExporter - // *AddAgentRequest_ProxysqlExporter - // *AddAgentRequest_ExternalExporter - // *AddAgentRequest_RdsExporter - // *AddAgentRequest_AzureDatabaseExporter - // *AddAgentRequest_QanMysqlPerfschemaAgent - // *AddAgentRequest_QanMysqlSlowlogAgent - // *AddAgentRequest_QanMongodbProfilerAgent - // *AddAgentRequest_QanMongodbMongologAgent - // *AddAgentRequest_QanPostgresqlPgstatementsAgent - // *AddAgentRequest_QanPostgresqlPgstatmonitorAgent - // *AddAgentRequest_ValkeyExporter - Agent isAddAgentRequest_Agent `protobuf_oneof:"agent"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AddAgentRequest) Reset() { - *x = AddAgentRequest{} - mi := &file_inventory_v1_agents_proto_msgTypes[25] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AddAgentRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddAgentRequest) ProtoMessage() {} - -func (x *AddAgentRequest) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_agents_proto_msgTypes[25] - 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 AddAgentRequest.ProtoReflect.Descriptor instead. -func (*AddAgentRequest) Descriptor() ([]byte, []int) { - return file_inventory_v1_agents_proto_rawDescGZIP(), []int{25} -} - -func (x *AddAgentRequest) GetAgent() isAddAgentRequest_Agent { - if x != nil { - return x.Agent - } - return nil -} - -func (x *AddAgentRequest) GetPmmAgent() *AddPMMAgentParams { - if x != nil { - if x, ok := x.Agent.(*AddAgentRequest_PmmAgent); ok { - return x.PmmAgent - } - } - return nil -} - -func (x *AddAgentRequest) GetNodeExporter() *AddNodeExporterParams { - if x != nil { - if x, ok := x.Agent.(*AddAgentRequest_NodeExporter); ok { - return x.NodeExporter - } - } - return nil -} - -func (x *AddAgentRequest) GetMysqldExporter() *AddMySQLdExporterParams { - if x != nil { - if x, ok := x.Agent.(*AddAgentRequest_MysqldExporter); ok { - return x.MysqldExporter - } - } - return nil -} - -func (x *AddAgentRequest) GetMongodbExporter() *AddMongoDBExporterParams { - if x != nil { - if x, ok := x.Agent.(*AddAgentRequest_MongodbExporter); ok { - return x.MongodbExporter - } - } - return nil -} - -func (x *AddAgentRequest) GetPostgresExporter() *AddPostgresExporterParams { - if x != nil { - if x, ok := x.Agent.(*AddAgentRequest_PostgresExporter); ok { - return x.PostgresExporter - } - } - return nil -} - -func (x *AddAgentRequest) GetProxysqlExporter() *AddProxySQLExporterParams { - if x != nil { - if x, ok := x.Agent.(*AddAgentRequest_ProxysqlExporter); ok { - return x.ProxysqlExporter - } - } - return nil -} - -func (x *AddAgentRequest) GetExternalExporter() *AddExternalExporterParams { - if x != nil { - if x, ok := x.Agent.(*AddAgentRequest_ExternalExporter); ok { - return x.ExternalExporter - } - } - return nil -} - -func (x *AddAgentRequest) GetRdsExporter() *AddRDSExporterParams { - if x != nil { - if x, ok := x.Agent.(*AddAgentRequest_RdsExporter); ok { - return x.RdsExporter - } - } - return nil -} - -func (x *AddAgentRequest) GetAzureDatabaseExporter() *AddAzureDatabaseExporterParams { - if x != nil { - if x, ok := x.Agent.(*AddAgentRequest_AzureDatabaseExporter); ok { - return x.AzureDatabaseExporter - } - } - return nil -} - -func (x *AddAgentRequest) GetQanMysqlPerfschemaAgent() *AddQANMySQLPerfSchemaAgentParams { - if x != nil { - if x, ok := x.Agent.(*AddAgentRequest_QanMysqlPerfschemaAgent); ok { - return x.QanMysqlPerfschemaAgent - } - } - return nil -} - -func (x *AddAgentRequest) GetQanMysqlSlowlogAgent() *AddQANMySQLSlowlogAgentParams { - if x != nil { - if x, ok := x.Agent.(*AddAgentRequest_QanMysqlSlowlogAgent); ok { - return x.QanMysqlSlowlogAgent - } - } - return nil -} - -func (x *AddAgentRequest) GetQanMongodbProfilerAgent() *AddQANMongoDBProfilerAgentParams { - if x != nil { - if x, ok := x.Agent.(*AddAgentRequest_QanMongodbProfilerAgent); ok { - return x.QanMongodbProfilerAgent - } - } - return nil -} - -func (x *AddAgentRequest) GetQanMongodbMongologAgent() *AddQANMongoDBMongologAgentParams { - if x != nil { - if x, ok := x.Agent.(*AddAgentRequest_QanMongodbMongologAgent); ok { - return x.QanMongodbMongologAgent - } - } - return nil -} - -func (x *AddAgentRequest) GetQanPostgresqlPgstatementsAgent() *AddQANPostgreSQLPgStatementsAgentParams { - if x != nil { - if x, ok := x.Agent.(*AddAgentRequest_QanPostgresqlPgstatementsAgent); ok { - return x.QanPostgresqlPgstatementsAgent - } - } - return nil -} - -func (x *AddAgentRequest) GetQanPostgresqlPgstatmonitorAgent() *AddQANPostgreSQLPgStatMonitorAgentParams { - if x != nil { - if x, ok := x.Agent.(*AddAgentRequest_QanPostgresqlPgstatmonitorAgent); ok { - return x.QanPostgresqlPgstatmonitorAgent - } - } - return nil -} - -func (x *AddAgentRequest) GetValkeyExporter() *AddValkeyExporterParams { - if x != nil { - if x, ok := x.Agent.(*AddAgentRequest_ValkeyExporter); ok { - return x.ValkeyExporter - } - } - return nil -} - -type isAddAgentRequest_Agent interface { - isAddAgentRequest_Agent() -} - -type AddAgentRequest_PmmAgent struct { - PmmAgent *AddPMMAgentParams `protobuf:"bytes,1,opt,name=pmm_agent,json=pmmAgent,proto3,oneof"` -} - -type AddAgentRequest_NodeExporter struct { - NodeExporter *AddNodeExporterParams `protobuf:"bytes,2,opt,name=node_exporter,json=nodeExporter,proto3,oneof"` -} - -type AddAgentRequest_MysqldExporter struct { - MysqldExporter *AddMySQLdExporterParams `protobuf:"bytes,3,opt,name=mysqld_exporter,json=mysqldExporter,proto3,oneof"` -} - -type AddAgentRequest_MongodbExporter struct { - MongodbExporter *AddMongoDBExporterParams `protobuf:"bytes,4,opt,name=mongodb_exporter,json=mongodbExporter,proto3,oneof"` -} - -type AddAgentRequest_PostgresExporter struct { - PostgresExporter *AddPostgresExporterParams `protobuf:"bytes,5,opt,name=postgres_exporter,json=postgresExporter,proto3,oneof"` -} - -type AddAgentRequest_ProxysqlExporter struct { - ProxysqlExporter *AddProxySQLExporterParams `protobuf:"bytes,6,opt,name=proxysql_exporter,json=proxysqlExporter,proto3,oneof"` -} - -type AddAgentRequest_ExternalExporter struct { - ExternalExporter *AddExternalExporterParams `protobuf:"bytes,7,opt,name=external_exporter,json=externalExporter,proto3,oneof"` -} - -type AddAgentRequest_RdsExporter struct { - RdsExporter *AddRDSExporterParams `protobuf:"bytes,8,opt,name=rds_exporter,json=rdsExporter,proto3,oneof"` -} - -type AddAgentRequest_AzureDatabaseExporter struct { - AzureDatabaseExporter *AddAzureDatabaseExporterParams `protobuf:"bytes,9,opt,name=azure_database_exporter,json=azureDatabaseExporter,proto3,oneof"` -} - -type AddAgentRequest_QanMysqlPerfschemaAgent struct { - QanMysqlPerfschemaAgent *AddQANMySQLPerfSchemaAgentParams `protobuf:"bytes,10,opt,name=qan_mysql_perfschema_agent,json=qanMysqlPerfschemaAgent,proto3,oneof"` -} - -type AddAgentRequest_QanMysqlSlowlogAgent struct { - QanMysqlSlowlogAgent *AddQANMySQLSlowlogAgentParams `protobuf:"bytes,11,opt,name=qan_mysql_slowlog_agent,json=qanMysqlSlowlogAgent,proto3,oneof"` -} - -type AddAgentRequest_QanMongodbProfilerAgent struct { - QanMongodbProfilerAgent *AddQANMongoDBProfilerAgentParams `protobuf:"bytes,12,opt,name=qan_mongodb_profiler_agent,json=qanMongodbProfilerAgent,proto3,oneof"` -} - -type AddAgentRequest_QanMongodbMongologAgent struct { - QanMongodbMongologAgent *AddQANMongoDBMongologAgentParams `protobuf:"bytes,16,opt,name=qan_mongodb_mongolog_agent,json=qanMongodbMongologAgent,proto3,oneof"` -} - -type AddAgentRequest_QanPostgresqlPgstatementsAgent struct { - QanPostgresqlPgstatementsAgent *AddQANPostgreSQLPgStatementsAgentParams `protobuf:"bytes,13,opt,name=qan_postgresql_pgstatements_agent,json=qanPostgresqlPgstatementsAgent,proto3,oneof"` -} - -type AddAgentRequest_QanPostgresqlPgstatmonitorAgent struct { - QanPostgresqlPgstatmonitorAgent *AddQANPostgreSQLPgStatMonitorAgentParams `protobuf:"bytes,14,opt,name=qan_postgresql_pgstatmonitor_agent,json=qanPostgresqlPgstatmonitorAgent,proto3,oneof"` -} - -type AddAgentRequest_ValkeyExporter struct { - ValkeyExporter *AddValkeyExporterParams `protobuf:"bytes,15,opt,name=valkey_exporter,json=valkeyExporter,proto3,oneof"` -} - -func (*AddAgentRequest_PmmAgent) isAddAgentRequest_Agent() {} - -func (*AddAgentRequest_NodeExporter) isAddAgentRequest_Agent() {} - -func (*AddAgentRequest_MysqldExporter) isAddAgentRequest_Agent() {} - -func (*AddAgentRequest_MongodbExporter) isAddAgentRequest_Agent() {} - -func (*AddAgentRequest_PostgresExporter) isAddAgentRequest_Agent() {} - -func (*AddAgentRequest_ProxysqlExporter) isAddAgentRequest_Agent() {} - -func (*AddAgentRequest_ExternalExporter) isAddAgentRequest_Agent() {} - -func (*AddAgentRequest_RdsExporter) isAddAgentRequest_Agent() {} - -func (*AddAgentRequest_AzureDatabaseExporter) isAddAgentRequest_Agent() {} - -func (*AddAgentRequest_QanMysqlPerfschemaAgent) isAddAgentRequest_Agent() {} - -func (*AddAgentRequest_QanMysqlSlowlogAgent) isAddAgentRequest_Agent() {} - -func (*AddAgentRequest_QanMongodbProfilerAgent) isAddAgentRequest_Agent() {} - -func (*AddAgentRequest_QanMongodbMongologAgent) isAddAgentRequest_Agent() {} - -func (*AddAgentRequest_QanPostgresqlPgstatementsAgent) isAddAgentRequest_Agent() {} - -func (*AddAgentRequest_QanPostgresqlPgstatmonitorAgent) isAddAgentRequest_Agent() {} - -func (*AddAgentRequest_ValkeyExporter) isAddAgentRequest_Agent() {} - -type AddAgentResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Agent: - // - // *AddAgentResponse_PmmAgent - // *AddAgentResponse_NodeExporter - // *AddAgentResponse_MysqldExporter - // *AddAgentResponse_MongodbExporter - // *AddAgentResponse_PostgresExporter - // *AddAgentResponse_ProxysqlExporter - // *AddAgentResponse_ExternalExporter - // *AddAgentResponse_RdsExporter - // *AddAgentResponse_AzureDatabaseExporter - // *AddAgentResponse_QanMysqlPerfschemaAgent - // *AddAgentResponse_QanMysqlSlowlogAgent - // *AddAgentResponse_QanMongodbProfilerAgent - // *AddAgentResponse_QanMongodbMongologAgent - // *AddAgentResponse_QanPostgresqlPgstatementsAgent - // *AddAgentResponse_QanPostgresqlPgstatmonitorAgent - // *AddAgentResponse_ValkeyExporter - Agent isAddAgentResponse_Agent `protobuf_oneof:"agent"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AddAgentResponse) Reset() { - *x = AddAgentResponse{} - mi := &file_inventory_v1_agents_proto_msgTypes[26] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AddAgentResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddAgentResponse) ProtoMessage() {} - -func (x *AddAgentResponse) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_agents_proto_msgTypes[26] - 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 AddAgentResponse.ProtoReflect.Descriptor instead. -func (*AddAgentResponse) Descriptor() ([]byte, []int) { - return file_inventory_v1_agents_proto_rawDescGZIP(), []int{26} -} - -func (x *AddAgentResponse) GetAgent() isAddAgentResponse_Agent { - if x != nil { - return x.Agent - } - return nil -} - -func (x *AddAgentResponse) GetPmmAgent() *PMMAgent { - if x != nil { - if x, ok := x.Agent.(*AddAgentResponse_PmmAgent); ok { - return x.PmmAgent - } - } - return nil -} - -func (x *AddAgentResponse) GetNodeExporter() *NodeExporter { - if x != nil { - if x, ok := x.Agent.(*AddAgentResponse_NodeExporter); ok { - return x.NodeExporter - } - } - return nil -} - -func (x *AddAgentResponse) GetMysqldExporter() *MySQLdExporter { - if x != nil { - if x, ok := x.Agent.(*AddAgentResponse_MysqldExporter); ok { - return x.MysqldExporter - } - } - return nil -} - -func (x *AddAgentResponse) GetMongodbExporter() *MongoDBExporter { - if x != nil { - if x, ok := x.Agent.(*AddAgentResponse_MongodbExporter); ok { - return x.MongodbExporter - } - } - return nil -} - -func (x *AddAgentResponse) GetPostgresExporter() *PostgresExporter { - if x != nil { - if x, ok := x.Agent.(*AddAgentResponse_PostgresExporter); ok { - return x.PostgresExporter - } - } - return nil -} - -func (x *AddAgentResponse) GetProxysqlExporter() *ProxySQLExporter { - if x != nil { - if x, ok := x.Agent.(*AddAgentResponse_ProxysqlExporter); ok { - return x.ProxysqlExporter - } - } - return nil -} - -func (x *AddAgentResponse) GetExternalExporter() *ExternalExporter { - if x != nil { - if x, ok := x.Agent.(*AddAgentResponse_ExternalExporter); ok { - return x.ExternalExporter - } - } - return nil -} - -func (x *AddAgentResponse) GetRdsExporter() *RDSExporter { - if x != nil { - if x, ok := x.Agent.(*AddAgentResponse_RdsExporter); ok { - return x.RdsExporter - } - } - return nil -} - -func (x *AddAgentResponse) GetAzureDatabaseExporter() *AzureDatabaseExporter { - if x != nil { - if x, ok := x.Agent.(*AddAgentResponse_AzureDatabaseExporter); ok { - return x.AzureDatabaseExporter - } - } - return nil -} - -func (x *AddAgentResponse) GetQanMysqlPerfschemaAgent() *QANMySQLPerfSchemaAgent { - if x != nil { - if x, ok := x.Agent.(*AddAgentResponse_QanMysqlPerfschemaAgent); ok { - return x.QanMysqlPerfschemaAgent - } - } - return nil -} - -func (x *AddAgentResponse) GetQanMysqlSlowlogAgent() *QANMySQLSlowlogAgent { - if x != nil { - if x, ok := x.Agent.(*AddAgentResponse_QanMysqlSlowlogAgent); ok { - return x.QanMysqlSlowlogAgent - } - } - return nil -} - -func (x *AddAgentResponse) GetQanMongodbProfilerAgent() *QANMongoDBProfilerAgent { - if x != nil { - if x, ok := x.Agent.(*AddAgentResponse_QanMongodbProfilerAgent); ok { - return x.QanMongodbProfilerAgent - } - } - return nil -} - -func (x *AddAgentResponse) GetQanMongodbMongologAgent() *QANMongoDBMongologAgent { - if x != nil { - if x, ok := x.Agent.(*AddAgentResponse_QanMongodbMongologAgent); ok { - return x.QanMongodbMongologAgent - } - } - return nil -} - -func (x *AddAgentResponse) GetQanPostgresqlPgstatementsAgent() *QANPostgreSQLPgStatementsAgent { - if x != nil { - if x, ok := x.Agent.(*AddAgentResponse_QanPostgresqlPgstatementsAgent); ok { - return x.QanPostgresqlPgstatementsAgent - } - } - return nil -} - -func (x *AddAgentResponse) GetQanPostgresqlPgstatmonitorAgent() *QANPostgreSQLPgStatMonitorAgent { - if x != nil { - if x, ok := x.Agent.(*AddAgentResponse_QanPostgresqlPgstatmonitorAgent); ok { - return x.QanPostgresqlPgstatmonitorAgent - } - } - return nil -} - -func (x *AddAgentResponse) GetValkeyExporter() *ValkeyExporter { - if x != nil { - if x, ok := x.Agent.(*AddAgentResponse_ValkeyExporter); ok { - return x.ValkeyExporter - } - } - return nil -} - -type isAddAgentResponse_Agent interface { - isAddAgentResponse_Agent() -} - -type AddAgentResponse_PmmAgent struct { - PmmAgent *PMMAgent `protobuf:"bytes,1,opt,name=pmm_agent,json=pmmAgent,proto3,oneof"` -} - -type AddAgentResponse_NodeExporter struct { - NodeExporter *NodeExporter `protobuf:"bytes,2,opt,name=node_exporter,json=nodeExporter,proto3,oneof"` -} - -type AddAgentResponse_MysqldExporter struct { - MysqldExporter *MySQLdExporter `protobuf:"bytes,3,opt,name=mysqld_exporter,json=mysqldExporter,proto3,oneof"` -} - -type AddAgentResponse_MongodbExporter struct { - MongodbExporter *MongoDBExporter `protobuf:"bytes,4,opt,name=mongodb_exporter,json=mongodbExporter,proto3,oneof"` -} - -type AddAgentResponse_PostgresExporter struct { - PostgresExporter *PostgresExporter `protobuf:"bytes,5,opt,name=postgres_exporter,json=postgresExporter,proto3,oneof"` -} - -type AddAgentResponse_ProxysqlExporter struct { - ProxysqlExporter *ProxySQLExporter `protobuf:"bytes,6,opt,name=proxysql_exporter,json=proxysqlExporter,proto3,oneof"` -} - -type AddAgentResponse_ExternalExporter struct { - ExternalExporter *ExternalExporter `protobuf:"bytes,7,opt,name=external_exporter,json=externalExporter,proto3,oneof"` -} - -type AddAgentResponse_RdsExporter struct { - RdsExporter *RDSExporter `protobuf:"bytes,8,opt,name=rds_exporter,json=rdsExporter,proto3,oneof"` -} - -type AddAgentResponse_AzureDatabaseExporter struct { - AzureDatabaseExporter *AzureDatabaseExporter `protobuf:"bytes,9,opt,name=azure_database_exporter,json=azureDatabaseExporter,proto3,oneof"` -} - -type AddAgentResponse_QanMysqlPerfschemaAgent struct { - QanMysqlPerfschemaAgent *QANMySQLPerfSchemaAgent `protobuf:"bytes,10,opt,name=qan_mysql_perfschema_agent,json=qanMysqlPerfschemaAgent,proto3,oneof"` -} - -type AddAgentResponse_QanMysqlSlowlogAgent struct { - QanMysqlSlowlogAgent *QANMySQLSlowlogAgent `protobuf:"bytes,11,opt,name=qan_mysql_slowlog_agent,json=qanMysqlSlowlogAgent,proto3,oneof"` -} - -type AddAgentResponse_QanMongodbProfilerAgent struct { - QanMongodbProfilerAgent *QANMongoDBProfilerAgent `protobuf:"bytes,12,opt,name=qan_mongodb_profiler_agent,json=qanMongodbProfilerAgent,proto3,oneof"` -} - -type AddAgentResponse_QanMongodbMongologAgent struct { - QanMongodbMongologAgent *QANMongoDBMongologAgent `protobuf:"bytes,16,opt,name=qan_mongodb_mongolog_agent,json=qanMongodbMongologAgent,proto3,oneof"` -} - -type AddAgentResponse_QanPostgresqlPgstatementsAgent struct { - QanPostgresqlPgstatementsAgent *QANPostgreSQLPgStatementsAgent `protobuf:"bytes,13,opt,name=qan_postgresql_pgstatements_agent,json=qanPostgresqlPgstatementsAgent,proto3,oneof"` -} - -type AddAgentResponse_QanPostgresqlPgstatmonitorAgent struct { - QanPostgresqlPgstatmonitorAgent *QANPostgreSQLPgStatMonitorAgent `protobuf:"bytes,14,opt,name=qan_postgresql_pgstatmonitor_agent,json=qanPostgresqlPgstatmonitorAgent,proto3,oneof"` -} - -type AddAgentResponse_ValkeyExporter struct { - ValkeyExporter *ValkeyExporter `protobuf:"bytes,15,opt,name=valkey_exporter,json=valkeyExporter,proto3,oneof"` -} - -func (*AddAgentResponse_PmmAgent) isAddAgentResponse_Agent() {} - -func (*AddAgentResponse_NodeExporter) isAddAgentResponse_Agent() {} - -func (*AddAgentResponse_MysqldExporter) isAddAgentResponse_Agent() {} - -func (*AddAgentResponse_MongodbExporter) isAddAgentResponse_Agent() {} - -func (*AddAgentResponse_PostgresExporter) isAddAgentResponse_Agent() {} - -func (*AddAgentResponse_ProxysqlExporter) isAddAgentResponse_Agent() {} - -func (*AddAgentResponse_ExternalExporter) isAddAgentResponse_Agent() {} - -func (*AddAgentResponse_RdsExporter) isAddAgentResponse_Agent() {} - -func (*AddAgentResponse_AzureDatabaseExporter) isAddAgentResponse_Agent() {} - -func (*AddAgentResponse_QanMysqlPerfschemaAgent) isAddAgentResponse_Agent() {} - -func (*AddAgentResponse_QanMysqlSlowlogAgent) isAddAgentResponse_Agent() {} - -func (*AddAgentResponse_QanMongodbProfilerAgent) isAddAgentResponse_Agent() {} - -func (*AddAgentResponse_QanMongodbMongologAgent) isAddAgentResponse_Agent() {} - -func (*AddAgentResponse_QanPostgresqlPgstatementsAgent) isAddAgentResponse_Agent() {} - -func (*AddAgentResponse_QanPostgresqlPgstatmonitorAgent) isAddAgentResponse_Agent() {} - -func (*AddAgentResponse_ValkeyExporter) isAddAgentResponse_Agent() {} - -type ChangeAgentRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - AgentId string `protobuf:"bytes,1,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"` - // Types that are valid to be assigned to Agent: - // - // *ChangeAgentRequest_NodeExporter - // *ChangeAgentRequest_MysqldExporter - // *ChangeAgentRequest_MongodbExporter - // *ChangeAgentRequest_PostgresExporter - // *ChangeAgentRequest_ProxysqlExporter - // *ChangeAgentRequest_ExternalExporter - // *ChangeAgentRequest_RdsExporter - // *ChangeAgentRequest_AzureDatabaseExporter - // *ChangeAgentRequest_QanMysqlPerfschemaAgent - // *ChangeAgentRequest_QanMysqlSlowlogAgent - // *ChangeAgentRequest_QanMongodbProfilerAgent - // *ChangeAgentRequest_QanMongodbMongologAgent - // *ChangeAgentRequest_QanPostgresqlPgstatementsAgent - // *ChangeAgentRequest_QanPostgresqlPgstatmonitorAgent - // *ChangeAgentRequest_NomadAgent - // *ChangeAgentRequest_ValkeyExporter - Agent isChangeAgentRequest_Agent `protobuf_oneof:"agent"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ChangeAgentRequest) Reset() { - *x = ChangeAgentRequest{} - mi := &file_inventory_v1_agents_proto_msgTypes[27] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ChangeAgentRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ChangeAgentRequest) ProtoMessage() {} - -func (x *ChangeAgentRequest) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_agents_proto_msgTypes[27] - 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 ChangeAgentRequest.ProtoReflect.Descriptor instead. -func (*ChangeAgentRequest) Descriptor() ([]byte, []int) { - return file_inventory_v1_agents_proto_rawDescGZIP(), []int{27} -} - -func (x *ChangeAgentRequest) GetAgentId() string { - if x != nil { - return x.AgentId - } - return "" -} - -func (x *ChangeAgentRequest) GetAgent() isChangeAgentRequest_Agent { - if x != nil { - return x.Agent - } - return nil -} - -func (x *ChangeAgentRequest) GetNodeExporter() *ChangeNodeExporterParams { - if x != nil { - if x, ok := x.Agent.(*ChangeAgentRequest_NodeExporter); ok { - return x.NodeExporter - } - } - return nil -} - -func (x *ChangeAgentRequest) GetMysqldExporter() *ChangeMySQLdExporterParams { - if x != nil { - if x, ok := x.Agent.(*ChangeAgentRequest_MysqldExporter); ok { - return x.MysqldExporter - } - } - return nil -} - -func (x *ChangeAgentRequest) GetMongodbExporter() *ChangeMongoDBExporterParams { - if x != nil { - if x, ok := x.Agent.(*ChangeAgentRequest_MongodbExporter); ok { - return x.MongodbExporter - } - } - return nil -} - -func (x *ChangeAgentRequest) GetPostgresExporter() *ChangePostgresExporterParams { - if x != nil { - if x, ok := x.Agent.(*ChangeAgentRequest_PostgresExporter); ok { - return x.PostgresExporter - } - } - return nil -} - -func (x *ChangeAgentRequest) GetProxysqlExporter() *ChangeProxySQLExporterParams { - if x != nil { - if x, ok := x.Agent.(*ChangeAgentRequest_ProxysqlExporter); ok { - return x.ProxysqlExporter - } - } - return nil -} - -func (x *ChangeAgentRequest) GetExternalExporter() *ChangeExternalExporterParams { - if x != nil { - if x, ok := x.Agent.(*ChangeAgentRequest_ExternalExporter); ok { - return x.ExternalExporter - } - } - return nil -} - -func (x *ChangeAgentRequest) GetRdsExporter() *ChangeRDSExporterParams { - if x != nil { - if x, ok := x.Agent.(*ChangeAgentRequest_RdsExporter); ok { - return x.RdsExporter - } - } - return nil -} - -func (x *ChangeAgentRequest) GetAzureDatabaseExporter() *ChangeAzureDatabaseExporterParams { - if x != nil { - if x, ok := x.Agent.(*ChangeAgentRequest_AzureDatabaseExporter); ok { - return x.AzureDatabaseExporter - } - } - return nil -} - -func (x *ChangeAgentRequest) GetQanMysqlPerfschemaAgent() *ChangeQANMySQLPerfSchemaAgentParams { - if x != nil { - if x, ok := x.Agent.(*ChangeAgentRequest_QanMysqlPerfschemaAgent); ok { - return x.QanMysqlPerfschemaAgent - } - } - return nil -} - -func (x *ChangeAgentRequest) GetQanMysqlSlowlogAgent() *ChangeQANMySQLSlowlogAgentParams { - if x != nil { - if x, ok := x.Agent.(*ChangeAgentRequest_QanMysqlSlowlogAgent); ok { - return x.QanMysqlSlowlogAgent - } - } - return nil -} - -func (x *ChangeAgentRequest) GetQanMongodbProfilerAgent() *ChangeQANMongoDBProfilerAgentParams { - if x != nil { - if x, ok := x.Agent.(*ChangeAgentRequest_QanMongodbProfilerAgent); ok { - return x.QanMongodbProfilerAgent - } - } - return nil -} - -func (x *ChangeAgentRequest) GetQanMongodbMongologAgent() *ChangeQANMongoDBMongologAgentParams { - if x != nil { - if x, ok := x.Agent.(*ChangeAgentRequest_QanMongodbMongologAgent); ok { - return x.QanMongodbMongologAgent - } - } - return nil -} - -func (x *ChangeAgentRequest) GetQanPostgresqlPgstatementsAgent() *ChangeQANPostgreSQLPgStatementsAgentParams { - if x != nil { - if x, ok := x.Agent.(*ChangeAgentRequest_QanPostgresqlPgstatementsAgent); ok { - return x.QanPostgresqlPgstatementsAgent - } - } - return nil -} - -func (x *ChangeAgentRequest) GetQanPostgresqlPgstatmonitorAgent() *ChangeQANPostgreSQLPgStatMonitorAgentParams { - if x != nil { - if x, ok := x.Agent.(*ChangeAgentRequest_QanPostgresqlPgstatmonitorAgent); ok { - return x.QanPostgresqlPgstatmonitorAgent - } - } - return nil -} - -func (x *ChangeAgentRequest) GetNomadAgent() *ChangeNomadAgentParams { - if x != nil { - if x, ok := x.Agent.(*ChangeAgentRequest_NomadAgent); ok { - return x.NomadAgent - } - } - return nil -} - -func (x *ChangeAgentRequest) GetValkeyExporter() *ChangeValkeyExporterParams { - if x != nil { - if x, ok := x.Agent.(*ChangeAgentRequest_ValkeyExporter); ok { - return x.ValkeyExporter - } - } - return nil -} - -type isChangeAgentRequest_Agent interface { - isChangeAgentRequest_Agent() -} - -type ChangeAgentRequest_NodeExporter struct { - NodeExporter *ChangeNodeExporterParams `protobuf:"bytes,2,opt,name=node_exporter,json=nodeExporter,proto3,oneof"` -} - -type ChangeAgentRequest_MysqldExporter struct { - MysqldExporter *ChangeMySQLdExporterParams `protobuf:"bytes,3,opt,name=mysqld_exporter,json=mysqldExporter,proto3,oneof"` -} - -type ChangeAgentRequest_MongodbExporter struct { - MongodbExporter *ChangeMongoDBExporterParams `protobuf:"bytes,4,opt,name=mongodb_exporter,json=mongodbExporter,proto3,oneof"` -} - -type ChangeAgentRequest_PostgresExporter struct { - PostgresExporter *ChangePostgresExporterParams `protobuf:"bytes,5,opt,name=postgres_exporter,json=postgresExporter,proto3,oneof"` -} - -type ChangeAgentRequest_ProxysqlExporter struct { - ProxysqlExporter *ChangeProxySQLExporterParams `protobuf:"bytes,6,opt,name=proxysql_exporter,json=proxysqlExporter,proto3,oneof"` -} - -type ChangeAgentRequest_ExternalExporter struct { - ExternalExporter *ChangeExternalExporterParams `protobuf:"bytes,7,opt,name=external_exporter,json=externalExporter,proto3,oneof"` -} - -type ChangeAgentRequest_RdsExporter struct { - RdsExporter *ChangeRDSExporterParams `protobuf:"bytes,8,opt,name=rds_exporter,json=rdsExporter,proto3,oneof"` -} - -type ChangeAgentRequest_AzureDatabaseExporter struct { - AzureDatabaseExporter *ChangeAzureDatabaseExporterParams `protobuf:"bytes,9,opt,name=azure_database_exporter,json=azureDatabaseExporter,proto3,oneof"` -} - -type ChangeAgentRequest_QanMysqlPerfschemaAgent struct { - QanMysqlPerfschemaAgent *ChangeQANMySQLPerfSchemaAgentParams `protobuf:"bytes,10,opt,name=qan_mysql_perfschema_agent,json=qanMysqlPerfschemaAgent,proto3,oneof"` -} - -type ChangeAgentRequest_QanMysqlSlowlogAgent struct { - QanMysqlSlowlogAgent *ChangeQANMySQLSlowlogAgentParams `protobuf:"bytes,11,opt,name=qan_mysql_slowlog_agent,json=qanMysqlSlowlogAgent,proto3,oneof"` -} - -type ChangeAgentRequest_QanMongodbProfilerAgent struct { - QanMongodbProfilerAgent *ChangeQANMongoDBProfilerAgentParams `protobuf:"bytes,12,opt,name=qan_mongodb_profiler_agent,json=qanMongodbProfilerAgent,proto3,oneof"` -} - -type ChangeAgentRequest_QanMongodbMongologAgent struct { - QanMongodbMongologAgent *ChangeQANMongoDBMongologAgentParams `protobuf:"bytes,17,opt,name=qan_mongodb_mongolog_agent,json=qanMongodbMongologAgent,proto3,oneof"` -} - -type ChangeAgentRequest_QanPostgresqlPgstatementsAgent struct { - QanPostgresqlPgstatementsAgent *ChangeQANPostgreSQLPgStatementsAgentParams `protobuf:"bytes,13,opt,name=qan_postgresql_pgstatements_agent,json=qanPostgresqlPgstatementsAgent,proto3,oneof"` -} - -type ChangeAgentRequest_QanPostgresqlPgstatmonitorAgent struct { - QanPostgresqlPgstatmonitorAgent *ChangeQANPostgreSQLPgStatMonitorAgentParams `protobuf:"bytes,14,opt,name=qan_postgresql_pgstatmonitor_agent,json=qanPostgresqlPgstatmonitorAgent,proto3,oneof"` -} - -type ChangeAgentRequest_NomadAgent struct { - NomadAgent *ChangeNomadAgentParams `protobuf:"bytes,15,opt,name=nomad_agent,json=nomadAgent,proto3,oneof"` -} - -type ChangeAgentRequest_ValkeyExporter struct { - ValkeyExporter *ChangeValkeyExporterParams `protobuf:"bytes,16,opt,name=valkey_exporter,json=valkeyExporter,proto3,oneof"` -} - -func (*ChangeAgentRequest_NodeExporter) isChangeAgentRequest_Agent() {} - -func (*ChangeAgentRequest_MysqldExporter) isChangeAgentRequest_Agent() {} - -func (*ChangeAgentRequest_MongodbExporter) isChangeAgentRequest_Agent() {} - -func (*ChangeAgentRequest_PostgresExporter) isChangeAgentRequest_Agent() {} - -func (*ChangeAgentRequest_ProxysqlExporter) isChangeAgentRequest_Agent() {} - -func (*ChangeAgentRequest_ExternalExporter) isChangeAgentRequest_Agent() {} - -func (*ChangeAgentRequest_RdsExporter) isChangeAgentRequest_Agent() {} - -func (*ChangeAgentRequest_AzureDatabaseExporter) isChangeAgentRequest_Agent() {} - -func (*ChangeAgentRequest_QanMysqlPerfschemaAgent) isChangeAgentRequest_Agent() {} - -func (*ChangeAgentRequest_QanMysqlSlowlogAgent) isChangeAgentRequest_Agent() {} - -func (*ChangeAgentRequest_QanMongodbProfilerAgent) isChangeAgentRequest_Agent() {} - -func (*ChangeAgentRequest_QanMongodbMongologAgent) isChangeAgentRequest_Agent() {} - -func (*ChangeAgentRequest_QanPostgresqlPgstatementsAgent) isChangeAgentRequest_Agent() {} - -func (*ChangeAgentRequest_QanPostgresqlPgstatmonitorAgent) isChangeAgentRequest_Agent() {} - -func (*ChangeAgentRequest_NomadAgent) isChangeAgentRequest_Agent() {} - -func (*ChangeAgentRequest_ValkeyExporter) isChangeAgentRequest_Agent() {} - -type ChangeAgentResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Agent: - // - // *ChangeAgentResponse_NodeExporter - // *ChangeAgentResponse_MysqldExporter - // *ChangeAgentResponse_MongodbExporter - // *ChangeAgentResponse_PostgresExporter - // *ChangeAgentResponse_ProxysqlExporter - // *ChangeAgentResponse_ExternalExporter - // *ChangeAgentResponse_RdsExporter - // *ChangeAgentResponse_AzureDatabaseExporter - // *ChangeAgentResponse_QanMysqlPerfschemaAgent - // *ChangeAgentResponse_QanMysqlSlowlogAgent - // *ChangeAgentResponse_QanMongodbProfilerAgent - // *ChangeAgentResponse_QanMongodbMongologAgent - // *ChangeAgentResponse_QanPostgresqlPgstatementsAgent - // *ChangeAgentResponse_QanPostgresqlPgstatmonitorAgent - // *ChangeAgentResponse_NomadAgent - // *ChangeAgentResponse_ValkeyExporter - Agent isChangeAgentResponse_Agent `protobuf_oneof:"agent"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ChangeAgentResponse) Reset() { - *x = ChangeAgentResponse{} - mi := &file_inventory_v1_agents_proto_msgTypes[28] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ChangeAgentResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ChangeAgentResponse) ProtoMessage() {} - -func (x *ChangeAgentResponse) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_agents_proto_msgTypes[28] - 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 ChangeAgentResponse.ProtoReflect.Descriptor instead. -func (*ChangeAgentResponse) Descriptor() ([]byte, []int) { - return file_inventory_v1_agents_proto_rawDescGZIP(), []int{28} -} - -func (x *ChangeAgentResponse) GetAgent() isChangeAgentResponse_Agent { - if x != nil { - return x.Agent - } - return nil -} - -func (x *ChangeAgentResponse) GetNodeExporter() *NodeExporter { - if x != nil { - if x, ok := x.Agent.(*ChangeAgentResponse_NodeExporter); ok { - return x.NodeExporter - } - } - return nil -} - -func (x *ChangeAgentResponse) GetMysqldExporter() *MySQLdExporter { - if x != nil { - if x, ok := x.Agent.(*ChangeAgentResponse_MysqldExporter); ok { - return x.MysqldExporter - } - } - return nil -} - -func (x *ChangeAgentResponse) GetMongodbExporter() *MongoDBExporter { - if x != nil { - if x, ok := x.Agent.(*ChangeAgentResponse_MongodbExporter); ok { - return x.MongodbExporter - } - } - return nil -} - -func (x *ChangeAgentResponse) GetPostgresExporter() *PostgresExporter { - if x != nil { - if x, ok := x.Agent.(*ChangeAgentResponse_PostgresExporter); ok { - return x.PostgresExporter - } - } - return nil -} - -func (x *ChangeAgentResponse) GetProxysqlExporter() *ProxySQLExporter { - if x != nil { - if x, ok := x.Agent.(*ChangeAgentResponse_ProxysqlExporter); ok { - return x.ProxysqlExporter - } - } - return nil -} - -func (x *ChangeAgentResponse) GetExternalExporter() *ExternalExporter { - if x != nil { - if x, ok := x.Agent.(*ChangeAgentResponse_ExternalExporter); ok { - return x.ExternalExporter - } - } - return nil -} - -func (x *ChangeAgentResponse) GetRdsExporter() *RDSExporter { - if x != nil { - if x, ok := x.Agent.(*ChangeAgentResponse_RdsExporter); ok { - return x.RdsExporter - } - } - return nil -} - -func (x *ChangeAgentResponse) GetAzureDatabaseExporter() *AzureDatabaseExporter { - if x != nil { - if x, ok := x.Agent.(*ChangeAgentResponse_AzureDatabaseExporter); ok { - return x.AzureDatabaseExporter - } - } - return nil -} - -func (x *ChangeAgentResponse) GetQanMysqlPerfschemaAgent() *QANMySQLPerfSchemaAgent { - if x != nil { - if x, ok := x.Agent.(*ChangeAgentResponse_QanMysqlPerfschemaAgent); ok { - return x.QanMysqlPerfschemaAgent - } - } - return nil -} - -func (x *ChangeAgentResponse) GetQanMysqlSlowlogAgent() *QANMySQLSlowlogAgent { - if x != nil { - if x, ok := x.Agent.(*ChangeAgentResponse_QanMysqlSlowlogAgent); ok { - return x.QanMysqlSlowlogAgent - } - } - return nil -} - -func (x *ChangeAgentResponse) GetQanMongodbProfilerAgent() *QANMongoDBProfilerAgent { - if x != nil { - if x, ok := x.Agent.(*ChangeAgentResponse_QanMongodbProfilerAgent); ok { - return x.QanMongodbProfilerAgent - } - } - return nil -} - -func (x *ChangeAgentResponse) GetQanMongodbMongologAgent() *QANMongoDBMongologAgent { - if x != nil { - if x, ok := x.Agent.(*ChangeAgentResponse_QanMongodbMongologAgent); ok { - return x.QanMongodbMongologAgent - } - } - return nil -} - -func (x *ChangeAgentResponse) GetQanPostgresqlPgstatementsAgent() *QANPostgreSQLPgStatementsAgent { - if x != nil { - if x, ok := x.Agent.(*ChangeAgentResponse_QanPostgresqlPgstatementsAgent); ok { - return x.QanPostgresqlPgstatementsAgent - } - } - return nil -} - -func (x *ChangeAgentResponse) GetQanPostgresqlPgstatmonitorAgent() *QANPostgreSQLPgStatMonitorAgent { - if x != nil { - if x, ok := x.Agent.(*ChangeAgentResponse_QanPostgresqlPgstatmonitorAgent); ok { - return x.QanPostgresqlPgstatmonitorAgent - } - } - return nil -} - -func (x *ChangeAgentResponse) GetNomadAgent() *NomadAgent { - if x != nil { - if x, ok := x.Agent.(*ChangeAgentResponse_NomadAgent); ok { - return x.NomadAgent - } - } - return nil -} - -func (x *ChangeAgentResponse) GetValkeyExporter() *ValkeyExporter { - if x != nil { - if x, ok := x.Agent.(*ChangeAgentResponse_ValkeyExporter); ok { - return x.ValkeyExporter - } - } - return nil -} - -type isChangeAgentResponse_Agent interface { - isChangeAgentResponse_Agent() -} - -type ChangeAgentResponse_NodeExporter struct { - NodeExporter *NodeExporter `protobuf:"bytes,2,opt,name=node_exporter,json=nodeExporter,proto3,oneof"` -} - -type ChangeAgentResponse_MysqldExporter struct { - MysqldExporter *MySQLdExporter `protobuf:"bytes,3,opt,name=mysqld_exporter,json=mysqldExporter,proto3,oneof"` -} - -type ChangeAgentResponse_MongodbExporter struct { - MongodbExporter *MongoDBExporter `protobuf:"bytes,4,opt,name=mongodb_exporter,json=mongodbExporter,proto3,oneof"` -} - -type ChangeAgentResponse_PostgresExporter struct { - PostgresExporter *PostgresExporter `protobuf:"bytes,5,opt,name=postgres_exporter,json=postgresExporter,proto3,oneof"` -} - -type ChangeAgentResponse_ProxysqlExporter struct { - ProxysqlExporter *ProxySQLExporter `protobuf:"bytes,6,opt,name=proxysql_exporter,json=proxysqlExporter,proto3,oneof"` -} - -type ChangeAgentResponse_ExternalExporter struct { - ExternalExporter *ExternalExporter `protobuf:"bytes,7,opt,name=external_exporter,json=externalExporter,proto3,oneof"` -} - -type ChangeAgentResponse_RdsExporter struct { - RdsExporter *RDSExporter `protobuf:"bytes,8,opt,name=rds_exporter,json=rdsExporter,proto3,oneof"` -} - -type ChangeAgentResponse_AzureDatabaseExporter struct { - AzureDatabaseExporter *AzureDatabaseExporter `protobuf:"bytes,9,opt,name=azure_database_exporter,json=azureDatabaseExporter,proto3,oneof"` -} - -type ChangeAgentResponse_QanMysqlPerfschemaAgent struct { - QanMysqlPerfschemaAgent *QANMySQLPerfSchemaAgent `protobuf:"bytes,10,opt,name=qan_mysql_perfschema_agent,json=qanMysqlPerfschemaAgent,proto3,oneof"` -} - -type ChangeAgentResponse_QanMysqlSlowlogAgent struct { - QanMysqlSlowlogAgent *QANMySQLSlowlogAgent `protobuf:"bytes,11,opt,name=qan_mysql_slowlog_agent,json=qanMysqlSlowlogAgent,proto3,oneof"` -} - -type ChangeAgentResponse_QanMongodbProfilerAgent struct { - QanMongodbProfilerAgent *QANMongoDBProfilerAgent `protobuf:"bytes,12,opt,name=qan_mongodb_profiler_agent,json=qanMongodbProfilerAgent,proto3,oneof"` -} - -type ChangeAgentResponse_QanMongodbMongologAgent struct { - QanMongodbMongologAgent *QANMongoDBMongologAgent `protobuf:"bytes,17,opt,name=qan_mongodb_mongolog_agent,json=qanMongodbMongologAgent,proto3,oneof"` -} - -type ChangeAgentResponse_QanPostgresqlPgstatementsAgent struct { - QanPostgresqlPgstatementsAgent *QANPostgreSQLPgStatementsAgent `protobuf:"bytes,13,opt,name=qan_postgresql_pgstatements_agent,json=qanPostgresqlPgstatementsAgent,proto3,oneof"` -} - -type ChangeAgentResponse_QanPostgresqlPgstatmonitorAgent struct { - QanPostgresqlPgstatmonitorAgent *QANPostgreSQLPgStatMonitorAgent `protobuf:"bytes,14,opt,name=qan_postgresql_pgstatmonitor_agent,json=qanPostgresqlPgstatmonitorAgent,proto3,oneof"` -} - -type ChangeAgentResponse_NomadAgent struct { - NomadAgent *NomadAgent `protobuf:"bytes,15,opt,name=nomad_agent,json=nomadAgent,proto3,oneof"` -} - -type ChangeAgentResponse_ValkeyExporter struct { - ValkeyExporter *ValkeyExporter `protobuf:"bytes,16,opt,name=valkey_exporter,json=valkeyExporter,proto3,oneof"` -} - -func (*ChangeAgentResponse_NodeExporter) isChangeAgentResponse_Agent() {} - -func (*ChangeAgentResponse_MysqldExporter) isChangeAgentResponse_Agent() {} - -func (*ChangeAgentResponse_MongodbExporter) isChangeAgentResponse_Agent() {} - -func (*ChangeAgentResponse_PostgresExporter) isChangeAgentResponse_Agent() {} - -func (*ChangeAgentResponse_ProxysqlExporter) isChangeAgentResponse_Agent() {} - -func (*ChangeAgentResponse_ExternalExporter) isChangeAgentResponse_Agent() {} - -func (*ChangeAgentResponse_RdsExporter) isChangeAgentResponse_Agent() {} - -func (*ChangeAgentResponse_AzureDatabaseExporter) isChangeAgentResponse_Agent() {} - -func (*ChangeAgentResponse_QanMysqlPerfschemaAgent) isChangeAgentResponse_Agent() {} - -func (*ChangeAgentResponse_QanMysqlSlowlogAgent) isChangeAgentResponse_Agent() {} - -func (*ChangeAgentResponse_QanMongodbProfilerAgent) isChangeAgentResponse_Agent() {} - -func (*ChangeAgentResponse_QanMongodbMongologAgent) isChangeAgentResponse_Agent() {} - -func (*ChangeAgentResponse_QanPostgresqlPgstatementsAgent) isChangeAgentResponse_Agent() {} - -func (*ChangeAgentResponse_QanPostgresqlPgstatmonitorAgent) isChangeAgentResponse_Agent() {} - -func (*ChangeAgentResponse_NomadAgent) isChangeAgentResponse_Agent() {} - -func (*ChangeAgentResponse_ValkeyExporter) isChangeAgentResponse_Agent() {} - -type AddPMMAgentParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Node identifier where this instance runs. - RunsOnNodeId string `protobuf:"bytes,1,opt,name=runs_on_node_id,json=runsOnNodeId,proto3" json:"runs_on_node_id,omitempty"` - // Custom user-assigned labels. - CustomLabels map[string]string `protobuf:"bytes,2,rep,name=custom_labels,json=customLabels,proto3" json:"custom_labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AddPMMAgentParams) Reset() { - *x = AddPMMAgentParams{} - mi := &file_inventory_v1_agents_proto_msgTypes[29] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AddPMMAgentParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddPMMAgentParams) ProtoMessage() {} - -func (x *AddPMMAgentParams) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_agents_proto_msgTypes[29] - 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 AddPMMAgentParams.ProtoReflect.Descriptor instead. -func (*AddPMMAgentParams) Descriptor() ([]byte, []int) { - return file_inventory_v1_agents_proto_rawDescGZIP(), []int{29} -} - -func (x *AddPMMAgentParams) GetRunsOnNodeId() string { - if x != nil { - return x.RunsOnNodeId - } - return "" -} - -func (x *AddPMMAgentParams) GetCustomLabels() map[string]string { - if x != nil { - return x.CustomLabels - } - return nil -} - -type AddNodeExporterParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The pmm-agent identifier which runs this instance. - PmmAgentId string `protobuf:"bytes,1,opt,name=pmm_agent_id,json=pmmAgentId,proto3" json:"pmm_agent_id,omitempty"` - // Custom user-assigned labels. - CustomLabels map[string]string `protobuf:"bytes,2,rep,name=custom_labels,json=customLabels,proto3" json:"custom_labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - // Enables push metrics mode for exporter. - PushMetrics bool `protobuf:"varint,3,opt,name=push_metrics,json=pushMetrics,proto3" json:"push_metrics,omitempty"` - // List of collector names to disable in this exporter. - DisableCollectors []string `protobuf:"bytes,4,rep,name=disable_collectors,json=disableCollectors,proto3" json:"disable_collectors,omitempty"` - // Log level for exporter. - LogLevel LogLevel `protobuf:"varint,5,opt,name=log_level,json=logLevel,proto3,enum=inventory.v1.LogLevel" json:"log_level,omitempty"` - // Expose the node_exporter process on all public interfaces - ExposeExporter bool `protobuf:"varint,6,opt,name=expose_exporter,json=exposeExporter,proto3" json:"expose_exporter,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AddNodeExporterParams) Reset() { - *x = AddNodeExporterParams{} - mi := &file_inventory_v1_agents_proto_msgTypes[30] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AddNodeExporterParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddNodeExporterParams) ProtoMessage() {} - -func (x *AddNodeExporterParams) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_agents_proto_msgTypes[30] - 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 AddNodeExporterParams.ProtoReflect.Descriptor instead. -func (*AddNodeExporterParams) Descriptor() ([]byte, []int) { - return file_inventory_v1_agents_proto_rawDescGZIP(), []int{30} -} - -func (x *AddNodeExporterParams) GetPmmAgentId() string { - if x != nil { - return x.PmmAgentId - } - return "" -} - -func (x *AddNodeExporterParams) GetCustomLabels() map[string]string { - if x != nil { - return x.CustomLabels - } - return nil -} - -func (x *AddNodeExporterParams) GetPushMetrics() bool { - if x != nil { - return x.PushMetrics - } - return false -} - -func (x *AddNodeExporterParams) GetDisableCollectors() []string { - if x != nil { - return x.DisableCollectors - } - return nil -} - -func (x *AddNodeExporterParams) GetLogLevel() LogLevel { - if x != nil { - return x.LogLevel - } - return LogLevel_LOG_LEVEL_UNSPECIFIED -} - -func (x *AddNodeExporterParams) GetExposeExporter() bool { - if x != nil { - return x.ExposeExporter - } - return false -} - -type ChangeNodeExporterParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Enable this Agent. Agents are enabled by default when they get added. - Enable *bool `protobuf:"varint,1,opt,name=enable,proto3,oneof" json:"enable,omitempty"` - // Replace all custom user-assigned labels. - CustomLabels *common.StringMap `protobuf:"bytes,2,opt,name=custom_labels,json=customLabels,proto3,oneof" json:"custom_labels,omitempty"` - // Enables push metrics with vmagent. - EnablePushMetrics *bool `protobuf:"varint,3,opt,name=enable_push_metrics,json=enablePushMetrics,proto3,oneof" json:"enable_push_metrics,omitempty"` - // Metrics resolution for this agent. - MetricsResolutions *common.MetricsResolutions `protobuf:"bytes,4,opt,name=metrics_resolutions,json=metricsResolutions,proto3" json:"metrics_resolutions,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ChangeNodeExporterParams) Reset() { - *x = ChangeNodeExporterParams{} - mi := &file_inventory_v1_agents_proto_msgTypes[31] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ChangeNodeExporterParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ChangeNodeExporterParams) ProtoMessage() {} - -func (x *ChangeNodeExporterParams) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_agents_proto_msgTypes[31] - 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 ChangeNodeExporterParams.ProtoReflect.Descriptor instead. -func (*ChangeNodeExporterParams) Descriptor() ([]byte, []int) { - return file_inventory_v1_agents_proto_rawDescGZIP(), []int{31} -} - -func (x *ChangeNodeExporterParams) GetEnable() bool { - if x != nil && x.Enable != nil { - return *x.Enable - } - return false -} - -func (x *ChangeNodeExporterParams) GetCustomLabels() *common.StringMap { - if x != nil { - return x.CustomLabels - } - return nil -} - -func (x *ChangeNodeExporterParams) GetEnablePushMetrics() bool { - if x != nil && x.EnablePushMetrics != nil { - return *x.EnablePushMetrics - } - return false -} - -func (x *ChangeNodeExporterParams) GetMetricsResolutions() *common.MetricsResolutions { - if x != nil { - return x.MetricsResolutions - } - return nil -} - -type AddMySQLdExporterParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The pmm-agent identifier which runs this instance. - PmmAgentId string `protobuf:"bytes,1,opt,name=pmm_agent_id,json=pmmAgentId,proto3" json:"pmm_agent_id,omitempty"` - // Service identifier. - ServiceId string `protobuf:"bytes,2,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` - // MySQL username for scraping metrics. - Username string `protobuf:"bytes,3,opt,name=username,proto3" json:"username,omitempty"` - // MySQL password for scraping metrics. - Password string `protobuf:"bytes,4,opt,name=password,proto3" json:"password,omitempty"` - // Use TLS for database connections. - Tls bool `protobuf:"varint,5,opt,name=tls,proto3" json:"tls,omitempty"` - // Skip TLS certificate and hostname validation. - TlsSkipVerify bool `protobuf:"varint,6,opt,name=tls_skip_verify,json=tlsSkipVerify,proto3" json:"tls_skip_verify,omitempty"` - // Certificate Authority certificate chain. - TlsCa string `protobuf:"bytes,7,opt,name=tls_ca,json=tlsCa,proto3" json:"tls_ca,omitempty"` - // Client certificate. - TlsCert string `protobuf:"bytes,8,opt,name=tls_cert,json=tlsCert,proto3" json:"tls_cert,omitempty"` - // Password for decrypting tls_cert. - TlsKey string `protobuf:"bytes,9,opt,name=tls_key,json=tlsKey,proto3" json:"tls_key,omitempty"` - // Tablestats group collectors will be disabled if there are more than that number of tables. - // 0 means tablestats group collectors are always enabled (no limit). - // Negative value means tablestats group collectors are always disabled. - TablestatsGroupTableLimit int32 `protobuf:"varint,10,opt,name=tablestats_group_table_limit,json=tablestatsGroupTableLimit,proto3" json:"tablestats_group_table_limit,omitempty"` - // Custom user-assigned labels. - CustomLabels map[string]string `protobuf:"bytes,11,rep,name=custom_labels,json=customLabels,proto3" json:"custom_labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - // Skip connection check. - SkipConnectionCheck bool `protobuf:"varint,12,opt,name=skip_connection_check,json=skipConnectionCheck,proto3" json:"skip_connection_check,omitempty"` - // Enables push metrics mode for exporter. - PushMetrics bool `protobuf:"varint,13,opt,name=push_metrics,json=pushMetrics,proto3" json:"push_metrics,omitempty"` - // List of collector names to disable in this exporter. - DisableCollectors []string `protobuf:"bytes,14,rep,name=disable_collectors,json=disableCollectors,proto3" json:"disable_collectors,omitempty"` - // Custom password for exporter endpoint /metrics. - AgentPassword string `protobuf:"bytes,15,opt,name=agent_password,json=agentPassword,proto3" json:"agent_password,omitempty"` - // Log level for exporter. - LogLevel LogLevel `protobuf:"varint,16,opt,name=log_level,json=logLevel,proto3,enum=inventory.v1.LogLevel" json:"log_level,omitempty"` - // Optionally expose the exporter process on all public interfaces - ExposeExporter bool `protobuf:"varint,17,opt,name=expose_exporter,json=exposeExporter,proto3" json:"expose_exporter,omitempty"` - // Extra DSN parameters for MySQL connection. - ExtraDsnParams map[string]string `protobuf:"bytes,18,rep,name=extra_dsn_params,json=extraDsnParams,proto3" json:"extra_dsn_params,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AddMySQLdExporterParams) Reset() { - *x = AddMySQLdExporterParams{} - mi := &file_inventory_v1_agents_proto_msgTypes[32] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AddMySQLdExporterParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddMySQLdExporterParams) ProtoMessage() {} - -func (x *AddMySQLdExporterParams) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_agents_proto_msgTypes[32] - 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 AddMySQLdExporterParams.ProtoReflect.Descriptor instead. -func (*AddMySQLdExporterParams) Descriptor() ([]byte, []int) { - return file_inventory_v1_agents_proto_rawDescGZIP(), []int{32} -} - -func (x *AddMySQLdExporterParams) GetPmmAgentId() string { - if x != nil { - return x.PmmAgentId - } - return "" -} - -func (x *AddMySQLdExporterParams) GetServiceId() string { - if x != nil { - return x.ServiceId - } - return "" -} - -func (x *AddMySQLdExporterParams) GetUsername() string { - if x != nil { - return x.Username - } - return "" -} - -func (x *AddMySQLdExporterParams) GetPassword() string { - if x != nil { - return x.Password - } - return "" -} - -func (x *AddMySQLdExporterParams) GetTls() bool { - if x != nil { - return x.Tls - } - return false -} - -func (x *AddMySQLdExporterParams) GetTlsSkipVerify() bool { - if x != nil { - return x.TlsSkipVerify - } - return false -} - -func (x *AddMySQLdExporterParams) GetTlsCa() string { - if x != nil { - return x.TlsCa - } - return "" -} - -func (x *AddMySQLdExporterParams) GetTlsCert() string { - if x != nil { - return x.TlsCert - } - return "" -} - -func (x *AddMySQLdExporterParams) GetTlsKey() string { - if x != nil { - return x.TlsKey - } - return "" -} - -func (x *AddMySQLdExporterParams) GetTablestatsGroupTableLimit() int32 { - if x != nil { - return x.TablestatsGroupTableLimit - } - return 0 -} - -func (x *AddMySQLdExporterParams) GetCustomLabels() map[string]string { - if x != nil { - return x.CustomLabels - } - return nil -} - -func (x *AddMySQLdExporterParams) GetSkipConnectionCheck() bool { - if x != nil { - return x.SkipConnectionCheck - } - return false -} - -func (x *AddMySQLdExporterParams) GetPushMetrics() bool { - if x != nil { - return x.PushMetrics - } - return false -} - -func (x *AddMySQLdExporterParams) GetDisableCollectors() []string { - if x != nil { - return x.DisableCollectors - } - return nil -} - -func (x *AddMySQLdExporterParams) GetAgentPassword() string { - if x != nil { - return x.AgentPassword - } - return "" -} - -func (x *AddMySQLdExporterParams) GetLogLevel() LogLevel { - if x != nil { - return x.LogLevel - } - return LogLevel_LOG_LEVEL_UNSPECIFIED -} - -func (x *AddMySQLdExporterParams) GetExposeExporter() bool { - if x != nil { - return x.ExposeExporter - } - return false -} - -func (x *AddMySQLdExporterParams) GetExtraDsnParams() map[string]string { - if x != nil { - return x.ExtraDsnParams - } - return nil -} - -type ChangeMySQLdExporterParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Enable this Agent. Agents are enabled by default when they get added. - Enable *bool `protobuf:"varint,1,opt,name=enable,proto3,oneof" json:"enable,omitempty"` - // Replace all custom user-assigned labels. - CustomLabels *common.StringMap `protobuf:"bytes,2,opt,name=custom_labels,json=customLabels,proto3,oneof" json:"custom_labels,omitempty"` - // Enables push metrics with vmagent. - EnablePushMetrics *bool `protobuf:"varint,3,opt,name=enable_push_metrics,json=enablePushMetrics,proto3,oneof" json:"enable_push_metrics,omitempty"` - // Metrics resolution for this agent. - MetricsResolutions *common.MetricsResolutions `protobuf:"bytes,4,opt,name=metrics_resolutions,json=metricsResolutions,proto3" json:"metrics_resolutions,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ChangeMySQLdExporterParams) Reset() { - *x = ChangeMySQLdExporterParams{} - mi := &file_inventory_v1_agents_proto_msgTypes[33] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ChangeMySQLdExporterParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ChangeMySQLdExporterParams) ProtoMessage() {} - -func (x *ChangeMySQLdExporterParams) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_agents_proto_msgTypes[33] - 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 ChangeMySQLdExporterParams.ProtoReflect.Descriptor instead. -func (*ChangeMySQLdExporterParams) Descriptor() ([]byte, []int) { - return file_inventory_v1_agents_proto_rawDescGZIP(), []int{33} -} - -func (x *ChangeMySQLdExporterParams) GetEnable() bool { - if x != nil && x.Enable != nil { - return *x.Enable - } - return false -} - -func (x *ChangeMySQLdExporterParams) GetCustomLabels() *common.StringMap { - if x != nil { - return x.CustomLabels - } - return nil -} - -func (x *ChangeMySQLdExporterParams) GetEnablePushMetrics() bool { - if x != nil && x.EnablePushMetrics != nil { - return *x.EnablePushMetrics - } - return false -} - -func (x *ChangeMySQLdExporterParams) GetMetricsResolutions() *common.MetricsResolutions { - if x != nil { - return x.MetricsResolutions - } - return nil -} - -type AddMongoDBExporterParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The pmm-agent identifier which runs this instance. - PmmAgentId string `protobuf:"bytes,1,opt,name=pmm_agent_id,json=pmmAgentId,proto3" json:"pmm_agent_id,omitempty"` - // Service identifier. - ServiceId string `protobuf:"bytes,2,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` - // MongoDB username for scraping metrics. - Username string `protobuf:"bytes,3,opt,name=username,proto3" json:"username,omitempty"` - // MongoDB password for scraping metrics. - Password string `protobuf:"bytes,4,opt,name=password,proto3" json:"password,omitempty"` - // Use TLS for database connections. - Tls bool `protobuf:"varint,5,opt,name=tls,proto3" json:"tls,omitempty"` - // Skip TLS certificate and hostname validation. - TlsSkipVerify bool `protobuf:"varint,6,opt,name=tls_skip_verify,json=tlsSkipVerify,proto3" json:"tls_skip_verify,omitempty"` - // Client certificate and key. - TlsCertificateKey string `protobuf:"bytes,7,opt,name=tls_certificate_key,json=tlsCertificateKey,proto3" json:"tls_certificate_key,omitempty"` - // Password for decrypting tls_certificate_key. - TlsCertificateKeyFilePassword string `protobuf:"bytes,8,opt,name=tls_certificate_key_file_password,json=tlsCertificateKeyFilePassword,proto3" json:"tls_certificate_key_file_password,omitempty"` - // Certificate Authority certificate chain. - TlsCa string `protobuf:"bytes,9,opt,name=tls_ca,json=tlsCa,proto3" json:"tls_ca,omitempty"` - // Custom user-assigned labels. - CustomLabels map[string]string `protobuf:"bytes,10,rep,name=custom_labels,json=customLabels,proto3" json:"custom_labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - // Skip connection check. - SkipConnectionCheck bool `protobuf:"varint,11,opt,name=skip_connection_check,json=skipConnectionCheck,proto3" json:"skip_connection_check,omitempty"` - // Enables push metrics mode for exporter. - PushMetrics bool `protobuf:"varint,12,opt,name=push_metrics,json=pushMetrics,proto3" json:"push_metrics,omitempty"` - // List of collector names to disable in this exporter. - DisableCollectors []string `protobuf:"bytes,13,rep,name=disable_collectors,json=disableCollectors,proto3" json:"disable_collectors,omitempty"` - // Authentication mechanism. - // See https://docs.mongodb.com/manual/reference/connection-string/#mongodb-urioption-urioption.authMechanism - // for details. - AuthenticationMechanism string `protobuf:"bytes,14,opt,name=authentication_mechanism,json=authenticationMechanism,proto3" json:"authentication_mechanism,omitempty"` - // Authentication database. - AuthenticationDatabase string `protobuf:"bytes,15,opt,name=authentication_database,json=authenticationDatabase,proto3" json:"authentication_database,omitempty"` - // Custom password for exporter endpoint /metrics. - AgentPassword string `protobuf:"bytes,16,opt,name=agent_password,json=agentPassword,proto3" json:"agent_password,omitempty"` - // List of colletions to get stats from. Can use * - StatsCollections []string `protobuf:"bytes,17,rep,name=stats_collections,json=statsCollections,proto3" json:"stats_collections,omitempty"` - // 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 `protobuf:"varint,18,opt,name=collections_limit,json=collectionsLimit,proto3" json:"collections_limit,omitempty"` - // Log level for exporter. - LogLevel LogLevel `protobuf:"varint,19,opt,name=log_level,json=logLevel,proto3,enum=inventory.v1.LogLevel" json:"log_level,omitempty"` - // Optionally expose the exporter process on all public interfaces - ExposeExporter bool `protobuf:"varint,20,opt,name=expose_exporter,json=exposeExporter,proto3" json:"expose_exporter,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AddMongoDBExporterParams) Reset() { - *x = AddMongoDBExporterParams{} - mi := &file_inventory_v1_agents_proto_msgTypes[34] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AddMongoDBExporterParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddMongoDBExporterParams) ProtoMessage() {} - -func (x *AddMongoDBExporterParams) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_agents_proto_msgTypes[34] - 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 AddMongoDBExporterParams.ProtoReflect.Descriptor instead. -func (*AddMongoDBExporterParams) Descriptor() ([]byte, []int) { - return file_inventory_v1_agents_proto_rawDescGZIP(), []int{34} -} - -func (x *AddMongoDBExporterParams) GetPmmAgentId() string { - if x != nil { - return x.PmmAgentId - } - return "" -} - -func (x *AddMongoDBExporterParams) GetServiceId() string { - if x != nil { - return x.ServiceId - } - return "" -} - -func (x *AddMongoDBExporterParams) GetUsername() string { - if x != nil { - return x.Username - } - return "" -} - -func (x *AddMongoDBExporterParams) GetPassword() string { - if x != nil { - return x.Password - } - return "" -} - -func (x *AddMongoDBExporterParams) GetTls() bool { - if x != nil { - return x.Tls - } - return false -} - -func (x *AddMongoDBExporterParams) GetTlsSkipVerify() bool { - if x != nil { - return x.TlsSkipVerify - } - return false -} - -func (x *AddMongoDBExporterParams) GetTlsCertificateKey() string { - if x != nil { - return x.TlsCertificateKey - } - return "" -} - -func (x *AddMongoDBExporterParams) GetTlsCertificateKeyFilePassword() string { - if x != nil { - return x.TlsCertificateKeyFilePassword - } - return "" -} - -func (x *AddMongoDBExporterParams) GetTlsCa() string { - if x != nil { - return x.TlsCa - } - return "" -} - -func (x *AddMongoDBExporterParams) GetCustomLabels() map[string]string { - if x != nil { - return x.CustomLabels - } - return nil -} - -func (x *AddMongoDBExporterParams) GetSkipConnectionCheck() bool { - if x != nil { - return x.SkipConnectionCheck - } - return false -} - -func (x *AddMongoDBExporterParams) GetPushMetrics() bool { - if x != nil { - return x.PushMetrics - } - return false -} - -func (x *AddMongoDBExporterParams) GetDisableCollectors() []string { - if x != nil { - return x.DisableCollectors - } - return nil -} - -func (x *AddMongoDBExporterParams) GetAuthenticationMechanism() string { - if x != nil { - return x.AuthenticationMechanism - } - return "" -} - -func (x *AddMongoDBExporterParams) GetAuthenticationDatabase() string { - if x != nil { - return x.AuthenticationDatabase - } - return "" -} - -func (x *AddMongoDBExporterParams) GetAgentPassword() string { - if x != nil { - return x.AgentPassword - } - return "" -} - -func (x *AddMongoDBExporterParams) GetStatsCollections() []string { - if x != nil { - return x.StatsCollections - } - return nil -} - -func (x *AddMongoDBExporterParams) GetCollectionsLimit() int32 { - if x != nil { - return x.CollectionsLimit - } - return 0 -} - -func (x *AddMongoDBExporterParams) GetLogLevel() LogLevel { - if x != nil { - return x.LogLevel - } - return LogLevel_LOG_LEVEL_UNSPECIFIED -} - -func (x *AddMongoDBExporterParams) GetExposeExporter() bool { - if x != nil { - return x.ExposeExporter - } - return false -} - -type ChangeMongoDBExporterParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Enable this Agent. Agents are enabled by default when they get added. - Enable *bool `protobuf:"varint,1,opt,name=enable,proto3,oneof" json:"enable,omitempty"` - // Replace all custom user-assigned labels. - CustomLabels *common.StringMap `protobuf:"bytes,2,opt,name=custom_labels,json=customLabels,proto3,oneof" json:"custom_labels,omitempty"` - // Enables push metrics with vmagent. - EnablePushMetrics *bool `protobuf:"varint,3,opt,name=enable_push_metrics,json=enablePushMetrics,proto3,oneof" json:"enable_push_metrics,omitempty"` - // Metrics resolution for this agent. - MetricsResolutions *common.MetricsResolutions `protobuf:"bytes,4,opt,name=metrics_resolutions,json=metricsResolutions,proto3" json:"metrics_resolutions,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ChangeMongoDBExporterParams) Reset() { - *x = ChangeMongoDBExporterParams{} - mi := &file_inventory_v1_agents_proto_msgTypes[35] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ChangeMongoDBExporterParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ChangeMongoDBExporterParams) ProtoMessage() {} - -func (x *ChangeMongoDBExporterParams) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_agents_proto_msgTypes[35] - 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 ChangeMongoDBExporterParams.ProtoReflect.Descriptor instead. -func (*ChangeMongoDBExporterParams) Descriptor() ([]byte, []int) { - return file_inventory_v1_agents_proto_rawDescGZIP(), []int{35} -} - -func (x *ChangeMongoDBExporterParams) GetEnable() bool { - if x != nil && x.Enable != nil { - return *x.Enable - } - return false -} - -func (x *ChangeMongoDBExporterParams) GetCustomLabels() *common.StringMap { - if x != nil { - return x.CustomLabels - } - return nil -} - -func (x *ChangeMongoDBExporterParams) GetEnablePushMetrics() bool { - if x != nil && x.EnablePushMetrics != nil { - return *x.EnablePushMetrics - } - return false -} - -func (x *ChangeMongoDBExporterParams) GetMetricsResolutions() *common.MetricsResolutions { - if x != nil { - return x.MetricsResolutions - } - return nil -} - -type AddPostgresExporterParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The pmm-agent identifier which runs this instance. - PmmAgentId string `protobuf:"bytes,1,opt,name=pmm_agent_id,json=pmmAgentId,proto3" json:"pmm_agent_id,omitempty"` - // Service identifier. - ServiceId string `protobuf:"bytes,2,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` - // PostgreSQL username for scraping metrics. - Username string `protobuf:"bytes,3,opt,name=username,proto3" json:"username,omitempty"` - // PostgreSQL password for scraping metrics. - Password string `protobuf:"bytes,4,opt,name=password,proto3" json:"password,omitempty"` - // Use TLS for database connections. - Tls bool `protobuf:"varint,5,opt,name=tls,proto3" json:"tls,omitempty"` - // Skip TLS certificate and hostname validation. Uses sslmode=required instead of verify-full. - TlsSkipVerify bool `protobuf:"varint,6,opt,name=tls_skip_verify,json=tlsSkipVerify,proto3" json:"tls_skip_verify,omitempty"` - // Custom user-assigned labels. - CustomLabels map[string]string `protobuf:"bytes,7,rep,name=custom_labels,json=customLabels,proto3" json:"custom_labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - // Skip connection check. - SkipConnectionCheck bool `protobuf:"varint,8,opt,name=skip_connection_check,json=skipConnectionCheck,proto3" json:"skip_connection_check,omitempty"` - // Enables push metrics mode for exporter. - PushMetrics bool `protobuf:"varint,9,opt,name=push_metrics,json=pushMetrics,proto3" json:"push_metrics,omitempty"` - // List of collector names to disable in this exporter. - DisableCollectors []string `protobuf:"bytes,10,rep,name=disable_collectors,json=disableCollectors,proto3" json:"disable_collectors,omitempty"` - // TLS CA certificate. - TlsCa string `protobuf:"bytes,11,opt,name=tls_ca,json=tlsCa,proto3" json:"tls_ca,omitempty"` - // TLS Certifcate. - TlsCert string `protobuf:"bytes,12,opt,name=tls_cert,json=tlsCert,proto3" json:"tls_cert,omitempty"` - // TLS Certificate Key. - TlsKey string `protobuf:"bytes,13,opt,name=tls_key,json=tlsKey,proto3" json:"tls_key,omitempty"` - // Custom password for exporter endpoint /metrics. - AgentPassword string `protobuf:"bytes,14,opt,name=agent_password,json=agentPassword,proto3" json:"agent_password,omitempty"` - // Log level for exporter. - LogLevel LogLevel `protobuf:"varint,15,opt,name=log_level,json=logLevel,proto3,enum=inventory.v1.LogLevel" json:"log_level,omitempty"` - // Limit of databases for auto-discovery. - AutoDiscoveryLimit int32 `protobuf:"varint,16,opt,name=auto_discovery_limit,json=autoDiscoveryLimit,proto3" json:"auto_discovery_limit,omitempty"` - // Optionally expose the exporter process on all public interfaces - ExposeExporter bool `protobuf:"varint,17,opt,name=expose_exporter,json=exposeExporter,proto3" json:"expose_exporter,omitempty"` - // Maximum number of connections that exporter can open to the database instance. - MaxExporterConnections int32 `protobuf:"varint,18,opt,name=max_exporter_connections,json=maxExporterConnections,proto3" json:"max_exporter_connections,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AddPostgresExporterParams) Reset() { - *x = AddPostgresExporterParams{} - mi := &file_inventory_v1_agents_proto_msgTypes[36] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AddPostgresExporterParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddPostgresExporterParams) ProtoMessage() {} - -func (x *AddPostgresExporterParams) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_agents_proto_msgTypes[36] - 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 AddPostgresExporterParams.ProtoReflect.Descriptor instead. -func (*AddPostgresExporterParams) Descriptor() ([]byte, []int) { - return file_inventory_v1_agents_proto_rawDescGZIP(), []int{36} -} - -func (x *AddPostgresExporterParams) GetPmmAgentId() string { - if x != nil { - return x.PmmAgentId - } - return "" -} - -func (x *AddPostgresExporterParams) GetServiceId() string { - if x != nil { - return x.ServiceId - } - return "" -} - -func (x *AddPostgresExporterParams) GetUsername() string { - if x != nil { - return x.Username - } - return "" -} - -func (x *AddPostgresExporterParams) GetPassword() string { - if x != nil { - return x.Password - } - return "" -} - -func (x *AddPostgresExporterParams) GetTls() bool { - if x != nil { - return x.Tls - } - return false -} - -func (x *AddPostgresExporterParams) GetTlsSkipVerify() bool { - if x != nil { - return x.TlsSkipVerify - } - return false -} - -func (x *AddPostgresExporterParams) GetCustomLabels() map[string]string { - if x != nil { - return x.CustomLabels - } - return nil -} - -func (x *AddPostgresExporterParams) GetSkipConnectionCheck() bool { - if x != nil { - return x.SkipConnectionCheck - } - return false -} - -func (x *AddPostgresExporterParams) GetPushMetrics() bool { - if x != nil { - return x.PushMetrics - } - return false -} - -func (x *AddPostgresExporterParams) GetDisableCollectors() []string { - if x != nil { - return x.DisableCollectors - } - return nil -} - -func (x *AddPostgresExporterParams) GetTlsCa() string { - if x != nil { - return x.TlsCa - } - return "" -} - -func (x *AddPostgresExporterParams) GetTlsCert() string { - if x != nil { - return x.TlsCert - } - return "" -} - -func (x *AddPostgresExporterParams) GetTlsKey() string { - if x != nil { - return x.TlsKey - } - return "" -} - -func (x *AddPostgresExporterParams) GetAgentPassword() string { - if x != nil { - return x.AgentPassword - } - return "" -} - -func (x *AddPostgresExporterParams) GetLogLevel() LogLevel { - if x != nil { - return x.LogLevel - } - return LogLevel_LOG_LEVEL_UNSPECIFIED -} - -func (x *AddPostgresExporterParams) GetAutoDiscoveryLimit() int32 { - if x != nil { - return x.AutoDiscoveryLimit - } - return 0 -} - -func (x *AddPostgresExporterParams) GetExposeExporter() bool { - if x != nil { - return x.ExposeExporter - } - return false -} - -func (x *AddPostgresExporterParams) GetMaxExporterConnections() int32 { - if x != nil { - return x.MaxExporterConnections - } - return 0 -} - -type ChangePostgresExporterParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Enable this Agent. Agents are enabled by default when they get added. - Enable *bool `protobuf:"varint,1,opt,name=enable,proto3,oneof" json:"enable,omitempty"` - // Replace all custom user-assigned labels. - CustomLabels *common.StringMap `protobuf:"bytes,2,opt,name=custom_labels,json=customLabels,proto3,oneof" json:"custom_labels,omitempty"` - // Enables push metrics with vmagent. - EnablePushMetrics *bool `protobuf:"varint,3,opt,name=enable_push_metrics,json=enablePushMetrics,proto3,oneof" json:"enable_push_metrics,omitempty"` - // Metrics resolution for this agent. - MetricsResolutions *common.MetricsResolutions `protobuf:"bytes,4,opt,name=metrics_resolutions,json=metricsResolutions,proto3" json:"metrics_resolutions,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ChangePostgresExporterParams) Reset() { - *x = ChangePostgresExporterParams{} - mi := &file_inventory_v1_agents_proto_msgTypes[37] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ChangePostgresExporterParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ChangePostgresExporterParams) ProtoMessage() {} - -func (x *ChangePostgresExporterParams) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_agents_proto_msgTypes[37] - 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 ChangePostgresExporterParams.ProtoReflect.Descriptor instead. -func (*ChangePostgresExporterParams) Descriptor() ([]byte, []int) { - return file_inventory_v1_agents_proto_rawDescGZIP(), []int{37} -} - -func (x *ChangePostgresExporterParams) GetEnable() bool { - if x != nil && x.Enable != nil { - return *x.Enable - } - return false -} - -func (x *ChangePostgresExporterParams) GetCustomLabels() *common.StringMap { - if x != nil { - return x.CustomLabels - } - return nil -} - -func (x *ChangePostgresExporterParams) GetEnablePushMetrics() bool { - if x != nil && x.EnablePushMetrics != nil { - return *x.EnablePushMetrics - } - return false -} - -func (x *ChangePostgresExporterParams) GetMetricsResolutions() *common.MetricsResolutions { - if x != nil { - return x.MetricsResolutions - } - return nil -} - -type AddProxySQLExporterParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The pmm-agent identifier which runs this instance. - PmmAgentId string `protobuf:"bytes,1,opt,name=pmm_agent_id,json=pmmAgentId,proto3" json:"pmm_agent_id,omitempty"` - // Service identifier. - ServiceId string `protobuf:"bytes,2,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` - // ProxySQL username for scraping metrics. - Username string `protobuf:"bytes,3,opt,name=username,proto3" json:"username,omitempty"` - // ProxySQL password for scraping metrics. - Password string `protobuf:"bytes,4,opt,name=password,proto3" json:"password,omitempty"` - // Use TLS for database connections. - Tls bool `protobuf:"varint,5,opt,name=tls,proto3" json:"tls,omitempty"` - // Skip TLS certificate and hostname validation. - TlsSkipVerify bool `protobuf:"varint,6,opt,name=tls_skip_verify,json=tlsSkipVerify,proto3" json:"tls_skip_verify,omitempty"` - // Custom user-assigned labels. - CustomLabels map[string]string `protobuf:"bytes,7,rep,name=custom_labels,json=customLabels,proto3" json:"custom_labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - // Skip connection check. - SkipConnectionCheck bool `protobuf:"varint,8,opt,name=skip_connection_check,json=skipConnectionCheck,proto3" json:"skip_connection_check,omitempty"` - // Enables push metrics mode for exporter. - PushMetrics bool `protobuf:"varint,9,opt,name=push_metrics,json=pushMetrics,proto3" json:"push_metrics,omitempty"` - // List of collector names to disable in this exporter. - DisableCollectors []string `protobuf:"bytes,10,rep,name=disable_collectors,json=disableCollectors,proto3" json:"disable_collectors,omitempty"` - // Custom password for exporter endpoint /metrics. - AgentPassword string `protobuf:"bytes,11,opt,name=agent_password,json=agentPassword,proto3" json:"agent_password,omitempty"` - // Log level for exporter. - LogLevel LogLevel `protobuf:"varint,12,opt,name=log_level,json=logLevel,proto3,enum=inventory.v1.LogLevel" json:"log_level,omitempty"` - // Optionally expose the exporter process on all public interfaces - ExposeExporter bool `protobuf:"varint,13,opt,name=expose_exporter,json=exposeExporter,proto3" json:"expose_exporter,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AddProxySQLExporterParams) Reset() { - *x = AddProxySQLExporterParams{} - mi := &file_inventory_v1_agents_proto_msgTypes[38] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AddProxySQLExporterParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddProxySQLExporterParams) ProtoMessage() {} - -func (x *AddProxySQLExporterParams) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_agents_proto_msgTypes[38] - 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 AddProxySQLExporterParams.ProtoReflect.Descriptor instead. -func (*AddProxySQLExporterParams) Descriptor() ([]byte, []int) { - return file_inventory_v1_agents_proto_rawDescGZIP(), []int{38} -} - -func (x *AddProxySQLExporterParams) GetPmmAgentId() string { - if x != nil { - return x.PmmAgentId - } - return "" -} - -func (x *AddProxySQLExporterParams) GetServiceId() string { - if x != nil { - return x.ServiceId - } - return "" -} - -func (x *AddProxySQLExporterParams) GetUsername() string { - if x != nil { - return x.Username - } - return "" -} - -func (x *AddProxySQLExporterParams) GetPassword() string { - if x != nil { - return x.Password - } - return "" -} - -func (x *AddProxySQLExporterParams) GetTls() bool { - if x != nil { - return x.Tls - } - return false -} - -func (x *AddProxySQLExporterParams) GetTlsSkipVerify() bool { - if x != nil { - return x.TlsSkipVerify - } - return false -} - -func (x *AddProxySQLExporterParams) GetCustomLabels() map[string]string { - if x != nil { - return x.CustomLabels - } - return nil -} - -func (x *AddProxySQLExporterParams) GetSkipConnectionCheck() bool { - if x != nil { - return x.SkipConnectionCheck - } - return false -} - -func (x *AddProxySQLExporterParams) GetPushMetrics() bool { - if x != nil { - return x.PushMetrics - } - return false -} - -func (x *AddProxySQLExporterParams) GetDisableCollectors() []string { - if x != nil { - return x.DisableCollectors - } - return nil -} - -func (x *AddProxySQLExporterParams) GetAgentPassword() string { - if x != nil { - return x.AgentPassword - } - return "" -} - -func (x *AddProxySQLExporterParams) GetLogLevel() LogLevel { - if x != nil { - return x.LogLevel - } - return LogLevel_LOG_LEVEL_UNSPECIFIED -} - -func (x *AddProxySQLExporterParams) GetExposeExporter() bool { - if x != nil { - return x.ExposeExporter - } - return false -} - -type ChangeProxySQLExporterParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Enable this Agent. Agents are enabled by default when they get added. - Enable *bool `protobuf:"varint,1,opt,name=enable,proto3,oneof" json:"enable,omitempty"` - // Replace all custom user-assigned labels. - CustomLabels *common.StringMap `protobuf:"bytes,2,opt,name=custom_labels,json=customLabels,proto3,oneof" json:"custom_labels,omitempty"` - // Enables push metrics with vmagent. - EnablePushMetrics *bool `protobuf:"varint,3,opt,name=enable_push_metrics,json=enablePushMetrics,proto3,oneof" json:"enable_push_metrics,omitempty"` - // Metrics resolution for this agent. - MetricsResolutions *common.MetricsResolutions `protobuf:"bytes,4,opt,name=metrics_resolutions,json=metricsResolutions,proto3" json:"metrics_resolutions,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ChangeProxySQLExporterParams) Reset() { - *x = ChangeProxySQLExporterParams{} - mi := &file_inventory_v1_agents_proto_msgTypes[39] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ChangeProxySQLExporterParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ChangeProxySQLExporterParams) ProtoMessage() {} - -func (x *ChangeProxySQLExporterParams) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_agents_proto_msgTypes[39] - 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 ChangeProxySQLExporterParams.ProtoReflect.Descriptor instead. -func (*ChangeProxySQLExporterParams) Descriptor() ([]byte, []int) { - return file_inventory_v1_agents_proto_rawDescGZIP(), []int{39} -} - -func (x *ChangeProxySQLExporterParams) GetEnable() bool { - if x != nil && x.Enable != nil { - return *x.Enable - } - return false -} - -func (x *ChangeProxySQLExporterParams) GetCustomLabels() *common.StringMap { - if x != nil { - return x.CustomLabels - } - return nil -} - -func (x *ChangeProxySQLExporterParams) GetEnablePushMetrics() bool { - if x != nil && x.EnablePushMetrics != nil { - return *x.EnablePushMetrics - } - return false -} - -func (x *ChangeProxySQLExporterParams) GetMetricsResolutions() *common.MetricsResolutions { - if x != nil { - return x.MetricsResolutions - } - return nil -} - -type AddQANMySQLPerfSchemaAgentParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The pmm-agent identifier which runs this instance. - PmmAgentId string `protobuf:"bytes,1,opt,name=pmm_agent_id,json=pmmAgentId,proto3" json:"pmm_agent_id,omitempty"` - // Service identifier. - ServiceId string `protobuf:"bytes,2,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` - // MySQL username for getting performance data. - Username string `protobuf:"bytes,3,opt,name=username,proto3" json:"username,omitempty"` - // MySQL password for getting performance data. - Password string `protobuf:"bytes,4,opt,name=password,proto3" json:"password,omitempty"` - // Use TLS for database connections. - Tls bool `protobuf:"varint,5,opt,name=tls,proto3" json:"tls,omitempty"` - // Skip TLS certificate and hostname validation. - TlsSkipVerify bool `protobuf:"varint,6,opt,name=tls_skip_verify,json=tlsSkipVerify,proto3" json:"tls_skip_verify,omitempty"` - // Certificate Authority certificate chain. - TlsCa string `protobuf:"bytes,7,opt,name=tls_ca,json=tlsCa,proto3" json:"tls_ca,omitempty"` - // Client certificate. - TlsCert string `protobuf:"bytes,8,opt,name=tls_cert,json=tlsCert,proto3" json:"tls_cert,omitempty"` - // Password for decrypting tls_cert. - TlsKey string `protobuf:"bytes,9,opt,name=tls_key,json=tlsKey,proto3" json:"tls_key,omitempty"` - // Limit query length in QAN (default: server-defined; -1: no limit) - MaxQueryLength int32 `protobuf:"varint,10,opt,name=max_query_length,json=maxQueryLength,proto3" json:"max_query_length,omitempty"` - // Disable query examples. - DisableQueryExamples bool `protobuf:"varint,11,opt,name=disable_query_examples,json=disableQueryExamples,proto3" json:"disable_query_examples,omitempty"` - // Custom user-assigned labels. - CustomLabels map[string]string `protobuf:"bytes,12,rep,name=custom_labels,json=customLabels,proto3" json:"custom_labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - // Skip connection check. - SkipConnectionCheck bool `protobuf:"varint,13,opt,name=skip_connection_check,json=skipConnectionCheck,proto3" json:"skip_connection_check,omitempty"` - // Disable parsing comments from queries and showing them in QAN. - DisableCommentsParsing bool `protobuf:"varint,14,opt,name=disable_comments_parsing,json=disableCommentsParsing,proto3" json:"disable_comments_parsing,omitempty"` - // Log level for exporter. - LogLevel LogLevel `protobuf:"varint,15,opt,name=log_level,json=logLevel,proto3,enum=inventory.v1.LogLevel" json:"log_level,omitempty"` - // Extra DSN parameters for MySQL connection. - ExtraDsnParams map[string]string `protobuf:"bytes,16,rep,name=extra_dsn_params,json=extraDsnParams,proto3" json:"extra_dsn_params,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AddQANMySQLPerfSchemaAgentParams) Reset() { - *x = AddQANMySQLPerfSchemaAgentParams{} - mi := &file_inventory_v1_agents_proto_msgTypes[40] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AddQANMySQLPerfSchemaAgentParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddQANMySQLPerfSchemaAgentParams) ProtoMessage() {} - -func (x *AddQANMySQLPerfSchemaAgentParams) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_agents_proto_msgTypes[40] - 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 AddQANMySQLPerfSchemaAgentParams.ProtoReflect.Descriptor instead. -func (*AddQANMySQLPerfSchemaAgentParams) Descriptor() ([]byte, []int) { - return file_inventory_v1_agents_proto_rawDescGZIP(), []int{40} -} - -func (x *AddQANMySQLPerfSchemaAgentParams) GetPmmAgentId() string { - if x != nil { - return x.PmmAgentId - } - return "" -} - -func (x *AddQANMySQLPerfSchemaAgentParams) GetServiceId() string { - if x != nil { - return x.ServiceId - } - return "" -} - -func (x *AddQANMySQLPerfSchemaAgentParams) GetUsername() string { - if x != nil { - return x.Username - } - return "" -} - -func (x *AddQANMySQLPerfSchemaAgentParams) GetPassword() string { - if x != nil { - return x.Password - } - return "" -} - -func (x *AddQANMySQLPerfSchemaAgentParams) GetTls() bool { - if x != nil { - return x.Tls - } - return false -} - -func (x *AddQANMySQLPerfSchemaAgentParams) GetTlsSkipVerify() bool { - if x != nil { - return x.TlsSkipVerify - } - return false -} - -func (x *AddQANMySQLPerfSchemaAgentParams) GetTlsCa() string { - if x != nil { - return x.TlsCa - } - return "" -} - -func (x *AddQANMySQLPerfSchemaAgentParams) GetTlsCert() string { - if x != nil { - return x.TlsCert - } - return "" -} - -func (x *AddQANMySQLPerfSchemaAgentParams) GetTlsKey() string { - if x != nil { - return x.TlsKey - } - return "" -} - -func (x *AddQANMySQLPerfSchemaAgentParams) GetMaxQueryLength() int32 { - if x != nil { - return x.MaxQueryLength - } - return 0 -} - -func (x *AddQANMySQLPerfSchemaAgentParams) GetDisableQueryExamples() bool { - if x != nil { - return x.DisableQueryExamples - } - return false -} - -func (x *AddQANMySQLPerfSchemaAgentParams) GetCustomLabels() map[string]string { - if x != nil { - return x.CustomLabels - } - return nil -} - -func (x *AddQANMySQLPerfSchemaAgentParams) GetSkipConnectionCheck() bool { - if x != nil { - return x.SkipConnectionCheck - } - return false -} - -func (x *AddQANMySQLPerfSchemaAgentParams) GetDisableCommentsParsing() bool { - if x != nil { - return x.DisableCommentsParsing - } - return false -} - -func (x *AddQANMySQLPerfSchemaAgentParams) GetLogLevel() LogLevel { - if x != nil { - return x.LogLevel - } - return LogLevel_LOG_LEVEL_UNSPECIFIED -} - -func (x *AddQANMySQLPerfSchemaAgentParams) GetExtraDsnParams() map[string]string { - if x != nil { - return x.ExtraDsnParams - } - return nil -} - -type ChangeQANMySQLPerfSchemaAgentParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Enable this Agent. Agents are enabled by default when they get added. - Enable *bool `protobuf:"varint,1,opt,name=enable,proto3,oneof" json:"enable,omitempty"` - // Replace all custom user-assigned labels. - CustomLabels *common.StringMap `protobuf:"bytes,2,opt,name=custom_labels,json=customLabels,proto3,oneof" json:"custom_labels,omitempty"` - // Enables push metrics with vmagent. - EnablePushMetrics *bool `protobuf:"varint,3,opt,name=enable_push_metrics,json=enablePushMetrics,proto3,oneof" json:"enable_push_metrics,omitempty"` - // Metrics resolution for this agent. - MetricsResolutions *common.MetricsResolutions `protobuf:"bytes,4,opt,name=metrics_resolutions,json=metricsResolutions,proto3" json:"metrics_resolutions,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ChangeQANMySQLPerfSchemaAgentParams) Reset() { - *x = ChangeQANMySQLPerfSchemaAgentParams{} - mi := &file_inventory_v1_agents_proto_msgTypes[41] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ChangeQANMySQLPerfSchemaAgentParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ChangeQANMySQLPerfSchemaAgentParams) ProtoMessage() {} - -func (x *ChangeQANMySQLPerfSchemaAgentParams) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_agents_proto_msgTypes[41] - 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 ChangeQANMySQLPerfSchemaAgentParams.ProtoReflect.Descriptor instead. -func (*ChangeQANMySQLPerfSchemaAgentParams) Descriptor() ([]byte, []int) { - return file_inventory_v1_agents_proto_rawDescGZIP(), []int{41} -} - -func (x *ChangeQANMySQLPerfSchemaAgentParams) GetEnable() bool { - if x != nil && x.Enable != nil { - return *x.Enable - } - return false -} - -func (x *ChangeQANMySQLPerfSchemaAgentParams) GetCustomLabels() *common.StringMap { - if x != nil { - return x.CustomLabels - } - return nil -} - -func (x *ChangeQANMySQLPerfSchemaAgentParams) GetEnablePushMetrics() bool { - if x != nil && x.EnablePushMetrics != nil { - return *x.EnablePushMetrics - } - return false -} - -func (x *ChangeQANMySQLPerfSchemaAgentParams) GetMetricsResolutions() *common.MetricsResolutions { - if x != nil { - return x.MetricsResolutions - } - return nil -} - -type AddQANMySQLSlowlogAgentParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The pmm-agent identifier which runs this instance. - PmmAgentId string `protobuf:"bytes,1,opt,name=pmm_agent_id,json=pmmAgentId,proto3" json:"pmm_agent_id,omitempty"` - // Service identifier. - ServiceId string `protobuf:"bytes,2,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` - // MySQL username for getting slowlog data. - Username string `protobuf:"bytes,3,opt,name=username,proto3" json:"username,omitempty"` - // MySQL password for getting slowlog data. - Password string `protobuf:"bytes,4,opt,name=password,proto3" json:"password,omitempty"` - // Use TLS for database connections. - Tls bool `protobuf:"varint,5,opt,name=tls,proto3" json:"tls,omitempty"` - // Skip TLS certificate and hostname validation. - TlsSkipVerify bool `protobuf:"varint,6,opt,name=tls_skip_verify,json=tlsSkipVerify,proto3" json:"tls_skip_verify,omitempty"` - // Certificate Authority certificate chain. - TlsCa string `protobuf:"bytes,7,opt,name=tls_ca,json=tlsCa,proto3" json:"tls_ca,omitempty"` - // Client certificate. - TlsCert string `protobuf:"bytes,8,opt,name=tls_cert,json=tlsCert,proto3" json:"tls_cert,omitempty"` - // Password for decrypting tls_cert. - TlsKey string `protobuf:"bytes,9,opt,name=tls_key,json=tlsKey,proto3" json:"tls_key,omitempty"` - // Limit query length in QAN (default: server-defined; -1: no limit). - MaxQueryLength int32 `protobuf:"varint,10,opt,name=max_query_length,json=maxQueryLength,proto3" json:"max_query_length,omitempty"` - // Disable query examples. - DisableQueryExamples bool `protobuf:"varint,11,opt,name=disable_query_examples,json=disableQueryExamples,proto3" json:"disable_query_examples,omitempty"` - // Rotate slowlog file at this size if > 0. - // Use zero or negative value to disable rotation. - MaxSlowlogFileSize int64 `protobuf:"varint,12,opt,name=max_slowlog_file_size,json=maxSlowlogFileSize,proto3" json:"max_slowlog_file_size,omitempty"` - // Custom user-assigned labels. - CustomLabels map[string]string `protobuf:"bytes,13,rep,name=custom_labels,json=customLabels,proto3" json:"custom_labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - // Skip connection check. - SkipConnectionCheck bool `protobuf:"varint,14,opt,name=skip_connection_check,json=skipConnectionCheck,proto3" json:"skip_connection_check,omitempty"` - // Disable parsing comments from queries and showing them in QAN. - DisableCommentsParsing bool `protobuf:"varint,15,opt,name=disable_comments_parsing,json=disableCommentsParsing,proto3" json:"disable_comments_parsing,omitempty"` - // Log level for exporter. - LogLevel LogLevel `protobuf:"varint,16,opt,name=log_level,json=logLevel,proto3,enum=inventory.v1.LogLevel" json:"log_level,omitempty"` - // Extra DSN parameters for MySQL connection. - ExtraDsnParams map[string]string `protobuf:"bytes,17,rep,name=extra_dsn_params,json=extraDsnParams,proto3" json:"extra_dsn_params,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AddQANMySQLSlowlogAgentParams) Reset() { - *x = AddQANMySQLSlowlogAgentParams{} - mi := &file_inventory_v1_agents_proto_msgTypes[42] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AddQANMySQLSlowlogAgentParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddQANMySQLSlowlogAgentParams) ProtoMessage() {} - -func (x *AddQANMySQLSlowlogAgentParams) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_agents_proto_msgTypes[42] - 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 AddQANMySQLSlowlogAgentParams.ProtoReflect.Descriptor instead. -func (*AddQANMySQLSlowlogAgentParams) Descriptor() ([]byte, []int) { - return file_inventory_v1_agents_proto_rawDescGZIP(), []int{42} -} - -func (x *AddQANMySQLSlowlogAgentParams) GetPmmAgentId() string { - if x != nil { - return x.PmmAgentId - } - return "" -} - -func (x *AddQANMySQLSlowlogAgentParams) GetServiceId() string { - if x != nil { - return x.ServiceId - } - return "" -} - -func (x *AddQANMySQLSlowlogAgentParams) GetUsername() string { - if x != nil { - return x.Username - } - return "" -} - -func (x *AddQANMySQLSlowlogAgentParams) GetPassword() string { - if x != nil { - return x.Password - } - return "" -} - -func (x *AddQANMySQLSlowlogAgentParams) GetTls() bool { - if x != nil { - return x.Tls - } - return false -} - -func (x *AddQANMySQLSlowlogAgentParams) GetTlsSkipVerify() bool { - if x != nil { - return x.TlsSkipVerify - } - return false -} - -func (x *AddQANMySQLSlowlogAgentParams) GetTlsCa() string { - if x != nil { - return x.TlsCa - } - return "" -} - -func (x *AddQANMySQLSlowlogAgentParams) GetTlsCert() string { - if x != nil { - return x.TlsCert - } - return "" -} - -func (x *AddQANMySQLSlowlogAgentParams) GetTlsKey() string { - if x != nil { - return x.TlsKey - } - return "" -} - -func (x *AddQANMySQLSlowlogAgentParams) GetMaxQueryLength() int32 { - if x != nil { - return x.MaxQueryLength - } - return 0 -} - -func (x *AddQANMySQLSlowlogAgentParams) GetDisableQueryExamples() bool { - if x != nil { - return x.DisableQueryExamples - } - return false -} - -func (x *AddQANMySQLSlowlogAgentParams) GetMaxSlowlogFileSize() int64 { - if x != nil { - return x.MaxSlowlogFileSize - } - return 0 -} - -func (x *AddQANMySQLSlowlogAgentParams) GetCustomLabels() map[string]string { - if x != nil { - return x.CustomLabels - } - return nil -} - -func (x *AddQANMySQLSlowlogAgentParams) GetSkipConnectionCheck() bool { - if x != nil { - return x.SkipConnectionCheck - } - return false -} - -func (x *AddQANMySQLSlowlogAgentParams) GetDisableCommentsParsing() bool { - if x != nil { - return x.DisableCommentsParsing - } - return false -} - -func (x *AddQANMySQLSlowlogAgentParams) GetLogLevel() LogLevel { - if x != nil { - return x.LogLevel - } - return LogLevel_LOG_LEVEL_UNSPECIFIED -} - -func (x *AddQANMySQLSlowlogAgentParams) GetExtraDsnParams() map[string]string { - if x != nil { - return x.ExtraDsnParams - } - return nil -} - -type ChangeQANMySQLSlowlogAgentParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Enable this Agent. Agents are enabled by default when they get added. - Enable *bool `protobuf:"varint,1,opt,name=enable,proto3,oneof" json:"enable,omitempty"` - // Replace all custom user-assigned labels. - CustomLabels *common.StringMap `protobuf:"bytes,2,opt,name=custom_labels,json=customLabels,proto3,oneof" json:"custom_labels,omitempty"` - // Enables push metrics with vmagent. - EnablePushMetrics *bool `protobuf:"varint,3,opt,name=enable_push_metrics,json=enablePushMetrics,proto3,oneof" json:"enable_push_metrics,omitempty"` - // Metrics resolution for this agent. - MetricsResolutions *common.MetricsResolutions `protobuf:"bytes,4,opt,name=metrics_resolutions,json=metricsResolutions,proto3" json:"metrics_resolutions,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ChangeQANMySQLSlowlogAgentParams) Reset() { - *x = ChangeQANMySQLSlowlogAgentParams{} - mi := &file_inventory_v1_agents_proto_msgTypes[43] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ChangeQANMySQLSlowlogAgentParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ChangeQANMySQLSlowlogAgentParams) ProtoMessage() {} - -func (x *ChangeQANMySQLSlowlogAgentParams) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_agents_proto_msgTypes[43] - 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 ChangeQANMySQLSlowlogAgentParams.ProtoReflect.Descriptor instead. -func (*ChangeQANMySQLSlowlogAgentParams) Descriptor() ([]byte, []int) { - return file_inventory_v1_agents_proto_rawDescGZIP(), []int{43} -} - -func (x *ChangeQANMySQLSlowlogAgentParams) GetEnable() bool { - if x != nil && x.Enable != nil { - return *x.Enable - } - return false -} - -func (x *ChangeQANMySQLSlowlogAgentParams) GetCustomLabels() *common.StringMap { - if x != nil { - return x.CustomLabels - } - return nil -} - -func (x *ChangeQANMySQLSlowlogAgentParams) GetEnablePushMetrics() bool { - if x != nil && x.EnablePushMetrics != nil { - return *x.EnablePushMetrics - } - return false -} - -func (x *ChangeQANMySQLSlowlogAgentParams) GetMetricsResolutions() *common.MetricsResolutions { - if x != nil { - return x.MetricsResolutions - } - return nil -} - -type AddQANMongoDBProfilerAgentParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The pmm-agent identifier which runs this instance. - PmmAgentId string `protobuf:"bytes,1,opt,name=pmm_agent_id,json=pmmAgentId,proto3" json:"pmm_agent_id,omitempty"` - // Service identifier. - ServiceId string `protobuf:"bytes,2,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` - // MongoDB username for getting profile data. - Username string `protobuf:"bytes,3,opt,name=username,proto3" json:"username,omitempty"` - // MongoDB password for getting profile data. - Password string `protobuf:"bytes,4,opt,name=password,proto3" json:"password,omitempty"` - // Use TLS for database connections. - Tls bool `protobuf:"varint,5,opt,name=tls,proto3" json:"tls,omitempty"` - // Skip TLS certificate and hostname validation. - TlsSkipVerify bool `protobuf:"varint,6,opt,name=tls_skip_verify,json=tlsSkipVerify,proto3" json:"tls_skip_verify,omitempty"` - // Client certificate and key. - TlsCertificateKey string `protobuf:"bytes,7,opt,name=tls_certificate_key,json=tlsCertificateKey,proto3" json:"tls_certificate_key,omitempty"` - // Password for decrypting tls_certificate_key. - TlsCertificateKeyFilePassword string `protobuf:"bytes,8,opt,name=tls_certificate_key_file_password,json=tlsCertificateKeyFilePassword,proto3" json:"tls_certificate_key_file_password,omitempty"` - // Certificate Authority certificate chain. - TlsCa string `protobuf:"bytes,9,opt,name=tls_ca,json=tlsCa,proto3" json:"tls_ca,omitempty"` - // Limit query length in QAN (default: server-defined; -1: no limit). - MaxQueryLength int32 `protobuf:"varint,10,opt,name=max_query_length,json=maxQueryLength,proto3" json:"max_query_length,omitempty"` - // Custom user-assigned labels. - CustomLabels map[string]string `protobuf:"bytes,11,rep,name=custom_labels,json=customLabels,proto3" json:"custom_labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - // Skip connection check. - SkipConnectionCheck bool `protobuf:"varint,12,opt,name=skip_connection_check,json=skipConnectionCheck,proto3" json:"skip_connection_check,omitempty"` - // Authentication mechanism. - // See https://docs.mongodb.com/manual/reference/connection-string/#mongodb-urioption-urioption.authMechanism - // for details. - AuthenticationMechanism string `protobuf:"bytes,13,opt,name=authentication_mechanism,json=authenticationMechanism,proto3" json:"authentication_mechanism,omitempty"` - // Authentication database. - AuthenticationDatabase string `protobuf:"bytes,14,opt,name=authentication_database,json=authenticationDatabase,proto3" json:"authentication_database,omitempty"` - // Log level for exporter. - LogLevel LogLevel `protobuf:"varint,15,opt,name=log_level,json=logLevel,proto3,enum=inventory.v1.LogLevel" json:"log_level,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AddQANMongoDBProfilerAgentParams) Reset() { - *x = AddQANMongoDBProfilerAgentParams{} - mi := &file_inventory_v1_agents_proto_msgTypes[44] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AddQANMongoDBProfilerAgentParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddQANMongoDBProfilerAgentParams) ProtoMessage() {} - -func (x *AddQANMongoDBProfilerAgentParams) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_agents_proto_msgTypes[44] - 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 AddQANMongoDBProfilerAgentParams.ProtoReflect.Descriptor instead. -func (*AddQANMongoDBProfilerAgentParams) Descriptor() ([]byte, []int) { - return file_inventory_v1_agents_proto_rawDescGZIP(), []int{44} -} - -func (x *AddQANMongoDBProfilerAgentParams) GetPmmAgentId() string { - if x != nil { - return x.PmmAgentId - } - return "" -} - -func (x *AddQANMongoDBProfilerAgentParams) GetServiceId() string { - if x != nil { - return x.ServiceId - } - return "" -} - -func (x *AddQANMongoDBProfilerAgentParams) GetUsername() string { - if x != nil { - return x.Username - } - return "" -} - -func (x *AddQANMongoDBProfilerAgentParams) GetPassword() string { - if x != nil { - return x.Password - } - return "" -} - -func (x *AddQANMongoDBProfilerAgentParams) GetTls() bool { - if x != nil { - return x.Tls - } - return false -} - -func (x *AddQANMongoDBProfilerAgentParams) GetTlsSkipVerify() bool { - if x != nil { - return x.TlsSkipVerify - } - return false -} - -func (x *AddQANMongoDBProfilerAgentParams) GetTlsCertificateKey() string { - if x != nil { - return x.TlsCertificateKey - } - return "" -} - -func (x *AddQANMongoDBProfilerAgentParams) GetTlsCertificateKeyFilePassword() string { - if x != nil { - return x.TlsCertificateKeyFilePassword - } - return "" -} - -func (x *AddQANMongoDBProfilerAgentParams) GetTlsCa() string { - if x != nil { - return x.TlsCa - } - return "" -} - -func (x *AddQANMongoDBProfilerAgentParams) GetMaxQueryLength() int32 { - if x != nil { - return x.MaxQueryLength - } - return 0 -} - -func (x *AddQANMongoDBProfilerAgentParams) GetCustomLabels() map[string]string { - if x != nil { - return x.CustomLabels - } - return nil -} - -func (x *AddQANMongoDBProfilerAgentParams) GetSkipConnectionCheck() bool { - if x != nil { - return x.SkipConnectionCheck - } - return false -} - -func (x *AddQANMongoDBProfilerAgentParams) GetAuthenticationMechanism() string { - if x != nil { - return x.AuthenticationMechanism - } - return "" -} - -func (x *AddQANMongoDBProfilerAgentParams) GetAuthenticationDatabase() string { - if x != nil { - return x.AuthenticationDatabase - } - return "" -} - -func (x *AddQANMongoDBProfilerAgentParams) GetLogLevel() LogLevel { - if x != nil { - return x.LogLevel - } - return LogLevel_LOG_LEVEL_UNSPECIFIED -} - -type ChangeQANMongoDBProfilerAgentParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Enable this Agent. Agents are enabled by default when they get added. - Enable *bool `protobuf:"varint,1,opt,name=enable,proto3,oneof" json:"enable,omitempty"` - // Replace all custom user-assigned labels. - CustomLabels *common.StringMap `protobuf:"bytes,2,opt,name=custom_labels,json=customLabels,proto3,oneof" json:"custom_labels,omitempty"` - // Enables push metrics with vmagent. - EnablePushMetrics *bool `protobuf:"varint,3,opt,name=enable_push_metrics,json=enablePushMetrics,proto3,oneof" json:"enable_push_metrics,omitempty"` - // Metrics resolution for this agent. - MetricsResolutions *common.MetricsResolutions `protobuf:"bytes,4,opt,name=metrics_resolutions,json=metricsResolutions,proto3" json:"metrics_resolutions,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ChangeQANMongoDBProfilerAgentParams) Reset() { - *x = ChangeQANMongoDBProfilerAgentParams{} - mi := &file_inventory_v1_agents_proto_msgTypes[45] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ChangeQANMongoDBProfilerAgentParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ChangeQANMongoDBProfilerAgentParams) ProtoMessage() {} - -func (x *ChangeQANMongoDBProfilerAgentParams) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_agents_proto_msgTypes[45] - 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 ChangeQANMongoDBProfilerAgentParams.ProtoReflect.Descriptor instead. -func (*ChangeQANMongoDBProfilerAgentParams) Descriptor() ([]byte, []int) { - return file_inventory_v1_agents_proto_rawDescGZIP(), []int{45} -} - -func (x *ChangeQANMongoDBProfilerAgentParams) GetEnable() bool { - if x != nil && x.Enable != nil { - return *x.Enable - } - return false -} - -func (x *ChangeQANMongoDBProfilerAgentParams) GetCustomLabels() *common.StringMap { - if x != nil { - return x.CustomLabels - } - return nil -} - -func (x *ChangeQANMongoDBProfilerAgentParams) GetEnablePushMetrics() bool { - if x != nil && x.EnablePushMetrics != nil { - return *x.EnablePushMetrics - } - return false -} - -func (x *ChangeQANMongoDBProfilerAgentParams) GetMetricsResolutions() *common.MetricsResolutions { - if x != nil { - return x.MetricsResolutions - } - return nil -} - -type AddQANMongoDBMongologAgentParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The pmm-agent identifier which runs this instance. - PmmAgentId string `protobuf:"bytes,1,opt,name=pmm_agent_id,json=pmmAgentId,proto3" json:"pmm_agent_id,omitempty"` - // Service identifier. - ServiceId string `protobuf:"bytes,2,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` - // MongoDB username for getting profile data. - Username string `protobuf:"bytes,3,opt,name=username,proto3" json:"username,omitempty"` - // MongoDB password for getting profile data. - Password string `protobuf:"bytes,4,opt,name=password,proto3" json:"password,omitempty"` - // Use TLS for database connections. - Tls bool `protobuf:"varint,5,opt,name=tls,proto3" json:"tls,omitempty"` - // Skip TLS certificate and hostname validation. - TlsSkipVerify bool `protobuf:"varint,6,opt,name=tls_skip_verify,json=tlsSkipVerify,proto3" json:"tls_skip_verify,omitempty"` - // Client certificate and key. - TlsCertificateKey string `protobuf:"bytes,7,opt,name=tls_certificate_key,json=tlsCertificateKey,proto3" json:"tls_certificate_key,omitempty"` - // Password for decrypting tls_certificate_key. - TlsCertificateKeyFilePassword string `protobuf:"bytes,8,opt,name=tls_certificate_key_file_password,json=tlsCertificateKeyFilePassword,proto3" json:"tls_certificate_key_file_password,omitempty"` - // Certificate Authority certificate chain. - TlsCa string `protobuf:"bytes,9,opt,name=tls_ca,json=tlsCa,proto3" json:"tls_ca,omitempty"` - // Limit query length in QAN (default: server-defined; -1: no limit). - MaxQueryLength int32 `protobuf:"varint,10,opt,name=max_query_length,json=maxQueryLength,proto3" json:"max_query_length,omitempty"` - // Custom user-assigned labels. - CustomLabels map[string]string `protobuf:"bytes,11,rep,name=custom_labels,json=customLabels,proto3" json:"custom_labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - // Skip connection check. - SkipConnectionCheck bool `protobuf:"varint,12,opt,name=skip_connection_check,json=skipConnectionCheck,proto3" json:"skip_connection_check,omitempty"` - // Authentication mechanism. - // See https://docs.mongodb.com/manual/reference/connection-string/#mongodb-urioption-urioption.authMechanism - // for details. - AuthenticationMechanism string `protobuf:"bytes,13,opt,name=authentication_mechanism,json=authenticationMechanism,proto3" json:"authentication_mechanism,omitempty"` - // Authentication database. - AuthenticationDatabase string `protobuf:"bytes,14,opt,name=authentication_database,json=authenticationDatabase,proto3" json:"authentication_database,omitempty"` - // Log level for exporter. - LogLevel LogLevel `protobuf:"varint,15,opt,name=log_level,json=logLevel,proto3,enum=inventory.v1.LogLevel" json:"log_level,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AddQANMongoDBMongologAgentParams) Reset() { - *x = AddQANMongoDBMongologAgentParams{} - mi := &file_inventory_v1_agents_proto_msgTypes[46] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AddQANMongoDBMongologAgentParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddQANMongoDBMongologAgentParams) ProtoMessage() {} - -func (x *AddQANMongoDBMongologAgentParams) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_agents_proto_msgTypes[46] - 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 AddQANMongoDBMongologAgentParams.ProtoReflect.Descriptor instead. -func (*AddQANMongoDBMongologAgentParams) Descriptor() ([]byte, []int) { - return file_inventory_v1_agents_proto_rawDescGZIP(), []int{46} -} - -func (x *AddQANMongoDBMongologAgentParams) GetPmmAgentId() string { - if x != nil { - return x.PmmAgentId - } - return "" -} - -func (x *AddQANMongoDBMongologAgentParams) GetServiceId() string { - if x != nil { - return x.ServiceId - } - return "" -} - -func (x *AddQANMongoDBMongologAgentParams) GetUsername() string { - if x != nil { - return x.Username - } - return "" -} - -func (x *AddQANMongoDBMongologAgentParams) GetPassword() string { - if x != nil { - return x.Password - } - return "" -} - -func (x *AddQANMongoDBMongologAgentParams) GetTls() bool { - if x != nil { - return x.Tls - } - return false -} - -func (x *AddQANMongoDBMongologAgentParams) GetTlsSkipVerify() bool { - if x != nil { - return x.TlsSkipVerify - } - return false -} - -func (x *AddQANMongoDBMongologAgentParams) GetTlsCertificateKey() string { - if x != nil { - return x.TlsCertificateKey - } - return "" -} - -func (x *AddQANMongoDBMongologAgentParams) GetTlsCertificateKeyFilePassword() string { - if x != nil { - return x.TlsCertificateKeyFilePassword - } - return "" -} - -func (x *AddQANMongoDBMongologAgentParams) GetTlsCa() string { - if x != nil { - return x.TlsCa - } - return "" -} - -func (x *AddQANMongoDBMongologAgentParams) GetMaxQueryLength() int32 { - if x != nil { - return x.MaxQueryLength - } - return 0 -} - -func (x *AddQANMongoDBMongologAgentParams) GetCustomLabels() map[string]string { - if x != nil { - return x.CustomLabels - } - return nil -} - -func (x *AddQANMongoDBMongologAgentParams) GetSkipConnectionCheck() bool { - if x != nil { - return x.SkipConnectionCheck - } - return false -} - -func (x *AddQANMongoDBMongologAgentParams) GetAuthenticationMechanism() string { - if x != nil { - return x.AuthenticationMechanism - } - return "" -} - -func (x *AddQANMongoDBMongologAgentParams) GetAuthenticationDatabase() string { - if x != nil { - return x.AuthenticationDatabase - } - return "" -} - -func (x *AddQANMongoDBMongologAgentParams) GetLogLevel() LogLevel { - if x != nil { - return x.LogLevel - } - return LogLevel_LOG_LEVEL_UNSPECIFIED -} - -type ChangeQANMongoDBMongologAgentParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Enable this Agent. Agents are enabled by default when they get added. - Enable *bool `protobuf:"varint,1,opt,name=enable,proto3,oneof" json:"enable,omitempty"` - // Replace all custom user-assigned labels. - CustomLabels *common.StringMap `protobuf:"bytes,2,opt,name=custom_labels,json=customLabels,proto3,oneof" json:"custom_labels,omitempty"` - // Enables push metrics with vmagent. - EnablePushMetrics *bool `protobuf:"varint,3,opt,name=enable_push_metrics,json=enablePushMetrics,proto3,oneof" json:"enable_push_metrics,omitempty"` - // Metrics resolution for this agent. - MetricsResolutions *common.MetricsResolutions `protobuf:"bytes,4,opt,name=metrics_resolutions,json=metricsResolutions,proto3" json:"metrics_resolutions,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ChangeQANMongoDBMongologAgentParams) Reset() { - *x = ChangeQANMongoDBMongologAgentParams{} - mi := &file_inventory_v1_agents_proto_msgTypes[47] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ChangeQANMongoDBMongologAgentParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ChangeQANMongoDBMongologAgentParams) ProtoMessage() {} - -func (x *ChangeQANMongoDBMongologAgentParams) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_agents_proto_msgTypes[47] - 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 ChangeQANMongoDBMongologAgentParams.ProtoReflect.Descriptor instead. -func (*ChangeQANMongoDBMongologAgentParams) Descriptor() ([]byte, []int) { - return file_inventory_v1_agents_proto_rawDescGZIP(), []int{47} -} - -func (x *ChangeQANMongoDBMongologAgentParams) GetEnable() bool { - if x != nil && x.Enable != nil { - return *x.Enable - } - return false -} - -func (x *ChangeQANMongoDBMongologAgentParams) GetCustomLabels() *common.StringMap { - if x != nil { - return x.CustomLabels - } - return nil -} - -func (x *ChangeQANMongoDBMongologAgentParams) GetEnablePushMetrics() bool { - if x != nil && x.EnablePushMetrics != nil { - return *x.EnablePushMetrics - } - return false -} - -func (x *ChangeQANMongoDBMongologAgentParams) GetMetricsResolutions() *common.MetricsResolutions { - if x != nil { - return x.MetricsResolutions - } - return nil -} - -type AddQANPostgreSQLPgStatementsAgentParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The pmm-agent identifier which runs this instance. - PmmAgentId string `protobuf:"bytes,1,opt,name=pmm_agent_id,json=pmmAgentId,proto3" json:"pmm_agent_id,omitempty"` - // Service identifier. - ServiceId string `protobuf:"bytes,2,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` - // PostgreSQL username for getting pg stat statements data. - Username string `protobuf:"bytes,3,opt,name=username,proto3" json:"username,omitempty"` - // PostgreSQL password for getting pg stat statements data. - Password string `protobuf:"bytes,4,opt,name=password,proto3" json:"password,omitempty"` - // Use TLS for database connections. - Tls bool `protobuf:"varint,5,opt,name=tls,proto3" json:"tls,omitempty"` - // Skip TLS certificate and hostname validation. - TlsSkipVerify bool `protobuf:"varint,6,opt,name=tls_skip_verify,json=tlsSkipVerify,proto3" json:"tls_skip_verify,omitempty"` - // Custom user-assigned labels. - CustomLabels map[string]string `protobuf:"bytes,7,rep,name=custom_labels,json=customLabels,proto3" json:"custom_labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - // Skip connection check. - SkipConnectionCheck bool `protobuf:"varint,8,opt,name=skip_connection_check,json=skipConnectionCheck,proto3" json:"skip_connection_check,omitempty"` - // Disable parsing comments from queries and showing them in QAN. - DisableCommentsParsing bool `protobuf:"varint,9,opt,name=disable_comments_parsing,json=disableCommentsParsing,proto3" json:"disable_comments_parsing,omitempty"` - // Limit query length in QAN (default: server-defined; -1: no limit). - MaxQueryLength int32 `protobuf:"varint,10,opt,name=max_query_length,json=maxQueryLength,proto3" json:"max_query_length,omitempty"` - // TLS CA certificate. - TlsCa string `protobuf:"bytes,11,opt,name=tls_ca,json=tlsCa,proto3" json:"tls_ca,omitempty"` - // TLS Certifcate. - TlsCert string `protobuf:"bytes,12,opt,name=tls_cert,json=tlsCert,proto3" json:"tls_cert,omitempty"` - // TLS Certificate Key. - TlsKey string `protobuf:"bytes,13,opt,name=tls_key,json=tlsKey,proto3" json:"tls_key,omitempty"` - // Log level for exporter. - LogLevel LogLevel `protobuf:"varint,14,opt,name=log_level,json=logLevel,proto3,enum=inventory.v1.LogLevel" json:"log_level,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AddQANPostgreSQLPgStatementsAgentParams) Reset() { - *x = AddQANPostgreSQLPgStatementsAgentParams{} - mi := &file_inventory_v1_agents_proto_msgTypes[48] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AddQANPostgreSQLPgStatementsAgentParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddQANPostgreSQLPgStatementsAgentParams) ProtoMessage() {} - -func (x *AddQANPostgreSQLPgStatementsAgentParams) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_agents_proto_msgTypes[48] - 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 AddQANPostgreSQLPgStatementsAgentParams.ProtoReflect.Descriptor instead. -func (*AddQANPostgreSQLPgStatementsAgentParams) Descriptor() ([]byte, []int) { - return file_inventory_v1_agents_proto_rawDescGZIP(), []int{48} -} - -func (x *AddQANPostgreSQLPgStatementsAgentParams) GetPmmAgentId() string { - if x != nil { - return x.PmmAgentId - } - return "" -} - -func (x *AddQANPostgreSQLPgStatementsAgentParams) GetServiceId() string { - if x != nil { - return x.ServiceId - } - return "" -} - -func (x *AddQANPostgreSQLPgStatementsAgentParams) GetUsername() string { - if x != nil { - return x.Username - } - return "" -} - -func (x *AddQANPostgreSQLPgStatementsAgentParams) GetPassword() string { - if x != nil { - return x.Password - } - return "" -} - -func (x *AddQANPostgreSQLPgStatementsAgentParams) GetTls() bool { - if x != nil { - return x.Tls - } - return false -} - -func (x *AddQANPostgreSQLPgStatementsAgentParams) GetTlsSkipVerify() bool { - if x != nil { - return x.TlsSkipVerify - } - return false -} - -func (x *AddQANPostgreSQLPgStatementsAgentParams) GetCustomLabels() map[string]string { - if x != nil { - return x.CustomLabels - } - return nil -} - -func (x *AddQANPostgreSQLPgStatementsAgentParams) GetSkipConnectionCheck() bool { - if x != nil { - return x.SkipConnectionCheck - } - return false -} - -func (x *AddQANPostgreSQLPgStatementsAgentParams) GetDisableCommentsParsing() bool { - if x != nil { - return x.DisableCommentsParsing - } - return false -} - -func (x *AddQANPostgreSQLPgStatementsAgentParams) GetMaxQueryLength() int32 { - if x != nil { - return x.MaxQueryLength - } - return 0 -} - -func (x *AddQANPostgreSQLPgStatementsAgentParams) GetTlsCa() string { - if x != nil { - return x.TlsCa - } - return "" -} - -func (x *AddQANPostgreSQLPgStatementsAgentParams) GetTlsCert() string { - if x != nil { - return x.TlsCert - } - return "" -} - -func (x *AddQANPostgreSQLPgStatementsAgentParams) GetTlsKey() string { - if x != nil { - return x.TlsKey - } - return "" -} - -func (x *AddQANPostgreSQLPgStatementsAgentParams) GetLogLevel() LogLevel { - if x != nil { - return x.LogLevel - } - return LogLevel_LOG_LEVEL_UNSPECIFIED -} - -type ChangeQANPostgreSQLPgStatementsAgentParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Enable this Agent. Agents are enabled by default when they get added. - Enable *bool `protobuf:"varint,1,opt,name=enable,proto3,oneof" json:"enable,omitempty"` - // Replace all custom user-assigned labels. - CustomLabels *common.StringMap `protobuf:"bytes,2,opt,name=custom_labels,json=customLabels,proto3,oneof" json:"custom_labels,omitempty"` - // Enables push metrics with vmagent. - EnablePushMetrics *bool `protobuf:"varint,3,opt,name=enable_push_metrics,json=enablePushMetrics,proto3,oneof" json:"enable_push_metrics,omitempty"` - // Metrics resolution for this agent. - MetricsResolutions *common.MetricsResolutions `protobuf:"bytes,4,opt,name=metrics_resolutions,json=metricsResolutions,proto3" json:"metrics_resolutions,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ChangeQANPostgreSQLPgStatementsAgentParams) Reset() { - *x = ChangeQANPostgreSQLPgStatementsAgentParams{} - mi := &file_inventory_v1_agents_proto_msgTypes[49] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ChangeQANPostgreSQLPgStatementsAgentParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ChangeQANPostgreSQLPgStatementsAgentParams) ProtoMessage() {} - -func (x *ChangeQANPostgreSQLPgStatementsAgentParams) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_agents_proto_msgTypes[49] - 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 ChangeQANPostgreSQLPgStatementsAgentParams.ProtoReflect.Descriptor instead. -func (*ChangeQANPostgreSQLPgStatementsAgentParams) Descriptor() ([]byte, []int) { - return file_inventory_v1_agents_proto_rawDescGZIP(), []int{49} -} - -func (x *ChangeQANPostgreSQLPgStatementsAgentParams) GetEnable() bool { - if x != nil && x.Enable != nil { - return *x.Enable - } - return false -} - -func (x *ChangeQANPostgreSQLPgStatementsAgentParams) GetCustomLabels() *common.StringMap { - if x != nil { - return x.CustomLabels - } - return nil -} - -func (x *ChangeQANPostgreSQLPgStatementsAgentParams) GetEnablePushMetrics() bool { - if x != nil && x.EnablePushMetrics != nil { - return *x.EnablePushMetrics - } - return false -} - -func (x *ChangeQANPostgreSQLPgStatementsAgentParams) GetMetricsResolutions() *common.MetricsResolutions { - if x != nil { - return x.MetricsResolutions - } - return nil -} - -type AddQANPostgreSQLPgStatMonitorAgentParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The pmm-agent identifier which runs this instance. - PmmAgentId string `protobuf:"bytes,1,opt,name=pmm_agent_id,json=pmmAgentId,proto3" json:"pmm_agent_id,omitempty"` - // Service identifier. - ServiceId string `protobuf:"bytes,2,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` - // PostgreSQL username for getting pg stat monitor data. - Username string `protobuf:"bytes,3,opt,name=username,proto3" json:"username,omitempty"` - // PostgreSQL password for getting pg stat monitor data. - Password string `protobuf:"bytes,4,opt,name=password,proto3" json:"password,omitempty"` - // Use TLS for database connections. - Tls bool `protobuf:"varint,5,opt,name=tls,proto3" json:"tls,omitempty"` - // Skip TLS certificate and hostname validation. - TlsSkipVerify bool `protobuf:"varint,6,opt,name=tls_skip_verify,json=tlsSkipVerify,proto3" json:"tls_skip_verify,omitempty"` - // Limit query length in QAN (default: server-defined; -1: no limit). - MaxQueryLength int32 `protobuf:"varint,7,opt,name=max_query_length,json=maxQueryLength,proto3" json:"max_query_length,omitempty"` - // Disable query examples. - DisableQueryExamples bool `protobuf:"varint,8,opt,name=disable_query_examples,json=disableQueryExamples,proto3" json:"disable_query_examples,omitempty"` - // Custom user-assigned labels. - CustomLabels map[string]string `protobuf:"bytes,9,rep,name=custom_labels,json=customLabels,proto3" json:"custom_labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - // Skip connection check. - SkipConnectionCheck bool `protobuf:"varint,10,opt,name=skip_connection_check,json=skipConnectionCheck,proto3" json:"skip_connection_check,omitempty"` - // Disable parsing comments from queries and showing them in QAN. - DisableCommentsParsing bool `protobuf:"varint,11,opt,name=disable_comments_parsing,json=disableCommentsParsing,proto3" json:"disable_comments_parsing,omitempty"` - // TLS CA certificate. - TlsCa string `protobuf:"bytes,12,opt,name=tls_ca,json=tlsCa,proto3" json:"tls_ca,omitempty"` - // TLS Certifcate. - TlsCert string `protobuf:"bytes,13,opt,name=tls_cert,json=tlsCert,proto3" json:"tls_cert,omitempty"` - // TLS Certificate Key. - TlsKey string `protobuf:"bytes,14,opt,name=tls_key,json=tlsKey,proto3" json:"tls_key,omitempty"` - // Log level for exporter. - LogLevel LogLevel `protobuf:"varint,15,opt,name=log_level,json=logLevel,proto3,enum=inventory.v1.LogLevel" json:"log_level,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AddQANPostgreSQLPgStatMonitorAgentParams) Reset() { - *x = AddQANPostgreSQLPgStatMonitorAgentParams{} - mi := &file_inventory_v1_agents_proto_msgTypes[50] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AddQANPostgreSQLPgStatMonitorAgentParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddQANPostgreSQLPgStatMonitorAgentParams) ProtoMessage() {} - -func (x *AddQANPostgreSQLPgStatMonitorAgentParams) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_agents_proto_msgTypes[50] - 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 AddQANPostgreSQLPgStatMonitorAgentParams.ProtoReflect.Descriptor instead. -func (*AddQANPostgreSQLPgStatMonitorAgentParams) Descriptor() ([]byte, []int) { - return file_inventory_v1_agents_proto_rawDescGZIP(), []int{50} -} - -func (x *AddQANPostgreSQLPgStatMonitorAgentParams) GetPmmAgentId() string { - if x != nil { - return x.PmmAgentId - } - return "" -} - -func (x *AddQANPostgreSQLPgStatMonitorAgentParams) GetServiceId() string { - if x != nil { - return x.ServiceId - } - return "" -} - -func (x *AddQANPostgreSQLPgStatMonitorAgentParams) GetUsername() string { - if x != nil { - return x.Username - } - return "" -} - -func (x *AddQANPostgreSQLPgStatMonitorAgentParams) GetPassword() string { - if x != nil { - return x.Password - } - return "" -} - -func (x *AddQANPostgreSQLPgStatMonitorAgentParams) GetTls() bool { - if x != nil { - return x.Tls - } - return false -} - -func (x *AddQANPostgreSQLPgStatMonitorAgentParams) GetTlsSkipVerify() bool { - if x != nil { - return x.TlsSkipVerify - } - return false -} - -func (x *AddQANPostgreSQLPgStatMonitorAgentParams) GetMaxQueryLength() int32 { - if x != nil { - return x.MaxQueryLength - } - return 0 -} - -func (x *AddQANPostgreSQLPgStatMonitorAgentParams) GetDisableQueryExamples() bool { - if x != nil { - return x.DisableQueryExamples - } - return false -} - -func (x *AddQANPostgreSQLPgStatMonitorAgentParams) GetCustomLabels() map[string]string { - if x != nil { - return x.CustomLabels - } - return nil -} - -func (x *AddQANPostgreSQLPgStatMonitorAgentParams) GetSkipConnectionCheck() bool { - if x != nil { - return x.SkipConnectionCheck - } - return false -} - -func (x *AddQANPostgreSQLPgStatMonitorAgentParams) GetDisableCommentsParsing() bool { - if x != nil { - return x.DisableCommentsParsing - } - return false -} - -func (x *AddQANPostgreSQLPgStatMonitorAgentParams) GetTlsCa() string { - if x != nil { - return x.TlsCa - } - return "" -} - -func (x *AddQANPostgreSQLPgStatMonitorAgentParams) GetTlsCert() string { - if x != nil { - return x.TlsCert - } - return "" -} - -func (x *AddQANPostgreSQLPgStatMonitorAgentParams) GetTlsKey() string { - if x != nil { - return x.TlsKey - } - return "" -} - -func (x *AddQANPostgreSQLPgStatMonitorAgentParams) GetLogLevel() LogLevel { - if x != nil { - return x.LogLevel - } - return LogLevel_LOG_LEVEL_UNSPECIFIED -} - -type ChangeQANPostgreSQLPgStatMonitorAgentParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Enable this Agent. Agents are enabled by default when they get added. - Enable *bool `protobuf:"varint,1,opt,name=enable,proto3,oneof" json:"enable,omitempty"` - // Replace all custom user-assigned labels. - CustomLabels *common.StringMap `protobuf:"bytes,2,opt,name=custom_labels,json=customLabels,proto3,oneof" json:"custom_labels,omitempty"` - // Enables push metrics with vmagent. - EnablePushMetrics *bool `protobuf:"varint,3,opt,name=enable_push_metrics,json=enablePushMetrics,proto3,oneof" json:"enable_push_metrics,omitempty"` - // Metrics resolution for this agent. - MetricsResolutions *common.MetricsResolutions `protobuf:"bytes,4,opt,name=metrics_resolutions,json=metricsResolutions,proto3" json:"metrics_resolutions,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ChangeQANPostgreSQLPgStatMonitorAgentParams) Reset() { - *x = ChangeQANPostgreSQLPgStatMonitorAgentParams{} - mi := &file_inventory_v1_agents_proto_msgTypes[51] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ChangeQANPostgreSQLPgStatMonitorAgentParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ChangeQANPostgreSQLPgStatMonitorAgentParams) ProtoMessage() {} - -func (x *ChangeQANPostgreSQLPgStatMonitorAgentParams) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_agents_proto_msgTypes[51] - 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 ChangeQANPostgreSQLPgStatMonitorAgentParams.ProtoReflect.Descriptor instead. -func (*ChangeQANPostgreSQLPgStatMonitorAgentParams) Descriptor() ([]byte, []int) { - return file_inventory_v1_agents_proto_rawDescGZIP(), []int{51} -} - -func (x *ChangeQANPostgreSQLPgStatMonitorAgentParams) GetEnable() bool { - if x != nil && x.Enable != nil { - return *x.Enable - } - return false -} - -func (x *ChangeQANPostgreSQLPgStatMonitorAgentParams) GetCustomLabels() *common.StringMap { - if x != nil { - return x.CustomLabels - } - return nil -} - -func (x *ChangeQANPostgreSQLPgStatMonitorAgentParams) GetEnablePushMetrics() bool { - if x != nil && x.EnablePushMetrics != nil { - return *x.EnablePushMetrics - } - return false -} - -func (x *ChangeQANPostgreSQLPgStatMonitorAgentParams) GetMetricsResolutions() *common.MetricsResolutions { - if x != nil { - return x.MetricsResolutions - } - return nil -} - -type AddRDSExporterParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The pmm-agent identifier which runs this instance. - PmmAgentId string `protobuf:"bytes,1,opt,name=pmm_agent_id,json=pmmAgentId,proto3" json:"pmm_agent_id,omitempty"` - // Node identifier. - NodeId string `protobuf:"bytes,2,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` - // AWS Access Key. - AwsAccessKey string `protobuf:"bytes,3,opt,name=aws_access_key,json=awsAccessKey,proto3" json:"aws_access_key,omitempty"` - // AWS Secret Key. - AwsSecretKey string `protobuf:"bytes,4,opt,name=aws_secret_key,json=awsSecretKey,proto3" json:"aws_secret_key,omitempty"` - // Custom user-assigned labels. - CustomLabels map[string]string `protobuf:"bytes,5,rep,name=custom_labels,json=customLabels,proto3" json:"custom_labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - // Skip connection check. - SkipConnectionCheck bool `protobuf:"varint,6,opt,name=skip_connection_check,json=skipConnectionCheck,proto3" json:"skip_connection_check,omitempty"` - // Disable basic metrics. - DisableBasicMetrics bool `protobuf:"varint,7,opt,name=disable_basic_metrics,json=disableBasicMetrics,proto3" json:"disable_basic_metrics,omitempty"` - // Disable enhanced metrics. - DisableEnhancedMetrics bool `protobuf:"varint,8,opt,name=disable_enhanced_metrics,json=disableEnhancedMetrics,proto3" json:"disable_enhanced_metrics,omitempty"` - // Enables push metrics mode for exporter. - PushMetrics bool `protobuf:"varint,9,opt,name=push_metrics,json=pushMetrics,proto3" json:"push_metrics,omitempty"` - // Log level for exporter. - LogLevel LogLevel `protobuf:"varint,10,opt,name=log_level,json=logLevel,proto3,enum=inventory.v1.LogLevel" json:"log_level,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AddRDSExporterParams) Reset() { - *x = AddRDSExporterParams{} - mi := &file_inventory_v1_agents_proto_msgTypes[52] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AddRDSExporterParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddRDSExporterParams) ProtoMessage() {} - -func (x *AddRDSExporterParams) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_agents_proto_msgTypes[52] - 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 AddRDSExporterParams.ProtoReflect.Descriptor instead. -func (*AddRDSExporterParams) Descriptor() ([]byte, []int) { - return file_inventory_v1_agents_proto_rawDescGZIP(), []int{52} -} - -func (x *AddRDSExporterParams) GetPmmAgentId() string { - if x != nil { - return x.PmmAgentId - } - return "" -} - -func (x *AddRDSExporterParams) GetNodeId() string { - if x != nil { - return x.NodeId - } - return "" -} - -func (x *AddRDSExporterParams) GetAwsAccessKey() string { - if x != nil { - return x.AwsAccessKey - } - return "" -} - -func (x *AddRDSExporterParams) GetAwsSecretKey() string { - if x != nil { - return x.AwsSecretKey - } - return "" -} - -func (x *AddRDSExporterParams) GetCustomLabels() map[string]string { - if x != nil { - return x.CustomLabels - } - return nil -} - -func (x *AddRDSExporterParams) GetSkipConnectionCheck() bool { - if x != nil { - return x.SkipConnectionCheck - } - return false -} - -func (x *AddRDSExporterParams) GetDisableBasicMetrics() bool { - if x != nil { - return x.DisableBasicMetrics - } - return false -} - -func (x *AddRDSExporterParams) GetDisableEnhancedMetrics() bool { - if x != nil { - return x.DisableEnhancedMetrics - } - return false -} - -func (x *AddRDSExporterParams) GetPushMetrics() bool { - if x != nil { - return x.PushMetrics - } - return false -} - -func (x *AddRDSExporterParams) GetLogLevel() LogLevel { - if x != nil { - return x.LogLevel - } - return LogLevel_LOG_LEVEL_UNSPECIFIED -} - -type ChangeRDSExporterParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Enable this Agent. Agents are enabled by default when they get added. - Enable *bool `protobuf:"varint,1,opt,name=enable,proto3,oneof" json:"enable,omitempty"` - // Replace all custom user-assigned labels. - CustomLabels *common.StringMap `protobuf:"bytes,2,opt,name=custom_labels,json=customLabels,proto3,oneof" json:"custom_labels,omitempty"` - // Enables push metrics with vmagent. - EnablePushMetrics *bool `protobuf:"varint,3,opt,name=enable_push_metrics,json=enablePushMetrics,proto3,oneof" json:"enable_push_metrics,omitempty"` - // Metrics resolution for this agent. - MetricsResolutions *common.MetricsResolutions `protobuf:"bytes,4,opt,name=metrics_resolutions,json=metricsResolutions,proto3" json:"metrics_resolutions,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ChangeRDSExporterParams) Reset() { - *x = ChangeRDSExporterParams{} - mi := &file_inventory_v1_agents_proto_msgTypes[53] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ChangeRDSExporterParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ChangeRDSExporterParams) ProtoMessage() {} - -func (x *ChangeRDSExporterParams) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_agents_proto_msgTypes[53] - 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 ChangeRDSExporterParams.ProtoReflect.Descriptor instead. -func (*ChangeRDSExporterParams) Descriptor() ([]byte, []int) { - return file_inventory_v1_agents_proto_rawDescGZIP(), []int{53} -} - -func (x *ChangeRDSExporterParams) GetEnable() bool { - if x != nil && x.Enable != nil { - return *x.Enable - } - return false -} - -func (x *ChangeRDSExporterParams) GetCustomLabels() *common.StringMap { - if x != nil { - return x.CustomLabels - } - return nil -} - -func (x *ChangeRDSExporterParams) GetEnablePushMetrics() bool { - if x != nil && x.EnablePushMetrics != nil { - return *x.EnablePushMetrics - } - return false -} - -func (x *ChangeRDSExporterParams) GetMetricsResolutions() *common.MetricsResolutions { - if x != nil { - return x.MetricsResolutions - } - return nil -} - -type AddExternalExporterParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The node identifier where this instance is run. - RunsOnNodeId string `protobuf:"bytes,1,opt,name=runs_on_node_id,json=runsOnNodeId,proto3" json:"runs_on_node_id,omitempty"` - // Service identifier. - ServiceId string `protobuf:"bytes,2,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` - // HTTP basic auth username for collecting metrics. - Username string `protobuf:"bytes,3,opt,name=username,proto3" json:"username,omitempty"` - // HTTP basic auth password for collecting metrics. - Password string `protobuf:"bytes,4,opt,name=password,proto3" json:"password,omitempty"` - // Scheme to generate URI to exporter metrics endpoints(default: http). - Scheme string `protobuf:"bytes,6,opt,name=scheme,proto3" json:"scheme,omitempty"` - // Path under which metrics are exposed, used to generate URI(default: /metrics). - MetricsPath string `protobuf:"bytes,7,opt,name=metrics_path,json=metricsPath,proto3" json:"metrics_path,omitempty"` - // Listen port for scraping metrics. - ListenPort uint32 `protobuf:"varint,8,opt,name=listen_port,json=listenPort,proto3" json:"listen_port,omitempty"` - // Custom user-assigned labels. - CustomLabels map[string]string `protobuf:"bytes,10,rep,name=custom_labels,json=customLabels,proto3" json:"custom_labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - // Enables push metrics mode for exporter. - PushMetrics bool `protobuf:"varint,11,opt,name=push_metrics,json=pushMetrics,proto3" json:"push_metrics,omitempty"` - // Skip TLS certificate and hostname verification. - TlsSkipVerify bool `protobuf:"varint,12,opt,name=tls_skip_verify,json=tlsSkipVerify,proto3" json:"tls_skip_verify,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AddExternalExporterParams) Reset() { - *x = AddExternalExporterParams{} - mi := &file_inventory_v1_agents_proto_msgTypes[54] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AddExternalExporterParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddExternalExporterParams) ProtoMessage() {} - -func (x *AddExternalExporterParams) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_agents_proto_msgTypes[54] - 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 AddExternalExporterParams.ProtoReflect.Descriptor instead. -func (*AddExternalExporterParams) Descriptor() ([]byte, []int) { - return file_inventory_v1_agents_proto_rawDescGZIP(), []int{54} -} - -func (x *AddExternalExporterParams) GetRunsOnNodeId() string { - if x != nil { - return x.RunsOnNodeId - } - return "" -} - -func (x *AddExternalExporterParams) GetServiceId() string { - if x != nil { - return x.ServiceId - } - return "" -} - -func (x *AddExternalExporterParams) GetUsername() string { - if x != nil { - return x.Username - } - return "" -} - -func (x *AddExternalExporterParams) GetPassword() string { - if x != nil { - return x.Password - } - return "" -} - -func (x *AddExternalExporterParams) GetScheme() string { - if x != nil { - return x.Scheme - } - return "" -} - -func (x *AddExternalExporterParams) GetMetricsPath() string { - if x != nil { - return x.MetricsPath - } - return "" -} - -func (x *AddExternalExporterParams) GetListenPort() uint32 { - if x != nil { - return x.ListenPort - } - return 0 -} - -func (x *AddExternalExporterParams) GetCustomLabels() map[string]string { - if x != nil { - return x.CustomLabels - } - return nil -} - -func (x *AddExternalExporterParams) GetPushMetrics() bool { - if x != nil { - return x.PushMetrics - } - return false -} - -func (x *AddExternalExporterParams) GetTlsSkipVerify() bool { - if x != nil { - return x.TlsSkipVerify - } - return false -} - -type ChangeExternalExporterParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Enable this Agent. Agents are enabled by default when they get added. - Enable *bool `protobuf:"varint,1,opt,name=enable,proto3,oneof" json:"enable,omitempty"` - // Replace all custom user-assigned labels. - CustomLabels *common.StringMap `protobuf:"bytes,2,opt,name=custom_labels,json=customLabels,proto3,oneof" json:"custom_labels,omitempty"` - // Enables push metrics with vmagent. - EnablePushMetrics *bool `protobuf:"varint,3,opt,name=enable_push_metrics,json=enablePushMetrics,proto3,oneof" json:"enable_push_metrics,omitempty"` - // Metrics resolution for this agent. - MetricsResolutions *common.MetricsResolutions `protobuf:"bytes,4,opt,name=metrics_resolutions,json=metricsResolutions,proto3" json:"metrics_resolutions,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ChangeExternalExporterParams) Reset() { - *x = ChangeExternalExporterParams{} - mi := &file_inventory_v1_agents_proto_msgTypes[55] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ChangeExternalExporterParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ChangeExternalExporterParams) ProtoMessage() {} - -func (x *ChangeExternalExporterParams) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_agents_proto_msgTypes[55] - 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 ChangeExternalExporterParams.ProtoReflect.Descriptor instead. -func (*ChangeExternalExporterParams) Descriptor() ([]byte, []int) { - return file_inventory_v1_agents_proto_rawDescGZIP(), []int{55} -} - -func (x *ChangeExternalExporterParams) GetEnable() bool { - if x != nil && x.Enable != nil { - return *x.Enable - } - return false -} - -func (x *ChangeExternalExporterParams) GetCustomLabels() *common.StringMap { - if x != nil { - return x.CustomLabels - } - return nil -} - -func (x *ChangeExternalExporterParams) GetEnablePushMetrics() bool { - if x != nil && x.EnablePushMetrics != nil { - return *x.EnablePushMetrics - } - return false -} - -func (x *ChangeExternalExporterParams) GetMetricsResolutions() *common.MetricsResolutions { - if x != nil { - return x.MetricsResolutions - } - return nil -} - -type AddAzureDatabaseExporterParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The pmm-agent identifier which runs this instance. - PmmAgentId string `protobuf:"bytes,1,opt,name=pmm_agent_id,json=pmmAgentId,proto3" json:"pmm_agent_id,omitempty"` - // Node identifier. - NodeId string `protobuf:"bytes,2,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` - // Azure client ID - AzureClientId string `protobuf:"bytes,3,opt,name=azure_client_id,json=azureClientId,proto3" json:"azure_client_id,omitempty"` - // Azure client secret - AzureClientSecret string `protobuf:"bytes,4,opt,name=azure_client_secret,json=azureClientSecret,proto3" json:"azure_client_secret,omitempty"` - // Azure tanant ID - AzureTenantId string `protobuf:"bytes,5,opt,name=azure_tenant_id,json=azureTenantId,proto3" json:"azure_tenant_id,omitempty"` - // Azure subscription ID - AzureSubscriptionId string `protobuf:"bytes,6,opt,name=azure_subscription_id,json=azureSubscriptionId,proto3" json:"azure_subscription_id,omitempty"` - // Azure resource group. - AzureResourceGroup string `protobuf:"bytes,7,opt,name=azure_resource_group,json=azureResourceGroup,proto3" json:"azure_resource_group,omitempty"` - // Azure resource type (mysql, maria, postgres) - AzureDatabaseResourceType string `protobuf:"bytes,8,opt,name=azure_database_resource_type,json=azureDatabaseResourceType,proto3" json:"azure_database_resource_type,omitempty"` - // Custom user-assigned labels. - CustomLabels map[string]string `protobuf:"bytes,9,rep,name=custom_labels,json=customLabels,proto3" json:"custom_labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - // Skip connection check. - SkipConnectionCheck bool `protobuf:"varint,10,opt,name=skip_connection_check,json=skipConnectionCheck,proto3" json:"skip_connection_check,omitempty"` - // Enables push metrics mode for exporter. - PushMetrics bool `protobuf:"varint,11,opt,name=push_metrics,json=pushMetrics,proto3" json:"push_metrics,omitempty"` - // Log level for exporter. - LogLevel LogLevel `protobuf:"varint,12,opt,name=log_level,json=logLevel,proto3,enum=inventory.v1.LogLevel" json:"log_level,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AddAzureDatabaseExporterParams) Reset() { - *x = AddAzureDatabaseExporterParams{} - mi := &file_inventory_v1_agents_proto_msgTypes[56] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AddAzureDatabaseExporterParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddAzureDatabaseExporterParams) ProtoMessage() {} - -func (x *AddAzureDatabaseExporterParams) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_agents_proto_msgTypes[56] - 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 AddAzureDatabaseExporterParams.ProtoReflect.Descriptor instead. -func (*AddAzureDatabaseExporterParams) Descriptor() ([]byte, []int) { - return file_inventory_v1_agents_proto_rawDescGZIP(), []int{56} -} - -func (x *AddAzureDatabaseExporterParams) GetPmmAgentId() string { - if x != nil { - return x.PmmAgentId - } - return "" -} - -func (x *AddAzureDatabaseExporterParams) GetNodeId() string { - if x != nil { - return x.NodeId - } - return "" -} - -func (x *AddAzureDatabaseExporterParams) GetAzureClientId() string { - if x != nil { - return x.AzureClientId - } - return "" -} - -func (x *AddAzureDatabaseExporterParams) GetAzureClientSecret() string { - if x != nil { - return x.AzureClientSecret - } - return "" -} - -func (x *AddAzureDatabaseExporterParams) GetAzureTenantId() string { - if x != nil { - return x.AzureTenantId - } - return "" -} - -func (x *AddAzureDatabaseExporterParams) GetAzureSubscriptionId() string { - if x != nil { - return x.AzureSubscriptionId - } - return "" -} - -func (x *AddAzureDatabaseExporterParams) GetAzureResourceGroup() string { - if x != nil { - return x.AzureResourceGroup - } - return "" -} - -func (x *AddAzureDatabaseExporterParams) GetAzureDatabaseResourceType() string { - if x != nil { - return x.AzureDatabaseResourceType - } - return "" -} - -func (x *AddAzureDatabaseExporterParams) GetCustomLabels() map[string]string { - if x != nil { - return x.CustomLabels - } - return nil -} - -func (x *AddAzureDatabaseExporterParams) GetSkipConnectionCheck() bool { - if x != nil { - return x.SkipConnectionCheck - } - return false -} - -func (x *AddAzureDatabaseExporterParams) GetPushMetrics() bool { - if x != nil { - return x.PushMetrics - } - return false -} - -func (x *AddAzureDatabaseExporterParams) GetLogLevel() LogLevel { - if x != nil { - return x.LogLevel - } - return LogLevel_LOG_LEVEL_UNSPECIFIED -} - -type ChangeAzureDatabaseExporterParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Enable this Agent. Agents are enabled by default when they get added. - Enable *bool `protobuf:"varint,1,opt,name=enable,proto3,oneof" json:"enable,omitempty"` - // Replace all custom user-assigned labels. - CustomLabels *common.StringMap `protobuf:"bytes,2,opt,name=custom_labels,json=customLabels,proto3,oneof" json:"custom_labels,omitempty"` - // Enables push metrics with vmagent. - EnablePushMetrics *bool `protobuf:"varint,3,opt,name=enable_push_metrics,json=enablePushMetrics,proto3,oneof" json:"enable_push_metrics,omitempty"` - // Metrics resolution for this agent. - MetricsResolutions *common.MetricsResolutions `protobuf:"bytes,4,opt,name=metrics_resolutions,json=metricsResolutions,proto3" json:"metrics_resolutions,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ChangeAzureDatabaseExporterParams) Reset() { - *x = ChangeAzureDatabaseExporterParams{} - mi := &file_inventory_v1_agents_proto_msgTypes[57] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ChangeAzureDatabaseExporterParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ChangeAzureDatabaseExporterParams) ProtoMessage() {} - -func (x *ChangeAzureDatabaseExporterParams) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_agents_proto_msgTypes[57] - 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 ChangeAzureDatabaseExporterParams.ProtoReflect.Descriptor instead. -func (*ChangeAzureDatabaseExporterParams) Descriptor() ([]byte, []int) { - return file_inventory_v1_agents_proto_rawDescGZIP(), []int{57} -} - -func (x *ChangeAzureDatabaseExporterParams) GetEnable() bool { - if x != nil && x.Enable != nil { - return *x.Enable - } - return false -} - -func (x *ChangeAzureDatabaseExporterParams) GetCustomLabels() *common.StringMap { - if x != nil { - return x.CustomLabels - } - return nil -} - -func (x *ChangeAzureDatabaseExporterParams) GetEnablePushMetrics() bool { - if x != nil && x.EnablePushMetrics != nil { - return *x.EnablePushMetrics - } - return false -} - -func (x *ChangeAzureDatabaseExporterParams) GetMetricsResolutions() *common.MetricsResolutions { - if x != nil { - return x.MetricsResolutions - } - return nil -} - -type ChangeNomadAgentParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Enable this Agent. Agents are enabled by default when they get added. - Enable *bool `protobuf:"varint,1,opt,name=enable,proto3,oneof" json:"enable,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ChangeNomadAgentParams) Reset() { - *x = ChangeNomadAgentParams{} - mi := &file_inventory_v1_agents_proto_msgTypes[58] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ChangeNomadAgentParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ChangeNomadAgentParams) ProtoMessage() {} - -func (x *ChangeNomadAgentParams) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_agents_proto_msgTypes[58] - 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 ChangeNomadAgentParams.ProtoReflect.Descriptor instead. -func (*ChangeNomadAgentParams) Descriptor() ([]byte, []int) { - return file_inventory_v1_agents_proto_rawDescGZIP(), []int{58} -} - -func (x *ChangeNomadAgentParams) GetEnable() bool { - if x != nil && x.Enable != nil { - return *x.Enable - } - return false -} - -type AddValkeyExporterParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The pmm-agent identifier which runs this instance. - PmmAgentId string `protobuf:"bytes,1,opt,name=pmm_agent_id,json=pmmAgentId,proto3" json:"pmm_agent_id,omitempty"` - // Service identifier. - ServiceId string `protobuf:"bytes,2,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` - // Valkey username for scraping metrics. - Username string `protobuf:"bytes,3,opt,name=username,proto3" json:"username,omitempty"` - // Valkey password for scraping metrics. - Password string `protobuf:"bytes,4,opt,name=password,proto3" json:"password,omitempty"` - // Use TLS for database connections. - Tls bool `protobuf:"varint,5,opt,name=tls,proto3" json:"tls,omitempty"` - // Skip TLS certificate and hostname validation. - TlsSkipVerify bool `protobuf:"varint,6,opt,name=tls_skip_verify,json=tlsSkipVerify,proto3" json:"tls_skip_verify,omitempty"` - // Custom user-assigned labels. - CustomLabels map[string]string `protobuf:"bytes,7,rep,name=custom_labels,json=customLabels,proto3" json:"custom_labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - // Skip connection check. - SkipConnectionCheck bool `protobuf:"varint,8,opt,name=skip_connection_check,json=skipConnectionCheck,proto3" json:"skip_connection_check,omitempty"` - // Enables push metrics mode for exporter. - PushMetrics bool `protobuf:"varint,9,opt,name=push_metrics,json=pushMetrics,proto3" json:"push_metrics,omitempty"` - // List of collector names to disable in this exporter. - DisableCollectors []string `protobuf:"bytes,10,rep,name=disable_collectors,json=disableCollectors,proto3" json:"disable_collectors,omitempty"` - // TLS CA certificate. - TlsCa string `protobuf:"bytes,11,opt,name=tls_ca,json=tlsCa,proto3" json:"tls_ca,omitempty"` - // TLS Certifcate. - TlsCert string `protobuf:"bytes,12,opt,name=tls_cert,json=tlsCert,proto3" json:"tls_cert,omitempty"` - // TLS Certificate Key. - TlsKey string `protobuf:"bytes,13,opt,name=tls_key,json=tlsKey,proto3" json:"tls_key,omitempty"` - // Custom password for exporter endpoint /metrics. - AgentPassword string `protobuf:"bytes,14,opt,name=agent_password,json=agentPassword,proto3" json:"agent_password,omitempty"` - // Optionally expose the exporter process on all public interfaces - ExposeExporter bool `protobuf:"varint,15,opt,name=expose_exporter,json=exposeExporter,proto3" json:"expose_exporter,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AddValkeyExporterParams) Reset() { - *x = AddValkeyExporterParams{} - mi := &file_inventory_v1_agents_proto_msgTypes[59] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AddValkeyExporterParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddValkeyExporterParams) ProtoMessage() {} - -func (x *AddValkeyExporterParams) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_agents_proto_msgTypes[59] - 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 AddValkeyExporterParams.ProtoReflect.Descriptor instead. -func (*AddValkeyExporterParams) Descriptor() ([]byte, []int) { - return file_inventory_v1_agents_proto_rawDescGZIP(), []int{59} -} - -func (x *AddValkeyExporterParams) GetPmmAgentId() string { - if x != nil { - return x.PmmAgentId - } - return "" -} - -func (x *AddValkeyExporterParams) GetServiceId() string { - if x != nil { - return x.ServiceId - } - return "" -} - -func (x *AddValkeyExporterParams) GetUsername() string { - if x != nil { - return x.Username - } - return "" -} - -func (x *AddValkeyExporterParams) GetPassword() string { - if x != nil { - return x.Password - } - return "" -} - -func (x *AddValkeyExporterParams) GetTls() bool { - if x != nil { - return x.Tls - } - return false -} - -func (x *AddValkeyExporterParams) GetTlsSkipVerify() bool { - if x != nil { - return x.TlsSkipVerify - } - return false -} - -func (x *AddValkeyExporterParams) GetCustomLabels() map[string]string { - if x != nil { - return x.CustomLabels - } - return nil -} - -func (x *AddValkeyExporterParams) GetSkipConnectionCheck() bool { - if x != nil { - return x.SkipConnectionCheck - } - return false -} - -func (x *AddValkeyExporterParams) GetPushMetrics() bool { - if x != nil { - return x.PushMetrics - } - return false -} - -func (x *AddValkeyExporterParams) GetDisableCollectors() []string { - if x != nil { - return x.DisableCollectors - } - return nil -} - -func (x *AddValkeyExporterParams) GetTlsCa() string { - if x != nil { - return x.TlsCa - } - return "" -} - -func (x *AddValkeyExporterParams) GetTlsCert() string { - if x != nil { - return x.TlsCert - } - return "" -} - -func (x *AddValkeyExporterParams) GetTlsKey() string { - if x != nil { - return x.TlsKey - } - return "" -} - -func (x *AddValkeyExporterParams) GetAgentPassword() string { - if x != nil { - return x.AgentPassword - } - return "" -} - -func (x *AddValkeyExporterParams) GetExposeExporter() bool { - if x != nil { - return x.ExposeExporter - } - return false -} - -type ChangeValkeyExporterParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Enable this Agent. Agents are enabled by default when they get added. - Enable *bool `protobuf:"varint,1,opt,name=enable,proto3,oneof" json:"enable,omitempty"` - // Replace all custom user-assigned labels. - CustomLabels *common.StringMap `protobuf:"bytes,2,opt,name=custom_labels,json=customLabels,proto3,oneof" json:"custom_labels,omitempty"` - // Enables push metrics with vmagent. - EnablePushMetrics *bool `protobuf:"varint,3,opt,name=enable_push_metrics,json=enablePushMetrics,proto3,oneof" json:"enable_push_metrics,omitempty"` - // Metrics resolution for this agent. - MetricsResolutions *common.MetricsResolutions `protobuf:"bytes,4,opt,name=metrics_resolutions,json=metricsResolutions,proto3" json:"metrics_resolutions,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ChangeValkeyExporterParams) Reset() { - *x = ChangeValkeyExporterParams{} - mi := &file_inventory_v1_agents_proto_msgTypes[60] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ChangeValkeyExporterParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ChangeValkeyExporterParams) ProtoMessage() {} - -func (x *ChangeValkeyExporterParams) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_agents_proto_msgTypes[60] - 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 ChangeValkeyExporterParams.ProtoReflect.Descriptor instead. -func (*ChangeValkeyExporterParams) Descriptor() ([]byte, []int) { - return file_inventory_v1_agents_proto_rawDescGZIP(), []int{60} -} - -func (x *ChangeValkeyExporterParams) GetEnable() bool { - if x != nil && x.Enable != nil { - return *x.Enable - } - return false -} - -func (x *ChangeValkeyExporterParams) GetCustomLabels() *common.StringMap { - if x != nil { - return x.CustomLabels - } - return nil -} - -func (x *ChangeValkeyExporterParams) GetEnablePushMetrics() bool { - if x != nil && x.EnablePushMetrics != nil { - return *x.EnablePushMetrics - } - return false -} - -func (x *ChangeValkeyExporterParams) GetMetricsResolutions() *common.MetricsResolutions { - if x != nil { - return x.MetricsResolutions - } - return nil -} - -type RemoveAgentRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - AgentId string `protobuf:"bytes,1,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"` - // Remove agent with all dependencies. - Force bool `protobuf:"varint,2,opt,name=force,proto3" json:"force,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *RemoveAgentRequest) Reset() { - *x = RemoveAgentRequest{} - mi := &file_inventory_v1_agents_proto_msgTypes[61] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *RemoveAgentRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RemoveAgentRequest) ProtoMessage() {} - -func (x *RemoveAgentRequest) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_agents_proto_msgTypes[61] - 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 RemoveAgentRequest.ProtoReflect.Descriptor instead. -func (*RemoveAgentRequest) Descriptor() ([]byte, []int) { - return file_inventory_v1_agents_proto_rawDescGZIP(), []int{61} -} - -func (x *RemoveAgentRequest) GetAgentId() string { - if x != nil { - return x.AgentId - } - return "" -} - -func (x *RemoveAgentRequest) GetForce() bool { - if x != nil { - return x.Force - } - return false -} - -type RemoveAgentResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *RemoveAgentResponse) Reset() { - *x = RemoveAgentResponse{} - mi := &file_inventory_v1_agents_proto_msgTypes[62] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *RemoveAgentResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RemoveAgentResponse) ProtoMessage() {} - -func (x *RemoveAgentResponse) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_agents_proto_msgTypes[62] - 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 RemoveAgentResponse.ProtoReflect.Descriptor instead. -func (*RemoveAgentResponse) Descriptor() ([]byte, []int) { - return file_inventory_v1_agents_proto_rawDescGZIP(), []int{62} -} - -var File_inventory_v1_agents_proto protoreflect.FileDescriptor - -const file_inventory_v1_agents_proto_rawDesc = "" + - "\n" + - "\x19inventory/v1/agents.proto\x12\finventory.v1\x1a\x13common/common.proto\x1a common/metrics_resolutions.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x1finventory/v1/agent_status.proto\x1a\x1cinventory/v1/log_level.proto\x1a.protoc-gen-openapiv2/options/annotations.proto\x1a\x17validate/validate.proto\"\xa6\x02\n" + - "\bPMMAgent\x12\x19\n" + - "\bagent_id\x18\x01 \x01(\tR\aagentId\x12%\n" + - "\x0fruns_on_node_id\x18\x02 \x01(\tR\frunsOnNodeId\x12M\n" + - "\rcustom_labels\x18\x03 \x03(\v2(.inventory.v1.PMMAgent.CustomLabelsEntryR\fcustomLabels\x12\x1c\n" + - "\tconnected\x18\n" + - " \x01(\bR\tconnected\x12*\n" + - "\x11process_exec_path\x18\v \x01(\tR\x0fprocessExecPath\x1a?\n" + - "\x11CustomLabelsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\xc6\x01\n" + - "\aVMAgent\x12\x19\n" + - "\bagent_id\x18\x01 \x01(\tR\aagentId\x12 \n" + - "\fpmm_agent_id\x18\x02 \x01(\tR\n" + - "pmmAgentId\x121\n" + - "\x06status\x18\n" + - " \x01(\x0e2\x19.inventory.v1.AgentStatusR\x06status\x12*\n" + - "\x11process_exec_path\x18\v \x01(\tR\x0fprocessExecPath\x12\x1f\n" + - "\vlisten_port\x18\f \x01(\rR\n" + - "listenPort\"\xeb\x01\n" + - "\n" + - "NomadAgent\x12\x19\n" + - "\bagent_id\x18\x01 \x01(\tR\aagentId\x12 \n" + - "\fpmm_agent_id\x18\x02 \x01(\tR\n" + - "pmmAgentId\x12\x1a\n" + - "\bdisabled\x18\x03 \x01(\bR\bdisabled\x121\n" + - "\x06status\x18\n" + - " \x01(\x0e2\x19.inventory.v1.AgentStatusR\x06status\x12*\n" + - "\x11process_exec_path\x18\v \x01(\tR\x0fprocessExecPath\x12\x1f\n" + - "\vlisten_port\x18\f \x01(\rR\n" + - "listenPortJ\x04\b\x04\x10\x05\"\x89\x05\n" + - "\fNodeExporter\x12\x19\n" + - "\bagent_id\x18\x01 \x01(\tR\aagentId\x12 \n" + - "\fpmm_agent_id\x18\x02 \x01(\tR\n" + - "pmmAgentId\x12\x1a\n" + - "\bdisabled\x18\x03 \x01(\bR\bdisabled\x12Q\n" + - "\rcustom_labels\x18\x04 \x03(\v2,.inventory.v1.NodeExporter.CustomLabelsEntryR\fcustomLabels\x120\n" + - "\x14push_metrics_enabled\x18\x05 \x01(\bR\x12pushMetricsEnabled\x12/\n" + - "\x13disabled_collectors\x18\x06 \x03(\tR\x12disabledCollectors\x121\n" + - "\x06status\x18\n" + - " \x01(\x0e2\x19.inventory.v1.AgentStatusR\x06status\x12\x1f\n" + - "\vlisten_port\x18\v \x01(\rR\n" + - "listenPort\x12*\n" + - "\x11process_exec_path\x18\f \x01(\tR\x0fprocessExecPath\x123\n" + - "\tlog_level\x18\r \x01(\x0e2\x16.inventory.v1.LogLevelR\blogLevel\x12'\n" + - "\x0fexpose_exporter\x18\x0e \x01(\bR\x0eexposeExporter\x12K\n" + - "\x13metrics_resolutions\x18\x0f \x01(\v2\x1a.common.MetricsResolutionsR\x12metricsResolutions\x1a?\n" + - "\x11CustomLabelsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\x8a\t\n" + - "\x0eMySQLdExporter\x12\x19\n" + - "\bagent_id\x18\x01 \x01(\tR\aagentId\x12 \n" + - "\fpmm_agent_id\x18\x02 \x01(\tR\n" + - "pmmAgentId\x12\x1a\n" + - "\bdisabled\x18\x03 \x01(\bR\bdisabled\x12\x1d\n" + - "\n" + - "service_id\x18\x04 \x01(\tR\tserviceId\x12\x1a\n" + - "\busername\x18\x05 \x01(\tR\busername\x12\x10\n" + - "\x03tls\x18\x06 \x01(\bR\x03tls\x12&\n" + - "\x0ftls_skip_verify\x18\a \x01(\bR\rtlsSkipVerify\x12\x15\n" + - "\x06tls_ca\x18\b \x01(\tR\x05tlsCa\x12\x19\n" + - "\btls_cert\x18\t \x01(\tR\atlsCert\x12\x17\n" + - "\atls_key\x18\n" + - " \x01(\tR\x06tlsKey\x12?\n" + - "\x1ctablestats_group_table_limit\x18\v \x01(\x05R\x19tablestatsGroupTableLimit\x12S\n" + - "\rcustom_labels\x18\f \x03(\v2..inventory.v1.MySQLdExporter.CustomLabelsEntryR\fcustomLabels\x120\n" + - "\x14push_metrics_enabled\x18\r \x01(\bR\x12pushMetricsEnabled\x12/\n" + - "\x13disabled_collectors\x18\x0e \x03(\tR\x12disabledCollectors\x12\x1f\n" + - "\vtable_count\x18\x0f \x01(\x05R\n" + - "tableCount\x121\n" + - "\x06status\x18\x14 \x01(\x0e2\x19.inventory.v1.AgentStatusR\x06status\x12\x1f\n" + - "\vlisten_port\x18\x15 \x01(\rR\n" + - "listenPort\x12:\n" + - "\x19tablestats_group_disabled\x18\x16 \x01(\bR\x17tablestatsGroupDisabled\x12*\n" + - "\x11process_exec_path\x18\x17 \x01(\tR\x0fprocessExecPath\x123\n" + - "\tlog_level\x18\x18 \x01(\x0e2\x16.inventory.v1.LogLevelR\blogLevel\x12'\n" + - "\x0fexpose_exporter\x18\x19 \x01(\bR\x0eexposeExporter\x12K\n" + - "\x13metrics_resolutions\x18\x1a \x01(\v2\x1a.common.MetricsResolutionsR\x12metricsResolutions\x12Z\n" + - "\x10extra_dsn_params\x18\x1b \x03(\v20.inventory.v1.MySQLdExporter.ExtraDsnParamsEntryR\x0eextraDsnParams\x1a?\n" + - "\x11CustomLabelsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\x1aA\n" + - "\x13ExtraDsnParamsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\x92\a\n" + - "\x0fMongoDBExporter\x12\x19\n" + - "\bagent_id\x18\x01 \x01(\tR\aagentId\x12 \n" + - "\fpmm_agent_id\x18\x02 \x01(\tR\n" + - "pmmAgentId\x12\x1a\n" + - "\bdisabled\x18\x03 \x01(\bR\bdisabled\x12\x1d\n" + - "\n" + - "service_id\x18\x04 \x01(\tR\tserviceId\x12\x1a\n" + - "\busername\x18\x05 \x01(\tR\busername\x12\x10\n" + - "\x03tls\x18\x06 \x01(\bR\x03tls\x12&\n" + - "\x0ftls_skip_verify\x18\a \x01(\bR\rtlsSkipVerify\x12T\n" + - "\rcustom_labels\x18\b \x03(\v2/.inventory.v1.MongoDBExporter.CustomLabelsEntryR\fcustomLabels\x120\n" + - "\x14push_metrics_enabled\x18\t \x01(\bR\x12pushMetricsEnabled\x12/\n" + - "\x13disabled_collectors\x18\n" + - " \x03(\tR\x12disabledCollectors\x121\n" + - "\x06status\x18\x14 \x01(\x0e2\x19.inventory.v1.AgentStatusR\x06status\x12\x1f\n" + - "\vlisten_port\x18\x15 \x01(\rR\n" + - "listenPort\x12+\n" + - "\x11stats_collections\x18\x16 \x03(\tR\x10statsCollections\x12+\n" + - "\x11collections_limit\x18\x17 \x01(\x05R\x10collectionsLimit\x122\n" + - "\x15enable_all_collectors\x18\x18 \x01(\bR\x13enableAllCollectors\x12*\n" + - "\x11process_exec_path\x18\x19 \x01(\tR\x0fprocessExecPath\x123\n" + - "\tlog_level\x18\x1a \x01(\x0e2\x16.inventory.v1.LogLevelR\blogLevel\x12'\n" + - "\x0fexpose_exporter\x18\x1b \x01(\bR\x0eexposeExporter\x12K\n" + - "\x13metrics_resolutions\x18\x1c \x01(\v2\x1a.common.MetricsResolutionsR\x12metricsResolutions\x1a?\n" + - "\x11CustomLabelsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\xf2\x06\n" + - "\x10PostgresExporter\x12\x19\n" + - "\bagent_id\x18\x01 \x01(\tR\aagentId\x12 \n" + - "\fpmm_agent_id\x18\x02 \x01(\tR\n" + - "pmmAgentId\x12\x1a\n" + - "\bdisabled\x18\x03 \x01(\bR\bdisabled\x12\x1d\n" + - "\n" + - "service_id\x18\x04 \x01(\tR\tserviceId\x12\x1a\n" + - "\busername\x18\x05 \x01(\tR\busername\x12\x10\n" + - "\x03tls\x18\x06 \x01(\bR\x03tls\x12&\n" + - "\x0ftls_skip_verify\x18\a \x01(\bR\rtlsSkipVerify\x12U\n" + - "\rcustom_labels\x18\b \x03(\v20.inventory.v1.PostgresExporter.CustomLabelsEntryR\fcustomLabels\x120\n" + - "\x14push_metrics_enabled\x18\t \x01(\bR\x12pushMetricsEnabled\x12/\n" + - "\x13disabled_collectors\x18\n" + - " \x03(\tR\x12disabledCollectors\x121\n" + - "\x06status\x18\x14 \x01(\x0e2\x19.inventory.v1.AgentStatusR\x06status\x12\x1f\n" + - "\vlisten_port\x18\x15 \x01(\rR\n" + - "listenPort\x12*\n" + - "\x11process_exec_path\x18\x16 \x01(\tR\x0fprocessExecPath\x123\n" + - "\tlog_level\x18\x17 \x01(\x0e2\x16.inventory.v1.LogLevelR\blogLevel\x120\n" + - "\x14auto_discovery_limit\x18\x18 \x01(\x05R\x12autoDiscoveryLimit\x12'\n" + - "\x0fexpose_exporter\x18\x19 \x01(\bR\x0eexposeExporter\x128\n" + - "\x18max_exporter_connections\x18\x1a \x01(\x05R\x16maxExporterConnections\x12K\n" + - "\x13metrics_resolutions\x18\x1b \x01(\v2\x1a.common.MetricsResolutionsR\x12metricsResolutions\x1a?\n" + - "\x11CustomLabelsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\x86\x06\n" + - "\x10ProxySQLExporter\x12\x19\n" + - "\bagent_id\x18\x01 \x01(\tR\aagentId\x12 \n" + - "\fpmm_agent_id\x18\x02 \x01(\tR\n" + - "pmmAgentId\x12\x1a\n" + - "\bdisabled\x18\x03 \x01(\bR\bdisabled\x12\x1d\n" + - "\n" + - "service_id\x18\x04 \x01(\tR\tserviceId\x12\x1a\n" + - "\busername\x18\x05 \x01(\tR\busername\x12\x10\n" + - "\x03tls\x18\x06 \x01(\bR\x03tls\x12&\n" + - "\x0ftls_skip_verify\x18\a \x01(\bR\rtlsSkipVerify\x12U\n" + - "\rcustom_labels\x18\b \x03(\v20.inventory.v1.ProxySQLExporter.CustomLabelsEntryR\fcustomLabels\x120\n" + - "\x14push_metrics_enabled\x18\t \x01(\bR\x12pushMetricsEnabled\x12/\n" + - "\x13disabled_collectors\x18\n" + - " \x03(\tR\x12disabledCollectors\x121\n" + - "\x06status\x18\x14 \x01(\x0e2\x19.inventory.v1.AgentStatusR\x06status\x12\x1f\n" + - "\vlisten_port\x18\x15 \x01(\rR\n" + - "listenPort\x12*\n" + - "\x11process_exec_path\x18\x16 \x01(\tR\x0fprocessExecPath\x123\n" + - "\tlog_level\x18\x17 \x01(\x0e2\x16.inventory.v1.LogLevelR\blogLevel\x12'\n" + - "\x0fexpose_exporter\x18\x18 \x01(\bR\x0eexposeExporter\x12K\n" + - "\x13metrics_resolutions\x18\x19 \x01(\v2\x1a.common.MetricsResolutionsR\x12metricsResolutions\x1a?\n" + - "\x11CustomLabelsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\xcd\x05\n" + - "\x0eValkeyExporter\x12\x19\n" + - "\bagent_id\x18\x01 \x01(\tR\aagentId\x12 \n" + - "\fpmm_agent_id\x18\x02 \x01(\tR\n" + - "pmmAgentId\x12\x1a\n" + - "\bdisabled\x18\x03 \x01(\bR\bdisabled\x12\x1d\n" + - "\n" + - "service_id\x18\x04 \x01(\tR\tserviceId\x12\x1a\n" + - "\busername\x18\x05 \x01(\tR\busername\x12\x10\n" + - "\x03tls\x18\x06 \x01(\bR\x03tls\x12&\n" + - "\x0ftls_skip_verify\x18\a \x01(\bR\rtlsSkipVerify\x12S\n" + - "\rcustom_labels\x18\b \x03(\v2..inventory.v1.ValkeyExporter.CustomLabelsEntryR\fcustomLabels\x120\n" + - "\x14push_metrics_enabled\x18\t \x01(\bR\x12pushMetricsEnabled\x12/\n" + - "\x13disabled_collectors\x18\n" + - " \x03(\tR\x12disabledCollectors\x121\n" + - "\x06status\x18\x14 \x01(\x0e2\x19.inventory.v1.AgentStatusR\x06status\x12\x1f\n" + - "\vlisten_port\x18\x15 \x01(\rR\n" + - "listenPort\x12*\n" + - "\x11process_exec_path\x18\x16 \x01(\tR\x0fprocessExecPath\x12'\n" + - "\x0fexpose_exporter\x18\x17 \x01(\bR\x0eexposeExporter\x12K\n" + - "\x13metrics_resolutions\x18\x18 \x01(\v2\x1a.common.MetricsResolutionsR\x12metricsResolutions\x1a?\n" + - "\x11CustomLabelsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\xa9\a\n" + - "\x17QANMySQLPerfSchemaAgent\x12\x19\n" + - "\bagent_id\x18\x01 \x01(\tR\aagentId\x12 \n" + - "\fpmm_agent_id\x18\x02 \x01(\tR\n" + - "pmmAgentId\x12\x1a\n" + - "\bdisabled\x18\x03 \x01(\bR\bdisabled\x12\x1d\n" + - "\n" + - "service_id\x18\x04 \x01(\tR\tserviceId\x12\x1a\n" + - "\busername\x18\x05 \x01(\tR\busername\x12\x10\n" + - "\x03tls\x18\x06 \x01(\bR\x03tls\x12&\n" + - "\x0ftls_skip_verify\x18\a \x01(\bR\rtlsSkipVerify\x12\x15\n" + - "\x06tls_ca\x18\b \x01(\tR\x05tlsCa\x12\x19\n" + - "\btls_cert\x18\t \x01(\tR\atlsCert\x12\x17\n" + - "\atls_key\x18\n" + - " \x01(\tR\x06tlsKey\x128\n" + - "\x18disable_comments_parsing\x18\v \x01(\bR\x16disableCommentsParsing\x12(\n" + - "\x10max_query_length\x18\f \x01(\x05R\x0emaxQueryLength\x126\n" + - "\x17query_examples_disabled\x18\r \x01(\bR\x15queryExamplesDisabled\x12\\\n" + - "\rcustom_labels\x18\x0e \x03(\v27.inventory.v1.QANMySQLPerfSchemaAgent.CustomLabelsEntryR\fcustomLabels\x121\n" + - "\x06status\x18\x14 \x01(\x0e2\x19.inventory.v1.AgentStatusR\x06status\x12*\n" + - "\x11process_exec_path\x18\x15 \x01(\tR\x0fprocessExecPath\x123\n" + - "\tlog_level\x18\x16 \x01(\x0e2\x16.inventory.v1.LogLevelR\blogLevel\x12c\n" + - "\x10extra_dsn_params\x18\x17 \x03(\v29.inventory.v1.QANMySQLPerfSchemaAgent.ExtraDsnParamsEntryR\x0eextraDsnParams\x1a?\n" + - "\x11CustomLabelsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\x1aA\n" + - "\x13ExtraDsnParamsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\xd3\a\n" + - "\x14QANMySQLSlowlogAgent\x12\x19\n" + - "\bagent_id\x18\x01 \x01(\tR\aagentId\x12 \n" + - "\fpmm_agent_id\x18\x02 \x01(\tR\n" + - "pmmAgentId\x12\x1a\n" + - "\bdisabled\x18\x03 \x01(\bR\bdisabled\x12\x1d\n" + - "\n" + - "service_id\x18\x04 \x01(\tR\tserviceId\x12\x1a\n" + - "\busername\x18\x05 \x01(\tR\busername\x12\x10\n" + - "\x03tls\x18\x06 \x01(\bR\x03tls\x12&\n" + - "\x0ftls_skip_verify\x18\a \x01(\bR\rtlsSkipVerify\x12\x15\n" + - "\x06tls_ca\x18\b \x01(\tR\x05tlsCa\x12\x19\n" + - "\btls_cert\x18\t \x01(\tR\atlsCert\x12\x17\n" + - "\atls_key\x18\n" + - " \x01(\tR\x06tlsKey\x128\n" + - "\x18disable_comments_parsing\x18\v \x01(\bR\x16disableCommentsParsing\x12(\n" + - "\x10max_query_length\x18\f \x01(\x05R\x0emaxQueryLength\x126\n" + - "\x17query_examples_disabled\x18\r \x01(\bR\x15queryExamplesDisabled\x121\n" + - "\x15max_slowlog_file_size\x18\x0e \x01(\x03R\x12maxSlowlogFileSize\x12Y\n" + - "\rcustom_labels\x18\x0f \x03(\v24.inventory.v1.QANMySQLSlowlogAgent.CustomLabelsEntryR\fcustomLabels\x121\n" + - "\x06status\x18\x14 \x01(\x0e2\x19.inventory.v1.AgentStatusR\x06status\x12*\n" + - "\x11process_exec_path\x18\x15 \x01(\tR\x0fprocessExecPath\x123\n" + - "\tlog_level\x18\x16 \x01(\x0e2\x16.inventory.v1.LogLevelR\blogLevel\x12`\n" + - "\x10extra_dsn_params\x18\x17 \x03(\v26.inventory.v1.QANMySQLSlowlogAgent.ExtraDsnParamsEntryR\x0eextraDsnParams\x1a?\n" + - "\x11CustomLabelsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\x1aA\n" + - "\x13ExtraDsnParamsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\xe3\x04\n" + - "\x17QANMongoDBProfilerAgent\x12\x19\n" + - "\bagent_id\x18\x01 \x01(\tR\aagentId\x12 \n" + - "\fpmm_agent_id\x18\x02 \x01(\tR\n" + - "pmmAgentId\x12\x1a\n" + - "\bdisabled\x18\x03 \x01(\bR\bdisabled\x12\x1d\n" + - "\n" + - "service_id\x18\x04 \x01(\tR\tserviceId\x12\x1a\n" + - "\busername\x18\x05 \x01(\tR\busername\x12\x10\n" + - "\x03tls\x18\x06 \x01(\bR\x03tls\x12&\n" + - "\x0ftls_skip_verify\x18\a \x01(\bR\rtlsSkipVerify\x12(\n" + - "\x10max_query_length\x18\t \x01(\x05R\x0emaxQueryLength\x12\\\n" + - "\rcustom_labels\x18\n" + - " \x03(\v27.inventory.v1.QANMongoDBProfilerAgent.CustomLabelsEntryR\fcustomLabels\x121\n" + - "\x06status\x18\x14 \x01(\x0e2\x19.inventory.v1.AgentStatusR\x06status\x12*\n" + - "\x11process_exec_path\x18\x15 \x01(\tR\x0fprocessExecPath\x123\n" + - "\tlog_level\x18\x16 \x01(\x0e2\x16.inventory.v1.LogLevelR\blogLevel\x1a?\n" + - "\x11CustomLabelsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01J\x04\b\b\x10\tR\x17query_examples_disabled\"\xe3\x04\n" + - "\x17QANMongoDBMongologAgent\x12\x19\n" + - "\bagent_id\x18\x01 \x01(\tR\aagentId\x12 \n" + - "\fpmm_agent_id\x18\x02 \x01(\tR\n" + - "pmmAgentId\x12\x1a\n" + - "\bdisabled\x18\x03 \x01(\bR\bdisabled\x12\x1d\n" + - "\n" + - "service_id\x18\x04 \x01(\tR\tserviceId\x12\x1a\n" + - "\busername\x18\x05 \x01(\tR\busername\x12\x10\n" + - "\x03tls\x18\x06 \x01(\bR\x03tls\x12&\n" + - "\x0ftls_skip_verify\x18\a \x01(\bR\rtlsSkipVerify\x12(\n" + - "\x10max_query_length\x18\t \x01(\x05R\x0emaxQueryLength\x12\\\n" + - "\rcustom_labels\x18\n" + - " \x03(\v27.inventory.v1.QANMongoDBMongologAgent.CustomLabelsEntryR\fcustomLabels\x121\n" + - "\x06status\x18\x14 \x01(\x0e2\x19.inventory.v1.AgentStatusR\x06status\x12*\n" + - "\x11process_exec_path\x18\x15 \x01(\tR\x0fprocessExecPath\x123\n" + - "\tlog_level\x18\x16 \x01(\x0e2\x16.inventory.v1.LogLevelR\blogLevel\x1a?\n" + - "\x11CustomLabelsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01J\x04\b\b\x10\tR\x17query_examples_disabled\"\x8c\x05\n" + - "\x1eQANPostgreSQLPgStatementsAgent\x12\x19\n" + - "\bagent_id\x18\x01 \x01(\tR\aagentId\x12 \n" + - "\fpmm_agent_id\x18\x02 \x01(\tR\n" + - "pmmAgentId\x12\x1a\n" + - "\bdisabled\x18\x03 \x01(\bR\bdisabled\x12\x1d\n" + - "\n" + - "service_id\x18\x04 \x01(\tR\tserviceId\x12\x1a\n" + - "\busername\x18\x05 \x01(\tR\busername\x128\n" + - "\x18disable_comments_parsing\x18\x06 \x01(\bR\x16disableCommentsParsing\x12(\n" + - "\x10max_query_length\x18\a \x01(\x05R\x0emaxQueryLength\x12\x10\n" + - "\x03tls\x18\b \x01(\bR\x03tls\x12&\n" + - "\x0ftls_skip_verify\x18\t \x01(\bR\rtlsSkipVerify\x12c\n" + - "\rcustom_labels\x18\n" + - " \x03(\v2>.inventory.v1.QANPostgreSQLPgStatementsAgent.CustomLabelsEntryR\fcustomLabels\x121\n" + - "\x06status\x18\x14 \x01(\x0e2\x19.inventory.v1.AgentStatusR\x06status\x12*\n" + - "\x11process_exec_path\x18\x15 \x01(\tR\x0fprocessExecPath\x123\n" + - "\tlog_level\x18\x16 \x01(\x0e2\x16.inventory.v1.LogLevelR\blogLevel\x1a?\n" + - "\x11CustomLabelsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\xc6\x05\n" + - "\x1fQANPostgreSQLPgStatMonitorAgent\x12\x19\n" + - "\bagent_id\x18\x01 \x01(\tR\aagentId\x12 \n" + - "\fpmm_agent_id\x18\x02 \x01(\tR\n" + - "pmmAgentId\x12\x1a\n" + - "\bdisabled\x18\x03 \x01(\bR\bdisabled\x12\x1d\n" + - "\n" + - "service_id\x18\x04 \x01(\tR\tserviceId\x12\x1a\n" + - "\busername\x18\x05 \x01(\tR\busername\x12\x10\n" + - "\x03tls\x18\x06 \x01(\bR\x03tls\x12&\n" + - "\x0ftls_skip_verify\x18\a \x01(\bR\rtlsSkipVerify\x128\n" + - "\x18disable_comments_parsing\x18\b \x01(\bR\x16disableCommentsParsing\x12(\n" + - "\x10max_query_length\x18\t \x01(\x05R\x0emaxQueryLength\x126\n" + - "\x17query_examples_disabled\x18\n" + - " \x01(\bR\x15queryExamplesDisabled\x12d\n" + - "\rcustom_labels\x18\v \x03(\v2?.inventory.v1.QANPostgreSQLPgStatMonitorAgent.CustomLabelsEntryR\fcustomLabels\x121\n" + - "\x06status\x18\x14 \x01(\x0e2\x19.inventory.v1.AgentStatusR\x06status\x12*\n" + - "\x11process_exec_path\x18\x15 \x01(\tR\x0fprocessExecPath\x123\n" + - "\tlog_level\x18\x16 \x01(\x0e2\x16.inventory.v1.LogLevelR\blogLevel\x1a?\n" + - "\x11CustomLabelsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\x90\x06\n" + - "\vRDSExporter\x12\x19\n" + - "\bagent_id\x18\x01 \x01(\tR\aagentId\x12 \n" + - "\fpmm_agent_id\x18\x02 \x01(\tR\n" + - "pmmAgentId\x12\x1a\n" + - "\bdisabled\x18\x03 \x01(\bR\bdisabled\x12\x17\n" + - "\anode_id\x18\x04 \x01(\tR\x06nodeId\x12$\n" + - "\x0eaws_access_key\x18\x05 \x01(\tR\fawsAccessKey\x12P\n" + - "\rcustom_labels\x18\x06 \x03(\v2+.inventory.v1.RDSExporter.CustomLabelsEntryR\fcustomLabels\x121\n" + - "\x06status\x18\n" + - " \x01(\x0e2\x19.inventory.v1.AgentStatusR\x06status\x12\x1f\n" + - "\vlisten_port\x18\v \x01(\rR\n" + - "listenPort\x124\n" + - "\x16basic_metrics_disabled\x18\x14 \x01(\bR\x14basicMetricsDisabled\x12:\n" + - "\x19enhanced_metrics_disabled\x18\x15 \x01(\bR\x17enhancedMetricsDisabled\x120\n" + - "\x14push_metrics_enabled\x18\x16 \x01(\bR\x12pushMetricsEnabled\x12*\n" + - "\x11process_exec_path\x18\x17 \x01(\tR\x0fprocessExecPath\x123\n" + - "\tlog_level\x18\x18 \x01(\x0e2\x16.inventory.v1.LogLevelR\blogLevel\x120\n" + - "\x14auto_discovery_limit\x18\x19 \x01(\x05R\x12autoDiscoveryLimit\x12K\n" + - "\x13metrics_resolutions\x18\x1a \x01(\v2\x1a.common.MetricsResolutionsR\x12metricsResolutions\x1a?\n" + - "\x11CustomLabelsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\xf2\x04\n" + - "\x10ExternalExporter\x12\x19\n" + - "\bagent_id\x18\x01 \x01(\tR\aagentId\x12%\n" + - "\x0fruns_on_node_id\x18\x02 \x01(\tR\frunsOnNodeId\x12\x1a\n" + - "\bdisabled\x18\x03 \x01(\bR\bdisabled\x12\x1d\n" + - "\n" + - "service_id\x18\x04 \x01(\tR\tserviceId\x12\x1a\n" + - "\busername\x18\x05 \x01(\tR\busername\x12\x16\n" + - "\x06scheme\x18\x06 \x01(\tR\x06scheme\x12!\n" + - "\fmetrics_path\x18\a \x01(\tR\vmetricsPath\x12U\n" + - "\rcustom_labels\x18\b \x03(\v20.inventory.v1.ExternalExporter.CustomLabelsEntryR\fcustomLabels\x12\x1f\n" + - "\vlisten_port\x18\t \x01(\rR\n" + - "listenPort\x120\n" + - "\x14push_metrics_enabled\x18\n" + - " \x01(\bR\x12pushMetricsEnabled\x12*\n" + - "\x11process_exec_path\x18\v \x01(\tR\x0fprocessExecPath\x12K\n" + - "\x13metrics_resolutions\x18\f \x01(\v2\x1a.common.MetricsResolutionsR\x12metricsResolutions\x12&\n" + - "\x0ftls_skip_verify\x18\r \x01(\bR\rtlsSkipVerify\x1a?\n" + - "\x11CustomLabelsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\xe0\x05\n" + - "\x15AzureDatabaseExporter\x12\x19\n" + - "\bagent_id\x18\x01 \x01(\tR\aagentId\x12 \n" + - "\fpmm_agent_id\x18\x02 \x01(\tR\n" + - "pmmAgentId\x12\x1a\n" + - "\bdisabled\x18\x03 \x01(\bR\bdisabled\x12\x17\n" + - "\anode_id\x18\x04 \x01(\tR\x06nodeId\x12C\n" + - "\x1eazure_database_subscription_id\x18\x05 \x01(\tR\x1bazureDatabaseSubscriptionId\x12?\n" + - "\x1cazure_database_resource_type\x18\x06 \x01(\tR\x19azureDatabaseResourceType\x12Z\n" + - "\rcustom_labels\x18\a \x03(\v25.inventory.v1.AzureDatabaseExporter.CustomLabelsEntryR\fcustomLabels\x121\n" + - "\x06status\x18\n" + - " \x01(\x0e2\x19.inventory.v1.AgentStatusR\x06status\x12\x1f\n" + - "\vlisten_port\x18\v \x01(\rR\n" + - "listenPort\x120\n" + - "\x14push_metrics_enabled\x18\f \x01(\bR\x12pushMetricsEnabled\x12*\n" + - "\x11process_exec_path\x18\r \x01(\tR\x0fprocessExecPath\x123\n" + - "\tlog_level\x18\x0e \x01(\x0e2\x16.inventory.v1.LogLevelR\blogLevel\x12K\n" + - "\x13metrics_resolutions\x18\x0f \x01(\v2\x1a.common.MetricsResolutionsR\x12metricsResolutions\x1a?\n" + - "\x11CustomLabelsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\xaa\x02\n" + - "\x17ChangeCommonAgentParams\x12\x1b\n" + - "\x06enable\x18\x01 \x01(\bH\x00R\x06enable\x88\x01\x01\x12;\n" + - "\rcustom_labels\x18\x02 \x01(\v2\x11.common.StringMapH\x01R\fcustomLabels\x88\x01\x01\x123\n" + - "\x13enable_push_metrics\x18\x03 \x01(\bH\x02R\x11enablePushMetrics\x88\x01\x01\x12K\n" + - "\x13metrics_resolutions\x18\x04 \x01(\v2\x1a.common.MetricsResolutionsR\x12metricsResolutionsB\t\n" + - "\a_enableB\x10\n" + - "\x0e_custom_labelsB\x16\n" + - "\x14_enable_push_metrics\"\xa5\x01\n" + - "\x11ListAgentsRequest\x12 \n" + - "\fpmm_agent_id\x18\x01 \x01(\tR\n" + - "pmmAgentId\x12\x17\n" + - "\anode_id\x18\x02 \x01(\tR\x06nodeId\x12\x1d\n" + - "\n" + - "service_id\x18\x03 \x01(\tR\tserviceId\x126\n" + - "\n" + - "agent_type\x18\x04 \x01(\x0e2\x17.inventory.v1.AgentTypeR\tagentType\"\xcd\v\n" + - "\x12ListAgentsResponse\x123\n" + - "\tpmm_agent\x18\x01 \x03(\v2\x16.inventory.v1.PMMAgentR\bpmmAgent\x120\n" + - "\bvm_agent\x18\x02 \x03(\v2\x15.inventory.v1.VMAgentR\avmAgent\x12?\n" + - "\rnode_exporter\x18\x03 \x03(\v2\x1a.inventory.v1.NodeExporterR\fnodeExporter\x12E\n" + - "\x0fmysqld_exporter\x18\x04 \x03(\v2\x1c.inventory.v1.MySQLdExporterR\x0emysqldExporter\x12H\n" + - "\x10mongodb_exporter\x18\x05 \x03(\v2\x1d.inventory.v1.MongoDBExporterR\x0fmongodbExporter\x12K\n" + - "\x11postgres_exporter\x18\x06 \x03(\v2\x1e.inventory.v1.PostgresExporterR\x10postgresExporter\x12K\n" + - "\x11proxysql_exporter\x18\a \x03(\v2\x1e.inventory.v1.ProxySQLExporterR\x10proxysqlExporter\x12b\n" + - "\x1aqan_mysql_perfschema_agent\x18\b \x03(\v2%.inventory.v1.QANMySQLPerfSchemaAgentR\x17qanMysqlPerfschemaAgent\x12Y\n" + - "\x17qan_mysql_slowlog_agent\x18\t \x03(\v2\".inventory.v1.QANMySQLSlowlogAgentR\x14qanMysqlSlowlogAgent\x12b\n" + - "\x1aqan_mongodb_profiler_agent\x18\n" + - " \x03(\v2%.inventory.v1.QANMongoDBProfilerAgentR\x17qanMongodbProfilerAgent\x12b\n" + - "\x1aqan_mongodb_mongolog_agent\x18\x12 \x03(\v2%.inventory.v1.QANMongoDBMongologAgentR\x17qanMongodbMongologAgent\x12w\n" + - "!qan_postgresql_pgstatements_agent\x18\v \x03(\v2,.inventory.v1.QANPostgreSQLPgStatementsAgentR\x1eqanPostgresqlPgstatementsAgent\x12z\n" + - "\"qan_postgresql_pgstatmonitor_agent\x18\f \x03(\v2-.inventory.v1.QANPostgreSQLPgStatMonitorAgentR\x1fqanPostgresqlPgstatmonitorAgent\x12K\n" + - "\x11external_exporter\x18\r \x03(\v2\x1e.inventory.v1.ExternalExporterR\x10externalExporter\x12<\n" + - "\frds_exporter\x18\x0e \x03(\v2\x19.inventory.v1.RDSExporterR\vrdsExporter\x12[\n" + - "\x17azure_database_exporter\x18\x0f \x03(\v2#.inventory.v1.AzureDatabaseExporterR\x15azureDatabaseExporter\x129\n" + - "\vnomad_agent\x18\x10 \x03(\v2\x18.inventory.v1.NomadAgentR\n" + - "nomadAgent\x12E\n" + - "\x0fvalkey_exporter\x18\x11 \x03(\v2\x1c.inventory.v1.ValkeyExporterR\x0evalkeyExporter\"5\n" + - "\x0fGetAgentRequest\x12\"\n" + - "\bagent_id\x18\x01 \x01(\tB\a\xfaB\x04r\x02\x10$R\aagentId\"\xf7\v\n" + - "\x10GetAgentResponse\x125\n" + - "\tpmm_agent\x18\x01 \x01(\v2\x16.inventory.v1.PMMAgentH\x00R\bpmmAgent\x121\n" + - "\avmagent\x18\x02 \x01(\v2\x15.inventory.v1.VMAgentH\x00R\avmagent\x12A\n" + - "\rnode_exporter\x18\x03 \x01(\v2\x1a.inventory.v1.NodeExporterH\x00R\fnodeExporter\x12G\n" + - "\x0fmysqld_exporter\x18\x04 \x01(\v2\x1c.inventory.v1.MySQLdExporterH\x00R\x0emysqldExporter\x12J\n" + - "\x10mongodb_exporter\x18\x05 \x01(\v2\x1d.inventory.v1.MongoDBExporterH\x00R\x0fmongodbExporter\x12M\n" + - "\x11postgres_exporter\x18\x06 \x01(\v2\x1e.inventory.v1.PostgresExporterH\x00R\x10postgresExporter\x12M\n" + - "\x11proxysql_exporter\x18\a \x01(\v2\x1e.inventory.v1.ProxySQLExporterH\x00R\x10proxysqlExporter\x12d\n" + - "\x1aqan_mysql_perfschema_agent\x18\b \x01(\v2%.inventory.v1.QANMySQLPerfSchemaAgentH\x00R\x17qanMysqlPerfschemaAgent\x12[\n" + - "\x17qan_mysql_slowlog_agent\x18\t \x01(\v2\".inventory.v1.QANMySQLSlowlogAgentH\x00R\x14qanMysqlSlowlogAgent\x12d\n" + - "\x1aqan_mongodb_profiler_agent\x18\n" + - " \x01(\v2%.inventory.v1.QANMongoDBProfilerAgentH\x00R\x17qanMongodbProfilerAgent\x12d\n" + - "\x1aqan_mongodb_mongolog_agent\x18\x12 \x01(\v2%.inventory.v1.QANMongoDBMongologAgentH\x00R\x17qanMongodbMongologAgent\x12y\n" + - "!qan_postgresql_pgstatements_agent\x18\v \x01(\v2,.inventory.v1.QANPostgreSQLPgStatementsAgentH\x00R\x1eqanPostgresqlPgstatementsAgent\x12|\n" + - "\"qan_postgresql_pgstatmonitor_agent\x18\f \x01(\v2-.inventory.v1.QANPostgreSQLPgStatMonitorAgentH\x00R\x1fqanPostgresqlPgstatmonitorAgent\x12M\n" + - "\x11external_exporter\x18\r \x01(\v2\x1e.inventory.v1.ExternalExporterH\x00R\x10externalExporter\x12>\n" + - "\frds_exporter\x18\x0e \x01(\v2\x19.inventory.v1.RDSExporterH\x00R\vrdsExporter\x12]\n" + - "\x17azure_database_exporter\x18\x0f \x01(\v2#.inventory.v1.AzureDatabaseExporterH\x00R\x15azureDatabaseExporter\x12;\n" + - "\vnomad_agent\x18\x10 \x01(\v2\x18.inventory.v1.NomadAgentH\x00R\n" + - "nomadAgent\x12G\n" + - "\x0fvalkey_exporter\x18\x11 \x01(\v2\x1c.inventory.v1.ValkeyExporterH\x00R\x0evalkeyExporterB\a\n" + - "\x05agent\"O\n" + - "\x13GetAgentLogsRequest\x12\"\n" + - "\bagent_id\x18\x01 \x01(\tB\a\xfaB\x04r\x02\x10$R\aagentId\x12\x14\n" + - "\x05limit\x18\x02 \x01(\rR\x05limit\"j\n" + - "\x14GetAgentLogsResponse\x12\x12\n" + - "\x04logs\x18\x01 \x03(\tR\x04logs\x12>\n" + - "\x1cagent_config_log_lines_count\x18\x02 \x01(\rR\x18agentConfigLogLinesCount\"\x98\f\n" + - "\x0fAddAgentRequest\x12>\n" + - "\tpmm_agent\x18\x01 \x01(\v2\x1f.inventory.v1.AddPMMAgentParamsH\x00R\bpmmAgent\x12J\n" + - "\rnode_exporter\x18\x02 \x01(\v2#.inventory.v1.AddNodeExporterParamsH\x00R\fnodeExporter\x12P\n" + - "\x0fmysqld_exporter\x18\x03 \x01(\v2%.inventory.v1.AddMySQLdExporterParamsH\x00R\x0emysqldExporter\x12S\n" + - "\x10mongodb_exporter\x18\x04 \x01(\v2&.inventory.v1.AddMongoDBExporterParamsH\x00R\x0fmongodbExporter\x12V\n" + - "\x11postgres_exporter\x18\x05 \x01(\v2'.inventory.v1.AddPostgresExporterParamsH\x00R\x10postgresExporter\x12V\n" + - "\x11proxysql_exporter\x18\x06 \x01(\v2'.inventory.v1.AddProxySQLExporterParamsH\x00R\x10proxysqlExporter\x12V\n" + - "\x11external_exporter\x18\a \x01(\v2'.inventory.v1.AddExternalExporterParamsH\x00R\x10externalExporter\x12G\n" + - "\frds_exporter\x18\b \x01(\v2\".inventory.v1.AddRDSExporterParamsH\x00R\vrdsExporter\x12f\n" + - "\x17azure_database_exporter\x18\t \x01(\v2,.inventory.v1.AddAzureDatabaseExporterParamsH\x00R\x15azureDatabaseExporter\x12m\n" + - "\x1aqan_mysql_perfschema_agent\x18\n" + - " \x01(\v2..inventory.v1.AddQANMySQLPerfSchemaAgentParamsH\x00R\x17qanMysqlPerfschemaAgent\x12d\n" + - "\x17qan_mysql_slowlog_agent\x18\v \x01(\v2+.inventory.v1.AddQANMySQLSlowlogAgentParamsH\x00R\x14qanMysqlSlowlogAgent\x12m\n" + - "\x1aqan_mongodb_profiler_agent\x18\f \x01(\v2..inventory.v1.AddQANMongoDBProfilerAgentParamsH\x00R\x17qanMongodbProfilerAgent\x12m\n" + - "\x1aqan_mongodb_mongolog_agent\x18\x10 \x01(\v2..inventory.v1.AddQANMongoDBMongologAgentParamsH\x00R\x17qanMongodbMongologAgent\x12\x82\x01\n" + - "!qan_postgresql_pgstatements_agent\x18\r \x01(\v25.inventory.v1.AddQANPostgreSQLPgStatementsAgentParamsH\x00R\x1eqanPostgresqlPgstatementsAgent\x12\x85\x01\n" + - "\"qan_postgresql_pgstatmonitor_agent\x18\x0e \x01(\v26.inventory.v1.AddQANPostgreSQLPgStatMonitorAgentParamsH\x00R\x1fqanPostgresqlPgstatmonitorAgent\x12P\n" + - "\x0fvalkey_exporter\x18\x0f \x01(\v2%.inventory.v1.AddValkeyExporterParamsH\x00R\x0evalkeyExporterB\a\n" + - "\x05agent\"\x87\v\n" + - "\x10AddAgentResponse\x125\n" + - "\tpmm_agent\x18\x01 \x01(\v2\x16.inventory.v1.PMMAgentH\x00R\bpmmAgent\x12A\n" + - "\rnode_exporter\x18\x02 \x01(\v2\x1a.inventory.v1.NodeExporterH\x00R\fnodeExporter\x12G\n" + - "\x0fmysqld_exporter\x18\x03 \x01(\v2\x1c.inventory.v1.MySQLdExporterH\x00R\x0emysqldExporter\x12J\n" + - "\x10mongodb_exporter\x18\x04 \x01(\v2\x1d.inventory.v1.MongoDBExporterH\x00R\x0fmongodbExporter\x12M\n" + - "\x11postgres_exporter\x18\x05 \x01(\v2\x1e.inventory.v1.PostgresExporterH\x00R\x10postgresExporter\x12M\n" + - "\x11proxysql_exporter\x18\x06 \x01(\v2\x1e.inventory.v1.ProxySQLExporterH\x00R\x10proxysqlExporter\x12M\n" + - "\x11external_exporter\x18\a \x01(\v2\x1e.inventory.v1.ExternalExporterH\x00R\x10externalExporter\x12>\n" + - "\frds_exporter\x18\b \x01(\v2\x19.inventory.v1.RDSExporterH\x00R\vrdsExporter\x12]\n" + - "\x17azure_database_exporter\x18\t \x01(\v2#.inventory.v1.AzureDatabaseExporterH\x00R\x15azureDatabaseExporter\x12d\n" + - "\x1aqan_mysql_perfschema_agent\x18\n" + - " \x01(\v2%.inventory.v1.QANMySQLPerfSchemaAgentH\x00R\x17qanMysqlPerfschemaAgent\x12[\n" + - "\x17qan_mysql_slowlog_agent\x18\v \x01(\v2\".inventory.v1.QANMySQLSlowlogAgentH\x00R\x14qanMysqlSlowlogAgent\x12d\n" + - "\x1aqan_mongodb_profiler_agent\x18\f \x01(\v2%.inventory.v1.QANMongoDBProfilerAgentH\x00R\x17qanMongodbProfilerAgent\x12d\n" + - "\x1aqan_mongodb_mongolog_agent\x18\x10 \x01(\v2%.inventory.v1.QANMongoDBMongologAgentH\x00R\x17qanMongodbMongologAgent\x12y\n" + - "!qan_postgresql_pgstatements_agent\x18\r \x01(\v2,.inventory.v1.QANPostgreSQLPgStatementsAgentH\x00R\x1eqanPostgresqlPgstatementsAgent\x12|\n" + - "\"qan_postgresql_pgstatmonitor_agent\x18\x0e \x01(\v2-.inventory.v1.QANPostgreSQLPgStatMonitorAgentH\x00R\x1fqanPostgresqlPgstatmonitorAgent\x12G\n" + - "\x0fvalkey_exporter\x18\x0f \x01(\v2\x1c.inventory.v1.ValkeyExporterH\x00R\x0evalkeyExporterB\a\n" + - "\x05agent\"\xf5\f\n" + - "\x12ChangeAgentRequest\x12\"\n" + - "\bagent_id\x18\x01 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\aagentId\x12M\n" + - "\rnode_exporter\x18\x02 \x01(\v2&.inventory.v1.ChangeNodeExporterParamsH\x00R\fnodeExporter\x12S\n" + - "\x0fmysqld_exporter\x18\x03 \x01(\v2(.inventory.v1.ChangeMySQLdExporterParamsH\x00R\x0emysqldExporter\x12V\n" + - "\x10mongodb_exporter\x18\x04 \x01(\v2).inventory.v1.ChangeMongoDBExporterParamsH\x00R\x0fmongodbExporter\x12Y\n" + - "\x11postgres_exporter\x18\x05 \x01(\v2*.inventory.v1.ChangePostgresExporterParamsH\x00R\x10postgresExporter\x12Y\n" + - "\x11proxysql_exporter\x18\x06 \x01(\v2*.inventory.v1.ChangeProxySQLExporterParamsH\x00R\x10proxysqlExporter\x12Y\n" + - "\x11external_exporter\x18\a \x01(\v2*.inventory.v1.ChangeExternalExporterParamsH\x00R\x10externalExporter\x12J\n" + - "\frds_exporter\x18\b \x01(\v2%.inventory.v1.ChangeRDSExporterParamsH\x00R\vrdsExporter\x12i\n" + - "\x17azure_database_exporter\x18\t \x01(\v2/.inventory.v1.ChangeAzureDatabaseExporterParamsH\x00R\x15azureDatabaseExporter\x12p\n" + - "\x1aqan_mysql_perfschema_agent\x18\n" + - " \x01(\v21.inventory.v1.ChangeQANMySQLPerfSchemaAgentParamsH\x00R\x17qanMysqlPerfschemaAgent\x12g\n" + - "\x17qan_mysql_slowlog_agent\x18\v \x01(\v2..inventory.v1.ChangeQANMySQLSlowlogAgentParamsH\x00R\x14qanMysqlSlowlogAgent\x12p\n" + - "\x1aqan_mongodb_profiler_agent\x18\f \x01(\v21.inventory.v1.ChangeQANMongoDBProfilerAgentParamsH\x00R\x17qanMongodbProfilerAgent\x12p\n" + - "\x1aqan_mongodb_mongolog_agent\x18\x11 \x01(\v21.inventory.v1.ChangeQANMongoDBMongologAgentParamsH\x00R\x17qanMongodbMongologAgent\x12\x85\x01\n" + - "!qan_postgresql_pgstatements_agent\x18\r \x01(\v28.inventory.v1.ChangeQANPostgreSQLPgStatementsAgentParamsH\x00R\x1eqanPostgresqlPgstatementsAgent\x12\x88\x01\n" + - "\"qan_postgresql_pgstatmonitor_agent\x18\x0e \x01(\v29.inventory.v1.ChangeQANPostgreSQLPgStatMonitorAgentParamsH\x00R\x1fqanPostgresqlPgstatmonitorAgent\x12G\n" + - "\vnomad_agent\x18\x0f \x01(\v2$.inventory.v1.ChangeNomadAgentParamsH\x00R\n" + - "nomadAgent\x12S\n" + - "\x0fvalkey_exporter\x18\x10 \x01(\v2(.inventory.v1.ChangeValkeyExporterParamsH\x00R\x0evalkeyExporterB\a\n" + - "\x05agent\"\x90\v\n" + - "\x13ChangeAgentResponse\x12A\n" + - "\rnode_exporter\x18\x02 \x01(\v2\x1a.inventory.v1.NodeExporterH\x00R\fnodeExporter\x12G\n" + - "\x0fmysqld_exporter\x18\x03 \x01(\v2\x1c.inventory.v1.MySQLdExporterH\x00R\x0emysqldExporter\x12J\n" + - "\x10mongodb_exporter\x18\x04 \x01(\v2\x1d.inventory.v1.MongoDBExporterH\x00R\x0fmongodbExporter\x12M\n" + - "\x11postgres_exporter\x18\x05 \x01(\v2\x1e.inventory.v1.PostgresExporterH\x00R\x10postgresExporter\x12M\n" + - "\x11proxysql_exporter\x18\x06 \x01(\v2\x1e.inventory.v1.ProxySQLExporterH\x00R\x10proxysqlExporter\x12M\n" + - "\x11external_exporter\x18\a \x01(\v2\x1e.inventory.v1.ExternalExporterH\x00R\x10externalExporter\x12>\n" + - "\frds_exporter\x18\b \x01(\v2\x19.inventory.v1.RDSExporterH\x00R\vrdsExporter\x12]\n" + - "\x17azure_database_exporter\x18\t \x01(\v2#.inventory.v1.AzureDatabaseExporterH\x00R\x15azureDatabaseExporter\x12d\n" + - "\x1aqan_mysql_perfschema_agent\x18\n" + - " \x01(\v2%.inventory.v1.QANMySQLPerfSchemaAgentH\x00R\x17qanMysqlPerfschemaAgent\x12[\n" + - "\x17qan_mysql_slowlog_agent\x18\v \x01(\v2\".inventory.v1.QANMySQLSlowlogAgentH\x00R\x14qanMysqlSlowlogAgent\x12d\n" + - "\x1aqan_mongodb_profiler_agent\x18\f \x01(\v2%.inventory.v1.QANMongoDBProfilerAgentH\x00R\x17qanMongodbProfilerAgent\x12d\n" + - "\x1aqan_mongodb_mongolog_agent\x18\x11 \x01(\v2%.inventory.v1.QANMongoDBMongologAgentH\x00R\x17qanMongodbMongologAgent\x12y\n" + - "!qan_postgresql_pgstatements_agent\x18\r \x01(\v2,.inventory.v1.QANPostgreSQLPgStatementsAgentH\x00R\x1eqanPostgresqlPgstatementsAgent\x12|\n" + - "\"qan_postgresql_pgstatmonitor_agent\x18\x0e \x01(\v2-.inventory.v1.QANPostgreSQLPgStatMonitorAgentH\x00R\x1fqanPostgresqlPgstatmonitorAgent\x12;\n" + - "\vnomad_agent\x18\x0f \x01(\v2\x18.inventory.v1.NomadAgentH\x00R\n" + - "nomadAgent\x12G\n" + - "\x0fvalkey_exporter\x18\x10 \x01(\v2\x1c.inventory.v1.ValkeyExporterH\x00R\x0evalkeyExporterB\a\n" + - "\x05agent\"\xdc\x01\n" + - "\x11AddPMMAgentParams\x12.\n" + - "\x0fruns_on_node_id\x18\x01 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\frunsOnNodeId\x12V\n" + - "\rcustom_labels\x18\x02 \x03(\v21.inventory.v1.AddPMMAgentParams.CustomLabelsEntryR\fcustomLabels\x1a?\n" + - "\x11CustomLabelsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\x8f\x03\n" + - "\x15AddNodeExporterParams\x12)\n" + - "\fpmm_agent_id\x18\x01 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\n" + - "pmmAgentId\x12Z\n" + - "\rcustom_labels\x18\x02 \x03(\v25.inventory.v1.AddNodeExporterParams.CustomLabelsEntryR\fcustomLabels\x12!\n" + - "\fpush_metrics\x18\x03 \x01(\bR\vpushMetrics\x12-\n" + - "\x12disable_collectors\x18\x04 \x03(\tR\x11disableCollectors\x123\n" + - "\tlog_level\x18\x05 \x01(\x0e2\x16.inventory.v1.LogLevelR\blogLevel\x12'\n" + - "\x0fexpose_exporter\x18\x06 \x01(\bR\x0eexposeExporter\x1a?\n" + - "\x11CustomLabelsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\xab\x02\n" + - "\x18ChangeNodeExporterParams\x12\x1b\n" + - "\x06enable\x18\x01 \x01(\bH\x00R\x06enable\x88\x01\x01\x12;\n" + - "\rcustom_labels\x18\x02 \x01(\v2\x11.common.StringMapH\x01R\fcustomLabels\x88\x01\x01\x123\n" + - "\x13enable_push_metrics\x18\x03 \x01(\bH\x02R\x11enablePushMetrics\x88\x01\x01\x12K\n" + - "\x13metrics_resolutions\x18\x04 \x01(\v2\x1a.common.MetricsResolutionsR\x12metricsResolutionsB\t\n" + - "\a_enableB\x10\n" + - "\x0e_custom_labelsB\x16\n" + - "\x14_enable_push_metrics\"\xc5\a\n" + - "\x17AddMySQLdExporterParams\x12)\n" + - "\fpmm_agent_id\x18\x01 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\n" + - "pmmAgentId\x12&\n" + - "\n" + - "service_id\x18\x02 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\tserviceId\x12#\n" + - "\busername\x18\x03 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\busername\x12\x1a\n" + - "\bpassword\x18\x04 \x01(\tR\bpassword\x12\x10\n" + - "\x03tls\x18\x05 \x01(\bR\x03tls\x12&\n" + - "\x0ftls_skip_verify\x18\x06 \x01(\bR\rtlsSkipVerify\x12\x15\n" + - "\x06tls_ca\x18\a \x01(\tR\x05tlsCa\x12\x19\n" + - "\btls_cert\x18\b \x01(\tR\atlsCert\x12\x17\n" + - "\atls_key\x18\t \x01(\tR\x06tlsKey\x12?\n" + - "\x1ctablestats_group_table_limit\x18\n" + - " \x01(\x05R\x19tablestatsGroupTableLimit\x12\\\n" + - "\rcustom_labels\x18\v \x03(\v27.inventory.v1.AddMySQLdExporterParams.CustomLabelsEntryR\fcustomLabels\x122\n" + - "\x15skip_connection_check\x18\f \x01(\bR\x13skipConnectionCheck\x12!\n" + - "\fpush_metrics\x18\r \x01(\bR\vpushMetrics\x12-\n" + - "\x12disable_collectors\x18\x0e \x03(\tR\x11disableCollectors\x12%\n" + - "\x0eagent_password\x18\x0f \x01(\tR\ragentPassword\x123\n" + - "\tlog_level\x18\x10 \x01(\x0e2\x16.inventory.v1.LogLevelR\blogLevel\x12'\n" + - "\x0fexpose_exporter\x18\x11 \x01(\bR\x0eexposeExporter\x12c\n" + - "\x10extra_dsn_params\x18\x12 \x03(\v29.inventory.v1.AddMySQLdExporterParams.ExtraDsnParamsEntryR\x0eextraDsnParams\x1a?\n" + - "\x11CustomLabelsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\x1aA\n" + - "\x13ExtraDsnParamsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\xad\x02\n" + - "\x1aChangeMySQLdExporterParams\x12\x1b\n" + - "\x06enable\x18\x01 \x01(\bH\x00R\x06enable\x88\x01\x01\x12;\n" + - "\rcustom_labels\x18\x02 \x01(\v2\x11.common.StringMapH\x01R\fcustomLabels\x88\x01\x01\x123\n" + - "\x13enable_push_metrics\x18\x03 \x01(\bH\x02R\x11enablePushMetrics\x88\x01\x01\x12K\n" + - "\x13metrics_resolutions\x18\x04 \x01(\v2\x1a.common.MetricsResolutionsR\x12metricsResolutionsB\t\n" + - "\a_enableB\x10\n" + - "\x0e_custom_labelsB\x16\n" + - "\x14_enable_push_metrics\"\xe9\a\n" + - "\x18AddMongoDBExporterParams\x12)\n" + - "\fpmm_agent_id\x18\x01 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\n" + - "pmmAgentId\x12&\n" + - "\n" + - "service_id\x18\x02 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\tserviceId\x12\x1a\n" + - "\busername\x18\x03 \x01(\tR\busername\x12\x1a\n" + - "\bpassword\x18\x04 \x01(\tR\bpassword\x12\x10\n" + - "\x03tls\x18\x05 \x01(\bR\x03tls\x12&\n" + - "\x0ftls_skip_verify\x18\x06 \x01(\bR\rtlsSkipVerify\x12.\n" + - "\x13tls_certificate_key\x18\a \x01(\tR\x11tlsCertificateKey\x12H\n" + - "!tls_certificate_key_file_password\x18\b \x01(\tR\x1dtlsCertificateKeyFilePassword\x12\x15\n" + - "\x06tls_ca\x18\t \x01(\tR\x05tlsCa\x12]\n" + - "\rcustom_labels\x18\n" + - " \x03(\v28.inventory.v1.AddMongoDBExporterParams.CustomLabelsEntryR\fcustomLabels\x122\n" + - "\x15skip_connection_check\x18\v \x01(\bR\x13skipConnectionCheck\x12!\n" + - "\fpush_metrics\x18\f \x01(\bR\vpushMetrics\x12-\n" + - "\x12disable_collectors\x18\r \x03(\tR\x11disableCollectors\x129\n" + - "\x18authentication_mechanism\x18\x0e \x01(\tR\x17authenticationMechanism\x127\n" + - "\x17authentication_database\x18\x0f \x01(\tR\x16authenticationDatabase\x12%\n" + - "\x0eagent_password\x18\x10 \x01(\tR\ragentPassword\x12+\n" + - "\x11stats_collections\x18\x11 \x03(\tR\x10statsCollections\x12+\n" + - "\x11collections_limit\x18\x12 \x01(\x05R\x10collectionsLimit\x123\n" + - "\tlog_level\x18\x13 \x01(\x0e2\x16.inventory.v1.LogLevelR\blogLevel\x12'\n" + - "\x0fexpose_exporter\x18\x14 \x01(\bR\x0eexposeExporter\x1a?\n" + - "\x11CustomLabelsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\xae\x02\n" + - "\x1bChangeMongoDBExporterParams\x12\x1b\n" + - "\x06enable\x18\x01 \x01(\bH\x00R\x06enable\x88\x01\x01\x12;\n" + - "\rcustom_labels\x18\x02 \x01(\v2\x11.common.StringMapH\x01R\fcustomLabels\x88\x01\x01\x123\n" + - "\x13enable_push_metrics\x18\x03 \x01(\bH\x02R\x11enablePushMetrics\x88\x01\x01\x12K\n" + - "\x13metrics_resolutions\x18\x04 \x01(\v2\x1a.common.MetricsResolutionsR\x12metricsResolutionsB\t\n" + - "\a_enableB\x10\n" + - "\x0e_custom_labelsB\x16\n" + - "\x14_enable_push_metrics\"\xcc\x06\n" + - "\x19AddPostgresExporterParams\x12)\n" + - "\fpmm_agent_id\x18\x01 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\n" + - "pmmAgentId\x12&\n" + - "\n" + - "service_id\x18\x02 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\tserviceId\x12#\n" + - "\busername\x18\x03 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\busername\x12\x1a\n" + - "\bpassword\x18\x04 \x01(\tR\bpassword\x12\x10\n" + - "\x03tls\x18\x05 \x01(\bR\x03tls\x12&\n" + - "\x0ftls_skip_verify\x18\x06 \x01(\bR\rtlsSkipVerify\x12^\n" + - "\rcustom_labels\x18\a \x03(\v29.inventory.v1.AddPostgresExporterParams.CustomLabelsEntryR\fcustomLabels\x122\n" + - "\x15skip_connection_check\x18\b \x01(\bR\x13skipConnectionCheck\x12!\n" + - "\fpush_metrics\x18\t \x01(\bR\vpushMetrics\x12-\n" + - "\x12disable_collectors\x18\n" + - " \x03(\tR\x11disableCollectors\x12\x15\n" + - "\x06tls_ca\x18\v \x01(\tR\x05tlsCa\x12\x19\n" + - "\btls_cert\x18\f \x01(\tR\atlsCert\x12\x17\n" + - "\atls_key\x18\r \x01(\tR\x06tlsKey\x12%\n" + - "\x0eagent_password\x18\x0e \x01(\tR\ragentPassword\x123\n" + - "\tlog_level\x18\x0f \x01(\x0e2\x16.inventory.v1.LogLevelR\blogLevel\x120\n" + - "\x14auto_discovery_limit\x18\x10 \x01(\x05R\x12autoDiscoveryLimit\x12'\n" + - "\x0fexpose_exporter\x18\x11 \x01(\bR\x0eexposeExporter\x128\n" + - "\x18max_exporter_connections\x18\x12 \x01(\x05R\x16maxExporterConnections\x1a?\n" + - "\x11CustomLabelsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\xaf\x02\n" + - "\x1cChangePostgresExporterParams\x12\x1b\n" + - "\x06enable\x18\x01 \x01(\bH\x00R\x06enable\x88\x01\x01\x12;\n" + - "\rcustom_labels\x18\x02 \x01(\v2\x11.common.StringMapH\x01R\fcustomLabels\x88\x01\x01\x123\n" + - "\x13enable_push_metrics\x18\x03 \x01(\bH\x02R\x11enablePushMetrics\x88\x01\x01\x12K\n" + - "\x13metrics_resolutions\x18\x04 \x01(\v2\x1a.common.MetricsResolutionsR\x12metricsResolutionsB\t\n" + - "\a_enableB\x10\n" + - "\x0e_custom_labelsB\x16\n" + - "\x14_enable_push_metrics\"\x95\x05\n" + - "\x19AddProxySQLExporterParams\x12)\n" + - "\fpmm_agent_id\x18\x01 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\n" + - "pmmAgentId\x12&\n" + - "\n" + - "service_id\x18\x02 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\tserviceId\x12#\n" + - "\busername\x18\x03 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\busername\x12\x1a\n" + - "\bpassword\x18\x04 \x01(\tR\bpassword\x12\x10\n" + - "\x03tls\x18\x05 \x01(\bR\x03tls\x12&\n" + - "\x0ftls_skip_verify\x18\x06 \x01(\bR\rtlsSkipVerify\x12^\n" + - "\rcustom_labels\x18\a \x03(\v29.inventory.v1.AddProxySQLExporterParams.CustomLabelsEntryR\fcustomLabels\x122\n" + - "\x15skip_connection_check\x18\b \x01(\bR\x13skipConnectionCheck\x12!\n" + - "\fpush_metrics\x18\t \x01(\bR\vpushMetrics\x12-\n" + - "\x12disable_collectors\x18\n" + - " \x03(\tR\x11disableCollectors\x12%\n" + - "\x0eagent_password\x18\v \x01(\tR\ragentPassword\x123\n" + - "\tlog_level\x18\f \x01(\x0e2\x16.inventory.v1.LogLevelR\blogLevel\x12'\n" + - "\x0fexpose_exporter\x18\r \x01(\bR\x0eexposeExporter\x1a?\n" + - "\x11CustomLabelsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\xaf\x02\n" + - "\x1cChangeProxySQLExporterParams\x12\x1b\n" + - "\x06enable\x18\x01 \x01(\bH\x00R\x06enable\x88\x01\x01\x12;\n" + - "\rcustom_labels\x18\x02 \x01(\v2\x11.common.StringMapH\x01R\fcustomLabels\x88\x01\x01\x123\n" + - "\x13enable_push_metrics\x18\x03 \x01(\bH\x02R\x11enablePushMetrics\x88\x01\x01\x12K\n" + - "\x13metrics_resolutions\x18\x04 \x01(\v2\x1a.common.MetricsResolutionsR\x12metricsResolutionsB\t\n" + - "\a_enableB\x10\n" + - "\x0e_custom_labelsB\x16\n" + - "\x14_enable_push_metrics\"\x97\a\n" + - " AddQANMySQLPerfSchemaAgentParams\x12)\n" + - "\fpmm_agent_id\x18\x01 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\n" + - "pmmAgentId\x12&\n" + - "\n" + - "service_id\x18\x02 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\tserviceId\x12#\n" + - "\busername\x18\x03 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\busername\x12\x1a\n" + - "\bpassword\x18\x04 \x01(\tR\bpassword\x12\x10\n" + - "\x03tls\x18\x05 \x01(\bR\x03tls\x12&\n" + - "\x0ftls_skip_verify\x18\x06 \x01(\bR\rtlsSkipVerify\x12\x15\n" + - "\x06tls_ca\x18\a \x01(\tR\x05tlsCa\x12\x19\n" + - "\btls_cert\x18\b \x01(\tR\atlsCert\x12\x17\n" + - "\atls_key\x18\t \x01(\tR\x06tlsKey\x12(\n" + - "\x10max_query_length\x18\n" + - " \x01(\x05R\x0emaxQueryLength\x124\n" + - "\x16disable_query_examples\x18\v \x01(\bR\x14disableQueryExamples\x12e\n" + - "\rcustom_labels\x18\f \x03(\v2@.inventory.v1.AddQANMySQLPerfSchemaAgentParams.CustomLabelsEntryR\fcustomLabels\x122\n" + - "\x15skip_connection_check\x18\r \x01(\bR\x13skipConnectionCheck\x128\n" + - "\x18disable_comments_parsing\x18\x0e \x01(\bR\x16disableCommentsParsing\x123\n" + - "\tlog_level\x18\x0f \x01(\x0e2\x16.inventory.v1.LogLevelR\blogLevel\x12l\n" + - "\x10extra_dsn_params\x18\x10 \x03(\v2B.inventory.v1.AddQANMySQLPerfSchemaAgentParams.ExtraDsnParamsEntryR\x0eextraDsnParams\x1a?\n" + - "\x11CustomLabelsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\x1aA\n" + - "\x13ExtraDsnParamsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\xb6\x02\n" + - "#ChangeQANMySQLPerfSchemaAgentParams\x12\x1b\n" + - "\x06enable\x18\x01 \x01(\bH\x00R\x06enable\x88\x01\x01\x12;\n" + - "\rcustom_labels\x18\x02 \x01(\v2\x11.common.StringMapH\x01R\fcustomLabels\x88\x01\x01\x123\n" + - "\x13enable_push_metrics\x18\x03 \x01(\bH\x02R\x11enablePushMetrics\x88\x01\x01\x12K\n" + - "\x13metrics_resolutions\x18\x04 \x01(\v2\x1a.common.MetricsResolutionsR\x12metricsResolutionsB\t\n" + - "\a_enableB\x10\n" + - "\x0e_custom_labelsB\x16\n" + - "\x14_enable_push_metrics\"\xc1\a\n" + - "\x1dAddQANMySQLSlowlogAgentParams\x12)\n" + - "\fpmm_agent_id\x18\x01 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\n" + - "pmmAgentId\x12&\n" + - "\n" + - "service_id\x18\x02 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\tserviceId\x12#\n" + - "\busername\x18\x03 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\busername\x12\x1a\n" + - "\bpassword\x18\x04 \x01(\tR\bpassword\x12\x10\n" + - "\x03tls\x18\x05 \x01(\bR\x03tls\x12&\n" + - "\x0ftls_skip_verify\x18\x06 \x01(\bR\rtlsSkipVerify\x12\x15\n" + - "\x06tls_ca\x18\a \x01(\tR\x05tlsCa\x12\x19\n" + - "\btls_cert\x18\b \x01(\tR\atlsCert\x12\x17\n" + - "\atls_key\x18\t \x01(\tR\x06tlsKey\x12(\n" + - "\x10max_query_length\x18\n" + - " \x01(\x05R\x0emaxQueryLength\x124\n" + - "\x16disable_query_examples\x18\v \x01(\bR\x14disableQueryExamples\x121\n" + - "\x15max_slowlog_file_size\x18\f \x01(\x03R\x12maxSlowlogFileSize\x12b\n" + - "\rcustom_labels\x18\r \x03(\v2=.inventory.v1.AddQANMySQLSlowlogAgentParams.CustomLabelsEntryR\fcustomLabels\x122\n" + - "\x15skip_connection_check\x18\x0e \x01(\bR\x13skipConnectionCheck\x128\n" + - "\x18disable_comments_parsing\x18\x0f \x01(\bR\x16disableCommentsParsing\x123\n" + - "\tlog_level\x18\x10 \x01(\x0e2\x16.inventory.v1.LogLevelR\blogLevel\x12i\n" + - "\x10extra_dsn_params\x18\x11 \x03(\v2?.inventory.v1.AddQANMySQLSlowlogAgentParams.ExtraDsnParamsEntryR\x0eextraDsnParams\x1a?\n" + - "\x11CustomLabelsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\x1aA\n" + - "\x13ExtraDsnParamsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\xb3\x02\n" + - " ChangeQANMySQLSlowlogAgentParams\x12\x1b\n" + - "\x06enable\x18\x01 \x01(\bH\x00R\x06enable\x88\x01\x01\x12;\n" + - "\rcustom_labels\x18\x02 \x01(\v2\x11.common.StringMapH\x01R\fcustomLabels\x88\x01\x01\x123\n" + - "\x13enable_push_metrics\x18\x03 \x01(\bH\x02R\x11enablePushMetrics\x88\x01\x01\x12K\n" + - "\x13metrics_resolutions\x18\x04 \x01(\v2\x1a.common.MetricsResolutionsR\x12metricsResolutionsB\t\n" + - "\a_enableB\x10\n" + - "\x0e_custom_labelsB\x16\n" + - "\x14_enable_push_metrics\"\xa7\x06\n" + - " AddQANMongoDBProfilerAgentParams\x12)\n" + - "\fpmm_agent_id\x18\x01 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\n" + - "pmmAgentId\x12&\n" + - "\n" + - "service_id\x18\x02 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\tserviceId\x12\x1a\n" + - "\busername\x18\x03 \x01(\tR\busername\x12\x1a\n" + - "\bpassword\x18\x04 \x01(\tR\bpassword\x12\x10\n" + - "\x03tls\x18\x05 \x01(\bR\x03tls\x12&\n" + - "\x0ftls_skip_verify\x18\x06 \x01(\bR\rtlsSkipVerify\x12.\n" + - "\x13tls_certificate_key\x18\a \x01(\tR\x11tlsCertificateKey\x12H\n" + - "!tls_certificate_key_file_password\x18\b \x01(\tR\x1dtlsCertificateKeyFilePassword\x12\x15\n" + - "\x06tls_ca\x18\t \x01(\tR\x05tlsCa\x12(\n" + - "\x10max_query_length\x18\n" + - " \x01(\x05R\x0emaxQueryLength\x12e\n" + - "\rcustom_labels\x18\v \x03(\v2@.inventory.v1.AddQANMongoDBProfilerAgentParams.CustomLabelsEntryR\fcustomLabels\x122\n" + - "\x15skip_connection_check\x18\f \x01(\bR\x13skipConnectionCheck\x129\n" + - "\x18authentication_mechanism\x18\r \x01(\tR\x17authenticationMechanism\x127\n" + - "\x17authentication_database\x18\x0e \x01(\tR\x16authenticationDatabase\x123\n" + - "\tlog_level\x18\x0f \x01(\x0e2\x16.inventory.v1.LogLevelR\blogLevel\x1a?\n" + - "\x11CustomLabelsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\xb6\x02\n" + - "#ChangeQANMongoDBProfilerAgentParams\x12\x1b\n" + - "\x06enable\x18\x01 \x01(\bH\x00R\x06enable\x88\x01\x01\x12;\n" + - "\rcustom_labels\x18\x02 \x01(\v2\x11.common.StringMapH\x01R\fcustomLabels\x88\x01\x01\x123\n" + - "\x13enable_push_metrics\x18\x03 \x01(\bH\x02R\x11enablePushMetrics\x88\x01\x01\x12K\n" + - "\x13metrics_resolutions\x18\x04 \x01(\v2\x1a.common.MetricsResolutionsR\x12metricsResolutionsB\t\n" + - "\a_enableB\x10\n" + - "\x0e_custom_labelsB\x16\n" + - "\x14_enable_push_metrics\"\xa7\x06\n" + - " AddQANMongoDBMongologAgentParams\x12)\n" + - "\fpmm_agent_id\x18\x01 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\n" + - "pmmAgentId\x12&\n" + - "\n" + - "service_id\x18\x02 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\tserviceId\x12\x1a\n" + - "\busername\x18\x03 \x01(\tR\busername\x12\x1a\n" + - "\bpassword\x18\x04 \x01(\tR\bpassword\x12\x10\n" + - "\x03tls\x18\x05 \x01(\bR\x03tls\x12&\n" + - "\x0ftls_skip_verify\x18\x06 \x01(\bR\rtlsSkipVerify\x12.\n" + - "\x13tls_certificate_key\x18\a \x01(\tR\x11tlsCertificateKey\x12H\n" + - "!tls_certificate_key_file_password\x18\b \x01(\tR\x1dtlsCertificateKeyFilePassword\x12\x15\n" + - "\x06tls_ca\x18\t \x01(\tR\x05tlsCa\x12(\n" + - "\x10max_query_length\x18\n" + - " \x01(\x05R\x0emaxQueryLength\x12e\n" + - "\rcustom_labels\x18\v \x03(\v2@.inventory.v1.AddQANMongoDBMongologAgentParams.CustomLabelsEntryR\fcustomLabels\x122\n" + - "\x15skip_connection_check\x18\f \x01(\bR\x13skipConnectionCheck\x129\n" + - "\x18authentication_mechanism\x18\r \x01(\tR\x17authenticationMechanism\x127\n" + - "\x17authentication_database\x18\x0e \x01(\tR\x16authenticationDatabase\x123\n" + - "\tlog_level\x18\x0f \x01(\x0e2\x16.inventory.v1.LogLevelR\blogLevel\x1a?\n" + - "\x11CustomLabelsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\xb6\x02\n" + - "#ChangeQANMongoDBMongologAgentParams\x12\x1b\n" + - "\x06enable\x18\x01 \x01(\bH\x00R\x06enable\x88\x01\x01\x12;\n" + - "\rcustom_labels\x18\x02 \x01(\v2\x11.common.StringMapH\x01R\fcustomLabels\x88\x01\x01\x123\n" + - "\x13enable_push_metrics\x18\x03 \x01(\bH\x02R\x11enablePushMetrics\x88\x01\x01\x12K\n" + - "\x13metrics_resolutions\x18\x04 \x01(\v2\x1a.common.MetricsResolutionsR\x12metricsResolutionsB\t\n" + - "\a_enableB\x10\n" + - "\x0e_custom_labelsB\x16\n" + - "\x14_enable_push_metrics\"\xbe\x05\n" + - "'AddQANPostgreSQLPgStatementsAgentParams\x12)\n" + - "\fpmm_agent_id\x18\x01 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\n" + - "pmmAgentId\x12&\n" + - "\n" + - "service_id\x18\x02 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\tserviceId\x12#\n" + - "\busername\x18\x03 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\busername\x12\x1a\n" + - "\bpassword\x18\x04 \x01(\tR\bpassword\x12\x10\n" + - "\x03tls\x18\x05 \x01(\bR\x03tls\x12&\n" + - "\x0ftls_skip_verify\x18\x06 \x01(\bR\rtlsSkipVerify\x12l\n" + - "\rcustom_labels\x18\a \x03(\v2G.inventory.v1.AddQANPostgreSQLPgStatementsAgentParams.CustomLabelsEntryR\fcustomLabels\x122\n" + - "\x15skip_connection_check\x18\b \x01(\bR\x13skipConnectionCheck\x128\n" + - "\x18disable_comments_parsing\x18\t \x01(\bR\x16disableCommentsParsing\x12(\n" + - "\x10max_query_length\x18\n" + - " \x01(\x05R\x0emaxQueryLength\x12\x15\n" + - "\x06tls_ca\x18\v \x01(\tR\x05tlsCa\x12\x19\n" + - "\btls_cert\x18\f \x01(\tR\atlsCert\x12\x17\n" + - "\atls_key\x18\r \x01(\tR\x06tlsKey\x123\n" + - "\tlog_level\x18\x0e \x01(\x0e2\x16.inventory.v1.LogLevelR\blogLevel\x1a?\n" + - "\x11CustomLabelsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\xbd\x02\n" + - "*ChangeQANPostgreSQLPgStatementsAgentParams\x12\x1b\n" + - "\x06enable\x18\x01 \x01(\bH\x00R\x06enable\x88\x01\x01\x12;\n" + - "\rcustom_labels\x18\x02 \x01(\v2\x11.common.StringMapH\x01R\fcustomLabels\x88\x01\x01\x123\n" + - "\x13enable_push_metrics\x18\x03 \x01(\bH\x02R\x11enablePushMetrics\x88\x01\x01\x12K\n" + - "\x13metrics_resolutions\x18\x04 \x01(\v2\x1a.common.MetricsResolutionsR\x12metricsResolutionsB\t\n" + - "\a_enableB\x10\n" + - "\x0e_custom_labelsB\x16\n" + - "\x14_enable_push_metrics\"\xf6\x05\n" + - "(AddQANPostgreSQLPgStatMonitorAgentParams\x12)\n" + - "\fpmm_agent_id\x18\x01 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\n" + - "pmmAgentId\x12&\n" + - "\n" + - "service_id\x18\x02 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\tserviceId\x12#\n" + - "\busername\x18\x03 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\busername\x12\x1a\n" + - "\bpassword\x18\x04 \x01(\tR\bpassword\x12\x10\n" + - "\x03tls\x18\x05 \x01(\bR\x03tls\x12&\n" + - "\x0ftls_skip_verify\x18\x06 \x01(\bR\rtlsSkipVerify\x12(\n" + - "\x10max_query_length\x18\a \x01(\x05R\x0emaxQueryLength\x124\n" + - "\x16disable_query_examples\x18\b \x01(\bR\x14disableQueryExamples\x12m\n" + - "\rcustom_labels\x18\t \x03(\v2H.inventory.v1.AddQANPostgreSQLPgStatMonitorAgentParams.CustomLabelsEntryR\fcustomLabels\x122\n" + - "\x15skip_connection_check\x18\n" + - " \x01(\bR\x13skipConnectionCheck\x128\n" + - "\x18disable_comments_parsing\x18\v \x01(\bR\x16disableCommentsParsing\x12\x15\n" + - "\x06tls_ca\x18\f \x01(\tR\x05tlsCa\x12\x19\n" + - "\btls_cert\x18\r \x01(\tR\atlsCert\x12\x17\n" + - "\atls_key\x18\x0e \x01(\tR\x06tlsKey\x123\n" + - "\tlog_level\x18\x0f \x01(\x0e2\x16.inventory.v1.LogLevelR\blogLevel\x1a?\n" + - "\x11CustomLabelsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\xbe\x02\n" + - "+ChangeQANPostgreSQLPgStatMonitorAgentParams\x12\x1b\n" + - "\x06enable\x18\x01 \x01(\bH\x00R\x06enable\x88\x01\x01\x12;\n" + - "\rcustom_labels\x18\x02 \x01(\v2\x11.common.StringMapH\x01R\fcustomLabels\x88\x01\x01\x123\n" + - "\x13enable_push_metrics\x18\x03 \x01(\bH\x02R\x11enablePushMetrics\x88\x01\x01\x12K\n" + - "\x13metrics_resolutions\x18\x04 \x01(\v2\x1a.common.MetricsResolutionsR\x12metricsResolutionsB\t\n" + - "\a_enableB\x10\n" + - "\x0e_custom_labelsB\x16\n" + - "\x14_enable_push_metrics\"\xc5\x04\n" + - "\x14AddRDSExporterParams\x12)\n" + - "\fpmm_agent_id\x18\x01 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\n" + - "pmmAgentId\x12 \n" + - "\anode_id\x18\x02 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\x06nodeId\x12$\n" + - "\x0eaws_access_key\x18\x03 \x01(\tR\fawsAccessKey\x12$\n" + - "\x0eaws_secret_key\x18\x04 \x01(\tR\fawsSecretKey\x12Y\n" + - "\rcustom_labels\x18\x05 \x03(\v24.inventory.v1.AddRDSExporterParams.CustomLabelsEntryR\fcustomLabels\x122\n" + - "\x15skip_connection_check\x18\x06 \x01(\bR\x13skipConnectionCheck\x122\n" + - "\x15disable_basic_metrics\x18\a \x01(\bR\x13disableBasicMetrics\x128\n" + - "\x18disable_enhanced_metrics\x18\b \x01(\bR\x16disableEnhancedMetrics\x12!\n" + - "\fpush_metrics\x18\t \x01(\bR\vpushMetrics\x123\n" + - "\tlog_level\x18\n" + - " \x01(\x0e2\x16.inventory.v1.LogLevelR\blogLevel\x1a?\n" + - "\x11CustomLabelsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\xaa\x02\n" + - "\x17ChangeRDSExporterParams\x12\x1b\n" + - "\x06enable\x18\x01 \x01(\bH\x00R\x06enable\x88\x01\x01\x12;\n" + - "\rcustom_labels\x18\x02 \x01(\v2\x11.common.StringMapH\x01R\fcustomLabels\x88\x01\x01\x123\n" + - "\x13enable_push_metrics\x18\x03 \x01(\bH\x02R\x11enablePushMetrics\x88\x01\x01\x12K\n" + - "\x13metrics_resolutions\x18\x04 \x01(\v2\x1a.common.MetricsResolutionsR\x12metricsResolutionsB\t\n" + - "\a_enableB\x10\n" + - "\x0e_custom_labelsB\x16\n" + - "\x14_enable_push_metrics\"\xf7\x03\n" + - "\x19AddExternalExporterParams\x12.\n" + - "\x0fruns_on_node_id\x18\x01 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\frunsOnNodeId\x12\x1d\n" + - "\n" + - "service_id\x18\x02 \x01(\tR\tserviceId\x12\x1a\n" + - "\busername\x18\x03 \x01(\tR\busername\x12\x1a\n" + - "\bpassword\x18\x04 \x01(\tR\bpassword\x12\x16\n" + - "\x06scheme\x18\x06 \x01(\tR\x06scheme\x12!\n" + - "\fmetrics_path\x18\a \x01(\tR\vmetricsPath\x12,\n" + - "\vlisten_port\x18\b \x01(\rB\v\xfaB\b*\x06\x10\x80\x80\x04 \x00R\n" + - "listenPort\x12^\n" + - "\rcustom_labels\x18\n" + - " \x03(\v29.inventory.v1.AddExternalExporterParams.CustomLabelsEntryR\fcustomLabels\x12!\n" + - "\fpush_metrics\x18\v \x01(\bR\vpushMetrics\x12&\n" + - "\x0ftls_skip_verify\x18\f \x01(\bR\rtlsSkipVerify\x1a?\n" + - "\x11CustomLabelsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\xaf\x02\n" + - "\x1cChangeExternalExporterParams\x12\x1b\n" + - "\x06enable\x18\x01 \x01(\bH\x00R\x06enable\x88\x01\x01\x12;\n" + - "\rcustom_labels\x18\x02 \x01(\v2\x11.common.StringMapH\x01R\fcustomLabels\x88\x01\x01\x123\n" + - "\x13enable_push_metrics\x18\x03 \x01(\bH\x02R\x11enablePushMetrics\x88\x01\x01\x12K\n" + - "\x13metrics_resolutions\x18\x04 \x01(\v2\x1a.common.MetricsResolutionsR\x12metricsResolutionsB\t\n" + - "\a_enableB\x10\n" + - "\x0e_custom_labelsB\x16\n" + - "\x14_enable_push_metrics\"\xcf\x05\n" + - "\x1eAddAzureDatabaseExporterParams\x12)\n" + - "\fpmm_agent_id\x18\x01 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\n" + - "pmmAgentId\x12 \n" + - "\anode_id\x18\x02 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\x06nodeId\x12&\n" + - "\x0fazure_client_id\x18\x03 \x01(\tR\razureClientId\x12.\n" + - "\x13azure_client_secret\x18\x04 \x01(\tR\x11azureClientSecret\x12&\n" + - "\x0fazure_tenant_id\x18\x05 \x01(\tR\razureTenantId\x122\n" + - "\x15azure_subscription_id\x18\x06 \x01(\tR\x13azureSubscriptionId\x120\n" + - "\x14azure_resource_group\x18\a \x01(\tR\x12azureResourceGroup\x12H\n" + - "\x1cazure_database_resource_type\x18\b \x01(\tB\a\xfaB\x04r\x02\x10\x01R\x19azureDatabaseResourceType\x12c\n" + - "\rcustom_labels\x18\t \x03(\v2>.inventory.v1.AddAzureDatabaseExporterParams.CustomLabelsEntryR\fcustomLabels\x122\n" + - "\x15skip_connection_check\x18\n" + - " \x01(\bR\x13skipConnectionCheck\x12!\n" + - "\fpush_metrics\x18\v \x01(\bR\vpushMetrics\x123\n" + - "\tlog_level\x18\f \x01(\x0e2\x16.inventory.v1.LogLevelR\blogLevel\x1a?\n" + - "\x11CustomLabelsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\xb4\x02\n" + - "!ChangeAzureDatabaseExporterParams\x12\x1b\n" + - "\x06enable\x18\x01 \x01(\bH\x00R\x06enable\x88\x01\x01\x12;\n" + - "\rcustom_labels\x18\x02 \x01(\v2\x11.common.StringMapH\x01R\fcustomLabels\x88\x01\x01\x123\n" + - "\x13enable_push_metrics\x18\x03 \x01(\bH\x02R\x11enablePushMetrics\x88\x01\x01\x12K\n" + - "\x13metrics_resolutions\x18\x04 \x01(\v2\x1a.common.MetricsResolutionsR\x12metricsResolutionsB\t\n" + - "\a_enableB\x10\n" + - "\x0e_custom_labelsB\x16\n" + - "\x14_enable_push_metrics\"@\n" + - "\x16ChangeNomadAgentParams\x12\x1b\n" + - "\x06enable\x18\x01 \x01(\bH\x00R\x06enable\x88\x01\x01B\t\n" + - "\a_enable\"\xa8\x05\n" + - "\x17AddValkeyExporterParams\x12)\n" + - "\fpmm_agent_id\x18\x01 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\n" + - "pmmAgentId\x12'\n" + - "\n" + - "service_id\x18\x02 \x01(\tB\b\xfaB\x05r\x03\xb0\x01\x01R\tserviceId\x12#\n" + - "\busername\x18\x03 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\busername\x12\x1a\n" + - "\bpassword\x18\x04 \x01(\tR\bpassword\x12\x10\n" + - "\x03tls\x18\x05 \x01(\bR\x03tls\x12&\n" + - "\x0ftls_skip_verify\x18\x06 \x01(\bR\rtlsSkipVerify\x12\\\n" + - "\rcustom_labels\x18\a \x03(\v27.inventory.v1.AddValkeyExporterParams.CustomLabelsEntryR\fcustomLabels\x122\n" + - "\x15skip_connection_check\x18\b \x01(\bR\x13skipConnectionCheck\x12!\n" + - "\fpush_metrics\x18\t \x01(\bR\vpushMetrics\x12-\n" + - "\x12disable_collectors\x18\n" + - " \x03(\tR\x11disableCollectors\x12\x15\n" + - "\x06tls_ca\x18\v \x01(\tR\x05tlsCa\x12\x19\n" + - "\btls_cert\x18\f \x01(\tR\atlsCert\x12\x17\n" + - "\atls_key\x18\r \x01(\tR\x06tlsKey\x12%\n" + - "\x0eagent_password\x18\x0e \x01(\tR\ragentPassword\x12'\n" + - "\x0fexpose_exporter\x18\x0f \x01(\bR\x0eexposeExporter\x1a?\n" + - "\x11CustomLabelsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\xad\x02\n" + - "\x1aChangeValkeyExporterParams\x12\x1b\n" + - "\x06enable\x18\x01 \x01(\bH\x00R\x06enable\x88\x01\x01\x12;\n" + - "\rcustom_labels\x18\x02 \x01(\v2\x11.common.StringMapH\x01R\fcustomLabels\x88\x01\x01\x123\n" + - "\x13enable_push_metrics\x18\x03 \x01(\bH\x02R\x11enablePushMetrics\x88\x01\x01\x12K\n" + - "\x13metrics_resolutions\x18\x04 \x01(\v2\x1a.common.MetricsResolutionsR\x12metricsResolutionsB\t\n" + - "\a_enableB\x10\n" + - "\x0e_custom_labelsB\x16\n" + - "\x14_enable_push_metrics\"N\n" + - "\x12RemoveAgentRequest\x12\"\n" + - "\bagent_id\x18\x01 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\aagentId\x12\x14\n" + - "\x05force\x18\x02 \x01(\bR\x05force\"\x15\n" + - "\x13RemoveAgentResponse*\xae\x05\n" + - "\tAgentType\x12\x1a\n" + - "\x16AGENT_TYPE_UNSPECIFIED\x10\x00\x12\x18\n" + - "\x14AGENT_TYPE_PMM_AGENT\x10\x01\x12\x17\n" + - "\x13AGENT_TYPE_VM_AGENT\x10\x0e\x12\x1c\n" + - "\x18AGENT_TYPE_NODE_EXPORTER\x10\x02\x12\x1e\n" + - "\x1aAGENT_TYPE_MYSQLD_EXPORTER\x10\x03\x12\x1f\n" + - "\x1bAGENT_TYPE_MONGODB_EXPORTER\x10\x04\x12 \n" + - "\x1cAGENT_TYPE_POSTGRES_EXPORTER\x10\x05\x12 \n" + - "\x1cAGENT_TYPE_PROXYSQL_EXPORTER\x10\x06\x12\x1e\n" + - "\x1aAGENT_TYPE_VALKEY_EXPORTER\x10\x11\x12)\n" + - "%AGENT_TYPE_QAN_MYSQL_PERFSCHEMA_AGENT\x10\a\x12&\n" + - "\"AGENT_TYPE_QAN_MYSQL_SLOWLOG_AGENT\x10\b\x12)\n" + - "%AGENT_TYPE_QAN_MONGODB_PROFILER_AGENT\x10\t\x12)\n" + - "%AGENT_TYPE_QAN_MONGODB_MONGOLOG_AGENT\x10\x12\x120\n" + - ",AGENT_TYPE_QAN_POSTGRESQL_PGSTATEMENTS_AGENT\x10\n" + - "\x121\n" + - "-AGENT_TYPE_QAN_POSTGRESQL_PGSTATMONITOR_AGENT\x10\r\x12 \n" + - "\x1cAGENT_TYPE_EXTERNAL_EXPORTER\x10\f\x12\x1b\n" + - "\x17AGENT_TYPE_RDS_EXPORTER\x10\v\x12&\n" + - "\"AGENT_TYPE_AZURE_DATABASE_EXPORTER\x10\x0f\x12\x1a\n" + - "\x16AGENT_TYPE_NOMAD_AGENT\x10\x102\x83\t\n" + - "\rAgentsService\x12\x9c\x01\n" + - "\n" + - "ListAgents\x12\x1f.inventory.v1.ListAgentsRequest\x1a .inventory.v1.ListAgentsResponse\"K\x92A,\x12\vList Agents\x1a\x1dReturns a list of all Agents.\x82\xd3\xe4\x93\x02\x16\x12\x14/v1/inventory/agents\x12\x9f\x01\n" + - "\bGetAgent\x12\x1d.inventory.v1.GetAgentRequest\x1a\x1e.inventory.v1.GetAgentResponse\"T\x92A*\x12\tGet Agent\x1a\x1dReturns a single Agent by ID.\x82\xd3\xe4\x93\x02!\x12\x1f/v1/inventory/agents/{agent_id}\x12\xb1\x01\n" + - "\fGetAgentLogs\x12!.inventory.v1.GetAgentLogsRequest\x1a\".inventory.v1.GetAgentLogsResponse\"Z\x92A+\x12\x0eGet Agent logs\x1a\x19Returns Agent logs by ID.\x82\xd3\xe4\x93\x02&\x12$/v1/inventory/agents/{agent_id}/logs\x12\xce\x01\n" + - "\bAddAgent\x12\x1d.inventory.v1.AddAgentRequest\x1a\x1e.inventory.v1.AddAgentResponse\"\x82\x01\x92A`\x12\x19Add an Agent to Inventory\x1aCAdds an Agent to Inventory. Only one agent at a time can be passed.\x82\xd3\xe4\x93\x02\x19:\x01*\"\x14/v1/inventory/agents\x12\xe8\x01\n" + - "\vChangeAgent\x12 .inventory.v1.ChangeAgentRequest\x1a!.inventory.v1.ChangeAgentResponse\"\x93\x01\x92Af\x12\x1cUpdate an Agent in Inventory\x1aFUpdates an Agent in Inventory. Only one agent at a time can be passed.\x82\xd3\xe4\x93\x02$:\x01*\x1a\x1f/v1/inventory/agents/{agent_id}\x12\xc0\x01\n" + - "\vRemoveAgent\x12 .inventory.v1.RemoveAgentRequest\x1a!.inventory.v1.RemoveAgentResponse\"l\x92AB\x12\x1eRemove an Agent from Inventory\x1a Removes an Agent from Inventory.\x82\xd3\xe4\x93\x02!*\x1f/v1/inventory/agents/{agent_id}B\xa5\x01\n" + - "\x10com.inventory.v1B\vAgentsProtoP\x01Z3github.com/percona/pmm/api/inventory/v1;inventoryv1\xa2\x02\x03IXX\xaa\x02\fInventory.V1\xca\x02\fInventory\\V1\xe2\x02\x18Inventory\\V1\\GPBMetadata\xea\x02\rInventory::V1b\x06proto3" - -var ( - file_inventory_v1_agents_proto_rawDescOnce sync.Once - file_inventory_v1_agents_proto_rawDescData []byte -) - -func file_inventory_v1_agents_proto_rawDescGZIP() []byte { - file_inventory_v1_agents_proto_rawDescOnce.Do(func() { - file_inventory_v1_agents_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_inventory_v1_agents_proto_rawDesc), len(file_inventory_v1_agents_proto_rawDesc))) - }) - 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, 101) - 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 - (*QANPostgreSQLPgStatementsAgent)(nil), // 14: inventory.v1.QANPostgreSQLPgStatementsAgent - (*QANPostgreSQLPgStatMonitorAgent)(nil), // 15: inventory.v1.QANPostgreSQLPgStatMonitorAgent - (*RDSExporter)(nil), // 16: inventory.v1.RDSExporter - (*ExternalExporter)(nil), // 17: inventory.v1.ExternalExporter - (*AzureDatabaseExporter)(nil), // 18: inventory.v1.AzureDatabaseExporter - (*ChangeCommonAgentParams)(nil), // 19: inventory.v1.ChangeCommonAgentParams - (*ListAgentsRequest)(nil), // 20: inventory.v1.ListAgentsRequest - (*ListAgentsResponse)(nil), // 21: inventory.v1.ListAgentsResponse - (*GetAgentRequest)(nil), // 22: inventory.v1.GetAgentRequest - (*GetAgentResponse)(nil), // 23: inventory.v1.GetAgentResponse - (*GetAgentLogsRequest)(nil), // 24: inventory.v1.GetAgentLogsRequest - (*GetAgentLogsResponse)(nil), // 25: inventory.v1.GetAgentLogsResponse - (*AddAgentRequest)(nil), // 26: inventory.v1.AddAgentRequest - (*AddAgentResponse)(nil), // 27: inventory.v1.AddAgentResponse - (*ChangeAgentRequest)(nil), // 28: inventory.v1.ChangeAgentRequest - (*ChangeAgentResponse)(nil), // 29: inventory.v1.ChangeAgentResponse - (*AddPMMAgentParams)(nil), // 30: inventory.v1.AddPMMAgentParams - (*AddNodeExporterParams)(nil), // 31: inventory.v1.AddNodeExporterParams - (*ChangeNodeExporterParams)(nil), // 32: inventory.v1.ChangeNodeExporterParams - (*AddMySQLdExporterParams)(nil), // 33: inventory.v1.AddMySQLdExporterParams - (*ChangeMySQLdExporterParams)(nil), // 34: inventory.v1.ChangeMySQLdExporterParams - (*AddMongoDBExporterParams)(nil), // 35: inventory.v1.AddMongoDBExporterParams - (*ChangeMongoDBExporterParams)(nil), // 36: inventory.v1.ChangeMongoDBExporterParams - (*AddPostgresExporterParams)(nil), // 37: inventory.v1.AddPostgresExporterParams - (*ChangePostgresExporterParams)(nil), // 38: inventory.v1.ChangePostgresExporterParams - (*AddProxySQLExporterParams)(nil), // 39: inventory.v1.AddProxySQLExporterParams - (*ChangeProxySQLExporterParams)(nil), // 40: inventory.v1.ChangeProxySQLExporterParams - (*AddQANMySQLPerfSchemaAgentParams)(nil), // 41: inventory.v1.AddQANMySQLPerfSchemaAgentParams - (*ChangeQANMySQLPerfSchemaAgentParams)(nil), // 42: inventory.v1.ChangeQANMySQLPerfSchemaAgentParams - (*AddQANMySQLSlowlogAgentParams)(nil), // 43: inventory.v1.AddQANMySQLSlowlogAgentParams - (*ChangeQANMySQLSlowlogAgentParams)(nil), // 44: inventory.v1.ChangeQANMySQLSlowlogAgentParams - (*AddQANMongoDBProfilerAgentParams)(nil), // 45: inventory.v1.AddQANMongoDBProfilerAgentParams - (*ChangeQANMongoDBProfilerAgentParams)(nil), // 46: inventory.v1.ChangeQANMongoDBProfilerAgentParams - (*AddQANMongoDBMongologAgentParams)(nil), // 47: inventory.v1.AddQANMongoDBMongologAgentParams - (*ChangeQANMongoDBMongologAgentParams)(nil), // 48: inventory.v1.ChangeQANMongoDBMongologAgentParams - (*AddQANPostgreSQLPgStatementsAgentParams)(nil), // 49: inventory.v1.AddQANPostgreSQLPgStatementsAgentParams - (*ChangeQANPostgreSQLPgStatementsAgentParams)(nil), // 50: inventory.v1.ChangeQANPostgreSQLPgStatementsAgentParams - (*AddQANPostgreSQLPgStatMonitorAgentParams)(nil), // 51: inventory.v1.AddQANPostgreSQLPgStatMonitorAgentParams - (*ChangeQANPostgreSQLPgStatMonitorAgentParams)(nil), // 52: inventory.v1.ChangeQANPostgreSQLPgStatMonitorAgentParams - (*AddRDSExporterParams)(nil), // 53: inventory.v1.AddRDSExporterParams - (*ChangeRDSExporterParams)(nil), // 54: inventory.v1.ChangeRDSExporterParams - (*AddExternalExporterParams)(nil), // 55: inventory.v1.AddExternalExporterParams - (*ChangeExternalExporterParams)(nil), // 56: inventory.v1.ChangeExternalExporterParams - (*AddAzureDatabaseExporterParams)(nil), // 57: inventory.v1.AddAzureDatabaseExporterParams - (*ChangeAzureDatabaseExporterParams)(nil), // 58: inventory.v1.ChangeAzureDatabaseExporterParams - (*ChangeNomadAgentParams)(nil), // 59: inventory.v1.ChangeNomadAgentParams - (*AddValkeyExporterParams)(nil), // 60: inventory.v1.AddValkeyExporterParams - (*ChangeValkeyExporterParams)(nil), // 61: inventory.v1.ChangeValkeyExporterParams - (*RemoveAgentRequest)(nil), // 62: inventory.v1.RemoveAgentRequest - (*RemoveAgentResponse)(nil), // 63: inventory.v1.RemoveAgentResponse - nil, // 64: inventory.v1.PMMAgent.CustomLabelsEntry - nil, // 65: inventory.v1.NodeExporter.CustomLabelsEntry - nil, // 66: inventory.v1.MySQLdExporter.CustomLabelsEntry - nil, // 67: inventory.v1.MySQLdExporter.ExtraDsnParamsEntry - nil, // 68: inventory.v1.MongoDBExporter.CustomLabelsEntry - nil, // 69: inventory.v1.PostgresExporter.CustomLabelsEntry - nil, // 70: inventory.v1.ProxySQLExporter.CustomLabelsEntry - nil, // 71: inventory.v1.ValkeyExporter.CustomLabelsEntry - nil, // 72: inventory.v1.QANMySQLPerfSchemaAgent.CustomLabelsEntry - nil, // 73: inventory.v1.QANMySQLPerfSchemaAgent.ExtraDsnParamsEntry - nil, // 74: inventory.v1.QANMySQLSlowlogAgent.CustomLabelsEntry - nil, // 75: inventory.v1.QANMySQLSlowlogAgent.ExtraDsnParamsEntry - nil, // 76: inventory.v1.QANMongoDBProfilerAgent.CustomLabelsEntry - nil, // 77: inventory.v1.QANMongoDBMongologAgent.CustomLabelsEntry - nil, // 78: inventory.v1.QANPostgreSQLPgStatementsAgent.CustomLabelsEntry - nil, // 79: inventory.v1.QANPostgreSQLPgStatMonitorAgent.CustomLabelsEntry - nil, // 80: inventory.v1.RDSExporter.CustomLabelsEntry - nil, // 81: inventory.v1.ExternalExporter.CustomLabelsEntry - nil, // 82: inventory.v1.AzureDatabaseExporter.CustomLabelsEntry - nil, // 83: inventory.v1.AddPMMAgentParams.CustomLabelsEntry - nil, // 84: inventory.v1.AddNodeExporterParams.CustomLabelsEntry - nil, // 85: inventory.v1.AddMySQLdExporterParams.CustomLabelsEntry - nil, // 86: inventory.v1.AddMySQLdExporterParams.ExtraDsnParamsEntry - nil, // 87: inventory.v1.AddMongoDBExporterParams.CustomLabelsEntry - nil, // 88: inventory.v1.AddPostgresExporterParams.CustomLabelsEntry - nil, // 89: inventory.v1.AddProxySQLExporterParams.CustomLabelsEntry - nil, // 90: inventory.v1.AddQANMySQLPerfSchemaAgentParams.CustomLabelsEntry - nil, // 91: inventory.v1.AddQANMySQLPerfSchemaAgentParams.ExtraDsnParamsEntry - nil, // 92: inventory.v1.AddQANMySQLSlowlogAgentParams.CustomLabelsEntry - nil, // 93: inventory.v1.AddQANMySQLSlowlogAgentParams.ExtraDsnParamsEntry - nil, // 94: inventory.v1.AddQANMongoDBProfilerAgentParams.CustomLabelsEntry - nil, // 95: inventory.v1.AddQANMongoDBMongologAgentParams.CustomLabelsEntry - nil, // 96: inventory.v1.AddQANPostgreSQLPgStatementsAgentParams.CustomLabelsEntry - nil, // 97: inventory.v1.AddQANPostgreSQLPgStatMonitorAgentParams.CustomLabelsEntry - nil, // 98: inventory.v1.AddRDSExporterParams.CustomLabelsEntry - nil, // 99: inventory.v1.AddExternalExporterParams.CustomLabelsEntry - nil, // 100: inventory.v1.AddAzureDatabaseExporterParams.CustomLabelsEntry - nil, // 101: inventory.v1.AddValkeyExporterParams.CustomLabelsEntry - (AgentStatus)(0), // 102: inventory.v1.AgentStatus - (LogLevel)(0), // 103: inventory.v1.LogLevel - (*common.MetricsResolutions)(nil), // 104: common.MetricsResolutions - (*common.StringMap)(nil), // 105: common.StringMap - } -) - -var file_inventory_v1_agents_proto_depIdxs = []int32{ - 64, // 0: inventory.v1.PMMAgent.custom_labels:type_name -> inventory.v1.PMMAgent.CustomLabelsEntry - 102, // 1: inventory.v1.VMAgent.status:type_name -> inventory.v1.AgentStatus - 102, // 2: inventory.v1.NomadAgent.status:type_name -> inventory.v1.AgentStatus - 65, // 3: inventory.v1.NodeExporter.custom_labels:type_name -> inventory.v1.NodeExporter.CustomLabelsEntry - 102, // 4: inventory.v1.NodeExporter.status:type_name -> inventory.v1.AgentStatus - 103, // 5: inventory.v1.NodeExporter.log_level:type_name -> inventory.v1.LogLevel - 104, // 6: inventory.v1.NodeExporter.metrics_resolutions:type_name -> common.MetricsResolutions - 66, // 7: inventory.v1.MySQLdExporter.custom_labels:type_name -> inventory.v1.MySQLdExporter.CustomLabelsEntry - 102, // 8: inventory.v1.MySQLdExporter.status:type_name -> inventory.v1.AgentStatus - 103, // 9: inventory.v1.MySQLdExporter.log_level:type_name -> inventory.v1.LogLevel - 104, // 10: inventory.v1.MySQLdExporter.metrics_resolutions:type_name -> common.MetricsResolutions - 67, // 11: inventory.v1.MySQLdExporter.extra_dsn_params:type_name -> inventory.v1.MySQLdExporter.ExtraDsnParamsEntry - 68, // 12: inventory.v1.MongoDBExporter.custom_labels:type_name -> inventory.v1.MongoDBExporter.CustomLabelsEntry - 102, // 13: inventory.v1.MongoDBExporter.status:type_name -> inventory.v1.AgentStatus - 103, // 14: inventory.v1.MongoDBExporter.log_level:type_name -> inventory.v1.LogLevel - 104, // 15: inventory.v1.MongoDBExporter.metrics_resolutions:type_name -> common.MetricsResolutions - 69, // 16: inventory.v1.PostgresExporter.custom_labels:type_name -> inventory.v1.PostgresExporter.CustomLabelsEntry - 102, // 17: inventory.v1.PostgresExporter.status:type_name -> inventory.v1.AgentStatus - 103, // 18: inventory.v1.PostgresExporter.log_level:type_name -> inventory.v1.LogLevel - 104, // 19: inventory.v1.PostgresExporter.metrics_resolutions:type_name -> common.MetricsResolutions - 70, // 20: inventory.v1.ProxySQLExporter.custom_labels:type_name -> inventory.v1.ProxySQLExporter.CustomLabelsEntry - 102, // 21: inventory.v1.ProxySQLExporter.status:type_name -> inventory.v1.AgentStatus - 103, // 22: inventory.v1.ProxySQLExporter.log_level:type_name -> inventory.v1.LogLevel - 104, // 23: inventory.v1.ProxySQLExporter.metrics_resolutions:type_name -> common.MetricsResolutions - 71, // 24: inventory.v1.ValkeyExporter.custom_labels:type_name -> inventory.v1.ValkeyExporter.CustomLabelsEntry - 102, // 25: inventory.v1.ValkeyExporter.status:type_name -> inventory.v1.AgentStatus - 104, // 26: inventory.v1.ValkeyExporter.metrics_resolutions:type_name -> common.MetricsResolutions - 72, // 27: inventory.v1.QANMySQLPerfSchemaAgent.custom_labels:type_name -> inventory.v1.QANMySQLPerfSchemaAgent.CustomLabelsEntry - 102, // 28: inventory.v1.QANMySQLPerfSchemaAgent.status:type_name -> inventory.v1.AgentStatus - 103, // 29: inventory.v1.QANMySQLPerfSchemaAgent.log_level:type_name -> inventory.v1.LogLevel - 73, // 30: inventory.v1.QANMySQLPerfSchemaAgent.extra_dsn_params:type_name -> inventory.v1.QANMySQLPerfSchemaAgent.ExtraDsnParamsEntry - 74, // 31: inventory.v1.QANMySQLSlowlogAgent.custom_labels:type_name -> inventory.v1.QANMySQLSlowlogAgent.CustomLabelsEntry - 102, // 32: inventory.v1.QANMySQLSlowlogAgent.status:type_name -> inventory.v1.AgentStatus - 103, // 33: inventory.v1.QANMySQLSlowlogAgent.log_level:type_name -> inventory.v1.LogLevel - 75, // 34: inventory.v1.QANMySQLSlowlogAgent.extra_dsn_params:type_name -> inventory.v1.QANMySQLSlowlogAgent.ExtraDsnParamsEntry - 76, // 35: inventory.v1.QANMongoDBProfilerAgent.custom_labels:type_name -> inventory.v1.QANMongoDBProfilerAgent.CustomLabelsEntry - 102, // 36: inventory.v1.QANMongoDBProfilerAgent.status:type_name -> inventory.v1.AgentStatus - 103, // 37: inventory.v1.QANMongoDBProfilerAgent.log_level:type_name -> inventory.v1.LogLevel - 77, // 38: inventory.v1.QANMongoDBMongologAgent.custom_labels:type_name -> inventory.v1.QANMongoDBMongologAgent.CustomLabelsEntry - 102, // 39: inventory.v1.QANMongoDBMongologAgent.status:type_name -> inventory.v1.AgentStatus - 103, // 40: inventory.v1.QANMongoDBMongologAgent.log_level:type_name -> inventory.v1.LogLevel - 78, // 41: inventory.v1.QANPostgreSQLPgStatementsAgent.custom_labels:type_name -> inventory.v1.QANPostgreSQLPgStatementsAgent.CustomLabelsEntry - 102, // 42: inventory.v1.QANPostgreSQLPgStatementsAgent.status:type_name -> inventory.v1.AgentStatus - 103, // 43: inventory.v1.QANPostgreSQLPgStatementsAgent.log_level:type_name -> inventory.v1.LogLevel - 79, // 44: inventory.v1.QANPostgreSQLPgStatMonitorAgent.custom_labels:type_name -> inventory.v1.QANPostgreSQLPgStatMonitorAgent.CustomLabelsEntry - 102, // 45: inventory.v1.QANPostgreSQLPgStatMonitorAgent.status:type_name -> inventory.v1.AgentStatus - 103, // 46: inventory.v1.QANPostgreSQLPgStatMonitorAgent.log_level:type_name -> inventory.v1.LogLevel - 80, // 47: inventory.v1.RDSExporter.custom_labels:type_name -> inventory.v1.RDSExporter.CustomLabelsEntry - 102, // 48: inventory.v1.RDSExporter.status:type_name -> inventory.v1.AgentStatus - 103, // 49: inventory.v1.RDSExporter.log_level:type_name -> inventory.v1.LogLevel - 104, // 50: inventory.v1.RDSExporter.metrics_resolutions:type_name -> common.MetricsResolutions - 81, // 51: inventory.v1.ExternalExporter.custom_labels:type_name -> inventory.v1.ExternalExporter.CustomLabelsEntry - 104, // 52: inventory.v1.ExternalExporter.metrics_resolutions:type_name -> common.MetricsResolutions - 82, // 53: inventory.v1.AzureDatabaseExporter.custom_labels:type_name -> inventory.v1.AzureDatabaseExporter.CustomLabelsEntry - 102, // 54: inventory.v1.AzureDatabaseExporter.status:type_name -> inventory.v1.AgentStatus - 103, // 55: inventory.v1.AzureDatabaseExporter.log_level:type_name -> inventory.v1.LogLevel - 104, // 56: inventory.v1.AzureDatabaseExporter.metrics_resolutions:type_name -> common.MetricsResolutions - 105, // 57: inventory.v1.ChangeCommonAgentParams.custom_labels:type_name -> common.StringMap - 104, // 58: inventory.v1.ChangeCommonAgentParams.metrics_resolutions:type_name -> common.MetricsResolutions - 0, // 59: inventory.v1.ListAgentsRequest.agent_type:type_name -> inventory.v1.AgentType - 1, // 60: inventory.v1.ListAgentsResponse.pmm_agent:type_name -> inventory.v1.PMMAgent - 2, // 61: inventory.v1.ListAgentsResponse.vm_agent:type_name -> inventory.v1.VMAgent - 4, // 62: inventory.v1.ListAgentsResponse.node_exporter:type_name -> inventory.v1.NodeExporter - 5, // 63: inventory.v1.ListAgentsResponse.mysqld_exporter:type_name -> inventory.v1.MySQLdExporter - 6, // 64: inventory.v1.ListAgentsResponse.mongodb_exporter:type_name -> inventory.v1.MongoDBExporter - 7, // 65: inventory.v1.ListAgentsResponse.postgres_exporter:type_name -> inventory.v1.PostgresExporter - 8, // 66: inventory.v1.ListAgentsResponse.proxysql_exporter:type_name -> inventory.v1.ProxySQLExporter - 10, // 67: inventory.v1.ListAgentsResponse.qan_mysql_perfschema_agent:type_name -> inventory.v1.QANMySQLPerfSchemaAgent - 11, // 68: inventory.v1.ListAgentsResponse.qan_mysql_slowlog_agent:type_name -> inventory.v1.QANMySQLSlowlogAgent - 12, // 69: inventory.v1.ListAgentsResponse.qan_mongodb_profiler_agent:type_name -> inventory.v1.QANMongoDBProfilerAgent - 13, // 70: inventory.v1.ListAgentsResponse.qan_mongodb_mongolog_agent:type_name -> inventory.v1.QANMongoDBMongologAgent - 14, // 71: inventory.v1.ListAgentsResponse.qan_postgresql_pgstatements_agent:type_name -> inventory.v1.QANPostgreSQLPgStatementsAgent - 15, // 72: inventory.v1.ListAgentsResponse.qan_postgresql_pgstatmonitor_agent:type_name -> inventory.v1.QANPostgreSQLPgStatMonitorAgent - 17, // 73: inventory.v1.ListAgentsResponse.external_exporter:type_name -> inventory.v1.ExternalExporter - 16, // 74: inventory.v1.ListAgentsResponse.rds_exporter:type_name -> inventory.v1.RDSExporter - 18, // 75: inventory.v1.ListAgentsResponse.azure_database_exporter:type_name -> inventory.v1.AzureDatabaseExporter - 3, // 76: inventory.v1.ListAgentsResponse.nomad_agent:type_name -> inventory.v1.NomadAgent - 9, // 77: inventory.v1.ListAgentsResponse.valkey_exporter:type_name -> inventory.v1.ValkeyExporter - 1, // 78: inventory.v1.GetAgentResponse.pmm_agent:type_name -> inventory.v1.PMMAgent - 2, // 79: inventory.v1.GetAgentResponse.vmagent:type_name -> inventory.v1.VMAgent - 4, // 80: inventory.v1.GetAgentResponse.node_exporter:type_name -> inventory.v1.NodeExporter - 5, // 81: inventory.v1.GetAgentResponse.mysqld_exporter:type_name -> inventory.v1.MySQLdExporter - 6, // 82: inventory.v1.GetAgentResponse.mongodb_exporter:type_name -> inventory.v1.MongoDBExporter - 7, // 83: inventory.v1.GetAgentResponse.postgres_exporter:type_name -> inventory.v1.PostgresExporter - 8, // 84: inventory.v1.GetAgentResponse.proxysql_exporter:type_name -> inventory.v1.ProxySQLExporter - 10, // 85: inventory.v1.GetAgentResponse.qan_mysql_perfschema_agent:type_name -> inventory.v1.QANMySQLPerfSchemaAgent - 11, // 86: inventory.v1.GetAgentResponse.qan_mysql_slowlog_agent:type_name -> inventory.v1.QANMySQLSlowlogAgent - 12, // 87: inventory.v1.GetAgentResponse.qan_mongodb_profiler_agent:type_name -> inventory.v1.QANMongoDBProfilerAgent - 13, // 88: inventory.v1.GetAgentResponse.qan_mongodb_mongolog_agent:type_name -> inventory.v1.QANMongoDBMongologAgent - 14, // 89: inventory.v1.GetAgentResponse.qan_postgresql_pgstatements_agent:type_name -> inventory.v1.QANPostgreSQLPgStatementsAgent - 15, // 90: inventory.v1.GetAgentResponse.qan_postgresql_pgstatmonitor_agent:type_name -> inventory.v1.QANPostgreSQLPgStatMonitorAgent - 17, // 91: inventory.v1.GetAgentResponse.external_exporter:type_name -> inventory.v1.ExternalExporter - 16, // 92: inventory.v1.GetAgentResponse.rds_exporter:type_name -> inventory.v1.RDSExporter - 18, // 93: inventory.v1.GetAgentResponse.azure_database_exporter:type_name -> inventory.v1.AzureDatabaseExporter - 3, // 94: inventory.v1.GetAgentResponse.nomad_agent:type_name -> inventory.v1.NomadAgent - 9, // 95: inventory.v1.GetAgentResponse.valkey_exporter:type_name -> inventory.v1.ValkeyExporter - 30, // 96: inventory.v1.AddAgentRequest.pmm_agent:type_name -> inventory.v1.AddPMMAgentParams - 31, // 97: inventory.v1.AddAgentRequest.node_exporter:type_name -> inventory.v1.AddNodeExporterParams - 33, // 98: inventory.v1.AddAgentRequest.mysqld_exporter:type_name -> inventory.v1.AddMySQLdExporterParams - 35, // 99: inventory.v1.AddAgentRequest.mongodb_exporter:type_name -> inventory.v1.AddMongoDBExporterParams - 37, // 100: inventory.v1.AddAgentRequest.postgres_exporter:type_name -> inventory.v1.AddPostgresExporterParams - 39, // 101: inventory.v1.AddAgentRequest.proxysql_exporter:type_name -> inventory.v1.AddProxySQLExporterParams - 55, // 102: inventory.v1.AddAgentRequest.external_exporter:type_name -> inventory.v1.AddExternalExporterParams - 53, // 103: inventory.v1.AddAgentRequest.rds_exporter:type_name -> inventory.v1.AddRDSExporterParams - 57, // 104: inventory.v1.AddAgentRequest.azure_database_exporter:type_name -> inventory.v1.AddAzureDatabaseExporterParams - 41, // 105: inventory.v1.AddAgentRequest.qan_mysql_perfschema_agent:type_name -> inventory.v1.AddQANMySQLPerfSchemaAgentParams - 43, // 106: inventory.v1.AddAgentRequest.qan_mysql_slowlog_agent:type_name -> inventory.v1.AddQANMySQLSlowlogAgentParams - 45, // 107: inventory.v1.AddAgentRequest.qan_mongodb_profiler_agent:type_name -> inventory.v1.AddQANMongoDBProfilerAgentParams - 47, // 108: inventory.v1.AddAgentRequest.qan_mongodb_mongolog_agent:type_name -> inventory.v1.AddQANMongoDBMongologAgentParams - 49, // 109: inventory.v1.AddAgentRequest.qan_postgresql_pgstatements_agent:type_name -> inventory.v1.AddQANPostgreSQLPgStatementsAgentParams - 51, // 110: inventory.v1.AddAgentRequest.qan_postgresql_pgstatmonitor_agent:type_name -> inventory.v1.AddQANPostgreSQLPgStatMonitorAgentParams - 60, // 111: inventory.v1.AddAgentRequest.valkey_exporter:type_name -> inventory.v1.AddValkeyExporterParams - 1, // 112: inventory.v1.AddAgentResponse.pmm_agent:type_name -> inventory.v1.PMMAgent - 4, // 113: inventory.v1.AddAgentResponse.node_exporter:type_name -> inventory.v1.NodeExporter - 5, // 114: inventory.v1.AddAgentResponse.mysqld_exporter:type_name -> inventory.v1.MySQLdExporter - 6, // 115: inventory.v1.AddAgentResponse.mongodb_exporter:type_name -> inventory.v1.MongoDBExporter - 7, // 116: inventory.v1.AddAgentResponse.postgres_exporter:type_name -> inventory.v1.PostgresExporter - 8, // 117: inventory.v1.AddAgentResponse.proxysql_exporter:type_name -> inventory.v1.ProxySQLExporter - 17, // 118: inventory.v1.AddAgentResponse.external_exporter:type_name -> inventory.v1.ExternalExporter - 16, // 119: inventory.v1.AddAgentResponse.rds_exporter:type_name -> inventory.v1.RDSExporter - 18, // 120: inventory.v1.AddAgentResponse.azure_database_exporter:type_name -> inventory.v1.AzureDatabaseExporter - 10, // 121: inventory.v1.AddAgentResponse.qan_mysql_perfschema_agent:type_name -> inventory.v1.QANMySQLPerfSchemaAgent - 11, // 122: inventory.v1.AddAgentResponse.qan_mysql_slowlog_agent:type_name -> inventory.v1.QANMySQLSlowlogAgent - 12, // 123: inventory.v1.AddAgentResponse.qan_mongodb_profiler_agent:type_name -> inventory.v1.QANMongoDBProfilerAgent - 13, // 124: inventory.v1.AddAgentResponse.qan_mongodb_mongolog_agent:type_name -> inventory.v1.QANMongoDBMongologAgent - 14, // 125: inventory.v1.AddAgentResponse.qan_postgresql_pgstatements_agent:type_name -> inventory.v1.QANPostgreSQLPgStatementsAgent - 15, // 126: inventory.v1.AddAgentResponse.qan_postgresql_pgstatmonitor_agent:type_name -> inventory.v1.QANPostgreSQLPgStatMonitorAgent - 9, // 127: inventory.v1.AddAgentResponse.valkey_exporter:type_name -> inventory.v1.ValkeyExporter - 32, // 128: inventory.v1.ChangeAgentRequest.node_exporter:type_name -> inventory.v1.ChangeNodeExporterParams - 34, // 129: inventory.v1.ChangeAgentRequest.mysqld_exporter:type_name -> inventory.v1.ChangeMySQLdExporterParams - 36, // 130: inventory.v1.ChangeAgentRequest.mongodb_exporter:type_name -> inventory.v1.ChangeMongoDBExporterParams - 38, // 131: inventory.v1.ChangeAgentRequest.postgres_exporter:type_name -> inventory.v1.ChangePostgresExporterParams - 40, // 132: inventory.v1.ChangeAgentRequest.proxysql_exporter:type_name -> inventory.v1.ChangeProxySQLExporterParams - 56, // 133: inventory.v1.ChangeAgentRequest.external_exporter:type_name -> inventory.v1.ChangeExternalExporterParams - 54, // 134: inventory.v1.ChangeAgentRequest.rds_exporter:type_name -> inventory.v1.ChangeRDSExporterParams - 58, // 135: inventory.v1.ChangeAgentRequest.azure_database_exporter:type_name -> inventory.v1.ChangeAzureDatabaseExporterParams - 42, // 136: inventory.v1.ChangeAgentRequest.qan_mysql_perfschema_agent:type_name -> inventory.v1.ChangeQANMySQLPerfSchemaAgentParams - 44, // 137: inventory.v1.ChangeAgentRequest.qan_mysql_slowlog_agent:type_name -> inventory.v1.ChangeQANMySQLSlowlogAgentParams - 46, // 138: inventory.v1.ChangeAgentRequest.qan_mongodb_profiler_agent:type_name -> inventory.v1.ChangeQANMongoDBProfilerAgentParams - 48, // 139: inventory.v1.ChangeAgentRequest.qan_mongodb_mongolog_agent:type_name -> inventory.v1.ChangeQANMongoDBMongologAgentParams - 50, // 140: inventory.v1.ChangeAgentRequest.qan_postgresql_pgstatements_agent:type_name -> inventory.v1.ChangeQANPostgreSQLPgStatementsAgentParams - 52, // 141: inventory.v1.ChangeAgentRequest.qan_postgresql_pgstatmonitor_agent:type_name -> inventory.v1.ChangeQANPostgreSQLPgStatMonitorAgentParams - 59, // 142: inventory.v1.ChangeAgentRequest.nomad_agent:type_name -> inventory.v1.ChangeNomadAgentParams - 61, // 143: inventory.v1.ChangeAgentRequest.valkey_exporter:type_name -> inventory.v1.ChangeValkeyExporterParams - 4, // 144: inventory.v1.ChangeAgentResponse.node_exporter:type_name -> inventory.v1.NodeExporter - 5, // 145: inventory.v1.ChangeAgentResponse.mysqld_exporter:type_name -> inventory.v1.MySQLdExporter - 6, // 146: inventory.v1.ChangeAgentResponse.mongodb_exporter:type_name -> inventory.v1.MongoDBExporter - 7, // 147: inventory.v1.ChangeAgentResponse.postgres_exporter:type_name -> inventory.v1.PostgresExporter - 8, // 148: inventory.v1.ChangeAgentResponse.proxysql_exporter:type_name -> inventory.v1.ProxySQLExporter - 17, // 149: inventory.v1.ChangeAgentResponse.external_exporter:type_name -> inventory.v1.ExternalExporter - 16, // 150: inventory.v1.ChangeAgentResponse.rds_exporter:type_name -> inventory.v1.RDSExporter - 18, // 151: inventory.v1.ChangeAgentResponse.azure_database_exporter:type_name -> inventory.v1.AzureDatabaseExporter - 10, // 152: inventory.v1.ChangeAgentResponse.qan_mysql_perfschema_agent:type_name -> inventory.v1.QANMySQLPerfSchemaAgent - 11, // 153: inventory.v1.ChangeAgentResponse.qan_mysql_slowlog_agent:type_name -> inventory.v1.QANMySQLSlowlogAgent - 12, // 154: inventory.v1.ChangeAgentResponse.qan_mongodb_profiler_agent:type_name -> inventory.v1.QANMongoDBProfilerAgent - 13, // 155: inventory.v1.ChangeAgentResponse.qan_mongodb_mongolog_agent:type_name -> inventory.v1.QANMongoDBMongologAgent - 14, // 156: inventory.v1.ChangeAgentResponse.qan_postgresql_pgstatements_agent:type_name -> inventory.v1.QANPostgreSQLPgStatementsAgent - 15, // 157: inventory.v1.ChangeAgentResponse.qan_postgresql_pgstatmonitor_agent:type_name -> inventory.v1.QANPostgreSQLPgStatMonitorAgent - 3, // 158: inventory.v1.ChangeAgentResponse.nomad_agent:type_name -> inventory.v1.NomadAgent - 9, // 159: inventory.v1.ChangeAgentResponse.valkey_exporter:type_name -> inventory.v1.ValkeyExporter - 83, // 160: inventory.v1.AddPMMAgentParams.custom_labels:type_name -> inventory.v1.AddPMMAgentParams.CustomLabelsEntry - 84, // 161: inventory.v1.AddNodeExporterParams.custom_labels:type_name -> inventory.v1.AddNodeExporterParams.CustomLabelsEntry - 103, // 162: inventory.v1.AddNodeExporterParams.log_level:type_name -> inventory.v1.LogLevel - 105, // 163: inventory.v1.ChangeNodeExporterParams.custom_labels:type_name -> common.StringMap - 104, // 164: inventory.v1.ChangeNodeExporterParams.metrics_resolutions:type_name -> common.MetricsResolutions - 85, // 165: inventory.v1.AddMySQLdExporterParams.custom_labels:type_name -> inventory.v1.AddMySQLdExporterParams.CustomLabelsEntry - 103, // 166: inventory.v1.AddMySQLdExporterParams.log_level:type_name -> inventory.v1.LogLevel - 86, // 167: inventory.v1.AddMySQLdExporterParams.extra_dsn_params:type_name -> inventory.v1.AddMySQLdExporterParams.ExtraDsnParamsEntry - 105, // 168: inventory.v1.ChangeMySQLdExporterParams.custom_labels:type_name -> common.StringMap - 104, // 169: inventory.v1.ChangeMySQLdExporterParams.metrics_resolutions:type_name -> common.MetricsResolutions - 87, // 170: inventory.v1.AddMongoDBExporterParams.custom_labels:type_name -> inventory.v1.AddMongoDBExporterParams.CustomLabelsEntry - 103, // 171: inventory.v1.AddMongoDBExporterParams.log_level:type_name -> inventory.v1.LogLevel - 105, // 172: inventory.v1.ChangeMongoDBExporterParams.custom_labels:type_name -> common.StringMap - 104, // 173: inventory.v1.ChangeMongoDBExporterParams.metrics_resolutions:type_name -> common.MetricsResolutions - 88, // 174: inventory.v1.AddPostgresExporterParams.custom_labels:type_name -> inventory.v1.AddPostgresExporterParams.CustomLabelsEntry - 103, // 175: inventory.v1.AddPostgresExporterParams.log_level:type_name -> inventory.v1.LogLevel - 105, // 176: inventory.v1.ChangePostgresExporterParams.custom_labels:type_name -> common.StringMap - 104, // 177: inventory.v1.ChangePostgresExporterParams.metrics_resolutions:type_name -> common.MetricsResolutions - 89, // 178: inventory.v1.AddProxySQLExporterParams.custom_labels:type_name -> inventory.v1.AddProxySQLExporterParams.CustomLabelsEntry - 103, // 179: inventory.v1.AddProxySQLExporterParams.log_level:type_name -> inventory.v1.LogLevel - 105, // 180: inventory.v1.ChangeProxySQLExporterParams.custom_labels:type_name -> common.StringMap - 104, // 181: inventory.v1.ChangeProxySQLExporterParams.metrics_resolutions:type_name -> common.MetricsResolutions - 90, // 182: inventory.v1.AddQANMySQLPerfSchemaAgentParams.custom_labels:type_name -> inventory.v1.AddQANMySQLPerfSchemaAgentParams.CustomLabelsEntry - 103, // 183: inventory.v1.AddQANMySQLPerfSchemaAgentParams.log_level:type_name -> inventory.v1.LogLevel - 91, // 184: inventory.v1.AddQANMySQLPerfSchemaAgentParams.extra_dsn_params:type_name -> inventory.v1.AddQANMySQLPerfSchemaAgentParams.ExtraDsnParamsEntry - 105, // 185: inventory.v1.ChangeQANMySQLPerfSchemaAgentParams.custom_labels:type_name -> common.StringMap - 104, // 186: inventory.v1.ChangeQANMySQLPerfSchemaAgentParams.metrics_resolutions:type_name -> common.MetricsResolutions - 92, // 187: inventory.v1.AddQANMySQLSlowlogAgentParams.custom_labels:type_name -> inventory.v1.AddQANMySQLSlowlogAgentParams.CustomLabelsEntry - 103, // 188: inventory.v1.AddQANMySQLSlowlogAgentParams.log_level:type_name -> inventory.v1.LogLevel - 93, // 189: inventory.v1.AddQANMySQLSlowlogAgentParams.extra_dsn_params:type_name -> inventory.v1.AddQANMySQLSlowlogAgentParams.ExtraDsnParamsEntry - 105, // 190: inventory.v1.ChangeQANMySQLSlowlogAgentParams.custom_labels:type_name -> common.StringMap - 104, // 191: inventory.v1.ChangeQANMySQLSlowlogAgentParams.metrics_resolutions:type_name -> common.MetricsResolutions - 94, // 192: inventory.v1.AddQANMongoDBProfilerAgentParams.custom_labels:type_name -> inventory.v1.AddQANMongoDBProfilerAgentParams.CustomLabelsEntry - 103, // 193: inventory.v1.AddQANMongoDBProfilerAgentParams.log_level:type_name -> inventory.v1.LogLevel - 105, // 194: inventory.v1.ChangeQANMongoDBProfilerAgentParams.custom_labels:type_name -> common.StringMap - 104, // 195: inventory.v1.ChangeQANMongoDBProfilerAgentParams.metrics_resolutions:type_name -> common.MetricsResolutions - 95, // 196: inventory.v1.AddQANMongoDBMongologAgentParams.custom_labels:type_name -> inventory.v1.AddQANMongoDBMongologAgentParams.CustomLabelsEntry - 103, // 197: inventory.v1.AddQANMongoDBMongologAgentParams.log_level:type_name -> inventory.v1.LogLevel - 105, // 198: inventory.v1.ChangeQANMongoDBMongologAgentParams.custom_labels:type_name -> common.StringMap - 104, // 199: inventory.v1.ChangeQANMongoDBMongologAgentParams.metrics_resolutions:type_name -> common.MetricsResolutions - 96, // 200: inventory.v1.AddQANPostgreSQLPgStatementsAgentParams.custom_labels:type_name -> inventory.v1.AddQANPostgreSQLPgStatementsAgentParams.CustomLabelsEntry - 103, // 201: inventory.v1.AddQANPostgreSQLPgStatementsAgentParams.log_level:type_name -> inventory.v1.LogLevel - 105, // 202: inventory.v1.ChangeQANPostgreSQLPgStatementsAgentParams.custom_labels:type_name -> common.StringMap - 104, // 203: inventory.v1.ChangeQANPostgreSQLPgStatementsAgentParams.metrics_resolutions:type_name -> common.MetricsResolutions - 97, // 204: inventory.v1.AddQANPostgreSQLPgStatMonitorAgentParams.custom_labels:type_name -> inventory.v1.AddQANPostgreSQLPgStatMonitorAgentParams.CustomLabelsEntry - 103, // 205: inventory.v1.AddQANPostgreSQLPgStatMonitorAgentParams.log_level:type_name -> inventory.v1.LogLevel - 105, // 206: inventory.v1.ChangeQANPostgreSQLPgStatMonitorAgentParams.custom_labels:type_name -> common.StringMap - 104, // 207: inventory.v1.ChangeQANPostgreSQLPgStatMonitorAgentParams.metrics_resolutions:type_name -> common.MetricsResolutions - 98, // 208: inventory.v1.AddRDSExporterParams.custom_labels:type_name -> inventory.v1.AddRDSExporterParams.CustomLabelsEntry - 103, // 209: inventory.v1.AddRDSExporterParams.log_level:type_name -> inventory.v1.LogLevel - 105, // 210: inventory.v1.ChangeRDSExporterParams.custom_labels:type_name -> common.StringMap - 104, // 211: inventory.v1.ChangeRDSExporterParams.metrics_resolutions:type_name -> common.MetricsResolutions - 99, // 212: inventory.v1.AddExternalExporterParams.custom_labels:type_name -> inventory.v1.AddExternalExporterParams.CustomLabelsEntry - 105, // 213: inventory.v1.ChangeExternalExporterParams.custom_labels:type_name -> common.StringMap - 104, // 214: inventory.v1.ChangeExternalExporterParams.metrics_resolutions:type_name -> common.MetricsResolutions - 100, // 215: inventory.v1.AddAzureDatabaseExporterParams.custom_labels:type_name -> inventory.v1.AddAzureDatabaseExporterParams.CustomLabelsEntry - 103, // 216: inventory.v1.AddAzureDatabaseExporterParams.log_level:type_name -> inventory.v1.LogLevel - 105, // 217: inventory.v1.ChangeAzureDatabaseExporterParams.custom_labels:type_name -> common.StringMap - 104, // 218: inventory.v1.ChangeAzureDatabaseExporterParams.metrics_resolutions:type_name -> common.MetricsResolutions - 101, // 219: inventory.v1.AddValkeyExporterParams.custom_labels:type_name -> inventory.v1.AddValkeyExporterParams.CustomLabelsEntry - 105, // 220: inventory.v1.ChangeValkeyExporterParams.custom_labels:type_name -> common.StringMap - 104, // 221: inventory.v1.ChangeValkeyExporterParams.metrics_resolutions:type_name -> common.MetricsResolutions - 20, // 222: inventory.v1.AgentsService.ListAgents:input_type -> inventory.v1.ListAgentsRequest - 22, // 223: inventory.v1.AgentsService.GetAgent:input_type -> inventory.v1.GetAgentRequest - 24, // 224: inventory.v1.AgentsService.GetAgentLogs:input_type -> inventory.v1.GetAgentLogsRequest - 26, // 225: inventory.v1.AgentsService.AddAgent:input_type -> inventory.v1.AddAgentRequest - 28, // 226: inventory.v1.AgentsService.ChangeAgent:input_type -> inventory.v1.ChangeAgentRequest - 62, // 227: inventory.v1.AgentsService.RemoveAgent:input_type -> inventory.v1.RemoveAgentRequest - 21, // 228: inventory.v1.AgentsService.ListAgents:output_type -> inventory.v1.ListAgentsResponse - 23, // 229: inventory.v1.AgentsService.GetAgent:output_type -> inventory.v1.GetAgentResponse - 25, // 230: inventory.v1.AgentsService.GetAgentLogs:output_type -> inventory.v1.GetAgentLogsResponse - 27, // 231: inventory.v1.AgentsService.AddAgent:output_type -> inventory.v1.AddAgentResponse - 29, // 232: inventory.v1.AgentsService.ChangeAgent:output_type -> inventory.v1.ChangeAgentResponse - 63, // 233: inventory.v1.AgentsService.RemoveAgent:output_type -> inventory.v1.RemoveAgentResponse - 228, // [228:234] is the sub-list for method output_type - 222, // [222:228] is the sub-list for method input_type - 222, // [222:222] is the sub-list for extension type_name - 222, // [222:222] is the sub-list for extension extendee - 0, // [0:222] is the sub-list for field type_name -} - -func init() { file_inventory_v1_agents_proto_init() } -func file_inventory_v1_agents_proto_init() { - if File_inventory_v1_agents_proto != nil { - return - } - file_inventory_v1_agent_status_proto_init() - file_inventory_v1_log_level_proto_init() - file_inventory_v1_agents_proto_msgTypes[18].OneofWrappers = []any{} - file_inventory_v1_agents_proto_msgTypes[22].OneofWrappers = []any{ - (*GetAgentResponse_PmmAgent)(nil), - (*GetAgentResponse_Vmagent)(nil), - (*GetAgentResponse_NodeExporter)(nil), - (*GetAgentResponse_MysqldExporter)(nil), - (*GetAgentResponse_MongodbExporter)(nil), - (*GetAgentResponse_PostgresExporter)(nil), - (*GetAgentResponse_ProxysqlExporter)(nil), - (*GetAgentResponse_QanMysqlPerfschemaAgent)(nil), - (*GetAgentResponse_QanMysqlSlowlogAgent)(nil), - (*GetAgentResponse_QanMongodbProfilerAgent)(nil), - (*GetAgentResponse_QanMongodbMongologAgent)(nil), - (*GetAgentResponse_QanPostgresqlPgstatementsAgent)(nil), - (*GetAgentResponse_QanPostgresqlPgstatmonitorAgent)(nil), - (*GetAgentResponse_ExternalExporter)(nil), - (*GetAgentResponse_RdsExporter)(nil), - (*GetAgentResponse_AzureDatabaseExporter)(nil), - (*GetAgentResponse_NomadAgent)(nil), - (*GetAgentResponse_ValkeyExporter)(nil), - } - file_inventory_v1_agents_proto_msgTypes[25].OneofWrappers = []any{ - (*AddAgentRequest_PmmAgent)(nil), - (*AddAgentRequest_NodeExporter)(nil), - (*AddAgentRequest_MysqldExporter)(nil), - (*AddAgentRequest_MongodbExporter)(nil), - (*AddAgentRequest_PostgresExporter)(nil), - (*AddAgentRequest_ProxysqlExporter)(nil), - (*AddAgentRequest_ExternalExporter)(nil), - (*AddAgentRequest_RdsExporter)(nil), - (*AddAgentRequest_AzureDatabaseExporter)(nil), - (*AddAgentRequest_QanMysqlPerfschemaAgent)(nil), - (*AddAgentRequest_QanMysqlSlowlogAgent)(nil), - (*AddAgentRequest_QanMongodbProfilerAgent)(nil), - (*AddAgentRequest_QanMongodbMongologAgent)(nil), - (*AddAgentRequest_QanPostgresqlPgstatementsAgent)(nil), - (*AddAgentRequest_QanPostgresqlPgstatmonitorAgent)(nil), - (*AddAgentRequest_ValkeyExporter)(nil), - } - file_inventory_v1_agents_proto_msgTypes[26].OneofWrappers = []any{ - (*AddAgentResponse_PmmAgent)(nil), - (*AddAgentResponse_NodeExporter)(nil), - (*AddAgentResponse_MysqldExporter)(nil), - (*AddAgentResponse_MongodbExporter)(nil), - (*AddAgentResponse_PostgresExporter)(nil), - (*AddAgentResponse_ProxysqlExporter)(nil), - (*AddAgentResponse_ExternalExporter)(nil), - (*AddAgentResponse_RdsExporter)(nil), - (*AddAgentResponse_AzureDatabaseExporter)(nil), - (*AddAgentResponse_QanMysqlPerfschemaAgent)(nil), - (*AddAgentResponse_QanMysqlSlowlogAgent)(nil), - (*AddAgentResponse_QanMongodbProfilerAgent)(nil), - (*AddAgentResponse_QanMongodbMongologAgent)(nil), - (*AddAgentResponse_QanPostgresqlPgstatementsAgent)(nil), - (*AddAgentResponse_QanPostgresqlPgstatmonitorAgent)(nil), - (*AddAgentResponse_ValkeyExporter)(nil), - } - file_inventory_v1_agents_proto_msgTypes[27].OneofWrappers = []any{ - (*ChangeAgentRequest_NodeExporter)(nil), - (*ChangeAgentRequest_MysqldExporter)(nil), - (*ChangeAgentRequest_MongodbExporter)(nil), - (*ChangeAgentRequest_PostgresExporter)(nil), - (*ChangeAgentRequest_ProxysqlExporter)(nil), - (*ChangeAgentRequest_ExternalExporter)(nil), - (*ChangeAgentRequest_RdsExporter)(nil), - (*ChangeAgentRequest_AzureDatabaseExporter)(nil), - (*ChangeAgentRequest_QanMysqlPerfschemaAgent)(nil), - (*ChangeAgentRequest_QanMysqlSlowlogAgent)(nil), - (*ChangeAgentRequest_QanMongodbProfilerAgent)(nil), - (*ChangeAgentRequest_QanMongodbMongologAgent)(nil), - (*ChangeAgentRequest_QanPostgresqlPgstatementsAgent)(nil), - (*ChangeAgentRequest_QanPostgresqlPgstatmonitorAgent)(nil), - (*ChangeAgentRequest_NomadAgent)(nil), - (*ChangeAgentRequest_ValkeyExporter)(nil), - } - file_inventory_v1_agents_proto_msgTypes[28].OneofWrappers = []any{ - (*ChangeAgentResponse_NodeExporter)(nil), - (*ChangeAgentResponse_MysqldExporter)(nil), - (*ChangeAgentResponse_MongodbExporter)(nil), - (*ChangeAgentResponse_PostgresExporter)(nil), - (*ChangeAgentResponse_ProxysqlExporter)(nil), - (*ChangeAgentResponse_ExternalExporter)(nil), - (*ChangeAgentResponse_RdsExporter)(nil), - (*ChangeAgentResponse_AzureDatabaseExporter)(nil), - (*ChangeAgentResponse_QanMysqlPerfschemaAgent)(nil), - (*ChangeAgentResponse_QanMysqlSlowlogAgent)(nil), - (*ChangeAgentResponse_QanMongodbProfilerAgent)(nil), - (*ChangeAgentResponse_QanMongodbMongologAgent)(nil), - (*ChangeAgentResponse_QanPostgresqlPgstatementsAgent)(nil), - (*ChangeAgentResponse_QanPostgresqlPgstatmonitorAgent)(nil), - (*ChangeAgentResponse_NomadAgent)(nil), - (*ChangeAgentResponse_ValkeyExporter)(nil), - } - file_inventory_v1_agents_proto_msgTypes[31].OneofWrappers = []any{} - file_inventory_v1_agents_proto_msgTypes[33].OneofWrappers = []any{} - file_inventory_v1_agents_proto_msgTypes[35].OneofWrappers = []any{} - file_inventory_v1_agents_proto_msgTypes[37].OneofWrappers = []any{} - file_inventory_v1_agents_proto_msgTypes[39].OneofWrappers = []any{} - file_inventory_v1_agents_proto_msgTypes[41].OneofWrappers = []any{} - file_inventory_v1_agents_proto_msgTypes[43].OneofWrappers = []any{} - file_inventory_v1_agents_proto_msgTypes[45].OneofWrappers = []any{} - file_inventory_v1_agents_proto_msgTypes[47].OneofWrappers = []any{} - file_inventory_v1_agents_proto_msgTypes[49].OneofWrappers = []any{} - file_inventory_v1_agents_proto_msgTypes[51].OneofWrappers = []any{} - file_inventory_v1_agents_proto_msgTypes[53].OneofWrappers = []any{} - file_inventory_v1_agents_proto_msgTypes[55].OneofWrappers = []any{} - file_inventory_v1_agents_proto_msgTypes[57].OneofWrappers = []any{} - file_inventory_v1_agents_proto_msgTypes[58].OneofWrappers = []any{} - file_inventory_v1_agents_proto_msgTypes[60].OneofWrappers = []any{} - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_inventory_v1_agents_proto_rawDesc), len(file_inventory_v1_agents_proto_rawDesc)), - NumEnums: 1, - NumMessages: 101, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_inventory_v1_agents_proto_goTypes, - DependencyIndexes: file_inventory_v1_agents_proto_depIdxs, - EnumInfos: file_inventory_v1_agents_proto_enumTypes, - MessageInfos: file_inventory_v1_agents_proto_msgTypes, - }.Build() - File_inventory_v1_agents_proto = out.File - file_inventory_v1_agents_proto_goTypes = nil - file_inventory_v1_agents_proto_depIdxs = nil -} diff --git a/api/inventory/v1/agents.pb.gw.go b/api/inventory/v1/agents.pb.gw.go deleted file mode 100644 index 72fb94b2252..00000000000 --- a/api/inventory/v1/agents.pb.gw.go +++ /dev/null @@ -1,577 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: inventory/v1/agents.proto - -/* -Package inventoryv1 is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package inventoryv1 - -import ( - "context" - "errors" - "io" - "net/http" - - "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" - "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" - "google.golang.org/protobuf/proto" -) - -// Suppress "imported and not used" errors -var ( - _ codes.Code - _ io.Reader - _ status.Status - _ = errors.New - _ = runtime.String - _ = utilities.NewDoubleArray - _ = metadata.Join -) - -var filter_AgentsService_ListAgents_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} - -func request_AgentsService_ListAgents_0(ctx context.Context, marshaler runtime.Marshaler, client AgentsServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq ListAgentsRequest - metadata runtime.ServerMetadata - ) - if req.Body != nil { - _, _ = io.Copy(io.Discard, req.Body) - } - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_AgentsService_ListAgents_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - msg, err := client.ListAgents(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_AgentsService_ListAgents_0(ctx context.Context, marshaler runtime.Marshaler, server AgentsServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq ListAgentsRequest - metadata runtime.ServerMetadata - ) - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_AgentsService_ListAgents_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - msg, err := server.ListAgents(ctx, &protoReq) - return msg, metadata, err -} - -func request_AgentsService_GetAgent_0(ctx context.Context, marshaler runtime.Marshaler, client AgentsServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq GetAgentRequest - metadata runtime.ServerMetadata - err error - ) - if req.Body != nil { - _, _ = io.Copy(io.Discard, req.Body) - } - val, ok := pathParams["agent_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "agent_id") - } - protoReq.AgentId, err = runtime.String(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "agent_id", err) - } - msg, err := client.GetAgent(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_AgentsService_GetAgent_0(ctx context.Context, marshaler runtime.Marshaler, server AgentsServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq GetAgentRequest - metadata runtime.ServerMetadata - err error - ) - val, ok := pathParams["agent_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "agent_id") - } - protoReq.AgentId, err = runtime.String(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "agent_id", err) - } - msg, err := server.GetAgent(ctx, &protoReq) - return msg, metadata, err -} - -var filter_AgentsService_GetAgentLogs_0 = &utilities.DoubleArray{Encoding: map[string]int{"agent_id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} - -func request_AgentsService_GetAgentLogs_0(ctx context.Context, marshaler runtime.Marshaler, client AgentsServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq GetAgentLogsRequest - metadata runtime.ServerMetadata - err error - ) - if req.Body != nil { - _, _ = io.Copy(io.Discard, req.Body) - } - val, ok := pathParams["agent_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "agent_id") - } - protoReq.AgentId, err = runtime.String(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "agent_id", err) - } - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_AgentsService_GetAgentLogs_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - msg, err := client.GetAgentLogs(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_AgentsService_GetAgentLogs_0(ctx context.Context, marshaler runtime.Marshaler, server AgentsServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq GetAgentLogsRequest - metadata runtime.ServerMetadata - err error - ) - val, ok := pathParams["agent_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "agent_id") - } - protoReq.AgentId, err = runtime.String(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "agent_id", err) - } - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_AgentsService_GetAgentLogs_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - msg, err := server.GetAgentLogs(ctx, &protoReq) - return msg, metadata, err -} - -func request_AgentsService_AddAgent_0(ctx context.Context, marshaler runtime.Marshaler, client AgentsServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq AddAgentRequest - 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.AddAgent(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_AgentsService_AddAgent_0(ctx context.Context, marshaler runtime.Marshaler, server AgentsServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq AddAgentRequest - 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.AddAgent(ctx, &protoReq) - return msg, metadata, err -} - -func request_AgentsService_ChangeAgent_0(ctx context.Context, marshaler runtime.Marshaler, client AgentsServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq ChangeAgentRequest - metadata runtime.ServerMetadata - err error - ) - 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) - } - val, ok := pathParams["agent_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "agent_id") - } - protoReq.AgentId, err = runtime.String(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "agent_id", err) - } - msg, err := client.ChangeAgent(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_AgentsService_ChangeAgent_0(ctx context.Context, marshaler runtime.Marshaler, server AgentsServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq ChangeAgentRequest - metadata runtime.ServerMetadata - err error - ) - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - val, ok := pathParams["agent_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "agent_id") - } - protoReq.AgentId, err = runtime.String(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "agent_id", err) - } - msg, err := server.ChangeAgent(ctx, &protoReq) - return msg, metadata, err -} - -var filter_AgentsService_RemoveAgent_0 = &utilities.DoubleArray{Encoding: map[string]int{"agent_id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} - -func request_AgentsService_RemoveAgent_0(ctx context.Context, marshaler runtime.Marshaler, client AgentsServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq RemoveAgentRequest - metadata runtime.ServerMetadata - err error - ) - if req.Body != nil { - _, _ = io.Copy(io.Discard, req.Body) - } - val, ok := pathParams["agent_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "agent_id") - } - protoReq.AgentId, err = runtime.String(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "agent_id", err) - } - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_AgentsService_RemoveAgent_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - msg, err := client.RemoveAgent(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_AgentsService_RemoveAgent_0(ctx context.Context, marshaler runtime.Marshaler, server AgentsServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq RemoveAgentRequest - metadata runtime.ServerMetadata - err error - ) - val, ok := pathParams["agent_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "agent_id") - } - protoReq.AgentId, err = runtime.String(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "agent_id", err) - } - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_AgentsService_RemoveAgent_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - msg, err := server.RemoveAgent(ctx, &protoReq) - return msg, metadata, err -} - -// RegisterAgentsServiceHandlerServer registers the http handlers for service AgentsService to "mux". -// UnaryRPC :call AgentsServiceServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterAgentsServiceHandlerFromEndpoint instead. -// GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call. -func RegisterAgentsServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AgentsServiceServer) error { - mux.Handle(http.MethodGet, pattern_AgentsService_ListAgents_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, "/inventory.v1.AgentsService/ListAgents", runtime.WithHTTPPathPattern("/v1/inventory/agents")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AgentsService_ListAgents_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_AgentsService_ListAgents_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodGet, pattern_AgentsService_GetAgent_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, "/inventory.v1.AgentsService/GetAgent", runtime.WithHTTPPathPattern("/v1/inventory/agents/{agent_id}")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AgentsService_GetAgent_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_AgentsService_GetAgent_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodGet, pattern_AgentsService_GetAgentLogs_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, "/inventory.v1.AgentsService/GetAgentLogs", runtime.WithHTTPPathPattern("/v1/inventory/agents/{agent_id}/logs")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AgentsService_GetAgentLogs_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_AgentsService_GetAgentLogs_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPost, pattern_AgentsService_AddAgent_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, "/inventory.v1.AgentsService/AddAgent", runtime.WithHTTPPathPattern("/v1/inventory/agents")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AgentsService_AddAgent_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_AgentsService_AddAgent_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPut, pattern_AgentsService_ChangeAgent_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, "/inventory.v1.AgentsService/ChangeAgent", runtime.WithHTTPPathPattern("/v1/inventory/agents/{agent_id}")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AgentsService_ChangeAgent_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_AgentsService_ChangeAgent_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodDelete, pattern_AgentsService_RemoveAgent_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, "/inventory.v1.AgentsService/RemoveAgent", runtime.WithHTTPPathPattern("/v1/inventory/agents/{agent_id}")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AgentsService_RemoveAgent_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_AgentsService_RemoveAgent_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - return nil -} - -// RegisterAgentsServiceHandlerFromEndpoint is same as RegisterAgentsServiceHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterAgentsServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.NewClient(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - return RegisterAgentsServiceHandler(ctx, mux, conn) -} - -// RegisterAgentsServiceHandler registers the http handlers for service AgentsService to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterAgentsServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterAgentsServiceHandlerClient(ctx, mux, NewAgentsServiceClient(conn)) -} - -// RegisterAgentsServiceHandlerClient registers the http handlers for service AgentsService -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "AgentsServiceClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "AgentsServiceClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "AgentsServiceClient" to call the correct interceptors. This client ignores the HTTP middlewares. -func RegisterAgentsServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AgentsServiceClient) error { - mux.Handle(http.MethodGet, pattern_AgentsService_ListAgents_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, "/inventory.v1.AgentsService/ListAgents", runtime.WithHTTPPathPattern("/v1/inventory/agents")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AgentsService_ListAgents_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_AgentsService_ListAgents_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodGet, pattern_AgentsService_GetAgent_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, "/inventory.v1.AgentsService/GetAgent", runtime.WithHTTPPathPattern("/v1/inventory/agents/{agent_id}")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AgentsService_GetAgent_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_AgentsService_GetAgent_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodGet, pattern_AgentsService_GetAgentLogs_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, "/inventory.v1.AgentsService/GetAgentLogs", runtime.WithHTTPPathPattern("/v1/inventory/agents/{agent_id}/logs")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AgentsService_GetAgentLogs_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_AgentsService_GetAgentLogs_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPost, pattern_AgentsService_AddAgent_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, "/inventory.v1.AgentsService/AddAgent", runtime.WithHTTPPathPattern("/v1/inventory/agents")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AgentsService_AddAgent_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_AgentsService_AddAgent_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPut, pattern_AgentsService_ChangeAgent_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, "/inventory.v1.AgentsService/ChangeAgent", runtime.WithHTTPPathPattern("/v1/inventory/agents/{agent_id}")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AgentsService_ChangeAgent_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_AgentsService_ChangeAgent_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodDelete, pattern_AgentsService_RemoveAgent_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, "/inventory.v1.AgentsService/RemoveAgent", runtime.WithHTTPPathPattern("/v1/inventory/agents/{agent_id}")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AgentsService_RemoveAgent_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_AgentsService_RemoveAgent_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - return nil -} - -var ( - pattern_AgentsService_ListAgents_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "inventory", "agents"}, "")) - pattern_AgentsService_GetAgent_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "inventory", "agents", "agent_id"}, "")) - pattern_AgentsService_GetAgentLogs_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"v1", "inventory", "agents", "agent_id", "logs"}, "")) - pattern_AgentsService_AddAgent_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "inventory", "agents"}, "")) - pattern_AgentsService_ChangeAgent_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "inventory", "agents", "agent_id"}, "")) - pattern_AgentsService_RemoveAgent_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "inventory", "agents", "agent_id"}, "")) -) - -var ( - forward_AgentsService_ListAgents_0 = runtime.ForwardResponseMessage - forward_AgentsService_GetAgent_0 = runtime.ForwardResponseMessage - forward_AgentsService_GetAgentLogs_0 = runtime.ForwardResponseMessage - forward_AgentsService_AddAgent_0 = runtime.ForwardResponseMessage - forward_AgentsService_ChangeAgent_0 = runtime.ForwardResponseMessage - forward_AgentsService_RemoveAgent_0 = runtime.ForwardResponseMessage -) diff --git a/api/inventory/v1/agents.pb.validate.go b/api/inventory/v1/agents.pb.validate.go deleted file mode 100644 index af3f6255a8d..00000000000 --- a/api/inventory/v1/agents.pb.validate.go +++ /dev/null @@ -1,13129 +0,0 @@ -// Code generated by protoc-gen-validate. DO NOT EDIT. -// source: inventory/v1/agents.proto - -package inventoryv1 - -import ( - "bytes" - "errors" - "fmt" - "net" - "net/mail" - "net/url" - "regexp" - "sort" - "strings" - "time" - "unicode/utf8" - - "google.golang.org/protobuf/types/known/anypb" -) - -// ensure the imports are used -var ( - _ = bytes.MinRead - _ = errors.New("") - _ = fmt.Print - _ = utf8.UTFMax - _ = (*regexp.Regexp)(nil) - _ = (*strings.Reader)(nil) - _ = net.IPv4len - _ = time.Duration(0) - _ = (*url.URL)(nil) - _ = (*mail.Address)(nil) - _ = anypb.Any{} - _ = sort.Sort -) - -// define the regex for a UUID once up-front -var _agents_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$") - -// Validate checks the field values on PMMAgent 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 *PMMAgent) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on PMMAgent 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 PMMAgentMultiError, or nil -// if none found. -func (m *PMMAgent) ValidateAll() error { - return m.validate(true) -} - -func (m *PMMAgent) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for AgentId - - // no validation rules for RunsOnNodeId - - // no validation rules for CustomLabels - - // no validation rules for Connected - - // no validation rules for ProcessExecPath - - if len(errors) > 0 { - return PMMAgentMultiError(errors) - } - - return nil -} - -// PMMAgentMultiError is an error wrapping multiple validation errors returned -// by PMMAgent.ValidateAll() if the designated constraints aren't met. -type PMMAgentMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m PMMAgentMultiError) 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 PMMAgentMultiError) AllErrors() []error { return m } - -// PMMAgentValidationError is the validation error returned by -// PMMAgent.Validate if the designated constraints aren't met. -type PMMAgentValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e PMMAgentValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e PMMAgentValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e PMMAgentValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e PMMAgentValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e PMMAgentValidationError) ErrorName() string { return "PMMAgentValidationError" } - -// Error satisfies the builtin error interface -func (e PMMAgentValidationError) 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 %sPMMAgent.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = PMMAgentValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = PMMAgentValidationError{} - -// Validate checks the field values on VMAgent 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 *VMAgent) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on VMAgent 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 VMAgentMultiError, or nil if none found. -func (m *VMAgent) ValidateAll() error { - return m.validate(true) -} - -func (m *VMAgent) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for AgentId - - // no validation rules for PmmAgentId - - // no validation rules for Status - - // no validation rules for ProcessExecPath - - // no validation rules for ListenPort - - if len(errors) > 0 { - return VMAgentMultiError(errors) - } - - return nil -} - -// VMAgentMultiError is an error wrapping multiple validation errors returned -// by VMAgent.ValidateAll() if the designated constraints aren't met. -type VMAgentMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m VMAgentMultiError) 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 VMAgentMultiError) AllErrors() []error { return m } - -// VMAgentValidationError is the validation error returned by VMAgent.Validate -// if the designated constraints aren't met. -type VMAgentValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e VMAgentValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e VMAgentValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e VMAgentValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e VMAgentValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e VMAgentValidationError) ErrorName() string { return "VMAgentValidationError" } - -// Error satisfies the builtin error interface -func (e VMAgentValidationError) 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 %sVMAgent.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = VMAgentValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = VMAgentValidationError{} - -// Validate checks the field values on NomadAgent 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 *NomadAgent) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on NomadAgent 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 NomadAgentMultiError, or -// nil if none found. -func (m *NomadAgent) ValidateAll() error { - return m.validate(true) -} - -func (m *NomadAgent) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for AgentId - - // no validation rules for PmmAgentId - - // no validation rules for Disabled - - // no validation rules for Status - - // no validation rules for ProcessExecPath - - // no validation rules for ListenPort - - if len(errors) > 0 { - return NomadAgentMultiError(errors) - } - - return nil -} - -// NomadAgentMultiError is an error wrapping multiple validation errors -// returned by NomadAgent.ValidateAll() if the designated constraints aren't met. -type NomadAgentMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m NomadAgentMultiError) 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 NomadAgentMultiError) AllErrors() []error { return m } - -// NomadAgentValidationError is the validation error returned by -// NomadAgent.Validate if the designated constraints aren't met. -type NomadAgentValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e NomadAgentValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e NomadAgentValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e NomadAgentValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e NomadAgentValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e NomadAgentValidationError) ErrorName() string { return "NomadAgentValidationError" } - -// Error satisfies the builtin error interface -func (e NomadAgentValidationError) 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 %sNomadAgent.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = NomadAgentValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = NomadAgentValidationError{} - -// Validate checks the field values on NodeExporter 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 *NodeExporter) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on NodeExporter 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 NodeExporterMultiError, or -// nil if none found. -func (m *NodeExporter) ValidateAll() error { - return m.validate(true) -} - -func (m *NodeExporter) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for AgentId - - // no validation rules for PmmAgentId - - // no validation rules for Disabled - - // no validation rules for CustomLabels - - // no validation rules for PushMetricsEnabled - - // no validation rules for Status - - // no validation rules for ListenPort - - // no validation rules for ProcessExecPath - - // no validation rules for LogLevel - - // no validation rules for ExposeExporter - - if all { - switch v := interface{}(m.GetMetricsResolutions()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, NodeExporterValidationError{ - field: "MetricsResolutions", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, NodeExporterValidationError{ - field: "MetricsResolutions", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMetricsResolutions()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return NodeExporterValidationError{ - field: "MetricsResolutions", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if len(errors) > 0 { - return NodeExporterMultiError(errors) - } - - return nil -} - -// NodeExporterMultiError is an error wrapping multiple validation errors -// returned by NodeExporter.ValidateAll() if the designated constraints aren't met. -type NodeExporterMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m NodeExporterMultiError) 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 NodeExporterMultiError) AllErrors() []error { return m } - -// NodeExporterValidationError is the validation error returned by -// NodeExporter.Validate if the designated constraints aren't met. -type NodeExporterValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e NodeExporterValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e NodeExporterValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e NodeExporterValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e NodeExporterValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e NodeExporterValidationError) ErrorName() string { return "NodeExporterValidationError" } - -// Error satisfies the builtin error interface -func (e NodeExporterValidationError) 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 %sNodeExporter.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = NodeExporterValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = NodeExporterValidationError{} - -// Validate checks the field values on MySQLdExporter 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 *MySQLdExporter) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on MySQLdExporter 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 MySQLdExporterMultiError, -// or nil if none found. -func (m *MySQLdExporter) ValidateAll() error { - return m.validate(true) -} - -func (m *MySQLdExporter) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for AgentId - - // no validation rules for PmmAgentId - - // no validation rules for Disabled - - // no validation rules for ServiceId - - // no validation rules for Username - - // no validation rules for Tls - - // no validation rules for TlsSkipVerify - - // no validation rules for TlsCa - - // no validation rules for TlsCert - - // no validation rules for TlsKey - - // no validation rules for TablestatsGroupTableLimit - - // no validation rules for CustomLabels - - // no validation rules for PushMetricsEnabled - - // no validation rules for TableCount - - // no validation rules for Status - - // no validation rules for ListenPort - - // no validation rules for TablestatsGroupDisabled - - // no validation rules for ProcessExecPath - - // no validation rules for LogLevel - - // no validation rules for ExposeExporter - - if all { - switch v := interface{}(m.GetMetricsResolutions()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, MySQLdExporterValidationError{ - field: "MetricsResolutions", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, MySQLdExporterValidationError{ - field: "MetricsResolutions", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMetricsResolutions()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return MySQLdExporterValidationError{ - field: "MetricsResolutions", - reason: "embedded message failed validation", - cause: err, - } - } - } - - // no validation rules for ExtraDsnParams - - if len(errors) > 0 { - return MySQLdExporterMultiError(errors) - } - - return nil -} - -// MySQLdExporterMultiError is an error wrapping multiple validation errors -// returned by MySQLdExporter.ValidateAll() if the designated constraints -// aren't met. -type MySQLdExporterMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m MySQLdExporterMultiError) 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 MySQLdExporterMultiError) AllErrors() []error { return m } - -// MySQLdExporterValidationError is the validation error returned by -// MySQLdExporter.Validate if the designated constraints aren't met. -type MySQLdExporterValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e MySQLdExporterValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e MySQLdExporterValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e MySQLdExporterValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e MySQLdExporterValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e MySQLdExporterValidationError) ErrorName() string { return "MySQLdExporterValidationError" } - -// Error satisfies the builtin error interface -func (e MySQLdExporterValidationError) 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 %sMySQLdExporter.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = MySQLdExporterValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = MySQLdExporterValidationError{} - -// Validate checks the field values on MongoDBExporter 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 *MongoDBExporter) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on MongoDBExporter 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 -// MongoDBExporterMultiError, or nil if none found. -func (m *MongoDBExporter) ValidateAll() error { - return m.validate(true) -} - -func (m *MongoDBExporter) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for AgentId - - // no validation rules for PmmAgentId - - // no validation rules for Disabled - - // no validation rules for ServiceId - - // no validation rules for Username - - // no validation rules for Tls - - // no validation rules for TlsSkipVerify - - // no validation rules for CustomLabels - - // no validation rules for PushMetricsEnabled - - // no validation rules for Status - - // no validation rules for ListenPort - - // no validation rules for CollectionsLimit - - // no validation rules for EnableAllCollectors - - // no validation rules for ProcessExecPath - - // no validation rules for LogLevel - - // no validation rules for ExposeExporter - - if all { - switch v := interface{}(m.GetMetricsResolutions()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, MongoDBExporterValidationError{ - field: "MetricsResolutions", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, MongoDBExporterValidationError{ - field: "MetricsResolutions", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMetricsResolutions()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return MongoDBExporterValidationError{ - field: "MetricsResolutions", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if len(errors) > 0 { - return MongoDBExporterMultiError(errors) - } - - return nil -} - -// MongoDBExporterMultiError is an error wrapping multiple validation errors -// returned by MongoDBExporter.ValidateAll() if the designated constraints -// aren't met. -type MongoDBExporterMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m MongoDBExporterMultiError) 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 MongoDBExporterMultiError) AllErrors() []error { return m } - -// MongoDBExporterValidationError is the validation error returned by -// MongoDBExporter.Validate if the designated constraints aren't met. -type MongoDBExporterValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e MongoDBExporterValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e MongoDBExporterValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e MongoDBExporterValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e MongoDBExporterValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e MongoDBExporterValidationError) ErrorName() string { return "MongoDBExporterValidationError" } - -// Error satisfies the builtin error interface -func (e MongoDBExporterValidationError) 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 %sMongoDBExporter.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = MongoDBExporterValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = MongoDBExporterValidationError{} - -// Validate checks the field values on PostgresExporter 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 *PostgresExporter) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on PostgresExporter 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 -// PostgresExporterMultiError, or nil if none found. -func (m *PostgresExporter) ValidateAll() error { - return m.validate(true) -} - -func (m *PostgresExporter) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for AgentId - - // no validation rules for PmmAgentId - - // no validation rules for Disabled - - // no validation rules for ServiceId - - // no validation rules for Username - - // no validation rules for Tls - - // no validation rules for TlsSkipVerify - - // no validation rules for CustomLabels - - // no validation rules for PushMetricsEnabled - - // no validation rules for Status - - // no validation rules for ListenPort - - // no validation rules for ProcessExecPath - - // no validation rules for LogLevel - - // no validation rules for AutoDiscoveryLimit - - // no validation rules for ExposeExporter - - // no validation rules for MaxExporterConnections - - if all { - switch v := interface{}(m.GetMetricsResolutions()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, PostgresExporterValidationError{ - field: "MetricsResolutions", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, PostgresExporterValidationError{ - field: "MetricsResolutions", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMetricsResolutions()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return PostgresExporterValidationError{ - field: "MetricsResolutions", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if len(errors) > 0 { - return PostgresExporterMultiError(errors) - } - - return nil -} - -// PostgresExporterMultiError is an error wrapping multiple validation errors -// returned by PostgresExporter.ValidateAll() if the designated constraints -// aren't met. -type PostgresExporterMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m PostgresExporterMultiError) 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 PostgresExporterMultiError) AllErrors() []error { return m } - -// PostgresExporterValidationError is the validation error returned by -// PostgresExporter.Validate if the designated constraints aren't met. -type PostgresExporterValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e PostgresExporterValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e PostgresExporterValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e PostgresExporterValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e PostgresExporterValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e PostgresExporterValidationError) ErrorName() string { return "PostgresExporterValidationError" } - -// Error satisfies the builtin error interface -func (e PostgresExporterValidationError) 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 %sPostgresExporter.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = PostgresExporterValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = PostgresExporterValidationError{} - -// Validate checks the field values on ProxySQLExporter 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 *ProxySQLExporter) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ProxySQLExporter 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 -// ProxySQLExporterMultiError, or nil if none found. -func (m *ProxySQLExporter) ValidateAll() error { - return m.validate(true) -} - -func (m *ProxySQLExporter) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for AgentId - - // no validation rules for PmmAgentId - - // no validation rules for Disabled - - // no validation rules for ServiceId - - // no validation rules for Username - - // no validation rules for Tls - - // no validation rules for TlsSkipVerify - - // no validation rules for CustomLabels - - // no validation rules for PushMetricsEnabled - - // no validation rules for Status - - // no validation rules for ListenPort - - // no validation rules for ProcessExecPath - - // no validation rules for LogLevel - - // no validation rules for ExposeExporter - - if all { - switch v := interface{}(m.GetMetricsResolutions()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ProxySQLExporterValidationError{ - field: "MetricsResolutions", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ProxySQLExporterValidationError{ - field: "MetricsResolutions", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMetricsResolutions()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ProxySQLExporterValidationError{ - field: "MetricsResolutions", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if len(errors) > 0 { - return ProxySQLExporterMultiError(errors) - } - - return nil -} - -// ProxySQLExporterMultiError is an error wrapping multiple validation errors -// returned by ProxySQLExporter.ValidateAll() if the designated constraints -// aren't met. -type ProxySQLExporterMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ProxySQLExporterMultiError) 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 ProxySQLExporterMultiError) AllErrors() []error { return m } - -// ProxySQLExporterValidationError is the validation error returned by -// ProxySQLExporter.Validate if the designated constraints aren't met. -type ProxySQLExporterValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ProxySQLExporterValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ProxySQLExporterValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ProxySQLExporterValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ProxySQLExporterValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ProxySQLExporterValidationError) ErrorName() string { return "ProxySQLExporterValidationError" } - -// Error satisfies the builtin error interface -func (e ProxySQLExporterValidationError) 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 %sProxySQLExporter.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ProxySQLExporterValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ProxySQLExporterValidationError{} - -// Validate checks the field values on ValkeyExporter 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 *ValkeyExporter) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ValkeyExporter 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 ValkeyExporterMultiError, -// or nil if none found. -func (m *ValkeyExporter) ValidateAll() error { - return m.validate(true) -} - -func (m *ValkeyExporter) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for AgentId - - // no validation rules for PmmAgentId - - // no validation rules for Disabled - - // no validation rules for ServiceId - - // no validation rules for Username - - // no validation rules for Tls - - // no validation rules for TlsSkipVerify - - // no validation rules for CustomLabels - - // no validation rules for PushMetricsEnabled - - // no validation rules for Status - - // no validation rules for ListenPort - - // no validation rules for ProcessExecPath - - // no validation rules for ExposeExporter - - if all { - switch v := interface{}(m.GetMetricsResolutions()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ValkeyExporterValidationError{ - field: "MetricsResolutions", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ValkeyExporterValidationError{ - field: "MetricsResolutions", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMetricsResolutions()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ValkeyExporterValidationError{ - field: "MetricsResolutions", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if len(errors) > 0 { - return ValkeyExporterMultiError(errors) - } - - return nil -} - -// ValkeyExporterMultiError is an error wrapping multiple validation errors -// returned by ValkeyExporter.ValidateAll() if the designated constraints -// aren't met. -type ValkeyExporterMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ValkeyExporterMultiError) 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 ValkeyExporterMultiError) AllErrors() []error { return m } - -// ValkeyExporterValidationError is the validation error returned by -// ValkeyExporter.Validate if the designated constraints aren't met. -type ValkeyExporterValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ValkeyExporterValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ValkeyExporterValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ValkeyExporterValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ValkeyExporterValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ValkeyExporterValidationError) ErrorName() string { return "ValkeyExporterValidationError" } - -// Error satisfies the builtin error interface -func (e ValkeyExporterValidationError) 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 %sValkeyExporter.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ValkeyExporterValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ValkeyExporterValidationError{} - -// Validate checks the field values on QANMySQLPerfSchemaAgent 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 *QANMySQLPerfSchemaAgent) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on QANMySQLPerfSchemaAgent 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 -// QANMySQLPerfSchemaAgentMultiError, or nil if none found. -func (m *QANMySQLPerfSchemaAgent) ValidateAll() error { - return m.validate(true) -} - -func (m *QANMySQLPerfSchemaAgent) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for AgentId - - // no validation rules for PmmAgentId - - // no validation rules for Disabled - - // no validation rules for ServiceId - - // no validation rules for Username - - // no validation rules for Tls - - // no validation rules for TlsSkipVerify - - // no validation rules for TlsCa - - // no validation rules for TlsCert - - // no validation rules for TlsKey - - // no validation rules for DisableCommentsParsing - - // no validation rules for MaxQueryLength - - // no validation rules for QueryExamplesDisabled - - // no validation rules for CustomLabels - - // no validation rules for Status - - // no validation rules for ProcessExecPath - - // no validation rules for LogLevel - - // no validation rules for ExtraDsnParams - - if len(errors) > 0 { - return QANMySQLPerfSchemaAgentMultiError(errors) - } - - return nil -} - -// QANMySQLPerfSchemaAgentMultiError is an error wrapping multiple validation -// errors returned by QANMySQLPerfSchemaAgent.ValidateAll() if the designated -// constraints aren't met. -type QANMySQLPerfSchemaAgentMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m QANMySQLPerfSchemaAgentMultiError) 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 QANMySQLPerfSchemaAgentMultiError) AllErrors() []error { return m } - -// QANMySQLPerfSchemaAgentValidationError is the validation error returned by -// QANMySQLPerfSchemaAgent.Validate if the designated constraints aren't met. -type QANMySQLPerfSchemaAgentValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e QANMySQLPerfSchemaAgentValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e QANMySQLPerfSchemaAgentValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e QANMySQLPerfSchemaAgentValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e QANMySQLPerfSchemaAgentValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e QANMySQLPerfSchemaAgentValidationError) ErrorName() string { - return "QANMySQLPerfSchemaAgentValidationError" -} - -// Error satisfies the builtin error interface -func (e QANMySQLPerfSchemaAgentValidationError) 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 %sQANMySQLPerfSchemaAgent.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = QANMySQLPerfSchemaAgentValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = QANMySQLPerfSchemaAgentValidationError{} - -// Validate checks the field values on QANMySQLSlowlogAgent 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 *QANMySQLSlowlogAgent) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on QANMySQLSlowlogAgent 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 -// QANMySQLSlowlogAgentMultiError, or nil if none found. -func (m *QANMySQLSlowlogAgent) ValidateAll() error { - return m.validate(true) -} - -func (m *QANMySQLSlowlogAgent) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for AgentId - - // no validation rules for PmmAgentId - - // no validation rules for Disabled - - // no validation rules for ServiceId - - // no validation rules for Username - - // no validation rules for Tls - - // no validation rules for TlsSkipVerify - - // no validation rules for TlsCa - - // no validation rules for TlsCert - - // no validation rules for TlsKey - - // no validation rules for DisableCommentsParsing - - // no validation rules for MaxQueryLength - - // no validation rules for QueryExamplesDisabled - - // no validation rules for MaxSlowlogFileSize - - // no validation rules for CustomLabels - - // no validation rules for Status - - // no validation rules for ProcessExecPath - - // no validation rules for LogLevel - - // no validation rules for ExtraDsnParams - - if len(errors) > 0 { - return QANMySQLSlowlogAgentMultiError(errors) - } - - return nil -} - -// QANMySQLSlowlogAgentMultiError is an error wrapping multiple validation -// errors returned by QANMySQLSlowlogAgent.ValidateAll() if the designated -// constraints aren't met. -type QANMySQLSlowlogAgentMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m QANMySQLSlowlogAgentMultiError) 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 QANMySQLSlowlogAgentMultiError) AllErrors() []error { return m } - -// QANMySQLSlowlogAgentValidationError is the validation error returned by -// QANMySQLSlowlogAgent.Validate if the designated constraints aren't met. -type QANMySQLSlowlogAgentValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e QANMySQLSlowlogAgentValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e QANMySQLSlowlogAgentValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e QANMySQLSlowlogAgentValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e QANMySQLSlowlogAgentValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e QANMySQLSlowlogAgentValidationError) ErrorName() string { - return "QANMySQLSlowlogAgentValidationError" -} - -// Error satisfies the builtin error interface -func (e QANMySQLSlowlogAgentValidationError) 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 %sQANMySQLSlowlogAgent.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = QANMySQLSlowlogAgentValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = QANMySQLSlowlogAgentValidationError{} - -// Validate checks the field values on QANMongoDBProfilerAgent 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 *QANMongoDBProfilerAgent) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on QANMongoDBProfilerAgent 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 -// QANMongoDBProfilerAgentMultiError, or nil if none found. -func (m *QANMongoDBProfilerAgent) ValidateAll() error { - return m.validate(true) -} - -func (m *QANMongoDBProfilerAgent) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for AgentId - - // no validation rules for PmmAgentId - - // no validation rules for Disabled - - // no validation rules for ServiceId - - // no validation rules for Username - - // no validation rules for Tls - - // no validation rules for TlsSkipVerify - - // no validation rules for MaxQueryLength - - // no validation rules for CustomLabels - - // no validation rules for Status - - // no validation rules for ProcessExecPath - - // no validation rules for LogLevel - - if len(errors) > 0 { - return QANMongoDBProfilerAgentMultiError(errors) - } - - return nil -} - -// QANMongoDBProfilerAgentMultiError is an error wrapping multiple validation -// errors returned by QANMongoDBProfilerAgent.ValidateAll() if the designated -// constraints aren't met. -type QANMongoDBProfilerAgentMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m QANMongoDBProfilerAgentMultiError) 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 QANMongoDBProfilerAgentMultiError) AllErrors() []error { return m } - -// QANMongoDBProfilerAgentValidationError is the validation error returned by -// QANMongoDBProfilerAgent.Validate if the designated constraints aren't met. -type QANMongoDBProfilerAgentValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e QANMongoDBProfilerAgentValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e QANMongoDBProfilerAgentValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e QANMongoDBProfilerAgentValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e QANMongoDBProfilerAgentValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e QANMongoDBProfilerAgentValidationError) ErrorName() string { - return "QANMongoDBProfilerAgentValidationError" -} - -// Error satisfies the builtin error interface -func (e QANMongoDBProfilerAgentValidationError) 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 %sQANMongoDBProfilerAgent.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = QANMongoDBProfilerAgentValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = QANMongoDBProfilerAgentValidationError{} - -// Validate checks the field values on QANMongoDBMongologAgent 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 *QANMongoDBMongologAgent) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on QANMongoDBMongologAgent 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 -// QANMongoDBMongologAgentMultiError, or nil if none found. -func (m *QANMongoDBMongologAgent) ValidateAll() error { - return m.validate(true) -} - -func (m *QANMongoDBMongologAgent) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for AgentId - - // no validation rules for PmmAgentId - - // no validation rules for Disabled - - // no validation rules for ServiceId - - // no validation rules for Username - - // no validation rules for Tls - - // no validation rules for TlsSkipVerify - - // no validation rules for MaxQueryLength - - // no validation rules for CustomLabels - - // no validation rules for Status - - // no validation rules for ProcessExecPath - - // no validation rules for LogLevel - - if len(errors) > 0 { - return QANMongoDBMongologAgentMultiError(errors) - } - - return nil -} - -// QANMongoDBMongologAgentMultiError is an error wrapping multiple validation -// errors returned by QANMongoDBMongologAgent.ValidateAll() if the designated -// constraints aren't met. -type QANMongoDBMongologAgentMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m QANMongoDBMongologAgentMultiError) 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 QANMongoDBMongologAgentMultiError) AllErrors() []error { return m } - -// QANMongoDBMongologAgentValidationError is the validation error returned by -// QANMongoDBMongologAgent.Validate if the designated constraints aren't met. -type QANMongoDBMongologAgentValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e QANMongoDBMongologAgentValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e QANMongoDBMongologAgentValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e QANMongoDBMongologAgentValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e QANMongoDBMongologAgentValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e QANMongoDBMongologAgentValidationError) ErrorName() string { - return "QANMongoDBMongologAgentValidationError" -} - -// Error satisfies the builtin error interface -func (e QANMongoDBMongologAgentValidationError) 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 %sQANMongoDBMongologAgent.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = QANMongoDBMongologAgentValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = QANMongoDBMongologAgentValidationError{} - -// Validate checks the field values on QANPostgreSQLPgStatementsAgent 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 *QANPostgreSQLPgStatementsAgent) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on QANPostgreSQLPgStatementsAgent 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 -// QANPostgreSQLPgStatementsAgentMultiError, or nil if none found. -func (m *QANPostgreSQLPgStatementsAgent) ValidateAll() error { - return m.validate(true) -} - -func (m *QANPostgreSQLPgStatementsAgent) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for AgentId - - // no validation rules for PmmAgentId - - // no validation rules for Disabled - - // no validation rules for ServiceId - - // no validation rules for Username - - // no validation rules for DisableCommentsParsing - - // no validation rules for MaxQueryLength - - // no validation rules for Tls - - // no validation rules for TlsSkipVerify - - // no validation rules for CustomLabels - - // no validation rules for Status - - // no validation rules for ProcessExecPath - - // no validation rules for LogLevel - - if len(errors) > 0 { - return QANPostgreSQLPgStatementsAgentMultiError(errors) - } - - return nil -} - -// QANPostgreSQLPgStatementsAgentMultiError is an error wrapping multiple -// validation errors returned by QANPostgreSQLPgStatementsAgent.ValidateAll() -// if the designated constraints aren't met. -type QANPostgreSQLPgStatementsAgentMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m QANPostgreSQLPgStatementsAgentMultiError) 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 QANPostgreSQLPgStatementsAgentMultiError) AllErrors() []error { return m } - -// QANPostgreSQLPgStatementsAgentValidationError is the validation error -// returned by QANPostgreSQLPgStatementsAgent.Validate if the designated -// constraints aren't met. -type QANPostgreSQLPgStatementsAgentValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e QANPostgreSQLPgStatementsAgentValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e QANPostgreSQLPgStatementsAgentValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e QANPostgreSQLPgStatementsAgentValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e QANPostgreSQLPgStatementsAgentValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e QANPostgreSQLPgStatementsAgentValidationError) ErrorName() string { - return "QANPostgreSQLPgStatementsAgentValidationError" -} - -// Error satisfies the builtin error interface -func (e QANPostgreSQLPgStatementsAgentValidationError) 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 %sQANPostgreSQLPgStatementsAgent.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = QANPostgreSQLPgStatementsAgentValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = QANPostgreSQLPgStatementsAgentValidationError{} - -// Validate checks the field values on QANPostgreSQLPgStatMonitorAgent 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 *QANPostgreSQLPgStatMonitorAgent) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on QANPostgreSQLPgStatMonitorAgent 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 -// QANPostgreSQLPgStatMonitorAgentMultiError, or nil if none found. -func (m *QANPostgreSQLPgStatMonitorAgent) ValidateAll() error { - return m.validate(true) -} - -func (m *QANPostgreSQLPgStatMonitorAgent) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for AgentId - - // no validation rules for PmmAgentId - - // no validation rules for Disabled - - // no validation rules for ServiceId - - // no validation rules for Username - - // no validation rules for Tls - - // no validation rules for TlsSkipVerify - - // no validation rules for DisableCommentsParsing - - // no validation rules for MaxQueryLength - - // no validation rules for QueryExamplesDisabled - - // no validation rules for CustomLabels - - // no validation rules for Status - - // no validation rules for ProcessExecPath - - // no validation rules for LogLevel - - if len(errors) > 0 { - return QANPostgreSQLPgStatMonitorAgentMultiError(errors) - } - - return nil -} - -// QANPostgreSQLPgStatMonitorAgentMultiError is an error wrapping multiple -// validation errors returned by QANPostgreSQLPgStatMonitorAgent.ValidateAll() -// if the designated constraints aren't met. -type QANPostgreSQLPgStatMonitorAgentMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m QANPostgreSQLPgStatMonitorAgentMultiError) 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 QANPostgreSQLPgStatMonitorAgentMultiError) AllErrors() []error { return m } - -// QANPostgreSQLPgStatMonitorAgentValidationError is the validation error -// returned by QANPostgreSQLPgStatMonitorAgent.Validate if the designated -// constraints aren't met. -type QANPostgreSQLPgStatMonitorAgentValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e QANPostgreSQLPgStatMonitorAgentValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e QANPostgreSQLPgStatMonitorAgentValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e QANPostgreSQLPgStatMonitorAgentValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e QANPostgreSQLPgStatMonitorAgentValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e QANPostgreSQLPgStatMonitorAgentValidationError) ErrorName() string { - return "QANPostgreSQLPgStatMonitorAgentValidationError" -} - -// Error satisfies the builtin error interface -func (e QANPostgreSQLPgStatMonitorAgentValidationError) 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 %sQANPostgreSQLPgStatMonitorAgent.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = QANPostgreSQLPgStatMonitorAgentValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = QANPostgreSQLPgStatMonitorAgentValidationError{} - -// Validate checks the field values on RDSExporter 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 *RDSExporter) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on RDSExporter 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 RDSExporterMultiError, or -// nil if none found. -func (m *RDSExporter) ValidateAll() error { - return m.validate(true) -} - -func (m *RDSExporter) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for AgentId - - // no validation rules for PmmAgentId - - // no validation rules for Disabled - - // no validation rules for NodeId - - // no validation rules for AwsAccessKey - - // no validation rules for CustomLabels - - // no validation rules for Status - - // no validation rules for ListenPort - - // no validation rules for BasicMetricsDisabled - - // no validation rules for EnhancedMetricsDisabled - - // no validation rules for PushMetricsEnabled - - // no validation rules for ProcessExecPath - - // no validation rules for LogLevel - - // no validation rules for AutoDiscoveryLimit - - if all { - switch v := interface{}(m.GetMetricsResolutions()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, RDSExporterValidationError{ - field: "MetricsResolutions", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, RDSExporterValidationError{ - field: "MetricsResolutions", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMetricsResolutions()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return RDSExporterValidationError{ - field: "MetricsResolutions", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if len(errors) > 0 { - return RDSExporterMultiError(errors) - } - - return nil -} - -// RDSExporterMultiError is an error wrapping multiple validation errors -// returned by RDSExporter.ValidateAll() if the designated constraints aren't met. -type RDSExporterMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m RDSExporterMultiError) 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 RDSExporterMultiError) AllErrors() []error { return m } - -// RDSExporterValidationError is the validation error returned by -// RDSExporter.Validate if the designated constraints aren't met. -type RDSExporterValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e RDSExporterValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e RDSExporterValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e RDSExporterValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e RDSExporterValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e RDSExporterValidationError) ErrorName() string { return "RDSExporterValidationError" } - -// Error satisfies the builtin error interface -func (e RDSExporterValidationError) 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 %sRDSExporter.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = RDSExporterValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = RDSExporterValidationError{} - -// Validate checks the field values on ExternalExporter 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 *ExternalExporter) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ExternalExporter 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 -// ExternalExporterMultiError, or nil if none found. -func (m *ExternalExporter) ValidateAll() error { - return m.validate(true) -} - -func (m *ExternalExporter) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for AgentId - - // no validation rules for RunsOnNodeId - - // no validation rules for Disabled - - // no validation rules for ServiceId - - // no validation rules for Username - - // no validation rules for Scheme - - // no validation rules for MetricsPath - - // no validation rules for CustomLabels - - // no validation rules for ListenPort - - // no validation rules for PushMetricsEnabled - - // no validation rules for ProcessExecPath - - if all { - switch v := interface{}(m.GetMetricsResolutions()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ExternalExporterValidationError{ - field: "MetricsResolutions", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ExternalExporterValidationError{ - field: "MetricsResolutions", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMetricsResolutions()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ExternalExporterValidationError{ - field: "MetricsResolutions", - reason: "embedded message failed validation", - cause: err, - } - } - } - - // no validation rules for TlsSkipVerify - - if len(errors) > 0 { - return ExternalExporterMultiError(errors) - } - - return nil -} - -// ExternalExporterMultiError is an error wrapping multiple validation errors -// returned by ExternalExporter.ValidateAll() if the designated constraints -// aren't met. -type ExternalExporterMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ExternalExporterMultiError) 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 ExternalExporterMultiError) AllErrors() []error { return m } - -// ExternalExporterValidationError is the validation error returned by -// ExternalExporter.Validate if the designated constraints aren't met. -type ExternalExporterValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ExternalExporterValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ExternalExporterValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ExternalExporterValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ExternalExporterValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ExternalExporterValidationError) ErrorName() string { return "ExternalExporterValidationError" } - -// Error satisfies the builtin error interface -func (e ExternalExporterValidationError) 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 %sExternalExporter.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ExternalExporterValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ExternalExporterValidationError{} - -// Validate checks the field values on AzureDatabaseExporter 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 *AzureDatabaseExporter) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on AzureDatabaseExporter 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 -// AzureDatabaseExporterMultiError, or nil if none found. -func (m *AzureDatabaseExporter) ValidateAll() error { - return m.validate(true) -} - -func (m *AzureDatabaseExporter) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for AgentId - - // no validation rules for PmmAgentId - - // no validation rules for Disabled - - // no validation rules for NodeId - - // no validation rules for AzureDatabaseSubscriptionId - - // no validation rules for AzureDatabaseResourceType - - // no validation rules for CustomLabels - - // no validation rules for Status - - // no validation rules for ListenPort - - // no validation rules for PushMetricsEnabled - - // no validation rules for ProcessExecPath - - // no validation rules for LogLevel - - if all { - switch v := interface{}(m.GetMetricsResolutions()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AzureDatabaseExporterValidationError{ - field: "MetricsResolutions", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AzureDatabaseExporterValidationError{ - field: "MetricsResolutions", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMetricsResolutions()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AzureDatabaseExporterValidationError{ - field: "MetricsResolutions", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if len(errors) > 0 { - return AzureDatabaseExporterMultiError(errors) - } - - return nil -} - -// AzureDatabaseExporterMultiError is an error wrapping multiple validation -// errors returned by AzureDatabaseExporter.ValidateAll() if the designated -// constraints aren't met. -type AzureDatabaseExporterMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m AzureDatabaseExporterMultiError) 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 AzureDatabaseExporterMultiError) AllErrors() []error { return m } - -// AzureDatabaseExporterValidationError is the validation error returned by -// AzureDatabaseExporter.Validate if the designated constraints aren't met. -type AzureDatabaseExporterValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e AzureDatabaseExporterValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e AzureDatabaseExporterValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e AzureDatabaseExporterValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e AzureDatabaseExporterValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e AzureDatabaseExporterValidationError) ErrorName() string { - return "AzureDatabaseExporterValidationError" -} - -// Error satisfies the builtin error interface -func (e AzureDatabaseExporterValidationError) 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 %sAzureDatabaseExporter.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = AzureDatabaseExporterValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = AzureDatabaseExporterValidationError{} - -// Validate checks the field values on ChangeCommonAgentParams 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 *ChangeCommonAgentParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ChangeCommonAgentParams 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 -// ChangeCommonAgentParamsMultiError, or nil if none found. -func (m *ChangeCommonAgentParams) ValidateAll() error { - return m.validate(true) -} - -func (m *ChangeCommonAgentParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if all { - switch v := interface{}(m.GetMetricsResolutions()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeCommonAgentParamsValidationError{ - field: "MetricsResolutions", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeCommonAgentParamsValidationError{ - field: "MetricsResolutions", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMetricsResolutions()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeCommonAgentParamsValidationError{ - field: "MetricsResolutions", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if m.Enable != nil { - // no validation rules for Enable - } - - if m.CustomLabels != nil { - if all { - switch v := interface{}(m.GetCustomLabels()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeCommonAgentParamsValidationError{ - field: "CustomLabels", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeCommonAgentParamsValidationError{ - field: "CustomLabels", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetCustomLabels()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeCommonAgentParamsValidationError{ - field: "CustomLabels", - reason: "embedded message failed validation", - cause: err, - } - } - } - } - - if m.EnablePushMetrics != nil { - // no validation rules for EnablePushMetrics - } - - if len(errors) > 0 { - return ChangeCommonAgentParamsMultiError(errors) - } - - return nil -} - -// ChangeCommonAgentParamsMultiError is an error wrapping multiple validation -// errors returned by ChangeCommonAgentParams.ValidateAll() if the designated -// constraints aren't met. -type ChangeCommonAgentParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ChangeCommonAgentParamsMultiError) 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 ChangeCommonAgentParamsMultiError) AllErrors() []error { return m } - -// ChangeCommonAgentParamsValidationError is the validation error returned by -// ChangeCommonAgentParams.Validate if the designated constraints aren't met. -type ChangeCommonAgentParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ChangeCommonAgentParamsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ChangeCommonAgentParamsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ChangeCommonAgentParamsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ChangeCommonAgentParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ChangeCommonAgentParamsValidationError) ErrorName() string { - return "ChangeCommonAgentParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e ChangeCommonAgentParamsValidationError) 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 %sChangeCommonAgentParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ChangeCommonAgentParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ChangeCommonAgentParamsValidationError{} - -// Validate checks the field values on ListAgentsRequest 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 *ListAgentsRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ListAgentsRequest 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 -// ListAgentsRequestMultiError, or nil if none found. -func (m *ListAgentsRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *ListAgentsRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for PmmAgentId - - // no validation rules for NodeId - - // no validation rules for ServiceId - - // no validation rules for AgentType - - if len(errors) > 0 { - return ListAgentsRequestMultiError(errors) - } - - return nil -} - -// ListAgentsRequestMultiError is an error wrapping multiple validation errors -// returned by ListAgentsRequest.ValidateAll() if the designated constraints -// aren't met. -type ListAgentsRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ListAgentsRequestMultiError) 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 ListAgentsRequestMultiError) AllErrors() []error { return m } - -// ListAgentsRequestValidationError is the validation error returned by -// ListAgentsRequest.Validate if the designated constraints aren't met. -type ListAgentsRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ListAgentsRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ListAgentsRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ListAgentsRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ListAgentsRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ListAgentsRequestValidationError) ErrorName() string { - return "ListAgentsRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e ListAgentsRequestValidationError) 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 %sListAgentsRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ListAgentsRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ListAgentsRequestValidationError{} - -// Validate checks the field values on ListAgentsResponse 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 *ListAgentsResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ListAgentsResponse 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 -// ListAgentsResponseMultiError, or nil if none found. -func (m *ListAgentsResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *ListAgentsResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - for idx, item := range m.GetPmmAgent() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ListAgentsResponseValidationError{ - field: fmt.Sprintf("PmmAgent[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ListAgentsResponseValidationError{ - field: fmt.Sprintf("PmmAgent[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ListAgentsResponseValidationError{ - field: fmt.Sprintf("PmmAgent[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - for idx, item := range m.GetVmAgent() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ListAgentsResponseValidationError{ - field: fmt.Sprintf("VmAgent[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ListAgentsResponseValidationError{ - field: fmt.Sprintf("VmAgent[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ListAgentsResponseValidationError{ - field: fmt.Sprintf("VmAgent[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - for idx, item := range m.GetNodeExporter() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ListAgentsResponseValidationError{ - field: fmt.Sprintf("NodeExporter[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ListAgentsResponseValidationError{ - field: fmt.Sprintf("NodeExporter[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ListAgentsResponseValidationError{ - field: fmt.Sprintf("NodeExporter[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - for idx, item := range m.GetMysqldExporter() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ListAgentsResponseValidationError{ - field: fmt.Sprintf("MysqldExporter[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ListAgentsResponseValidationError{ - field: fmt.Sprintf("MysqldExporter[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ListAgentsResponseValidationError{ - field: fmt.Sprintf("MysqldExporter[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - for idx, item := range m.GetMongodbExporter() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ListAgentsResponseValidationError{ - field: fmt.Sprintf("MongodbExporter[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ListAgentsResponseValidationError{ - field: fmt.Sprintf("MongodbExporter[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ListAgentsResponseValidationError{ - field: fmt.Sprintf("MongodbExporter[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - for idx, item := range m.GetPostgresExporter() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ListAgentsResponseValidationError{ - field: fmt.Sprintf("PostgresExporter[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ListAgentsResponseValidationError{ - field: fmt.Sprintf("PostgresExporter[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ListAgentsResponseValidationError{ - field: fmt.Sprintf("PostgresExporter[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - for idx, item := range m.GetProxysqlExporter() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ListAgentsResponseValidationError{ - field: fmt.Sprintf("ProxysqlExporter[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ListAgentsResponseValidationError{ - field: fmt.Sprintf("ProxysqlExporter[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ListAgentsResponseValidationError{ - field: fmt.Sprintf("ProxysqlExporter[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - for idx, item := range m.GetQanMysqlPerfschemaAgent() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ListAgentsResponseValidationError{ - field: fmt.Sprintf("QanMysqlPerfschemaAgent[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ListAgentsResponseValidationError{ - field: fmt.Sprintf("QanMysqlPerfschemaAgent[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ListAgentsResponseValidationError{ - field: fmt.Sprintf("QanMysqlPerfschemaAgent[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - for idx, item := range m.GetQanMysqlSlowlogAgent() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ListAgentsResponseValidationError{ - field: fmt.Sprintf("QanMysqlSlowlogAgent[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ListAgentsResponseValidationError{ - field: fmt.Sprintf("QanMysqlSlowlogAgent[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ListAgentsResponseValidationError{ - field: fmt.Sprintf("QanMysqlSlowlogAgent[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - for idx, item := range m.GetQanMongodbProfilerAgent() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ListAgentsResponseValidationError{ - field: fmt.Sprintf("QanMongodbProfilerAgent[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ListAgentsResponseValidationError{ - field: fmt.Sprintf("QanMongodbProfilerAgent[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ListAgentsResponseValidationError{ - field: fmt.Sprintf("QanMongodbProfilerAgent[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - for idx, item := range m.GetQanMongodbMongologAgent() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ListAgentsResponseValidationError{ - field: fmt.Sprintf("QanMongodbMongologAgent[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ListAgentsResponseValidationError{ - field: fmt.Sprintf("QanMongodbMongologAgent[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ListAgentsResponseValidationError{ - field: fmt.Sprintf("QanMongodbMongologAgent[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - for idx, item := range m.GetQanPostgresqlPgstatementsAgent() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ListAgentsResponseValidationError{ - field: fmt.Sprintf("QanPostgresqlPgstatementsAgent[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ListAgentsResponseValidationError{ - field: fmt.Sprintf("QanPostgresqlPgstatementsAgent[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ListAgentsResponseValidationError{ - field: fmt.Sprintf("QanPostgresqlPgstatementsAgent[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - for idx, item := range m.GetQanPostgresqlPgstatmonitorAgent() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ListAgentsResponseValidationError{ - field: fmt.Sprintf("QanPostgresqlPgstatmonitorAgent[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ListAgentsResponseValidationError{ - field: fmt.Sprintf("QanPostgresqlPgstatmonitorAgent[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ListAgentsResponseValidationError{ - field: fmt.Sprintf("QanPostgresqlPgstatmonitorAgent[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - for idx, item := range m.GetExternalExporter() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ListAgentsResponseValidationError{ - field: fmt.Sprintf("ExternalExporter[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ListAgentsResponseValidationError{ - field: fmt.Sprintf("ExternalExporter[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ListAgentsResponseValidationError{ - field: fmt.Sprintf("ExternalExporter[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - for idx, item := range m.GetRdsExporter() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ListAgentsResponseValidationError{ - field: fmt.Sprintf("RdsExporter[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ListAgentsResponseValidationError{ - field: fmt.Sprintf("RdsExporter[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ListAgentsResponseValidationError{ - field: fmt.Sprintf("RdsExporter[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - for idx, item := range m.GetAzureDatabaseExporter() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ListAgentsResponseValidationError{ - field: fmt.Sprintf("AzureDatabaseExporter[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ListAgentsResponseValidationError{ - field: fmt.Sprintf("AzureDatabaseExporter[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ListAgentsResponseValidationError{ - field: fmt.Sprintf("AzureDatabaseExporter[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - for idx, item := range m.GetNomadAgent() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ListAgentsResponseValidationError{ - field: fmt.Sprintf("NomadAgent[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ListAgentsResponseValidationError{ - field: fmt.Sprintf("NomadAgent[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ListAgentsResponseValidationError{ - field: fmt.Sprintf("NomadAgent[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - for idx, item := range m.GetValkeyExporter() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ListAgentsResponseValidationError{ - field: fmt.Sprintf("ValkeyExporter[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ListAgentsResponseValidationError{ - field: fmt.Sprintf("ValkeyExporter[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ListAgentsResponseValidationError{ - field: fmt.Sprintf("ValkeyExporter[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - if len(errors) > 0 { - return ListAgentsResponseMultiError(errors) - } - - return nil -} - -// ListAgentsResponseMultiError is an error wrapping multiple validation errors -// returned by ListAgentsResponse.ValidateAll() if the designated constraints -// aren't met. -type ListAgentsResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ListAgentsResponseMultiError) 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 ListAgentsResponseMultiError) AllErrors() []error { return m } - -// ListAgentsResponseValidationError is the validation error returned by -// ListAgentsResponse.Validate if the designated constraints aren't met. -type ListAgentsResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ListAgentsResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ListAgentsResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ListAgentsResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ListAgentsResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ListAgentsResponseValidationError) ErrorName() string { - return "ListAgentsResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e ListAgentsResponseValidationError) 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 %sListAgentsResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ListAgentsResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ListAgentsResponseValidationError{} - -// Validate checks the field values on GetAgentRequest 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 *GetAgentRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on GetAgentRequest 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 -// GetAgentRequestMultiError, or nil if none found. -func (m *GetAgentRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *GetAgentRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetAgentId()) < 36 { - err := GetAgentRequestValidationError{ - field: "AgentId", - reason: "value length must be at least 36 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if len(errors) > 0 { - return GetAgentRequestMultiError(errors) - } - - return nil -} - -// GetAgentRequestMultiError is an error wrapping multiple validation errors -// returned by GetAgentRequest.ValidateAll() if the designated constraints -// aren't met. -type GetAgentRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m GetAgentRequestMultiError) 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 GetAgentRequestMultiError) AllErrors() []error { return m } - -// GetAgentRequestValidationError is the validation error returned by -// GetAgentRequest.Validate if the designated constraints aren't met. -type GetAgentRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e GetAgentRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e GetAgentRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e GetAgentRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e GetAgentRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e GetAgentRequestValidationError) ErrorName() string { return "GetAgentRequestValidationError" } - -// Error satisfies the builtin error interface -func (e GetAgentRequestValidationError) 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 %sGetAgentRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = GetAgentRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = GetAgentRequestValidationError{} - -// Validate checks the field values on GetAgentResponse 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 *GetAgentResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on GetAgentResponse 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 -// GetAgentResponseMultiError, or nil if none found. -func (m *GetAgentResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *GetAgentResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - switch v := m.Agent.(type) { - case *GetAgentResponse_PmmAgent: - if v == nil { - err := GetAgentResponseValidationError{ - field: "Agent", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetPmmAgent()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GetAgentResponseValidationError{ - field: "PmmAgent", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GetAgentResponseValidationError{ - field: "PmmAgent", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetPmmAgent()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GetAgentResponseValidationError{ - field: "PmmAgent", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *GetAgentResponse_Vmagent: - if v == nil { - err := GetAgentResponseValidationError{ - field: "Agent", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetVmagent()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GetAgentResponseValidationError{ - field: "Vmagent", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GetAgentResponseValidationError{ - field: "Vmagent", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetVmagent()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GetAgentResponseValidationError{ - field: "Vmagent", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *GetAgentResponse_NodeExporter: - if v == nil { - err := GetAgentResponseValidationError{ - field: "Agent", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetNodeExporter()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GetAgentResponseValidationError{ - field: "NodeExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GetAgentResponseValidationError{ - field: "NodeExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetNodeExporter()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GetAgentResponseValidationError{ - field: "NodeExporter", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *GetAgentResponse_MysqldExporter: - if v == nil { - err := GetAgentResponseValidationError{ - field: "Agent", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetMysqldExporter()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GetAgentResponseValidationError{ - field: "MysqldExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GetAgentResponseValidationError{ - field: "MysqldExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMysqldExporter()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GetAgentResponseValidationError{ - field: "MysqldExporter", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *GetAgentResponse_MongodbExporter: - if v == nil { - err := GetAgentResponseValidationError{ - field: "Agent", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetMongodbExporter()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GetAgentResponseValidationError{ - field: "MongodbExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GetAgentResponseValidationError{ - field: "MongodbExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMongodbExporter()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GetAgentResponseValidationError{ - field: "MongodbExporter", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *GetAgentResponse_PostgresExporter: - if v == nil { - err := GetAgentResponseValidationError{ - field: "Agent", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetPostgresExporter()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GetAgentResponseValidationError{ - field: "PostgresExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GetAgentResponseValidationError{ - field: "PostgresExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetPostgresExporter()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GetAgentResponseValidationError{ - field: "PostgresExporter", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *GetAgentResponse_ProxysqlExporter: - if v == nil { - err := GetAgentResponseValidationError{ - field: "Agent", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetProxysqlExporter()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GetAgentResponseValidationError{ - field: "ProxysqlExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GetAgentResponseValidationError{ - field: "ProxysqlExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetProxysqlExporter()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GetAgentResponseValidationError{ - field: "ProxysqlExporter", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *GetAgentResponse_QanMysqlPerfschemaAgent: - if v == nil { - err := GetAgentResponseValidationError{ - field: "Agent", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetQanMysqlPerfschemaAgent()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GetAgentResponseValidationError{ - field: "QanMysqlPerfschemaAgent", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GetAgentResponseValidationError{ - field: "QanMysqlPerfschemaAgent", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetQanMysqlPerfschemaAgent()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GetAgentResponseValidationError{ - field: "QanMysqlPerfschemaAgent", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *GetAgentResponse_QanMysqlSlowlogAgent: - if v == nil { - err := GetAgentResponseValidationError{ - field: "Agent", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetQanMysqlSlowlogAgent()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GetAgentResponseValidationError{ - field: "QanMysqlSlowlogAgent", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GetAgentResponseValidationError{ - field: "QanMysqlSlowlogAgent", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetQanMysqlSlowlogAgent()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GetAgentResponseValidationError{ - field: "QanMysqlSlowlogAgent", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *GetAgentResponse_QanMongodbProfilerAgent: - if v == nil { - err := GetAgentResponseValidationError{ - field: "Agent", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetQanMongodbProfilerAgent()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GetAgentResponseValidationError{ - field: "QanMongodbProfilerAgent", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GetAgentResponseValidationError{ - field: "QanMongodbProfilerAgent", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetQanMongodbProfilerAgent()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GetAgentResponseValidationError{ - field: "QanMongodbProfilerAgent", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *GetAgentResponse_QanMongodbMongologAgent: - if v == nil { - err := GetAgentResponseValidationError{ - field: "Agent", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetQanMongodbMongologAgent()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GetAgentResponseValidationError{ - field: "QanMongodbMongologAgent", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GetAgentResponseValidationError{ - field: "QanMongodbMongologAgent", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetQanMongodbMongologAgent()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GetAgentResponseValidationError{ - field: "QanMongodbMongologAgent", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *GetAgentResponse_QanPostgresqlPgstatementsAgent: - if v == nil { - err := GetAgentResponseValidationError{ - field: "Agent", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetQanPostgresqlPgstatementsAgent()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GetAgentResponseValidationError{ - field: "QanPostgresqlPgstatementsAgent", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GetAgentResponseValidationError{ - field: "QanPostgresqlPgstatementsAgent", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetQanPostgresqlPgstatementsAgent()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GetAgentResponseValidationError{ - field: "QanPostgresqlPgstatementsAgent", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *GetAgentResponse_QanPostgresqlPgstatmonitorAgent: - if v == nil { - err := GetAgentResponseValidationError{ - field: "Agent", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetQanPostgresqlPgstatmonitorAgent()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GetAgentResponseValidationError{ - field: "QanPostgresqlPgstatmonitorAgent", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GetAgentResponseValidationError{ - field: "QanPostgresqlPgstatmonitorAgent", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetQanPostgresqlPgstatmonitorAgent()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GetAgentResponseValidationError{ - field: "QanPostgresqlPgstatmonitorAgent", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *GetAgentResponse_ExternalExporter: - if v == nil { - err := GetAgentResponseValidationError{ - field: "Agent", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetExternalExporter()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GetAgentResponseValidationError{ - field: "ExternalExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GetAgentResponseValidationError{ - field: "ExternalExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetExternalExporter()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GetAgentResponseValidationError{ - field: "ExternalExporter", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *GetAgentResponse_RdsExporter: - if v == nil { - err := GetAgentResponseValidationError{ - field: "Agent", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetRdsExporter()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GetAgentResponseValidationError{ - field: "RdsExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GetAgentResponseValidationError{ - field: "RdsExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetRdsExporter()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GetAgentResponseValidationError{ - field: "RdsExporter", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *GetAgentResponse_AzureDatabaseExporter: - if v == nil { - err := GetAgentResponseValidationError{ - field: "Agent", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetAzureDatabaseExporter()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GetAgentResponseValidationError{ - field: "AzureDatabaseExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GetAgentResponseValidationError{ - field: "AzureDatabaseExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetAzureDatabaseExporter()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GetAgentResponseValidationError{ - field: "AzureDatabaseExporter", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *GetAgentResponse_NomadAgent: - if v == nil { - err := GetAgentResponseValidationError{ - field: "Agent", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetNomadAgent()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GetAgentResponseValidationError{ - field: "NomadAgent", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GetAgentResponseValidationError{ - field: "NomadAgent", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetNomadAgent()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GetAgentResponseValidationError{ - field: "NomadAgent", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *GetAgentResponse_ValkeyExporter: - if v == nil { - err := GetAgentResponseValidationError{ - field: "Agent", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetValkeyExporter()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GetAgentResponseValidationError{ - field: "ValkeyExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GetAgentResponseValidationError{ - field: "ValkeyExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetValkeyExporter()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GetAgentResponseValidationError{ - field: "ValkeyExporter", - reason: "embedded message failed validation", - cause: err, - } - } - } - - default: - _ = v // ensures v is used - } - - if len(errors) > 0 { - return GetAgentResponseMultiError(errors) - } - - return nil -} - -// GetAgentResponseMultiError is an error wrapping multiple validation errors -// returned by GetAgentResponse.ValidateAll() if the designated constraints -// aren't met. -type GetAgentResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m GetAgentResponseMultiError) 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 GetAgentResponseMultiError) AllErrors() []error { return m } - -// GetAgentResponseValidationError is the validation error returned by -// GetAgentResponse.Validate if the designated constraints aren't met. -type GetAgentResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e GetAgentResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e GetAgentResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e GetAgentResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e GetAgentResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e GetAgentResponseValidationError) ErrorName() string { return "GetAgentResponseValidationError" } - -// Error satisfies the builtin error interface -func (e GetAgentResponseValidationError) 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 %sGetAgentResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = GetAgentResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = GetAgentResponseValidationError{} - -// Validate checks the field values on GetAgentLogsRequest 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 *GetAgentLogsRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on GetAgentLogsRequest 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 -// GetAgentLogsRequestMultiError, or nil if none found. -func (m *GetAgentLogsRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *GetAgentLogsRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetAgentId()) < 36 { - err := GetAgentLogsRequestValidationError{ - field: "AgentId", - reason: "value length must be at least 36 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for Limit - - if len(errors) > 0 { - return GetAgentLogsRequestMultiError(errors) - } - - return nil -} - -// GetAgentLogsRequestMultiError is an error wrapping multiple validation -// errors returned by GetAgentLogsRequest.ValidateAll() if the designated -// constraints aren't met. -type GetAgentLogsRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m GetAgentLogsRequestMultiError) 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 GetAgentLogsRequestMultiError) AllErrors() []error { return m } - -// GetAgentLogsRequestValidationError is the validation error returned by -// GetAgentLogsRequest.Validate if the designated constraints aren't met. -type GetAgentLogsRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e GetAgentLogsRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e GetAgentLogsRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e GetAgentLogsRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e GetAgentLogsRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e GetAgentLogsRequestValidationError) ErrorName() string { - return "GetAgentLogsRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e GetAgentLogsRequestValidationError) 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 %sGetAgentLogsRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = GetAgentLogsRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = GetAgentLogsRequestValidationError{} - -// Validate checks the field values on GetAgentLogsResponse 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 *GetAgentLogsResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on GetAgentLogsResponse 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 -// GetAgentLogsResponseMultiError, or nil if none found. -func (m *GetAgentLogsResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *GetAgentLogsResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for AgentConfigLogLinesCount - - if len(errors) > 0 { - return GetAgentLogsResponseMultiError(errors) - } - - return nil -} - -// GetAgentLogsResponseMultiError is an error wrapping multiple validation -// errors returned by GetAgentLogsResponse.ValidateAll() if the designated -// constraints aren't met. -type GetAgentLogsResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m GetAgentLogsResponseMultiError) 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 GetAgentLogsResponseMultiError) AllErrors() []error { return m } - -// GetAgentLogsResponseValidationError is the validation error returned by -// GetAgentLogsResponse.Validate if the designated constraints aren't met. -type GetAgentLogsResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e GetAgentLogsResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e GetAgentLogsResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e GetAgentLogsResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e GetAgentLogsResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e GetAgentLogsResponseValidationError) ErrorName() string { - return "GetAgentLogsResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e GetAgentLogsResponseValidationError) 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 %sGetAgentLogsResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = GetAgentLogsResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = GetAgentLogsResponseValidationError{} - -// Validate checks the field values on AddAgentRequest 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 *AddAgentRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on AddAgentRequest 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 -// AddAgentRequestMultiError, or nil if none found. -func (m *AddAgentRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *AddAgentRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - switch v := m.Agent.(type) { - case *AddAgentRequest_PmmAgent: - if v == nil { - err := AddAgentRequestValidationError{ - field: "Agent", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetPmmAgent()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AddAgentRequestValidationError{ - field: "PmmAgent", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AddAgentRequestValidationError{ - field: "PmmAgent", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetPmmAgent()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AddAgentRequestValidationError{ - field: "PmmAgent", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *AddAgentRequest_NodeExporter: - if v == nil { - err := AddAgentRequestValidationError{ - field: "Agent", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetNodeExporter()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AddAgentRequestValidationError{ - field: "NodeExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AddAgentRequestValidationError{ - field: "NodeExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetNodeExporter()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AddAgentRequestValidationError{ - field: "NodeExporter", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *AddAgentRequest_MysqldExporter: - if v == nil { - err := AddAgentRequestValidationError{ - field: "Agent", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetMysqldExporter()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AddAgentRequestValidationError{ - field: "MysqldExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AddAgentRequestValidationError{ - field: "MysqldExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMysqldExporter()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AddAgentRequestValidationError{ - field: "MysqldExporter", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *AddAgentRequest_MongodbExporter: - if v == nil { - err := AddAgentRequestValidationError{ - field: "Agent", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetMongodbExporter()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AddAgentRequestValidationError{ - field: "MongodbExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AddAgentRequestValidationError{ - field: "MongodbExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMongodbExporter()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AddAgentRequestValidationError{ - field: "MongodbExporter", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *AddAgentRequest_PostgresExporter: - if v == nil { - err := AddAgentRequestValidationError{ - field: "Agent", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetPostgresExporter()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AddAgentRequestValidationError{ - field: "PostgresExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AddAgentRequestValidationError{ - field: "PostgresExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetPostgresExporter()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AddAgentRequestValidationError{ - field: "PostgresExporter", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *AddAgentRequest_ProxysqlExporter: - if v == nil { - err := AddAgentRequestValidationError{ - field: "Agent", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetProxysqlExporter()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AddAgentRequestValidationError{ - field: "ProxysqlExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AddAgentRequestValidationError{ - field: "ProxysqlExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetProxysqlExporter()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AddAgentRequestValidationError{ - field: "ProxysqlExporter", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *AddAgentRequest_ExternalExporter: - if v == nil { - err := AddAgentRequestValidationError{ - field: "Agent", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetExternalExporter()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AddAgentRequestValidationError{ - field: "ExternalExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AddAgentRequestValidationError{ - field: "ExternalExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetExternalExporter()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AddAgentRequestValidationError{ - field: "ExternalExporter", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *AddAgentRequest_RdsExporter: - if v == nil { - err := AddAgentRequestValidationError{ - field: "Agent", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetRdsExporter()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AddAgentRequestValidationError{ - field: "RdsExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AddAgentRequestValidationError{ - field: "RdsExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetRdsExporter()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AddAgentRequestValidationError{ - field: "RdsExporter", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *AddAgentRequest_AzureDatabaseExporter: - if v == nil { - err := AddAgentRequestValidationError{ - field: "Agent", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetAzureDatabaseExporter()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AddAgentRequestValidationError{ - field: "AzureDatabaseExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AddAgentRequestValidationError{ - field: "AzureDatabaseExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetAzureDatabaseExporter()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AddAgentRequestValidationError{ - field: "AzureDatabaseExporter", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *AddAgentRequest_QanMysqlPerfschemaAgent: - if v == nil { - err := AddAgentRequestValidationError{ - field: "Agent", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetQanMysqlPerfschemaAgent()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AddAgentRequestValidationError{ - field: "QanMysqlPerfschemaAgent", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AddAgentRequestValidationError{ - field: "QanMysqlPerfschemaAgent", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetQanMysqlPerfschemaAgent()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AddAgentRequestValidationError{ - field: "QanMysqlPerfschemaAgent", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *AddAgentRequest_QanMysqlSlowlogAgent: - if v == nil { - err := AddAgentRequestValidationError{ - field: "Agent", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetQanMysqlSlowlogAgent()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AddAgentRequestValidationError{ - field: "QanMysqlSlowlogAgent", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AddAgentRequestValidationError{ - field: "QanMysqlSlowlogAgent", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetQanMysqlSlowlogAgent()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AddAgentRequestValidationError{ - field: "QanMysqlSlowlogAgent", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *AddAgentRequest_QanMongodbProfilerAgent: - if v == nil { - err := AddAgentRequestValidationError{ - field: "Agent", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetQanMongodbProfilerAgent()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AddAgentRequestValidationError{ - field: "QanMongodbProfilerAgent", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AddAgentRequestValidationError{ - field: "QanMongodbProfilerAgent", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetQanMongodbProfilerAgent()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AddAgentRequestValidationError{ - field: "QanMongodbProfilerAgent", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *AddAgentRequest_QanMongodbMongologAgent: - if v == nil { - err := AddAgentRequestValidationError{ - field: "Agent", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetQanMongodbMongologAgent()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AddAgentRequestValidationError{ - field: "QanMongodbMongologAgent", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AddAgentRequestValidationError{ - field: "QanMongodbMongologAgent", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetQanMongodbMongologAgent()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AddAgentRequestValidationError{ - field: "QanMongodbMongologAgent", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *AddAgentRequest_QanPostgresqlPgstatementsAgent: - if v == nil { - err := AddAgentRequestValidationError{ - field: "Agent", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetQanPostgresqlPgstatementsAgent()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AddAgentRequestValidationError{ - field: "QanPostgresqlPgstatementsAgent", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AddAgentRequestValidationError{ - field: "QanPostgresqlPgstatementsAgent", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetQanPostgresqlPgstatementsAgent()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AddAgentRequestValidationError{ - field: "QanPostgresqlPgstatementsAgent", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *AddAgentRequest_QanPostgresqlPgstatmonitorAgent: - if v == nil { - err := AddAgentRequestValidationError{ - field: "Agent", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetQanPostgresqlPgstatmonitorAgent()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AddAgentRequestValidationError{ - field: "QanPostgresqlPgstatmonitorAgent", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AddAgentRequestValidationError{ - field: "QanPostgresqlPgstatmonitorAgent", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetQanPostgresqlPgstatmonitorAgent()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AddAgentRequestValidationError{ - field: "QanPostgresqlPgstatmonitorAgent", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *AddAgentRequest_ValkeyExporter: - if v == nil { - err := AddAgentRequestValidationError{ - field: "Agent", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetValkeyExporter()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AddAgentRequestValidationError{ - field: "ValkeyExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AddAgentRequestValidationError{ - field: "ValkeyExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetValkeyExporter()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AddAgentRequestValidationError{ - field: "ValkeyExporter", - reason: "embedded message failed validation", - cause: err, - } - } - } - - default: - _ = v // ensures v is used - } - - if len(errors) > 0 { - return AddAgentRequestMultiError(errors) - } - - return nil -} - -// AddAgentRequestMultiError is an error wrapping multiple validation errors -// returned by AddAgentRequest.ValidateAll() if the designated constraints -// aren't met. -type AddAgentRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m AddAgentRequestMultiError) 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 AddAgentRequestMultiError) AllErrors() []error { return m } - -// AddAgentRequestValidationError is the validation error returned by -// AddAgentRequest.Validate if the designated constraints aren't met. -type AddAgentRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e AddAgentRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e AddAgentRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e AddAgentRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e AddAgentRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e AddAgentRequestValidationError) ErrorName() string { return "AddAgentRequestValidationError" } - -// Error satisfies the builtin error interface -func (e AddAgentRequestValidationError) 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 %sAddAgentRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = AddAgentRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = AddAgentRequestValidationError{} - -// Validate checks the field values on AddAgentResponse 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 *AddAgentResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on AddAgentResponse 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 -// AddAgentResponseMultiError, or nil if none found. -func (m *AddAgentResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *AddAgentResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - switch v := m.Agent.(type) { - case *AddAgentResponse_PmmAgent: - if v == nil { - err := AddAgentResponseValidationError{ - field: "Agent", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetPmmAgent()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AddAgentResponseValidationError{ - field: "PmmAgent", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AddAgentResponseValidationError{ - field: "PmmAgent", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetPmmAgent()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AddAgentResponseValidationError{ - field: "PmmAgent", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *AddAgentResponse_NodeExporter: - if v == nil { - err := AddAgentResponseValidationError{ - field: "Agent", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetNodeExporter()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AddAgentResponseValidationError{ - field: "NodeExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AddAgentResponseValidationError{ - field: "NodeExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetNodeExporter()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AddAgentResponseValidationError{ - field: "NodeExporter", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *AddAgentResponse_MysqldExporter: - if v == nil { - err := AddAgentResponseValidationError{ - field: "Agent", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetMysqldExporter()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AddAgentResponseValidationError{ - field: "MysqldExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AddAgentResponseValidationError{ - field: "MysqldExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMysqldExporter()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AddAgentResponseValidationError{ - field: "MysqldExporter", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *AddAgentResponse_MongodbExporter: - if v == nil { - err := AddAgentResponseValidationError{ - field: "Agent", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetMongodbExporter()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AddAgentResponseValidationError{ - field: "MongodbExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AddAgentResponseValidationError{ - field: "MongodbExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMongodbExporter()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AddAgentResponseValidationError{ - field: "MongodbExporter", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *AddAgentResponse_PostgresExporter: - if v == nil { - err := AddAgentResponseValidationError{ - field: "Agent", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetPostgresExporter()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AddAgentResponseValidationError{ - field: "PostgresExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AddAgentResponseValidationError{ - field: "PostgresExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetPostgresExporter()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AddAgentResponseValidationError{ - field: "PostgresExporter", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *AddAgentResponse_ProxysqlExporter: - if v == nil { - err := AddAgentResponseValidationError{ - field: "Agent", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetProxysqlExporter()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AddAgentResponseValidationError{ - field: "ProxysqlExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AddAgentResponseValidationError{ - field: "ProxysqlExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetProxysqlExporter()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AddAgentResponseValidationError{ - field: "ProxysqlExporter", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *AddAgentResponse_ExternalExporter: - if v == nil { - err := AddAgentResponseValidationError{ - field: "Agent", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetExternalExporter()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AddAgentResponseValidationError{ - field: "ExternalExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AddAgentResponseValidationError{ - field: "ExternalExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetExternalExporter()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AddAgentResponseValidationError{ - field: "ExternalExporter", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *AddAgentResponse_RdsExporter: - if v == nil { - err := AddAgentResponseValidationError{ - field: "Agent", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetRdsExporter()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AddAgentResponseValidationError{ - field: "RdsExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AddAgentResponseValidationError{ - field: "RdsExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetRdsExporter()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AddAgentResponseValidationError{ - field: "RdsExporter", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *AddAgentResponse_AzureDatabaseExporter: - if v == nil { - err := AddAgentResponseValidationError{ - field: "Agent", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetAzureDatabaseExporter()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AddAgentResponseValidationError{ - field: "AzureDatabaseExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AddAgentResponseValidationError{ - field: "AzureDatabaseExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetAzureDatabaseExporter()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AddAgentResponseValidationError{ - field: "AzureDatabaseExporter", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *AddAgentResponse_QanMysqlPerfschemaAgent: - if v == nil { - err := AddAgentResponseValidationError{ - field: "Agent", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetQanMysqlPerfschemaAgent()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AddAgentResponseValidationError{ - field: "QanMysqlPerfschemaAgent", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AddAgentResponseValidationError{ - field: "QanMysqlPerfschemaAgent", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetQanMysqlPerfschemaAgent()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AddAgentResponseValidationError{ - field: "QanMysqlPerfschemaAgent", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *AddAgentResponse_QanMysqlSlowlogAgent: - if v == nil { - err := AddAgentResponseValidationError{ - field: "Agent", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetQanMysqlSlowlogAgent()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AddAgentResponseValidationError{ - field: "QanMysqlSlowlogAgent", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AddAgentResponseValidationError{ - field: "QanMysqlSlowlogAgent", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetQanMysqlSlowlogAgent()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AddAgentResponseValidationError{ - field: "QanMysqlSlowlogAgent", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *AddAgentResponse_QanMongodbProfilerAgent: - if v == nil { - err := AddAgentResponseValidationError{ - field: "Agent", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetQanMongodbProfilerAgent()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AddAgentResponseValidationError{ - field: "QanMongodbProfilerAgent", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AddAgentResponseValidationError{ - field: "QanMongodbProfilerAgent", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetQanMongodbProfilerAgent()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AddAgentResponseValidationError{ - field: "QanMongodbProfilerAgent", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *AddAgentResponse_QanMongodbMongologAgent: - if v == nil { - err := AddAgentResponseValidationError{ - field: "Agent", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetQanMongodbMongologAgent()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AddAgentResponseValidationError{ - field: "QanMongodbMongologAgent", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AddAgentResponseValidationError{ - field: "QanMongodbMongologAgent", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetQanMongodbMongologAgent()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AddAgentResponseValidationError{ - field: "QanMongodbMongologAgent", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *AddAgentResponse_QanPostgresqlPgstatementsAgent: - if v == nil { - err := AddAgentResponseValidationError{ - field: "Agent", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetQanPostgresqlPgstatementsAgent()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AddAgentResponseValidationError{ - field: "QanPostgresqlPgstatementsAgent", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AddAgentResponseValidationError{ - field: "QanPostgresqlPgstatementsAgent", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetQanPostgresqlPgstatementsAgent()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AddAgentResponseValidationError{ - field: "QanPostgresqlPgstatementsAgent", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *AddAgentResponse_QanPostgresqlPgstatmonitorAgent: - if v == nil { - err := AddAgentResponseValidationError{ - field: "Agent", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetQanPostgresqlPgstatmonitorAgent()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AddAgentResponseValidationError{ - field: "QanPostgresqlPgstatmonitorAgent", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AddAgentResponseValidationError{ - field: "QanPostgresqlPgstatmonitorAgent", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetQanPostgresqlPgstatmonitorAgent()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AddAgentResponseValidationError{ - field: "QanPostgresqlPgstatmonitorAgent", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *AddAgentResponse_ValkeyExporter: - if v == nil { - err := AddAgentResponseValidationError{ - field: "Agent", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetValkeyExporter()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AddAgentResponseValidationError{ - field: "ValkeyExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AddAgentResponseValidationError{ - field: "ValkeyExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetValkeyExporter()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AddAgentResponseValidationError{ - field: "ValkeyExporter", - reason: "embedded message failed validation", - cause: err, - } - } - } - - default: - _ = v // ensures v is used - } - - if len(errors) > 0 { - return AddAgentResponseMultiError(errors) - } - - return nil -} - -// AddAgentResponseMultiError is an error wrapping multiple validation errors -// returned by AddAgentResponse.ValidateAll() if the designated constraints -// aren't met. -type AddAgentResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m AddAgentResponseMultiError) 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 AddAgentResponseMultiError) AllErrors() []error { return m } - -// AddAgentResponseValidationError is the validation error returned by -// AddAgentResponse.Validate if the designated constraints aren't met. -type AddAgentResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e AddAgentResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e AddAgentResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e AddAgentResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e AddAgentResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e AddAgentResponseValidationError) ErrorName() string { return "AddAgentResponseValidationError" } - -// Error satisfies the builtin error interface -func (e AddAgentResponseValidationError) 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 %sAddAgentResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = AddAgentResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = AddAgentResponseValidationError{} - -// Validate checks the field values on ChangeAgentRequest 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 *ChangeAgentRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ChangeAgentRequest 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 -// ChangeAgentRequestMultiError, or nil if none found. -func (m *ChangeAgentRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *ChangeAgentRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetAgentId()) < 1 { - err := ChangeAgentRequestValidationError{ - field: "AgentId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - switch v := m.Agent.(type) { - case *ChangeAgentRequest_NodeExporter: - if v == nil { - err := ChangeAgentRequestValidationError{ - field: "Agent", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetNodeExporter()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeAgentRequestValidationError{ - field: "NodeExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeAgentRequestValidationError{ - field: "NodeExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetNodeExporter()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeAgentRequestValidationError{ - field: "NodeExporter", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *ChangeAgentRequest_MysqldExporter: - if v == nil { - err := ChangeAgentRequestValidationError{ - field: "Agent", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetMysqldExporter()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeAgentRequestValidationError{ - field: "MysqldExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeAgentRequestValidationError{ - field: "MysqldExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMysqldExporter()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeAgentRequestValidationError{ - field: "MysqldExporter", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *ChangeAgentRequest_MongodbExporter: - if v == nil { - err := ChangeAgentRequestValidationError{ - field: "Agent", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetMongodbExporter()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeAgentRequestValidationError{ - field: "MongodbExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeAgentRequestValidationError{ - field: "MongodbExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMongodbExporter()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeAgentRequestValidationError{ - field: "MongodbExporter", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *ChangeAgentRequest_PostgresExporter: - if v == nil { - err := ChangeAgentRequestValidationError{ - field: "Agent", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetPostgresExporter()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeAgentRequestValidationError{ - field: "PostgresExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeAgentRequestValidationError{ - field: "PostgresExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetPostgresExporter()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeAgentRequestValidationError{ - field: "PostgresExporter", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *ChangeAgentRequest_ProxysqlExporter: - if v == nil { - err := ChangeAgentRequestValidationError{ - field: "Agent", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetProxysqlExporter()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeAgentRequestValidationError{ - field: "ProxysqlExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeAgentRequestValidationError{ - field: "ProxysqlExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetProxysqlExporter()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeAgentRequestValidationError{ - field: "ProxysqlExporter", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *ChangeAgentRequest_ExternalExporter: - if v == nil { - err := ChangeAgentRequestValidationError{ - field: "Agent", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetExternalExporter()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeAgentRequestValidationError{ - field: "ExternalExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeAgentRequestValidationError{ - field: "ExternalExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetExternalExporter()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeAgentRequestValidationError{ - field: "ExternalExporter", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *ChangeAgentRequest_RdsExporter: - if v == nil { - err := ChangeAgentRequestValidationError{ - field: "Agent", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetRdsExporter()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeAgentRequestValidationError{ - field: "RdsExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeAgentRequestValidationError{ - field: "RdsExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetRdsExporter()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeAgentRequestValidationError{ - field: "RdsExporter", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *ChangeAgentRequest_AzureDatabaseExporter: - if v == nil { - err := ChangeAgentRequestValidationError{ - field: "Agent", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetAzureDatabaseExporter()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeAgentRequestValidationError{ - field: "AzureDatabaseExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeAgentRequestValidationError{ - field: "AzureDatabaseExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetAzureDatabaseExporter()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeAgentRequestValidationError{ - field: "AzureDatabaseExporter", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *ChangeAgentRequest_QanMysqlPerfschemaAgent: - if v == nil { - err := ChangeAgentRequestValidationError{ - field: "Agent", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetQanMysqlPerfschemaAgent()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeAgentRequestValidationError{ - field: "QanMysqlPerfschemaAgent", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeAgentRequestValidationError{ - field: "QanMysqlPerfschemaAgent", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetQanMysqlPerfschemaAgent()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeAgentRequestValidationError{ - field: "QanMysqlPerfschemaAgent", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *ChangeAgentRequest_QanMysqlSlowlogAgent: - if v == nil { - err := ChangeAgentRequestValidationError{ - field: "Agent", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetQanMysqlSlowlogAgent()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeAgentRequestValidationError{ - field: "QanMysqlSlowlogAgent", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeAgentRequestValidationError{ - field: "QanMysqlSlowlogAgent", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetQanMysqlSlowlogAgent()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeAgentRequestValidationError{ - field: "QanMysqlSlowlogAgent", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *ChangeAgentRequest_QanMongodbProfilerAgent: - if v == nil { - err := ChangeAgentRequestValidationError{ - field: "Agent", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetQanMongodbProfilerAgent()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeAgentRequestValidationError{ - field: "QanMongodbProfilerAgent", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeAgentRequestValidationError{ - field: "QanMongodbProfilerAgent", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetQanMongodbProfilerAgent()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeAgentRequestValidationError{ - field: "QanMongodbProfilerAgent", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *ChangeAgentRequest_QanMongodbMongologAgent: - if v == nil { - err := ChangeAgentRequestValidationError{ - field: "Agent", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetQanMongodbMongologAgent()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeAgentRequestValidationError{ - field: "QanMongodbMongologAgent", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeAgentRequestValidationError{ - field: "QanMongodbMongologAgent", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetQanMongodbMongologAgent()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeAgentRequestValidationError{ - field: "QanMongodbMongologAgent", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *ChangeAgentRequest_QanPostgresqlPgstatementsAgent: - if v == nil { - err := ChangeAgentRequestValidationError{ - field: "Agent", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetQanPostgresqlPgstatementsAgent()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeAgentRequestValidationError{ - field: "QanPostgresqlPgstatementsAgent", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeAgentRequestValidationError{ - field: "QanPostgresqlPgstatementsAgent", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetQanPostgresqlPgstatementsAgent()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeAgentRequestValidationError{ - field: "QanPostgresqlPgstatementsAgent", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *ChangeAgentRequest_QanPostgresqlPgstatmonitorAgent: - if v == nil { - err := ChangeAgentRequestValidationError{ - field: "Agent", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetQanPostgresqlPgstatmonitorAgent()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeAgentRequestValidationError{ - field: "QanPostgresqlPgstatmonitorAgent", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeAgentRequestValidationError{ - field: "QanPostgresqlPgstatmonitorAgent", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetQanPostgresqlPgstatmonitorAgent()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeAgentRequestValidationError{ - field: "QanPostgresqlPgstatmonitorAgent", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *ChangeAgentRequest_NomadAgent: - if v == nil { - err := ChangeAgentRequestValidationError{ - field: "Agent", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetNomadAgent()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeAgentRequestValidationError{ - field: "NomadAgent", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeAgentRequestValidationError{ - field: "NomadAgent", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetNomadAgent()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeAgentRequestValidationError{ - field: "NomadAgent", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *ChangeAgentRequest_ValkeyExporter: - if v == nil { - err := ChangeAgentRequestValidationError{ - field: "Agent", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetValkeyExporter()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeAgentRequestValidationError{ - field: "ValkeyExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeAgentRequestValidationError{ - field: "ValkeyExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetValkeyExporter()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeAgentRequestValidationError{ - field: "ValkeyExporter", - reason: "embedded message failed validation", - cause: err, - } - } - } - - default: - _ = v // ensures v is used - } - - if len(errors) > 0 { - return ChangeAgentRequestMultiError(errors) - } - - return nil -} - -// ChangeAgentRequestMultiError is an error wrapping multiple validation errors -// returned by ChangeAgentRequest.ValidateAll() if the designated constraints -// aren't met. -type ChangeAgentRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ChangeAgentRequestMultiError) 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 ChangeAgentRequestMultiError) AllErrors() []error { return m } - -// ChangeAgentRequestValidationError is the validation error returned by -// ChangeAgentRequest.Validate if the designated constraints aren't met. -type ChangeAgentRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ChangeAgentRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ChangeAgentRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ChangeAgentRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ChangeAgentRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ChangeAgentRequestValidationError) ErrorName() string { - return "ChangeAgentRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e ChangeAgentRequestValidationError) 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 %sChangeAgentRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ChangeAgentRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ChangeAgentRequestValidationError{} - -// Validate checks the field values on ChangeAgentResponse 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 *ChangeAgentResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ChangeAgentResponse 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 -// ChangeAgentResponseMultiError, or nil if none found. -func (m *ChangeAgentResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *ChangeAgentResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - switch v := m.Agent.(type) { - case *ChangeAgentResponse_NodeExporter: - if v == nil { - err := ChangeAgentResponseValidationError{ - field: "Agent", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetNodeExporter()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeAgentResponseValidationError{ - field: "NodeExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeAgentResponseValidationError{ - field: "NodeExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetNodeExporter()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeAgentResponseValidationError{ - field: "NodeExporter", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *ChangeAgentResponse_MysqldExporter: - if v == nil { - err := ChangeAgentResponseValidationError{ - field: "Agent", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetMysqldExporter()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeAgentResponseValidationError{ - field: "MysqldExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeAgentResponseValidationError{ - field: "MysqldExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMysqldExporter()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeAgentResponseValidationError{ - field: "MysqldExporter", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *ChangeAgentResponse_MongodbExporter: - if v == nil { - err := ChangeAgentResponseValidationError{ - field: "Agent", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetMongodbExporter()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeAgentResponseValidationError{ - field: "MongodbExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeAgentResponseValidationError{ - field: "MongodbExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMongodbExporter()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeAgentResponseValidationError{ - field: "MongodbExporter", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *ChangeAgentResponse_PostgresExporter: - if v == nil { - err := ChangeAgentResponseValidationError{ - field: "Agent", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetPostgresExporter()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeAgentResponseValidationError{ - field: "PostgresExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeAgentResponseValidationError{ - field: "PostgresExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetPostgresExporter()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeAgentResponseValidationError{ - field: "PostgresExporter", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *ChangeAgentResponse_ProxysqlExporter: - if v == nil { - err := ChangeAgentResponseValidationError{ - field: "Agent", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetProxysqlExporter()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeAgentResponseValidationError{ - field: "ProxysqlExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeAgentResponseValidationError{ - field: "ProxysqlExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetProxysqlExporter()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeAgentResponseValidationError{ - field: "ProxysqlExporter", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *ChangeAgentResponse_ExternalExporter: - if v == nil { - err := ChangeAgentResponseValidationError{ - field: "Agent", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetExternalExporter()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeAgentResponseValidationError{ - field: "ExternalExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeAgentResponseValidationError{ - field: "ExternalExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetExternalExporter()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeAgentResponseValidationError{ - field: "ExternalExporter", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *ChangeAgentResponse_RdsExporter: - if v == nil { - err := ChangeAgentResponseValidationError{ - field: "Agent", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetRdsExporter()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeAgentResponseValidationError{ - field: "RdsExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeAgentResponseValidationError{ - field: "RdsExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetRdsExporter()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeAgentResponseValidationError{ - field: "RdsExporter", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *ChangeAgentResponse_AzureDatabaseExporter: - if v == nil { - err := ChangeAgentResponseValidationError{ - field: "Agent", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetAzureDatabaseExporter()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeAgentResponseValidationError{ - field: "AzureDatabaseExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeAgentResponseValidationError{ - field: "AzureDatabaseExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetAzureDatabaseExporter()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeAgentResponseValidationError{ - field: "AzureDatabaseExporter", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *ChangeAgentResponse_QanMysqlPerfschemaAgent: - if v == nil { - err := ChangeAgentResponseValidationError{ - field: "Agent", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetQanMysqlPerfschemaAgent()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeAgentResponseValidationError{ - field: "QanMysqlPerfschemaAgent", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeAgentResponseValidationError{ - field: "QanMysqlPerfschemaAgent", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetQanMysqlPerfschemaAgent()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeAgentResponseValidationError{ - field: "QanMysqlPerfschemaAgent", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *ChangeAgentResponse_QanMysqlSlowlogAgent: - if v == nil { - err := ChangeAgentResponseValidationError{ - field: "Agent", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetQanMysqlSlowlogAgent()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeAgentResponseValidationError{ - field: "QanMysqlSlowlogAgent", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeAgentResponseValidationError{ - field: "QanMysqlSlowlogAgent", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetQanMysqlSlowlogAgent()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeAgentResponseValidationError{ - field: "QanMysqlSlowlogAgent", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *ChangeAgentResponse_QanMongodbProfilerAgent: - if v == nil { - err := ChangeAgentResponseValidationError{ - field: "Agent", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetQanMongodbProfilerAgent()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeAgentResponseValidationError{ - field: "QanMongodbProfilerAgent", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeAgentResponseValidationError{ - field: "QanMongodbProfilerAgent", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetQanMongodbProfilerAgent()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeAgentResponseValidationError{ - field: "QanMongodbProfilerAgent", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *ChangeAgentResponse_QanMongodbMongologAgent: - if v == nil { - err := ChangeAgentResponseValidationError{ - field: "Agent", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetQanMongodbMongologAgent()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeAgentResponseValidationError{ - field: "QanMongodbMongologAgent", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeAgentResponseValidationError{ - field: "QanMongodbMongologAgent", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetQanMongodbMongologAgent()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeAgentResponseValidationError{ - field: "QanMongodbMongologAgent", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *ChangeAgentResponse_QanPostgresqlPgstatementsAgent: - if v == nil { - err := ChangeAgentResponseValidationError{ - field: "Agent", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetQanPostgresqlPgstatementsAgent()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeAgentResponseValidationError{ - field: "QanPostgresqlPgstatementsAgent", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeAgentResponseValidationError{ - field: "QanPostgresqlPgstatementsAgent", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetQanPostgresqlPgstatementsAgent()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeAgentResponseValidationError{ - field: "QanPostgresqlPgstatementsAgent", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *ChangeAgentResponse_QanPostgresqlPgstatmonitorAgent: - if v == nil { - err := ChangeAgentResponseValidationError{ - field: "Agent", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetQanPostgresqlPgstatmonitorAgent()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeAgentResponseValidationError{ - field: "QanPostgresqlPgstatmonitorAgent", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeAgentResponseValidationError{ - field: "QanPostgresqlPgstatmonitorAgent", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetQanPostgresqlPgstatmonitorAgent()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeAgentResponseValidationError{ - field: "QanPostgresqlPgstatmonitorAgent", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *ChangeAgentResponse_NomadAgent: - if v == nil { - err := ChangeAgentResponseValidationError{ - field: "Agent", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetNomadAgent()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeAgentResponseValidationError{ - field: "NomadAgent", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeAgentResponseValidationError{ - field: "NomadAgent", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetNomadAgent()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeAgentResponseValidationError{ - field: "NomadAgent", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *ChangeAgentResponse_ValkeyExporter: - if v == nil { - err := ChangeAgentResponseValidationError{ - field: "Agent", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetValkeyExporter()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeAgentResponseValidationError{ - field: "ValkeyExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeAgentResponseValidationError{ - field: "ValkeyExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetValkeyExporter()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeAgentResponseValidationError{ - field: "ValkeyExporter", - reason: "embedded message failed validation", - cause: err, - } - } - } - - default: - _ = v // ensures v is used - } - - if len(errors) > 0 { - return ChangeAgentResponseMultiError(errors) - } - - return nil -} - -// ChangeAgentResponseMultiError is an error wrapping multiple validation -// errors returned by ChangeAgentResponse.ValidateAll() if the designated -// constraints aren't met. -type ChangeAgentResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ChangeAgentResponseMultiError) 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 ChangeAgentResponseMultiError) AllErrors() []error { return m } - -// ChangeAgentResponseValidationError is the validation error returned by -// ChangeAgentResponse.Validate if the designated constraints aren't met. -type ChangeAgentResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ChangeAgentResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ChangeAgentResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ChangeAgentResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ChangeAgentResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ChangeAgentResponseValidationError) ErrorName() string { - return "ChangeAgentResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e ChangeAgentResponseValidationError) 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 %sChangeAgentResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ChangeAgentResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ChangeAgentResponseValidationError{} - -// Validate checks the field values on AddPMMAgentParams 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 *AddPMMAgentParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on AddPMMAgentParams 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 -// AddPMMAgentParamsMultiError, or nil if none found. -func (m *AddPMMAgentParams) ValidateAll() error { - return m.validate(true) -} - -func (m *AddPMMAgentParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetRunsOnNodeId()) < 1 { - err := AddPMMAgentParamsValidationError{ - field: "RunsOnNodeId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for CustomLabels - - if len(errors) > 0 { - return AddPMMAgentParamsMultiError(errors) - } - - return nil -} - -// AddPMMAgentParamsMultiError is an error wrapping multiple validation errors -// returned by AddPMMAgentParams.ValidateAll() if the designated constraints -// aren't met. -type AddPMMAgentParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m AddPMMAgentParamsMultiError) 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 AddPMMAgentParamsMultiError) AllErrors() []error { return m } - -// AddPMMAgentParamsValidationError is the validation error returned by -// AddPMMAgentParams.Validate if the designated constraints aren't met. -type AddPMMAgentParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e AddPMMAgentParamsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e AddPMMAgentParamsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e AddPMMAgentParamsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e AddPMMAgentParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e AddPMMAgentParamsValidationError) ErrorName() string { - return "AddPMMAgentParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e AddPMMAgentParamsValidationError) 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 %sAddPMMAgentParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = AddPMMAgentParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = AddPMMAgentParamsValidationError{} - -// Validate checks the field values on AddNodeExporterParams 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 *AddNodeExporterParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on AddNodeExporterParams 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 -// AddNodeExporterParamsMultiError, or nil if none found. -func (m *AddNodeExporterParams) ValidateAll() error { - return m.validate(true) -} - -func (m *AddNodeExporterParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetPmmAgentId()) < 1 { - err := AddNodeExporterParamsValidationError{ - field: "PmmAgentId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for CustomLabels - - // no validation rules for PushMetrics - - // no validation rules for LogLevel - - // no validation rules for ExposeExporter - - if len(errors) > 0 { - return AddNodeExporterParamsMultiError(errors) - } - - return nil -} - -// AddNodeExporterParamsMultiError is an error wrapping multiple validation -// errors returned by AddNodeExporterParams.ValidateAll() if the designated -// constraints aren't met. -type AddNodeExporterParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m AddNodeExporterParamsMultiError) 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 AddNodeExporterParamsMultiError) AllErrors() []error { return m } - -// AddNodeExporterParamsValidationError is the validation error returned by -// AddNodeExporterParams.Validate if the designated constraints aren't met. -type AddNodeExporterParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e AddNodeExporterParamsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e AddNodeExporterParamsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e AddNodeExporterParamsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e AddNodeExporterParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e AddNodeExporterParamsValidationError) ErrorName() string { - return "AddNodeExporterParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e AddNodeExporterParamsValidationError) 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 %sAddNodeExporterParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = AddNodeExporterParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = AddNodeExporterParamsValidationError{} - -// Validate checks the field values on ChangeNodeExporterParams 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 *ChangeNodeExporterParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ChangeNodeExporterParams 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 -// ChangeNodeExporterParamsMultiError, or nil if none found. -func (m *ChangeNodeExporterParams) ValidateAll() error { - return m.validate(true) -} - -func (m *ChangeNodeExporterParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if all { - switch v := interface{}(m.GetMetricsResolutions()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeNodeExporterParamsValidationError{ - field: "MetricsResolutions", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeNodeExporterParamsValidationError{ - field: "MetricsResolutions", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMetricsResolutions()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeNodeExporterParamsValidationError{ - field: "MetricsResolutions", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if m.Enable != nil { - // no validation rules for Enable - } - - if m.CustomLabels != nil { - if all { - switch v := interface{}(m.GetCustomLabels()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeNodeExporterParamsValidationError{ - field: "CustomLabels", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeNodeExporterParamsValidationError{ - field: "CustomLabels", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetCustomLabels()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeNodeExporterParamsValidationError{ - field: "CustomLabels", - reason: "embedded message failed validation", - cause: err, - } - } - } - } - - if m.EnablePushMetrics != nil { - // no validation rules for EnablePushMetrics - } - - if len(errors) > 0 { - return ChangeNodeExporterParamsMultiError(errors) - } - - return nil -} - -// ChangeNodeExporterParamsMultiError is an error wrapping multiple validation -// errors returned by ChangeNodeExporterParams.ValidateAll() if the designated -// constraints aren't met. -type ChangeNodeExporterParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ChangeNodeExporterParamsMultiError) 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 ChangeNodeExporterParamsMultiError) AllErrors() []error { return m } - -// ChangeNodeExporterParamsValidationError is the validation error returned by -// ChangeNodeExporterParams.Validate if the designated constraints aren't met. -type ChangeNodeExporterParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ChangeNodeExporterParamsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ChangeNodeExporterParamsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ChangeNodeExporterParamsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ChangeNodeExporterParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ChangeNodeExporterParamsValidationError) ErrorName() string { - return "ChangeNodeExporterParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e ChangeNodeExporterParamsValidationError) 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 %sChangeNodeExporterParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ChangeNodeExporterParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ChangeNodeExporterParamsValidationError{} - -// Validate checks the field values on AddMySQLdExporterParams 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 *AddMySQLdExporterParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on AddMySQLdExporterParams 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 -// AddMySQLdExporterParamsMultiError, or nil if none found. -func (m *AddMySQLdExporterParams) ValidateAll() error { - return m.validate(true) -} - -func (m *AddMySQLdExporterParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetPmmAgentId()) < 1 { - err := AddMySQLdExporterParamsValidationError{ - field: "PmmAgentId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if utf8.RuneCountInString(m.GetServiceId()) < 1 { - err := AddMySQLdExporterParamsValidationError{ - field: "ServiceId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if utf8.RuneCountInString(m.GetUsername()) < 1 { - err := AddMySQLdExporterParamsValidationError{ - field: "Username", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for Password - - // no validation rules for Tls - - // no validation rules for TlsSkipVerify - - // no validation rules for TlsCa - - // no validation rules for TlsCert - - // no validation rules for TlsKey - - // no validation rules for TablestatsGroupTableLimit - - // no validation rules for CustomLabels - - // no validation rules for SkipConnectionCheck - - // no validation rules for PushMetrics - - // no validation rules for AgentPassword - - // no validation rules for LogLevel - - // no validation rules for ExposeExporter - - // no validation rules for ExtraDsnParams - - if len(errors) > 0 { - return AddMySQLdExporterParamsMultiError(errors) - } - - return nil -} - -// AddMySQLdExporterParamsMultiError is an error wrapping multiple validation -// errors returned by AddMySQLdExporterParams.ValidateAll() if the designated -// constraints aren't met. -type AddMySQLdExporterParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m AddMySQLdExporterParamsMultiError) 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 AddMySQLdExporterParamsMultiError) AllErrors() []error { return m } - -// AddMySQLdExporterParamsValidationError is the validation error returned by -// AddMySQLdExporterParams.Validate if the designated constraints aren't met. -type AddMySQLdExporterParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e AddMySQLdExporterParamsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e AddMySQLdExporterParamsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e AddMySQLdExporterParamsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e AddMySQLdExporterParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e AddMySQLdExporterParamsValidationError) ErrorName() string { - return "AddMySQLdExporterParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e AddMySQLdExporterParamsValidationError) 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 %sAddMySQLdExporterParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = AddMySQLdExporterParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = AddMySQLdExporterParamsValidationError{} - -// Validate checks the field values on ChangeMySQLdExporterParams 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 *ChangeMySQLdExporterParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ChangeMySQLdExporterParams 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 -// ChangeMySQLdExporterParamsMultiError, or nil if none found. -func (m *ChangeMySQLdExporterParams) ValidateAll() error { - return m.validate(true) -} - -func (m *ChangeMySQLdExporterParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if all { - switch v := interface{}(m.GetMetricsResolutions()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeMySQLdExporterParamsValidationError{ - field: "MetricsResolutions", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeMySQLdExporterParamsValidationError{ - field: "MetricsResolutions", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMetricsResolutions()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeMySQLdExporterParamsValidationError{ - field: "MetricsResolutions", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if m.Enable != nil { - // no validation rules for Enable - } - - if m.CustomLabels != nil { - if all { - switch v := interface{}(m.GetCustomLabels()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeMySQLdExporterParamsValidationError{ - field: "CustomLabels", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeMySQLdExporterParamsValidationError{ - field: "CustomLabels", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetCustomLabels()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeMySQLdExporterParamsValidationError{ - field: "CustomLabels", - reason: "embedded message failed validation", - cause: err, - } - } - } - } - - if m.EnablePushMetrics != nil { - // no validation rules for EnablePushMetrics - } - - if len(errors) > 0 { - return ChangeMySQLdExporterParamsMultiError(errors) - } - - return nil -} - -// ChangeMySQLdExporterParamsMultiError is an error wrapping multiple -// validation errors returned by ChangeMySQLdExporterParams.ValidateAll() if -// the designated constraints aren't met. -type ChangeMySQLdExporterParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ChangeMySQLdExporterParamsMultiError) 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 ChangeMySQLdExporterParamsMultiError) AllErrors() []error { return m } - -// ChangeMySQLdExporterParamsValidationError is the validation error returned -// by ChangeMySQLdExporterParams.Validate if the designated constraints aren't met. -type ChangeMySQLdExporterParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ChangeMySQLdExporterParamsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ChangeMySQLdExporterParamsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ChangeMySQLdExporterParamsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ChangeMySQLdExporterParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ChangeMySQLdExporterParamsValidationError) ErrorName() string { - return "ChangeMySQLdExporterParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e ChangeMySQLdExporterParamsValidationError) 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 %sChangeMySQLdExporterParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ChangeMySQLdExporterParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ChangeMySQLdExporterParamsValidationError{} - -// Validate checks the field values on AddMongoDBExporterParams 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 *AddMongoDBExporterParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on AddMongoDBExporterParams 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 -// AddMongoDBExporterParamsMultiError, or nil if none found. -func (m *AddMongoDBExporterParams) ValidateAll() error { - return m.validate(true) -} - -func (m *AddMongoDBExporterParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetPmmAgentId()) < 1 { - err := AddMongoDBExporterParamsValidationError{ - field: "PmmAgentId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if utf8.RuneCountInString(m.GetServiceId()) < 1 { - err := AddMongoDBExporterParamsValidationError{ - field: "ServiceId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for Username - - // no validation rules for Password - - // no validation rules for Tls - - // no validation rules for TlsSkipVerify - - // no validation rules for TlsCertificateKey - - // no validation rules for TlsCertificateKeyFilePassword - - // no validation rules for TlsCa - - // no validation rules for CustomLabels - - // no validation rules for SkipConnectionCheck - - // no validation rules for PushMetrics - - // no validation rules for AuthenticationMechanism - - // no validation rules for AuthenticationDatabase - - // no validation rules for AgentPassword - - // no validation rules for CollectionsLimit - - // no validation rules for LogLevel - - // no validation rules for ExposeExporter - - if len(errors) > 0 { - return AddMongoDBExporterParamsMultiError(errors) - } - - return nil -} - -// AddMongoDBExporterParamsMultiError is an error wrapping multiple validation -// errors returned by AddMongoDBExporterParams.ValidateAll() if the designated -// constraints aren't met. -type AddMongoDBExporterParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m AddMongoDBExporterParamsMultiError) 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 AddMongoDBExporterParamsMultiError) AllErrors() []error { return m } - -// AddMongoDBExporterParamsValidationError is the validation error returned by -// AddMongoDBExporterParams.Validate if the designated constraints aren't met. -type AddMongoDBExporterParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e AddMongoDBExporterParamsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e AddMongoDBExporterParamsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e AddMongoDBExporterParamsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e AddMongoDBExporterParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e AddMongoDBExporterParamsValidationError) ErrorName() string { - return "AddMongoDBExporterParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e AddMongoDBExporterParamsValidationError) 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 %sAddMongoDBExporterParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = AddMongoDBExporterParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = AddMongoDBExporterParamsValidationError{} - -// Validate checks the field values on ChangeMongoDBExporterParams 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 *ChangeMongoDBExporterParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ChangeMongoDBExporterParams 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 -// ChangeMongoDBExporterParamsMultiError, or nil if none found. -func (m *ChangeMongoDBExporterParams) ValidateAll() error { - return m.validate(true) -} - -func (m *ChangeMongoDBExporterParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if all { - switch v := interface{}(m.GetMetricsResolutions()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeMongoDBExporterParamsValidationError{ - field: "MetricsResolutions", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeMongoDBExporterParamsValidationError{ - field: "MetricsResolutions", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMetricsResolutions()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeMongoDBExporterParamsValidationError{ - field: "MetricsResolutions", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if m.Enable != nil { - // no validation rules for Enable - } - - if m.CustomLabels != nil { - if all { - switch v := interface{}(m.GetCustomLabels()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeMongoDBExporterParamsValidationError{ - field: "CustomLabels", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeMongoDBExporterParamsValidationError{ - field: "CustomLabels", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetCustomLabels()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeMongoDBExporterParamsValidationError{ - field: "CustomLabels", - reason: "embedded message failed validation", - cause: err, - } - } - } - } - - if m.EnablePushMetrics != nil { - // no validation rules for EnablePushMetrics - } - - if len(errors) > 0 { - return ChangeMongoDBExporterParamsMultiError(errors) - } - - return nil -} - -// ChangeMongoDBExporterParamsMultiError is an error wrapping multiple -// validation errors returned by ChangeMongoDBExporterParams.ValidateAll() if -// the designated constraints aren't met. -type ChangeMongoDBExporterParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ChangeMongoDBExporterParamsMultiError) 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 ChangeMongoDBExporterParamsMultiError) AllErrors() []error { return m } - -// ChangeMongoDBExporterParamsValidationError is the validation error returned -// by ChangeMongoDBExporterParams.Validate if the designated constraints -// aren't met. -type ChangeMongoDBExporterParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ChangeMongoDBExporterParamsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ChangeMongoDBExporterParamsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ChangeMongoDBExporterParamsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ChangeMongoDBExporterParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ChangeMongoDBExporterParamsValidationError) ErrorName() string { - return "ChangeMongoDBExporterParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e ChangeMongoDBExporterParamsValidationError) 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 %sChangeMongoDBExporterParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ChangeMongoDBExporterParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ChangeMongoDBExporterParamsValidationError{} - -// Validate checks the field values on AddPostgresExporterParams 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 *AddPostgresExporterParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on AddPostgresExporterParams 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 -// AddPostgresExporterParamsMultiError, or nil if none found. -func (m *AddPostgresExporterParams) ValidateAll() error { - return m.validate(true) -} - -func (m *AddPostgresExporterParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetPmmAgentId()) < 1 { - err := AddPostgresExporterParamsValidationError{ - field: "PmmAgentId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if utf8.RuneCountInString(m.GetServiceId()) < 1 { - err := AddPostgresExporterParamsValidationError{ - field: "ServiceId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if utf8.RuneCountInString(m.GetUsername()) < 1 { - err := AddPostgresExporterParamsValidationError{ - field: "Username", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for Password - - // no validation rules for Tls - - // no validation rules for TlsSkipVerify - - // no validation rules for CustomLabels - - // no validation rules for SkipConnectionCheck - - // no validation rules for PushMetrics - - // no validation rules for TlsCa - - // no validation rules for TlsCert - - // no validation rules for TlsKey - - // no validation rules for AgentPassword - - // no validation rules for LogLevel - - // no validation rules for AutoDiscoveryLimit - - // no validation rules for ExposeExporter - - // no validation rules for MaxExporterConnections - - if len(errors) > 0 { - return AddPostgresExporterParamsMultiError(errors) - } - - return nil -} - -// AddPostgresExporterParamsMultiError is an error wrapping multiple validation -// errors returned by AddPostgresExporterParams.ValidateAll() if the -// designated constraints aren't met. -type AddPostgresExporterParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m AddPostgresExporterParamsMultiError) 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 AddPostgresExporterParamsMultiError) AllErrors() []error { return m } - -// AddPostgresExporterParamsValidationError is the validation error returned by -// AddPostgresExporterParams.Validate if the designated constraints aren't met. -type AddPostgresExporterParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e AddPostgresExporterParamsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e AddPostgresExporterParamsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e AddPostgresExporterParamsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e AddPostgresExporterParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e AddPostgresExporterParamsValidationError) ErrorName() string { - return "AddPostgresExporterParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e AddPostgresExporterParamsValidationError) 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 %sAddPostgresExporterParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = AddPostgresExporterParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = AddPostgresExporterParamsValidationError{} - -// Validate checks the field values on ChangePostgresExporterParams 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 *ChangePostgresExporterParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ChangePostgresExporterParams 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 -// ChangePostgresExporterParamsMultiError, or nil if none found. -func (m *ChangePostgresExporterParams) ValidateAll() error { - return m.validate(true) -} - -func (m *ChangePostgresExporterParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if all { - switch v := interface{}(m.GetMetricsResolutions()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangePostgresExporterParamsValidationError{ - field: "MetricsResolutions", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangePostgresExporterParamsValidationError{ - field: "MetricsResolutions", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMetricsResolutions()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangePostgresExporterParamsValidationError{ - field: "MetricsResolutions", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if m.Enable != nil { - // no validation rules for Enable - } - - if m.CustomLabels != nil { - if all { - switch v := interface{}(m.GetCustomLabels()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangePostgresExporterParamsValidationError{ - field: "CustomLabels", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangePostgresExporterParamsValidationError{ - field: "CustomLabels", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetCustomLabels()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangePostgresExporterParamsValidationError{ - field: "CustomLabels", - reason: "embedded message failed validation", - cause: err, - } - } - } - } - - if m.EnablePushMetrics != nil { - // no validation rules for EnablePushMetrics - } - - if len(errors) > 0 { - return ChangePostgresExporterParamsMultiError(errors) - } - - return nil -} - -// ChangePostgresExporterParamsMultiError is an error wrapping multiple -// validation errors returned by ChangePostgresExporterParams.ValidateAll() if -// the designated constraints aren't met. -type ChangePostgresExporterParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ChangePostgresExporterParamsMultiError) 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 ChangePostgresExporterParamsMultiError) AllErrors() []error { return m } - -// ChangePostgresExporterParamsValidationError is the validation error returned -// by ChangePostgresExporterParams.Validate if the designated constraints -// aren't met. -type ChangePostgresExporterParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ChangePostgresExporterParamsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ChangePostgresExporterParamsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ChangePostgresExporterParamsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ChangePostgresExporterParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ChangePostgresExporterParamsValidationError) ErrorName() string { - return "ChangePostgresExporterParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e ChangePostgresExporterParamsValidationError) 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 %sChangePostgresExporterParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ChangePostgresExporterParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ChangePostgresExporterParamsValidationError{} - -// Validate checks the field values on AddProxySQLExporterParams 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 *AddProxySQLExporterParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on AddProxySQLExporterParams 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 -// AddProxySQLExporterParamsMultiError, or nil if none found. -func (m *AddProxySQLExporterParams) ValidateAll() error { - return m.validate(true) -} - -func (m *AddProxySQLExporterParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetPmmAgentId()) < 1 { - err := AddProxySQLExporterParamsValidationError{ - field: "PmmAgentId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if utf8.RuneCountInString(m.GetServiceId()) < 1 { - err := AddProxySQLExporterParamsValidationError{ - field: "ServiceId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if utf8.RuneCountInString(m.GetUsername()) < 1 { - err := AddProxySQLExporterParamsValidationError{ - field: "Username", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for Password - - // no validation rules for Tls - - // no validation rules for TlsSkipVerify - - // no validation rules for CustomLabels - - // no validation rules for SkipConnectionCheck - - // no validation rules for PushMetrics - - // no validation rules for AgentPassword - - // no validation rules for LogLevel - - // no validation rules for ExposeExporter - - if len(errors) > 0 { - return AddProxySQLExporterParamsMultiError(errors) - } - - return nil -} - -// AddProxySQLExporterParamsMultiError is an error wrapping multiple validation -// errors returned by AddProxySQLExporterParams.ValidateAll() if the -// designated constraints aren't met. -type AddProxySQLExporterParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m AddProxySQLExporterParamsMultiError) 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 AddProxySQLExporterParamsMultiError) AllErrors() []error { return m } - -// AddProxySQLExporterParamsValidationError is the validation error returned by -// AddProxySQLExporterParams.Validate if the designated constraints aren't met. -type AddProxySQLExporterParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e AddProxySQLExporterParamsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e AddProxySQLExporterParamsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e AddProxySQLExporterParamsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e AddProxySQLExporterParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e AddProxySQLExporterParamsValidationError) ErrorName() string { - return "AddProxySQLExporterParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e AddProxySQLExporterParamsValidationError) 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 %sAddProxySQLExporterParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = AddProxySQLExporterParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = AddProxySQLExporterParamsValidationError{} - -// Validate checks the field values on ChangeProxySQLExporterParams 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 *ChangeProxySQLExporterParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ChangeProxySQLExporterParams 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 -// ChangeProxySQLExporterParamsMultiError, or nil if none found. -func (m *ChangeProxySQLExporterParams) ValidateAll() error { - return m.validate(true) -} - -func (m *ChangeProxySQLExporterParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if all { - switch v := interface{}(m.GetMetricsResolutions()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeProxySQLExporterParamsValidationError{ - field: "MetricsResolutions", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeProxySQLExporterParamsValidationError{ - field: "MetricsResolutions", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMetricsResolutions()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeProxySQLExporterParamsValidationError{ - field: "MetricsResolutions", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if m.Enable != nil { - // no validation rules for Enable - } - - if m.CustomLabels != nil { - if all { - switch v := interface{}(m.GetCustomLabels()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeProxySQLExporterParamsValidationError{ - field: "CustomLabels", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeProxySQLExporterParamsValidationError{ - field: "CustomLabels", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetCustomLabels()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeProxySQLExporterParamsValidationError{ - field: "CustomLabels", - reason: "embedded message failed validation", - cause: err, - } - } - } - } - - if m.EnablePushMetrics != nil { - // no validation rules for EnablePushMetrics - } - - if len(errors) > 0 { - return ChangeProxySQLExporterParamsMultiError(errors) - } - - return nil -} - -// ChangeProxySQLExporterParamsMultiError is an error wrapping multiple -// validation errors returned by ChangeProxySQLExporterParams.ValidateAll() if -// the designated constraints aren't met. -type ChangeProxySQLExporterParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ChangeProxySQLExporterParamsMultiError) 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 ChangeProxySQLExporterParamsMultiError) AllErrors() []error { return m } - -// ChangeProxySQLExporterParamsValidationError is the validation error returned -// by ChangeProxySQLExporterParams.Validate if the designated constraints -// aren't met. -type ChangeProxySQLExporterParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ChangeProxySQLExporterParamsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ChangeProxySQLExporterParamsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ChangeProxySQLExporterParamsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ChangeProxySQLExporterParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ChangeProxySQLExporterParamsValidationError) ErrorName() string { - return "ChangeProxySQLExporterParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e ChangeProxySQLExporterParamsValidationError) 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 %sChangeProxySQLExporterParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ChangeProxySQLExporterParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ChangeProxySQLExporterParamsValidationError{} - -// Validate checks the field values on AddQANMySQLPerfSchemaAgentParams 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 *AddQANMySQLPerfSchemaAgentParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on AddQANMySQLPerfSchemaAgentParams 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 -// AddQANMySQLPerfSchemaAgentParamsMultiError, or nil if none found. -func (m *AddQANMySQLPerfSchemaAgentParams) ValidateAll() error { - return m.validate(true) -} - -func (m *AddQANMySQLPerfSchemaAgentParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetPmmAgentId()) < 1 { - err := AddQANMySQLPerfSchemaAgentParamsValidationError{ - field: "PmmAgentId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if utf8.RuneCountInString(m.GetServiceId()) < 1 { - err := AddQANMySQLPerfSchemaAgentParamsValidationError{ - field: "ServiceId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if utf8.RuneCountInString(m.GetUsername()) < 1 { - err := AddQANMySQLPerfSchemaAgentParamsValidationError{ - field: "Username", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for Password - - // no validation rules for Tls - - // no validation rules for TlsSkipVerify - - // no validation rules for TlsCa - - // no validation rules for TlsCert - - // no validation rules for TlsKey - - // no validation rules for MaxQueryLength - - // no validation rules for DisableQueryExamples - - // no validation rules for CustomLabels - - // no validation rules for SkipConnectionCheck - - // no validation rules for DisableCommentsParsing - - // no validation rules for LogLevel - - // no validation rules for ExtraDsnParams - - if len(errors) > 0 { - return AddQANMySQLPerfSchemaAgentParamsMultiError(errors) - } - - return nil -} - -// AddQANMySQLPerfSchemaAgentParamsMultiError is an error wrapping multiple -// validation errors returned by -// AddQANMySQLPerfSchemaAgentParams.ValidateAll() if the designated -// constraints aren't met. -type AddQANMySQLPerfSchemaAgentParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m AddQANMySQLPerfSchemaAgentParamsMultiError) 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 AddQANMySQLPerfSchemaAgentParamsMultiError) AllErrors() []error { return m } - -// AddQANMySQLPerfSchemaAgentParamsValidationError is the validation error -// returned by AddQANMySQLPerfSchemaAgentParams.Validate if the designated -// constraints aren't met. -type AddQANMySQLPerfSchemaAgentParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e AddQANMySQLPerfSchemaAgentParamsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e AddQANMySQLPerfSchemaAgentParamsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e AddQANMySQLPerfSchemaAgentParamsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e AddQANMySQLPerfSchemaAgentParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e AddQANMySQLPerfSchemaAgentParamsValidationError) ErrorName() string { - return "AddQANMySQLPerfSchemaAgentParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e AddQANMySQLPerfSchemaAgentParamsValidationError) 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 %sAddQANMySQLPerfSchemaAgentParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = AddQANMySQLPerfSchemaAgentParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = AddQANMySQLPerfSchemaAgentParamsValidationError{} - -// Validate checks the field values on ChangeQANMySQLPerfSchemaAgentParams 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 *ChangeQANMySQLPerfSchemaAgentParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ChangeQANMySQLPerfSchemaAgentParams -// 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 -// ChangeQANMySQLPerfSchemaAgentParamsMultiError, or nil if none found. -func (m *ChangeQANMySQLPerfSchemaAgentParams) ValidateAll() error { - return m.validate(true) -} - -func (m *ChangeQANMySQLPerfSchemaAgentParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if all { - switch v := interface{}(m.GetMetricsResolutions()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeQANMySQLPerfSchemaAgentParamsValidationError{ - field: "MetricsResolutions", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeQANMySQLPerfSchemaAgentParamsValidationError{ - field: "MetricsResolutions", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMetricsResolutions()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeQANMySQLPerfSchemaAgentParamsValidationError{ - field: "MetricsResolutions", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if m.Enable != nil { - // no validation rules for Enable - } - - if m.CustomLabels != nil { - if all { - switch v := interface{}(m.GetCustomLabels()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeQANMySQLPerfSchemaAgentParamsValidationError{ - field: "CustomLabels", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeQANMySQLPerfSchemaAgentParamsValidationError{ - field: "CustomLabels", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetCustomLabels()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeQANMySQLPerfSchemaAgentParamsValidationError{ - field: "CustomLabels", - reason: "embedded message failed validation", - cause: err, - } - } - } - } - - if m.EnablePushMetrics != nil { - // no validation rules for EnablePushMetrics - } - - if len(errors) > 0 { - return ChangeQANMySQLPerfSchemaAgentParamsMultiError(errors) - } - - return nil -} - -// ChangeQANMySQLPerfSchemaAgentParamsMultiError is an error wrapping multiple -// validation errors returned by -// ChangeQANMySQLPerfSchemaAgentParams.ValidateAll() if the designated -// constraints aren't met. -type ChangeQANMySQLPerfSchemaAgentParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ChangeQANMySQLPerfSchemaAgentParamsMultiError) 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 ChangeQANMySQLPerfSchemaAgentParamsMultiError) AllErrors() []error { return m } - -// ChangeQANMySQLPerfSchemaAgentParamsValidationError is the validation error -// returned by ChangeQANMySQLPerfSchemaAgentParams.Validate if the designated -// constraints aren't met. -type ChangeQANMySQLPerfSchemaAgentParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ChangeQANMySQLPerfSchemaAgentParamsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ChangeQANMySQLPerfSchemaAgentParamsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ChangeQANMySQLPerfSchemaAgentParamsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ChangeQANMySQLPerfSchemaAgentParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ChangeQANMySQLPerfSchemaAgentParamsValidationError) ErrorName() string { - return "ChangeQANMySQLPerfSchemaAgentParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e ChangeQANMySQLPerfSchemaAgentParamsValidationError) 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 %sChangeQANMySQLPerfSchemaAgentParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ChangeQANMySQLPerfSchemaAgentParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ChangeQANMySQLPerfSchemaAgentParamsValidationError{} - -// Validate checks the field values on AddQANMySQLSlowlogAgentParams 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 *AddQANMySQLSlowlogAgentParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on AddQANMySQLSlowlogAgentParams 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 -// AddQANMySQLSlowlogAgentParamsMultiError, or nil if none found. -func (m *AddQANMySQLSlowlogAgentParams) ValidateAll() error { - return m.validate(true) -} - -func (m *AddQANMySQLSlowlogAgentParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetPmmAgentId()) < 1 { - err := AddQANMySQLSlowlogAgentParamsValidationError{ - field: "PmmAgentId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if utf8.RuneCountInString(m.GetServiceId()) < 1 { - err := AddQANMySQLSlowlogAgentParamsValidationError{ - field: "ServiceId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if utf8.RuneCountInString(m.GetUsername()) < 1 { - err := AddQANMySQLSlowlogAgentParamsValidationError{ - field: "Username", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for Password - - // no validation rules for Tls - - // no validation rules for TlsSkipVerify - - // no validation rules for TlsCa - - // no validation rules for TlsCert - - // no validation rules for TlsKey - - // no validation rules for MaxQueryLength - - // no validation rules for DisableQueryExamples - - // no validation rules for MaxSlowlogFileSize - - // no validation rules for CustomLabels - - // no validation rules for SkipConnectionCheck - - // no validation rules for DisableCommentsParsing - - // no validation rules for LogLevel - - // no validation rules for ExtraDsnParams - - if len(errors) > 0 { - return AddQANMySQLSlowlogAgentParamsMultiError(errors) - } - - return nil -} - -// AddQANMySQLSlowlogAgentParamsMultiError is an error wrapping multiple -// validation errors returned by AddQANMySQLSlowlogAgentParams.ValidateAll() -// if the designated constraints aren't met. -type AddQANMySQLSlowlogAgentParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m AddQANMySQLSlowlogAgentParamsMultiError) 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 AddQANMySQLSlowlogAgentParamsMultiError) AllErrors() []error { return m } - -// AddQANMySQLSlowlogAgentParamsValidationError is the validation error -// returned by AddQANMySQLSlowlogAgentParams.Validate if the designated -// constraints aren't met. -type AddQANMySQLSlowlogAgentParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e AddQANMySQLSlowlogAgentParamsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e AddQANMySQLSlowlogAgentParamsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e AddQANMySQLSlowlogAgentParamsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e AddQANMySQLSlowlogAgentParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e AddQANMySQLSlowlogAgentParamsValidationError) ErrorName() string { - return "AddQANMySQLSlowlogAgentParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e AddQANMySQLSlowlogAgentParamsValidationError) 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 %sAddQANMySQLSlowlogAgentParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = AddQANMySQLSlowlogAgentParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = AddQANMySQLSlowlogAgentParamsValidationError{} - -// Validate checks the field values on ChangeQANMySQLSlowlogAgentParams 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 *ChangeQANMySQLSlowlogAgentParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ChangeQANMySQLSlowlogAgentParams 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 -// ChangeQANMySQLSlowlogAgentParamsMultiError, or nil if none found. -func (m *ChangeQANMySQLSlowlogAgentParams) ValidateAll() error { - return m.validate(true) -} - -func (m *ChangeQANMySQLSlowlogAgentParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if all { - switch v := interface{}(m.GetMetricsResolutions()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeQANMySQLSlowlogAgentParamsValidationError{ - field: "MetricsResolutions", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeQANMySQLSlowlogAgentParamsValidationError{ - field: "MetricsResolutions", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMetricsResolutions()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeQANMySQLSlowlogAgentParamsValidationError{ - field: "MetricsResolutions", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if m.Enable != nil { - // no validation rules for Enable - } - - if m.CustomLabels != nil { - if all { - switch v := interface{}(m.GetCustomLabels()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeQANMySQLSlowlogAgentParamsValidationError{ - field: "CustomLabels", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeQANMySQLSlowlogAgentParamsValidationError{ - field: "CustomLabels", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetCustomLabels()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeQANMySQLSlowlogAgentParamsValidationError{ - field: "CustomLabels", - reason: "embedded message failed validation", - cause: err, - } - } - } - } - - if m.EnablePushMetrics != nil { - // no validation rules for EnablePushMetrics - } - - if len(errors) > 0 { - return ChangeQANMySQLSlowlogAgentParamsMultiError(errors) - } - - return nil -} - -// ChangeQANMySQLSlowlogAgentParamsMultiError is an error wrapping multiple -// validation errors returned by -// ChangeQANMySQLSlowlogAgentParams.ValidateAll() if the designated -// constraints aren't met. -type ChangeQANMySQLSlowlogAgentParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ChangeQANMySQLSlowlogAgentParamsMultiError) 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 ChangeQANMySQLSlowlogAgentParamsMultiError) AllErrors() []error { return m } - -// ChangeQANMySQLSlowlogAgentParamsValidationError is the validation error -// returned by ChangeQANMySQLSlowlogAgentParams.Validate if the designated -// constraints aren't met. -type ChangeQANMySQLSlowlogAgentParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ChangeQANMySQLSlowlogAgentParamsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ChangeQANMySQLSlowlogAgentParamsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ChangeQANMySQLSlowlogAgentParamsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ChangeQANMySQLSlowlogAgentParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ChangeQANMySQLSlowlogAgentParamsValidationError) ErrorName() string { - return "ChangeQANMySQLSlowlogAgentParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e ChangeQANMySQLSlowlogAgentParamsValidationError) 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 %sChangeQANMySQLSlowlogAgentParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ChangeQANMySQLSlowlogAgentParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ChangeQANMySQLSlowlogAgentParamsValidationError{} - -// Validate checks the field values on AddQANMongoDBProfilerAgentParams 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 *AddQANMongoDBProfilerAgentParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on AddQANMongoDBProfilerAgentParams 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 -// AddQANMongoDBProfilerAgentParamsMultiError, or nil if none found. -func (m *AddQANMongoDBProfilerAgentParams) ValidateAll() error { - return m.validate(true) -} - -func (m *AddQANMongoDBProfilerAgentParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetPmmAgentId()) < 1 { - err := AddQANMongoDBProfilerAgentParamsValidationError{ - field: "PmmAgentId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if utf8.RuneCountInString(m.GetServiceId()) < 1 { - err := AddQANMongoDBProfilerAgentParamsValidationError{ - field: "ServiceId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for Username - - // no validation rules for Password - - // no validation rules for Tls - - // no validation rules for TlsSkipVerify - - // no validation rules for TlsCertificateKey - - // no validation rules for TlsCertificateKeyFilePassword - - // no validation rules for TlsCa - - // no validation rules for MaxQueryLength - - // no validation rules for CustomLabels - - // no validation rules for SkipConnectionCheck - - // no validation rules for AuthenticationMechanism - - // no validation rules for AuthenticationDatabase - - // no validation rules for LogLevel - - if len(errors) > 0 { - return AddQANMongoDBProfilerAgentParamsMultiError(errors) - } - - return nil -} - -// AddQANMongoDBProfilerAgentParamsMultiError is an error wrapping multiple -// validation errors returned by -// AddQANMongoDBProfilerAgentParams.ValidateAll() if the designated -// constraints aren't met. -type AddQANMongoDBProfilerAgentParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m AddQANMongoDBProfilerAgentParamsMultiError) 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 AddQANMongoDBProfilerAgentParamsMultiError) AllErrors() []error { return m } - -// AddQANMongoDBProfilerAgentParamsValidationError is the validation error -// returned by AddQANMongoDBProfilerAgentParams.Validate if the designated -// constraints aren't met. -type AddQANMongoDBProfilerAgentParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e AddQANMongoDBProfilerAgentParamsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e AddQANMongoDBProfilerAgentParamsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e AddQANMongoDBProfilerAgentParamsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e AddQANMongoDBProfilerAgentParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e AddQANMongoDBProfilerAgentParamsValidationError) ErrorName() string { - return "AddQANMongoDBProfilerAgentParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e AddQANMongoDBProfilerAgentParamsValidationError) 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 %sAddQANMongoDBProfilerAgentParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = AddQANMongoDBProfilerAgentParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = AddQANMongoDBProfilerAgentParamsValidationError{} - -// Validate checks the field values on ChangeQANMongoDBProfilerAgentParams 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 *ChangeQANMongoDBProfilerAgentParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ChangeQANMongoDBProfilerAgentParams -// 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 -// ChangeQANMongoDBProfilerAgentParamsMultiError, or nil if none found. -func (m *ChangeQANMongoDBProfilerAgentParams) ValidateAll() error { - return m.validate(true) -} - -func (m *ChangeQANMongoDBProfilerAgentParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if all { - switch v := interface{}(m.GetMetricsResolutions()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeQANMongoDBProfilerAgentParamsValidationError{ - field: "MetricsResolutions", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeQANMongoDBProfilerAgentParamsValidationError{ - field: "MetricsResolutions", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMetricsResolutions()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeQANMongoDBProfilerAgentParamsValidationError{ - field: "MetricsResolutions", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if m.Enable != nil { - // no validation rules for Enable - } - - if m.CustomLabels != nil { - if all { - switch v := interface{}(m.GetCustomLabels()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeQANMongoDBProfilerAgentParamsValidationError{ - field: "CustomLabels", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeQANMongoDBProfilerAgentParamsValidationError{ - field: "CustomLabels", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetCustomLabels()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeQANMongoDBProfilerAgentParamsValidationError{ - field: "CustomLabels", - reason: "embedded message failed validation", - cause: err, - } - } - } - } - - if m.EnablePushMetrics != nil { - // no validation rules for EnablePushMetrics - } - - if len(errors) > 0 { - return ChangeQANMongoDBProfilerAgentParamsMultiError(errors) - } - - return nil -} - -// ChangeQANMongoDBProfilerAgentParamsMultiError is an error wrapping multiple -// validation errors returned by -// ChangeQANMongoDBProfilerAgentParams.ValidateAll() if the designated -// constraints aren't met. -type ChangeQANMongoDBProfilerAgentParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ChangeQANMongoDBProfilerAgentParamsMultiError) 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 ChangeQANMongoDBProfilerAgentParamsMultiError) AllErrors() []error { return m } - -// ChangeQANMongoDBProfilerAgentParamsValidationError is the validation error -// returned by ChangeQANMongoDBProfilerAgentParams.Validate if the designated -// constraints aren't met. -type ChangeQANMongoDBProfilerAgentParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ChangeQANMongoDBProfilerAgentParamsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ChangeQANMongoDBProfilerAgentParamsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ChangeQANMongoDBProfilerAgentParamsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ChangeQANMongoDBProfilerAgentParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ChangeQANMongoDBProfilerAgentParamsValidationError) ErrorName() string { - return "ChangeQANMongoDBProfilerAgentParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e ChangeQANMongoDBProfilerAgentParamsValidationError) 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 %sChangeQANMongoDBProfilerAgentParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ChangeQANMongoDBProfilerAgentParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ChangeQANMongoDBProfilerAgentParamsValidationError{} - -// Validate checks the field values on AddQANMongoDBMongologAgentParams 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 *AddQANMongoDBMongologAgentParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on AddQANMongoDBMongologAgentParams 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 -// AddQANMongoDBMongologAgentParamsMultiError, or nil if none found. -func (m *AddQANMongoDBMongologAgentParams) ValidateAll() error { - return m.validate(true) -} - -func (m *AddQANMongoDBMongologAgentParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetPmmAgentId()) < 1 { - err := AddQANMongoDBMongologAgentParamsValidationError{ - field: "PmmAgentId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if utf8.RuneCountInString(m.GetServiceId()) < 1 { - err := AddQANMongoDBMongologAgentParamsValidationError{ - field: "ServiceId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for Username - - // no validation rules for Password - - // no validation rules for Tls - - // no validation rules for TlsSkipVerify - - // no validation rules for TlsCertificateKey - - // no validation rules for TlsCertificateKeyFilePassword - - // no validation rules for TlsCa - - // no validation rules for MaxQueryLength - - // no validation rules for CustomLabels - - // no validation rules for SkipConnectionCheck - - // no validation rules for AuthenticationMechanism - - // no validation rules for AuthenticationDatabase - - // no validation rules for LogLevel - - if len(errors) > 0 { - return AddQANMongoDBMongologAgentParamsMultiError(errors) - } - - return nil -} - -// AddQANMongoDBMongologAgentParamsMultiError is an error wrapping multiple -// validation errors returned by -// AddQANMongoDBMongologAgentParams.ValidateAll() if the designated -// constraints aren't met. -type AddQANMongoDBMongologAgentParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m AddQANMongoDBMongologAgentParamsMultiError) 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 AddQANMongoDBMongologAgentParamsMultiError) AllErrors() []error { return m } - -// AddQANMongoDBMongologAgentParamsValidationError is the validation error -// returned by AddQANMongoDBMongologAgentParams.Validate if the designated -// constraints aren't met. -type AddQANMongoDBMongologAgentParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e AddQANMongoDBMongologAgentParamsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e AddQANMongoDBMongologAgentParamsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e AddQANMongoDBMongologAgentParamsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e AddQANMongoDBMongologAgentParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e AddQANMongoDBMongologAgentParamsValidationError) ErrorName() string { - return "AddQANMongoDBMongologAgentParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e AddQANMongoDBMongologAgentParamsValidationError) 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 %sAddQANMongoDBMongologAgentParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = AddQANMongoDBMongologAgentParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = AddQANMongoDBMongologAgentParamsValidationError{} - -// Validate checks the field values on ChangeQANMongoDBMongologAgentParams 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 *ChangeQANMongoDBMongologAgentParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ChangeQANMongoDBMongologAgentParams -// 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 -// ChangeQANMongoDBMongologAgentParamsMultiError, or nil if none found. -func (m *ChangeQANMongoDBMongologAgentParams) ValidateAll() error { - return m.validate(true) -} - -func (m *ChangeQANMongoDBMongologAgentParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if all { - switch v := interface{}(m.GetMetricsResolutions()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeQANMongoDBMongologAgentParamsValidationError{ - field: "MetricsResolutions", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeQANMongoDBMongologAgentParamsValidationError{ - field: "MetricsResolutions", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMetricsResolutions()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeQANMongoDBMongologAgentParamsValidationError{ - field: "MetricsResolutions", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if m.Enable != nil { - // no validation rules for Enable - } - - if m.CustomLabels != nil { - if all { - switch v := interface{}(m.GetCustomLabels()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeQANMongoDBMongologAgentParamsValidationError{ - field: "CustomLabels", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeQANMongoDBMongologAgentParamsValidationError{ - field: "CustomLabels", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetCustomLabels()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeQANMongoDBMongologAgentParamsValidationError{ - field: "CustomLabels", - reason: "embedded message failed validation", - cause: err, - } - } - } - } - - if m.EnablePushMetrics != nil { - // no validation rules for EnablePushMetrics - } - - if len(errors) > 0 { - return ChangeQANMongoDBMongologAgentParamsMultiError(errors) - } - - return nil -} - -// ChangeQANMongoDBMongologAgentParamsMultiError is an error wrapping multiple -// validation errors returned by -// ChangeQANMongoDBMongologAgentParams.ValidateAll() if the designated -// constraints aren't met. -type ChangeQANMongoDBMongologAgentParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ChangeQANMongoDBMongologAgentParamsMultiError) 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 ChangeQANMongoDBMongologAgentParamsMultiError) AllErrors() []error { return m } - -// ChangeQANMongoDBMongologAgentParamsValidationError is the validation error -// returned by ChangeQANMongoDBMongologAgentParams.Validate if the designated -// constraints aren't met. -type ChangeQANMongoDBMongologAgentParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ChangeQANMongoDBMongologAgentParamsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ChangeQANMongoDBMongologAgentParamsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ChangeQANMongoDBMongologAgentParamsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ChangeQANMongoDBMongologAgentParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ChangeQANMongoDBMongologAgentParamsValidationError) ErrorName() string { - return "ChangeQANMongoDBMongologAgentParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e ChangeQANMongoDBMongologAgentParamsValidationError) 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 %sChangeQANMongoDBMongologAgentParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ChangeQANMongoDBMongologAgentParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ChangeQANMongoDBMongologAgentParamsValidationError{} - -// Validate checks the field values on AddQANPostgreSQLPgStatementsAgentParams -// 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 *AddQANPostgreSQLPgStatementsAgentParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on -// AddQANPostgreSQLPgStatementsAgentParams 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 -// AddQANPostgreSQLPgStatementsAgentParamsMultiError, or nil if none found. -func (m *AddQANPostgreSQLPgStatementsAgentParams) ValidateAll() error { - return m.validate(true) -} - -func (m *AddQANPostgreSQLPgStatementsAgentParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetPmmAgentId()) < 1 { - err := AddQANPostgreSQLPgStatementsAgentParamsValidationError{ - field: "PmmAgentId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if utf8.RuneCountInString(m.GetServiceId()) < 1 { - err := AddQANPostgreSQLPgStatementsAgentParamsValidationError{ - field: "ServiceId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if utf8.RuneCountInString(m.GetUsername()) < 1 { - err := AddQANPostgreSQLPgStatementsAgentParamsValidationError{ - field: "Username", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for Password - - // no validation rules for Tls - - // no validation rules for TlsSkipVerify - - // no validation rules for CustomLabels - - // no validation rules for SkipConnectionCheck - - // no validation rules for DisableCommentsParsing - - // no validation rules for MaxQueryLength - - // no validation rules for TlsCa - - // no validation rules for TlsCert - - // no validation rules for TlsKey - - // no validation rules for LogLevel - - if len(errors) > 0 { - return AddQANPostgreSQLPgStatementsAgentParamsMultiError(errors) - } - - return nil -} - -// AddQANPostgreSQLPgStatementsAgentParamsMultiError is an error wrapping -// multiple validation errors returned by -// AddQANPostgreSQLPgStatementsAgentParams.ValidateAll() if the designated -// constraints aren't met. -type AddQANPostgreSQLPgStatementsAgentParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m AddQANPostgreSQLPgStatementsAgentParamsMultiError) 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 AddQANPostgreSQLPgStatementsAgentParamsMultiError) AllErrors() []error { return m } - -// AddQANPostgreSQLPgStatementsAgentParamsValidationError is the validation -// error returned by AddQANPostgreSQLPgStatementsAgentParams.Validate if the -// designated constraints aren't met. -type AddQANPostgreSQLPgStatementsAgentParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e AddQANPostgreSQLPgStatementsAgentParamsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e AddQANPostgreSQLPgStatementsAgentParamsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e AddQANPostgreSQLPgStatementsAgentParamsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e AddQANPostgreSQLPgStatementsAgentParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e AddQANPostgreSQLPgStatementsAgentParamsValidationError) ErrorName() string { - return "AddQANPostgreSQLPgStatementsAgentParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e AddQANPostgreSQLPgStatementsAgentParamsValidationError) 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 %sAddQANPostgreSQLPgStatementsAgentParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = AddQANPostgreSQLPgStatementsAgentParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = AddQANPostgreSQLPgStatementsAgentParamsValidationError{} - -// Validate checks the field values on -// ChangeQANPostgreSQLPgStatementsAgentParams 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 *ChangeQANPostgreSQLPgStatementsAgentParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on -// ChangeQANPostgreSQLPgStatementsAgentParams 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 -// ChangeQANPostgreSQLPgStatementsAgentParamsMultiError, or nil if none found. -func (m *ChangeQANPostgreSQLPgStatementsAgentParams) ValidateAll() error { - return m.validate(true) -} - -func (m *ChangeQANPostgreSQLPgStatementsAgentParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if all { - switch v := interface{}(m.GetMetricsResolutions()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeQANPostgreSQLPgStatementsAgentParamsValidationError{ - field: "MetricsResolutions", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeQANPostgreSQLPgStatementsAgentParamsValidationError{ - field: "MetricsResolutions", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMetricsResolutions()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeQANPostgreSQLPgStatementsAgentParamsValidationError{ - field: "MetricsResolutions", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if m.Enable != nil { - // no validation rules for Enable - } - - if m.CustomLabels != nil { - if all { - switch v := interface{}(m.GetCustomLabels()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeQANPostgreSQLPgStatementsAgentParamsValidationError{ - field: "CustomLabels", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeQANPostgreSQLPgStatementsAgentParamsValidationError{ - field: "CustomLabels", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetCustomLabels()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeQANPostgreSQLPgStatementsAgentParamsValidationError{ - field: "CustomLabels", - reason: "embedded message failed validation", - cause: err, - } - } - } - } - - if m.EnablePushMetrics != nil { - // no validation rules for EnablePushMetrics - } - - if len(errors) > 0 { - return ChangeQANPostgreSQLPgStatementsAgentParamsMultiError(errors) - } - - return nil -} - -// ChangeQANPostgreSQLPgStatementsAgentParamsMultiError is an error wrapping -// multiple validation errors returned by -// ChangeQANPostgreSQLPgStatementsAgentParams.ValidateAll() if the designated -// constraints aren't met. -type ChangeQANPostgreSQLPgStatementsAgentParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ChangeQANPostgreSQLPgStatementsAgentParamsMultiError) 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 ChangeQANPostgreSQLPgStatementsAgentParamsMultiError) AllErrors() []error { return m } - -// ChangeQANPostgreSQLPgStatementsAgentParamsValidationError is the validation -// error returned by ChangeQANPostgreSQLPgStatementsAgentParams.Validate if -// the designated constraints aren't met. -type ChangeQANPostgreSQLPgStatementsAgentParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ChangeQANPostgreSQLPgStatementsAgentParamsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ChangeQANPostgreSQLPgStatementsAgentParamsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ChangeQANPostgreSQLPgStatementsAgentParamsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ChangeQANPostgreSQLPgStatementsAgentParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ChangeQANPostgreSQLPgStatementsAgentParamsValidationError) ErrorName() string { - return "ChangeQANPostgreSQLPgStatementsAgentParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e ChangeQANPostgreSQLPgStatementsAgentParamsValidationError) 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 %sChangeQANPostgreSQLPgStatementsAgentParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ChangeQANPostgreSQLPgStatementsAgentParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ChangeQANPostgreSQLPgStatementsAgentParamsValidationError{} - -// Validate checks the field values on AddQANPostgreSQLPgStatMonitorAgentParams -// 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 *AddQANPostgreSQLPgStatMonitorAgentParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on -// AddQANPostgreSQLPgStatMonitorAgentParams 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 -// AddQANPostgreSQLPgStatMonitorAgentParamsMultiError, or nil if none found. -func (m *AddQANPostgreSQLPgStatMonitorAgentParams) ValidateAll() error { - return m.validate(true) -} - -func (m *AddQANPostgreSQLPgStatMonitorAgentParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetPmmAgentId()) < 1 { - err := AddQANPostgreSQLPgStatMonitorAgentParamsValidationError{ - field: "PmmAgentId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if utf8.RuneCountInString(m.GetServiceId()) < 1 { - err := AddQANPostgreSQLPgStatMonitorAgentParamsValidationError{ - field: "ServiceId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if utf8.RuneCountInString(m.GetUsername()) < 1 { - err := AddQANPostgreSQLPgStatMonitorAgentParamsValidationError{ - field: "Username", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for Password - - // no validation rules for Tls - - // no validation rules for TlsSkipVerify - - // no validation rules for MaxQueryLength - - // no validation rules for DisableQueryExamples - - // no validation rules for CustomLabels - - // no validation rules for SkipConnectionCheck - - // no validation rules for DisableCommentsParsing - - // no validation rules for TlsCa - - // no validation rules for TlsCert - - // no validation rules for TlsKey - - // no validation rules for LogLevel - - if len(errors) > 0 { - return AddQANPostgreSQLPgStatMonitorAgentParamsMultiError(errors) - } - - return nil -} - -// AddQANPostgreSQLPgStatMonitorAgentParamsMultiError is an error wrapping -// multiple validation errors returned by -// AddQANPostgreSQLPgStatMonitorAgentParams.ValidateAll() if the designated -// constraints aren't met. -type AddQANPostgreSQLPgStatMonitorAgentParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m AddQANPostgreSQLPgStatMonitorAgentParamsMultiError) 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 AddQANPostgreSQLPgStatMonitorAgentParamsMultiError) AllErrors() []error { return m } - -// AddQANPostgreSQLPgStatMonitorAgentParamsValidationError is the validation -// error returned by AddQANPostgreSQLPgStatMonitorAgentParams.Validate if the -// designated constraints aren't met. -type AddQANPostgreSQLPgStatMonitorAgentParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e AddQANPostgreSQLPgStatMonitorAgentParamsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e AddQANPostgreSQLPgStatMonitorAgentParamsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e AddQANPostgreSQLPgStatMonitorAgentParamsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e AddQANPostgreSQLPgStatMonitorAgentParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e AddQANPostgreSQLPgStatMonitorAgentParamsValidationError) ErrorName() string { - return "AddQANPostgreSQLPgStatMonitorAgentParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e AddQANPostgreSQLPgStatMonitorAgentParamsValidationError) 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 %sAddQANPostgreSQLPgStatMonitorAgentParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = AddQANPostgreSQLPgStatMonitorAgentParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = AddQANPostgreSQLPgStatMonitorAgentParamsValidationError{} - -// Validate checks the field values on -// ChangeQANPostgreSQLPgStatMonitorAgentParams 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 *ChangeQANPostgreSQLPgStatMonitorAgentParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on -// ChangeQANPostgreSQLPgStatMonitorAgentParams 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 -// ChangeQANPostgreSQLPgStatMonitorAgentParamsMultiError, or nil if none found. -func (m *ChangeQANPostgreSQLPgStatMonitorAgentParams) ValidateAll() error { - return m.validate(true) -} - -func (m *ChangeQANPostgreSQLPgStatMonitorAgentParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if all { - switch v := interface{}(m.GetMetricsResolutions()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeQANPostgreSQLPgStatMonitorAgentParamsValidationError{ - field: "MetricsResolutions", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeQANPostgreSQLPgStatMonitorAgentParamsValidationError{ - field: "MetricsResolutions", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMetricsResolutions()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeQANPostgreSQLPgStatMonitorAgentParamsValidationError{ - field: "MetricsResolutions", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if m.Enable != nil { - // no validation rules for Enable - } - - if m.CustomLabels != nil { - if all { - switch v := interface{}(m.GetCustomLabels()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeQANPostgreSQLPgStatMonitorAgentParamsValidationError{ - field: "CustomLabels", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeQANPostgreSQLPgStatMonitorAgentParamsValidationError{ - field: "CustomLabels", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetCustomLabels()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeQANPostgreSQLPgStatMonitorAgentParamsValidationError{ - field: "CustomLabels", - reason: "embedded message failed validation", - cause: err, - } - } - } - } - - if m.EnablePushMetrics != nil { - // no validation rules for EnablePushMetrics - } - - if len(errors) > 0 { - return ChangeQANPostgreSQLPgStatMonitorAgentParamsMultiError(errors) - } - - return nil -} - -// ChangeQANPostgreSQLPgStatMonitorAgentParamsMultiError is an error wrapping -// multiple validation errors returned by -// ChangeQANPostgreSQLPgStatMonitorAgentParams.ValidateAll() if the designated -// constraints aren't met. -type ChangeQANPostgreSQLPgStatMonitorAgentParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ChangeQANPostgreSQLPgStatMonitorAgentParamsMultiError) 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 ChangeQANPostgreSQLPgStatMonitorAgentParamsMultiError) AllErrors() []error { return m } - -// ChangeQANPostgreSQLPgStatMonitorAgentParamsValidationError is the validation -// error returned by ChangeQANPostgreSQLPgStatMonitorAgentParams.Validate if -// the designated constraints aren't met. -type ChangeQANPostgreSQLPgStatMonitorAgentParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ChangeQANPostgreSQLPgStatMonitorAgentParamsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ChangeQANPostgreSQLPgStatMonitorAgentParamsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ChangeQANPostgreSQLPgStatMonitorAgentParamsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ChangeQANPostgreSQLPgStatMonitorAgentParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ChangeQANPostgreSQLPgStatMonitorAgentParamsValidationError) ErrorName() string { - return "ChangeQANPostgreSQLPgStatMonitorAgentParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e ChangeQANPostgreSQLPgStatMonitorAgentParamsValidationError) 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 %sChangeQANPostgreSQLPgStatMonitorAgentParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ChangeQANPostgreSQLPgStatMonitorAgentParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ChangeQANPostgreSQLPgStatMonitorAgentParamsValidationError{} - -// Validate checks the field values on AddRDSExporterParams 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 *AddRDSExporterParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on AddRDSExporterParams 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 -// AddRDSExporterParamsMultiError, or nil if none found. -func (m *AddRDSExporterParams) ValidateAll() error { - return m.validate(true) -} - -func (m *AddRDSExporterParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetPmmAgentId()) < 1 { - err := AddRDSExporterParamsValidationError{ - field: "PmmAgentId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if utf8.RuneCountInString(m.GetNodeId()) < 1 { - err := AddRDSExporterParamsValidationError{ - field: "NodeId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for AwsAccessKey - - // no validation rules for AwsSecretKey - - // no validation rules for CustomLabels - - // no validation rules for SkipConnectionCheck - - // no validation rules for DisableBasicMetrics - - // no validation rules for DisableEnhancedMetrics - - // no validation rules for PushMetrics - - // no validation rules for LogLevel - - if len(errors) > 0 { - return AddRDSExporterParamsMultiError(errors) - } - - return nil -} - -// AddRDSExporterParamsMultiError is an error wrapping multiple validation -// errors returned by AddRDSExporterParams.ValidateAll() if the designated -// constraints aren't met. -type AddRDSExporterParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m AddRDSExporterParamsMultiError) 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 AddRDSExporterParamsMultiError) AllErrors() []error { return m } - -// AddRDSExporterParamsValidationError is the validation error returned by -// AddRDSExporterParams.Validate if the designated constraints aren't met. -type AddRDSExporterParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e AddRDSExporterParamsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e AddRDSExporterParamsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e AddRDSExporterParamsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e AddRDSExporterParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e AddRDSExporterParamsValidationError) ErrorName() string { - return "AddRDSExporterParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e AddRDSExporterParamsValidationError) 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 %sAddRDSExporterParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = AddRDSExporterParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = AddRDSExporterParamsValidationError{} - -// Validate checks the field values on ChangeRDSExporterParams 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 *ChangeRDSExporterParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ChangeRDSExporterParams 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 -// ChangeRDSExporterParamsMultiError, or nil if none found. -func (m *ChangeRDSExporterParams) ValidateAll() error { - return m.validate(true) -} - -func (m *ChangeRDSExporterParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if all { - switch v := interface{}(m.GetMetricsResolutions()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeRDSExporterParamsValidationError{ - field: "MetricsResolutions", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeRDSExporterParamsValidationError{ - field: "MetricsResolutions", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMetricsResolutions()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeRDSExporterParamsValidationError{ - field: "MetricsResolutions", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if m.Enable != nil { - // no validation rules for Enable - } - - if m.CustomLabels != nil { - if all { - switch v := interface{}(m.GetCustomLabels()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeRDSExporterParamsValidationError{ - field: "CustomLabels", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeRDSExporterParamsValidationError{ - field: "CustomLabels", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetCustomLabels()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeRDSExporterParamsValidationError{ - field: "CustomLabels", - reason: "embedded message failed validation", - cause: err, - } - } - } - } - - if m.EnablePushMetrics != nil { - // no validation rules for EnablePushMetrics - } - - if len(errors) > 0 { - return ChangeRDSExporterParamsMultiError(errors) - } - - return nil -} - -// ChangeRDSExporterParamsMultiError is an error wrapping multiple validation -// errors returned by ChangeRDSExporterParams.ValidateAll() if the designated -// constraints aren't met. -type ChangeRDSExporterParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ChangeRDSExporterParamsMultiError) 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 ChangeRDSExporterParamsMultiError) AllErrors() []error { return m } - -// ChangeRDSExporterParamsValidationError is the validation error returned by -// ChangeRDSExporterParams.Validate if the designated constraints aren't met. -type ChangeRDSExporterParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ChangeRDSExporterParamsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ChangeRDSExporterParamsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ChangeRDSExporterParamsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ChangeRDSExporterParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ChangeRDSExporterParamsValidationError) ErrorName() string { - return "ChangeRDSExporterParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e ChangeRDSExporterParamsValidationError) 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 %sChangeRDSExporterParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ChangeRDSExporterParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ChangeRDSExporterParamsValidationError{} - -// Validate checks the field values on AddExternalExporterParams 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 *AddExternalExporterParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on AddExternalExporterParams 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 -// AddExternalExporterParamsMultiError, or nil if none found. -func (m *AddExternalExporterParams) ValidateAll() error { - return m.validate(true) -} - -func (m *AddExternalExporterParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetRunsOnNodeId()) < 1 { - err := AddExternalExporterParamsValidationError{ - field: "RunsOnNodeId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for ServiceId - - // no validation rules for Username - - // no validation rules for Password - - // no validation rules for Scheme - - // no validation rules for MetricsPath - - if val := m.GetListenPort(); val <= 0 || val >= 65536 { - err := AddExternalExporterParamsValidationError{ - field: "ListenPort", - reason: "value must be inside range (0, 65536)", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for CustomLabels - - // no validation rules for PushMetrics - - // no validation rules for TlsSkipVerify - - if len(errors) > 0 { - return AddExternalExporterParamsMultiError(errors) - } - - return nil -} - -// AddExternalExporterParamsMultiError is an error wrapping multiple validation -// errors returned by AddExternalExporterParams.ValidateAll() if the -// designated constraints aren't met. -type AddExternalExporterParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m AddExternalExporterParamsMultiError) 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 AddExternalExporterParamsMultiError) AllErrors() []error { return m } - -// AddExternalExporterParamsValidationError is the validation error returned by -// AddExternalExporterParams.Validate if the designated constraints aren't met. -type AddExternalExporterParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e AddExternalExporterParamsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e AddExternalExporterParamsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e AddExternalExporterParamsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e AddExternalExporterParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e AddExternalExporterParamsValidationError) ErrorName() string { - return "AddExternalExporterParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e AddExternalExporterParamsValidationError) 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 %sAddExternalExporterParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = AddExternalExporterParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = AddExternalExporterParamsValidationError{} - -// Validate checks the field values on ChangeExternalExporterParams 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 *ChangeExternalExporterParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ChangeExternalExporterParams 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 -// ChangeExternalExporterParamsMultiError, or nil if none found. -func (m *ChangeExternalExporterParams) ValidateAll() error { - return m.validate(true) -} - -func (m *ChangeExternalExporterParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if all { - switch v := interface{}(m.GetMetricsResolutions()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeExternalExporterParamsValidationError{ - field: "MetricsResolutions", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeExternalExporterParamsValidationError{ - field: "MetricsResolutions", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMetricsResolutions()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeExternalExporterParamsValidationError{ - field: "MetricsResolutions", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if m.Enable != nil { - // no validation rules for Enable - } - - if m.CustomLabels != nil { - if all { - switch v := interface{}(m.GetCustomLabels()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeExternalExporterParamsValidationError{ - field: "CustomLabels", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeExternalExporterParamsValidationError{ - field: "CustomLabels", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetCustomLabels()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeExternalExporterParamsValidationError{ - field: "CustomLabels", - reason: "embedded message failed validation", - cause: err, - } - } - } - } - - if m.EnablePushMetrics != nil { - // no validation rules for EnablePushMetrics - } - - if len(errors) > 0 { - return ChangeExternalExporterParamsMultiError(errors) - } - - return nil -} - -// ChangeExternalExporterParamsMultiError is an error wrapping multiple -// validation errors returned by ChangeExternalExporterParams.ValidateAll() if -// the designated constraints aren't met. -type ChangeExternalExporterParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ChangeExternalExporterParamsMultiError) 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 ChangeExternalExporterParamsMultiError) AllErrors() []error { return m } - -// ChangeExternalExporterParamsValidationError is the validation error returned -// by ChangeExternalExporterParams.Validate if the designated constraints -// aren't met. -type ChangeExternalExporterParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ChangeExternalExporterParamsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ChangeExternalExporterParamsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ChangeExternalExporterParamsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ChangeExternalExporterParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ChangeExternalExporterParamsValidationError) ErrorName() string { - return "ChangeExternalExporterParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e ChangeExternalExporterParamsValidationError) 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 %sChangeExternalExporterParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ChangeExternalExporterParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ChangeExternalExporterParamsValidationError{} - -// Validate checks the field values on AddAzureDatabaseExporterParams 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 *AddAzureDatabaseExporterParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on AddAzureDatabaseExporterParams 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 -// AddAzureDatabaseExporterParamsMultiError, or nil if none found. -func (m *AddAzureDatabaseExporterParams) ValidateAll() error { - return m.validate(true) -} - -func (m *AddAzureDatabaseExporterParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetPmmAgentId()) < 1 { - err := AddAzureDatabaseExporterParamsValidationError{ - field: "PmmAgentId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if utf8.RuneCountInString(m.GetNodeId()) < 1 { - err := AddAzureDatabaseExporterParamsValidationError{ - field: "NodeId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for AzureClientId - - // no validation rules for AzureClientSecret - - // no validation rules for AzureTenantId - - // no validation rules for AzureSubscriptionId - - // no validation rules for AzureResourceGroup - - if utf8.RuneCountInString(m.GetAzureDatabaseResourceType()) < 1 { - err := AddAzureDatabaseExporterParamsValidationError{ - field: "AzureDatabaseResourceType", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for CustomLabels - - // no validation rules for SkipConnectionCheck - - // no validation rules for PushMetrics - - // no validation rules for LogLevel - - if len(errors) > 0 { - return AddAzureDatabaseExporterParamsMultiError(errors) - } - - return nil -} - -// AddAzureDatabaseExporterParamsMultiError is an error wrapping multiple -// validation errors returned by AddAzureDatabaseExporterParams.ValidateAll() -// if the designated constraints aren't met. -type AddAzureDatabaseExporterParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m AddAzureDatabaseExporterParamsMultiError) 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 AddAzureDatabaseExporterParamsMultiError) AllErrors() []error { return m } - -// AddAzureDatabaseExporterParamsValidationError is the validation error -// returned by AddAzureDatabaseExporterParams.Validate if the designated -// constraints aren't met. -type AddAzureDatabaseExporterParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e AddAzureDatabaseExporterParamsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e AddAzureDatabaseExporterParamsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e AddAzureDatabaseExporterParamsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e AddAzureDatabaseExporterParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e AddAzureDatabaseExporterParamsValidationError) ErrorName() string { - return "AddAzureDatabaseExporterParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e AddAzureDatabaseExporterParamsValidationError) 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 %sAddAzureDatabaseExporterParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = AddAzureDatabaseExporterParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = AddAzureDatabaseExporterParamsValidationError{} - -// Validate checks the field values on ChangeAzureDatabaseExporterParams 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 *ChangeAzureDatabaseExporterParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ChangeAzureDatabaseExporterParams -// 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 -// ChangeAzureDatabaseExporterParamsMultiError, or nil if none found. -func (m *ChangeAzureDatabaseExporterParams) ValidateAll() error { - return m.validate(true) -} - -func (m *ChangeAzureDatabaseExporterParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if all { - switch v := interface{}(m.GetMetricsResolutions()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeAzureDatabaseExporterParamsValidationError{ - field: "MetricsResolutions", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeAzureDatabaseExporterParamsValidationError{ - field: "MetricsResolutions", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMetricsResolutions()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeAzureDatabaseExporterParamsValidationError{ - field: "MetricsResolutions", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if m.Enable != nil { - // no validation rules for Enable - } - - if m.CustomLabels != nil { - if all { - switch v := interface{}(m.GetCustomLabels()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeAzureDatabaseExporterParamsValidationError{ - field: "CustomLabels", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeAzureDatabaseExporterParamsValidationError{ - field: "CustomLabels", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetCustomLabels()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeAzureDatabaseExporterParamsValidationError{ - field: "CustomLabels", - reason: "embedded message failed validation", - cause: err, - } - } - } - } - - if m.EnablePushMetrics != nil { - // no validation rules for EnablePushMetrics - } - - if len(errors) > 0 { - return ChangeAzureDatabaseExporterParamsMultiError(errors) - } - - return nil -} - -// ChangeAzureDatabaseExporterParamsMultiError is an error wrapping multiple -// validation errors returned by -// ChangeAzureDatabaseExporterParams.ValidateAll() if the designated -// constraints aren't met. -type ChangeAzureDatabaseExporterParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ChangeAzureDatabaseExporterParamsMultiError) 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 ChangeAzureDatabaseExporterParamsMultiError) AllErrors() []error { return m } - -// ChangeAzureDatabaseExporterParamsValidationError is the validation error -// returned by ChangeAzureDatabaseExporterParams.Validate if the designated -// constraints aren't met. -type ChangeAzureDatabaseExporterParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ChangeAzureDatabaseExporterParamsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ChangeAzureDatabaseExporterParamsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ChangeAzureDatabaseExporterParamsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ChangeAzureDatabaseExporterParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ChangeAzureDatabaseExporterParamsValidationError) ErrorName() string { - return "ChangeAzureDatabaseExporterParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e ChangeAzureDatabaseExporterParamsValidationError) 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 %sChangeAzureDatabaseExporterParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ChangeAzureDatabaseExporterParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ChangeAzureDatabaseExporterParamsValidationError{} - -// Validate checks the field values on ChangeNomadAgentParams 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 *ChangeNomadAgentParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ChangeNomadAgentParams 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 -// ChangeNomadAgentParamsMultiError, or nil if none found. -func (m *ChangeNomadAgentParams) ValidateAll() error { - return m.validate(true) -} - -func (m *ChangeNomadAgentParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if m.Enable != nil { - // no validation rules for Enable - } - - if len(errors) > 0 { - return ChangeNomadAgentParamsMultiError(errors) - } - - return nil -} - -// ChangeNomadAgentParamsMultiError is an error wrapping multiple validation -// errors returned by ChangeNomadAgentParams.ValidateAll() if the designated -// constraints aren't met. -type ChangeNomadAgentParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ChangeNomadAgentParamsMultiError) 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 ChangeNomadAgentParamsMultiError) AllErrors() []error { return m } - -// ChangeNomadAgentParamsValidationError is the validation error returned by -// ChangeNomadAgentParams.Validate if the designated constraints aren't met. -type ChangeNomadAgentParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ChangeNomadAgentParamsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ChangeNomadAgentParamsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ChangeNomadAgentParamsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ChangeNomadAgentParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ChangeNomadAgentParamsValidationError) ErrorName() string { - return "ChangeNomadAgentParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e ChangeNomadAgentParamsValidationError) 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 %sChangeNomadAgentParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ChangeNomadAgentParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ChangeNomadAgentParamsValidationError{} - -// Validate checks the field values on AddValkeyExporterParams 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 *AddValkeyExporterParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on AddValkeyExporterParams 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 -// AddValkeyExporterParamsMultiError, or nil if none found. -func (m *AddValkeyExporterParams) ValidateAll() error { - return m.validate(true) -} - -func (m *AddValkeyExporterParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetPmmAgentId()) < 1 { - err := AddValkeyExporterParamsValidationError{ - field: "PmmAgentId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if err := m._validateUuid(m.GetServiceId()); err != nil { - err = AddValkeyExporterParamsValidationError{ - field: "ServiceId", - reason: "value must be a valid UUID", - cause: err, - } - if !all { - return err - } - errors = append(errors, err) - } - - if utf8.RuneCountInString(m.GetUsername()) < 1 { - err := AddValkeyExporterParamsValidationError{ - field: "Username", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for Password - - // no validation rules for Tls - - // no validation rules for TlsSkipVerify - - // no validation rules for CustomLabels - - // no validation rules for SkipConnectionCheck - - // no validation rules for PushMetrics - - // no validation rules for TlsCa - - // no validation rules for TlsCert - - // no validation rules for TlsKey - - // no validation rules for AgentPassword - - // no validation rules for ExposeExporter - - if len(errors) > 0 { - return AddValkeyExporterParamsMultiError(errors) - } - - return nil -} - -func (m *AddValkeyExporterParams) _validateUuid(uuid string) error { - if matched := _agents_uuidPattern.MatchString(uuid); !matched { - return errors.New("invalid uuid format") - } - - return nil -} - -// AddValkeyExporterParamsMultiError is an error wrapping multiple validation -// errors returned by AddValkeyExporterParams.ValidateAll() if the designated -// constraints aren't met. -type AddValkeyExporterParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m AddValkeyExporterParamsMultiError) 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 AddValkeyExporterParamsMultiError) AllErrors() []error { return m } - -// AddValkeyExporterParamsValidationError is the validation error returned by -// AddValkeyExporterParams.Validate if the designated constraints aren't met. -type AddValkeyExporterParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e AddValkeyExporterParamsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e AddValkeyExporterParamsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e AddValkeyExporterParamsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e AddValkeyExporterParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e AddValkeyExporterParamsValidationError) ErrorName() string { - return "AddValkeyExporterParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e AddValkeyExporterParamsValidationError) 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 %sAddValkeyExporterParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = AddValkeyExporterParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = AddValkeyExporterParamsValidationError{} - -// Validate checks the field values on ChangeValkeyExporterParams 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 *ChangeValkeyExporterParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ChangeValkeyExporterParams 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 -// ChangeValkeyExporterParamsMultiError, or nil if none found. -func (m *ChangeValkeyExporterParams) ValidateAll() error { - return m.validate(true) -} - -func (m *ChangeValkeyExporterParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if all { - switch v := interface{}(m.GetMetricsResolutions()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeValkeyExporterParamsValidationError{ - field: "MetricsResolutions", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeValkeyExporterParamsValidationError{ - field: "MetricsResolutions", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMetricsResolutions()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeValkeyExporterParamsValidationError{ - field: "MetricsResolutions", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if m.Enable != nil { - // no validation rules for Enable - } - - if m.CustomLabels != nil { - if all { - switch v := interface{}(m.GetCustomLabels()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeValkeyExporterParamsValidationError{ - field: "CustomLabels", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeValkeyExporterParamsValidationError{ - field: "CustomLabels", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetCustomLabels()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeValkeyExporterParamsValidationError{ - field: "CustomLabels", - reason: "embedded message failed validation", - cause: err, - } - } - } - } - - if m.EnablePushMetrics != nil { - // no validation rules for EnablePushMetrics - } - - if len(errors) > 0 { - return ChangeValkeyExporterParamsMultiError(errors) - } - - return nil -} - -// ChangeValkeyExporterParamsMultiError is an error wrapping multiple -// validation errors returned by ChangeValkeyExporterParams.ValidateAll() if -// the designated constraints aren't met. -type ChangeValkeyExporterParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ChangeValkeyExporterParamsMultiError) 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 ChangeValkeyExporterParamsMultiError) AllErrors() []error { return m } - -// ChangeValkeyExporterParamsValidationError is the validation error returned -// by ChangeValkeyExporterParams.Validate if the designated constraints aren't met. -type ChangeValkeyExporterParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ChangeValkeyExporterParamsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ChangeValkeyExporterParamsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ChangeValkeyExporterParamsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ChangeValkeyExporterParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ChangeValkeyExporterParamsValidationError) ErrorName() string { - return "ChangeValkeyExporterParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e ChangeValkeyExporterParamsValidationError) 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 %sChangeValkeyExporterParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ChangeValkeyExporterParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ChangeValkeyExporterParamsValidationError{} - -// Validate checks the field values on RemoveAgentRequest 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 *RemoveAgentRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on RemoveAgentRequest 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 -// RemoveAgentRequestMultiError, or nil if none found. -func (m *RemoveAgentRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *RemoveAgentRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetAgentId()) < 1 { - err := RemoveAgentRequestValidationError{ - field: "AgentId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for Force - - if len(errors) > 0 { - return RemoveAgentRequestMultiError(errors) - } - - return nil -} - -// RemoveAgentRequestMultiError is an error wrapping multiple validation errors -// returned by RemoveAgentRequest.ValidateAll() if the designated constraints -// aren't met. -type RemoveAgentRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m RemoveAgentRequestMultiError) 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 RemoveAgentRequestMultiError) AllErrors() []error { return m } - -// RemoveAgentRequestValidationError is the validation error returned by -// RemoveAgentRequest.Validate if the designated constraints aren't met. -type RemoveAgentRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e RemoveAgentRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e RemoveAgentRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e RemoveAgentRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e RemoveAgentRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e RemoveAgentRequestValidationError) ErrorName() string { - return "RemoveAgentRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e RemoveAgentRequestValidationError) 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 %sRemoveAgentRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = RemoveAgentRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = RemoveAgentRequestValidationError{} - -// Validate checks the field values on RemoveAgentResponse 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 *RemoveAgentResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on RemoveAgentResponse 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 -// RemoveAgentResponseMultiError, or nil if none found. -func (m *RemoveAgentResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *RemoveAgentResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return RemoveAgentResponseMultiError(errors) - } - - return nil -} - -// RemoveAgentResponseMultiError is an error wrapping multiple validation -// errors returned by RemoveAgentResponse.ValidateAll() if the designated -// constraints aren't met. -type RemoveAgentResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m RemoveAgentResponseMultiError) 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 RemoveAgentResponseMultiError) AllErrors() []error { return m } - -// RemoveAgentResponseValidationError is the validation error returned by -// RemoveAgentResponse.Validate if the designated constraints aren't met. -type RemoveAgentResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e RemoveAgentResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e RemoveAgentResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e RemoveAgentResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e RemoveAgentResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e RemoveAgentResponseValidationError) ErrorName() string { - return "RemoveAgentResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e RemoveAgentResponseValidationError) 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 %sRemoveAgentResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = RemoveAgentResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = RemoveAgentResponseValidationError{} diff --git a/api/inventory/v1/agents_grpc.pb.go b/api/inventory/v1/agents_grpc.pb.go deleted file mode 100644 index 0b4c6fc63e1..00000000000 --- a/api/inventory/v1/agents_grpc.pb.go +++ /dev/null @@ -1,333 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.6.0 -// - protoc (unknown) -// source: inventory/v1/agents.proto - -package inventoryv1 - -import ( - context "context" - - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.64.0 or later. -const _ = grpc.SupportPackageIsVersion9 - -const ( - AgentsService_ListAgents_FullMethodName = "/inventory.v1.AgentsService/ListAgents" - AgentsService_GetAgent_FullMethodName = "/inventory.v1.AgentsService/GetAgent" - AgentsService_GetAgentLogs_FullMethodName = "/inventory.v1.AgentsService/GetAgentLogs" - AgentsService_AddAgent_FullMethodName = "/inventory.v1.AgentsService/AddAgent" - AgentsService_ChangeAgent_FullMethodName = "/inventory.v1.AgentsService/ChangeAgent" - AgentsService_RemoveAgent_FullMethodName = "/inventory.v1.AgentsService/RemoveAgent" -) - -// AgentsServiceClient is the client API for AgentsService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -// -// Agents service provides public methods for managing Agents. -type AgentsServiceClient interface { - // ListAgents returns a list of all Agents. - ListAgents(ctx context.Context, in *ListAgentsRequest, opts ...grpc.CallOption) (*ListAgentsResponse, error) - // GetAgent returns a single Agent by ID. - GetAgent(ctx context.Context, in *GetAgentRequest, opts ...grpc.CallOption) (*GetAgentResponse, error) - // GetAgentLogs returns Agent logs by ID. - GetAgentLogs(ctx context.Context, in *GetAgentLogsRequest, opts ...grpc.CallOption) (*GetAgentLogsResponse, error) - // AddAgent adds an Agent to Inventory. - AddAgent(ctx context.Context, in *AddAgentRequest, opts ...grpc.CallOption) (*AddAgentResponse, error) - // ChangeAgent changes a subset of attributes of the Agent record in Inventory. - ChangeAgent(ctx context.Context, in *ChangeAgentRequest, opts ...grpc.CallOption) (*ChangeAgentResponse, error) - // RemoveAgent removes an Agent. - RemoveAgent(ctx context.Context, in *RemoveAgentRequest, opts ...grpc.CallOption) (*RemoveAgentResponse, error) -} - -type agentsServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewAgentsServiceClient(cc grpc.ClientConnInterface) AgentsServiceClient { - return &agentsServiceClient{cc} -} - -func (c *agentsServiceClient) ListAgents(ctx context.Context, in *ListAgentsRequest, opts ...grpc.CallOption) (*ListAgentsResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(ListAgentsResponse) - err := c.cc.Invoke(ctx, AgentsService_ListAgents_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *agentsServiceClient) GetAgent(ctx context.Context, in *GetAgentRequest, opts ...grpc.CallOption) (*GetAgentResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetAgentResponse) - err := c.cc.Invoke(ctx, AgentsService_GetAgent_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *agentsServiceClient) GetAgentLogs(ctx context.Context, in *GetAgentLogsRequest, opts ...grpc.CallOption) (*GetAgentLogsResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetAgentLogsResponse) - err := c.cc.Invoke(ctx, AgentsService_GetAgentLogs_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *agentsServiceClient) AddAgent(ctx context.Context, in *AddAgentRequest, opts ...grpc.CallOption) (*AddAgentResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(AddAgentResponse) - err := c.cc.Invoke(ctx, AgentsService_AddAgent_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *agentsServiceClient) ChangeAgent(ctx context.Context, in *ChangeAgentRequest, opts ...grpc.CallOption) (*ChangeAgentResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(ChangeAgentResponse) - err := c.cc.Invoke(ctx, AgentsService_ChangeAgent_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *agentsServiceClient) RemoveAgent(ctx context.Context, in *RemoveAgentRequest, opts ...grpc.CallOption) (*RemoveAgentResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(RemoveAgentResponse) - err := c.cc.Invoke(ctx, AgentsService_RemoveAgent_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -// AgentsServiceServer is the server API for AgentsService service. -// All implementations must embed UnimplementedAgentsServiceServer -// for forward compatibility. -// -// Agents service provides public methods for managing Agents. -type AgentsServiceServer interface { - // ListAgents returns a list of all Agents. - ListAgents(context.Context, *ListAgentsRequest) (*ListAgentsResponse, error) - // GetAgent returns a single Agent by ID. - GetAgent(context.Context, *GetAgentRequest) (*GetAgentResponse, error) - // GetAgentLogs returns Agent logs by ID. - GetAgentLogs(context.Context, *GetAgentLogsRequest) (*GetAgentLogsResponse, error) - // AddAgent adds an Agent to Inventory. - AddAgent(context.Context, *AddAgentRequest) (*AddAgentResponse, error) - // ChangeAgent changes a subset of attributes of the Agent record in Inventory. - ChangeAgent(context.Context, *ChangeAgentRequest) (*ChangeAgentResponse, error) - // RemoveAgent removes an Agent. - RemoveAgent(context.Context, *RemoveAgentRequest) (*RemoveAgentResponse, error) - mustEmbedUnimplementedAgentsServiceServer() -} - -// UnimplementedAgentsServiceServer must be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -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") -} -func (UnimplementedAgentsServiceServer) mustEmbedUnimplementedAgentsServiceServer() {} -func (UnimplementedAgentsServiceServer) testEmbeddedByValue() {} - -// UnsafeAgentsServiceServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to AgentsServiceServer will -// result in compilation errors. -type UnsafeAgentsServiceServer interface { - mustEmbedUnimplementedAgentsServiceServer() -} - -func RegisterAgentsServiceServer(s grpc.ServiceRegistrar, srv AgentsServiceServer) { - // If the following call panics, it indicates UnimplementedAgentsServiceServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } - s.RegisterService(&AgentsService_ServiceDesc, srv) -} - -func _AgentsService_ListAgents_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListAgentsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AgentsServiceServer).ListAgents(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: AgentsService_ListAgents_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AgentsServiceServer).ListAgents(ctx, req.(*ListAgentsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AgentsService_GetAgent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetAgentRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AgentsServiceServer).GetAgent(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: AgentsService_GetAgent_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AgentsServiceServer).GetAgent(ctx, req.(*GetAgentRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AgentsService_GetAgentLogs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetAgentLogsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AgentsServiceServer).GetAgentLogs(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: AgentsService_GetAgentLogs_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AgentsServiceServer).GetAgentLogs(ctx, req.(*GetAgentLogsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AgentsService_AddAgent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AddAgentRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AgentsServiceServer).AddAgent(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: AgentsService_AddAgent_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AgentsServiceServer).AddAgent(ctx, req.(*AddAgentRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AgentsService_ChangeAgent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ChangeAgentRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AgentsServiceServer).ChangeAgent(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: AgentsService_ChangeAgent_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AgentsServiceServer).ChangeAgent(ctx, req.(*ChangeAgentRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AgentsService_RemoveAgent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RemoveAgentRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AgentsServiceServer).RemoveAgent(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: AgentsService_RemoveAgent_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AgentsServiceServer).RemoveAgent(ctx, req.(*RemoveAgentRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// AgentsService_ServiceDesc is the grpc.ServiceDesc for AgentsService service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var AgentsService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "inventory.v1.AgentsService", - HandlerType: (*AgentsServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "ListAgents", - Handler: _AgentsService_ListAgents_Handler, - }, - { - MethodName: "GetAgent", - Handler: _AgentsService_GetAgent_Handler, - }, - { - MethodName: "GetAgentLogs", - Handler: _AgentsService_GetAgentLogs_Handler, - }, - { - MethodName: "AddAgent", - Handler: _AgentsService_AddAgent_Handler, - }, - { - MethodName: "ChangeAgent", - Handler: _AgentsService_ChangeAgent_Handler, - }, - { - MethodName: "RemoveAgent", - Handler: _AgentsService_RemoveAgent_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "inventory/v1/agents.proto", -} diff --git a/api/inventory/v1/json/client/agents_service/add_agent_parameters.go b/api/inventory/v1/json/client/agents_service/add_agent_parameters.go deleted file mode 100644 index eca45926526..00000000000 --- a/api/inventory/v1/json/client/agents_service/add_agent_parameters.go +++ /dev/null @@ -1,144 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package agents_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" -) - -// NewAddAgentParams creates a new AddAgentParams 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 NewAddAgentParams() *AddAgentParams { - return &AddAgentParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewAddAgentParamsWithTimeout creates a new AddAgentParams object -// with the ability to set a timeout on a request. -func NewAddAgentParamsWithTimeout(timeout time.Duration) *AddAgentParams { - return &AddAgentParams{ - timeout: timeout, - } -} - -// NewAddAgentParamsWithContext creates a new AddAgentParams object -// with the ability to set a context for a request. -func NewAddAgentParamsWithContext(ctx context.Context) *AddAgentParams { - return &AddAgentParams{ - Context: ctx, - } -} - -// NewAddAgentParamsWithHTTPClient creates a new AddAgentParams object -// with the ability to set a custom HTTPClient for a request. -func NewAddAgentParamsWithHTTPClient(client *http.Client) *AddAgentParams { - return &AddAgentParams{ - HTTPClient: client, - } -} - -/* -AddAgentParams contains all the parameters to send to the API endpoint - - for the add agent operation. - - Typically these are written to a http.Request. -*/ -type AddAgentParams struct { - // Body. - Body AddAgentBody - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the add agent params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *AddAgentParams) WithDefaults() *AddAgentParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the add agent params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *AddAgentParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the add agent params -func (o *AddAgentParams) WithTimeout(timeout time.Duration) *AddAgentParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the add agent params -func (o *AddAgentParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the add agent params -func (o *AddAgentParams) WithContext(ctx context.Context) *AddAgentParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the add agent params -func (o *AddAgentParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the add agent params -func (o *AddAgentParams) WithHTTPClient(client *http.Client) *AddAgentParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the add agent params -func (o *AddAgentParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the add agent params -func (o *AddAgentParams) WithBody(body AddAgentBody) *AddAgentParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the add agent params -func (o *AddAgentParams) SetBody(body AddAgentBody) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *AddAgentParams) 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/inventory/v1/json/client/agents_service/add_agent_responses.go b/api/inventory/v1/json/client/agents_service/add_agent_responses.go deleted file mode 100644 index 9137686f21d..00000000000 --- a/api/inventory/v1/json/client/agents_service/add_agent_responses.go +++ /dev/null @@ -1,8496 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package agents_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" -) - -// AddAgentReader is a Reader for the AddAgent structure. -type AddAgentReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *AddAgentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewAddAgentOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewAddAgentDefault(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 - } -} - -// NewAddAgentOK creates a AddAgentOK with default headers values -func NewAddAgentOK() *AddAgentOK { - return &AddAgentOK{} -} - -/* -AddAgentOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type AddAgentOK struct { - Payload *AddAgentOKBody -} - -// IsSuccess returns true when this add agent Ok response has a 2xx status code -func (o *AddAgentOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this add agent Ok response has a 3xx status code -func (o *AddAgentOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this add agent Ok response has a 4xx status code -func (o *AddAgentOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this add agent Ok response has a 5xx status code -func (o *AddAgentOK) IsServerError() bool { - return false -} - -// IsCode returns true when this add agent Ok response a status code equal to that given -func (o *AddAgentOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the add agent Ok response -func (o *AddAgentOK) Code() int { - return 200 -} - -func (o *AddAgentOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/inventory/agents][%d] addAgentOk %s", 200, payload) -} - -func (o *AddAgentOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/inventory/agents][%d] addAgentOk %s", 200, payload) -} - -func (o *AddAgentOK) GetPayload() *AddAgentOKBody { - return o.Payload -} - -func (o *AddAgentOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(AddAgentOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -// NewAddAgentDefault creates a AddAgentDefault with default headers values -func NewAddAgentDefault(code int) *AddAgentDefault { - return &AddAgentDefault{ - _statusCode: code, - } -} - -/* -AddAgentDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type AddAgentDefault struct { - _statusCode int - - Payload *AddAgentDefaultBody -} - -// IsSuccess returns true when this add agent default response has a 2xx status code -func (o *AddAgentDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this add agent default response has a 3xx status code -func (o *AddAgentDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this add agent default response has a 4xx status code -func (o *AddAgentDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this add agent default response has a 5xx status code -func (o *AddAgentDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this add agent default response a status code equal to that given -func (o *AddAgentDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the add agent default response -func (o *AddAgentDefault) Code() int { - return o._statusCode -} - -func (o *AddAgentDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/inventory/agents][%d] AddAgent default %s", o._statusCode, payload) -} - -func (o *AddAgentDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/inventory/agents][%d] AddAgent default %s", o._statusCode, payload) -} - -func (o *AddAgentDefault) GetPayload() *AddAgentDefaultBody { - return o.Payload -} - -func (o *AddAgentDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(AddAgentDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -AddAgentBody add agent body -swagger:model AddAgentBody -*/ -type AddAgentBody struct { - // azure database exporter - AzureDatabaseExporter *AddAgentParamsBodyAzureDatabaseExporter `json:"azure_database_exporter,omitempty"` - - // external exporter - ExternalExporter *AddAgentParamsBodyExternalExporter `json:"external_exporter,omitempty"` - - // mongodb exporter - MongodbExporter *AddAgentParamsBodyMongodbExporter `json:"mongodb_exporter,omitempty"` - - // mysqld exporter - MysqldExporter *AddAgentParamsBodyMysqldExporter `json:"mysqld_exporter,omitempty"` - - // node exporter - NodeExporter *AddAgentParamsBodyNodeExporter `json:"node_exporter,omitempty"` - - // pmm agent - PMMAgent *AddAgentParamsBodyPMMAgent `json:"pmm_agent,omitempty"` - - // postgres exporter - PostgresExporter *AddAgentParamsBodyPostgresExporter `json:"postgres_exporter,omitempty"` - - // proxysql exporter - ProxysqlExporter *AddAgentParamsBodyProxysqlExporter `json:"proxysql_exporter,omitempty"` - - // qan mongodb mongolog agent - QANMongodbMongologAgent *AddAgentParamsBodyQANMongodbMongologAgent `json:"qan_mongodb_mongolog_agent,omitempty"` - - // qan mongodb profiler agent - QANMongodbProfilerAgent *AddAgentParamsBodyQANMongodbProfilerAgent `json:"qan_mongodb_profiler_agent,omitempty"` - - // qan mysql perfschema agent - QANMysqlPerfschemaAgent *AddAgentParamsBodyQANMysqlPerfschemaAgent `json:"qan_mysql_perfschema_agent,omitempty"` - - // qan mysql slowlog agent - QANMysqlSlowlogAgent *AddAgentParamsBodyQANMysqlSlowlogAgent `json:"qan_mysql_slowlog_agent,omitempty"` - - // qan postgresql pgstatements agent - QANPostgresqlPgstatementsAgent *AddAgentParamsBodyQANPostgresqlPgstatementsAgent `json:"qan_postgresql_pgstatements_agent,omitempty"` - - // qan postgresql pgstatmonitor agent - QANPostgresqlPgstatmonitorAgent *AddAgentParamsBodyQANPostgresqlPgstatmonitorAgent `json:"qan_postgresql_pgstatmonitor_agent,omitempty"` - - // rds exporter - RDSExporter *AddAgentParamsBodyRDSExporter `json:"rds_exporter,omitempty"` - - // valkey exporter - ValkeyExporter *AddAgentParamsBodyValkeyExporter `json:"valkey_exporter,omitempty"` -} - -// Validate validates this add agent body -func (o *AddAgentBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateAzureDatabaseExporter(formats); err != nil { - res = append(res, err) - } - - if err := o.validateExternalExporter(formats); err != nil { - res = append(res, err) - } - - if err := o.validateMongodbExporter(formats); err != nil { - res = append(res, err) - } - - if err := o.validateMysqldExporter(formats); err != nil { - res = append(res, err) - } - - if err := o.validateNodeExporter(formats); err != nil { - res = append(res, err) - } - - if err := o.validatePMMAgent(formats); err != nil { - res = append(res, err) - } - - if err := o.validatePostgresExporter(formats); err != nil { - res = append(res, err) - } - - if err := o.validateProxysqlExporter(formats); err != nil { - res = append(res, err) - } - - if err := o.validateQANMongodbMongologAgent(formats); err != nil { - res = append(res, err) - } - - if err := o.validateQANMongodbProfilerAgent(formats); err != nil { - res = append(res, err) - } - - if err := o.validateQANMysqlPerfschemaAgent(formats); err != nil { - res = append(res, err) - } - - if err := o.validateQANMysqlSlowlogAgent(formats); err != nil { - res = append(res, err) - } - - if err := o.validateQANPostgresqlPgstatementsAgent(formats); err != nil { - res = append(res, err) - } - - if err := o.validateQANPostgresqlPgstatmonitorAgent(formats); err != nil { - res = append(res, err) - } - - if err := o.validateRDSExporter(formats); err != nil { - res = append(res, err) - } - - if err := o.validateValkeyExporter(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *AddAgentBody) validateAzureDatabaseExporter(formats strfmt.Registry) error { - if swag.IsZero(o.AzureDatabaseExporter) { // not required - return nil - } - - if o.AzureDatabaseExporter != nil { - if err := o.AzureDatabaseExporter.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "azure_database_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "azure_database_exporter") - } - - return err - } - } - - return nil -} - -func (o *AddAgentBody) validateExternalExporter(formats strfmt.Registry) error { - if swag.IsZero(o.ExternalExporter) { // not required - return nil - } - - if o.ExternalExporter != nil { - if err := o.ExternalExporter.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "external_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "external_exporter") - } - - return err - } - } - - return nil -} - -func (o *AddAgentBody) validateMongodbExporter(formats strfmt.Registry) error { - if swag.IsZero(o.MongodbExporter) { // not required - return nil - } - - if o.MongodbExporter != nil { - if err := o.MongodbExporter.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "mongodb_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "mongodb_exporter") - } - - return err - } - } - - return nil -} - -func (o *AddAgentBody) validateMysqldExporter(formats strfmt.Registry) error { - if swag.IsZero(o.MysqldExporter) { // not required - return nil - } - - if o.MysqldExporter != nil { - if err := o.MysqldExporter.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "mysqld_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "mysqld_exporter") - } - - return err - } - } - - return nil -} - -func (o *AddAgentBody) validateNodeExporter(formats strfmt.Registry) error { - if swag.IsZero(o.NodeExporter) { // not required - return nil - } - - if o.NodeExporter != nil { - if err := o.NodeExporter.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "node_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "node_exporter") - } - - return err - } - } - - return nil -} - -func (o *AddAgentBody) validatePMMAgent(formats strfmt.Registry) error { - if swag.IsZero(o.PMMAgent) { // not required - return nil - } - - if o.PMMAgent != nil { - if err := o.PMMAgent.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "pmm_agent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "pmm_agent") - } - - return err - } - } - - return nil -} - -func (o *AddAgentBody) validatePostgresExporter(formats strfmt.Registry) error { - if swag.IsZero(o.PostgresExporter) { // not required - return nil - } - - if o.PostgresExporter != nil { - if err := o.PostgresExporter.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "postgres_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "postgres_exporter") - } - - return err - } - } - - return nil -} - -func (o *AddAgentBody) validateProxysqlExporter(formats strfmt.Registry) error { - if swag.IsZero(o.ProxysqlExporter) { // not required - return nil - } - - if o.ProxysqlExporter != nil { - if err := o.ProxysqlExporter.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "proxysql_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "proxysql_exporter") - } - - return err - } - } - - return nil -} - -func (o *AddAgentBody) validateQANMongodbMongologAgent(formats strfmt.Registry) error { - if swag.IsZero(o.QANMongodbMongologAgent) { // not required - return nil - } - - if o.QANMongodbMongologAgent != nil { - if err := o.QANMongodbMongologAgent.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "qan_mongodb_mongolog_agent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "qan_mongodb_mongolog_agent") - } - - return err - } - } - - return nil -} - -func (o *AddAgentBody) validateQANMongodbProfilerAgent(formats strfmt.Registry) error { - if swag.IsZero(o.QANMongodbProfilerAgent) { // not required - return nil - } - - if o.QANMongodbProfilerAgent != nil { - if err := o.QANMongodbProfilerAgent.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "qan_mongodb_profiler_agent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "qan_mongodb_profiler_agent") - } - - return err - } - } - - return nil -} - -func (o *AddAgentBody) validateQANMysqlPerfschemaAgent(formats strfmt.Registry) error { - if swag.IsZero(o.QANMysqlPerfschemaAgent) { // not required - return nil - } - - if o.QANMysqlPerfschemaAgent != nil { - if err := o.QANMysqlPerfschemaAgent.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "qan_mysql_perfschema_agent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "qan_mysql_perfschema_agent") - } - - return err - } - } - - return nil -} - -func (o *AddAgentBody) validateQANMysqlSlowlogAgent(formats strfmt.Registry) error { - if swag.IsZero(o.QANMysqlSlowlogAgent) { // not required - return nil - } - - if o.QANMysqlSlowlogAgent != nil { - if err := o.QANMysqlSlowlogAgent.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "qan_mysql_slowlog_agent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "qan_mysql_slowlog_agent") - } - - return err - } - } - - return nil -} - -func (o *AddAgentBody) validateQANPostgresqlPgstatementsAgent(formats strfmt.Registry) error { - if swag.IsZero(o.QANPostgresqlPgstatementsAgent) { // not required - return nil - } - - if o.QANPostgresqlPgstatementsAgent != nil { - if err := o.QANPostgresqlPgstatementsAgent.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "qan_postgresql_pgstatements_agent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "qan_postgresql_pgstatements_agent") - } - - return err - } - } - - return nil -} - -func (o *AddAgentBody) validateQANPostgresqlPgstatmonitorAgent(formats strfmt.Registry) error { - if swag.IsZero(o.QANPostgresqlPgstatmonitorAgent) { // not required - return nil - } - - if o.QANPostgresqlPgstatmonitorAgent != nil { - if err := o.QANPostgresqlPgstatmonitorAgent.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "qan_postgresql_pgstatmonitor_agent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "qan_postgresql_pgstatmonitor_agent") - } - - return err - } - } - - return nil -} - -func (o *AddAgentBody) validateRDSExporter(formats strfmt.Registry) error { - if swag.IsZero(o.RDSExporter) { // not required - return nil - } - - if o.RDSExporter != nil { - if err := o.RDSExporter.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "rds_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "rds_exporter") - } - - return err - } - } - - return nil -} - -func (o *AddAgentBody) validateValkeyExporter(formats strfmt.Registry) error { - if swag.IsZero(o.ValkeyExporter) { // not required - return nil - } - - if o.ValkeyExporter != nil { - if err := o.ValkeyExporter.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "valkey_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "valkey_exporter") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this add agent body based on the context it is used -func (o *AddAgentBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateAzureDatabaseExporter(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateExternalExporter(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateMongodbExporter(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateMysqldExporter(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateNodeExporter(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidatePMMAgent(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidatePostgresExporter(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateProxysqlExporter(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateQANMongodbMongologAgent(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateQANMongodbProfilerAgent(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateQANMysqlPerfschemaAgent(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateQANMysqlSlowlogAgent(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateQANPostgresqlPgstatementsAgent(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateQANPostgresqlPgstatmonitorAgent(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateRDSExporter(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateValkeyExporter(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *AddAgentBody) contextValidateAzureDatabaseExporter(ctx context.Context, formats strfmt.Registry) error { - if o.AzureDatabaseExporter != nil { - - if swag.IsZero(o.AzureDatabaseExporter) { // not required - return nil - } - - if err := o.AzureDatabaseExporter.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "azure_database_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "azure_database_exporter") - } - - return err - } - } - - return nil -} - -func (o *AddAgentBody) contextValidateExternalExporter(ctx context.Context, formats strfmt.Registry) error { - if o.ExternalExporter != nil { - - if swag.IsZero(o.ExternalExporter) { // not required - return nil - } - - if err := o.ExternalExporter.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "external_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "external_exporter") - } - - return err - } - } - - return nil -} - -func (o *AddAgentBody) contextValidateMongodbExporter(ctx context.Context, formats strfmt.Registry) error { - if o.MongodbExporter != nil { - - if swag.IsZero(o.MongodbExporter) { // not required - return nil - } - - if err := o.MongodbExporter.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "mongodb_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "mongodb_exporter") - } - - return err - } - } - - return nil -} - -func (o *AddAgentBody) contextValidateMysqldExporter(ctx context.Context, formats strfmt.Registry) error { - if o.MysqldExporter != nil { - - if swag.IsZero(o.MysqldExporter) { // not required - return nil - } - - if err := o.MysqldExporter.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "mysqld_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "mysqld_exporter") - } - - return err - } - } - - return nil -} - -func (o *AddAgentBody) contextValidateNodeExporter(ctx context.Context, formats strfmt.Registry) error { - if o.NodeExporter != nil { - - if swag.IsZero(o.NodeExporter) { // not required - return nil - } - - if err := o.NodeExporter.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "node_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "node_exporter") - } - - return err - } - } - - return nil -} - -func (o *AddAgentBody) contextValidatePMMAgent(ctx context.Context, formats strfmt.Registry) error { - if o.PMMAgent != nil { - - if swag.IsZero(o.PMMAgent) { // not required - return nil - } - - if err := o.PMMAgent.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "pmm_agent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "pmm_agent") - } - - return err - } - } - - return nil -} - -func (o *AddAgentBody) contextValidatePostgresExporter(ctx context.Context, formats strfmt.Registry) error { - if o.PostgresExporter != nil { - - if swag.IsZero(o.PostgresExporter) { // not required - return nil - } - - if err := o.PostgresExporter.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "postgres_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "postgres_exporter") - } - - return err - } - } - - return nil -} - -func (o *AddAgentBody) contextValidateProxysqlExporter(ctx context.Context, formats strfmt.Registry) error { - if o.ProxysqlExporter != nil { - - if swag.IsZero(o.ProxysqlExporter) { // not required - return nil - } - - if err := o.ProxysqlExporter.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "proxysql_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "proxysql_exporter") - } - - return err - } - } - - return nil -} - -func (o *AddAgentBody) contextValidateQANMongodbMongologAgent(ctx context.Context, formats strfmt.Registry) error { - if o.QANMongodbMongologAgent != nil { - - if swag.IsZero(o.QANMongodbMongologAgent) { // not required - return nil - } - - if err := o.QANMongodbMongologAgent.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "qan_mongodb_mongolog_agent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "qan_mongodb_mongolog_agent") - } - - return err - } - } - - return nil -} - -func (o *AddAgentBody) contextValidateQANMongodbProfilerAgent(ctx context.Context, formats strfmt.Registry) error { - if o.QANMongodbProfilerAgent != nil { - - if swag.IsZero(o.QANMongodbProfilerAgent) { // not required - return nil - } - - if err := o.QANMongodbProfilerAgent.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "qan_mongodb_profiler_agent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "qan_mongodb_profiler_agent") - } - - return err - } - } - - return nil -} - -func (o *AddAgentBody) contextValidateQANMysqlPerfschemaAgent(ctx context.Context, formats strfmt.Registry) error { - if o.QANMysqlPerfschemaAgent != nil { - - if swag.IsZero(o.QANMysqlPerfschemaAgent) { // not required - return nil - } - - if err := o.QANMysqlPerfschemaAgent.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "qan_mysql_perfschema_agent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "qan_mysql_perfschema_agent") - } - - return err - } - } - - return nil -} - -func (o *AddAgentBody) contextValidateQANMysqlSlowlogAgent(ctx context.Context, formats strfmt.Registry) error { - if o.QANMysqlSlowlogAgent != nil { - - if swag.IsZero(o.QANMysqlSlowlogAgent) { // not required - return nil - } - - if err := o.QANMysqlSlowlogAgent.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "qan_mysql_slowlog_agent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "qan_mysql_slowlog_agent") - } - - return err - } - } - - return nil -} - -func (o *AddAgentBody) contextValidateQANPostgresqlPgstatementsAgent(ctx context.Context, formats strfmt.Registry) error { - if o.QANPostgresqlPgstatementsAgent != nil { - - if swag.IsZero(o.QANPostgresqlPgstatementsAgent) { // not required - return nil - } - - if err := o.QANPostgresqlPgstatementsAgent.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "qan_postgresql_pgstatements_agent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "qan_postgresql_pgstatements_agent") - } - - return err - } - } - - return nil -} - -func (o *AddAgentBody) contextValidateQANPostgresqlPgstatmonitorAgent(ctx context.Context, formats strfmt.Registry) error { - if o.QANPostgresqlPgstatmonitorAgent != nil { - - if swag.IsZero(o.QANPostgresqlPgstatmonitorAgent) { // not required - return nil - } - - if err := o.QANPostgresqlPgstatmonitorAgent.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "qan_postgresql_pgstatmonitor_agent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "qan_postgresql_pgstatmonitor_agent") - } - - return err - } - } - - return nil -} - -func (o *AddAgentBody) contextValidateRDSExporter(ctx context.Context, formats strfmt.Registry) error { - if o.RDSExporter != nil { - - if swag.IsZero(o.RDSExporter) { // not required - return nil - } - - if err := o.RDSExporter.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "rds_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "rds_exporter") - } - - return err - } - } - - return nil -} - -func (o *AddAgentBody) contextValidateValkeyExporter(ctx context.Context, formats strfmt.Registry) error { - if o.ValkeyExporter != nil { - - if swag.IsZero(o.ValkeyExporter) { // not required - return nil - } - - if err := o.ValkeyExporter.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "valkey_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "valkey_exporter") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *AddAgentBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddAgentBody) UnmarshalBinary(b []byte) error { - var res AddAgentBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddAgentDefaultBody add agent default body -swagger:model AddAgentDefaultBody -*/ -type AddAgentDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*AddAgentDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this add agent default body -func (o *AddAgentDefaultBody) 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 *AddAgentDefaultBody) 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("AddAgent default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("AddAgent default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this add agent default body based on the context it is used -func (o *AddAgentDefaultBody) 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 *AddAgentDefaultBody) 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("AddAgent default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("AddAgent default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *AddAgentDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddAgentDefaultBody) UnmarshalBinary(b []byte) error { - var res AddAgentDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddAgentDefaultBodyDetailsItems0 add agent default body details items0 -swagger:model AddAgentDefaultBodyDetailsItems0 -*/ -type AddAgentDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` - - // add agent default body details items0 - AddAgentDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *AddAgentDefaultBodyDetailsItems0) 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 AddAgentDefaultBodyDetailsItems0 - - 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.AddAgentDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o AddAgentDefaultBodyDetailsItems0) 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.AddAgentDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.AddAgentDefaultBodyDetailsItems0) - 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 add agent default body details items0 -func (o *AddAgentDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this add agent default body details items0 based on context it is used -func (o *AddAgentDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddAgentDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddAgentDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res AddAgentDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddAgentOKBody add agent OK body -swagger:model AddAgentOKBody -*/ -type AddAgentOKBody struct { - // azure database exporter - AzureDatabaseExporter *AddAgentOKBodyAzureDatabaseExporter `json:"azure_database_exporter,omitempty"` - - // external exporter - ExternalExporter *AddAgentOKBodyExternalExporter `json:"external_exporter,omitempty"` - - // mongodb exporter - MongodbExporter *AddAgentOKBodyMongodbExporter `json:"mongodb_exporter,omitempty"` - - // mysqld exporter - MysqldExporter *AddAgentOKBodyMysqldExporter `json:"mysqld_exporter,omitempty"` - - // node exporter - NodeExporter *AddAgentOKBodyNodeExporter `json:"node_exporter,omitempty"` - - // pmm agent - PMMAgent *AddAgentOKBodyPMMAgent `json:"pmm_agent,omitempty"` - - // postgres exporter - PostgresExporter *AddAgentOKBodyPostgresExporter `json:"postgres_exporter,omitempty"` - - // proxysql exporter - ProxysqlExporter *AddAgentOKBodyProxysqlExporter `json:"proxysql_exporter,omitempty"` - - // qan mongodb mongolog agent - QANMongodbMongologAgent *AddAgentOKBodyQANMongodbMongologAgent `json:"qan_mongodb_mongolog_agent,omitempty"` - - // qan mongodb profiler agent - QANMongodbProfilerAgent *AddAgentOKBodyQANMongodbProfilerAgent `json:"qan_mongodb_profiler_agent,omitempty"` - - // qan mysql perfschema agent - QANMysqlPerfschemaAgent *AddAgentOKBodyQANMysqlPerfschemaAgent `json:"qan_mysql_perfschema_agent,omitempty"` - - // qan mysql slowlog agent - QANMysqlSlowlogAgent *AddAgentOKBodyQANMysqlSlowlogAgent `json:"qan_mysql_slowlog_agent,omitempty"` - - // qan postgresql pgstatements agent - QANPostgresqlPgstatementsAgent *AddAgentOKBodyQANPostgresqlPgstatementsAgent `json:"qan_postgresql_pgstatements_agent,omitempty"` - - // qan postgresql pgstatmonitor agent - QANPostgresqlPgstatmonitorAgent *AddAgentOKBodyQANPostgresqlPgstatmonitorAgent `json:"qan_postgresql_pgstatmonitor_agent,omitempty"` - - // rds exporter - RDSExporter *AddAgentOKBodyRDSExporter `json:"rds_exporter,omitempty"` - - // valkey exporter - ValkeyExporter *AddAgentOKBodyValkeyExporter `json:"valkey_exporter,omitempty"` -} - -// Validate validates this add agent OK body -func (o *AddAgentOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateAzureDatabaseExporter(formats); err != nil { - res = append(res, err) - } - - if err := o.validateExternalExporter(formats); err != nil { - res = append(res, err) - } - - if err := o.validateMongodbExporter(formats); err != nil { - res = append(res, err) - } - - if err := o.validateMysqldExporter(formats); err != nil { - res = append(res, err) - } - - if err := o.validateNodeExporter(formats); err != nil { - res = append(res, err) - } - - if err := o.validatePMMAgent(formats); err != nil { - res = append(res, err) - } - - if err := o.validatePostgresExporter(formats); err != nil { - res = append(res, err) - } - - if err := o.validateProxysqlExporter(formats); err != nil { - res = append(res, err) - } - - if err := o.validateQANMongodbMongologAgent(formats); err != nil { - res = append(res, err) - } - - if err := o.validateQANMongodbProfilerAgent(formats); err != nil { - res = append(res, err) - } - - if err := o.validateQANMysqlPerfschemaAgent(formats); err != nil { - res = append(res, err) - } - - if err := o.validateQANMysqlSlowlogAgent(formats); err != nil { - res = append(res, err) - } - - if err := o.validateQANPostgresqlPgstatementsAgent(formats); err != nil { - res = append(res, err) - } - - if err := o.validateQANPostgresqlPgstatmonitorAgent(formats); err != nil { - res = append(res, err) - } - - if err := o.validateRDSExporter(formats); err != nil { - res = append(res, err) - } - - if err := o.validateValkeyExporter(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *AddAgentOKBody) validateAzureDatabaseExporter(formats strfmt.Registry) error { - if swag.IsZero(o.AzureDatabaseExporter) { // not required - return nil - } - - if o.AzureDatabaseExporter != nil { - if err := o.AzureDatabaseExporter.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addAgentOk" + "." + "azure_database_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addAgentOk" + "." + "azure_database_exporter") - } - - return err - } - } - - return nil -} - -func (o *AddAgentOKBody) validateExternalExporter(formats strfmt.Registry) error { - if swag.IsZero(o.ExternalExporter) { // not required - return nil - } - - if o.ExternalExporter != nil { - if err := o.ExternalExporter.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addAgentOk" + "." + "external_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addAgentOk" + "." + "external_exporter") - } - - return err - } - } - - return nil -} - -func (o *AddAgentOKBody) validateMongodbExporter(formats strfmt.Registry) error { - if swag.IsZero(o.MongodbExporter) { // not required - return nil - } - - if o.MongodbExporter != nil { - if err := o.MongodbExporter.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addAgentOk" + "." + "mongodb_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addAgentOk" + "." + "mongodb_exporter") - } - - return err - } - } - - return nil -} - -func (o *AddAgentOKBody) validateMysqldExporter(formats strfmt.Registry) error { - if swag.IsZero(o.MysqldExporter) { // not required - return nil - } - - if o.MysqldExporter != nil { - if err := o.MysqldExporter.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addAgentOk" + "." + "mysqld_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addAgentOk" + "." + "mysqld_exporter") - } - - return err - } - } - - return nil -} - -func (o *AddAgentOKBody) validateNodeExporter(formats strfmt.Registry) error { - if swag.IsZero(o.NodeExporter) { // not required - return nil - } - - if o.NodeExporter != nil { - if err := o.NodeExporter.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addAgentOk" + "." + "node_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addAgentOk" + "." + "node_exporter") - } - - return err - } - } - - return nil -} - -func (o *AddAgentOKBody) validatePMMAgent(formats strfmt.Registry) error { - if swag.IsZero(o.PMMAgent) { // not required - return nil - } - - if o.PMMAgent != nil { - if err := o.PMMAgent.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addAgentOk" + "." + "pmm_agent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addAgentOk" + "." + "pmm_agent") - } - - return err - } - } - - return nil -} - -func (o *AddAgentOKBody) validatePostgresExporter(formats strfmt.Registry) error { - if swag.IsZero(o.PostgresExporter) { // not required - return nil - } - - if o.PostgresExporter != nil { - if err := o.PostgresExporter.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addAgentOk" + "." + "postgres_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addAgentOk" + "." + "postgres_exporter") - } - - return err - } - } - - return nil -} - -func (o *AddAgentOKBody) validateProxysqlExporter(formats strfmt.Registry) error { - if swag.IsZero(o.ProxysqlExporter) { // not required - return nil - } - - if o.ProxysqlExporter != nil { - if err := o.ProxysqlExporter.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addAgentOk" + "." + "proxysql_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addAgentOk" + "." + "proxysql_exporter") - } - - return err - } - } - - return nil -} - -func (o *AddAgentOKBody) validateQANMongodbMongologAgent(formats strfmt.Registry) error { - if swag.IsZero(o.QANMongodbMongologAgent) { // not required - return nil - } - - if o.QANMongodbMongologAgent != nil { - if err := o.QANMongodbMongologAgent.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addAgentOk" + "." + "qan_mongodb_mongolog_agent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addAgentOk" + "." + "qan_mongodb_mongolog_agent") - } - - return err - } - } - - return nil -} - -func (o *AddAgentOKBody) validateQANMongodbProfilerAgent(formats strfmt.Registry) error { - if swag.IsZero(o.QANMongodbProfilerAgent) { // not required - return nil - } - - if o.QANMongodbProfilerAgent != nil { - if err := o.QANMongodbProfilerAgent.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addAgentOk" + "." + "qan_mongodb_profiler_agent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addAgentOk" + "." + "qan_mongodb_profiler_agent") - } - - return err - } - } - - return nil -} - -func (o *AddAgentOKBody) validateQANMysqlPerfschemaAgent(formats strfmt.Registry) error { - if swag.IsZero(o.QANMysqlPerfschemaAgent) { // not required - return nil - } - - if o.QANMysqlPerfschemaAgent != nil { - if err := o.QANMysqlPerfschemaAgent.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addAgentOk" + "." + "qan_mysql_perfschema_agent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addAgentOk" + "." + "qan_mysql_perfschema_agent") - } - - return err - } - } - - return nil -} - -func (o *AddAgentOKBody) validateQANMysqlSlowlogAgent(formats strfmt.Registry) error { - if swag.IsZero(o.QANMysqlSlowlogAgent) { // not required - return nil - } - - if o.QANMysqlSlowlogAgent != nil { - if err := o.QANMysqlSlowlogAgent.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addAgentOk" + "." + "qan_mysql_slowlog_agent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addAgentOk" + "." + "qan_mysql_slowlog_agent") - } - - return err - } - } - - return nil -} - -func (o *AddAgentOKBody) validateQANPostgresqlPgstatementsAgent(formats strfmt.Registry) error { - if swag.IsZero(o.QANPostgresqlPgstatementsAgent) { // not required - return nil - } - - if o.QANPostgresqlPgstatementsAgent != nil { - if err := o.QANPostgresqlPgstatementsAgent.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addAgentOk" + "." + "qan_postgresql_pgstatements_agent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addAgentOk" + "." + "qan_postgresql_pgstatements_agent") - } - - return err - } - } - - return nil -} - -func (o *AddAgentOKBody) validateQANPostgresqlPgstatmonitorAgent(formats strfmt.Registry) error { - if swag.IsZero(o.QANPostgresqlPgstatmonitorAgent) { // not required - return nil - } - - if o.QANPostgresqlPgstatmonitorAgent != nil { - if err := o.QANPostgresqlPgstatmonitorAgent.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addAgentOk" + "." + "qan_postgresql_pgstatmonitor_agent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addAgentOk" + "." + "qan_postgresql_pgstatmonitor_agent") - } - - return err - } - } - - return nil -} - -func (o *AddAgentOKBody) validateRDSExporter(formats strfmt.Registry) error { - if swag.IsZero(o.RDSExporter) { // not required - return nil - } - - if o.RDSExporter != nil { - if err := o.RDSExporter.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addAgentOk" + "." + "rds_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addAgentOk" + "." + "rds_exporter") - } - - return err - } - } - - return nil -} - -func (o *AddAgentOKBody) validateValkeyExporter(formats strfmt.Registry) error { - if swag.IsZero(o.ValkeyExporter) { // not required - return nil - } - - if o.ValkeyExporter != nil { - if err := o.ValkeyExporter.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addAgentOk" + "." + "valkey_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addAgentOk" + "." + "valkey_exporter") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this add agent OK body based on the context it is used -func (o *AddAgentOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateAzureDatabaseExporter(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateExternalExporter(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateMongodbExporter(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateMysqldExporter(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateNodeExporter(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidatePMMAgent(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidatePostgresExporter(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateProxysqlExporter(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateQANMongodbMongologAgent(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateQANMongodbProfilerAgent(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateQANMysqlPerfschemaAgent(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateQANMysqlSlowlogAgent(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateQANPostgresqlPgstatementsAgent(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateQANPostgresqlPgstatmonitorAgent(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateRDSExporter(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateValkeyExporter(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *AddAgentOKBody) contextValidateAzureDatabaseExporter(ctx context.Context, formats strfmt.Registry) error { - if o.AzureDatabaseExporter != nil { - - if swag.IsZero(o.AzureDatabaseExporter) { // not required - return nil - } - - if err := o.AzureDatabaseExporter.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addAgentOk" + "." + "azure_database_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addAgentOk" + "." + "azure_database_exporter") - } - - return err - } - } - - return nil -} - -func (o *AddAgentOKBody) contextValidateExternalExporter(ctx context.Context, formats strfmt.Registry) error { - if o.ExternalExporter != nil { - - if swag.IsZero(o.ExternalExporter) { // not required - return nil - } - - if err := o.ExternalExporter.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addAgentOk" + "." + "external_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addAgentOk" + "." + "external_exporter") - } - - return err - } - } - - return nil -} - -func (o *AddAgentOKBody) contextValidateMongodbExporter(ctx context.Context, formats strfmt.Registry) error { - if o.MongodbExporter != nil { - - if swag.IsZero(o.MongodbExporter) { // not required - return nil - } - - if err := o.MongodbExporter.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addAgentOk" + "." + "mongodb_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addAgentOk" + "." + "mongodb_exporter") - } - - return err - } - } - - return nil -} - -func (o *AddAgentOKBody) contextValidateMysqldExporter(ctx context.Context, formats strfmt.Registry) error { - if o.MysqldExporter != nil { - - if swag.IsZero(o.MysqldExporter) { // not required - return nil - } - - if err := o.MysqldExporter.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addAgentOk" + "." + "mysqld_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addAgentOk" + "." + "mysqld_exporter") - } - - return err - } - } - - return nil -} - -func (o *AddAgentOKBody) contextValidateNodeExporter(ctx context.Context, formats strfmt.Registry) error { - if o.NodeExporter != nil { - - if swag.IsZero(o.NodeExporter) { // not required - return nil - } - - if err := o.NodeExporter.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addAgentOk" + "." + "node_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addAgentOk" + "." + "node_exporter") - } - - return err - } - } - - return nil -} - -func (o *AddAgentOKBody) contextValidatePMMAgent(ctx context.Context, formats strfmt.Registry) error { - if o.PMMAgent != nil { - - if swag.IsZero(o.PMMAgent) { // not required - return nil - } - - if err := o.PMMAgent.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addAgentOk" + "." + "pmm_agent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addAgentOk" + "." + "pmm_agent") - } - - return err - } - } - - return nil -} - -func (o *AddAgentOKBody) contextValidatePostgresExporter(ctx context.Context, formats strfmt.Registry) error { - if o.PostgresExporter != nil { - - if swag.IsZero(o.PostgresExporter) { // not required - return nil - } - - if err := o.PostgresExporter.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addAgentOk" + "." + "postgres_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addAgentOk" + "." + "postgres_exporter") - } - - return err - } - } - - return nil -} - -func (o *AddAgentOKBody) contextValidateProxysqlExporter(ctx context.Context, formats strfmt.Registry) error { - if o.ProxysqlExporter != nil { - - if swag.IsZero(o.ProxysqlExporter) { // not required - return nil - } - - if err := o.ProxysqlExporter.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addAgentOk" + "." + "proxysql_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addAgentOk" + "." + "proxysql_exporter") - } - - return err - } - } - - return nil -} - -func (o *AddAgentOKBody) contextValidateQANMongodbMongologAgent(ctx context.Context, formats strfmt.Registry) error { - if o.QANMongodbMongologAgent != nil { - - if swag.IsZero(o.QANMongodbMongologAgent) { // not required - return nil - } - - if err := o.QANMongodbMongologAgent.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addAgentOk" + "." + "qan_mongodb_mongolog_agent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addAgentOk" + "." + "qan_mongodb_mongolog_agent") - } - - return err - } - } - - return nil -} - -func (o *AddAgentOKBody) contextValidateQANMongodbProfilerAgent(ctx context.Context, formats strfmt.Registry) error { - if o.QANMongodbProfilerAgent != nil { - - if swag.IsZero(o.QANMongodbProfilerAgent) { // not required - return nil - } - - if err := o.QANMongodbProfilerAgent.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addAgentOk" + "." + "qan_mongodb_profiler_agent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addAgentOk" + "." + "qan_mongodb_profiler_agent") - } - - return err - } - } - - return nil -} - -func (o *AddAgentOKBody) contextValidateQANMysqlPerfschemaAgent(ctx context.Context, formats strfmt.Registry) error { - if o.QANMysqlPerfschemaAgent != nil { - - if swag.IsZero(o.QANMysqlPerfschemaAgent) { // not required - return nil - } - - if err := o.QANMysqlPerfschemaAgent.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addAgentOk" + "." + "qan_mysql_perfschema_agent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addAgentOk" + "." + "qan_mysql_perfschema_agent") - } - - return err - } - } - - return nil -} - -func (o *AddAgentOKBody) contextValidateQANMysqlSlowlogAgent(ctx context.Context, formats strfmt.Registry) error { - if o.QANMysqlSlowlogAgent != nil { - - if swag.IsZero(o.QANMysqlSlowlogAgent) { // not required - return nil - } - - if err := o.QANMysqlSlowlogAgent.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addAgentOk" + "." + "qan_mysql_slowlog_agent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addAgentOk" + "." + "qan_mysql_slowlog_agent") - } - - return err - } - } - - return nil -} - -func (o *AddAgentOKBody) contextValidateQANPostgresqlPgstatementsAgent(ctx context.Context, formats strfmt.Registry) error { - if o.QANPostgresqlPgstatementsAgent != nil { - - if swag.IsZero(o.QANPostgresqlPgstatementsAgent) { // not required - return nil - } - - if err := o.QANPostgresqlPgstatementsAgent.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addAgentOk" + "." + "qan_postgresql_pgstatements_agent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addAgentOk" + "." + "qan_postgresql_pgstatements_agent") - } - - return err - } - } - - return nil -} - -func (o *AddAgentOKBody) contextValidateQANPostgresqlPgstatmonitorAgent(ctx context.Context, formats strfmt.Registry) error { - if o.QANPostgresqlPgstatmonitorAgent != nil { - - if swag.IsZero(o.QANPostgresqlPgstatmonitorAgent) { // not required - return nil - } - - if err := o.QANPostgresqlPgstatmonitorAgent.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addAgentOk" + "." + "qan_postgresql_pgstatmonitor_agent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addAgentOk" + "." + "qan_postgresql_pgstatmonitor_agent") - } - - return err - } - } - - return nil -} - -func (o *AddAgentOKBody) contextValidateRDSExporter(ctx context.Context, formats strfmt.Registry) error { - if o.RDSExporter != nil { - - if swag.IsZero(o.RDSExporter) { // not required - return nil - } - - if err := o.RDSExporter.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addAgentOk" + "." + "rds_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addAgentOk" + "." + "rds_exporter") - } - - return err - } - } - - return nil -} - -func (o *AddAgentOKBody) contextValidateValkeyExporter(ctx context.Context, formats strfmt.Registry) error { - if o.ValkeyExporter != nil { - - if swag.IsZero(o.ValkeyExporter) { // not required - return nil - } - - if err := o.ValkeyExporter.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addAgentOk" + "." + "valkey_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addAgentOk" + "." + "valkey_exporter") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *AddAgentOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddAgentOKBody) UnmarshalBinary(b []byte) error { - var res AddAgentOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddAgentOKBodyAzureDatabaseExporter AzureDatabaseExporter runs on Generic or Container Node and exposes RemoteAzure Node metrics. -swagger:model AddAgentOKBodyAzureDatabaseExporter -*/ -type AddAgentOKBodyAzureDatabaseExporter struct { - // Unique randomly generated instance identifier. - AgentID string `json:"agent_id,omitempty"` - - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `json:"disabled,omitempty"` - - // Node identifier. - NodeID string `json:"node_id,omitempty"` - - // Azure database subscription ID. - AzureDatabaseSubscriptionID string `json:"azure_database_subscription_id,omitempty"` - - // Azure database resource type (mysql, maria, postgres) - AzureDatabaseResourceType string `json:"azure_database_resource_type,omitempty"` - - // 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"` - - // True if the exporter operates in push metrics mode. - PushMetricsEnabled bool `json:"push_metrics_enabled,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"` - - // metrics resolutions - MetricsResolutions *AddAgentOKBodyAzureDatabaseExporterMetricsResolutions `json:"metrics_resolutions,omitempty"` -} - -// Validate validates this add agent OK body azure database exporter -func (o *AddAgentOKBodyAzureDatabaseExporter) 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 addAgentOkBodyAzureDatabaseExporterTypeStatusPropEnum []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 { - addAgentOkBodyAzureDatabaseExporterTypeStatusPropEnum = append(addAgentOkBodyAzureDatabaseExporterTypeStatusPropEnum, v) - } -} - -const ( - - // AddAgentOKBodyAzureDatabaseExporterStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - AddAgentOKBodyAzureDatabaseExporterStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // AddAgentOKBodyAzureDatabaseExporterStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - AddAgentOKBodyAzureDatabaseExporterStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // AddAgentOKBodyAzureDatabaseExporterStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - AddAgentOKBodyAzureDatabaseExporterStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - - // AddAgentOKBodyAzureDatabaseExporterStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - AddAgentOKBodyAzureDatabaseExporterStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - - // AddAgentOKBodyAzureDatabaseExporterStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - AddAgentOKBodyAzureDatabaseExporterStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - - // AddAgentOKBodyAzureDatabaseExporterStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - AddAgentOKBodyAzureDatabaseExporterStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" - - // AddAgentOKBodyAzureDatabaseExporterStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - AddAgentOKBodyAzureDatabaseExporterStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" - - // AddAgentOKBodyAzureDatabaseExporterStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - AddAgentOKBodyAzureDatabaseExporterStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" -) - -// prop value enum -func (o *AddAgentOKBodyAzureDatabaseExporter) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addAgentOkBodyAzureDatabaseExporterTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddAgentOKBodyAzureDatabaseExporter) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required - return nil - } - - // value enum - if err := o.validateStatusEnum("addAgentOk"+"."+"azure_database_exporter"+"."+"status", "body", *o.Status); err != nil { - return err - } - - return nil -} - -var addAgentOkBodyAzureDatabaseExporterTypeLogLevelPropEnum []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 { - addAgentOkBodyAzureDatabaseExporterTypeLogLevelPropEnum = append(addAgentOkBodyAzureDatabaseExporterTypeLogLevelPropEnum, v) - } -} - -const ( - - // AddAgentOKBodyAzureDatabaseExporterLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - AddAgentOKBodyAzureDatabaseExporterLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // AddAgentOKBodyAzureDatabaseExporterLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - AddAgentOKBodyAzureDatabaseExporterLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // AddAgentOKBodyAzureDatabaseExporterLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - AddAgentOKBodyAzureDatabaseExporterLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // AddAgentOKBodyAzureDatabaseExporterLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - AddAgentOKBodyAzureDatabaseExporterLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // AddAgentOKBodyAzureDatabaseExporterLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - AddAgentOKBodyAzureDatabaseExporterLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // AddAgentOKBodyAzureDatabaseExporterLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - AddAgentOKBodyAzureDatabaseExporterLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -func (o *AddAgentOKBodyAzureDatabaseExporter) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addAgentOkBodyAzureDatabaseExporterTypeLogLevelPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddAgentOKBodyAzureDatabaseExporter) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("addAgentOk"+"."+"azure_database_exporter"+"."+"log_level", "body", *o.LogLevel); err != nil { - return err - } - - return nil -} - -func (o *AddAgentOKBodyAzureDatabaseExporter) 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("addAgentOk" + "." + "azure_database_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addAgentOk" + "." + "azure_database_exporter" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this add agent OK body azure database exporter based on the context it is used -func (o *AddAgentOKBodyAzureDatabaseExporter) 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 *AddAgentOKBodyAzureDatabaseExporter) 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 { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addAgentOk" + "." + "azure_database_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addAgentOk" + "." + "azure_database_exporter" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *AddAgentOKBodyAzureDatabaseExporter) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddAgentOKBodyAzureDatabaseExporter) UnmarshalBinary(b []byte) error { - var res AddAgentOKBodyAzureDatabaseExporter - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddAgentOKBodyAzureDatabaseExporterMetricsResolutions MetricsResolutions represents Prometheus exporters metrics resolutions. -swagger:model AddAgentOKBodyAzureDatabaseExporterMetricsResolutions -*/ -type AddAgentOKBodyAzureDatabaseExporterMetricsResolutions struct { - // High resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Hr string `json:"hr,omitempty"` - - // Medium resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Mr string `json:"mr,omitempty"` - - // Low resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Lr string `json:"lr,omitempty"` -} - -// Validate validates this add agent OK body azure database exporter metrics resolutions -func (o *AddAgentOKBodyAzureDatabaseExporterMetricsResolutions) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this add agent OK body azure database exporter metrics resolutions based on context it is used -func (o *AddAgentOKBodyAzureDatabaseExporterMetricsResolutions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddAgentOKBodyAzureDatabaseExporterMetricsResolutions) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddAgentOKBodyAzureDatabaseExporterMetricsResolutions) UnmarshalBinary(b []byte) error { - var res AddAgentOKBodyAzureDatabaseExporterMetricsResolutions - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddAgentOKBodyExternalExporter ExternalExporter runs on any Node type, including Remote Node. -swagger:model AddAgentOKBodyExternalExporter -*/ -type AddAgentOKBodyExternalExporter struct { - // Unique randomly generated instance identifier. - AgentID string `json:"agent_id,omitempty"` - - // Node identifier where this instance runs. - RunsOnNodeID string `json:"runs_on_node_id,omitempty"` - - // If disabled, metrics from this exporter will not be collected. - Disabled bool `json:"disabled,omitempty"` - - // Service identifier. - ServiceID string `json:"service_id,omitempty"` - - // HTTP basic auth username for collecting metrics. - Username string `json:"username,omitempty"` - - // Scheme to generate URI to exporter metrics endpoints. - Scheme string `json:"scheme,omitempty"` - - // Path under which metrics are exposed, used to generate URI. - MetricsPath string `json:"metrics_path,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // Listen port for scraping metrics. - ListenPort int64 `json:"listen_port,omitempty"` - - // True if exporter uses push metrics mode. - PushMetricsEnabled bool `json:"push_metrics_enabled,omitempty"` - - // Path to exec process. - ProcessExecPath string `json:"process_exec_path,omitempty"` - - // Skip TLS certificate and hostname verification. - TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - - // metrics resolutions - MetricsResolutions *AddAgentOKBodyExternalExporterMetricsResolutions `json:"metrics_resolutions,omitempty"` -} - -// Validate validates this add agent OK body external exporter -func (o *AddAgentOKBodyExternalExporter) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateMetricsResolutions(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *AddAgentOKBodyExternalExporter) 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("addAgentOk" + "." + "external_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addAgentOk" + "." + "external_exporter" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this add agent OK body external exporter based on the context it is used -func (o *AddAgentOKBodyExternalExporter) 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 *AddAgentOKBodyExternalExporter) 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 { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addAgentOk" + "." + "external_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addAgentOk" + "." + "external_exporter" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *AddAgentOKBodyExternalExporter) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddAgentOKBodyExternalExporter) UnmarshalBinary(b []byte) error { - var res AddAgentOKBodyExternalExporter - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddAgentOKBodyExternalExporterMetricsResolutions MetricsResolutions represents Prometheus exporters metrics resolutions. -swagger:model AddAgentOKBodyExternalExporterMetricsResolutions -*/ -type AddAgentOKBodyExternalExporterMetricsResolutions struct { - // High resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Hr string `json:"hr,omitempty"` - - // Medium resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Mr string `json:"mr,omitempty"` - - // Low resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Lr string `json:"lr,omitempty"` -} - -// Validate validates this add agent OK body external exporter metrics resolutions -func (o *AddAgentOKBodyExternalExporterMetricsResolutions) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this add agent OK body external exporter metrics resolutions based on context it is used -func (o *AddAgentOKBodyExternalExporterMetricsResolutions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddAgentOKBodyExternalExporterMetricsResolutions) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddAgentOKBodyExternalExporterMetricsResolutions) UnmarshalBinary(b []byte) error { - var res AddAgentOKBodyExternalExporterMetricsResolutions - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddAgentOKBodyMongodbExporter MongoDBExporter runs on Generic or Container Node and exposes MongoDB Service metrics. -swagger:model AddAgentOKBodyMongodbExporter -*/ -type AddAgentOKBodyMongodbExporter struct { - // Unique randomly generated instance identifier. - AgentID string `json:"agent_id,omitempty"` - - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `json:"disabled,omitempty"` - - // Service identifier. - ServiceID string `json:"service_id,omitempty"` - - // MongoDB username for scraping metrics. - Username string `json:"username,omitempty"` - - // Use TLS for database connections. - TLS bool `json:"tls,omitempty"` - - // Skip TLS certificate and hostname validation. - TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // True if exporter uses push metrics mode. - PushMetricsEnabled bool `json:"push_metrics_enabled,omitempty"` - - // 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"` - - // 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. - EnableAllCollectors bool `json:"enable_all_collectors,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"` - - // Optionally expose the exporter process on all public interfaces - ExposeExporter bool `json:"expose_exporter,omitempty"` - - // metrics resolutions - MetricsResolutions *AddAgentOKBodyMongodbExporterMetricsResolutions `json:"metrics_resolutions,omitempty"` -} - -// Validate validates this add agent OK body mongodb exporter -func (o *AddAgentOKBodyMongodbExporter) 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 addAgentOkBodyMongodbExporterTypeStatusPropEnum []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 { - addAgentOkBodyMongodbExporterTypeStatusPropEnum = append(addAgentOkBodyMongodbExporterTypeStatusPropEnum, v) - } -} - -const ( - - // AddAgentOKBodyMongodbExporterStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - AddAgentOKBodyMongodbExporterStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // AddAgentOKBodyMongodbExporterStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - AddAgentOKBodyMongodbExporterStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // AddAgentOKBodyMongodbExporterStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - AddAgentOKBodyMongodbExporterStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - - // AddAgentOKBodyMongodbExporterStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - AddAgentOKBodyMongodbExporterStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - - // AddAgentOKBodyMongodbExporterStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - AddAgentOKBodyMongodbExporterStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - - // AddAgentOKBodyMongodbExporterStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - AddAgentOKBodyMongodbExporterStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" - - // AddAgentOKBodyMongodbExporterStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - AddAgentOKBodyMongodbExporterStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" - - // AddAgentOKBodyMongodbExporterStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - AddAgentOKBodyMongodbExporterStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" -) - -// prop value enum -func (o *AddAgentOKBodyMongodbExporter) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addAgentOkBodyMongodbExporterTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddAgentOKBodyMongodbExporter) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required - return nil - } - - // value enum - if err := o.validateStatusEnum("addAgentOk"+"."+"mongodb_exporter"+"."+"status", "body", *o.Status); err != nil { - return err - } - - return nil -} - -var addAgentOkBodyMongodbExporterTypeLogLevelPropEnum []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 { - addAgentOkBodyMongodbExporterTypeLogLevelPropEnum = append(addAgentOkBodyMongodbExporterTypeLogLevelPropEnum, v) - } -} - -const ( - - // AddAgentOKBodyMongodbExporterLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - AddAgentOKBodyMongodbExporterLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // AddAgentOKBodyMongodbExporterLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - AddAgentOKBodyMongodbExporterLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // AddAgentOKBodyMongodbExporterLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - AddAgentOKBodyMongodbExporterLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // AddAgentOKBodyMongodbExporterLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - AddAgentOKBodyMongodbExporterLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // AddAgentOKBodyMongodbExporterLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - AddAgentOKBodyMongodbExporterLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // AddAgentOKBodyMongodbExporterLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - AddAgentOKBodyMongodbExporterLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -func (o *AddAgentOKBodyMongodbExporter) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addAgentOkBodyMongodbExporterTypeLogLevelPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddAgentOKBodyMongodbExporter) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("addAgentOk"+"."+"mongodb_exporter"+"."+"log_level", "body", *o.LogLevel); err != nil { - return err - } - - return nil -} - -func (o *AddAgentOKBodyMongodbExporter) 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("addAgentOk" + "." + "mongodb_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addAgentOk" + "." + "mongodb_exporter" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this add agent OK body mongodb exporter based on the context it is used -func (o *AddAgentOKBodyMongodbExporter) 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 *AddAgentOKBodyMongodbExporter) 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 { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addAgentOk" + "." + "mongodb_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addAgentOk" + "." + "mongodb_exporter" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *AddAgentOKBodyMongodbExporter) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddAgentOKBodyMongodbExporter) UnmarshalBinary(b []byte) error { - var res AddAgentOKBodyMongodbExporter - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddAgentOKBodyMongodbExporterMetricsResolutions MetricsResolutions represents Prometheus exporters metrics resolutions. -swagger:model AddAgentOKBodyMongodbExporterMetricsResolutions -*/ -type AddAgentOKBodyMongodbExporterMetricsResolutions struct { - // High resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Hr string `json:"hr,omitempty"` - - // Medium resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Mr string `json:"mr,omitempty"` - - // Low resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Lr string `json:"lr,omitempty"` -} - -// Validate validates this add agent OK body mongodb exporter metrics resolutions -func (o *AddAgentOKBodyMongodbExporterMetricsResolutions) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this add agent OK body mongodb exporter metrics resolutions based on context it is used -func (o *AddAgentOKBodyMongodbExporterMetricsResolutions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddAgentOKBodyMongodbExporterMetricsResolutions) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddAgentOKBodyMongodbExporterMetricsResolutions) UnmarshalBinary(b []byte) error { - var res AddAgentOKBodyMongodbExporterMetricsResolutions - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddAgentOKBodyMysqldExporter MySQLdExporter runs on Generic or Container Node and exposes MySQL Service metrics. -swagger:model AddAgentOKBodyMysqldExporter -*/ -type AddAgentOKBodyMysqldExporter struct { - // Unique randomly generated instance identifier. - AgentID string `json:"agent_id,omitempty"` - - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `json:"disabled,omitempty"` - - // Service identifier. - ServiceID string `json:"service_id,omitempty"` - - // MySQL username for scraping metrics. - Username string `json:"username,omitempty"` - - // Use TLS for database connections. - TLS bool `json:"tls,omitempty"` - - // Skip TLS certificate and hostname validation. - TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - - // Certificate Authority certificate chain. - TLSCa string `json:"tls_ca,omitempty"` - - // Client certificate. - TLSCert string `json:"tls_cert,omitempty"` - - // Password for decrypting tls_cert. - TLSKey string `json:"tls_key,omitempty"` - - // Tablestats group collectors are disabled if there are more than that number of tables. - // 0 means tablestats group collectors are always enabled (no limit). - // Negative value means tablestats group collectors are always disabled. - TablestatsGroupTableLimit int32 `json:"tablestats_group_table_limit,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // True if exporter uses push metrics mode. - PushMetricsEnabled bool `json:"push_metrics_enabled,omitempty"` - - // List of disabled collector names. - DisabledCollectors []string `json:"disabled_collectors"` - - // 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"` - - // True if tablestats group collectors are currently disabled. - TablestatsGroupDisabled bool `json:"tablestats_group_disabled,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"` - - // 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 *AddAgentOKBodyMysqldExporterMetricsResolutions `json:"metrics_resolutions,omitempty"` -} - -// Validate validates this add agent OK body mysqld exporter -func (o *AddAgentOKBodyMysqldExporter) 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 addAgentOkBodyMysqldExporterTypeStatusPropEnum []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 { - addAgentOkBodyMysqldExporterTypeStatusPropEnum = append(addAgentOkBodyMysqldExporterTypeStatusPropEnum, v) - } -} - -const ( - - // AddAgentOKBodyMysqldExporterStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - AddAgentOKBodyMysqldExporterStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // AddAgentOKBodyMysqldExporterStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - AddAgentOKBodyMysqldExporterStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // AddAgentOKBodyMysqldExporterStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - AddAgentOKBodyMysqldExporterStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - - // AddAgentOKBodyMysqldExporterStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - AddAgentOKBodyMysqldExporterStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - - // AddAgentOKBodyMysqldExporterStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - AddAgentOKBodyMysqldExporterStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - - // AddAgentOKBodyMysqldExporterStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - AddAgentOKBodyMysqldExporterStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" - - // AddAgentOKBodyMysqldExporterStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - AddAgentOKBodyMysqldExporterStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" - - // AddAgentOKBodyMysqldExporterStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - AddAgentOKBodyMysqldExporterStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" -) - -// prop value enum -func (o *AddAgentOKBodyMysqldExporter) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addAgentOkBodyMysqldExporterTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddAgentOKBodyMysqldExporter) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required - return nil - } - - // value enum - if err := o.validateStatusEnum("addAgentOk"+"."+"mysqld_exporter"+"."+"status", "body", *o.Status); err != nil { - return err - } - - return nil -} - -var addAgentOkBodyMysqldExporterTypeLogLevelPropEnum []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 { - addAgentOkBodyMysqldExporterTypeLogLevelPropEnum = append(addAgentOkBodyMysqldExporterTypeLogLevelPropEnum, v) - } -} - -const ( - - // AddAgentOKBodyMysqldExporterLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - AddAgentOKBodyMysqldExporterLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // AddAgentOKBodyMysqldExporterLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - AddAgentOKBodyMysqldExporterLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // AddAgentOKBodyMysqldExporterLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - AddAgentOKBodyMysqldExporterLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // AddAgentOKBodyMysqldExporterLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - AddAgentOKBodyMysqldExporterLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // AddAgentOKBodyMysqldExporterLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - AddAgentOKBodyMysqldExporterLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // AddAgentOKBodyMysqldExporterLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - AddAgentOKBodyMysqldExporterLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -func (o *AddAgentOKBodyMysqldExporter) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addAgentOkBodyMysqldExporterTypeLogLevelPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddAgentOKBodyMysqldExporter) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("addAgentOk"+"."+"mysqld_exporter"+"."+"log_level", "body", *o.LogLevel); err != nil { - return err - } - - return nil -} - -func (o *AddAgentOKBodyMysqldExporter) 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("addAgentOk" + "." + "mysqld_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addAgentOk" + "." + "mysqld_exporter" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this add agent OK body mysqld exporter based on the context it is used -func (o *AddAgentOKBodyMysqldExporter) 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 *AddAgentOKBodyMysqldExporter) 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 { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addAgentOk" + "." + "mysqld_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addAgentOk" + "." + "mysqld_exporter" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *AddAgentOKBodyMysqldExporter) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddAgentOKBodyMysqldExporter) UnmarshalBinary(b []byte) error { - var res AddAgentOKBodyMysqldExporter - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddAgentOKBodyMysqldExporterMetricsResolutions MetricsResolutions represents Prometheus exporters metrics resolutions. -swagger:model AddAgentOKBodyMysqldExporterMetricsResolutions -*/ -type AddAgentOKBodyMysqldExporterMetricsResolutions struct { - // High resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Hr string `json:"hr,omitempty"` - - // Medium resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Mr string `json:"mr,omitempty"` - - // Low resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Lr string `json:"lr,omitempty"` -} - -// Validate validates this add agent OK body mysqld exporter metrics resolutions -func (o *AddAgentOKBodyMysqldExporterMetricsResolutions) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this add agent OK body mysqld exporter metrics resolutions based on context it is used -func (o *AddAgentOKBodyMysqldExporterMetricsResolutions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddAgentOKBodyMysqldExporterMetricsResolutions) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddAgentOKBodyMysqldExporterMetricsResolutions) UnmarshalBinary(b []byte) error { - var res AddAgentOKBodyMysqldExporterMetricsResolutions - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddAgentOKBodyNodeExporter NodeExporter runs on Generic or Container Node and exposes its metrics. -swagger:model AddAgentOKBodyNodeExporter -*/ -type AddAgentOKBodyNodeExporter struct { - // Unique randomly generated instance identifier. - AgentID string `json:"agent_id,omitempty"` - - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `json:"disabled,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // True if exporter uses push metrics mode. - PushMetricsEnabled bool `json:"push_metrics_enabled,omitempty"` - - // 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"` - - // Optionally expose the exporter process on all public interfaces - ExposeExporter bool `json:"expose_exporter,omitempty"` - - // metrics resolutions - MetricsResolutions *AddAgentOKBodyNodeExporterMetricsResolutions `json:"metrics_resolutions,omitempty"` -} - -// Validate validates this add agent OK body node exporter -func (o *AddAgentOKBodyNodeExporter) 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 addAgentOkBodyNodeExporterTypeStatusPropEnum []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 { - addAgentOkBodyNodeExporterTypeStatusPropEnum = append(addAgentOkBodyNodeExporterTypeStatusPropEnum, v) - } -} - -const ( - - // AddAgentOKBodyNodeExporterStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - AddAgentOKBodyNodeExporterStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // AddAgentOKBodyNodeExporterStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - AddAgentOKBodyNodeExporterStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // AddAgentOKBodyNodeExporterStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - AddAgentOKBodyNodeExporterStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - - // AddAgentOKBodyNodeExporterStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - AddAgentOKBodyNodeExporterStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - - // AddAgentOKBodyNodeExporterStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - AddAgentOKBodyNodeExporterStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - - // AddAgentOKBodyNodeExporterStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - AddAgentOKBodyNodeExporterStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" - - // AddAgentOKBodyNodeExporterStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - AddAgentOKBodyNodeExporterStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" - - // AddAgentOKBodyNodeExporterStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - AddAgentOKBodyNodeExporterStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" -) - -// prop value enum -func (o *AddAgentOKBodyNodeExporter) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addAgentOkBodyNodeExporterTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddAgentOKBodyNodeExporter) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required - return nil - } - - // value enum - if err := o.validateStatusEnum("addAgentOk"+"."+"node_exporter"+"."+"status", "body", *o.Status); err != nil { - return err - } - - return nil -} - -var addAgentOkBodyNodeExporterTypeLogLevelPropEnum []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 { - addAgentOkBodyNodeExporterTypeLogLevelPropEnum = append(addAgentOkBodyNodeExporterTypeLogLevelPropEnum, v) - } -} - -const ( - - // AddAgentOKBodyNodeExporterLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - AddAgentOKBodyNodeExporterLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // AddAgentOKBodyNodeExporterLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - AddAgentOKBodyNodeExporterLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // AddAgentOKBodyNodeExporterLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - AddAgentOKBodyNodeExporterLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // AddAgentOKBodyNodeExporterLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - AddAgentOKBodyNodeExporterLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // AddAgentOKBodyNodeExporterLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - AddAgentOKBodyNodeExporterLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // AddAgentOKBodyNodeExporterLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - AddAgentOKBodyNodeExporterLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -func (o *AddAgentOKBodyNodeExporter) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addAgentOkBodyNodeExporterTypeLogLevelPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddAgentOKBodyNodeExporter) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("addAgentOk"+"."+"node_exporter"+"."+"log_level", "body", *o.LogLevel); err != nil { - return err - } - - return nil -} - -func (o *AddAgentOKBodyNodeExporter) 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("addAgentOk" + "." + "node_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addAgentOk" + "." + "node_exporter" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this add agent OK body node exporter based on the context it is used -func (o *AddAgentOKBodyNodeExporter) 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 *AddAgentOKBodyNodeExporter) 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 { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addAgentOk" + "." + "node_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addAgentOk" + "." + "node_exporter" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *AddAgentOKBodyNodeExporter) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddAgentOKBodyNodeExporter) UnmarshalBinary(b []byte) error { - var res AddAgentOKBodyNodeExporter - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddAgentOKBodyNodeExporterMetricsResolutions MetricsResolutions represents Prometheus exporters metrics resolutions. -swagger:model AddAgentOKBodyNodeExporterMetricsResolutions -*/ -type AddAgentOKBodyNodeExporterMetricsResolutions struct { - // High resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Hr string `json:"hr,omitempty"` - - // Medium resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Mr string `json:"mr,omitempty"` - - // Low resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Lr string `json:"lr,omitempty"` -} - -// Validate validates this add agent OK body node exporter metrics resolutions -func (o *AddAgentOKBodyNodeExporterMetricsResolutions) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this add agent OK body node exporter metrics resolutions based on context it is used -func (o *AddAgentOKBodyNodeExporterMetricsResolutions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddAgentOKBodyNodeExporterMetricsResolutions) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddAgentOKBodyNodeExporterMetricsResolutions) UnmarshalBinary(b []byte) error { - var res AddAgentOKBodyNodeExporterMetricsResolutions - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddAgentOKBodyPMMAgent PMMAgent runs on Generic or Container Node. -swagger:model AddAgentOKBodyPMMAgent -*/ -type AddAgentOKBodyPMMAgent struct { - // Unique randomly generated instance identifier. - AgentID string `json:"agent_id,omitempty"` - - // Node identifier where this instance runs. - RunsOnNodeID string `json:"runs_on_node_id,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // True if Agent is running and connected to pmm-managed. - Connected bool `json:"connected,omitempty"` - - // Path to exec process. - ProcessExecPath string `json:"process_exec_path,omitempty"` -} - -// Validate validates this add agent OK body PMM agent -func (o *AddAgentOKBodyPMMAgent) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this add agent OK body PMM agent based on context it is used -func (o *AddAgentOKBodyPMMAgent) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddAgentOKBodyPMMAgent) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddAgentOKBodyPMMAgent) UnmarshalBinary(b []byte) error { - var res AddAgentOKBodyPMMAgent - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddAgentOKBodyPostgresExporter PostgresExporter runs on Generic or Container Node and exposes PostgreSQL Service metrics. -swagger:model AddAgentOKBodyPostgresExporter -*/ -type AddAgentOKBodyPostgresExporter struct { - // Unique randomly generated instance identifier. - AgentID string `json:"agent_id,omitempty"` - - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `json:"disabled,omitempty"` - - // Service identifier. - ServiceID string `json:"service_id,omitempty"` - - // PostgreSQL username for scraping metrics. - Username string `json:"username,omitempty"` - - // Use TLS for database connections. - TLS bool `json:"tls,omitempty"` - - // Skip TLS certificate and hostname validation. Uses sslmode=required instead of verify-full. - TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // True if exporter uses push metrics mode. - PushMetricsEnabled bool `json:"push_metrics_enabled,omitempty"` - - // 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"` - - // Optionally expose the exporter process on all public interfaces - ExposeExporter bool `json:"expose_exporter,omitempty"` - - // Maximum number of connections that exporter can open to the database instance. - MaxExporterConnections int32 `json:"max_exporter_connections,omitempty"` - - // metrics resolutions - MetricsResolutions *AddAgentOKBodyPostgresExporterMetricsResolutions `json:"metrics_resolutions,omitempty"` -} - -// Validate validates this add agent OK body postgres exporter -func (o *AddAgentOKBodyPostgresExporter) 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 addAgentOkBodyPostgresExporterTypeStatusPropEnum []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 { - addAgentOkBodyPostgresExporterTypeStatusPropEnum = append(addAgentOkBodyPostgresExporterTypeStatusPropEnum, v) - } -} - -const ( - - // AddAgentOKBodyPostgresExporterStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - AddAgentOKBodyPostgresExporterStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // AddAgentOKBodyPostgresExporterStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - AddAgentOKBodyPostgresExporterStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // AddAgentOKBodyPostgresExporterStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - AddAgentOKBodyPostgresExporterStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - - // AddAgentOKBodyPostgresExporterStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - AddAgentOKBodyPostgresExporterStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - - // AddAgentOKBodyPostgresExporterStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - AddAgentOKBodyPostgresExporterStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - - // AddAgentOKBodyPostgresExporterStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - AddAgentOKBodyPostgresExporterStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" - - // AddAgentOKBodyPostgresExporterStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - AddAgentOKBodyPostgresExporterStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" - - // AddAgentOKBodyPostgresExporterStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - AddAgentOKBodyPostgresExporterStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" -) - -// prop value enum -func (o *AddAgentOKBodyPostgresExporter) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addAgentOkBodyPostgresExporterTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddAgentOKBodyPostgresExporter) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required - return nil - } - - // value enum - if err := o.validateStatusEnum("addAgentOk"+"."+"postgres_exporter"+"."+"status", "body", *o.Status); err != nil { - return err - } - - return nil -} - -var addAgentOkBodyPostgresExporterTypeLogLevelPropEnum []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 { - addAgentOkBodyPostgresExporterTypeLogLevelPropEnum = append(addAgentOkBodyPostgresExporterTypeLogLevelPropEnum, v) - } -} - -const ( - - // AddAgentOKBodyPostgresExporterLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - AddAgentOKBodyPostgresExporterLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // AddAgentOKBodyPostgresExporterLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - AddAgentOKBodyPostgresExporterLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // AddAgentOKBodyPostgresExporterLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - AddAgentOKBodyPostgresExporterLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // AddAgentOKBodyPostgresExporterLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - AddAgentOKBodyPostgresExporterLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // AddAgentOKBodyPostgresExporterLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - AddAgentOKBodyPostgresExporterLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // AddAgentOKBodyPostgresExporterLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - AddAgentOKBodyPostgresExporterLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -func (o *AddAgentOKBodyPostgresExporter) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addAgentOkBodyPostgresExporterTypeLogLevelPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddAgentOKBodyPostgresExporter) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("addAgentOk"+"."+"postgres_exporter"+"."+"log_level", "body", *o.LogLevel); err != nil { - return err - } - - return nil -} - -func (o *AddAgentOKBodyPostgresExporter) 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("addAgentOk" + "." + "postgres_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addAgentOk" + "." + "postgres_exporter" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this add agent OK body postgres exporter based on the context it is used -func (o *AddAgentOKBodyPostgresExporter) 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 *AddAgentOKBodyPostgresExporter) 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 { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addAgentOk" + "." + "postgres_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addAgentOk" + "." + "postgres_exporter" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *AddAgentOKBodyPostgresExporter) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddAgentOKBodyPostgresExporter) UnmarshalBinary(b []byte) error { - var res AddAgentOKBodyPostgresExporter - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddAgentOKBodyPostgresExporterMetricsResolutions MetricsResolutions represents Prometheus exporters metrics resolutions. -swagger:model AddAgentOKBodyPostgresExporterMetricsResolutions -*/ -type AddAgentOKBodyPostgresExporterMetricsResolutions struct { - // High resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Hr string `json:"hr,omitempty"` - - // Medium resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Mr string `json:"mr,omitempty"` - - // Low resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Lr string `json:"lr,omitempty"` -} - -// Validate validates this add agent OK body postgres exporter metrics resolutions -func (o *AddAgentOKBodyPostgresExporterMetricsResolutions) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this add agent OK body postgres exporter metrics resolutions based on context it is used -func (o *AddAgentOKBodyPostgresExporterMetricsResolutions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddAgentOKBodyPostgresExporterMetricsResolutions) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddAgentOKBodyPostgresExporterMetricsResolutions) UnmarshalBinary(b []byte) error { - var res AddAgentOKBodyPostgresExporterMetricsResolutions - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddAgentOKBodyProxysqlExporter ProxySQLExporter runs on Generic or Container Node and exposes ProxySQL Service metrics. -swagger:model AddAgentOKBodyProxysqlExporter -*/ -type AddAgentOKBodyProxysqlExporter struct { - // Unique randomly generated instance identifier. - AgentID string `json:"agent_id,omitempty"` - - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `json:"disabled,omitempty"` - - // Service identifier. - ServiceID string `json:"service_id,omitempty"` - - // ProxySQL username for scraping metrics. - Username string `json:"username,omitempty"` - - // Use TLS for database connections. - TLS bool `json:"tls,omitempty"` - - // Skip TLS certificate and hostname validation. - TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // True if exporter uses push metrics mode. - PushMetricsEnabled bool `json:"push_metrics_enabled,omitempty"` - - // 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"` - - // Optionally expose the exporter process on all public interfaces - ExposeExporter bool `json:"expose_exporter,omitempty"` - - // metrics resolutions - MetricsResolutions *AddAgentOKBodyProxysqlExporterMetricsResolutions `json:"metrics_resolutions,omitempty"` -} - -// Validate validates this add agent OK body proxysql exporter -func (o *AddAgentOKBodyProxysqlExporter) 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 addAgentOkBodyProxysqlExporterTypeStatusPropEnum []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 { - addAgentOkBodyProxysqlExporterTypeStatusPropEnum = append(addAgentOkBodyProxysqlExporterTypeStatusPropEnum, v) - } -} - -const ( - - // AddAgentOKBodyProxysqlExporterStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - AddAgentOKBodyProxysqlExporterStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // AddAgentOKBodyProxysqlExporterStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - AddAgentOKBodyProxysqlExporterStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // AddAgentOKBodyProxysqlExporterStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - AddAgentOKBodyProxysqlExporterStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - - // AddAgentOKBodyProxysqlExporterStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - AddAgentOKBodyProxysqlExporterStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - - // AddAgentOKBodyProxysqlExporterStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - AddAgentOKBodyProxysqlExporterStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - - // AddAgentOKBodyProxysqlExporterStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - AddAgentOKBodyProxysqlExporterStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" - - // AddAgentOKBodyProxysqlExporterStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - AddAgentOKBodyProxysqlExporterStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" - - // AddAgentOKBodyProxysqlExporterStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - AddAgentOKBodyProxysqlExporterStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" -) - -// prop value enum -func (o *AddAgentOKBodyProxysqlExporter) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addAgentOkBodyProxysqlExporterTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddAgentOKBodyProxysqlExporter) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required - return nil - } - - // value enum - if err := o.validateStatusEnum("addAgentOk"+"."+"proxysql_exporter"+"."+"status", "body", *o.Status); err != nil { - return err - } - - return nil -} - -var addAgentOkBodyProxysqlExporterTypeLogLevelPropEnum []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 { - addAgentOkBodyProxysqlExporterTypeLogLevelPropEnum = append(addAgentOkBodyProxysqlExporterTypeLogLevelPropEnum, v) - } -} - -const ( - - // AddAgentOKBodyProxysqlExporterLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - AddAgentOKBodyProxysqlExporterLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // AddAgentOKBodyProxysqlExporterLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - AddAgentOKBodyProxysqlExporterLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // AddAgentOKBodyProxysqlExporterLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - AddAgentOKBodyProxysqlExporterLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // AddAgentOKBodyProxysqlExporterLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - AddAgentOKBodyProxysqlExporterLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // AddAgentOKBodyProxysqlExporterLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - AddAgentOKBodyProxysqlExporterLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // AddAgentOKBodyProxysqlExporterLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - AddAgentOKBodyProxysqlExporterLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -func (o *AddAgentOKBodyProxysqlExporter) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addAgentOkBodyProxysqlExporterTypeLogLevelPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddAgentOKBodyProxysqlExporter) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("addAgentOk"+"."+"proxysql_exporter"+"."+"log_level", "body", *o.LogLevel); err != nil { - return err - } - - return nil -} - -func (o *AddAgentOKBodyProxysqlExporter) 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("addAgentOk" + "." + "proxysql_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addAgentOk" + "." + "proxysql_exporter" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this add agent OK body proxysql exporter based on the context it is used -func (o *AddAgentOKBodyProxysqlExporter) 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 *AddAgentOKBodyProxysqlExporter) 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 { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addAgentOk" + "." + "proxysql_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addAgentOk" + "." + "proxysql_exporter" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *AddAgentOKBodyProxysqlExporter) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddAgentOKBodyProxysqlExporter) UnmarshalBinary(b []byte) error { - var res AddAgentOKBodyProxysqlExporter - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddAgentOKBodyProxysqlExporterMetricsResolutions MetricsResolutions represents Prometheus exporters metrics resolutions. -swagger:model AddAgentOKBodyProxysqlExporterMetricsResolutions -*/ -type AddAgentOKBodyProxysqlExporterMetricsResolutions struct { - // High resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Hr string `json:"hr,omitempty"` - - // Medium resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Mr string `json:"mr,omitempty"` - - // Low resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Lr string `json:"lr,omitempty"` -} - -// Validate validates this add agent OK body proxysql exporter metrics resolutions -func (o *AddAgentOKBodyProxysqlExporterMetricsResolutions) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this add agent OK body proxysql exporter metrics resolutions based on context it is used -func (o *AddAgentOKBodyProxysqlExporterMetricsResolutions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddAgentOKBodyProxysqlExporterMetricsResolutions) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddAgentOKBodyProxysqlExporterMetricsResolutions) UnmarshalBinary(b []byte) error { - var res AddAgentOKBodyProxysqlExporterMetricsResolutions - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddAgentOKBodyQANMongodbMongologAgent QANMongoDBMongologAgent runs within pmm-agent and sends MongoDB Query Analytics data to the PMM Server. -swagger:model AddAgentOKBodyQANMongodbMongologAgent -*/ -type AddAgentOKBodyQANMongodbMongologAgent struct { - // Unique randomly generated instance identifier. - AgentID string `json:"agent_id,omitempty"` - - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `json:"disabled,omitempty"` - - // Service identifier. - ServiceID string `json:"service_id,omitempty"` - - // MongoDB username for getting profiler data. - Username string `json:"username,omitempty"` - - // Use TLS for database connections. - TLS bool `json:"tls,omitempty"` - - // Skip TLS certificate and hostname validation. - TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - - // Limit query length in QAN (default: server-defined; -1: no limit). - MaxQueryLength int32 `json:"max_query_length,omitempty"` - - // 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"` - - // 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 agent OK body QAN mongodb mongolog agent -func (o *AddAgentOKBodyQANMongodbMongologAgent) 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 addAgentOkBodyQanMongodbMongologAgentTypeStatusPropEnum []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 { - addAgentOkBodyQanMongodbMongologAgentTypeStatusPropEnum = append(addAgentOkBodyQanMongodbMongologAgentTypeStatusPropEnum, v) - } -} - -const ( - - // AddAgentOKBodyQANMongodbMongologAgentStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - AddAgentOKBodyQANMongodbMongologAgentStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // AddAgentOKBodyQANMongodbMongologAgentStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - AddAgentOKBodyQANMongodbMongologAgentStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // AddAgentOKBodyQANMongodbMongologAgentStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - AddAgentOKBodyQANMongodbMongologAgentStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - - // AddAgentOKBodyQANMongodbMongologAgentStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - AddAgentOKBodyQANMongodbMongologAgentStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - - // AddAgentOKBodyQANMongodbMongologAgentStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - AddAgentOKBodyQANMongodbMongologAgentStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - - // AddAgentOKBodyQANMongodbMongologAgentStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - AddAgentOKBodyQANMongodbMongologAgentStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" - - // AddAgentOKBodyQANMongodbMongologAgentStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - AddAgentOKBodyQANMongodbMongologAgentStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" - - // AddAgentOKBodyQANMongodbMongologAgentStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - AddAgentOKBodyQANMongodbMongologAgentStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" -) - -// prop value enum -func (o *AddAgentOKBodyQANMongodbMongologAgent) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addAgentOkBodyQanMongodbMongologAgentTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddAgentOKBodyQANMongodbMongologAgent) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required - return nil - } - - // value enum - if err := o.validateStatusEnum("addAgentOk"+"."+"qan_mongodb_mongolog_agent"+"."+"status", "body", *o.Status); err != nil { - return err - } - - return nil -} - -var addAgentOkBodyQanMongodbMongologAgentTypeLogLevelPropEnum []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 { - addAgentOkBodyQanMongodbMongologAgentTypeLogLevelPropEnum = append(addAgentOkBodyQanMongodbMongologAgentTypeLogLevelPropEnum, v) - } -} - -const ( - - // AddAgentOKBodyQANMongodbMongologAgentLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - AddAgentOKBodyQANMongodbMongologAgentLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // AddAgentOKBodyQANMongodbMongologAgentLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - AddAgentOKBodyQANMongodbMongologAgentLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // AddAgentOKBodyQANMongodbMongologAgentLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - AddAgentOKBodyQANMongodbMongologAgentLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // AddAgentOKBodyQANMongodbMongologAgentLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - AddAgentOKBodyQANMongodbMongologAgentLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // AddAgentOKBodyQANMongodbMongologAgentLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - AddAgentOKBodyQANMongodbMongologAgentLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // AddAgentOKBodyQANMongodbMongologAgentLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - AddAgentOKBodyQANMongodbMongologAgentLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -func (o *AddAgentOKBodyQANMongodbMongologAgent) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addAgentOkBodyQanMongodbMongologAgentTypeLogLevelPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddAgentOKBodyQANMongodbMongologAgent) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("addAgentOk"+"."+"qan_mongodb_mongolog_agent"+"."+"log_level", "body", *o.LogLevel); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this add agent OK body QAN mongodb mongolog agent based on context it is used -func (o *AddAgentOKBodyQANMongodbMongologAgent) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddAgentOKBodyQANMongodbMongologAgent) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddAgentOKBodyQANMongodbMongologAgent) UnmarshalBinary(b []byte) error { - var res AddAgentOKBodyQANMongodbMongologAgent - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddAgentOKBodyQANMongodbProfilerAgent QANMongoDBProfilerAgent runs within pmm-agent and sends MongoDB Query Analytics data to the PMM Server. -swagger:model AddAgentOKBodyQANMongodbProfilerAgent -*/ -type AddAgentOKBodyQANMongodbProfilerAgent struct { - // Unique randomly generated instance identifier. - AgentID string `json:"agent_id,omitempty"` - - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `json:"disabled,omitempty"` - - // Service identifier. - ServiceID string `json:"service_id,omitempty"` - - // MongoDB username for getting profiler data. - Username string `json:"username,omitempty"` - - // Use TLS for database connections. - TLS bool `json:"tls,omitempty"` - - // Skip TLS certificate and hostname validation. - TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - - // Limit query length in QAN (default: server-defined; -1: no limit). - MaxQueryLength int32 `json:"max_query_length,omitempty"` - - // 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"` - - // 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 agent OK body QAN mongodb profiler agent -func (o *AddAgentOKBodyQANMongodbProfilerAgent) 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 addAgentOkBodyQanMongodbProfilerAgentTypeStatusPropEnum []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 { - addAgentOkBodyQanMongodbProfilerAgentTypeStatusPropEnum = append(addAgentOkBodyQanMongodbProfilerAgentTypeStatusPropEnum, v) - } -} - -const ( - - // AddAgentOKBodyQANMongodbProfilerAgentStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - AddAgentOKBodyQANMongodbProfilerAgentStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // AddAgentOKBodyQANMongodbProfilerAgentStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - AddAgentOKBodyQANMongodbProfilerAgentStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // AddAgentOKBodyQANMongodbProfilerAgentStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - AddAgentOKBodyQANMongodbProfilerAgentStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - - // AddAgentOKBodyQANMongodbProfilerAgentStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - AddAgentOKBodyQANMongodbProfilerAgentStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - - // AddAgentOKBodyQANMongodbProfilerAgentStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - AddAgentOKBodyQANMongodbProfilerAgentStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - - // AddAgentOKBodyQANMongodbProfilerAgentStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - AddAgentOKBodyQANMongodbProfilerAgentStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" - - // AddAgentOKBodyQANMongodbProfilerAgentStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - AddAgentOKBodyQANMongodbProfilerAgentStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" - - // AddAgentOKBodyQANMongodbProfilerAgentStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - AddAgentOKBodyQANMongodbProfilerAgentStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" -) - -// prop value enum -func (o *AddAgentOKBodyQANMongodbProfilerAgent) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addAgentOkBodyQanMongodbProfilerAgentTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddAgentOKBodyQANMongodbProfilerAgent) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required - return nil - } - - // value enum - if err := o.validateStatusEnum("addAgentOk"+"."+"qan_mongodb_profiler_agent"+"."+"status", "body", *o.Status); err != nil { - return err - } - - return nil -} - -var addAgentOkBodyQanMongodbProfilerAgentTypeLogLevelPropEnum []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 { - addAgentOkBodyQanMongodbProfilerAgentTypeLogLevelPropEnum = append(addAgentOkBodyQanMongodbProfilerAgentTypeLogLevelPropEnum, v) - } -} - -const ( - - // AddAgentOKBodyQANMongodbProfilerAgentLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - AddAgentOKBodyQANMongodbProfilerAgentLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // AddAgentOKBodyQANMongodbProfilerAgentLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - AddAgentOKBodyQANMongodbProfilerAgentLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // AddAgentOKBodyQANMongodbProfilerAgentLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - AddAgentOKBodyQANMongodbProfilerAgentLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // AddAgentOKBodyQANMongodbProfilerAgentLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - AddAgentOKBodyQANMongodbProfilerAgentLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // AddAgentOKBodyQANMongodbProfilerAgentLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - AddAgentOKBodyQANMongodbProfilerAgentLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // AddAgentOKBodyQANMongodbProfilerAgentLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - AddAgentOKBodyQANMongodbProfilerAgentLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -func (o *AddAgentOKBodyQANMongodbProfilerAgent) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addAgentOkBodyQanMongodbProfilerAgentTypeLogLevelPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddAgentOKBodyQANMongodbProfilerAgent) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("addAgentOk"+"."+"qan_mongodb_profiler_agent"+"."+"log_level", "body", *o.LogLevel); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this add agent OK body QAN mongodb profiler agent based on context it is used -func (o *AddAgentOKBodyQANMongodbProfilerAgent) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddAgentOKBodyQANMongodbProfilerAgent) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddAgentOKBodyQANMongodbProfilerAgent) UnmarshalBinary(b []byte) error { - var res AddAgentOKBodyQANMongodbProfilerAgent - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddAgentOKBodyQANMysqlPerfschemaAgent QANMySQLPerfSchemaAgent runs within pmm-agent and sends MySQL Query Analytics data to the PMM Server. -swagger:model AddAgentOKBodyQANMysqlPerfschemaAgent -*/ -type AddAgentOKBodyQANMysqlPerfschemaAgent struct { - // Unique randomly generated instance identifier. - AgentID string `json:"agent_id,omitempty"` - - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `json:"disabled,omitempty"` - - // Service identifier. - ServiceID string `json:"service_id,omitempty"` - - // MySQL username for getting performance data. - Username string `json:"username,omitempty"` - - // Use TLS for database connections. - TLS bool `json:"tls,omitempty"` - - // Skip TLS certificate and hostname validation. - TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - - // Certificate Authority certificate chain. - TLSCa string `json:"tls_ca,omitempty"` - - // Client certificate. - TLSCert string `json:"tls_cert,omitempty"` - - // Password for decrypting tls_cert. - TLSKey string `json:"tls_key,omitempty"` - - // Disable parsing comments from queries and showing them in QAN. - DisableCommentsParsing bool `json:"disable_comments_parsing,omitempty"` - - // Limit query length in QAN (default: server-defined; -1: no limit). - MaxQueryLength int32 `json:"max_query_length,omitempty"` - - // True if query examples are disabled. - QueryExamplesDisabled bool `json:"query_examples_disabled,omitempty"` - - // 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"` - - // 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 agent OK body QAN mysql perfschema agent -func (o *AddAgentOKBodyQANMysqlPerfschemaAgent) 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 addAgentOkBodyQanMysqlPerfschemaAgentTypeStatusPropEnum []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 { - addAgentOkBodyQanMysqlPerfschemaAgentTypeStatusPropEnum = append(addAgentOkBodyQanMysqlPerfschemaAgentTypeStatusPropEnum, v) - } -} - -const ( - - // AddAgentOKBodyQANMysqlPerfschemaAgentStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - AddAgentOKBodyQANMysqlPerfschemaAgentStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // AddAgentOKBodyQANMysqlPerfschemaAgentStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - AddAgentOKBodyQANMysqlPerfschemaAgentStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // AddAgentOKBodyQANMysqlPerfschemaAgentStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - AddAgentOKBodyQANMysqlPerfschemaAgentStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - - // AddAgentOKBodyQANMysqlPerfschemaAgentStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - AddAgentOKBodyQANMysqlPerfschemaAgentStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - - // AddAgentOKBodyQANMysqlPerfschemaAgentStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - AddAgentOKBodyQANMysqlPerfschemaAgentStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - - // AddAgentOKBodyQANMysqlPerfschemaAgentStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - AddAgentOKBodyQANMysqlPerfschemaAgentStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" - - // AddAgentOKBodyQANMysqlPerfschemaAgentStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - AddAgentOKBodyQANMysqlPerfschemaAgentStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" - - // AddAgentOKBodyQANMysqlPerfschemaAgentStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - AddAgentOKBodyQANMysqlPerfschemaAgentStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" -) - -// prop value enum -func (o *AddAgentOKBodyQANMysqlPerfschemaAgent) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addAgentOkBodyQanMysqlPerfschemaAgentTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddAgentOKBodyQANMysqlPerfschemaAgent) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required - return nil - } - - // value enum - if err := o.validateStatusEnum("addAgentOk"+"."+"qan_mysql_perfschema_agent"+"."+"status", "body", *o.Status); err != nil { - return err - } - - return nil -} - -var addAgentOkBodyQanMysqlPerfschemaAgentTypeLogLevelPropEnum []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 { - addAgentOkBodyQanMysqlPerfschemaAgentTypeLogLevelPropEnum = append(addAgentOkBodyQanMysqlPerfschemaAgentTypeLogLevelPropEnum, v) - } -} - -const ( - - // AddAgentOKBodyQANMysqlPerfschemaAgentLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - AddAgentOKBodyQANMysqlPerfschemaAgentLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // AddAgentOKBodyQANMysqlPerfschemaAgentLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - AddAgentOKBodyQANMysqlPerfschemaAgentLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // AddAgentOKBodyQANMysqlPerfschemaAgentLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - AddAgentOKBodyQANMysqlPerfschemaAgentLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // AddAgentOKBodyQANMysqlPerfschemaAgentLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - AddAgentOKBodyQANMysqlPerfschemaAgentLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // AddAgentOKBodyQANMysqlPerfschemaAgentLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - AddAgentOKBodyQANMysqlPerfschemaAgentLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // AddAgentOKBodyQANMysqlPerfschemaAgentLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - AddAgentOKBodyQANMysqlPerfschemaAgentLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -func (o *AddAgentOKBodyQANMysqlPerfschemaAgent) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addAgentOkBodyQanMysqlPerfschemaAgentTypeLogLevelPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddAgentOKBodyQANMysqlPerfschemaAgent) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("addAgentOk"+"."+"qan_mysql_perfschema_agent"+"."+"log_level", "body", *o.LogLevel); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this add agent OK body QAN mysql perfschema agent based on context it is used -func (o *AddAgentOKBodyQANMysqlPerfschemaAgent) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddAgentOKBodyQANMysqlPerfschemaAgent) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddAgentOKBodyQANMysqlPerfschemaAgent) UnmarshalBinary(b []byte) error { - var res AddAgentOKBodyQANMysqlPerfschemaAgent - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddAgentOKBodyQANMysqlSlowlogAgent QANMySQLSlowlogAgent runs within pmm-agent and sends MySQL Query Analytics data to the PMM Server. -swagger:model AddAgentOKBodyQANMysqlSlowlogAgent -*/ -type AddAgentOKBodyQANMysqlSlowlogAgent struct { - // Unique randomly generated instance identifier. - AgentID string `json:"agent_id,omitempty"` - - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `json:"disabled,omitempty"` - - // Service identifier. - ServiceID string `json:"service_id,omitempty"` - - // MySQL username for getting performance data. - Username string `json:"username,omitempty"` - - // Use TLS for database connections. - TLS bool `json:"tls,omitempty"` - - // Skip TLS certificate and hostname validation. - TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - - // Certificate Authority certificate chain. - TLSCa string `json:"tls_ca,omitempty"` - - // Client certificate. - TLSCert string `json:"tls_cert,omitempty"` - - // Password for decrypting tls_cert. - TLSKey string `json:"tls_key,omitempty"` - - // Disable parsing comments from queries and showing them in QAN. - DisableCommentsParsing bool `json:"disable_comments_parsing,omitempty"` - - // Limit query length in QAN (default: server-defined; -1: no limit) - MaxQueryLength int32 `json:"max_query_length,omitempty"` - - // True if query examples are disabled. - QueryExamplesDisabled bool `json:"query_examples_disabled,omitempty"` - - // Slowlog file is rotated at this size if > 0. - MaxSlowlogFileSize string `json:"max_slowlog_file_size,omitempty"` - - // 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"` - - // 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 agent OK body QAN mysql slowlog agent -func (o *AddAgentOKBodyQANMysqlSlowlogAgent) 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 addAgentOkBodyQanMysqlSlowlogAgentTypeStatusPropEnum []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 { - addAgentOkBodyQanMysqlSlowlogAgentTypeStatusPropEnum = append(addAgentOkBodyQanMysqlSlowlogAgentTypeStatusPropEnum, v) - } -} - -const ( - - // AddAgentOKBodyQANMysqlSlowlogAgentStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - AddAgentOKBodyQANMysqlSlowlogAgentStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // AddAgentOKBodyQANMysqlSlowlogAgentStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - AddAgentOKBodyQANMysqlSlowlogAgentStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // AddAgentOKBodyQANMysqlSlowlogAgentStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - AddAgentOKBodyQANMysqlSlowlogAgentStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - - // AddAgentOKBodyQANMysqlSlowlogAgentStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - AddAgentOKBodyQANMysqlSlowlogAgentStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - - // AddAgentOKBodyQANMysqlSlowlogAgentStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - AddAgentOKBodyQANMysqlSlowlogAgentStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - - // AddAgentOKBodyQANMysqlSlowlogAgentStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - AddAgentOKBodyQANMysqlSlowlogAgentStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" - - // AddAgentOKBodyQANMysqlSlowlogAgentStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - AddAgentOKBodyQANMysqlSlowlogAgentStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" - - // AddAgentOKBodyQANMysqlSlowlogAgentStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - AddAgentOKBodyQANMysqlSlowlogAgentStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" -) - -// prop value enum -func (o *AddAgentOKBodyQANMysqlSlowlogAgent) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addAgentOkBodyQanMysqlSlowlogAgentTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddAgentOKBodyQANMysqlSlowlogAgent) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required - return nil - } - - // value enum - if err := o.validateStatusEnum("addAgentOk"+"."+"qan_mysql_slowlog_agent"+"."+"status", "body", *o.Status); err != nil { - return err - } - - return nil -} - -var addAgentOkBodyQanMysqlSlowlogAgentTypeLogLevelPropEnum []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 { - addAgentOkBodyQanMysqlSlowlogAgentTypeLogLevelPropEnum = append(addAgentOkBodyQanMysqlSlowlogAgentTypeLogLevelPropEnum, v) - } -} - -const ( - - // AddAgentOKBodyQANMysqlSlowlogAgentLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - AddAgentOKBodyQANMysqlSlowlogAgentLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // AddAgentOKBodyQANMysqlSlowlogAgentLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - AddAgentOKBodyQANMysqlSlowlogAgentLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // AddAgentOKBodyQANMysqlSlowlogAgentLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - AddAgentOKBodyQANMysqlSlowlogAgentLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // AddAgentOKBodyQANMysqlSlowlogAgentLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - AddAgentOKBodyQANMysqlSlowlogAgentLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // AddAgentOKBodyQANMysqlSlowlogAgentLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - AddAgentOKBodyQANMysqlSlowlogAgentLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // AddAgentOKBodyQANMysqlSlowlogAgentLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - AddAgentOKBodyQANMysqlSlowlogAgentLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -func (o *AddAgentOKBodyQANMysqlSlowlogAgent) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addAgentOkBodyQanMysqlSlowlogAgentTypeLogLevelPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddAgentOKBodyQANMysqlSlowlogAgent) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("addAgentOk"+"."+"qan_mysql_slowlog_agent"+"."+"log_level", "body", *o.LogLevel); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this add agent OK body QAN mysql slowlog agent based on context it is used -func (o *AddAgentOKBodyQANMysqlSlowlogAgent) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddAgentOKBodyQANMysqlSlowlogAgent) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddAgentOKBodyQANMysqlSlowlogAgent) UnmarshalBinary(b []byte) error { - var res AddAgentOKBodyQANMysqlSlowlogAgent - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddAgentOKBodyQANPostgresqlPgstatementsAgent QANPostgreSQLPgStatementsAgent runs within pmm-agent and sends PostgreSQL Query Analytics data to the PMM Server. -swagger:model AddAgentOKBodyQANPostgresqlPgstatementsAgent -*/ -type AddAgentOKBodyQANPostgresqlPgstatementsAgent struct { - // Unique randomly generated instance identifier. - AgentID string `json:"agent_id,omitempty"` - - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `json:"disabled,omitempty"` - - // Service identifier. - ServiceID string `json:"service_id,omitempty"` - - // PostgreSQL username for getting pg stat statements data. - Username string `json:"username,omitempty"` - - // Disable parsing comments from queries and showing them in QAN. - DisableCommentsParsing bool `json:"disable_comments_parsing,omitempty"` - - // Limit query length in QAN (default: server-defined; -1: no limit). - MaxQueryLength int32 `json:"max_query_length,omitempty"` - - // Use TLS for database connections. - TLS bool `json:"tls,omitempty"` - - // Skip TLS certificate and hostname validation. - TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - - // 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"` - - // 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 agent OK body QAN postgresql pgstatements agent -func (o *AddAgentOKBodyQANPostgresqlPgstatementsAgent) 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 addAgentOkBodyQanPostgresqlPgstatementsAgentTypeStatusPropEnum []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 { - addAgentOkBodyQanPostgresqlPgstatementsAgentTypeStatusPropEnum = append(addAgentOkBodyQanPostgresqlPgstatementsAgentTypeStatusPropEnum, v) - } -} - -const ( - - // AddAgentOKBodyQANPostgresqlPgstatementsAgentStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - AddAgentOKBodyQANPostgresqlPgstatementsAgentStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // AddAgentOKBodyQANPostgresqlPgstatementsAgentStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - AddAgentOKBodyQANPostgresqlPgstatementsAgentStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // AddAgentOKBodyQANPostgresqlPgstatementsAgentStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - AddAgentOKBodyQANPostgresqlPgstatementsAgentStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - - // AddAgentOKBodyQANPostgresqlPgstatementsAgentStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - AddAgentOKBodyQANPostgresqlPgstatementsAgentStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - - // AddAgentOKBodyQANPostgresqlPgstatementsAgentStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - AddAgentOKBodyQANPostgresqlPgstatementsAgentStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - - // AddAgentOKBodyQANPostgresqlPgstatementsAgentStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - AddAgentOKBodyQANPostgresqlPgstatementsAgentStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" - - // AddAgentOKBodyQANPostgresqlPgstatementsAgentStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - AddAgentOKBodyQANPostgresqlPgstatementsAgentStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" - - // AddAgentOKBodyQANPostgresqlPgstatementsAgentStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - AddAgentOKBodyQANPostgresqlPgstatementsAgentStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" -) - -// prop value enum -func (o *AddAgentOKBodyQANPostgresqlPgstatementsAgent) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addAgentOkBodyQanPostgresqlPgstatementsAgentTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddAgentOKBodyQANPostgresqlPgstatementsAgent) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required - return nil - } - - // value enum - if err := o.validateStatusEnum("addAgentOk"+"."+"qan_postgresql_pgstatements_agent"+"."+"status", "body", *o.Status); err != nil { - return err - } - - return nil -} - -var addAgentOkBodyQanPostgresqlPgstatementsAgentTypeLogLevelPropEnum []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 { - addAgentOkBodyQanPostgresqlPgstatementsAgentTypeLogLevelPropEnum = append(addAgentOkBodyQanPostgresqlPgstatementsAgentTypeLogLevelPropEnum, v) - } -} - -const ( - - // AddAgentOKBodyQANPostgresqlPgstatementsAgentLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - AddAgentOKBodyQANPostgresqlPgstatementsAgentLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // AddAgentOKBodyQANPostgresqlPgstatementsAgentLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - AddAgentOKBodyQANPostgresqlPgstatementsAgentLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // AddAgentOKBodyQANPostgresqlPgstatementsAgentLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - AddAgentOKBodyQANPostgresqlPgstatementsAgentLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // AddAgentOKBodyQANPostgresqlPgstatementsAgentLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - AddAgentOKBodyQANPostgresqlPgstatementsAgentLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // AddAgentOKBodyQANPostgresqlPgstatementsAgentLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - AddAgentOKBodyQANPostgresqlPgstatementsAgentLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // AddAgentOKBodyQANPostgresqlPgstatementsAgentLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - AddAgentOKBodyQANPostgresqlPgstatementsAgentLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -func (o *AddAgentOKBodyQANPostgresqlPgstatementsAgent) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addAgentOkBodyQanPostgresqlPgstatementsAgentTypeLogLevelPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddAgentOKBodyQANPostgresqlPgstatementsAgent) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("addAgentOk"+"."+"qan_postgresql_pgstatements_agent"+"."+"log_level", "body", *o.LogLevel); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this add agent OK body QAN postgresql pgstatements agent based on context it is used -func (o *AddAgentOKBodyQANPostgresqlPgstatementsAgent) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddAgentOKBodyQANPostgresqlPgstatementsAgent) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddAgentOKBodyQANPostgresqlPgstatementsAgent) UnmarshalBinary(b []byte) error { - var res AddAgentOKBodyQANPostgresqlPgstatementsAgent - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddAgentOKBodyQANPostgresqlPgstatmonitorAgent QANPostgreSQLPgStatMonitorAgent runs within pmm-agent and sends PostgreSQL Query Analytics data to the PMM Server. -swagger:model AddAgentOKBodyQANPostgresqlPgstatmonitorAgent -*/ -type AddAgentOKBodyQANPostgresqlPgstatmonitorAgent struct { - // Unique randomly generated instance identifier. - AgentID string `json:"agent_id,omitempty"` - - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `json:"disabled,omitempty"` - - // Service identifier. - ServiceID string `json:"service_id,omitempty"` - - // PostgreSQL username for getting pg stat monitor data. - Username string `json:"username,omitempty"` - - // Use TLS for database connections. - TLS bool `json:"tls,omitempty"` - - // Skip TLS certificate and hostname validation. - TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - - // Disable parsing comments from queries and showing them in QAN. - DisableCommentsParsing bool `json:"disable_comments_parsing,omitempty"` - - // Limit query length in QAN (default: server-defined; -1: no limit). - MaxQueryLength int32 `json:"max_query_length,omitempty"` - - // True if query examples are disabled. - QueryExamplesDisabled bool `json:"query_examples_disabled,omitempty"` - - // 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"` - - // 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 agent OK body QAN postgresql pgstatmonitor agent -func (o *AddAgentOKBodyQANPostgresqlPgstatmonitorAgent) 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 addAgentOkBodyQanPostgresqlPgstatmonitorAgentTypeStatusPropEnum []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 { - addAgentOkBodyQanPostgresqlPgstatmonitorAgentTypeStatusPropEnum = append(addAgentOkBodyQanPostgresqlPgstatmonitorAgentTypeStatusPropEnum, v) - } -} - -const ( - - // AddAgentOKBodyQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - AddAgentOKBodyQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // AddAgentOKBodyQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - AddAgentOKBodyQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // AddAgentOKBodyQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - AddAgentOKBodyQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - - // AddAgentOKBodyQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - AddAgentOKBodyQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - - // AddAgentOKBodyQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - AddAgentOKBodyQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - - // AddAgentOKBodyQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - AddAgentOKBodyQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" - - // AddAgentOKBodyQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - AddAgentOKBodyQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" - - // AddAgentOKBodyQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - AddAgentOKBodyQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" -) - -// prop value enum -func (o *AddAgentOKBodyQANPostgresqlPgstatmonitorAgent) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addAgentOkBodyQanPostgresqlPgstatmonitorAgentTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddAgentOKBodyQANPostgresqlPgstatmonitorAgent) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required - return nil - } - - // value enum - if err := o.validateStatusEnum("addAgentOk"+"."+"qan_postgresql_pgstatmonitor_agent"+"."+"status", "body", *o.Status); err != nil { - return err - } - - return nil -} - -var addAgentOkBodyQanPostgresqlPgstatmonitorAgentTypeLogLevelPropEnum []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 { - addAgentOkBodyQanPostgresqlPgstatmonitorAgentTypeLogLevelPropEnum = append(addAgentOkBodyQanPostgresqlPgstatmonitorAgentTypeLogLevelPropEnum, v) - } -} - -const ( - - // AddAgentOKBodyQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - AddAgentOKBodyQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // AddAgentOKBodyQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - AddAgentOKBodyQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // AddAgentOKBodyQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - AddAgentOKBodyQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // AddAgentOKBodyQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - AddAgentOKBodyQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // AddAgentOKBodyQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - AddAgentOKBodyQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // AddAgentOKBodyQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - AddAgentOKBodyQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -func (o *AddAgentOKBodyQANPostgresqlPgstatmonitorAgent) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addAgentOkBodyQanPostgresqlPgstatmonitorAgentTypeLogLevelPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddAgentOKBodyQANPostgresqlPgstatmonitorAgent) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("addAgentOk"+"."+"qan_postgresql_pgstatmonitor_agent"+"."+"log_level", "body", *o.LogLevel); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this add agent OK body QAN postgresql pgstatmonitor agent based on context it is used -func (o *AddAgentOKBodyQANPostgresqlPgstatmonitorAgent) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddAgentOKBodyQANPostgresqlPgstatmonitorAgent) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddAgentOKBodyQANPostgresqlPgstatmonitorAgent) UnmarshalBinary(b []byte) error { - var res AddAgentOKBodyQANPostgresqlPgstatmonitorAgent - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddAgentOKBodyRDSExporter RDSExporter runs on Generic or Container Node and exposes RemoteRDS Node metrics. -swagger:model AddAgentOKBodyRDSExporter -*/ -type AddAgentOKBodyRDSExporter struct { - // Unique randomly generated instance identifier. - AgentID string `json:"agent_id,omitempty"` - - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `json:"disabled,omitempty"` - - // Node identifier. - NodeID string `json:"node_id,omitempty"` - - // AWS Access Key. - AWSAccessKey string `json:"aws_access_key,omitempty"` - - // 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"` - - // Basic metrics are disabled. - BasicMetricsDisabled bool `json:"basic_metrics_disabled,omitempty"` - - // Enhanced metrics are disabled. - EnhancedMetricsDisabled bool `json:"enhanced_metrics_disabled,omitempty"` - - // True if exporter uses push metrics mode. - PushMetricsEnabled bool `json:"push_metrics_enabled,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"` - - // metrics resolutions - MetricsResolutions *AddAgentOKBodyRDSExporterMetricsResolutions `json:"metrics_resolutions,omitempty"` -} - -// Validate validates this add agent OK body RDS exporter -func (o *AddAgentOKBodyRDSExporter) 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 addAgentOkBodyRdsExporterTypeStatusPropEnum []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 { - addAgentOkBodyRdsExporterTypeStatusPropEnum = append(addAgentOkBodyRdsExporterTypeStatusPropEnum, v) - } -} - -const ( - - // AddAgentOKBodyRDSExporterStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - AddAgentOKBodyRDSExporterStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // AddAgentOKBodyRDSExporterStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - AddAgentOKBodyRDSExporterStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // AddAgentOKBodyRDSExporterStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - AddAgentOKBodyRDSExporterStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - - // AddAgentOKBodyRDSExporterStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - AddAgentOKBodyRDSExporterStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - - // AddAgentOKBodyRDSExporterStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - AddAgentOKBodyRDSExporterStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - - // AddAgentOKBodyRDSExporterStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - AddAgentOKBodyRDSExporterStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" - - // AddAgentOKBodyRDSExporterStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - AddAgentOKBodyRDSExporterStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" - - // AddAgentOKBodyRDSExporterStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - AddAgentOKBodyRDSExporterStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" -) - -// prop value enum -func (o *AddAgentOKBodyRDSExporter) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addAgentOkBodyRdsExporterTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddAgentOKBodyRDSExporter) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required - return nil - } - - // value enum - if err := o.validateStatusEnum("addAgentOk"+"."+"rds_exporter"+"."+"status", "body", *o.Status); err != nil { - return err - } - - return nil -} - -var addAgentOkBodyRdsExporterTypeLogLevelPropEnum []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 { - addAgentOkBodyRdsExporterTypeLogLevelPropEnum = append(addAgentOkBodyRdsExporterTypeLogLevelPropEnum, v) - } -} - -const ( - - // AddAgentOKBodyRDSExporterLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - AddAgentOKBodyRDSExporterLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // AddAgentOKBodyRDSExporterLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - AddAgentOKBodyRDSExporterLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // AddAgentOKBodyRDSExporterLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - AddAgentOKBodyRDSExporterLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // AddAgentOKBodyRDSExporterLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - AddAgentOKBodyRDSExporterLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // AddAgentOKBodyRDSExporterLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - AddAgentOKBodyRDSExporterLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // AddAgentOKBodyRDSExporterLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - AddAgentOKBodyRDSExporterLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -func (o *AddAgentOKBodyRDSExporter) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addAgentOkBodyRdsExporterTypeLogLevelPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddAgentOKBodyRDSExporter) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("addAgentOk"+"."+"rds_exporter"+"."+"log_level", "body", *o.LogLevel); err != nil { - return err - } - - return nil -} - -func (o *AddAgentOKBodyRDSExporter) 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("addAgentOk" + "." + "rds_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addAgentOk" + "." + "rds_exporter" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this add agent OK body RDS exporter based on the context it is used -func (o *AddAgentOKBodyRDSExporter) 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 *AddAgentOKBodyRDSExporter) 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 { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addAgentOk" + "." + "rds_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addAgentOk" + "." + "rds_exporter" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *AddAgentOKBodyRDSExporter) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddAgentOKBodyRDSExporter) UnmarshalBinary(b []byte) error { - var res AddAgentOKBodyRDSExporter - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddAgentOKBodyRDSExporterMetricsResolutions MetricsResolutions represents Prometheus exporters metrics resolutions. -swagger:model AddAgentOKBodyRDSExporterMetricsResolutions -*/ -type AddAgentOKBodyRDSExporterMetricsResolutions struct { - // High resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Hr string `json:"hr,omitempty"` - - // Medium resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Mr string `json:"mr,omitempty"` - - // Low resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Lr string `json:"lr,omitempty"` -} - -// Validate validates this add agent OK body RDS exporter metrics resolutions -func (o *AddAgentOKBodyRDSExporterMetricsResolutions) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this add agent OK body RDS exporter metrics resolutions based on context it is used -func (o *AddAgentOKBodyRDSExporterMetricsResolutions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddAgentOKBodyRDSExporterMetricsResolutions) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddAgentOKBodyRDSExporterMetricsResolutions) UnmarshalBinary(b []byte) error { - var res AddAgentOKBodyRDSExporterMetricsResolutions - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddAgentOKBodyValkeyExporter ValkeyExporter runs on Generic or Container Node and exposes Valkey Service metrics. -swagger:model AddAgentOKBodyValkeyExporter -*/ -type AddAgentOKBodyValkeyExporter struct { - // Unique randomly generated instance identifier. - AgentID string `json:"agent_id,omitempty"` - - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `json:"disabled,omitempty"` - - // Service identifier. - ServiceID string `json:"service_id,omitempty"` - - // Valkey username for scraping metrics. - Username string `json:"username,omitempty"` - - // Use TLS for database connections. - TLS bool `json:"tls,omitempty"` - - // Skip TLS certificate and hostname verification. - TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // True if exporter uses push metrics mode. - PushMetricsEnabled bool `json:"push_metrics_enabled,omitempty"` - - // 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"` - - // metrics resolutions - MetricsResolutions *AddAgentOKBodyValkeyExporterMetricsResolutions `json:"metrics_resolutions,omitempty"` -} - -// Validate validates this add agent OK body valkey exporter -func (o *AddAgentOKBodyValkeyExporter) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateStatus(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 addAgentOkBodyValkeyExporterTypeStatusPropEnum []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 { - addAgentOkBodyValkeyExporterTypeStatusPropEnum = append(addAgentOkBodyValkeyExporterTypeStatusPropEnum, v) - } -} - -const ( - - // AddAgentOKBodyValkeyExporterStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - AddAgentOKBodyValkeyExporterStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // AddAgentOKBodyValkeyExporterStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - AddAgentOKBodyValkeyExporterStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // AddAgentOKBodyValkeyExporterStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - AddAgentOKBodyValkeyExporterStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - - // AddAgentOKBodyValkeyExporterStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - AddAgentOKBodyValkeyExporterStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - - // AddAgentOKBodyValkeyExporterStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - AddAgentOKBodyValkeyExporterStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - - // AddAgentOKBodyValkeyExporterStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - AddAgentOKBodyValkeyExporterStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" - - // AddAgentOKBodyValkeyExporterStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - AddAgentOKBodyValkeyExporterStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" - - // AddAgentOKBodyValkeyExporterStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - AddAgentOKBodyValkeyExporterStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" -) - -// prop value enum -func (o *AddAgentOKBodyValkeyExporter) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addAgentOkBodyValkeyExporterTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddAgentOKBodyValkeyExporter) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required - return nil - } - - // value enum - if err := o.validateStatusEnum("addAgentOk"+"."+"valkey_exporter"+"."+"status", "body", *o.Status); err != nil { - return err - } - - return nil -} - -func (o *AddAgentOKBodyValkeyExporter) 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("addAgentOk" + "." + "valkey_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addAgentOk" + "." + "valkey_exporter" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this add agent OK body valkey exporter based on the context it is used -func (o *AddAgentOKBodyValkeyExporter) 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 *AddAgentOKBodyValkeyExporter) 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 { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addAgentOk" + "." + "valkey_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addAgentOk" + "." + "valkey_exporter" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *AddAgentOKBodyValkeyExporter) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddAgentOKBodyValkeyExporter) UnmarshalBinary(b []byte) error { - var res AddAgentOKBodyValkeyExporter - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddAgentOKBodyValkeyExporterMetricsResolutions MetricsResolutions represents Prometheus exporters metrics resolutions. -swagger:model AddAgentOKBodyValkeyExporterMetricsResolutions -*/ -type AddAgentOKBodyValkeyExporterMetricsResolutions struct { - // High resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Hr string `json:"hr,omitempty"` - - // Medium resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Mr string `json:"mr,omitempty"` - - // Low resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Lr string `json:"lr,omitempty"` -} - -// Validate validates this add agent OK body valkey exporter metrics resolutions -func (o *AddAgentOKBodyValkeyExporterMetricsResolutions) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this add agent OK body valkey exporter metrics resolutions based on context it is used -func (o *AddAgentOKBodyValkeyExporterMetricsResolutions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddAgentOKBodyValkeyExporterMetricsResolutions) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddAgentOKBodyValkeyExporterMetricsResolutions) UnmarshalBinary(b []byte) error { - var res AddAgentOKBodyValkeyExporterMetricsResolutions - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddAgentParamsBodyAzureDatabaseExporter add agent params body azure database exporter -swagger:model AddAgentParamsBodyAzureDatabaseExporter -*/ -type AddAgentParamsBodyAzureDatabaseExporter struct { - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Node identifier. - NodeID string `json:"node_id,omitempty"` - - // Azure client ID - AzureClientID string `json:"azure_client_id,omitempty"` - - // Azure client secret - AzureClientSecret string `json:"azure_client_secret,omitempty"` - - // Azure tanant ID - AzureTenantID string `json:"azure_tenant_id,omitempty"` - - // Azure subscription ID - AzureSubscriptionID string `json:"azure_subscription_id,omitempty"` - - // Azure resource group. - AzureResourceGroup string `json:"azure_resource_group,omitempty"` - - // Azure resource type (mysql, maria, postgres) - AzureDatabaseResourceType string `json:"azure_database_resource_type,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // Skip connection check. - SkipConnectionCheck bool `json:"skip_connection_check,omitempty"` - - // Enables push metrics mode for exporter. - PushMetrics bool `json:"push_metrics,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 agent params body azure database exporter -func (o *AddAgentParamsBodyAzureDatabaseExporter) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateLogLevel(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var addAgentParamsBodyAzureDatabaseExporterTypeLogLevelPropEnum []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 { - addAgentParamsBodyAzureDatabaseExporterTypeLogLevelPropEnum = append(addAgentParamsBodyAzureDatabaseExporterTypeLogLevelPropEnum, v) - } -} - -const ( - - // AddAgentParamsBodyAzureDatabaseExporterLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - AddAgentParamsBodyAzureDatabaseExporterLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // AddAgentParamsBodyAzureDatabaseExporterLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - AddAgentParamsBodyAzureDatabaseExporterLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // AddAgentParamsBodyAzureDatabaseExporterLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - AddAgentParamsBodyAzureDatabaseExporterLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // AddAgentParamsBodyAzureDatabaseExporterLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - AddAgentParamsBodyAzureDatabaseExporterLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // AddAgentParamsBodyAzureDatabaseExporterLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - AddAgentParamsBodyAzureDatabaseExporterLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // AddAgentParamsBodyAzureDatabaseExporterLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - AddAgentParamsBodyAzureDatabaseExporterLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -func (o *AddAgentParamsBodyAzureDatabaseExporter) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addAgentParamsBodyAzureDatabaseExporterTypeLogLevelPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddAgentParamsBodyAzureDatabaseExporter) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("body"+"."+"azure_database_exporter"+"."+"log_level", "body", *o.LogLevel); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this add agent params body azure database exporter based on context it is used -func (o *AddAgentParamsBodyAzureDatabaseExporter) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddAgentParamsBodyAzureDatabaseExporter) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddAgentParamsBodyAzureDatabaseExporter) UnmarshalBinary(b []byte) error { - var res AddAgentParamsBodyAzureDatabaseExporter - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddAgentParamsBodyExternalExporter add agent params body external exporter -swagger:model AddAgentParamsBodyExternalExporter -*/ -type AddAgentParamsBodyExternalExporter struct { - // The node identifier where this instance is run. - RunsOnNodeID string `json:"runs_on_node_id,omitempty"` - - // Service identifier. - ServiceID string `json:"service_id,omitempty"` - - // HTTP basic auth username for collecting metrics. - Username string `json:"username,omitempty"` - - // HTTP basic auth password for collecting metrics. - Password string `json:"password,omitempty"` - - // Scheme to generate URI to exporter metrics endpoints(default: http). - Scheme string `json:"scheme,omitempty"` - - // Path under which metrics are exposed, used to generate URI(default: /metrics). - MetricsPath string `json:"metrics_path,omitempty"` - - // Listen port for scraping metrics. - ListenPort int64 `json:"listen_port,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // Enables push metrics mode for exporter. - PushMetrics bool `json:"push_metrics,omitempty"` - - // Skip TLS certificate and hostname verification. - TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` -} - -// Validate validates this add agent params body external exporter -func (o *AddAgentParamsBodyExternalExporter) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this add agent params body external exporter based on context it is used -func (o *AddAgentParamsBodyExternalExporter) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddAgentParamsBodyExternalExporter) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddAgentParamsBodyExternalExporter) UnmarshalBinary(b []byte) error { - var res AddAgentParamsBodyExternalExporter - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddAgentParamsBodyMongodbExporter add agent params body mongodb exporter -swagger:model AddAgentParamsBodyMongodbExporter -*/ -type AddAgentParamsBodyMongodbExporter struct { - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Service identifier. - ServiceID string `json:"service_id,omitempty"` - - // MongoDB username for scraping metrics. - Username string `json:"username,omitempty"` - - // MongoDB password for scraping metrics. - Password string `json:"password,omitempty"` - - // Use TLS for database connections. - TLS bool `json:"tls,omitempty"` - - // Skip TLS certificate and hostname validation. - TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - - // Client certificate and key. - TLSCertificateKey string `json:"tls_certificate_key,omitempty"` - - // Password for decrypting tls_certificate_key. - TLSCertificateKeyFilePassword string `json:"tls_certificate_key_file_password,omitempty"` - - // Certificate Authority certificate chain. - TLSCa string `json:"tls_ca,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // Skip connection check. - SkipConnectionCheck bool `json:"skip_connection_check,omitempty"` - - // Enables push metrics mode for exporter. - PushMetrics bool `json:"push_metrics,omitempty"` - - // List of collector names to disable in this exporter. - DisableCollectors []string `json:"disable_collectors"` - - // Authentication mechanism. - // See https://docs.mongodb.com/manual/reference/connection-string/#mongodb-urioption-urioption.authMechanism - // for details. - AuthenticationMechanism string `json:"authentication_mechanism,omitempty"` - - // Authentication database. - AuthenticationDatabase string `json:"authentication_database,omitempty"` - - // Custom password for exporter endpoint /metrics. - AgentPassword string `json:"agent_password,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"` - - // 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"` -} - -// Validate validates this add agent params body mongodb exporter -func (o *AddAgentParamsBodyMongodbExporter) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateLogLevel(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var addAgentParamsBodyMongodbExporterTypeLogLevelPropEnum []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 { - addAgentParamsBodyMongodbExporterTypeLogLevelPropEnum = append(addAgentParamsBodyMongodbExporterTypeLogLevelPropEnum, v) - } -} - -const ( - - // AddAgentParamsBodyMongodbExporterLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - AddAgentParamsBodyMongodbExporterLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // AddAgentParamsBodyMongodbExporterLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - AddAgentParamsBodyMongodbExporterLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // AddAgentParamsBodyMongodbExporterLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - AddAgentParamsBodyMongodbExporterLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // AddAgentParamsBodyMongodbExporterLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - AddAgentParamsBodyMongodbExporterLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // AddAgentParamsBodyMongodbExporterLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - AddAgentParamsBodyMongodbExporterLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // AddAgentParamsBodyMongodbExporterLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - AddAgentParamsBodyMongodbExporterLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -func (o *AddAgentParamsBodyMongodbExporter) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addAgentParamsBodyMongodbExporterTypeLogLevelPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddAgentParamsBodyMongodbExporter) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("body"+"."+"mongodb_exporter"+"."+"log_level", "body", *o.LogLevel); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this add agent params body mongodb exporter based on context it is used -func (o *AddAgentParamsBodyMongodbExporter) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddAgentParamsBodyMongodbExporter) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddAgentParamsBodyMongodbExporter) UnmarshalBinary(b []byte) error { - var res AddAgentParamsBodyMongodbExporter - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddAgentParamsBodyMysqldExporter add agent params body mysqld exporter -swagger:model AddAgentParamsBodyMysqldExporter -*/ -type AddAgentParamsBodyMysqldExporter struct { - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Service identifier. - ServiceID string `json:"service_id,omitempty"` - - // MySQL username for scraping metrics. - Username string `json:"username,omitempty"` - - // MySQL password for scraping metrics. - Password string `json:"password,omitempty"` - - // Use TLS for database connections. - TLS bool `json:"tls,omitempty"` - - // Skip TLS certificate and hostname validation. - TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - - // Certificate Authority certificate chain. - TLSCa string `json:"tls_ca,omitempty"` - - // Client certificate. - TLSCert string `json:"tls_cert,omitempty"` - - // Password for decrypting tls_cert. - TLSKey string `json:"tls_key,omitempty"` - - // Tablestats group collectors will be disabled if there are more than that number of tables. - // 0 means tablestats group collectors are always enabled (no limit). - // Negative value means tablestats group collectors are always disabled. - TablestatsGroupTableLimit int32 `json:"tablestats_group_table_limit,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // Skip connection check. - SkipConnectionCheck bool `json:"skip_connection_check,omitempty"` - - // Enables push metrics mode for exporter. - PushMetrics bool `json:"push_metrics,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"` - - // Extra DSN parameters for MySQL connection. - ExtraDsnParams map[string]string `json:"extra_dsn_params,omitempty"` -} - -// Validate validates this add agent params body mysqld exporter -func (o *AddAgentParamsBodyMysqldExporter) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateLogLevel(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var addAgentParamsBodyMysqldExporterTypeLogLevelPropEnum []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 { - addAgentParamsBodyMysqldExporterTypeLogLevelPropEnum = append(addAgentParamsBodyMysqldExporterTypeLogLevelPropEnum, v) - } -} - -const ( - - // AddAgentParamsBodyMysqldExporterLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - AddAgentParamsBodyMysqldExporterLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // AddAgentParamsBodyMysqldExporterLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - AddAgentParamsBodyMysqldExporterLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // AddAgentParamsBodyMysqldExporterLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - AddAgentParamsBodyMysqldExporterLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // AddAgentParamsBodyMysqldExporterLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - AddAgentParamsBodyMysqldExporterLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // AddAgentParamsBodyMysqldExporterLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - AddAgentParamsBodyMysqldExporterLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // AddAgentParamsBodyMysqldExporterLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - AddAgentParamsBodyMysqldExporterLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -func (o *AddAgentParamsBodyMysqldExporter) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addAgentParamsBodyMysqldExporterTypeLogLevelPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddAgentParamsBodyMysqldExporter) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("body"+"."+"mysqld_exporter"+"."+"log_level", "body", *o.LogLevel); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this add agent params body mysqld exporter based on context it is used -func (o *AddAgentParamsBodyMysqldExporter) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddAgentParamsBodyMysqldExporter) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddAgentParamsBodyMysqldExporter) UnmarshalBinary(b []byte) error { - var res AddAgentParamsBodyMysqldExporter - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddAgentParamsBodyNodeExporter add agent params body node exporter -swagger:model AddAgentParamsBodyNodeExporter -*/ -type AddAgentParamsBodyNodeExporter struct { - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // Enables push metrics mode for exporter. - PushMetrics bool `json:"push_metrics,omitempty"` - - // List of collector names to disable in this exporter. - DisableCollectors []string `json:"disable_collectors"` - - // 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"` - - // Expose the node_exporter process on all public interfaces - ExposeExporter bool `json:"expose_exporter,omitempty"` -} - -// Validate validates this add agent params body node exporter -func (o *AddAgentParamsBodyNodeExporter) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateLogLevel(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var addAgentParamsBodyNodeExporterTypeLogLevelPropEnum []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 { - addAgentParamsBodyNodeExporterTypeLogLevelPropEnum = append(addAgentParamsBodyNodeExporterTypeLogLevelPropEnum, v) - } -} - -const ( - - // AddAgentParamsBodyNodeExporterLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - AddAgentParamsBodyNodeExporterLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // AddAgentParamsBodyNodeExporterLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - AddAgentParamsBodyNodeExporterLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // AddAgentParamsBodyNodeExporterLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - AddAgentParamsBodyNodeExporterLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // AddAgentParamsBodyNodeExporterLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - AddAgentParamsBodyNodeExporterLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // AddAgentParamsBodyNodeExporterLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - AddAgentParamsBodyNodeExporterLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // AddAgentParamsBodyNodeExporterLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - AddAgentParamsBodyNodeExporterLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -func (o *AddAgentParamsBodyNodeExporter) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addAgentParamsBodyNodeExporterTypeLogLevelPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddAgentParamsBodyNodeExporter) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("body"+"."+"node_exporter"+"."+"log_level", "body", *o.LogLevel); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this add agent params body node exporter based on context it is used -func (o *AddAgentParamsBodyNodeExporter) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddAgentParamsBodyNodeExporter) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddAgentParamsBodyNodeExporter) UnmarshalBinary(b []byte) error { - var res AddAgentParamsBodyNodeExporter - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddAgentParamsBodyPMMAgent add agent params body PMM agent -swagger:model AddAgentParamsBodyPMMAgent -*/ -type AddAgentParamsBodyPMMAgent struct { - // Node identifier where this instance runs. - RunsOnNodeID string `json:"runs_on_node_id,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` -} - -// Validate validates this add agent params body PMM agent -func (o *AddAgentParamsBodyPMMAgent) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this add agent params body PMM agent based on context it is used -func (o *AddAgentParamsBodyPMMAgent) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddAgentParamsBodyPMMAgent) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddAgentParamsBodyPMMAgent) UnmarshalBinary(b []byte) error { - var res AddAgentParamsBodyPMMAgent - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddAgentParamsBodyPostgresExporter add agent params body postgres exporter -swagger:model AddAgentParamsBodyPostgresExporter -*/ -type AddAgentParamsBodyPostgresExporter struct { - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Service identifier. - ServiceID string `json:"service_id,omitempty"` - - // PostgreSQL username for scraping metrics. - Username string `json:"username,omitempty"` - - // PostgreSQL password for scraping metrics. - Password string `json:"password,omitempty"` - - // Use TLS for database connections. - TLS bool `json:"tls,omitempty"` - - // Skip TLS certificate and hostname validation. Uses sslmode=required instead of verify-full. - TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // Skip connection check. - SkipConnectionCheck bool `json:"skip_connection_check,omitempty"` - - // Enables push metrics mode for exporter. - PushMetrics bool `json:"push_metrics,omitempty"` - - // List of collector names to disable in this exporter. - DisableCollectors []string `json:"disable_collectors"` - - // TLS CA certificate. - TLSCa string `json:"tls_ca,omitempty"` - - // TLS Certifcate. - TLSCert string `json:"tls_cert,omitempty"` - - // TLS Certificate Key. - TLSKey string `json:"tls_key,omitempty"` - - // 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 of databases for auto-discovery. - AutoDiscoveryLimit int32 `json:"auto_discovery_limit,omitempty"` - - // Optionally expose the exporter process on all public interfaces - ExposeExporter bool `json:"expose_exporter,omitempty"` - - // Maximum number of connections that exporter can open to the database instance. - MaxExporterConnections int32 `json:"max_exporter_connections,omitempty"` -} - -// Validate validates this add agent params body postgres exporter -func (o *AddAgentParamsBodyPostgresExporter) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateLogLevel(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var addAgentParamsBodyPostgresExporterTypeLogLevelPropEnum []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 { - addAgentParamsBodyPostgresExporterTypeLogLevelPropEnum = append(addAgentParamsBodyPostgresExporterTypeLogLevelPropEnum, v) - } -} - -const ( - - // AddAgentParamsBodyPostgresExporterLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - AddAgentParamsBodyPostgresExporterLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // AddAgentParamsBodyPostgresExporterLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - AddAgentParamsBodyPostgresExporterLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // AddAgentParamsBodyPostgresExporterLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - AddAgentParamsBodyPostgresExporterLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // AddAgentParamsBodyPostgresExporterLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - AddAgentParamsBodyPostgresExporterLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // AddAgentParamsBodyPostgresExporterLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - AddAgentParamsBodyPostgresExporterLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // AddAgentParamsBodyPostgresExporterLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - AddAgentParamsBodyPostgresExporterLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -func (o *AddAgentParamsBodyPostgresExporter) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addAgentParamsBodyPostgresExporterTypeLogLevelPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddAgentParamsBodyPostgresExporter) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("body"+"."+"postgres_exporter"+"."+"log_level", "body", *o.LogLevel); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this add agent params body postgres exporter based on context it is used -func (o *AddAgentParamsBodyPostgresExporter) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddAgentParamsBodyPostgresExporter) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddAgentParamsBodyPostgresExporter) UnmarshalBinary(b []byte) error { - var res AddAgentParamsBodyPostgresExporter - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddAgentParamsBodyProxysqlExporter add agent params body proxysql exporter -swagger:model AddAgentParamsBodyProxysqlExporter -*/ -type AddAgentParamsBodyProxysqlExporter struct { - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Service identifier. - ServiceID string `json:"service_id,omitempty"` - - // ProxySQL username for scraping metrics. - Username string `json:"username,omitempty"` - - // ProxySQL password for scraping metrics. - Password string `json:"password,omitempty"` - - // Use TLS for database connections. - TLS bool `json:"tls,omitempty"` - - // Skip TLS certificate and hostname validation. - TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // Skip connection check. - SkipConnectionCheck bool `json:"skip_connection_check,omitempty"` - - // Enables push metrics mode for exporter. - PushMetrics bool `json:"push_metrics,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"` -} - -// Validate validates this add agent params body proxysql exporter -func (o *AddAgentParamsBodyProxysqlExporter) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateLogLevel(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var addAgentParamsBodyProxysqlExporterTypeLogLevelPropEnum []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 { - addAgentParamsBodyProxysqlExporterTypeLogLevelPropEnum = append(addAgentParamsBodyProxysqlExporterTypeLogLevelPropEnum, v) - } -} - -const ( - - // AddAgentParamsBodyProxysqlExporterLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - AddAgentParamsBodyProxysqlExporterLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // AddAgentParamsBodyProxysqlExporterLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - AddAgentParamsBodyProxysqlExporterLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // AddAgentParamsBodyProxysqlExporterLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - AddAgentParamsBodyProxysqlExporterLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // AddAgentParamsBodyProxysqlExporterLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - AddAgentParamsBodyProxysqlExporterLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // AddAgentParamsBodyProxysqlExporterLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - AddAgentParamsBodyProxysqlExporterLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // AddAgentParamsBodyProxysqlExporterLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - AddAgentParamsBodyProxysqlExporterLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -func (o *AddAgentParamsBodyProxysqlExporter) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addAgentParamsBodyProxysqlExporterTypeLogLevelPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddAgentParamsBodyProxysqlExporter) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("body"+"."+"proxysql_exporter"+"."+"log_level", "body", *o.LogLevel); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this add agent params body proxysql exporter based on context it is used -func (o *AddAgentParamsBodyProxysqlExporter) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddAgentParamsBodyProxysqlExporter) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddAgentParamsBodyProxysqlExporter) UnmarshalBinary(b []byte) error { - var res AddAgentParamsBodyProxysqlExporter - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddAgentParamsBodyQANMongodbMongologAgent add agent params body QAN mongodb mongolog agent -swagger:model AddAgentParamsBodyQANMongodbMongologAgent -*/ -type AddAgentParamsBodyQANMongodbMongologAgent struct { - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Service identifier. - ServiceID string `json:"service_id,omitempty"` - - // MongoDB username for getting profile data. - Username string `json:"username,omitempty"` - - // MongoDB password for getting profile data. - Password string `json:"password,omitempty"` - - // Use TLS for database connections. - TLS bool `json:"tls,omitempty"` - - // Skip TLS certificate and hostname validation. - TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - - // Client certificate and key. - TLSCertificateKey string `json:"tls_certificate_key,omitempty"` - - // Password for decrypting tls_certificate_key. - TLSCertificateKeyFilePassword string `json:"tls_certificate_key_file_password,omitempty"` - - // Certificate Authority certificate chain. - TLSCa string `json:"tls_ca,omitempty"` - - // Limit query length in QAN (default: server-defined; -1: no limit). - MaxQueryLength int32 `json:"max_query_length,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // Skip connection check. - SkipConnectionCheck bool `json:"skip_connection_check,omitempty"` - - // Authentication mechanism. - // See https://docs.mongodb.com/manual/reference/connection-string/#mongodb-urioption-urioption.authMechanism - // for details. - AuthenticationMechanism string `json:"authentication_mechanism,omitempty"` - - // Authentication database. - AuthenticationDatabase string `json:"authentication_database,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 agent params body QAN mongodb mongolog agent -func (o *AddAgentParamsBodyQANMongodbMongologAgent) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateLogLevel(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var addAgentParamsBodyQanMongodbMongologAgentTypeLogLevelPropEnum []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 { - addAgentParamsBodyQanMongodbMongologAgentTypeLogLevelPropEnum = append(addAgentParamsBodyQanMongodbMongologAgentTypeLogLevelPropEnum, v) - } -} - -const ( - - // AddAgentParamsBodyQANMongodbMongologAgentLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - AddAgentParamsBodyQANMongodbMongologAgentLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // AddAgentParamsBodyQANMongodbMongologAgentLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - AddAgentParamsBodyQANMongodbMongologAgentLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // AddAgentParamsBodyQANMongodbMongologAgentLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - AddAgentParamsBodyQANMongodbMongologAgentLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // AddAgentParamsBodyQANMongodbMongologAgentLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - AddAgentParamsBodyQANMongodbMongologAgentLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // AddAgentParamsBodyQANMongodbMongologAgentLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - AddAgentParamsBodyQANMongodbMongologAgentLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // AddAgentParamsBodyQANMongodbMongologAgentLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - AddAgentParamsBodyQANMongodbMongologAgentLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -func (o *AddAgentParamsBodyQANMongodbMongologAgent) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addAgentParamsBodyQanMongodbMongologAgentTypeLogLevelPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddAgentParamsBodyQANMongodbMongologAgent) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("body"+"."+"qan_mongodb_mongolog_agent"+"."+"log_level", "body", *o.LogLevel); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this add agent params body QAN mongodb mongolog agent based on context it is used -func (o *AddAgentParamsBodyQANMongodbMongologAgent) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddAgentParamsBodyQANMongodbMongologAgent) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddAgentParamsBodyQANMongodbMongologAgent) UnmarshalBinary(b []byte) error { - var res AddAgentParamsBodyQANMongodbMongologAgent - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddAgentParamsBodyQANMongodbProfilerAgent add agent params body QAN mongodb profiler agent -swagger:model AddAgentParamsBodyQANMongodbProfilerAgent -*/ -type AddAgentParamsBodyQANMongodbProfilerAgent struct { - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Service identifier. - ServiceID string `json:"service_id,omitempty"` - - // MongoDB username for getting profile data. - Username string `json:"username,omitempty"` - - // MongoDB password for getting profile data. - Password string `json:"password,omitempty"` - - // Use TLS for database connections. - TLS bool `json:"tls,omitempty"` - - // Skip TLS certificate and hostname validation. - TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - - // Client certificate and key. - TLSCertificateKey string `json:"tls_certificate_key,omitempty"` - - // Password for decrypting tls_certificate_key. - TLSCertificateKeyFilePassword string `json:"tls_certificate_key_file_password,omitempty"` - - // Certificate Authority certificate chain. - TLSCa string `json:"tls_ca,omitempty"` - - // Limit query length in QAN (default: server-defined; -1: no limit). - MaxQueryLength int32 `json:"max_query_length,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // Skip connection check. - SkipConnectionCheck bool `json:"skip_connection_check,omitempty"` - - // Authentication mechanism. - // See https://docs.mongodb.com/manual/reference/connection-string/#mongodb-urioption-urioption.authMechanism - // for details. - AuthenticationMechanism string `json:"authentication_mechanism,omitempty"` - - // Authentication database. - AuthenticationDatabase string `json:"authentication_database,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 agent params body QAN mongodb profiler agent -func (o *AddAgentParamsBodyQANMongodbProfilerAgent) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateLogLevel(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var addAgentParamsBodyQanMongodbProfilerAgentTypeLogLevelPropEnum []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 { - addAgentParamsBodyQanMongodbProfilerAgentTypeLogLevelPropEnum = append(addAgentParamsBodyQanMongodbProfilerAgentTypeLogLevelPropEnum, v) - } -} - -const ( - - // AddAgentParamsBodyQANMongodbProfilerAgentLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - AddAgentParamsBodyQANMongodbProfilerAgentLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // AddAgentParamsBodyQANMongodbProfilerAgentLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - AddAgentParamsBodyQANMongodbProfilerAgentLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // AddAgentParamsBodyQANMongodbProfilerAgentLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - AddAgentParamsBodyQANMongodbProfilerAgentLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // AddAgentParamsBodyQANMongodbProfilerAgentLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - AddAgentParamsBodyQANMongodbProfilerAgentLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // AddAgentParamsBodyQANMongodbProfilerAgentLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - AddAgentParamsBodyQANMongodbProfilerAgentLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // AddAgentParamsBodyQANMongodbProfilerAgentLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - AddAgentParamsBodyQANMongodbProfilerAgentLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -func (o *AddAgentParamsBodyQANMongodbProfilerAgent) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addAgentParamsBodyQanMongodbProfilerAgentTypeLogLevelPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddAgentParamsBodyQANMongodbProfilerAgent) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("body"+"."+"qan_mongodb_profiler_agent"+"."+"log_level", "body", *o.LogLevel); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this add agent params body QAN mongodb profiler agent based on context it is used -func (o *AddAgentParamsBodyQANMongodbProfilerAgent) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddAgentParamsBodyQANMongodbProfilerAgent) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddAgentParamsBodyQANMongodbProfilerAgent) UnmarshalBinary(b []byte) error { - var res AddAgentParamsBodyQANMongodbProfilerAgent - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddAgentParamsBodyQANMysqlPerfschemaAgent add agent params body QAN mysql perfschema agent -swagger:model AddAgentParamsBodyQANMysqlPerfschemaAgent -*/ -type AddAgentParamsBodyQANMysqlPerfschemaAgent struct { - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Service identifier. - ServiceID string `json:"service_id,omitempty"` - - // MySQL username for getting performance data. - Username string `json:"username,omitempty"` - - // MySQL password for getting performance data. - Password string `json:"password,omitempty"` - - // Use TLS for database connections. - TLS bool `json:"tls,omitempty"` - - // Skip TLS certificate and hostname validation. - TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - - // Certificate Authority certificate chain. - TLSCa string `json:"tls_ca,omitempty"` - - // Client certificate. - TLSCert string `json:"tls_cert,omitempty"` - - // Password for decrypting tls_cert. - TLSKey string `json:"tls_key,omitempty"` - - // Limit query length in QAN (default: server-defined; -1: no limit) - MaxQueryLength int32 `json:"max_query_length,omitempty"` - - // Disable query examples. - DisableQueryExamples bool `json:"disable_query_examples,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // Skip connection check. - SkipConnectionCheck bool `json:"skip_connection_check,omitempty"` - - // Disable parsing comments from queries and showing them in QAN. - DisableCommentsParsing bool `json:"disable_comments_parsing,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 agent params body QAN mysql perfschema agent -func (o *AddAgentParamsBodyQANMysqlPerfschemaAgent) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateLogLevel(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var addAgentParamsBodyQanMysqlPerfschemaAgentTypeLogLevelPropEnum []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 { - addAgentParamsBodyQanMysqlPerfschemaAgentTypeLogLevelPropEnum = append(addAgentParamsBodyQanMysqlPerfschemaAgentTypeLogLevelPropEnum, v) - } -} - -const ( - - // AddAgentParamsBodyQANMysqlPerfschemaAgentLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - AddAgentParamsBodyQANMysqlPerfschemaAgentLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // AddAgentParamsBodyQANMysqlPerfschemaAgentLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - AddAgentParamsBodyQANMysqlPerfschemaAgentLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // AddAgentParamsBodyQANMysqlPerfschemaAgentLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - AddAgentParamsBodyQANMysqlPerfschemaAgentLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // AddAgentParamsBodyQANMysqlPerfschemaAgentLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - AddAgentParamsBodyQANMysqlPerfschemaAgentLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // AddAgentParamsBodyQANMysqlPerfschemaAgentLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - AddAgentParamsBodyQANMysqlPerfschemaAgentLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // AddAgentParamsBodyQANMysqlPerfschemaAgentLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - AddAgentParamsBodyQANMysqlPerfschemaAgentLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -func (o *AddAgentParamsBodyQANMysqlPerfschemaAgent) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addAgentParamsBodyQanMysqlPerfschemaAgentTypeLogLevelPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddAgentParamsBodyQANMysqlPerfschemaAgent) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("body"+"."+"qan_mysql_perfschema_agent"+"."+"log_level", "body", *o.LogLevel); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this add agent params body QAN mysql perfschema agent based on context it is used -func (o *AddAgentParamsBodyQANMysqlPerfschemaAgent) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddAgentParamsBodyQANMysqlPerfschemaAgent) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddAgentParamsBodyQANMysqlPerfschemaAgent) UnmarshalBinary(b []byte) error { - var res AddAgentParamsBodyQANMysqlPerfschemaAgent - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddAgentParamsBodyQANMysqlSlowlogAgent add agent params body QAN mysql slowlog agent -swagger:model AddAgentParamsBodyQANMysqlSlowlogAgent -*/ -type AddAgentParamsBodyQANMysqlSlowlogAgent struct { - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Service identifier. - ServiceID string `json:"service_id,omitempty"` - - // MySQL username for getting slowlog data. - Username string `json:"username,omitempty"` - - // MySQL password for getting slowlog data. - Password string `json:"password,omitempty"` - - // Use TLS for database connections. - TLS bool `json:"tls,omitempty"` - - // Skip TLS certificate and hostname validation. - TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - - // Certificate Authority certificate chain. - TLSCa string `json:"tls_ca,omitempty"` - - // Client certificate. - TLSCert string `json:"tls_cert,omitempty"` - - // Password for decrypting tls_cert. - TLSKey string `json:"tls_key,omitempty"` - - // Limit query length in QAN (default: server-defined; -1: no limit). - MaxQueryLength int32 `json:"max_query_length,omitempty"` - - // Disable query examples. - DisableQueryExamples bool `json:"disable_query_examples,omitempty"` - - // Rotate slowlog file at this size if > 0. - // Use zero or negative value to disable rotation. - MaxSlowlogFileSize string `json:"max_slowlog_file_size,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // Skip connection check. - SkipConnectionCheck bool `json:"skip_connection_check,omitempty"` - - // Disable parsing comments from queries and showing them in QAN. - DisableCommentsParsing bool `json:"disable_comments_parsing,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 agent params body QAN mysql slowlog agent -func (o *AddAgentParamsBodyQANMysqlSlowlogAgent) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateLogLevel(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var addAgentParamsBodyQanMysqlSlowlogAgentTypeLogLevelPropEnum []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 { - addAgentParamsBodyQanMysqlSlowlogAgentTypeLogLevelPropEnum = append(addAgentParamsBodyQanMysqlSlowlogAgentTypeLogLevelPropEnum, v) - } -} - -const ( - - // AddAgentParamsBodyQANMysqlSlowlogAgentLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - AddAgentParamsBodyQANMysqlSlowlogAgentLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // AddAgentParamsBodyQANMysqlSlowlogAgentLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - AddAgentParamsBodyQANMysqlSlowlogAgentLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // AddAgentParamsBodyQANMysqlSlowlogAgentLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - AddAgentParamsBodyQANMysqlSlowlogAgentLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // AddAgentParamsBodyQANMysqlSlowlogAgentLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - AddAgentParamsBodyQANMysqlSlowlogAgentLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // AddAgentParamsBodyQANMysqlSlowlogAgentLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - AddAgentParamsBodyQANMysqlSlowlogAgentLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // AddAgentParamsBodyQANMysqlSlowlogAgentLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - AddAgentParamsBodyQANMysqlSlowlogAgentLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -func (o *AddAgentParamsBodyQANMysqlSlowlogAgent) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addAgentParamsBodyQanMysqlSlowlogAgentTypeLogLevelPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddAgentParamsBodyQANMysqlSlowlogAgent) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("body"+"."+"qan_mysql_slowlog_agent"+"."+"log_level", "body", *o.LogLevel); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this add agent params body QAN mysql slowlog agent based on context it is used -func (o *AddAgentParamsBodyQANMysqlSlowlogAgent) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddAgentParamsBodyQANMysqlSlowlogAgent) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddAgentParamsBodyQANMysqlSlowlogAgent) UnmarshalBinary(b []byte) error { - var res AddAgentParamsBodyQANMysqlSlowlogAgent - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddAgentParamsBodyQANPostgresqlPgstatementsAgent add agent params body QAN postgresql pgstatements agent -swagger:model AddAgentParamsBodyQANPostgresqlPgstatementsAgent -*/ -type AddAgentParamsBodyQANPostgresqlPgstatementsAgent struct { - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Service identifier. - ServiceID string `json:"service_id,omitempty"` - - // PostgreSQL username for getting pg stat statements data. - Username string `json:"username,omitempty"` - - // PostgreSQL password for getting pg stat statements data. - Password string `json:"password,omitempty"` - - // Use TLS for database connections. - TLS bool `json:"tls,omitempty"` - - // Skip TLS certificate and hostname validation. - TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // Skip connection check. - SkipConnectionCheck bool `json:"skip_connection_check,omitempty"` - - // Disable parsing comments from queries and showing them in QAN. - DisableCommentsParsing bool `json:"disable_comments_parsing,omitempty"` - - // Limit query length in QAN (default: server-defined; -1: no limit). - MaxQueryLength int32 `json:"max_query_length,omitempty"` - - // TLS CA certificate. - TLSCa string `json:"tls_ca,omitempty"` - - // TLS Certifcate. - TLSCert string `json:"tls_cert,omitempty"` - - // TLS Certificate Key. - TLSKey string `json:"tls_key,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 agent params body QAN postgresql pgstatements agent -func (o *AddAgentParamsBodyQANPostgresqlPgstatementsAgent) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateLogLevel(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var addAgentParamsBodyQanPostgresqlPgstatementsAgentTypeLogLevelPropEnum []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 { - addAgentParamsBodyQanPostgresqlPgstatementsAgentTypeLogLevelPropEnum = append(addAgentParamsBodyQanPostgresqlPgstatementsAgentTypeLogLevelPropEnum, v) - } -} - -const ( - - // AddAgentParamsBodyQANPostgresqlPgstatementsAgentLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - AddAgentParamsBodyQANPostgresqlPgstatementsAgentLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // AddAgentParamsBodyQANPostgresqlPgstatementsAgentLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - AddAgentParamsBodyQANPostgresqlPgstatementsAgentLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // AddAgentParamsBodyQANPostgresqlPgstatementsAgentLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - AddAgentParamsBodyQANPostgresqlPgstatementsAgentLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // AddAgentParamsBodyQANPostgresqlPgstatementsAgentLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - AddAgentParamsBodyQANPostgresqlPgstatementsAgentLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // AddAgentParamsBodyQANPostgresqlPgstatementsAgentLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - AddAgentParamsBodyQANPostgresqlPgstatementsAgentLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // AddAgentParamsBodyQANPostgresqlPgstatementsAgentLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - AddAgentParamsBodyQANPostgresqlPgstatementsAgentLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -func (o *AddAgentParamsBodyQANPostgresqlPgstatementsAgent) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addAgentParamsBodyQanPostgresqlPgstatementsAgentTypeLogLevelPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddAgentParamsBodyQANPostgresqlPgstatementsAgent) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("body"+"."+"qan_postgresql_pgstatements_agent"+"."+"log_level", "body", *o.LogLevel); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this add agent params body QAN postgresql pgstatements agent based on context it is used -func (o *AddAgentParamsBodyQANPostgresqlPgstatementsAgent) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddAgentParamsBodyQANPostgresqlPgstatementsAgent) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddAgentParamsBodyQANPostgresqlPgstatementsAgent) UnmarshalBinary(b []byte) error { - var res AddAgentParamsBodyQANPostgresqlPgstatementsAgent - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddAgentParamsBodyQANPostgresqlPgstatmonitorAgent add agent params body QAN postgresql pgstatmonitor agent -swagger:model AddAgentParamsBodyQANPostgresqlPgstatmonitorAgent -*/ -type AddAgentParamsBodyQANPostgresqlPgstatmonitorAgent struct { - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Service identifier. - ServiceID string `json:"service_id,omitempty"` - - // PostgreSQL username for getting pg stat monitor data. - Username string `json:"username,omitempty"` - - // PostgreSQL password for getting pg stat monitor data. - Password string `json:"password,omitempty"` - - // Use TLS for database connections. - TLS bool `json:"tls,omitempty"` - - // Skip TLS certificate and hostname validation. - TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - - // Limit query length in QAN (default: server-defined; -1: no limit). - MaxQueryLength int32 `json:"max_query_length,omitempty"` - - // Disable query examples. - DisableQueryExamples bool `json:"disable_query_examples,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // Skip connection check. - SkipConnectionCheck bool `json:"skip_connection_check,omitempty"` - - // Disable parsing comments from queries and showing them in QAN. - DisableCommentsParsing bool `json:"disable_comments_parsing,omitempty"` - - // TLS CA certificate. - TLSCa string `json:"tls_ca,omitempty"` - - // TLS Certifcate. - TLSCert string `json:"tls_cert,omitempty"` - - // TLS Certificate Key. - TLSKey string `json:"tls_key,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 agent params body QAN postgresql pgstatmonitor agent -func (o *AddAgentParamsBodyQANPostgresqlPgstatmonitorAgent) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateLogLevel(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var addAgentParamsBodyQanPostgresqlPgstatmonitorAgentTypeLogLevelPropEnum []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 { - addAgentParamsBodyQanPostgresqlPgstatmonitorAgentTypeLogLevelPropEnum = append(addAgentParamsBodyQanPostgresqlPgstatmonitorAgentTypeLogLevelPropEnum, v) - } -} - -const ( - - // AddAgentParamsBodyQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - AddAgentParamsBodyQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // AddAgentParamsBodyQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - AddAgentParamsBodyQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // AddAgentParamsBodyQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - AddAgentParamsBodyQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // AddAgentParamsBodyQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - AddAgentParamsBodyQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // AddAgentParamsBodyQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - AddAgentParamsBodyQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // AddAgentParamsBodyQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - AddAgentParamsBodyQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -func (o *AddAgentParamsBodyQANPostgresqlPgstatmonitorAgent) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addAgentParamsBodyQanPostgresqlPgstatmonitorAgentTypeLogLevelPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddAgentParamsBodyQANPostgresqlPgstatmonitorAgent) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("body"+"."+"qan_postgresql_pgstatmonitor_agent"+"."+"log_level", "body", *o.LogLevel); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this add agent params body QAN postgresql pgstatmonitor agent based on context it is used -func (o *AddAgentParamsBodyQANPostgresqlPgstatmonitorAgent) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddAgentParamsBodyQANPostgresqlPgstatmonitorAgent) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddAgentParamsBodyQANPostgresqlPgstatmonitorAgent) UnmarshalBinary(b []byte) error { - var res AddAgentParamsBodyQANPostgresqlPgstatmonitorAgent - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddAgentParamsBodyRDSExporter add agent params body RDS exporter -swagger:model AddAgentParamsBodyRDSExporter -*/ -type AddAgentParamsBodyRDSExporter struct { - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Node identifier. - NodeID string `json:"node_id,omitempty"` - - // AWS Access Key. - AWSAccessKey string `json:"aws_access_key,omitempty"` - - // AWS Secret Key. - AWSSecretKey string `json:"aws_secret_key,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // Skip connection check. - SkipConnectionCheck bool `json:"skip_connection_check,omitempty"` - - // Disable basic metrics. - DisableBasicMetrics bool `json:"disable_basic_metrics,omitempty"` - - // Disable enhanced metrics. - DisableEnhancedMetrics bool `json:"disable_enhanced_metrics,omitempty"` - - // Enables push metrics mode for exporter. - PushMetrics bool `json:"push_metrics,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 agent params body RDS exporter -func (o *AddAgentParamsBodyRDSExporter) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateLogLevel(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var addAgentParamsBodyRdsExporterTypeLogLevelPropEnum []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 { - addAgentParamsBodyRdsExporterTypeLogLevelPropEnum = append(addAgentParamsBodyRdsExporterTypeLogLevelPropEnum, v) - } -} - -const ( - - // AddAgentParamsBodyRDSExporterLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - AddAgentParamsBodyRDSExporterLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // AddAgentParamsBodyRDSExporterLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - AddAgentParamsBodyRDSExporterLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // AddAgentParamsBodyRDSExporterLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - AddAgentParamsBodyRDSExporterLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // AddAgentParamsBodyRDSExporterLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - AddAgentParamsBodyRDSExporterLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // AddAgentParamsBodyRDSExporterLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - AddAgentParamsBodyRDSExporterLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // AddAgentParamsBodyRDSExporterLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - AddAgentParamsBodyRDSExporterLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -func (o *AddAgentParamsBodyRDSExporter) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addAgentParamsBodyRdsExporterTypeLogLevelPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddAgentParamsBodyRDSExporter) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("body"+"."+"rds_exporter"+"."+"log_level", "body", *o.LogLevel); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this add agent params body RDS exporter based on context it is used -func (o *AddAgentParamsBodyRDSExporter) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddAgentParamsBodyRDSExporter) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddAgentParamsBodyRDSExporter) UnmarshalBinary(b []byte) error { - var res AddAgentParamsBodyRDSExporter - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddAgentParamsBodyValkeyExporter add agent params body valkey exporter -swagger:model AddAgentParamsBodyValkeyExporter -*/ -type AddAgentParamsBodyValkeyExporter struct { - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Service identifier. - ServiceID string `json:"service_id,omitempty"` - - // Valkey username for scraping metrics. - Username string `json:"username,omitempty"` - - // Valkey password for scraping metrics. - Password string `json:"password,omitempty"` - - // Use TLS for database connections. - TLS bool `json:"tls,omitempty"` - - // Skip TLS certificate and hostname validation. - TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // Skip connection check. - SkipConnectionCheck bool `json:"skip_connection_check,omitempty"` - - // Enables push metrics mode for exporter. - PushMetrics bool `json:"push_metrics,omitempty"` - - // List of collector names to disable in this exporter. - DisableCollectors []string `json:"disable_collectors"` - - // TLS CA certificate. - TLSCa string `json:"tls_ca,omitempty"` - - // TLS Certifcate. - TLSCert string `json:"tls_cert,omitempty"` - - // TLS Certificate Key. - TLSKey string `json:"tls_key,omitempty"` - - // Custom password for exporter endpoint /metrics. - AgentPassword string `json:"agent_password,omitempty"` - - // Optionally expose the exporter process on all public interfaces - ExposeExporter bool `json:"expose_exporter,omitempty"` -} - -// Validate validates this add agent params body valkey exporter -func (o *AddAgentParamsBodyValkeyExporter) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this add agent params body valkey exporter based on context it is used -func (o *AddAgentParamsBodyValkeyExporter) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddAgentParamsBodyValkeyExporter) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddAgentParamsBodyValkeyExporter) UnmarshalBinary(b []byte) error { - var res AddAgentParamsBodyValkeyExporter - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/inventory/v1/json/client/agents_service/agents_service_client.go b/api/inventory/v1/json/client/agents_service/agents_service_client.go deleted file mode 100644 index abd742c194c..00000000000 --- a/api/inventory/v1/json/client/agents_service/agents_service_client.go +++ /dev/null @@ -1,339 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package agents_service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// New creates a new agents service API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -// New creates a new agents service API client with basic auth credentials. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - user: user for basic authentication header. -// - password: password for basic authentication header. -func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BasicAuth(user, password) - return &Client{transport: transport, formats: strfmt.Default} -} - -// New creates a new agents service API client with a bearer token for authentication. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - bearerToken: bearer token for Bearer authentication header. -func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BearerToken(bearerToken) - return &Client{transport: transport, formats: strfmt.Default} -} - -/* -Client for agents service API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption may be used to customize the behavior of Client methods. -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - AddAgent(params *AddAgentParams, opts ...ClientOption) (*AddAgentOK, error) - - ChangeAgent(params *ChangeAgentParams, opts ...ClientOption) (*ChangeAgentOK, error) - - GetAgent(params *GetAgentParams, opts ...ClientOption) (*GetAgentOK, error) - - GetAgentLogs(params *GetAgentLogsParams, opts ...ClientOption) (*GetAgentLogsOK, error) - - ListAgents(params *ListAgentsParams, opts ...ClientOption) (*ListAgentsOK, error) - - RemoveAgent(params *RemoveAgentParams, opts ...ClientOption) (*RemoveAgentOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -AddAgent adds an agent to inventory - -Adds an Agent to Inventory. Only one agent at a time can be passed. -*/ -func (a *Client) AddAgent(params *AddAgentParams, opts ...ClientOption) (*AddAgentOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewAddAgentParams() - } - op := &runtime.ClientOperation{ - ID: "AddAgent", - Method: "POST", - PathPattern: "/v1/inventory/agents", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &AddAgentReader{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.(*AddAgentOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*AddAgentDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -ChangeAgent updates an agent in inventory - -Updates an Agent in Inventory. Only one agent at a time can be passed. -*/ -func (a *Client) ChangeAgent(params *ChangeAgentParams, opts ...ClientOption) (*ChangeAgentOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewChangeAgentParams() - } - op := &runtime.ClientOperation{ - ID: "ChangeAgent", - Method: "PUT", - PathPattern: "/v1/inventory/agents/{agent_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &ChangeAgentReader{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.(*ChangeAgentOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*ChangeAgentDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -GetAgent gets agent - -Returns a single Agent by ID. -*/ -func (a *Client) GetAgent(params *GetAgentParams, opts ...ClientOption) (*GetAgentOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewGetAgentParams() - } - op := &runtime.ClientOperation{ - ID: "GetAgent", - Method: "GET", - PathPattern: "/v1/inventory/agents/{agent_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &GetAgentReader{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.(*GetAgentOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*GetAgentDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -GetAgentLogs gets agent logs - -Returns Agent logs by ID. -*/ -func (a *Client) GetAgentLogs(params *GetAgentLogsParams, opts ...ClientOption) (*GetAgentLogsOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewGetAgentLogsParams() - } - op := &runtime.ClientOperation{ - ID: "GetAgentLogs", - Method: "GET", - PathPattern: "/v1/inventory/agents/{agent_id}/logs", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &GetAgentLogsReader{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.(*GetAgentLogsOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*GetAgentLogsDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -ListAgents lists agents - -Returns a list of all Agents. -*/ -func (a *Client) ListAgents(params *ListAgentsParams, opts ...ClientOption) (*ListAgentsOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewListAgentsParams() - } - op := &runtime.ClientOperation{ - ID: "ListAgents", - Method: "GET", - PathPattern: "/v1/inventory/agents", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &ListAgentsReader{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.(*ListAgentsOK) - if ok { - return success, nil - } - - // 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()) -} - -/* -RemoveAgent removes an agent from inventory - -Removes an Agent from Inventory. -*/ -func (a *Client) RemoveAgent(params *RemoveAgentParams, opts ...ClientOption) (*RemoveAgentOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewRemoveAgentParams() - } - op := &runtime.ClientOperation{ - ID: "RemoveAgent", - Method: "DELETE", - PathPattern: "/v1/inventory/agents/{agent_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &RemoveAgentReader{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.(*RemoveAgentOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*RemoveAgentDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/api/inventory/v1/json/client/agents_service/change_agent_parameters.go b/api/inventory/v1/json/client/agents_service/change_agent_parameters.go deleted file mode 100644 index c683f8aeb08..00000000000 --- a/api/inventory/v1/json/client/agents_service/change_agent_parameters.go +++ /dev/null @@ -1,163 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package agents_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" -) - -// NewChangeAgentParams creates a new ChangeAgentParams 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 NewChangeAgentParams() *ChangeAgentParams { - return &ChangeAgentParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewChangeAgentParamsWithTimeout creates a new ChangeAgentParams object -// with the ability to set a timeout on a request. -func NewChangeAgentParamsWithTimeout(timeout time.Duration) *ChangeAgentParams { - return &ChangeAgentParams{ - timeout: timeout, - } -} - -// NewChangeAgentParamsWithContext creates a new ChangeAgentParams object -// with the ability to set a context for a request. -func NewChangeAgentParamsWithContext(ctx context.Context) *ChangeAgentParams { - return &ChangeAgentParams{ - Context: ctx, - } -} - -// NewChangeAgentParamsWithHTTPClient creates a new ChangeAgentParams object -// with the ability to set a custom HTTPClient for a request. -func NewChangeAgentParamsWithHTTPClient(client *http.Client) *ChangeAgentParams { - return &ChangeAgentParams{ - HTTPClient: client, - } -} - -/* -ChangeAgentParams contains all the parameters to send to the API endpoint - - for the change agent operation. - - Typically these are written to a http.Request. -*/ -type ChangeAgentParams struct { - // AgentID. - AgentID string - - // Body. - Body ChangeAgentBody - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the change agent params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ChangeAgentParams) WithDefaults() *ChangeAgentParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the change agent params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ChangeAgentParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the change agent params -func (o *ChangeAgentParams) WithTimeout(timeout time.Duration) *ChangeAgentParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the change agent params -func (o *ChangeAgentParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the change agent params -func (o *ChangeAgentParams) WithContext(ctx context.Context) *ChangeAgentParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the change agent params -func (o *ChangeAgentParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the change agent params -func (o *ChangeAgentParams) WithHTTPClient(client *http.Client) *ChangeAgentParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the change agent params -func (o *ChangeAgentParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithAgentID adds the agentID to the change agent params -func (o *ChangeAgentParams) WithAgentID(agentID string) *ChangeAgentParams { - o.SetAgentID(agentID) - return o -} - -// SetAgentID adds the agentId to the change agent params -func (o *ChangeAgentParams) SetAgentID(agentID string) { - o.AgentID = agentID -} - -// WithBody adds the body to the change agent params -func (o *ChangeAgentParams) WithBody(body ChangeAgentBody) *ChangeAgentParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the change agent params -func (o *ChangeAgentParams) SetBody(body ChangeAgentBody) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *ChangeAgentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param agent_id - if err := r.SetPathParam("agent_id", o.AgentID); err != nil { - return err - } - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/api/inventory/v1/json/client/agents_service/change_agent_responses.go b/api/inventory/v1/json/client/agents_service/change_agent_responses.go deleted file mode 100644 index 2292ac63390..00000000000 --- a/api/inventory/v1/json/client/agents_service/change_agent_responses.go +++ /dev/null @@ -1,10244 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package agents_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" -) - -// ChangeAgentReader is a Reader for the ChangeAgent structure. -type ChangeAgentReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ChangeAgentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewChangeAgentOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewChangeAgentDefault(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 - } -} - -// NewChangeAgentOK creates a ChangeAgentOK with default headers values -func NewChangeAgentOK() *ChangeAgentOK { - return &ChangeAgentOK{} -} - -/* -ChangeAgentOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type ChangeAgentOK struct { - Payload *ChangeAgentOKBody -} - -// IsSuccess returns true when this change agent Ok response has a 2xx status code -func (o *ChangeAgentOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this change agent Ok response has a 3xx status code -func (o *ChangeAgentOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this change agent Ok response has a 4xx status code -func (o *ChangeAgentOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this change agent Ok response has a 5xx status code -func (o *ChangeAgentOK) IsServerError() bool { - return false -} - -// IsCode returns true when this change agent Ok response a status code equal to that given -func (o *ChangeAgentOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the change agent Ok response -func (o *ChangeAgentOK) Code() int { - return 200 -} - -func (o *ChangeAgentOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/inventory/agents/{agent_id}][%d] changeAgentOk %s", 200, payload) -} - -func (o *ChangeAgentOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/inventory/agents/{agent_id}][%d] changeAgentOk %s", 200, payload) -} - -func (o *ChangeAgentOK) GetPayload() *ChangeAgentOKBody { - return o.Payload -} - -func (o *ChangeAgentOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(ChangeAgentOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -// NewChangeAgentDefault creates a ChangeAgentDefault with default headers values -func NewChangeAgentDefault(code int) *ChangeAgentDefault { - return &ChangeAgentDefault{ - _statusCode: code, - } -} - -/* -ChangeAgentDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type ChangeAgentDefault struct { - _statusCode int - - Payload *ChangeAgentDefaultBody -} - -// IsSuccess returns true when this change agent default response has a 2xx status code -func (o *ChangeAgentDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this change agent default response has a 3xx status code -func (o *ChangeAgentDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this change agent default response has a 4xx status code -func (o *ChangeAgentDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this change agent default response has a 5xx status code -func (o *ChangeAgentDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this change agent default response a status code equal to that given -func (o *ChangeAgentDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the change agent default response -func (o *ChangeAgentDefault) Code() int { - return o._statusCode -} - -func (o *ChangeAgentDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/inventory/agents/{agent_id}][%d] ChangeAgent default %s", o._statusCode, payload) -} - -func (o *ChangeAgentDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/inventory/agents/{agent_id}][%d] ChangeAgent default %s", o._statusCode, payload) -} - -func (o *ChangeAgentDefault) GetPayload() *ChangeAgentDefaultBody { - return o.Payload -} - -func (o *ChangeAgentDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(ChangeAgentDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -ChangeAgentBody change agent body -swagger:model ChangeAgentBody -*/ -type ChangeAgentBody struct { - // azure database exporter - AzureDatabaseExporter *ChangeAgentParamsBodyAzureDatabaseExporter `json:"azure_database_exporter,omitempty"` - - // external exporter - ExternalExporter *ChangeAgentParamsBodyExternalExporter `json:"external_exporter,omitempty"` - - // mongodb exporter - MongodbExporter *ChangeAgentParamsBodyMongodbExporter `json:"mongodb_exporter,omitempty"` - - // mysqld exporter - MysqldExporter *ChangeAgentParamsBodyMysqldExporter `json:"mysqld_exporter,omitempty"` - - // node exporter - NodeExporter *ChangeAgentParamsBodyNodeExporter `json:"node_exporter,omitempty"` - - // nomad agent - NomadAgent *ChangeAgentParamsBodyNomadAgent `json:"nomad_agent,omitempty"` - - // postgres exporter - PostgresExporter *ChangeAgentParamsBodyPostgresExporter `json:"postgres_exporter,omitempty"` - - // proxysql exporter - ProxysqlExporter *ChangeAgentParamsBodyProxysqlExporter `json:"proxysql_exporter,omitempty"` - - // qan mongodb mongolog agent - QANMongodbMongologAgent *ChangeAgentParamsBodyQANMongodbMongologAgent `json:"qan_mongodb_mongolog_agent,omitempty"` - - // qan mongodb profiler agent - QANMongodbProfilerAgent *ChangeAgentParamsBodyQANMongodbProfilerAgent `json:"qan_mongodb_profiler_agent,omitempty"` - - // qan mysql perfschema agent - QANMysqlPerfschemaAgent *ChangeAgentParamsBodyQANMysqlPerfschemaAgent `json:"qan_mysql_perfschema_agent,omitempty"` - - // qan mysql slowlog agent - QANMysqlSlowlogAgent *ChangeAgentParamsBodyQANMysqlSlowlogAgent `json:"qan_mysql_slowlog_agent,omitempty"` - - // qan postgresql pgstatements agent - QANPostgresqlPgstatementsAgent *ChangeAgentParamsBodyQANPostgresqlPgstatementsAgent `json:"qan_postgresql_pgstatements_agent,omitempty"` - - // qan postgresql pgstatmonitor agent - QANPostgresqlPgstatmonitorAgent *ChangeAgentParamsBodyQANPostgresqlPgstatmonitorAgent `json:"qan_postgresql_pgstatmonitor_agent,omitempty"` - - // rds exporter - RDSExporter *ChangeAgentParamsBodyRDSExporter `json:"rds_exporter,omitempty"` - - // valkey exporter - ValkeyExporter *ChangeAgentParamsBodyValkeyExporter `json:"valkey_exporter,omitempty"` -} - -// Validate validates this change agent body -func (o *ChangeAgentBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateAzureDatabaseExporter(formats); err != nil { - res = append(res, err) - } - - if err := o.validateExternalExporter(formats); err != nil { - res = append(res, err) - } - - if err := o.validateMongodbExporter(formats); err != nil { - res = append(res, err) - } - - if err := o.validateMysqldExporter(formats); err != nil { - res = append(res, err) - } - - if err := o.validateNodeExporter(formats); err != nil { - res = append(res, err) - } - - if err := o.validateNomadAgent(formats); err != nil { - res = append(res, err) - } - - if err := o.validatePostgresExporter(formats); err != nil { - res = append(res, err) - } - - if err := o.validateProxysqlExporter(formats); err != nil { - res = append(res, err) - } - - if err := o.validateQANMongodbMongologAgent(formats); err != nil { - res = append(res, err) - } - - if err := o.validateQANMongodbProfilerAgent(formats); err != nil { - res = append(res, err) - } - - if err := o.validateQANMysqlPerfschemaAgent(formats); err != nil { - res = append(res, err) - } - - if err := o.validateQANMysqlSlowlogAgent(formats); err != nil { - res = append(res, err) - } - - if err := o.validateQANPostgresqlPgstatementsAgent(formats); err != nil { - res = append(res, err) - } - - if err := o.validateQANPostgresqlPgstatmonitorAgent(formats); err != nil { - res = append(res, err) - } - - if err := o.validateRDSExporter(formats); err != nil { - res = append(res, err) - } - - if err := o.validateValkeyExporter(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ChangeAgentBody) validateAzureDatabaseExporter(formats strfmt.Registry) error { - if swag.IsZero(o.AzureDatabaseExporter) { // not required - return nil - } - - if o.AzureDatabaseExporter != nil { - if err := o.AzureDatabaseExporter.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "azure_database_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "azure_database_exporter") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentBody) validateExternalExporter(formats strfmt.Registry) error { - if swag.IsZero(o.ExternalExporter) { // not required - return nil - } - - if o.ExternalExporter != nil { - if err := o.ExternalExporter.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "external_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "external_exporter") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentBody) validateMongodbExporter(formats strfmt.Registry) error { - if swag.IsZero(o.MongodbExporter) { // not required - return nil - } - - if o.MongodbExporter != nil { - if err := o.MongodbExporter.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "mongodb_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "mongodb_exporter") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentBody) validateMysqldExporter(formats strfmt.Registry) error { - if swag.IsZero(o.MysqldExporter) { // not required - return nil - } - - if o.MysqldExporter != nil { - if err := o.MysqldExporter.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "mysqld_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "mysqld_exporter") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentBody) validateNodeExporter(formats strfmt.Registry) error { - if swag.IsZero(o.NodeExporter) { // not required - return nil - } - - if o.NodeExporter != nil { - if err := o.NodeExporter.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "node_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "node_exporter") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentBody) validateNomadAgent(formats strfmt.Registry) error { - if swag.IsZero(o.NomadAgent) { // not required - return nil - } - - if o.NomadAgent != nil { - if err := o.NomadAgent.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "nomad_agent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "nomad_agent") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentBody) validatePostgresExporter(formats strfmt.Registry) error { - if swag.IsZero(o.PostgresExporter) { // not required - return nil - } - - if o.PostgresExporter != nil { - if err := o.PostgresExporter.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "postgres_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "postgres_exporter") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentBody) validateProxysqlExporter(formats strfmt.Registry) error { - if swag.IsZero(o.ProxysqlExporter) { // not required - return nil - } - - if o.ProxysqlExporter != nil { - if err := o.ProxysqlExporter.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "proxysql_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "proxysql_exporter") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentBody) validateQANMongodbMongologAgent(formats strfmt.Registry) error { - if swag.IsZero(o.QANMongodbMongologAgent) { // not required - return nil - } - - if o.QANMongodbMongologAgent != nil { - if err := o.QANMongodbMongologAgent.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "qan_mongodb_mongolog_agent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "qan_mongodb_mongolog_agent") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentBody) validateQANMongodbProfilerAgent(formats strfmt.Registry) error { - if swag.IsZero(o.QANMongodbProfilerAgent) { // not required - return nil - } - - if o.QANMongodbProfilerAgent != nil { - if err := o.QANMongodbProfilerAgent.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "qan_mongodb_profiler_agent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "qan_mongodb_profiler_agent") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentBody) validateQANMysqlPerfschemaAgent(formats strfmt.Registry) error { - if swag.IsZero(o.QANMysqlPerfschemaAgent) { // not required - return nil - } - - if o.QANMysqlPerfschemaAgent != nil { - if err := o.QANMysqlPerfschemaAgent.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "qan_mysql_perfschema_agent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "qan_mysql_perfschema_agent") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentBody) validateQANMysqlSlowlogAgent(formats strfmt.Registry) error { - if swag.IsZero(o.QANMysqlSlowlogAgent) { // not required - return nil - } - - if o.QANMysqlSlowlogAgent != nil { - if err := o.QANMysqlSlowlogAgent.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "qan_mysql_slowlog_agent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "qan_mysql_slowlog_agent") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentBody) validateQANPostgresqlPgstatementsAgent(formats strfmt.Registry) error { - if swag.IsZero(o.QANPostgresqlPgstatementsAgent) { // not required - return nil - } - - if o.QANPostgresqlPgstatementsAgent != nil { - if err := o.QANPostgresqlPgstatementsAgent.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "qan_postgresql_pgstatements_agent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "qan_postgresql_pgstatements_agent") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentBody) validateQANPostgresqlPgstatmonitorAgent(formats strfmt.Registry) error { - if swag.IsZero(o.QANPostgresqlPgstatmonitorAgent) { // not required - return nil - } - - if o.QANPostgresqlPgstatmonitorAgent != nil { - if err := o.QANPostgresqlPgstatmonitorAgent.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "qan_postgresql_pgstatmonitor_agent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "qan_postgresql_pgstatmonitor_agent") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentBody) validateRDSExporter(formats strfmt.Registry) error { - if swag.IsZero(o.RDSExporter) { // not required - return nil - } - - if o.RDSExporter != nil { - if err := o.RDSExporter.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "rds_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "rds_exporter") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentBody) validateValkeyExporter(formats strfmt.Registry) error { - if swag.IsZero(o.ValkeyExporter) { // not required - return nil - } - - if o.ValkeyExporter != nil { - if err := o.ValkeyExporter.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "valkey_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "valkey_exporter") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this change agent body based on the context it is used -func (o *ChangeAgentBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateAzureDatabaseExporter(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateExternalExporter(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateMongodbExporter(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateMysqldExporter(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateNodeExporter(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateNomadAgent(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidatePostgresExporter(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateProxysqlExporter(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateQANMongodbMongologAgent(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateQANMongodbProfilerAgent(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateQANMysqlPerfschemaAgent(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateQANMysqlSlowlogAgent(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateQANPostgresqlPgstatementsAgent(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateQANPostgresqlPgstatmonitorAgent(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateRDSExporter(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateValkeyExporter(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ChangeAgentBody) contextValidateAzureDatabaseExporter(ctx context.Context, formats strfmt.Registry) error { - if o.AzureDatabaseExporter != nil { - - if swag.IsZero(o.AzureDatabaseExporter) { // not required - return nil - } - - if err := o.AzureDatabaseExporter.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "azure_database_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "azure_database_exporter") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentBody) contextValidateExternalExporter(ctx context.Context, formats strfmt.Registry) error { - if o.ExternalExporter != nil { - - if swag.IsZero(o.ExternalExporter) { // not required - return nil - } - - if err := o.ExternalExporter.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "external_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "external_exporter") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentBody) contextValidateMongodbExporter(ctx context.Context, formats strfmt.Registry) error { - if o.MongodbExporter != nil { - - if swag.IsZero(o.MongodbExporter) { // not required - return nil - } - - if err := o.MongodbExporter.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "mongodb_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "mongodb_exporter") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentBody) contextValidateMysqldExporter(ctx context.Context, formats strfmt.Registry) error { - if o.MysqldExporter != nil { - - if swag.IsZero(o.MysqldExporter) { // not required - return nil - } - - if err := o.MysqldExporter.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "mysqld_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "mysqld_exporter") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentBody) contextValidateNodeExporter(ctx context.Context, formats strfmt.Registry) error { - if o.NodeExporter != nil { - - if swag.IsZero(o.NodeExporter) { // not required - return nil - } - - if err := o.NodeExporter.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "node_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "node_exporter") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentBody) contextValidateNomadAgent(ctx context.Context, formats strfmt.Registry) error { - if o.NomadAgent != nil { - - if swag.IsZero(o.NomadAgent) { // not required - return nil - } - - if err := o.NomadAgent.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "nomad_agent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "nomad_agent") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentBody) contextValidatePostgresExporter(ctx context.Context, formats strfmt.Registry) error { - if o.PostgresExporter != nil { - - if swag.IsZero(o.PostgresExporter) { // not required - return nil - } - - if err := o.PostgresExporter.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "postgres_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "postgres_exporter") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentBody) contextValidateProxysqlExporter(ctx context.Context, formats strfmt.Registry) error { - if o.ProxysqlExporter != nil { - - if swag.IsZero(o.ProxysqlExporter) { // not required - return nil - } - - if err := o.ProxysqlExporter.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "proxysql_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "proxysql_exporter") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentBody) contextValidateQANMongodbMongologAgent(ctx context.Context, formats strfmt.Registry) error { - if o.QANMongodbMongologAgent != nil { - - if swag.IsZero(o.QANMongodbMongologAgent) { // not required - return nil - } - - if err := o.QANMongodbMongologAgent.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "qan_mongodb_mongolog_agent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "qan_mongodb_mongolog_agent") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentBody) contextValidateQANMongodbProfilerAgent(ctx context.Context, formats strfmt.Registry) error { - if o.QANMongodbProfilerAgent != nil { - - if swag.IsZero(o.QANMongodbProfilerAgent) { // not required - return nil - } - - if err := o.QANMongodbProfilerAgent.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "qan_mongodb_profiler_agent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "qan_mongodb_profiler_agent") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentBody) contextValidateQANMysqlPerfschemaAgent(ctx context.Context, formats strfmt.Registry) error { - if o.QANMysqlPerfschemaAgent != nil { - - if swag.IsZero(o.QANMysqlPerfschemaAgent) { // not required - return nil - } - - if err := o.QANMysqlPerfschemaAgent.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "qan_mysql_perfschema_agent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "qan_mysql_perfschema_agent") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentBody) contextValidateQANMysqlSlowlogAgent(ctx context.Context, formats strfmt.Registry) error { - if o.QANMysqlSlowlogAgent != nil { - - if swag.IsZero(o.QANMysqlSlowlogAgent) { // not required - return nil - } - - if err := o.QANMysqlSlowlogAgent.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "qan_mysql_slowlog_agent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "qan_mysql_slowlog_agent") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentBody) contextValidateQANPostgresqlPgstatementsAgent(ctx context.Context, formats strfmt.Registry) error { - if o.QANPostgresqlPgstatementsAgent != nil { - - if swag.IsZero(o.QANPostgresqlPgstatementsAgent) { // not required - return nil - } - - if err := o.QANPostgresqlPgstatementsAgent.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "qan_postgresql_pgstatements_agent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "qan_postgresql_pgstatements_agent") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentBody) contextValidateQANPostgresqlPgstatmonitorAgent(ctx context.Context, formats strfmt.Registry) error { - if o.QANPostgresqlPgstatmonitorAgent != nil { - - if swag.IsZero(o.QANPostgresqlPgstatmonitorAgent) { // not required - return nil - } - - if err := o.QANPostgresqlPgstatmonitorAgent.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "qan_postgresql_pgstatmonitor_agent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "qan_postgresql_pgstatmonitor_agent") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentBody) contextValidateRDSExporter(ctx context.Context, formats strfmt.Registry) error { - if o.RDSExporter != nil { - - if swag.IsZero(o.RDSExporter) { // not required - return nil - } - - if err := o.RDSExporter.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "rds_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "rds_exporter") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentBody) contextValidateValkeyExporter(ctx context.Context, formats strfmt.Registry) error { - if o.ValkeyExporter != nil { - - if swag.IsZero(o.ValkeyExporter) { // not required - return nil - } - - if err := o.ValkeyExporter.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "valkey_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "valkey_exporter") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeAgentBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeAgentBody) UnmarshalBinary(b []byte) error { - var res ChangeAgentBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeAgentDefaultBody change agent default body -swagger:model ChangeAgentDefaultBody -*/ -type ChangeAgentDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*ChangeAgentDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this change agent default body -func (o *ChangeAgentDefaultBody) 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 *ChangeAgentDefaultBody) 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("ChangeAgent default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("ChangeAgent default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this change agent default body based on the context it is used -func (o *ChangeAgentDefaultBody) 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 *ChangeAgentDefaultBody) 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("ChangeAgent default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("ChangeAgent default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeAgentDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeAgentDefaultBody) UnmarshalBinary(b []byte) error { - var res ChangeAgentDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeAgentDefaultBodyDetailsItems0 change agent default body details items0 -swagger:model ChangeAgentDefaultBodyDetailsItems0 -*/ -type ChangeAgentDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` - - // change agent default body details items0 - ChangeAgentDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *ChangeAgentDefaultBodyDetailsItems0) 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 ChangeAgentDefaultBodyDetailsItems0 - - 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.ChangeAgentDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o ChangeAgentDefaultBodyDetailsItems0) 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.ChangeAgentDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.ChangeAgentDefaultBodyDetailsItems0) - 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 change agent default body details items0 -func (o *ChangeAgentDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this change agent default body details items0 based on context it is used -func (o *ChangeAgentDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeAgentDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeAgentDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res ChangeAgentDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeAgentOKBody change agent OK body -swagger:model ChangeAgentOKBody -*/ -type ChangeAgentOKBody struct { - // azure database exporter - AzureDatabaseExporter *ChangeAgentOKBodyAzureDatabaseExporter `json:"azure_database_exporter,omitempty"` - - // external exporter - ExternalExporter *ChangeAgentOKBodyExternalExporter `json:"external_exporter,omitempty"` - - // mongodb exporter - MongodbExporter *ChangeAgentOKBodyMongodbExporter `json:"mongodb_exporter,omitempty"` - - // mysqld exporter - MysqldExporter *ChangeAgentOKBodyMysqldExporter `json:"mysqld_exporter,omitempty"` - - // node exporter - NodeExporter *ChangeAgentOKBodyNodeExporter `json:"node_exporter,omitempty"` - - // nomad agent - NomadAgent *ChangeAgentOKBodyNomadAgent `json:"nomad_agent,omitempty"` - - // postgres exporter - PostgresExporter *ChangeAgentOKBodyPostgresExporter `json:"postgres_exporter,omitempty"` - - // proxysql exporter - ProxysqlExporter *ChangeAgentOKBodyProxysqlExporter `json:"proxysql_exporter,omitempty"` - - // qan mongodb mongolog agent - QANMongodbMongologAgent *ChangeAgentOKBodyQANMongodbMongologAgent `json:"qan_mongodb_mongolog_agent,omitempty"` - - // qan mongodb profiler agent - QANMongodbProfilerAgent *ChangeAgentOKBodyQANMongodbProfilerAgent `json:"qan_mongodb_profiler_agent,omitempty"` - - // qan mysql perfschema agent - QANMysqlPerfschemaAgent *ChangeAgentOKBodyQANMysqlPerfschemaAgent `json:"qan_mysql_perfschema_agent,omitempty"` - - // qan mysql slowlog agent - QANMysqlSlowlogAgent *ChangeAgentOKBodyQANMysqlSlowlogAgent `json:"qan_mysql_slowlog_agent,omitempty"` - - // qan postgresql pgstatements agent - QANPostgresqlPgstatementsAgent *ChangeAgentOKBodyQANPostgresqlPgstatementsAgent `json:"qan_postgresql_pgstatements_agent,omitempty"` - - // qan postgresql pgstatmonitor agent - QANPostgresqlPgstatmonitorAgent *ChangeAgentOKBodyQANPostgresqlPgstatmonitorAgent `json:"qan_postgresql_pgstatmonitor_agent,omitempty"` - - // rds exporter - RDSExporter *ChangeAgentOKBodyRDSExporter `json:"rds_exporter,omitempty"` - - // valkey exporter - ValkeyExporter *ChangeAgentOKBodyValkeyExporter `json:"valkey_exporter,omitempty"` -} - -// Validate validates this change agent OK body -func (o *ChangeAgentOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateAzureDatabaseExporter(formats); err != nil { - res = append(res, err) - } - - if err := o.validateExternalExporter(formats); err != nil { - res = append(res, err) - } - - if err := o.validateMongodbExporter(formats); err != nil { - res = append(res, err) - } - - if err := o.validateMysqldExporter(formats); err != nil { - res = append(res, err) - } - - if err := o.validateNodeExporter(formats); err != nil { - res = append(res, err) - } - - if err := o.validateNomadAgent(formats); err != nil { - res = append(res, err) - } - - if err := o.validatePostgresExporter(formats); err != nil { - res = append(res, err) - } - - if err := o.validateProxysqlExporter(formats); err != nil { - res = append(res, err) - } - - if err := o.validateQANMongodbMongologAgent(formats); err != nil { - res = append(res, err) - } - - if err := o.validateQANMongodbProfilerAgent(formats); err != nil { - res = append(res, err) - } - - if err := o.validateQANMysqlPerfschemaAgent(formats); err != nil { - res = append(res, err) - } - - if err := o.validateQANMysqlSlowlogAgent(formats); err != nil { - res = append(res, err) - } - - if err := o.validateQANPostgresqlPgstatementsAgent(formats); err != nil { - res = append(res, err) - } - - if err := o.validateQANPostgresqlPgstatmonitorAgent(formats); err != nil { - res = append(res, err) - } - - if err := o.validateRDSExporter(formats); err != nil { - res = append(res, err) - } - - if err := o.validateValkeyExporter(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ChangeAgentOKBody) validateAzureDatabaseExporter(formats strfmt.Registry) error { - if swag.IsZero(o.AzureDatabaseExporter) { // not required - return nil - } - - if o.AzureDatabaseExporter != nil { - if err := o.AzureDatabaseExporter.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("changeAgentOk" + "." + "azure_database_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("changeAgentOk" + "." + "azure_database_exporter") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentOKBody) validateExternalExporter(formats strfmt.Registry) error { - if swag.IsZero(o.ExternalExporter) { // not required - return nil - } - - if o.ExternalExporter != nil { - if err := o.ExternalExporter.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("changeAgentOk" + "." + "external_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("changeAgentOk" + "." + "external_exporter") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentOKBody) validateMongodbExporter(formats strfmt.Registry) error { - if swag.IsZero(o.MongodbExporter) { // not required - return nil - } - - if o.MongodbExporter != nil { - if err := o.MongodbExporter.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("changeAgentOk" + "." + "mongodb_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("changeAgentOk" + "." + "mongodb_exporter") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentOKBody) validateMysqldExporter(formats strfmt.Registry) error { - if swag.IsZero(o.MysqldExporter) { // not required - return nil - } - - if o.MysqldExporter != nil { - if err := o.MysqldExporter.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("changeAgentOk" + "." + "mysqld_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("changeAgentOk" + "." + "mysqld_exporter") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentOKBody) validateNodeExporter(formats strfmt.Registry) error { - if swag.IsZero(o.NodeExporter) { // not required - return nil - } - - if o.NodeExporter != nil { - if err := o.NodeExporter.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("changeAgentOk" + "." + "node_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("changeAgentOk" + "." + "node_exporter") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentOKBody) validateNomadAgent(formats strfmt.Registry) error { - if swag.IsZero(o.NomadAgent) { // not required - return nil - } - - if o.NomadAgent != nil { - if err := o.NomadAgent.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("changeAgentOk" + "." + "nomad_agent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("changeAgentOk" + "." + "nomad_agent") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentOKBody) validatePostgresExporter(formats strfmt.Registry) error { - if swag.IsZero(o.PostgresExporter) { // not required - return nil - } - - if o.PostgresExporter != nil { - if err := o.PostgresExporter.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("changeAgentOk" + "." + "postgres_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("changeAgentOk" + "." + "postgres_exporter") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentOKBody) validateProxysqlExporter(formats strfmt.Registry) error { - if swag.IsZero(o.ProxysqlExporter) { // not required - return nil - } - - if o.ProxysqlExporter != nil { - if err := o.ProxysqlExporter.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("changeAgentOk" + "." + "proxysql_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("changeAgentOk" + "." + "proxysql_exporter") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentOKBody) validateQANMongodbMongologAgent(formats strfmt.Registry) error { - if swag.IsZero(o.QANMongodbMongologAgent) { // not required - return nil - } - - if o.QANMongodbMongologAgent != nil { - if err := o.QANMongodbMongologAgent.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("changeAgentOk" + "." + "qan_mongodb_mongolog_agent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("changeAgentOk" + "." + "qan_mongodb_mongolog_agent") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentOKBody) validateQANMongodbProfilerAgent(formats strfmt.Registry) error { - if swag.IsZero(o.QANMongodbProfilerAgent) { // not required - return nil - } - - if o.QANMongodbProfilerAgent != nil { - if err := o.QANMongodbProfilerAgent.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("changeAgentOk" + "." + "qan_mongodb_profiler_agent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("changeAgentOk" + "." + "qan_mongodb_profiler_agent") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentOKBody) validateQANMysqlPerfschemaAgent(formats strfmt.Registry) error { - if swag.IsZero(o.QANMysqlPerfschemaAgent) { // not required - return nil - } - - if o.QANMysqlPerfschemaAgent != nil { - if err := o.QANMysqlPerfschemaAgent.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("changeAgentOk" + "." + "qan_mysql_perfschema_agent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("changeAgentOk" + "." + "qan_mysql_perfschema_agent") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentOKBody) validateQANMysqlSlowlogAgent(formats strfmt.Registry) error { - if swag.IsZero(o.QANMysqlSlowlogAgent) { // not required - return nil - } - - if o.QANMysqlSlowlogAgent != nil { - if err := o.QANMysqlSlowlogAgent.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("changeAgentOk" + "." + "qan_mysql_slowlog_agent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("changeAgentOk" + "." + "qan_mysql_slowlog_agent") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentOKBody) validateQANPostgresqlPgstatementsAgent(formats strfmt.Registry) error { - if swag.IsZero(o.QANPostgresqlPgstatementsAgent) { // not required - return nil - } - - if o.QANPostgresqlPgstatementsAgent != nil { - if err := o.QANPostgresqlPgstatementsAgent.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("changeAgentOk" + "." + "qan_postgresql_pgstatements_agent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("changeAgentOk" + "." + "qan_postgresql_pgstatements_agent") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentOKBody) validateQANPostgresqlPgstatmonitorAgent(formats strfmt.Registry) error { - if swag.IsZero(o.QANPostgresqlPgstatmonitorAgent) { // not required - return nil - } - - if o.QANPostgresqlPgstatmonitorAgent != nil { - if err := o.QANPostgresqlPgstatmonitorAgent.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("changeAgentOk" + "." + "qan_postgresql_pgstatmonitor_agent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("changeAgentOk" + "." + "qan_postgresql_pgstatmonitor_agent") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentOKBody) validateRDSExporter(formats strfmt.Registry) error { - if swag.IsZero(o.RDSExporter) { // not required - return nil - } - - if o.RDSExporter != nil { - if err := o.RDSExporter.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("changeAgentOk" + "." + "rds_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("changeAgentOk" + "." + "rds_exporter") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentOKBody) validateValkeyExporter(formats strfmt.Registry) error { - if swag.IsZero(o.ValkeyExporter) { // not required - return nil - } - - if o.ValkeyExporter != nil { - if err := o.ValkeyExporter.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("changeAgentOk" + "." + "valkey_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("changeAgentOk" + "." + "valkey_exporter") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this change agent OK body based on the context it is used -func (o *ChangeAgentOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateAzureDatabaseExporter(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateExternalExporter(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateMongodbExporter(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateMysqldExporter(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateNodeExporter(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateNomadAgent(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidatePostgresExporter(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateProxysqlExporter(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateQANMongodbMongologAgent(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateQANMongodbProfilerAgent(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateQANMysqlPerfschemaAgent(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateQANMysqlSlowlogAgent(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateQANPostgresqlPgstatementsAgent(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateQANPostgresqlPgstatmonitorAgent(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateRDSExporter(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateValkeyExporter(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ChangeAgentOKBody) contextValidateAzureDatabaseExporter(ctx context.Context, formats strfmt.Registry) error { - if o.AzureDatabaseExporter != nil { - - if swag.IsZero(o.AzureDatabaseExporter) { // not required - return nil - } - - if err := o.AzureDatabaseExporter.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("changeAgentOk" + "." + "azure_database_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("changeAgentOk" + "." + "azure_database_exporter") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentOKBody) contextValidateExternalExporter(ctx context.Context, formats strfmt.Registry) error { - if o.ExternalExporter != nil { - - if swag.IsZero(o.ExternalExporter) { // not required - return nil - } - - if err := o.ExternalExporter.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("changeAgentOk" + "." + "external_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("changeAgentOk" + "." + "external_exporter") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentOKBody) contextValidateMongodbExporter(ctx context.Context, formats strfmt.Registry) error { - if o.MongodbExporter != nil { - - if swag.IsZero(o.MongodbExporter) { // not required - return nil - } - - if err := o.MongodbExporter.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("changeAgentOk" + "." + "mongodb_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("changeAgentOk" + "." + "mongodb_exporter") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentOKBody) contextValidateMysqldExporter(ctx context.Context, formats strfmt.Registry) error { - if o.MysqldExporter != nil { - - if swag.IsZero(o.MysqldExporter) { // not required - return nil - } - - if err := o.MysqldExporter.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("changeAgentOk" + "." + "mysqld_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("changeAgentOk" + "." + "mysqld_exporter") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentOKBody) contextValidateNodeExporter(ctx context.Context, formats strfmt.Registry) error { - if o.NodeExporter != nil { - - if swag.IsZero(o.NodeExporter) { // not required - return nil - } - - if err := o.NodeExporter.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("changeAgentOk" + "." + "node_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("changeAgentOk" + "." + "node_exporter") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentOKBody) contextValidateNomadAgent(ctx context.Context, formats strfmt.Registry) error { - if o.NomadAgent != nil { - - if swag.IsZero(o.NomadAgent) { // not required - return nil - } - - if err := o.NomadAgent.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("changeAgentOk" + "." + "nomad_agent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("changeAgentOk" + "." + "nomad_agent") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentOKBody) contextValidatePostgresExporter(ctx context.Context, formats strfmt.Registry) error { - if o.PostgresExporter != nil { - - if swag.IsZero(o.PostgresExporter) { // not required - return nil - } - - if err := o.PostgresExporter.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("changeAgentOk" + "." + "postgres_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("changeAgentOk" + "." + "postgres_exporter") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentOKBody) contextValidateProxysqlExporter(ctx context.Context, formats strfmt.Registry) error { - if o.ProxysqlExporter != nil { - - if swag.IsZero(o.ProxysqlExporter) { // not required - return nil - } - - if err := o.ProxysqlExporter.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("changeAgentOk" + "." + "proxysql_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("changeAgentOk" + "." + "proxysql_exporter") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentOKBody) contextValidateQANMongodbMongologAgent(ctx context.Context, formats strfmt.Registry) error { - if o.QANMongodbMongologAgent != nil { - - if swag.IsZero(o.QANMongodbMongologAgent) { // not required - return nil - } - - if err := o.QANMongodbMongologAgent.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("changeAgentOk" + "." + "qan_mongodb_mongolog_agent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("changeAgentOk" + "." + "qan_mongodb_mongolog_agent") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentOKBody) contextValidateQANMongodbProfilerAgent(ctx context.Context, formats strfmt.Registry) error { - if o.QANMongodbProfilerAgent != nil { - - if swag.IsZero(o.QANMongodbProfilerAgent) { // not required - return nil - } - - if err := o.QANMongodbProfilerAgent.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("changeAgentOk" + "." + "qan_mongodb_profiler_agent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("changeAgentOk" + "." + "qan_mongodb_profiler_agent") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentOKBody) contextValidateQANMysqlPerfschemaAgent(ctx context.Context, formats strfmt.Registry) error { - if o.QANMysqlPerfschemaAgent != nil { - - if swag.IsZero(o.QANMysqlPerfschemaAgent) { // not required - return nil - } - - if err := o.QANMysqlPerfschemaAgent.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("changeAgentOk" + "." + "qan_mysql_perfschema_agent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("changeAgentOk" + "." + "qan_mysql_perfschema_agent") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentOKBody) contextValidateQANMysqlSlowlogAgent(ctx context.Context, formats strfmt.Registry) error { - if o.QANMysqlSlowlogAgent != nil { - - if swag.IsZero(o.QANMysqlSlowlogAgent) { // not required - return nil - } - - if err := o.QANMysqlSlowlogAgent.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("changeAgentOk" + "." + "qan_mysql_slowlog_agent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("changeAgentOk" + "." + "qan_mysql_slowlog_agent") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentOKBody) contextValidateQANPostgresqlPgstatementsAgent(ctx context.Context, formats strfmt.Registry) error { - if o.QANPostgresqlPgstatementsAgent != nil { - - if swag.IsZero(o.QANPostgresqlPgstatementsAgent) { // not required - return nil - } - - if err := o.QANPostgresqlPgstatementsAgent.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("changeAgentOk" + "." + "qan_postgresql_pgstatements_agent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("changeAgentOk" + "." + "qan_postgresql_pgstatements_agent") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentOKBody) contextValidateQANPostgresqlPgstatmonitorAgent(ctx context.Context, formats strfmt.Registry) error { - if o.QANPostgresqlPgstatmonitorAgent != nil { - - if swag.IsZero(o.QANPostgresqlPgstatmonitorAgent) { // not required - return nil - } - - if err := o.QANPostgresqlPgstatmonitorAgent.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("changeAgentOk" + "." + "qan_postgresql_pgstatmonitor_agent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("changeAgentOk" + "." + "qan_postgresql_pgstatmonitor_agent") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentOKBody) contextValidateRDSExporter(ctx context.Context, formats strfmt.Registry) error { - if o.RDSExporter != nil { - - if swag.IsZero(o.RDSExporter) { // not required - return nil - } - - if err := o.RDSExporter.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("changeAgentOk" + "." + "rds_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("changeAgentOk" + "." + "rds_exporter") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentOKBody) contextValidateValkeyExporter(ctx context.Context, formats strfmt.Registry) error { - if o.ValkeyExporter != nil { - - if swag.IsZero(o.ValkeyExporter) { // not required - return nil - } - - if err := o.ValkeyExporter.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("changeAgentOk" + "." + "valkey_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("changeAgentOk" + "." + "valkey_exporter") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeAgentOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeAgentOKBody) UnmarshalBinary(b []byte) error { - var res ChangeAgentOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeAgentOKBodyAzureDatabaseExporter AzureDatabaseExporter runs on Generic or Container Node and exposes RemoteAzure Node metrics. -swagger:model ChangeAgentOKBodyAzureDatabaseExporter -*/ -type ChangeAgentOKBodyAzureDatabaseExporter struct { - // Unique randomly generated instance identifier. - AgentID string `json:"agent_id,omitempty"` - - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `json:"disabled,omitempty"` - - // Node identifier. - NodeID string `json:"node_id,omitempty"` - - // Azure database subscription ID. - AzureDatabaseSubscriptionID string `json:"azure_database_subscription_id,omitempty"` - - // Azure database resource type (mysql, maria, postgres) - AzureDatabaseResourceType string `json:"azure_database_resource_type,omitempty"` - - // 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"` - - // True if the exporter operates in push metrics mode. - PushMetricsEnabled bool `json:"push_metrics_enabled,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"` - - // metrics resolutions - MetricsResolutions *ChangeAgentOKBodyAzureDatabaseExporterMetricsResolutions `json:"metrics_resolutions,omitempty"` -} - -// Validate validates this change agent OK body azure database exporter -func (o *ChangeAgentOKBodyAzureDatabaseExporter) 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 changeAgentOkBodyAzureDatabaseExporterTypeStatusPropEnum []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 { - changeAgentOkBodyAzureDatabaseExporterTypeStatusPropEnum = append(changeAgentOkBodyAzureDatabaseExporterTypeStatusPropEnum, v) - } -} - -const ( - - // ChangeAgentOKBodyAzureDatabaseExporterStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - ChangeAgentOKBodyAzureDatabaseExporterStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // ChangeAgentOKBodyAzureDatabaseExporterStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - ChangeAgentOKBodyAzureDatabaseExporterStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // ChangeAgentOKBodyAzureDatabaseExporterStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - ChangeAgentOKBodyAzureDatabaseExporterStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - - // ChangeAgentOKBodyAzureDatabaseExporterStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - ChangeAgentOKBodyAzureDatabaseExporterStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - - // ChangeAgentOKBodyAzureDatabaseExporterStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - ChangeAgentOKBodyAzureDatabaseExporterStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - - // ChangeAgentOKBodyAzureDatabaseExporterStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - ChangeAgentOKBodyAzureDatabaseExporterStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" - - // ChangeAgentOKBodyAzureDatabaseExporterStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - ChangeAgentOKBodyAzureDatabaseExporterStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" - - // ChangeAgentOKBodyAzureDatabaseExporterStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - ChangeAgentOKBodyAzureDatabaseExporterStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" -) - -// prop value enum -func (o *ChangeAgentOKBodyAzureDatabaseExporter) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, changeAgentOkBodyAzureDatabaseExporterTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ChangeAgentOKBodyAzureDatabaseExporter) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required - return nil - } - - // value enum - if err := o.validateStatusEnum("changeAgentOk"+"."+"azure_database_exporter"+"."+"status", "body", *o.Status); err != nil { - return err - } - - return nil -} - -var changeAgentOkBodyAzureDatabaseExporterTypeLogLevelPropEnum []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 { - changeAgentOkBodyAzureDatabaseExporterTypeLogLevelPropEnum = append(changeAgentOkBodyAzureDatabaseExporterTypeLogLevelPropEnum, v) - } -} - -const ( - - // ChangeAgentOKBodyAzureDatabaseExporterLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - ChangeAgentOKBodyAzureDatabaseExporterLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // ChangeAgentOKBodyAzureDatabaseExporterLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - ChangeAgentOKBodyAzureDatabaseExporterLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // ChangeAgentOKBodyAzureDatabaseExporterLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - ChangeAgentOKBodyAzureDatabaseExporterLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // ChangeAgentOKBodyAzureDatabaseExporterLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - ChangeAgentOKBodyAzureDatabaseExporterLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // ChangeAgentOKBodyAzureDatabaseExporterLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - ChangeAgentOKBodyAzureDatabaseExporterLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // ChangeAgentOKBodyAzureDatabaseExporterLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - ChangeAgentOKBodyAzureDatabaseExporterLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -func (o *ChangeAgentOKBodyAzureDatabaseExporter) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, changeAgentOkBodyAzureDatabaseExporterTypeLogLevelPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ChangeAgentOKBodyAzureDatabaseExporter) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("changeAgentOk"+"."+"azure_database_exporter"+"."+"log_level", "body", *o.LogLevel); err != nil { - return err - } - - return nil -} - -func (o *ChangeAgentOKBodyAzureDatabaseExporter) 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("changeAgentOk" + "." + "azure_database_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("changeAgentOk" + "." + "azure_database_exporter" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this change agent OK body azure database exporter based on the context it is used -func (o *ChangeAgentOKBodyAzureDatabaseExporter) 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 *ChangeAgentOKBodyAzureDatabaseExporter) 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 { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("changeAgentOk" + "." + "azure_database_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("changeAgentOk" + "." + "azure_database_exporter" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeAgentOKBodyAzureDatabaseExporter) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeAgentOKBodyAzureDatabaseExporter) UnmarshalBinary(b []byte) error { - var res ChangeAgentOKBodyAzureDatabaseExporter - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeAgentOKBodyAzureDatabaseExporterMetricsResolutions MetricsResolutions represents Prometheus exporters metrics resolutions. -swagger:model ChangeAgentOKBodyAzureDatabaseExporterMetricsResolutions -*/ -type ChangeAgentOKBodyAzureDatabaseExporterMetricsResolutions struct { - // High resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Hr string `json:"hr,omitempty"` - - // Medium resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Mr string `json:"mr,omitempty"` - - // Low resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Lr string `json:"lr,omitempty"` -} - -// Validate validates this change agent OK body azure database exporter metrics resolutions -func (o *ChangeAgentOKBodyAzureDatabaseExporterMetricsResolutions) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this change agent OK body azure database exporter metrics resolutions based on context it is used -func (o *ChangeAgentOKBodyAzureDatabaseExporterMetricsResolutions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeAgentOKBodyAzureDatabaseExporterMetricsResolutions) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeAgentOKBodyAzureDatabaseExporterMetricsResolutions) UnmarshalBinary(b []byte) error { - var res ChangeAgentOKBodyAzureDatabaseExporterMetricsResolutions - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeAgentOKBodyExternalExporter ExternalExporter runs on any Node type, including Remote Node. -swagger:model ChangeAgentOKBodyExternalExporter -*/ -type ChangeAgentOKBodyExternalExporter struct { - // Unique randomly generated instance identifier. - AgentID string `json:"agent_id,omitempty"` - - // Node identifier where this instance runs. - RunsOnNodeID string `json:"runs_on_node_id,omitempty"` - - // If disabled, metrics from this exporter will not be collected. - Disabled bool `json:"disabled,omitempty"` - - // Service identifier. - ServiceID string `json:"service_id,omitempty"` - - // HTTP basic auth username for collecting metrics. - Username string `json:"username,omitempty"` - - // Scheme to generate URI to exporter metrics endpoints. - Scheme string `json:"scheme,omitempty"` - - // Path under which metrics are exposed, used to generate URI. - MetricsPath string `json:"metrics_path,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // Listen port for scraping metrics. - ListenPort int64 `json:"listen_port,omitempty"` - - // True if exporter uses push metrics mode. - PushMetricsEnabled bool `json:"push_metrics_enabled,omitempty"` - - // Path to exec process. - ProcessExecPath string `json:"process_exec_path,omitempty"` - - // Skip TLS certificate and hostname verification. - TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - - // metrics resolutions - MetricsResolutions *ChangeAgentOKBodyExternalExporterMetricsResolutions `json:"metrics_resolutions,omitempty"` -} - -// Validate validates this change agent OK body external exporter -func (o *ChangeAgentOKBodyExternalExporter) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateMetricsResolutions(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ChangeAgentOKBodyExternalExporter) 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("changeAgentOk" + "." + "external_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("changeAgentOk" + "." + "external_exporter" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this change agent OK body external exporter based on the context it is used -func (o *ChangeAgentOKBodyExternalExporter) 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 *ChangeAgentOKBodyExternalExporter) 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 { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("changeAgentOk" + "." + "external_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("changeAgentOk" + "." + "external_exporter" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeAgentOKBodyExternalExporter) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeAgentOKBodyExternalExporter) UnmarshalBinary(b []byte) error { - var res ChangeAgentOKBodyExternalExporter - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeAgentOKBodyExternalExporterMetricsResolutions MetricsResolutions represents Prometheus exporters metrics resolutions. -swagger:model ChangeAgentOKBodyExternalExporterMetricsResolutions -*/ -type ChangeAgentOKBodyExternalExporterMetricsResolutions struct { - // High resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Hr string `json:"hr,omitempty"` - - // Medium resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Mr string `json:"mr,omitempty"` - - // Low resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Lr string `json:"lr,omitempty"` -} - -// Validate validates this change agent OK body external exporter metrics resolutions -func (o *ChangeAgentOKBodyExternalExporterMetricsResolutions) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this change agent OK body external exporter metrics resolutions based on context it is used -func (o *ChangeAgentOKBodyExternalExporterMetricsResolutions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeAgentOKBodyExternalExporterMetricsResolutions) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeAgentOKBodyExternalExporterMetricsResolutions) UnmarshalBinary(b []byte) error { - var res ChangeAgentOKBodyExternalExporterMetricsResolutions - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeAgentOKBodyMongodbExporter MongoDBExporter runs on Generic or Container Node and exposes MongoDB Service metrics. -swagger:model ChangeAgentOKBodyMongodbExporter -*/ -type ChangeAgentOKBodyMongodbExporter struct { - // Unique randomly generated instance identifier. - AgentID string `json:"agent_id,omitempty"` - - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `json:"disabled,omitempty"` - - // Service identifier. - ServiceID string `json:"service_id,omitempty"` - - // MongoDB username for scraping metrics. - Username string `json:"username,omitempty"` - - // Use TLS for database connections. - TLS bool `json:"tls,omitempty"` - - // Skip TLS certificate and hostname validation. - TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // True if exporter uses push metrics mode. - PushMetricsEnabled bool `json:"push_metrics_enabled,omitempty"` - - // 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"` - - // 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. - EnableAllCollectors bool `json:"enable_all_collectors,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"` - - // Optionally expose the exporter process on all public interfaces - ExposeExporter bool `json:"expose_exporter,omitempty"` - - // metrics resolutions - MetricsResolutions *ChangeAgentOKBodyMongodbExporterMetricsResolutions `json:"metrics_resolutions,omitempty"` -} - -// Validate validates this change agent OK body mongodb exporter -func (o *ChangeAgentOKBodyMongodbExporter) 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 changeAgentOkBodyMongodbExporterTypeStatusPropEnum []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 { - changeAgentOkBodyMongodbExporterTypeStatusPropEnum = append(changeAgentOkBodyMongodbExporterTypeStatusPropEnum, v) - } -} - -const ( - - // ChangeAgentOKBodyMongodbExporterStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - ChangeAgentOKBodyMongodbExporterStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // ChangeAgentOKBodyMongodbExporterStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - ChangeAgentOKBodyMongodbExporterStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // ChangeAgentOKBodyMongodbExporterStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - ChangeAgentOKBodyMongodbExporterStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - - // ChangeAgentOKBodyMongodbExporterStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - ChangeAgentOKBodyMongodbExporterStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - - // ChangeAgentOKBodyMongodbExporterStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - ChangeAgentOKBodyMongodbExporterStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - - // ChangeAgentOKBodyMongodbExporterStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - ChangeAgentOKBodyMongodbExporterStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" - - // ChangeAgentOKBodyMongodbExporterStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - ChangeAgentOKBodyMongodbExporterStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" - - // ChangeAgentOKBodyMongodbExporterStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - ChangeAgentOKBodyMongodbExporterStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" -) - -// prop value enum -func (o *ChangeAgentOKBodyMongodbExporter) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, changeAgentOkBodyMongodbExporterTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ChangeAgentOKBodyMongodbExporter) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required - return nil - } - - // value enum - if err := o.validateStatusEnum("changeAgentOk"+"."+"mongodb_exporter"+"."+"status", "body", *o.Status); err != nil { - return err - } - - return nil -} - -var changeAgentOkBodyMongodbExporterTypeLogLevelPropEnum []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 { - changeAgentOkBodyMongodbExporterTypeLogLevelPropEnum = append(changeAgentOkBodyMongodbExporterTypeLogLevelPropEnum, v) - } -} - -const ( - - // ChangeAgentOKBodyMongodbExporterLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - ChangeAgentOKBodyMongodbExporterLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // ChangeAgentOKBodyMongodbExporterLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - ChangeAgentOKBodyMongodbExporterLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // ChangeAgentOKBodyMongodbExporterLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - ChangeAgentOKBodyMongodbExporterLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // ChangeAgentOKBodyMongodbExporterLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - ChangeAgentOKBodyMongodbExporterLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // ChangeAgentOKBodyMongodbExporterLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - ChangeAgentOKBodyMongodbExporterLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // ChangeAgentOKBodyMongodbExporterLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - ChangeAgentOKBodyMongodbExporterLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -func (o *ChangeAgentOKBodyMongodbExporter) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, changeAgentOkBodyMongodbExporterTypeLogLevelPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ChangeAgentOKBodyMongodbExporter) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("changeAgentOk"+"."+"mongodb_exporter"+"."+"log_level", "body", *o.LogLevel); err != nil { - return err - } - - return nil -} - -func (o *ChangeAgentOKBodyMongodbExporter) 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("changeAgentOk" + "." + "mongodb_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("changeAgentOk" + "." + "mongodb_exporter" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this change agent OK body mongodb exporter based on the context it is used -func (o *ChangeAgentOKBodyMongodbExporter) 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 *ChangeAgentOKBodyMongodbExporter) 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 { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("changeAgentOk" + "." + "mongodb_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("changeAgentOk" + "." + "mongodb_exporter" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeAgentOKBodyMongodbExporter) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeAgentOKBodyMongodbExporter) UnmarshalBinary(b []byte) error { - var res ChangeAgentOKBodyMongodbExporter - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeAgentOKBodyMongodbExporterMetricsResolutions MetricsResolutions represents Prometheus exporters metrics resolutions. -swagger:model ChangeAgentOKBodyMongodbExporterMetricsResolutions -*/ -type ChangeAgentOKBodyMongodbExporterMetricsResolutions struct { - // High resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Hr string `json:"hr,omitempty"` - - // Medium resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Mr string `json:"mr,omitempty"` - - // Low resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Lr string `json:"lr,omitempty"` -} - -// Validate validates this change agent OK body mongodb exporter metrics resolutions -func (o *ChangeAgentOKBodyMongodbExporterMetricsResolutions) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this change agent OK body mongodb exporter metrics resolutions based on context it is used -func (o *ChangeAgentOKBodyMongodbExporterMetricsResolutions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeAgentOKBodyMongodbExporterMetricsResolutions) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeAgentOKBodyMongodbExporterMetricsResolutions) UnmarshalBinary(b []byte) error { - var res ChangeAgentOKBodyMongodbExporterMetricsResolutions - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeAgentOKBodyMysqldExporter MySQLdExporter runs on Generic or Container Node and exposes MySQL Service metrics. -swagger:model ChangeAgentOKBodyMysqldExporter -*/ -type ChangeAgentOKBodyMysqldExporter struct { - // Unique randomly generated instance identifier. - AgentID string `json:"agent_id,omitempty"` - - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `json:"disabled,omitempty"` - - // Service identifier. - ServiceID string `json:"service_id,omitempty"` - - // MySQL username for scraping metrics. - Username string `json:"username,omitempty"` - - // Use TLS for database connections. - TLS bool `json:"tls,omitempty"` - - // Skip TLS certificate and hostname validation. - TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - - // Certificate Authority certificate chain. - TLSCa string `json:"tls_ca,omitempty"` - - // Client certificate. - TLSCert string `json:"tls_cert,omitempty"` - - // Password for decrypting tls_cert. - TLSKey string `json:"tls_key,omitempty"` - - // Tablestats group collectors are disabled if there are more than that number of tables. - // 0 means tablestats group collectors are always enabled (no limit). - // Negative value means tablestats group collectors are always disabled. - TablestatsGroupTableLimit int32 `json:"tablestats_group_table_limit,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // True if exporter uses push metrics mode. - PushMetricsEnabled bool `json:"push_metrics_enabled,omitempty"` - - // List of disabled collector names. - DisabledCollectors []string `json:"disabled_collectors"` - - // 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"` - - // True if tablestats group collectors are currently disabled. - TablestatsGroupDisabled bool `json:"tablestats_group_disabled,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"` - - // 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 *ChangeAgentOKBodyMysqldExporterMetricsResolutions `json:"metrics_resolutions,omitempty"` -} - -// Validate validates this change agent OK body mysqld exporter -func (o *ChangeAgentOKBodyMysqldExporter) 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 changeAgentOkBodyMysqldExporterTypeStatusPropEnum []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 { - changeAgentOkBodyMysqldExporterTypeStatusPropEnum = append(changeAgentOkBodyMysqldExporterTypeStatusPropEnum, v) - } -} - -const ( - - // ChangeAgentOKBodyMysqldExporterStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - ChangeAgentOKBodyMysqldExporterStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // ChangeAgentOKBodyMysqldExporterStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - ChangeAgentOKBodyMysqldExporterStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // ChangeAgentOKBodyMysqldExporterStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - ChangeAgentOKBodyMysqldExporterStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - - // ChangeAgentOKBodyMysqldExporterStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - ChangeAgentOKBodyMysqldExporterStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - - // ChangeAgentOKBodyMysqldExporterStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - ChangeAgentOKBodyMysqldExporterStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - - // ChangeAgentOKBodyMysqldExporterStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - ChangeAgentOKBodyMysqldExporterStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" - - // ChangeAgentOKBodyMysqldExporterStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - ChangeAgentOKBodyMysqldExporterStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" - - // ChangeAgentOKBodyMysqldExporterStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - ChangeAgentOKBodyMysqldExporterStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" -) - -// prop value enum -func (o *ChangeAgentOKBodyMysqldExporter) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, changeAgentOkBodyMysqldExporterTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ChangeAgentOKBodyMysqldExporter) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required - return nil - } - - // value enum - if err := o.validateStatusEnum("changeAgentOk"+"."+"mysqld_exporter"+"."+"status", "body", *o.Status); err != nil { - return err - } - - return nil -} - -var changeAgentOkBodyMysqldExporterTypeLogLevelPropEnum []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 { - changeAgentOkBodyMysqldExporterTypeLogLevelPropEnum = append(changeAgentOkBodyMysqldExporterTypeLogLevelPropEnum, v) - } -} - -const ( - - // ChangeAgentOKBodyMysqldExporterLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - ChangeAgentOKBodyMysqldExporterLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // ChangeAgentOKBodyMysqldExporterLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - ChangeAgentOKBodyMysqldExporterLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // ChangeAgentOKBodyMysqldExporterLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - ChangeAgentOKBodyMysqldExporterLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // ChangeAgentOKBodyMysqldExporterLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - ChangeAgentOKBodyMysqldExporterLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // ChangeAgentOKBodyMysqldExporterLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - ChangeAgentOKBodyMysqldExporterLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // ChangeAgentOKBodyMysqldExporterLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - ChangeAgentOKBodyMysqldExporterLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -func (o *ChangeAgentOKBodyMysqldExporter) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, changeAgentOkBodyMysqldExporterTypeLogLevelPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ChangeAgentOKBodyMysqldExporter) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("changeAgentOk"+"."+"mysqld_exporter"+"."+"log_level", "body", *o.LogLevel); err != nil { - return err - } - - return nil -} - -func (o *ChangeAgentOKBodyMysqldExporter) 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("changeAgentOk" + "." + "mysqld_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("changeAgentOk" + "." + "mysqld_exporter" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this change agent OK body mysqld exporter based on the context it is used -func (o *ChangeAgentOKBodyMysqldExporter) 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 *ChangeAgentOKBodyMysqldExporter) 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 { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("changeAgentOk" + "." + "mysqld_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("changeAgentOk" + "." + "mysqld_exporter" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeAgentOKBodyMysqldExporter) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeAgentOKBodyMysqldExporter) UnmarshalBinary(b []byte) error { - var res ChangeAgentOKBodyMysqldExporter - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeAgentOKBodyMysqldExporterMetricsResolutions MetricsResolutions represents Prometheus exporters metrics resolutions. -swagger:model ChangeAgentOKBodyMysqldExporterMetricsResolutions -*/ -type ChangeAgentOKBodyMysqldExporterMetricsResolutions struct { - // High resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Hr string `json:"hr,omitempty"` - - // Medium resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Mr string `json:"mr,omitempty"` - - // Low resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Lr string `json:"lr,omitempty"` -} - -// Validate validates this change agent OK body mysqld exporter metrics resolutions -func (o *ChangeAgentOKBodyMysqldExporterMetricsResolutions) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this change agent OK body mysqld exporter metrics resolutions based on context it is used -func (o *ChangeAgentOKBodyMysqldExporterMetricsResolutions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeAgentOKBodyMysqldExporterMetricsResolutions) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeAgentOKBodyMysqldExporterMetricsResolutions) UnmarshalBinary(b []byte) error { - var res ChangeAgentOKBodyMysqldExporterMetricsResolutions - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeAgentOKBodyNodeExporter NodeExporter runs on Generic or Container Node and exposes its metrics. -swagger:model ChangeAgentOKBodyNodeExporter -*/ -type ChangeAgentOKBodyNodeExporter struct { - // Unique randomly generated instance identifier. - AgentID string `json:"agent_id,omitempty"` - - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `json:"disabled,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // True if exporter uses push metrics mode. - PushMetricsEnabled bool `json:"push_metrics_enabled,omitempty"` - - // 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"` - - // Optionally expose the exporter process on all public interfaces - ExposeExporter bool `json:"expose_exporter,omitempty"` - - // metrics resolutions - MetricsResolutions *ChangeAgentOKBodyNodeExporterMetricsResolutions `json:"metrics_resolutions,omitempty"` -} - -// Validate validates this change agent OK body node exporter -func (o *ChangeAgentOKBodyNodeExporter) 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 changeAgentOkBodyNodeExporterTypeStatusPropEnum []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 { - changeAgentOkBodyNodeExporterTypeStatusPropEnum = append(changeAgentOkBodyNodeExporterTypeStatusPropEnum, v) - } -} - -const ( - - // ChangeAgentOKBodyNodeExporterStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - ChangeAgentOKBodyNodeExporterStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // ChangeAgentOKBodyNodeExporterStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - ChangeAgentOKBodyNodeExporterStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // ChangeAgentOKBodyNodeExporterStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - ChangeAgentOKBodyNodeExporterStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - - // ChangeAgentOKBodyNodeExporterStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - ChangeAgentOKBodyNodeExporterStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - - // ChangeAgentOKBodyNodeExporterStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - ChangeAgentOKBodyNodeExporterStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - - // ChangeAgentOKBodyNodeExporterStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - ChangeAgentOKBodyNodeExporterStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" - - // ChangeAgentOKBodyNodeExporterStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - ChangeAgentOKBodyNodeExporterStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" - - // ChangeAgentOKBodyNodeExporterStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - ChangeAgentOKBodyNodeExporterStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" -) - -// prop value enum -func (o *ChangeAgentOKBodyNodeExporter) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, changeAgentOkBodyNodeExporterTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ChangeAgentOKBodyNodeExporter) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required - return nil - } - - // value enum - if err := o.validateStatusEnum("changeAgentOk"+"."+"node_exporter"+"."+"status", "body", *o.Status); err != nil { - return err - } - - return nil -} - -var changeAgentOkBodyNodeExporterTypeLogLevelPropEnum []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 { - changeAgentOkBodyNodeExporterTypeLogLevelPropEnum = append(changeAgentOkBodyNodeExporterTypeLogLevelPropEnum, v) - } -} - -const ( - - // ChangeAgentOKBodyNodeExporterLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - ChangeAgentOKBodyNodeExporterLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // ChangeAgentOKBodyNodeExporterLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - ChangeAgentOKBodyNodeExporterLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // ChangeAgentOKBodyNodeExporterLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - ChangeAgentOKBodyNodeExporterLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // ChangeAgentOKBodyNodeExporterLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - ChangeAgentOKBodyNodeExporterLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // ChangeAgentOKBodyNodeExporterLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - ChangeAgentOKBodyNodeExporterLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // ChangeAgentOKBodyNodeExporterLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - ChangeAgentOKBodyNodeExporterLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -func (o *ChangeAgentOKBodyNodeExporter) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, changeAgentOkBodyNodeExporterTypeLogLevelPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ChangeAgentOKBodyNodeExporter) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("changeAgentOk"+"."+"node_exporter"+"."+"log_level", "body", *o.LogLevel); err != nil { - return err - } - - return nil -} - -func (o *ChangeAgentOKBodyNodeExporter) 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("changeAgentOk" + "." + "node_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("changeAgentOk" + "." + "node_exporter" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this change agent OK body node exporter based on the context it is used -func (o *ChangeAgentOKBodyNodeExporter) 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 *ChangeAgentOKBodyNodeExporter) 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 { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("changeAgentOk" + "." + "node_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("changeAgentOk" + "." + "node_exporter" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeAgentOKBodyNodeExporter) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeAgentOKBodyNodeExporter) UnmarshalBinary(b []byte) error { - var res ChangeAgentOKBodyNodeExporter - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeAgentOKBodyNodeExporterMetricsResolutions MetricsResolutions represents Prometheus exporters metrics resolutions. -swagger:model ChangeAgentOKBodyNodeExporterMetricsResolutions -*/ -type ChangeAgentOKBodyNodeExporterMetricsResolutions struct { - // High resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Hr string `json:"hr,omitempty"` - - // Medium resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Mr string `json:"mr,omitempty"` - - // Low resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Lr string `json:"lr,omitempty"` -} - -// Validate validates this change agent OK body node exporter metrics resolutions -func (o *ChangeAgentOKBodyNodeExporterMetricsResolutions) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this change agent OK body node exporter metrics resolutions based on context it is used -func (o *ChangeAgentOKBodyNodeExporterMetricsResolutions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeAgentOKBodyNodeExporterMetricsResolutions) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeAgentOKBodyNodeExporterMetricsResolutions) UnmarshalBinary(b []byte) error { - var res ChangeAgentOKBodyNodeExporterMetricsResolutions - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeAgentOKBodyNomadAgent change agent OK body nomad agent -swagger:model ChangeAgentOKBodyNomadAgent -*/ -type ChangeAgentOKBodyNomadAgent struct { - // Unique randomly generated instance identifier. - AgentID string `json:"agent_id,omitempty"` - - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `json:"disabled,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"` - - // Path to exec process. - ProcessExecPath string `json:"process_exec_path,omitempty"` - - // Listen port for scraping metrics. - ListenPort int64 `json:"listen_port,omitempty"` -} - -// Validate validates this change agent OK body nomad agent -func (o *ChangeAgentOKBodyNomadAgent) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateStatus(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var changeAgentOkBodyNomadAgentTypeStatusPropEnum []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 { - changeAgentOkBodyNomadAgentTypeStatusPropEnum = append(changeAgentOkBodyNomadAgentTypeStatusPropEnum, v) - } -} - -const ( - - // ChangeAgentOKBodyNomadAgentStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - ChangeAgentOKBodyNomadAgentStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // ChangeAgentOKBodyNomadAgentStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - ChangeAgentOKBodyNomadAgentStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // ChangeAgentOKBodyNomadAgentStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - ChangeAgentOKBodyNomadAgentStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - - // ChangeAgentOKBodyNomadAgentStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - ChangeAgentOKBodyNomadAgentStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - - // ChangeAgentOKBodyNomadAgentStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - ChangeAgentOKBodyNomadAgentStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - - // ChangeAgentOKBodyNomadAgentStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - ChangeAgentOKBodyNomadAgentStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" - - // ChangeAgentOKBodyNomadAgentStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - ChangeAgentOKBodyNomadAgentStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" - - // ChangeAgentOKBodyNomadAgentStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - ChangeAgentOKBodyNomadAgentStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" -) - -// prop value enum -func (o *ChangeAgentOKBodyNomadAgent) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, changeAgentOkBodyNomadAgentTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ChangeAgentOKBodyNomadAgent) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required - return nil - } - - // value enum - if err := o.validateStatusEnum("changeAgentOk"+"."+"nomad_agent"+"."+"status", "body", *o.Status); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this change agent OK body nomad agent based on context it is used -func (o *ChangeAgentOKBodyNomadAgent) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeAgentOKBodyNomadAgent) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeAgentOKBodyNomadAgent) UnmarshalBinary(b []byte) error { - var res ChangeAgentOKBodyNomadAgent - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeAgentOKBodyPostgresExporter PostgresExporter runs on Generic or Container Node and exposes PostgreSQL Service metrics. -swagger:model ChangeAgentOKBodyPostgresExporter -*/ -type ChangeAgentOKBodyPostgresExporter struct { - // Unique randomly generated instance identifier. - AgentID string `json:"agent_id,omitempty"` - - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `json:"disabled,omitempty"` - - // Service identifier. - ServiceID string `json:"service_id,omitempty"` - - // PostgreSQL username for scraping metrics. - Username string `json:"username,omitempty"` - - // Use TLS for database connections. - TLS bool `json:"tls,omitempty"` - - // Skip TLS certificate and hostname validation. Uses sslmode=required instead of verify-full. - TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // True if exporter uses push metrics mode. - PushMetricsEnabled bool `json:"push_metrics_enabled,omitempty"` - - // 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"` - - // Optionally expose the exporter process on all public interfaces - ExposeExporter bool `json:"expose_exporter,omitempty"` - - // Maximum number of connections that exporter can open to the database instance. - MaxExporterConnections int32 `json:"max_exporter_connections,omitempty"` - - // metrics resolutions - MetricsResolutions *ChangeAgentOKBodyPostgresExporterMetricsResolutions `json:"metrics_resolutions,omitempty"` -} - -// Validate validates this change agent OK body postgres exporter -func (o *ChangeAgentOKBodyPostgresExporter) 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 changeAgentOkBodyPostgresExporterTypeStatusPropEnum []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 { - changeAgentOkBodyPostgresExporterTypeStatusPropEnum = append(changeAgentOkBodyPostgresExporterTypeStatusPropEnum, v) - } -} - -const ( - - // ChangeAgentOKBodyPostgresExporterStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - ChangeAgentOKBodyPostgresExporterStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // ChangeAgentOKBodyPostgresExporterStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - ChangeAgentOKBodyPostgresExporterStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // ChangeAgentOKBodyPostgresExporterStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - ChangeAgentOKBodyPostgresExporterStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - - // ChangeAgentOKBodyPostgresExporterStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - ChangeAgentOKBodyPostgresExporterStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - - // ChangeAgentOKBodyPostgresExporterStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - ChangeAgentOKBodyPostgresExporterStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - - // ChangeAgentOKBodyPostgresExporterStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - ChangeAgentOKBodyPostgresExporterStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" - - // ChangeAgentOKBodyPostgresExporterStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - ChangeAgentOKBodyPostgresExporterStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" - - // ChangeAgentOKBodyPostgresExporterStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - ChangeAgentOKBodyPostgresExporterStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" -) - -// prop value enum -func (o *ChangeAgentOKBodyPostgresExporter) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, changeAgentOkBodyPostgresExporterTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ChangeAgentOKBodyPostgresExporter) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required - return nil - } - - // value enum - if err := o.validateStatusEnum("changeAgentOk"+"."+"postgres_exporter"+"."+"status", "body", *o.Status); err != nil { - return err - } - - return nil -} - -var changeAgentOkBodyPostgresExporterTypeLogLevelPropEnum []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 { - changeAgentOkBodyPostgresExporterTypeLogLevelPropEnum = append(changeAgentOkBodyPostgresExporterTypeLogLevelPropEnum, v) - } -} - -const ( - - // ChangeAgentOKBodyPostgresExporterLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - ChangeAgentOKBodyPostgresExporterLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // ChangeAgentOKBodyPostgresExporterLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - ChangeAgentOKBodyPostgresExporterLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // ChangeAgentOKBodyPostgresExporterLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - ChangeAgentOKBodyPostgresExporterLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // ChangeAgentOKBodyPostgresExporterLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - ChangeAgentOKBodyPostgresExporterLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // ChangeAgentOKBodyPostgresExporterLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - ChangeAgentOKBodyPostgresExporterLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // ChangeAgentOKBodyPostgresExporterLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - ChangeAgentOKBodyPostgresExporterLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -func (o *ChangeAgentOKBodyPostgresExporter) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, changeAgentOkBodyPostgresExporterTypeLogLevelPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ChangeAgentOKBodyPostgresExporter) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("changeAgentOk"+"."+"postgres_exporter"+"."+"log_level", "body", *o.LogLevel); err != nil { - return err - } - - return nil -} - -func (o *ChangeAgentOKBodyPostgresExporter) 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("changeAgentOk" + "." + "postgres_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("changeAgentOk" + "." + "postgres_exporter" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this change agent OK body postgres exporter based on the context it is used -func (o *ChangeAgentOKBodyPostgresExporter) 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 *ChangeAgentOKBodyPostgresExporter) 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 { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("changeAgentOk" + "." + "postgres_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("changeAgentOk" + "." + "postgres_exporter" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeAgentOKBodyPostgresExporter) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeAgentOKBodyPostgresExporter) UnmarshalBinary(b []byte) error { - var res ChangeAgentOKBodyPostgresExporter - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeAgentOKBodyPostgresExporterMetricsResolutions MetricsResolutions represents Prometheus exporters metrics resolutions. -swagger:model ChangeAgentOKBodyPostgresExporterMetricsResolutions -*/ -type ChangeAgentOKBodyPostgresExporterMetricsResolutions struct { - // High resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Hr string `json:"hr,omitempty"` - - // Medium resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Mr string `json:"mr,omitempty"` - - // Low resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Lr string `json:"lr,omitempty"` -} - -// Validate validates this change agent OK body postgres exporter metrics resolutions -func (o *ChangeAgentOKBodyPostgresExporterMetricsResolutions) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this change agent OK body postgres exporter metrics resolutions based on context it is used -func (o *ChangeAgentOKBodyPostgresExporterMetricsResolutions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeAgentOKBodyPostgresExporterMetricsResolutions) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeAgentOKBodyPostgresExporterMetricsResolutions) UnmarshalBinary(b []byte) error { - var res ChangeAgentOKBodyPostgresExporterMetricsResolutions - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeAgentOKBodyProxysqlExporter ProxySQLExporter runs on Generic or Container Node and exposes ProxySQL Service metrics. -swagger:model ChangeAgentOKBodyProxysqlExporter -*/ -type ChangeAgentOKBodyProxysqlExporter struct { - // Unique randomly generated instance identifier. - AgentID string `json:"agent_id,omitempty"` - - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `json:"disabled,omitempty"` - - // Service identifier. - ServiceID string `json:"service_id,omitempty"` - - // ProxySQL username for scraping metrics. - Username string `json:"username,omitempty"` - - // Use TLS for database connections. - TLS bool `json:"tls,omitempty"` - - // Skip TLS certificate and hostname validation. - TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // True if exporter uses push metrics mode. - PushMetricsEnabled bool `json:"push_metrics_enabled,omitempty"` - - // 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"` - - // Optionally expose the exporter process on all public interfaces - ExposeExporter bool `json:"expose_exporter,omitempty"` - - // metrics resolutions - MetricsResolutions *ChangeAgentOKBodyProxysqlExporterMetricsResolutions `json:"metrics_resolutions,omitempty"` -} - -// Validate validates this change agent OK body proxysql exporter -func (o *ChangeAgentOKBodyProxysqlExporter) 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 changeAgentOkBodyProxysqlExporterTypeStatusPropEnum []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 { - changeAgentOkBodyProxysqlExporterTypeStatusPropEnum = append(changeAgentOkBodyProxysqlExporterTypeStatusPropEnum, v) - } -} - -const ( - - // ChangeAgentOKBodyProxysqlExporterStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - ChangeAgentOKBodyProxysqlExporterStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // ChangeAgentOKBodyProxysqlExporterStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - ChangeAgentOKBodyProxysqlExporterStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // ChangeAgentOKBodyProxysqlExporterStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - ChangeAgentOKBodyProxysqlExporterStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - - // ChangeAgentOKBodyProxysqlExporterStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - ChangeAgentOKBodyProxysqlExporterStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - - // ChangeAgentOKBodyProxysqlExporterStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - ChangeAgentOKBodyProxysqlExporterStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - - // ChangeAgentOKBodyProxysqlExporterStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - ChangeAgentOKBodyProxysqlExporterStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" - - // ChangeAgentOKBodyProxysqlExporterStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - ChangeAgentOKBodyProxysqlExporterStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" - - // ChangeAgentOKBodyProxysqlExporterStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - ChangeAgentOKBodyProxysqlExporterStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" -) - -// prop value enum -func (o *ChangeAgentOKBodyProxysqlExporter) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, changeAgentOkBodyProxysqlExporterTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ChangeAgentOKBodyProxysqlExporter) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required - return nil - } - - // value enum - if err := o.validateStatusEnum("changeAgentOk"+"."+"proxysql_exporter"+"."+"status", "body", *o.Status); err != nil { - return err - } - - return nil -} - -var changeAgentOkBodyProxysqlExporterTypeLogLevelPropEnum []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 { - changeAgentOkBodyProxysqlExporterTypeLogLevelPropEnum = append(changeAgentOkBodyProxysqlExporterTypeLogLevelPropEnum, v) - } -} - -const ( - - // ChangeAgentOKBodyProxysqlExporterLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - ChangeAgentOKBodyProxysqlExporterLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // ChangeAgentOKBodyProxysqlExporterLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - ChangeAgentOKBodyProxysqlExporterLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // ChangeAgentOKBodyProxysqlExporterLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - ChangeAgentOKBodyProxysqlExporterLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // ChangeAgentOKBodyProxysqlExporterLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - ChangeAgentOKBodyProxysqlExporterLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // ChangeAgentOKBodyProxysqlExporterLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - ChangeAgentOKBodyProxysqlExporterLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // ChangeAgentOKBodyProxysqlExporterLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - ChangeAgentOKBodyProxysqlExporterLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -func (o *ChangeAgentOKBodyProxysqlExporter) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, changeAgentOkBodyProxysqlExporterTypeLogLevelPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ChangeAgentOKBodyProxysqlExporter) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("changeAgentOk"+"."+"proxysql_exporter"+"."+"log_level", "body", *o.LogLevel); err != nil { - return err - } - - return nil -} - -func (o *ChangeAgentOKBodyProxysqlExporter) 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("changeAgentOk" + "." + "proxysql_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("changeAgentOk" + "." + "proxysql_exporter" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this change agent OK body proxysql exporter based on the context it is used -func (o *ChangeAgentOKBodyProxysqlExporter) 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 *ChangeAgentOKBodyProxysqlExporter) 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 { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("changeAgentOk" + "." + "proxysql_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("changeAgentOk" + "." + "proxysql_exporter" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeAgentOKBodyProxysqlExporter) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeAgentOKBodyProxysqlExporter) UnmarshalBinary(b []byte) error { - var res ChangeAgentOKBodyProxysqlExporter - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeAgentOKBodyProxysqlExporterMetricsResolutions MetricsResolutions represents Prometheus exporters metrics resolutions. -swagger:model ChangeAgentOKBodyProxysqlExporterMetricsResolutions -*/ -type ChangeAgentOKBodyProxysqlExporterMetricsResolutions struct { - // High resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Hr string `json:"hr,omitempty"` - - // Medium resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Mr string `json:"mr,omitempty"` - - // Low resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Lr string `json:"lr,omitempty"` -} - -// Validate validates this change agent OK body proxysql exporter metrics resolutions -func (o *ChangeAgentOKBodyProxysqlExporterMetricsResolutions) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this change agent OK body proxysql exporter metrics resolutions based on context it is used -func (o *ChangeAgentOKBodyProxysqlExporterMetricsResolutions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeAgentOKBodyProxysqlExporterMetricsResolutions) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeAgentOKBodyProxysqlExporterMetricsResolutions) UnmarshalBinary(b []byte) error { - var res ChangeAgentOKBodyProxysqlExporterMetricsResolutions - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeAgentOKBodyQANMongodbMongologAgent QANMongoDBMongologAgent runs within pmm-agent and sends MongoDB Query Analytics data to the PMM Server. -swagger:model ChangeAgentOKBodyQANMongodbMongologAgent -*/ -type ChangeAgentOKBodyQANMongodbMongologAgent struct { - // Unique randomly generated instance identifier. - AgentID string `json:"agent_id,omitempty"` - - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `json:"disabled,omitempty"` - - // Service identifier. - ServiceID string `json:"service_id,omitempty"` - - // MongoDB username for getting profiler data. - Username string `json:"username,omitempty"` - - // Use TLS for database connections. - TLS bool `json:"tls,omitempty"` - - // Skip TLS certificate and hostname validation. - TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - - // Limit query length in QAN (default: server-defined; -1: no limit). - MaxQueryLength int32 `json:"max_query_length,omitempty"` - - // 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"` - - // 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 change agent OK body QAN mongodb mongolog agent -func (o *ChangeAgentOKBodyQANMongodbMongologAgent) 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 changeAgentOkBodyQanMongodbMongologAgentTypeStatusPropEnum []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 { - changeAgentOkBodyQanMongodbMongologAgentTypeStatusPropEnum = append(changeAgentOkBodyQanMongodbMongologAgentTypeStatusPropEnum, v) - } -} - -const ( - - // ChangeAgentOKBodyQANMongodbMongologAgentStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - ChangeAgentOKBodyQANMongodbMongologAgentStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // ChangeAgentOKBodyQANMongodbMongologAgentStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - ChangeAgentOKBodyQANMongodbMongologAgentStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // ChangeAgentOKBodyQANMongodbMongologAgentStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - ChangeAgentOKBodyQANMongodbMongologAgentStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - - // ChangeAgentOKBodyQANMongodbMongologAgentStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - ChangeAgentOKBodyQANMongodbMongologAgentStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - - // ChangeAgentOKBodyQANMongodbMongologAgentStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - ChangeAgentOKBodyQANMongodbMongologAgentStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - - // ChangeAgentOKBodyQANMongodbMongologAgentStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - ChangeAgentOKBodyQANMongodbMongologAgentStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" - - // ChangeAgentOKBodyQANMongodbMongologAgentStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - ChangeAgentOKBodyQANMongodbMongologAgentStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" - - // ChangeAgentOKBodyQANMongodbMongologAgentStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - ChangeAgentOKBodyQANMongodbMongologAgentStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" -) - -// prop value enum -func (o *ChangeAgentOKBodyQANMongodbMongologAgent) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, changeAgentOkBodyQanMongodbMongologAgentTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ChangeAgentOKBodyQANMongodbMongologAgent) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required - return nil - } - - // value enum - if err := o.validateStatusEnum("changeAgentOk"+"."+"qan_mongodb_mongolog_agent"+"."+"status", "body", *o.Status); err != nil { - return err - } - - return nil -} - -var changeAgentOkBodyQanMongodbMongologAgentTypeLogLevelPropEnum []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 { - changeAgentOkBodyQanMongodbMongologAgentTypeLogLevelPropEnum = append(changeAgentOkBodyQanMongodbMongologAgentTypeLogLevelPropEnum, v) - } -} - -const ( - - // ChangeAgentOKBodyQANMongodbMongologAgentLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - ChangeAgentOKBodyQANMongodbMongologAgentLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // ChangeAgentOKBodyQANMongodbMongologAgentLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - ChangeAgentOKBodyQANMongodbMongologAgentLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // ChangeAgentOKBodyQANMongodbMongologAgentLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - ChangeAgentOKBodyQANMongodbMongologAgentLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // ChangeAgentOKBodyQANMongodbMongologAgentLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - ChangeAgentOKBodyQANMongodbMongologAgentLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // ChangeAgentOKBodyQANMongodbMongologAgentLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - ChangeAgentOKBodyQANMongodbMongologAgentLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // ChangeAgentOKBodyQANMongodbMongologAgentLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - ChangeAgentOKBodyQANMongodbMongologAgentLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -func (o *ChangeAgentOKBodyQANMongodbMongologAgent) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, changeAgentOkBodyQanMongodbMongologAgentTypeLogLevelPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ChangeAgentOKBodyQANMongodbMongologAgent) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("changeAgentOk"+"."+"qan_mongodb_mongolog_agent"+"."+"log_level", "body", *o.LogLevel); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this change agent OK body QAN mongodb mongolog agent based on context it is used -func (o *ChangeAgentOKBodyQANMongodbMongologAgent) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeAgentOKBodyQANMongodbMongologAgent) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeAgentOKBodyQANMongodbMongologAgent) UnmarshalBinary(b []byte) error { - var res ChangeAgentOKBodyQANMongodbMongologAgent - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeAgentOKBodyQANMongodbProfilerAgent QANMongoDBProfilerAgent runs within pmm-agent and sends MongoDB Query Analytics data to the PMM Server. -swagger:model ChangeAgentOKBodyQANMongodbProfilerAgent -*/ -type ChangeAgentOKBodyQANMongodbProfilerAgent struct { - // Unique randomly generated instance identifier. - AgentID string `json:"agent_id,omitempty"` - - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `json:"disabled,omitempty"` - - // Service identifier. - ServiceID string `json:"service_id,omitempty"` - - // MongoDB username for getting profiler data. - Username string `json:"username,omitempty"` - - // Use TLS for database connections. - TLS bool `json:"tls,omitempty"` - - // Skip TLS certificate and hostname validation. - TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - - // Limit query length in QAN (default: server-defined; -1: no limit). - MaxQueryLength int32 `json:"max_query_length,omitempty"` - - // 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"` - - // 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 change agent OK body QAN mongodb profiler agent -func (o *ChangeAgentOKBodyQANMongodbProfilerAgent) 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 changeAgentOkBodyQanMongodbProfilerAgentTypeStatusPropEnum []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 { - changeAgentOkBodyQanMongodbProfilerAgentTypeStatusPropEnum = append(changeAgentOkBodyQanMongodbProfilerAgentTypeStatusPropEnum, v) - } -} - -const ( - - // ChangeAgentOKBodyQANMongodbProfilerAgentStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - ChangeAgentOKBodyQANMongodbProfilerAgentStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // ChangeAgentOKBodyQANMongodbProfilerAgentStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - ChangeAgentOKBodyQANMongodbProfilerAgentStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // ChangeAgentOKBodyQANMongodbProfilerAgentStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - ChangeAgentOKBodyQANMongodbProfilerAgentStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - - // ChangeAgentOKBodyQANMongodbProfilerAgentStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - ChangeAgentOKBodyQANMongodbProfilerAgentStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - - // ChangeAgentOKBodyQANMongodbProfilerAgentStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - ChangeAgentOKBodyQANMongodbProfilerAgentStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - - // ChangeAgentOKBodyQANMongodbProfilerAgentStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - ChangeAgentOKBodyQANMongodbProfilerAgentStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" - - // ChangeAgentOKBodyQANMongodbProfilerAgentStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - ChangeAgentOKBodyQANMongodbProfilerAgentStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" - - // ChangeAgentOKBodyQANMongodbProfilerAgentStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - ChangeAgentOKBodyQANMongodbProfilerAgentStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" -) - -// prop value enum -func (o *ChangeAgentOKBodyQANMongodbProfilerAgent) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, changeAgentOkBodyQanMongodbProfilerAgentTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ChangeAgentOKBodyQANMongodbProfilerAgent) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required - return nil - } - - // value enum - if err := o.validateStatusEnum("changeAgentOk"+"."+"qan_mongodb_profiler_agent"+"."+"status", "body", *o.Status); err != nil { - return err - } - - return nil -} - -var changeAgentOkBodyQanMongodbProfilerAgentTypeLogLevelPropEnum []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 { - changeAgentOkBodyQanMongodbProfilerAgentTypeLogLevelPropEnum = append(changeAgentOkBodyQanMongodbProfilerAgentTypeLogLevelPropEnum, v) - } -} - -const ( - - // ChangeAgentOKBodyQANMongodbProfilerAgentLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - ChangeAgentOKBodyQANMongodbProfilerAgentLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // ChangeAgentOKBodyQANMongodbProfilerAgentLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - ChangeAgentOKBodyQANMongodbProfilerAgentLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // ChangeAgentOKBodyQANMongodbProfilerAgentLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - ChangeAgentOKBodyQANMongodbProfilerAgentLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // ChangeAgentOKBodyQANMongodbProfilerAgentLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - ChangeAgentOKBodyQANMongodbProfilerAgentLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // ChangeAgentOKBodyQANMongodbProfilerAgentLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - ChangeAgentOKBodyQANMongodbProfilerAgentLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // ChangeAgentOKBodyQANMongodbProfilerAgentLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - ChangeAgentOKBodyQANMongodbProfilerAgentLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -func (o *ChangeAgentOKBodyQANMongodbProfilerAgent) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, changeAgentOkBodyQanMongodbProfilerAgentTypeLogLevelPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ChangeAgentOKBodyQANMongodbProfilerAgent) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("changeAgentOk"+"."+"qan_mongodb_profiler_agent"+"."+"log_level", "body", *o.LogLevel); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this change agent OK body QAN mongodb profiler agent based on context it is used -func (o *ChangeAgentOKBodyQANMongodbProfilerAgent) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeAgentOKBodyQANMongodbProfilerAgent) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeAgentOKBodyQANMongodbProfilerAgent) UnmarshalBinary(b []byte) error { - var res ChangeAgentOKBodyQANMongodbProfilerAgent - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeAgentOKBodyQANMysqlPerfschemaAgent QANMySQLPerfSchemaAgent runs within pmm-agent and sends MySQL Query Analytics data to the PMM Server. -swagger:model ChangeAgentOKBodyQANMysqlPerfschemaAgent -*/ -type ChangeAgentOKBodyQANMysqlPerfschemaAgent struct { - // Unique randomly generated instance identifier. - AgentID string `json:"agent_id,omitempty"` - - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `json:"disabled,omitempty"` - - // Service identifier. - ServiceID string `json:"service_id,omitempty"` - - // MySQL username for getting performance data. - Username string `json:"username,omitempty"` - - // Use TLS for database connections. - TLS bool `json:"tls,omitempty"` - - // Skip TLS certificate and hostname validation. - TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - - // Certificate Authority certificate chain. - TLSCa string `json:"tls_ca,omitempty"` - - // Client certificate. - TLSCert string `json:"tls_cert,omitempty"` - - // Password for decrypting tls_cert. - TLSKey string `json:"tls_key,omitempty"` - - // Disable parsing comments from queries and showing them in QAN. - DisableCommentsParsing bool `json:"disable_comments_parsing,omitempty"` - - // Limit query length in QAN (default: server-defined; -1: no limit). - MaxQueryLength int32 `json:"max_query_length,omitempty"` - - // True if query examples are disabled. - QueryExamplesDisabled bool `json:"query_examples_disabled,omitempty"` - - // 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"` - - // 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 change agent OK body QAN mysql perfschema agent -func (o *ChangeAgentOKBodyQANMysqlPerfschemaAgent) 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 changeAgentOkBodyQanMysqlPerfschemaAgentTypeStatusPropEnum []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 { - changeAgentOkBodyQanMysqlPerfschemaAgentTypeStatusPropEnum = append(changeAgentOkBodyQanMysqlPerfschemaAgentTypeStatusPropEnum, v) - } -} - -const ( - - // ChangeAgentOKBodyQANMysqlPerfschemaAgentStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - ChangeAgentOKBodyQANMysqlPerfschemaAgentStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // ChangeAgentOKBodyQANMysqlPerfschemaAgentStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - ChangeAgentOKBodyQANMysqlPerfschemaAgentStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // ChangeAgentOKBodyQANMysqlPerfschemaAgentStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - ChangeAgentOKBodyQANMysqlPerfschemaAgentStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - - // ChangeAgentOKBodyQANMysqlPerfschemaAgentStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - ChangeAgentOKBodyQANMysqlPerfschemaAgentStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - - // ChangeAgentOKBodyQANMysqlPerfschemaAgentStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - ChangeAgentOKBodyQANMysqlPerfschemaAgentStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - - // ChangeAgentOKBodyQANMysqlPerfschemaAgentStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - ChangeAgentOKBodyQANMysqlPerfschemaAgentStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" - - // ChangeAgentOKBodyQANMysqlPerfschemaAgentStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - ChangeAgentOKBodyQANMysqlPerfschemaAgentStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" - - // ChangeAgentOKBodyQANMysqlPerfschemaAgentStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - ChangeAgentOKBodyQANMysqlPerfschemaAgentStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" -) - -// prop value enum -func (o *ChangeAgentOKBodyQANMysqlPerfschemaAgent) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, changeAgentOkBodyQanMysqlPerfschemaAgentTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ChangeAgentOKBodyQANMysqlPerfschemaAgent) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required - return nil - } - - // value enum - if err := o.validateStatusEnum("changeAgentOk"+"."+"qan_mysql_perfschema_agent"+"."+"status", "body", *o.Status); err != nil { - return err - } - - return nil -} - -var changeAgentOkBodyQanMysqlPerfschemaAgentTypeLogLevelPropEnum []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 { - changeAgentOkBodyQanMysqlPerfschemaAgentTypeLogLevelPropEnum = append(changeAgentOkBodyQanMysqlPerfschemaAgentTypeLogLevelPropEnum, v) - } -} - -const ( - - // ChangeAgentOKBodyQANMysqlPerfschemaAgentLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - ChangeAgentOKBodyQANMysqlPerfschemaAgentLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // ChangeAgentOKBodyQANMysqlPerfschemaAgentLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - ChangeAgentOKBodyQANMysqlPerfschemaAgentLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // ChangeAgentOKBodyQANMysqlPerfschemaAgentLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - ChangeAgentOKBodyQANMysqlPerfschemaAgentLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // ChangeAgentOKBodyQANMysqlPerfschemaAgentLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - ChangeAgentOKBodyQANMysqlPerfschemaAgentLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // ChangeAgentOKBodyQANMysqlPerfschemaAgentLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - ChangeAgentOKBodyQANMysqlPerfschemaAgentLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // ChangeAgentOKBodyQANMysqlPerfschemaAgentLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - ChangeAgentOKBodyQANMysqlPerfschemaAgentLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -func (o *ChangeAgentOKBodyQANMysqlPerfschemaAgent) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, changeAgentOkBodyQanMysqlPerfschemaAgentTypeLogLevelPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ChangeAgentOKBodyQANMysqlPerfschemaAgent) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("changeAgentOk"+"."+"qan_mysql_perfschema_agent"+"."+"log_level", "body", *o.LogLevel); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this change agent OK body QAN mysql perfschema agent based on context it is used -func (o *ChangeAgentOKBodyQANMysqlPerfschemaAgent) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeAgentOKBodyQANMysqlPerfschemaAgent) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeAgentOKBodyQANMysqlPerfschemaAgent) UnmarshalBinary(b []byte) error { - var res ChangeAgentOKBodyQANMysqlPerfschemaAgent - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeAgentOKBodyQANMysqlSlowlogAgent QANMySQLSlowlogAgent runs within pmm-agent and sends MySQL Query Analytics data to the PMM Server. -swagger:model ChangeAgentOKBodyQANMysqlSlowlogAgent -*/ -type ChangeAgentOKBodyQANMysqlSlowlogAgent struct { - // Unique randomly generated instance identifier. - AgentID string `json:"agent_id,omitempty"` - - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `json:"disabled,omitempty"` - - // Service identifier. - ServiceID string `json:"service_id,omitempty"` - - // MySQL username for getting performance data. - Username string `json:"username,omitempty"` - - // Use TLS for database connections. - TLS bool `json:"tls,omitempty"` - - // Skip TLS certificate and hostname validation. - TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - - // Certificate Authority certificate chain. - TLSCa string `json:"tls_ca,omitempty"` - - // Client certificate. - TLSCert string `json:"tls_cert,omitempty"` - - // Password for decrypting tls_cert. - TLSKey string `json:"tls_key,omitempty"` - - // Disable parsing comments from queries and showing them in QAN. - DisableCommentsParsing bool `json:"disable_comments_parsing,omitempty"` - - // Limit query length in QAN (default: server-defined; -1: no limit) - MaxQueryLength int32 `json:"max_query_length,omitempty"` - - // True if query examples are disabled. - QueryExamplesDisabled bool `json:"query_examples_disabled,omitempty"` - - // Slowlog file is rotated at this size if > 0. - MaxSlowlogFileSize string `json:"max_slowlog_file_size,omitempty"` - - // 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"` - - // 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 change agent OK body QAN mysql slowlog agent -func (o *ChangeAgentOKBodyQANMysqlSlowlogAgent) 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 changeAgentOkBodyQanMysqlSlowlogAgentTypeStatusPropEnum []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 { - changeAgentOkBodyQanMysqlSlowlogAgentTypeStatusPropEnum = append(changeAgentOkBodyQanMysqlSlowlogAgentTypeStatusPropEnum, v) - } -} - -const ( - - // ChangeAgentOKBodyQANMysqlSlowlogAgentStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - ChangeAgentOKBodyQANMysqlSlowlogAgentStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // ChangeAgentOKBodyQANMysqlSlowlogAgentStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - ChangeAgentOKBodyQANMysqlSlowlogAgentStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // ChangeAgentOKBodyQANMysqlSlowlogAgentStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - ChangeAgentOKBodyQANMysqlSlowlogAgentStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - - // ChangeAgentOKBodyQANMysqlSlowlogAgentStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - ChangeAgentOKBodyQANMysqlSlowlogAgentStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - - // ChangeAgentOKBodyQANMysqlSlowlogAgentStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - ChangeAgentOKBodyQANMysqlSlowlogAgentStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - - // ChangeAgentOKBodyQANMysqlSlowlogAgentStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - ChangeAgentOKBodyQANMysqlSlowlogAgentStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" - - // ChangeAgentOKBodyQANMysqlSlowlogAgentStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - ChangeAgentOKBodyQANMysqlSlowlogAgentStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" - - // ChangeAgentOKBodyQANMysqlSlowlogAgentStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - ChangeAgentOKBodyQANMysqlSlowlogAgentStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" -) - -// prop value enum -func (o *ChangeAgentOKBodyQANMysqlSlowlogAgent) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, changeAgentOkBodyQanMysqlSlowlogAgentTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ChangeAgentOKBodyQANMysqlSlowlogAgent) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required - return nil - } - - // value enum - if err := o.validateStatusEnum("changeAgentOk"+"."+"qan_mysql_slowlog_agent"+"."+"status", "body", *o.Status); err != nil { - return err - } - - return nil -} - -var changeAgentOkBodyQanMysqlSlowlogAgentTypeLogLevelPropEnum []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 { - changeAgentOkBodyQanMysqlSlowlogAgentTypeLogLevelPropEnum = append(changeAgentOkBodyQanMysqlSlowlogAgentTypeLogLevelPropEnum, v) - } -} - -const ( - - // ChangeAgentOKBodyQANMysqlSlowlogAgentLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - ChangeAgentOKBodyQANMysqlSlowlogAgentLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // ChangeAgentOKBodyQANMysqlSlowlogAgentLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - ChangeAgentOKBodyQANMysqlSlowlogAgentLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // ChangeAgentOKBodyQANMysqlSlowlogAgentLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - ChangeAgentOKBodyQANMysqlSlowlogAgentLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // ChangeAgentOKBodyQANMysqlSlowlogAgentLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - ChangeAgentOKBodyQANMysqlSlowlogAgentLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // ChangeAgentOKBodyQANMysqlSlowlogAgentLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - ChangeAgentOKBodyQANMysqlSlowlogAgentLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // ChangeAgentOKBodyQANMysqlSlowlogAgentLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - ChangeAgentOKBodyQANMysqlSlowlogAgentLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -func (o *ChangeAgentOKBodyQANMysqlSlowlogAgent) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, changeAgentOkBodyQanMysqlSlowlogAgentTypeLogLevelPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ChangeAgentOKBodyQANMysqlSlowlogAgent) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("changeAgentOk"+"."+"qan_mysql_slowlog_agent"+"."+"log_level", "body", *o.LogLevel); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this change agent OK body QAN mysql slowlog agent based on context it is used -func (o *ChangeAgentOKBodyQANMysqlSlowlogAgent) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeAgentOKBodyQANMysqlSlowlogAgent) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeAgentOKBodyQANMysqlSlowlogAgent) UnmarshalBinary(b []byte) error { - var res ChangeAgentOKBodyQANMysqlSlowlogAgent - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeAgentOKBodyQANPostgresqlPgstatementsAgent QANPostgreSQLPgStatementsAgent runs within pmm-agent and sends PostgreSQL Query Analytics data to the PMM Server. -swagger:model ChangeAgentOKBodyQANPostgresqlPgstatementsAgent -*/ -type ChangeAgentOKBodyQANPostgresqlPgstatementsAgent struct { - // Unique randomly generated instance identifier. - AgentID string `json:"agent_id,omitempty"` - - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `json:"disabled,omitempty"` - - // Service identifier. - ServiceID string `json:"service_id,omitempty"` - - // PostgreSQL username for getting pg stat statements data. - Username string `json:"username,omitempty"` - - // Disable parsing comments from queries and showing them in QAN. - DisableCommentsParsing bool `json:"disable_comments_parsing,omitempty"` - - // Limit query length in QAN (default: server-defined; -1: no limit). - MaxQueryLength int32 `json:"max_query_length,omitempty"` - - // Use TLS for database connections. - TLS bool `json:"tls,omitempty"` - - // Skip TLS certificate and hostname validation. - TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - - // 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"` - - // 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 change agent OK body QAN postgresql pgstatements agent -func (o *ChangeAgentOKBodyQANPostgresqlPgstatementsAgent) 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 changeAgentOkBodyQanPostgresqlPgstatementsAgentTypeStatusPropEnum []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 { - changeAgentOkBodyQanPostgresqlPgstatementsAgentTypeStatusPropEnum = append(changeAgentOkBodyQanPostgresqlPgstatementsAgentTypeStatusPropEnum, v) - } -} - -const ( - - // ChangeAgentOKBodyQANPostgresqlPgstatementsAgentStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - ChangeAgentOKBodyQANPostgresqlPgstatementsAgentStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // ChangeAgentOKBodyQANPostgresqlPgstatementsAgentStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - ChangeAgentOKBodyQANPostgresqlPgstatementsAgentStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // ChangeAgentOKBodyQANPostgresqlPgstatementsAgentStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - ChangeAgentOKBodyQANPostgresqlPgstatementsAgentStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - - // ChangeAgentOKBodyQANPostgresqlPgstatementsAgentStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - ChangeAgentOKBodyQANPostgresqlPgstatementsAgentStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - - // ChangeAgentOKBodyQANPostgresqlPgstatementsAgentStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - ChangeAgentOKBodyQANPostgresqlPgstatementsAgentStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - - // ChangeAgentOKBodyQANPostgresqlPgstatementsAgentStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - ChangeAgentOKBodyQANPostgresqlPgstatementsAgentStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" - - // ChangeAgentOKBodyQANPostgresqlPgstatementsAgentStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - ChangeAgentOKBodyQANPostgresqlPgstatementsAgentStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" - - // ChangeAgentOKBodyQANPostgresqlPgstatementsAgentStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - ChangeAgentOKBodyQANPostgresqlPgstatementsAgentStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" -) - -// prop value enum -func (o *ChangeAgentOKBodyQANPostgresqlPgstatementsAgent) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, changeAgentOkBodyQanPostgresqlPgstatementsAgentTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ChangeAgentOKBodyQANPostgresqlPgstatementsAgent) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required - return nil - } - - // value enum - if err := o.validateStatusEnum("changeAgentOk"+"."+"qan_postgresql_pgstatements_agent"+"."+"status", "body", *o.Status); err != nil { - return err - } - - return nil -} - -var changeAgentOkBodyQanPostgresqlPgstatementsAgentTypeLogLevelPropEnum []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 { - changeAgentOkBodyQanPostgresqlPgstatementsAgentTypeLogLevelPropEnum = append(changeAgentOkBodyQanPostgresqlPgstatementsAgentTypeLogLevelPropEnum, v) - } -} - -const ( - - // ChangeAgentOKBodyQANPostgresqlPgstatementsAgentLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - ChangeAgentOKBodyQANPostgresqlPgstatementsAgentLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // ChangeAgentOKBodyQANPostgresqlPgstatementsAgentLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - ChangeAgentOKBodyQANPostgresqlPgstatementsAgentLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // ChangeAgentOKBodyQANPostgresqlPgstatementsAgentLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - ChangeAgentOKBodyQANPostgresqlPgstatementsAgentLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // ChangeAgentOKBodyQANPostgresqlPgstatementsAgentLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - ChangeAgentOKBodyQANPostgresqlPgstatementsAgentLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // ChangeAgentOKBodyQANPostgresqlPgstatementsAgentLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - ChangeAgentOKBodyQANPostgresqlPgstatementsAgentLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // ChangeAgentOKBodyQANPostgresqlPgstatementsAgentLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - ChangeAgentOKBodyQANPostgresqlPgstatementsAgentLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -func (o *ChangeAgentOKBodyQANPostgresqlPgstatementsAgent) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, changeAgentOkBodyQanPostgresqlPgstatementsAgentTypeLogLevelPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ChangeAgentOKBodyQANPostgresqlPgstatementsAgent) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("changeAgentOk"+"."+"qan_postgresql_pgstatements_agent"+"."+"log_level", "body", *o.LogLevel); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this change agent OK body QAN postgresql pgstatements agent based on context it is used -func (o *ChangeAgentOKBodyQANPostgresqlPgstatementsAgent) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeAgentOKBodyQANPostgresqlPgstatementsAgent) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeAgentOKBodyQANPostgresqlPgstatementsAgent) UnmarshalBinary(b []byte) error { - var res ChangeAgentOKBodyQANPostgresqlPgstatementsAgent - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeAgentOKBodyQANPostgresqlPgstatmonitorAgent QANPostgreSQLPgStatMonitorAgent runs within pmm-agent and sends PostgreSQL Query Analytics data to the PMM Server. -swagger:model ChangeAgentOKBodyQANPostgresqlPgstatmonitorAgent -*/ -type ChangeAgentOKBodyQANPostgresqlPgstatmonitorAgent struct { - // Unique randomly generated instance identifier. - AgentID string `json:"agent_id,omitempty"` - - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `json:"disabled,omitempty"` - - // Service identifier. - ServiceID string `json:"service_id,omitempty"` - - // PostgreSQL username for getting pg stat monitor data. - Username string `json:"username,omitempty"` - - // Use TLS for database connections. - TLS bool `json:"tls,omitempty"` - - // Skip TLS certificate and hostname validation. - TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - - // Disable parsing comments from queries and showing them in QAN. - DisableCommentsParsing bool `json:"disable_comments_parsing,omitempty"` - - // Limit query length in QAN (default: server-defined; -1: no limit). - MaxQueryLength int32 `json:"max_query_length,omitempty"` - - // True if query examples are disabled. - QueryExamplesDisabled bool `json:"query_examples_disabled,omitempty"` - - // 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"` - - // 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 change agent OK body QAN postgresql pgstatmonitor agent -func (o *ChangeAgentOKBodyQANPostgresqlPgstatmonitorAgent) 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 changeAgentOkBodyQanPostgresqlPgstatmonitorAgentTypeStatusPropEnum []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 { - changeAgentOkBodyQanPostgresqlPgstatmonitorAgentTypeStatusPropEnum = append(changeAgentOkBodyQanPostgresqlPgstatmonitorAgentTypeStatusPropEnum, v) - } -} - -const ( - - // ChangeAgentOKBodyQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - ChangeAgentOKBodyQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // ChangeAgentOKBodyQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - ChangeAgentOKBodyQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // ChangeAgentOKBodyQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - ChangeAgentOKBodyQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - - // ChangeAgentOKBodyQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - ChangeAgentOKBodyQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - - // ChangeAgentOKBodyQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - ChangeAgentOKBodyQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - - // ChangeAgentOKBodyQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - ChangeAgentOKBodyQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" - - // ChangeAgentOKBodyQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - ChangeAgentOKBodyQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" - - // ChangeAgentOKBodyQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - ChangeAgentOKBodyQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" -) - -// prop value enum -func (o *ChangeAgentOKBodyQANPostgresqlPgstatmonitorAgent) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, changeAgentOkBodyQanPostgresqlPgstatmonitorAgentTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ChangeAgentOKBodyQANPostgresqlPgstatmonitorAgent) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required - return nil - } - - // value enum - if err := o.validateStatusEnum("changeAgentOk"+"."+"qan_postgresql_pgstatmonitor_agent"+"."+"status", "body", *o.Status); err != nil { - return err - } - - return nil -} - -var changeAgentOkBodyQanPostgresqlPgstatmonitorAgentTypeLogLevelPropEnum []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 { - changeAgentOkBodyQanPostgresqlPgstatmonitorAgentTypeLogLevelPropEnum = append(changeAgentOkBodyQanPostgresqlPgstatmonitorAgentTypeLogLevelPropEnum, v) - } -} - -const ( - - // ChangeAgentOKBodyQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - ChangeAgentOKBodyQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // ChangeAgentOKBodyQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - ChangeAgentOKBodyQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // ChangeAgentOKBodyQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - ChangeAgentOKBodyQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // ChangeAgentOKBodyQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - ChangeAgentOKBodyQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // ChangeAgentOKBodyQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - ChangeAgentOKBodyQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // ChangeAgentOKBodyQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - ChangeAgentOKBodyQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -func (o *ChangeAgentOKBodyQANPostgresqlPgstatmonitorAgent) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, changeAgentOkBodyQanPostgresqlPgstatmonitorAgentTypeLogLevelPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ChangeAgentOKBodyQANPostgresqlPgstatmonitorAgent) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("changeAgentOk"+"."+"qan_postgresql_pgstatmonitor_agent"+"."+"log_level", "body", *o.LogLevel); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this change agent OK body QAN postgresql pgstatmonitor agent based on context it is used -func (o *ChangeAgentOKBodyQANPostgresqlPgstatmonitorAgent) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeAgentOKBodyQANPostgresqlPgstatmonitorAgent) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeAgentOKBodyQANPostgresqlPgstatmonitorAgent) UnmarshalBinary(b []byte) error { - var res ChangeAgentOKBodyQANPostgresqlPgstatmonitorAgent - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeAgentOKBodyRDSExporter RDSExporter runs on Generic or Container Node and exposes RemoteRDS Node metrics. -swagger:model ChangeAgentOKBodyRDSExporter -*/ -type ChangeAgentOKBodyRDSExporter struct { - // Unique randomly generated instance identifier. - AgentID string `json:"agent_id,omitempty"` - - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `json:"disabled,omitempty"` - - // Node identifier. - NodeID string `json:"node_id,omitempty"` - - // AWS Access Key. - AWSAccessKey string `json:"aws_access_key,omitempty"` - - // 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"` - - // Basic metrics are disabled. - BasicMetricsDisabled bool `json:"basic_metrics_disabled,omitempty"` - - // Enhanced metrics are disabled. - EnhancedMetricsDisabled bool `json:"enhanced_metrics_disabled,omitempty"` - - // True if exporter uses push metrics mode. - PushMetricsEnabled bool `json:"push_metrics_enabled,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"` - - // metrics resolutions - MetricsResolutions *ChangeAgentOKBodyRDSExporterMetricsResolutions `json:"metrics_resolutions,omitempty"` -} - -// Validate validates this change agent OK body RDS exporter -func (o *ChangeAgentOKBodyRDSExporter) 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 changeAgentOkBodyRdsExporterTypeStatusPropEnum []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 { - changeAgentOkBodyRdsExporterTypeStatusPropEnum = append(changeAgentOkBodyRdsExporterTypeStatusPropEnum, v) - } -} - -const ( - - // ChangeAgentOKBodyRDSExporterStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - ChangeAgentOKBodyRDSExporterStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // ChangeAgentOKBodyRDSExporterStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - ChangeAgentOKBodyRDSExporterStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // ChangeAgentOKBodyRDSExporterStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - ChangeAgentOKBodyRDSExporterStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - - // ChangeAgentOKBodyRDSExporterStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - ChangeAgentOKBodyRDSExporterStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - - // ChangeAgentOKBodyRDSExporterStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - ChangeAgentOKBodyRDSExporterStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - - // ChangeAgentOKBodyRDSExporterStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - ChangeAgentOKBodyRDSExporterStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" - - // ChangeAgentOKBodyRDSExporterStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - ChangeAgentOKBodyRDSExporterStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" - - // ChangeAgentOKBodyRDSExporterStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - ChangeAgentOKBodyRDSExporterStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" -) - -// prop value enum -func (o *ChangeAgentOKBodyRDSExporter) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, changeAgentOkBodyRdsExporterTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ChangeAgentOKBodyRDSExporter) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required - return nil - } - - // value enum - if err := o.validateStatusEnum("changeAgentOk"+"."+"rds_exporter"+"."+"status", "body", *o.Status); err != nil { - return err - } - - return nil -} - -var changeAgentOkBodyRdsExporterTypeLogLevelPropEnum []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 { - changeAgentOkBodyRdsExporterTypeLogLevelPropEnum = append(changeAgentOkBodyRdsExporterTypeLogLevelPropEnum, v) - } -} - -const ( - - // ChangeAgentOKBodyRDSExporterLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - ChangeAgentOKBodyRDSExporterLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // ChangeAgentOKBodyRDSExporterLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - ChangeAgentOKBodyRDSExporterLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // ChangeAgentOKBodyRDSExporterLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - ChangeAgentOKBodyRDSExporterLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // ChangeAgentOKBodyRDSExporterLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - ChangeAgentOKBodyRDSExporterLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // ChangeAgentOKBodyRDSExporterLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - ChangeAgentOKBodyRDSExporterLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // ChangeAgentOKBodyRDSExporterLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - ChangeAgentOKBodyRDSExporterLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -func (o *ChangeAgentOKBodyRDSExporter) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, changeAgentOkBodyRdsExporterTypeLogLevelPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ChangeAgentOKBodyRDSExporter) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("changeAgentOk"+"."+"rds_exporter"+"."+"log_level", "body", *o.LogLevel); err != nil { - return err - } - - return nil -} - -func (o *ChangeAgentOKBodyRDSExporter) 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("changeAgentOk" + "." + "rds_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("changeAgentOk" + "." + "rds_exporter" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this change agent OK body RDS exporter based on the context it is used -func (o *ChangeAgentOKBodyRDSExporter) 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 *ChangeAgentOKBodyRDSExporter) 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 { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("changeAgentOk" + "." + "rds_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("changeAgentOk" + "." + "rds_exporter" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeAgentOKBodyRDSExporter) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeAgentOKBodyRDSExporter) UnmarshalBinary(b []byte) error { - var res ChangeAgentOKBodyRDSExporter - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeAgentOKBodyRDSExporterMetricsResolutions MetricsResolutions represents Prometheus exporters metrics resolutions. -swagger:model ChangeAgentOKBodyRDSExporterMetricsResolutions -*/ -type ChangeAgentOKBodyRDSExporterMetricsResolutions struct { - // High resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Hr string `json:"hr,omitempty"` - - // Medium resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Mr string `json:"mr,omitempty"` - - // Low resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Lr string `json:"lr,omitempty"` -} - -// Validate validates this change agent OK body RDS exporter metrics resolutions -func (o *ChangeAgentOKBodyRDSExporterMetricsResolutions) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this change agent OK body RDS exporter metrics resolutions based on context it is used -func (o *ChangeAgentOKBodyRDSExporterMetricsResolutions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeAgentOKBodyRDSExporterMetricsResolutions) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeAgentOKBodyRDSExporterMetricsResolutions) UnmarshalBinary(b []byte) error { - var res ChangeAgentOKBodyRDSExporterMetricsResolutions - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeAgentOKBodyValkeyExporter ValkeyExporter runs on Generic or Container Node and exposes Valkey Service metrics. -swagger:model ChangeAgentOKBodyValkeyExporter -*/ -type ChangeAgentOKBodyValkeyExporter struct { - // Unique randomly generated instance identifier. - AgentID string `json:"agent_id,omitempty"` - - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `json:"disabled,omitempty"` - - // Service identifier. - ServiceID string `json:"service_id,omitempty"` - - // Valkey username for scraping metrics. - Username string `json:"username,omitempty"` - - // Use TLS for database connections. - TLS bool `json:"tls,omitempty"` - - // Skip TLS certificate and hostname verification. - TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // True if exporter uses push metrics mode. - PushMetricsEnabled bool `json:"push_metrics_enabled,omitempty"` - - // 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"` - - // metrics resolutions - MetricsResolutions *ChangeAgentOKBodyValkeyExporterMetricsResolutions `json:"metrics_resolutions,omitempty"` -} - -// Validate validates this change agent OK body valkey exporter -func (o *ChangeAgentOKBodyValkeyExporter) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateStatus(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 changeAgentOkBodyValkeyExporterTypeStatusPropEnum []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 { - changeAgentOkBodyValkeyExporterTypeStatusPropEnum = append(changeAgentOkBodyValkeyExporterTypeStatusPropEnum, v) - } -} - -const ( - - // ChangeAgentOKBodyValkeyExporterStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - ChangeAgentOKBodyValkeyExporterStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // ChangeAgentOKBodyValkeyExporterStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - ChangeAgentOKBodyValkeyExporterStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // ChangeAgentOKBodyValkeyExporterStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - ChangeAgentOKBodyValkeyExporterStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - - // ChangeAgentOKBodyValkeyExporterStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - ChangeAgentOKBodyValkeyExporterStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - - // ChangeAgentOKBodyValkeyExporterStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - ChangeAgentOKBodyValkeyExporterStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - - // ChangeAgentOKBodyValkeyExporterStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - ChangeAgentOKBodyValkeyExporterStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" - - // ChangeAgentOKBodyValkeyExporterStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - ChangeAgentOKBodyValkeyExporterStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" - - // ChangeAgentOKBodyValkeyExporterStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - ChangeAgentOKBodyValkeyExporterStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" -) - -// prop value enum -func (o *ChangeAgentOKBodyValkeyExporter) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, changeAgentOkBodyValkeyExporterTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ChangeAgentOKBodyValkeyExporter) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required - return nil - } - - // value enum - if err := o.validateStatusEnum("changeAgentOk"+"."+"valkey_exporter"+"."+"status", "body", *o.Status); err != nil { - return err - } - - return nil -} - -func (o *ChangeAgentOKBodyValkeyExporter) 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("changeAgentOk" + "." + "valkey_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("changeAgentOk" + "." + "valkey_exporter" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this change agent OK body valkey exporter based on the context it is used -func (o *ChangeAgentOKBodyValkeyExporter) 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 *ChangeAgentOKBodyValkeyExporter) 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 { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("changeAgentOk" + "." + "valkey_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("changeAgentOk" + "." + "valkey_exporter" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeAgentOKBodyValkeyExporter) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeAgentOKBodyValkeyExporter) UnmarshalBinary(b []byte) error { - var res ChangeAgentOKBodyValkeyExporter - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeAgentOKBodyValkeyExporterMetricsResolutions MetricsResolutions represents Prometheus exporters metrics resolutions. -swagger:model ChangeAgentOKBodyValkeyExporterMetricsResolutions -*/ -type ChangeAgentOKBodyValkeyExporterMetricsResolutions struct { - // High resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Hr string `json:"hr,omitempty"` - - // Medium resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Mr string `json:"mr,omitempty"` - - // Low resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Lr string `json:"lr,omitempty"` -} - -// Validate validates this change agent OK body valkey exporter metrics resolutions -func (o *ChangeAgentOKBodyValkeyExporterMetricsResolutions) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this change agent OK body valkey exporter metrics resolutions based on context it is used -func (o *ChangeAgentOKBodyValkeyExporterMetricsResolutions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeAgentOKBodyValkeyExporterMetricsResolutions) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeAgentOKBodyValkeyExporterMetricsResolutions) UnmarshalBinary(b []byte) error { - var res ChangeAgentOKBodyValkeyExporterMetricsResolutions - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeAgentParamsBodyAzureDatabaseExporter change agent params body azure database exporter -swagger:model ChangeAgentParamsBodyAzureDatabaseExporter -*/ -type ChangeAgentParamsBodyAzureDatabaseExporter struct { - // Enable this Agent. Agents are enabled by default when they get added. - Enable *bool `json:"enable,omitempty"` - - // Enables push metrics with vmagent. - EnablePushMetrics *bool `json:"enable_push_metrics,omitempty"` - - // custom labels - CustomLabels *ChangeAgentParamsBodyAzureDatabaseExporterCustomLabels `json:"custom_labels,omitempty"` - - // metrics resolutions - MetricsResolutions *ChangeAgentParamsBodyAzureDatabaseExporterMetricsResolutions `json:"metrics_resolutions,omitempty"` -} - -// Validate validates this change agent params body azure database exporter -func (o *ChangeAgentParamsBodyAzureDatabaseExporter) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateCustomLabels(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 -} - -func (o *ChangeAgentParamsBodyAzureDatabaseExporter) validateCustomLabels(formats strfmt.Registry) error { - if swag.IsZero(o.CustomLabels) { // not required - return nil - } - - if o.CustomLabels != nil { - if err := o.CustomLabels.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "azure_database_exporter" + "." + "custom_labels") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "azure_database_exporter" + "." + "custom_labels") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentParamsBodyAzureDatabaseExporter) 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("body" + "." + "azure_database_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "azure_database_exporter" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this change agent params body azure database exporter based on the context it is used -func (o *ChangeAgentParamsBodyAzureDatabaseExporter) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateCustomLabels(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateMetricsResolutions(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ChangeAgentParamsBodyAzureDatabaseExporter) contextValidateCustomLabels(ctx context.Context, formats strfmt.Registry) error { - if o.CustomLabels != nil { - - if swag.IsZero(o.CustomLabels) { // not required - return nil - } - - if err := o.CustomLabels.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "azure_database_exporter" + "." + "custom_labels") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "azure_database_exporter" + "." + "custom_labels") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentParamsBodyAzureDatabaseExporter) 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 { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "azure_database_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "azure_database_exporter" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeAgentParamsBodyAzureDatabaseExporter) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeAgentParamsBodyAzureDatabaseExporter) UnmarshalBinary(b []byte) error { - var res ChangeAgentParamsBodyAzureDatabaseExporter - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeAgentParamsBodyAzureDatabaseExporterCustomLabels A wrapper for map[string]string. This type allows to distinguish between an empty map and a null value. -swagger:model ChangeAgentParamsBodyAzureDatabaseExporterCustomLabels -*/ -type ChangeAgentParamsBodyAzureDatabaseExporterCustomLabels struct { - // values - Values map[string]string `json:"values,omitempty"` -} - -// Validate validates this change agent params body azure database exporter custom labels -func (o *ChangeAgentParamsBodyAzureDatabaseExporterCustomLabels) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this change agent params body azure database exporter custom labels based on context it is used -func (o *ChangeAgentParamsBodyAzureDatabaseExporterCustomLabels) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeAgentParamsBodyAzureDatabaseExporterCustomLabels) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeAgentParamsBodyAzureDatabaseExporterCustomLabels) UnmarshalBinary(b []byte) error { - var res ChangeAgentParamsBodyAzureDatabaseExporterCustomLabels - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeAgentParamsBodyAzureDatabaseExporterMetricsResolutions MetricsResolutions represents Prometheus exporters metrics resolutions. -swagger:model ChangeAgentParamsBodyAzureDatabaseExporterMetricsResolutions -*/ -type ChangeAgentParamsBodyAzureDatabaseExporterMetricsResolutions struct { - // High resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Hr string `json:"hr,omitempty"` - - // Medium resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Mr string `json:"mr,omitempty"` - - // Low resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Lr string `json:"lr,omitempty"` -} - -// Validate validates this change agent params body azure database exporter metrics resolutions -func (o *ChangeAgentParamsBodyAzureDatabaseExporterMetricsResolutions) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this change agent params body azure database exporter metrics resolutions based on context it is used -func (o *ChangeAgentParamsBodyAzureDatabaseExporterMetricsResolutions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeAgentParamsBodyAzureDatabaseExporterMetricsResolutions) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeAgentParamsBodyAzureDatabaseExporterMetricsResolutions) UnmarshalBinary(b []byte) error { - var res ChangeAgentParamsBodyAzureDatabaseExporterMetricsResolutions - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeAgentParamsBodyExternalExporter change agent params body external exporter -swagger:model ChangeAgentParamsBodyExternalExporter -*/ -type ChangeAgentParamsBodyExternalExporter struct { - // Enable this Agent. Agents are enabled by default when they get added. - Enable *bool `json:"enable,omitempty"` - - // Enables push metrics with vmagent. - EnablePushMetrics *bool `json:"enable_push_metrics,omitempty"` - - // custom labels - CustomLabels *ChangeAgentParamsBodyExternalExporterCustomLabels `json:"custom_labels,omitempty"` - - // metrics resolutions - MetricsResolutions *ChangeAgentParamsBodyExternalExporterMetricsResolutions `json:"metrics_resolutions,omitempty"` -} - -// Validate validates this change agent params body external exporter -func (o *ChangeAgentParamsBodyExternalExporter) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateCustomLabels(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 -} - -func (o *ChangeAgentParamsBodyExternalExporter) validateCustomLabels(formats strfmt.Registry) error { - if swag.IsZero(o.CustomLabels) { // not required - return nil - } - - if o.CustomLabels != nil { - if err := o.CustomLabels.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "external_exporter" + "." + "custom_labels") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "external_exporter" + "." + "custom_labels") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentParamsBodyExternalExporter) 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("body" + "." + "external_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "external_exporter" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this change agent params body external exporter based on the context it is used -func (o *ChangeAgentParamsBodyExternalExporter) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateCustomLabels(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateMetricsResolutions(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ChangeAgentParamsBodyExternalExporter) contextValidateCustomLabels(ctx context.Context, formats strfmt.Registry) error { - if o.CustomLabels != nil { - - if swag.IsZero(o.CustomLabels) { // not required - return nil - } - - if err := o.CustomLabels.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "external_exporter" + "." + "custom_labels") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "external_exporter" + "." + "custom_labels") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentParamsBodyExternalExporter) 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 { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "external_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "external_exporter" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeAgentParamsBodyExternalExporter) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeAgentParamsBodyExternalExporter) UnmarshalBinary(b []byte) error { - var res ChangeAgentParamsBodyExternalExporter - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeAgentParamsBodyExternalExporterCustomLabels A wrapper for map[string]string. This type allows to distinguish between an empty map and a null value. -swagger:model ChangeAgentParamsBodyExternalExporterCustomLabels -*/ -type ChangeAgentParamsBodyExternalExporterCustomLabels struct { - // values - Values map[string]string `json:"values,omitempty"` -} - -// Validate validates this change agent params body external exporter custom labels -func (o *ChangeAgentParamsBodyExternalExporterCustomLabels) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this change agent params body external exporter custom labels based on context it is used -func (o *ChangeAgentParamsBodyExternalExporterCustomLabels) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeAgentParamsBodyExternalExporterCustomLabels) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeAgentParamsBodyExternalExporterCustomLabels) UnmarshalBinary(b []byte) error { - var res ChangeAgentParamsBodyExternalExporterCustomLabels - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeAgentParamsBodyExternalExporterMetricsResolutions MetricsResolutions represents Prometheus exporters metrics resolutions. -swagger:model ChangeAgentParamsBodyExternalExporterMetricsResolutions -*/ -type ChangeAgentParamsBodyExternalExporterMetricsResolutions struct { - // High resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Hr string `json:"hr,omitempty"` - - // Medium resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Mr string `json:"mr,omitempty"` - - // Low resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Lr string `json:"lr,omitempty"` -} - -// Validate validates this change agent params body external exporter metrics resolutions -func (o *ChangeAgentParamsBodyExternalExporterMetricsResolutions) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this change agent params body external exporter metrics resolutions based on context it is used -func (o *ChangeAgentParamsBodyExternalExporterMetricsResolutions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeAgentParamsBodyExternalExporterMetricsResolutions) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeAgentParamsBodyExternalExporterMetricsResolutions) UnmarshalBinary(b []byte) error { - var res ChangeAgentParamsBodyExternalExporterMetricsResolutions - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeAgentParamsBodyMongodbExporter change agent params body mongodb exporter -swagger:model ChangeAgentParamsBodyMongodbExporter -*/ -type ChangeAgentParamsBodyMongodbExporter struct { - // Enable this Agent. Agents are enabled by default when they get added. - Enable *bool `json:"enable,omitempty"` - - // Enables push metrics with vmagent. - EnablePushMetrics *bool `json:"enable_push_metrics,omitempty"` - - // custom labels - CustomLabels *ChangeAgentParamsBodyMongodbExporterCustomLabels `json:"custom_labels,omitempty"` - - // metrics resolutions - MetricsResolutions *ChangeAgentParamsBodyMongodbExporterMetricsResolutions `json:"metrics_resolutions,omitempty"` -} - -// Validate validates this change agent params body mongodb exporter -func (o *ChangeAgentParamsBodyMongodbExporter) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateCustomLabels(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 -} - -func (o *ChangeAgentParamsBodyMongodbExporter) validateCustomLabels(formats strfmt.Registry) error { - if swag.IsZero(o.CustomLabels) { // not required - return nil - } - - if o.CustomLabels != nil { - if err := o.CustomLabels.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "mongodb_exporter" + "." + "custom_labels") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "mongodb_exporter" + "." + "custom_labels") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentParamsBodyMongodbExporter) 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("body" + "." + "mongodb_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "mongodb_exporter" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this change agent params body mongodb exporter based on the context it is used -func (o *ChangeAgentParamsBodyMongodbExporter) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateCustomLabels(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateMetricsResolutions(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ChangeAgentParamsBodyMongodbExporter) contextValidateCustomLabels(ctx context.Context, formats strfmt.Registry) error { - if o.CustomLabels != nil { - - if swag.IsZero(o.CustomLabels) { // not required - return nil - } - - if err := o.CustomLabels.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "mongodb_exporter" + "." + "custom_labels") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "mongodb_exporter" + "." + "custom_labels") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentParamsBodyMongodbExporter) 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 { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "mongodb_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "mongodb_exporter" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeAgentParamsBodyMongodbExporter) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeAgentParamsBodyMongodbExporter) UnmarshalBinary(b []byte) error { - var res ChangeAgentParamsBodyMongodbExporter - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeAgentParamsBodyMongodbExporterCustomLabels A wrapper for map[string]string. This type allows to distinguish between an empty map and a null value. -swagger:model ChangeAgentParamsBodyMongodbExporterCustomLabels -*/ -type ChangeAgentParamsBodyMongodbExporterCustomLabels struct { - // values - Values map[string]string `json:"values,omitempty"` -} - -// Validate validates this change agent params body mongodb exporter custom labels -func (o *ChangeAgentParamsBodyMongodbExporterCustomLabels) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this change agent params body mongodb exporter custom labels based on context it is used -func (o *ChangeAgentParamsBodyMongodbExporterCustomLabels) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeAgentParamsBodyMongodbExporterCustomLabels) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeAgentParamsBodyMongodbExporterCustomLabels) UnmarshalBinary(b []byte) error { - var res ChangeAgentParamsBodyMongodbExporterCustomLabels - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeAgentParamsBodyMongodbExporterMetricsResolutions MetricsResolutions represents Prometheus exporters metrics resolutions. -swagger:model ChangeAgentParamsBodyMongodbExporterMetricsResolutions -*/ -type ChangeAgentParamsBodyMongodbExporterMetricsResolutions struct { - // High resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Hr string `json:"hr,omitempty"` - - // Medium resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Mr string `json:"mr,omitempty"` - - // Low resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Lr string `json:"lr,omitempty"` -} - -// Validate validates this change agent params body mongodb exporter metrics resolutions -func (o *ChangeAgentParamsBodyMongodbExporterMetricsResolutions) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this change agent params body mongodb exporter metrics resolutions based on context it is used -func (o *ChangeAgentParamsBodyMongodbExporterMetricsResolutions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeAgentParamsBodyMongodbExporterMetricsResolutions) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeAgentParamsBodyMongodbExporterMetricsResolutions) UnmarshalBinary(b []byte) error { - var res ChangeAgentParamsBodyMongodbExporterMetricsResolutions - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeAgentParamsBodyMysqldExporter change agent params body mysqld exporter -swagger:model ChangeAgentParamsBodyMysqldExporter -*/ -type ChangeAgentParamsBodyMysqldExporter struct { - // Enable this Agent. Agents are enabled by default when they get added. - Enable *bool `json:"enable,omitempty"` - - // Enables push metrics with vmagent. - EnablePushMetrics *bool `json:"enable_push_metrics,omitempty"` - - // custom labels - CustomLabels *ChangeAgentParamsBodyMysqldExporterCustomLabels `json:"custom_labels,omitempty"` - - // metrics resolutions - MetricsResolutions *ChangeAgentParamsBodyMysqldExporterMetricsResolutions `json:"metrics_resolutions,omitempty"` -} - -// Validate validates this change agent params body mysqld exporter -func (o *ChangeAgentParamsBodyMysqldExporter) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateCustomLabels(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 -} - -func (o *ChangeAgentParamsBodyMysqldExporter) validateCustomLabels(formats strfmt.Registry) error { - if swag.IsZero(o.CustomLabels) { // not required - return nil - } - - if o.CustomLabels != nil { - if err := o.CustomLabels.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "mysqld_exporter" + "." + "custom_labels") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "mysqld_exporter" + "." + "custom_labels") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentParamsBodyMysqldExporter) 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("body" + "." + "mysqld_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "mysqld_exporter" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this change agent params body mysqld exporter based on the context it is used -func (o *ChangeAgentParamsBodyMysqldExporter) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateCustomLabels(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateMetricsResolutions(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ChangeAgentParamsBodyMysqldExporter) contextValidateCustomLabels(ctx context.Context, formats strfmt.Registry) error { - if o.CustomLabels != nil { - - if swag.IsZero(o.CustomLabels) { // not required - return nil - } - - if err := o.CustomLabels.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "mysqld_exporter" + "." + "custom_labels") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "mysqld_exporter" + "." + "custom_labels") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentParamsBodyMysqldExporter) 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 { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "mysqld_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "mysqld_exporter" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeAgentParamsBodyMysqldExporter) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeAgentParamsBodyMysqldExporter) UnmarshalBinary(b []byte) error { - var res ChangeAgentParamsBodyMysqldExporter - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeAgentParamsBodyMysqldExporterCustomLabels A wrapper for map[string]string. This type allows to distinguish between an empty map and a null value. -swagger:model ChangeAgentParamsBodyMysqldExporterCustomLabels -*/ -type ChangeAgentParamsBodyMysqldExporterCustomLabels struct { - // values - Values map[string]string `json:"values,omitempty"` -} - -// Validate validates this change agent params body mysqld exporter custom labels -func (o *ChangeAgentParamsBodyMysqldExporterCustomLabels) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this change agent params body mysqld exporter custom labels based on context it is used -func (o *ChangeAgentParamsBodyMysqldExporterCustomLabels) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeAgentParamsBodyMysqldExporterCustomLabels) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeAgentParamsBodyMysqldExporterCustomLabels) UnmarshalBinary(b []byte) error { - var res ChangeAgentParamsBodyMysqldExporterCustomLabels - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeAgentParamsBodyMysqldExporterMetricsResolutions MetricsResolutions represents Prometheus exporters metrics resolutions. -swagger:model ChangeAgentParamsBodyMysqldExporterMetricsResolutions -*/ -type ChangeAgentParamsBodyMysqldExporterMetricsResolutions struct { - // High resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Hr string `json:"hr,omitempty"` - - // Medium resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Mr string `json:"mr,omitempty"` - - // Low resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Lr string `json:"lr,omitempty"` -} - -// Validate validates this change agent params body mysqld exporter metrics resolutions -func (o *ChangeAgentParamsBodyMysqldExporterMetricsResolutions) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this change agent params body mysqld exporter metrics resolutions based on context it is used -func (o *ChangeAgentParamsBodyMysqldExporterMetricsResolutions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeAgentParamsBodyMysqldExporterMetricsResolutions) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeAgentParamsBodyMysqldExporterMetricsResolutions) UnmarshalBinary(b []byte) error { - var res ChangeAgentParamsBodyMysqldExporterMetricsResolutions - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeAgentParamsBodyNodeExporter change agent params body node exporter -swagger:model ChangeAgentParamsBodyNodeExporter -*/ -type ChangeAgentParamsBodyNodeExporter struct { - // Enable this Agent. Agents are enabled by default when they get added. - Enable *bool `json:"enable,omitempty"` - - // Enables push metrics with vmagent. - EnablePushMetrics *bool `json:"enable_push_metrics,omitempty"` - - // custom labels - CustomLabels *ChangeAgentParamsBodyNodeExporterCustomLabels `json:"custom_labels,omitempty"` - - // metrics resolutions - MetricsResolutions *ChangeAgentParamsBodyNodeExporterMetricsResolutions `json:"metrics_resolutions,omitempty"` -} - -// Validate validates this change agent params body node exporter -func (o *ChangeAgentParamsBodyNodeExporter) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateCustomLabels(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 -} - -func (o *ChangeAgentParamsBodyNodeExporter) validateCustomLabels(formats strfmt.Registry) error { - if swag.IsZero(o.CustomLabels) { // not required - return nil - } - - if o.CustomLabels != nil { - if err := o.CustomLabels.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "node_exporter" + "." + "custom_labels") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "node_exporter" + "." + "custom_labels") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentParamsBodyNodeExporter) 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("body" + "." + "node_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "node_exporter" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this change agent params body node exporter based on the context it is used -func (o *ChangeAgentParamsBodyNodeExporter) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateCustomLabels(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateMetricsResolutions(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ChangeAgentParamsBodyNodeExporter) contextValidateCustomLabels(ctx context.Context, formats strfmt.Registry) error { - if o.CustomLabels != nil { - - if swag.IsZero(o.CustomLabels) { // not required - return nil - } - - if err := o.CustomLabels.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "node_exporter" + "." + "custom_labels") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "node_exporter" + "." + "custom_labels") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentParamsBodyNodeExporter) 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 { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "node_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "node_exporter" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeAgentParamsBodyNodeExporter) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeAgentParamsBodyNodeExporter) UnmarshalBinary(b []byte) error { - var res ChangeAgentParamsBodyNodeExporter - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeAgentParamsBodyNodeExporterCustomLabels A wrapper for map[string]string. This type allows to distinguish between an empty map and a null value. -swagger:model ChangeAgentParamsBodyNodeExporterCustomLabels -*/ -type ChangeAgentParamsBodyNodeExporterCustomLabels struct { - // values - Values map[string]string `json:"values,omitempty"` -} - -// Validate validates this change agent params body node exporter custom labels -func (o *ChangeAgentParamsBodyNodeExporterCustomLabels) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this change agent params body node exporter custom labels based on context it is used -func (o *ChangeAgentParamsBodyNodeExporterCustomLabels) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeAgentParamsBodyNodeExporterCustomLabels) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeAgentParamsBodyNodeExporterCustomLabels) UnmarshalBinary(b []byte) error { - var res ChangeAgentParamsBodyNodeExporterCustomLabels - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeAgentParamsBodyNodeExporterMetricsResolutions MetricsResolutions represents Prometheus exporters metrics resolutions. -swagger:model ChangeAgentParamsBodyNodeExporterMetricsResolutions -*/ -type ChangeAgentParamsBodyNodeExporterMetricsResolutions struct { - // High resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Hr string `json:"hr,omitempty"` - - // Medium resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Mr string `json:"mr,omitempty"` - - // Low resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Lr string `json:"lr,omitempty"` -} - -// Validate validates this change agent params body node exporter metrics resolutions -func (o *ChangeAgentParamsBodyNodeExporterMetricsResolutions) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this change agent params body node exporter metrics resolutions based on context it is used -func (o *ChangeAgentParamsBodyNodeExporterMetricsResolutions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeAgentParamsBodyNodeExporterMetricsResolutions) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeAgentParamsBodyNodeExporterMetricsResolutions) UnmarshalBinary(b []byte) error { - var res ChangeAgentParamsBodyNodeExporterMetricsResolutions - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeAgentParamsBodyNomadAgent change agent params body nomad agent -swagger:model ChangeAgentParamsBodyNomadAgent -*/ -type ChangeAgentParamsBodyNomadAgent struct { - // Enable this Agent. Agents are enabled by default when they get added. - Enable *bool `json:"enable,omitempty"` -} - -// Validate validates this change agent params body nomad agent -func (o *ChangeAgentParamsBodyNomadAgent) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this change agent params body nomad agent based on context it is used -func (o *ChangeAgentParamsBodyNomadAgent) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeAgentParamsBodyNomadAgent) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeAgentParamsBodyNomadAgent) UnmarshalBinary(b []byte) error { - var res ChangeAgentParamsBodyNomadAgent - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeAgentParamsBodyPostgresExporter change agent params body postgres exporter -swagger:model ChangeAgentParamsBodyPostgresExporter -*/ -type ChangeAgentParamsBodyPostgresExporter struct { - // Enable this Agent. Agents are enabled by default when they get added. - Enable *bool `json:"enable,omitempty"` - - // Enables push metrics with vmagent. - EnablePushMetrics *bool `json:"enable_push_metrics,omitempty"` - - // custom labels - CustomLabels *ChangeAgentParamsBodyPostgresExporterCustomLabels `json:"custom_labels,omitempty"` - - // metrics resolutions - MetricsResolutions *ChangeAgentParamsBodyPostgresExporterMetricsResolutions `json:"metrics_resolutions,omitempty"` -} - -// Validate validates this change agent params body postgres exporter -func (o *ChangeAgentParamsBodyPostgresExporter) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateCustomLabels(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 -} - -func (o *ChangeAgentParamsBodyPostgresExporter) validateCustomLabels(formats strfmt.Registry) error { - if swag.IsZero(o.CustomLabels) { // not required - return nil - } - - if o.CustomLabels != nil { - if err := o.CustomLabels.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "postgres_exporter" + "." + "custom_labels") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "postgres_exporter" + "." + "custom_labels") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentParamsBodyPostgresExporter) 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("body" + "." + "postgres_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "postgres_exporter" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this change agent params body postgres exporter based on the context it is used -func (o *ChangeAgentParamsBodyPostgresExporter) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateCustomLabels(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateMetricsResolutions(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ChangeAgentParamsBodyPostgresExporter) contextValidateCustomLabels(ctx context.Context, formats strfmt.Registry) error { - if o.CustomLabels != nil { - - if swag.IsZero(o.CustomLabels) { // not required - return nil - } - - if err := o.CustomLabels.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "postgres_exporter" + "." + "custom_labels") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "postgres_exporter" + "." + "custom_labels") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentParamsBodyPostgresExporter) 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 { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "postgres_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "postgres_exporter" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeAgentParamsBodyPostgresExporter) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeAgentParamsBodyPostgresExporter) UnmarshalBinary(b []byte) error { - var res ChangeAgentParamsBodyPostgresExporter - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeAgentParamsBodyPostgresExporterCustomLabels A wrapper for map[string]string. This type allows to distinguish between an empty map and a null value. -swagger:model ChangeAgentParamsBodyPostgresExporterCustomLabels -*/ -type ChangeAgentParamsBodyPostgresExporterCustomLabels struct { - // values - Values map[string]string `json:"values,omitempty"` -} - -// Validate validates this change agent params body postgres exporter custom labels -func (o *ChangeAgentParamsBodyPostgresExporterCustomLabels) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this change agent params body postgres exporter custom labels based on context it is used -func (o *ChangeAgentParamsBodyPostgresExporterCustomLabels) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeAgentParamsBodyPostgresExporterCustomLabels) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeAgentParamsBodyPostgresExporterCustomLabels) UnmarshalBinary(b []byte) error { - var res ChangeAgentParamsBodyPostgresExporterCustomLabels - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeAgentParamsBodyPostgresExporterMetricsResolutions MetricsResolutions represents Prometheus exporters metrics resolutions. -swagger:model ChangeAgentParamsBodyPostgresExporterMetricsResolutions -*/ -type ChangeAgentParamsBodyPostgresExporterMetricsResolutions struct { - // High resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Hr string `json:"hr,omitempty"` - - // Medium resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Mr string `json:"mr,omitempty"` - - // Low resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Lr string `json:"lr,omitempty"` -} - -// Validate validates this change agent params body postgres exporter metrics resolutions -func (o *ChangeAgentParamsBodyPostgresExporterMetricsResolutions) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this change agent params body postgres exporter metrics resolutions based on context it is used -func (o *ChangeAgentParamsBodyPostgresExporterMetricsResolutions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeAgentParamsBodyPostgresExporterMetricsResolutions) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeAgentParamsBodyPostgresExporterMetricsResolutions) UnmarshalBinary(b []byte) error { - var res ChangeAgentParamsBodyPostgresExporterMetricsResolutions - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeAgentParamsBodyProxysqlExporter change agent params body proxysql exporter -swagger:model ChangeAgentParamsBodyProxysqlExporter -*/ -type ChangeAgentParamsBodyProxysqlExporter struct { - // Enable this Agent. Agents are enabled by default when they get added. - Enable *bool `json:"enable,omitempty"` - - // Enables push metrics with vmagent. - EnablePushMetrics *bool `json:"enable_push_metrics,omitempty"` - - // custom labels - CustomLabels *ChangeAgentParamsBodyProxysqlExporterCustomLabels `json:"custom_labels,omitempty"` - - // metrics resolutions - MetricsResolutions *ChangeAgentParamsBodyProxysqlExporterMetricsResolutions `json:"metrics_resolutions,omitempty"` -} - -// Validate validates this change agent params body proxysql exporter -func (o *ChangeAgentParamsBodyProxysqlExporter) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateCustomLabels(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 -} - -func (o *ChangeAgentParamsBodyProxysqlExporter) validateCustomLabels(formats strfmt.Registry) error { - if swag.IsZero(o.CustomLabels) { // not required - return nil - } - - if o.CustomLabels != nil { - if err := o.CustomLabels.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "proxysql_exporter" + "." + "custom_labels") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "proxysql_exporter" + "." + "custom_labels") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentParamsBodyProxysqlExporter) 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("body" + "." + "proxysql_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "proxysql_exporter" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this change agent params body proxysql exporter based on the context it is used -func (o *ChangeAgentParamsBodyProxysqlExporter) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateCustomLabels(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateMetricsResolutions(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ChangeAgentParamsBodyProxysqlExporter) contextValidateCustomLabels(ctx context.Context, formats strfmt.Registry) error { - if o.CustomLabels != nil { - - if swag.IsZero(o.CustomLabels) { // not required - return nil - } - - if err := o.CustomLabels.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "proxysql_exporter" + "." + "custom_labels") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "proxysql_exporter" + "." + "custom_labels") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentParamsBodyProxysqlExporter) 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 { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "proxysql_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "proxysql_exporter" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeAgentParamsBodyProxysqlExporter) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeAgentParamsBodyProxysqlExporter) UnmarshalBinary(b []byte) error { - var res ChangeAgentParamsBodyProxysqlExporter - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeAgentParamsBodyProxysqlExporterCustomLabels A wrapper for map[string]string. This type allows to distinguish between an empty map and a null value. -swagger:model ChangeAgentParamsBodyProxysqlExporterCustomLabels -*/ -type ChangeAgentParamsBodyProxysqlExporterCustomLabels struct { - // values - Values map[string]string `json:"values,omitempty"` -} - -// Validate validates this change agent params body proxysql exporter custom labels -func (o *ChangeAgentParamsBodyProxysqlExporterCustomLabels) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this change agent params body proxysql exporter custom labels based on context it is used -func (o *ChangeAgentParamsBodyProxysqlExporterCustomLabels) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeAgentParamsBodyProxysqlExporterCustomLabels) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeAgentParamsBodyProxysqlExporterCustomLabels) UnmarshalBinary(b []byte) error { - var res ChangeAgentParamsBodyProxysqlExporterCustomLabels - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeAgentParamsBodyProxysqlExporterMetricsResolutions MetricsResolutions represents Prometheus exporters metrics resolutions. -swagger:model ChangeAgentParamsBodyProxysqlExporterMetricsResolutions -*/ -type ChangeAgentParamsBodyProxysqlExporterMetricsResolutions struct { - // High resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Hr string `json:"hr,omitempty"` - - // Medium resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Mr string `json:"mr,omitempty"` - - // Low resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Lr string `json:"lr,omitempty"` -} - -// Validate validates this change agent params body proxysql exporter metrics resolutions -func (o *ChangeAgentParamsBodyProxysqlExporterMetricsResolutions) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this change agent params body proxysql exporter metrics resolutions based on context it is used -func (o *ChangeAgentParamsBodyProxysqlExporterMetricsResolutions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeAgentParamsBodyProxysqlExporterMetricsResolutions) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeAgentParamsBodyProxysqlExporterMetricsResolutions) UnmarshalBinary(b []byte) error { - var res ChangeAgentParamsBodyProxysqlExporterMetricsResolutions - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeAgentParamsBodyQANMongodbMongologAgent change agent params body QAN mongodb mongolog agent -swagger:model ChangeAgentParamsBodyQANMongodbMongologAgent -*/ -type ChangeAgentParamsBodyQANMongodbMongologAgent struct { - // Enable this Agent. Agents are enabled by default when they get added. - Enable *bool `json:"enable,omitempty"` - - // Enables push metrics with vmagent. - EnablePushMetrics *bool `json:"enable_push_metrics,omitempty"` - - // custom labels - CustomLabels *ChangeAgentParamsBodyQANMongodbMongologAgentCustomLabels `json:"custom_labels,omitempty"` - - // metrics resolutions - MetricsResolutions *ChangeAgentParamsBodyQANMongodbMongologAgentMetricsResolutions `json:"metrics_resolutions,omitempty"` -} - -// Validate validates this change agent params body QAN mongodb mongolog agent -func (o *ChangeAgentParamsBodyQANMongodbMongologAgent) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateCustomLabels(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 -} - -func (o *ChangeAgentParamsBodyQANMongodbMongologAgent) validateCustomLabels(formats strfmt.Registry) error { - if swag.IsZero(o.CustomLabels) { // not required - return nil - } - - if o.CustomLabels != nil { - if err := o.CustomLabels.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "qan_mongodb_mongolog_agent" + "." + "custom_labels") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "qan_mongodb_mongolog_agent" + "." + "custom_labels") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentParamsBodyQANMongodbMongologAgent) 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("body" + "." + "qan_mongodb_mongolog_agent" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "qan_mongodb_mongolog_agent" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this change agent params body QAN mongodb mongolog agent based on the context it is used -func (o *ChangeAgentParamsBodyQANMongodbMongologAgent) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateCustomLabels(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateMetricsResolutions(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ChangeAgentParamsBodyQANMongodbMongologAgent) contextValidateCustomLabels(ctx context.Context, formats strfmt.Registry) error { - if o.CustomLabels != nil { - - if swag.IsZero(o.CustomLabels) { // not required - return nil - } - - if err := o.CustomLabels.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "qan_mongodb_mongolog_agent" + "." + "custom_labels") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "qan_mongodb_mongolog_agent" + "." + "custom_labels") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentParamsBodyQANMongodbMongologAgent) 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 { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "qan_mongodb_mongolog_agent" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "qan_mongodb_mongolog_agent" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeAgentParamsBodyQANMongodbMongologAgent) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeAgentParamsBodyQANMongodbMongologAgent) UnmarshalBinary(b []byte) error { - var res ChangeAgentParamsBodyQANMongodbMongologAgent - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeAgentParamsBodyQANMongodbMongologAgentCustomLabels A wrapper for map[string]string. This type allows to distinguish between an empty map and a null value. -swagger:model ChangeAgentParamsBodyQANMongodbMongologAgentCustomLabels -*/ -type ChangeAgentParamsBodyQANMongodbMongologAgentCustomLabels struct { - // values - Values map[string]string `json:"values,omitempty"` -} - -// Validate validates this change agent params body QAN mongodb mongolog agent custom labels -func (o *ChangeAgentParamsBodyQANMongodbMongologAgentCustomLabels) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this change agent params body QAN mongodb mongolog agent custom labels based on context it is used -func (o *ChangeAgentParamsBodyQANMongodbMongologAgentCustomLabels) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeAgentParamsBodyQANMongodbMongologAgentCustomLabels) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeAgentParamsBodyQANMongodbMongologAgentCustomLabels) UnmarshalBinary(b []byte) error { - var res ChangeAgentParamsBodyQANMongodbMongologAgentCustomLabels - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeAgentParamsBodyQANMongodbMongologAgentMetricsResolutions MetricsResolutions represents Prometheus exporters metrics resolutions. -swagger:model ChangeAgentParamsBodyQANMongodbMongologAgentMetricsResolutions -*/ -type ChangeAgentParamsBodyQANMongodbMongologAgentMetricsResolutions struct { - // High resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Hr string `json:"hr,omitempty"` - - // Medium resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Mr string `json:"mr,omitempty"` - - // Low resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Lr string `json:"lr,omitempty"` -} - -// Validate validates this change agent params body QAN mongodb mongolog agent metrics resolutions -func (o *ChangeAgentParamsBodyQANMongodbMongologAgentMetricsResolutions) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this change agent params body QAN mongodb mongolog agent metrics resolutions based on context it is used -func (o *ChangeAgentParamsBodyQANMongodbMongologAgentMetricsResolutions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeAgentParamsBodyQANMongodbMongologAgentMetricsResolutions) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeAgentParamsBodyQANMongodbMongologAgentMetricsResolutions) UnmarshalBinary(b []byte) error { - var res ChangeAgentParamsBodyQANMongodbMongologAgentMetricsResolutions - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeAgentParamsBodyQANMongodbProfilerAgent change agent params body QAN mongodb profiler agent -swagger:model ChangeAgentParamsBodyQANMongodbProfilerAgent -*/ -type ChangeAgentParamsBodyQANMongodbProfilerAgent struct { - // Enable this Agent. Agents are enabled by default when they get added. - Enable *bool `json:"enable,omitempty"` - - // Enables push metrics with vmagent. - EnablePushMetrics *bool `json:"enable_push_metrics,omitempty"` - - // custom labels - CustomLabels *ChangeAgentParamsBodyQANMongodbProfilerAgentCustomLabels `json:"custom_labels,omitempty"` - - // metrics resolutions - MetricsResolutions *ChangeAgentParamsBodyQANMongodbProfilerAgentMetricsResolutions `json:"metrics_resolutions,omitempty"` -} - -// Validate validates this change agent params body QAN mongodb profiler agent -func (o *ChangeAgentParamsBodyQANMongodbProfilerAgent) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateCustomLabels(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 -} - -func (o *ChangeAgentParamsBodyQANMongodbProfilerAgent) validateCustomLabels(formats strfmt.Registry) error { - if swag.IsZero(o.CustomLabels) { // not required - return nil - } - - if o.CustomLabels != nil { - if err := o.CustomLabels.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "qan_mongodb_profiler_agent" + "." + "custom_labels") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "qan_mongodb_profiler_agent" + "." + "custom_labels") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentParamsBodyQANMongodbProfilerAgent) 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("body" + "." + "qan_mongodb_profiler_agent" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "qan_mongodb_profiler_agent" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this change agent params body QAN mongodb profiler agent based on the context it is used -func (o *ChangeAgentParamsBodyQANMongodbProfilerAgent) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateCustomLabels(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateMetricsResolutions(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ChangeAgentParamsBodyQANMongodbProfilerAgent) contextValidateCustomLabels(ctx context.Context, formats strfmt.Registry) error { - if o.CustomLabels != nil { - - if swag.IsZero(o.CustomLabels) { // not required - return nil - } - - if err := o.CustomLabels.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "qan_mongodb_profiler_agent" + "." + "custom_labels") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "qan_mongodb_profiler_agent" + "." + "custom_labels") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentParamsBodyQANMongodbProfilerAgent) 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 { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "qan_mongodb_profiler_agent" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "qan_mongodb_profiler_agent" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeAgentParamsBodyQANMongodbProfilerAgent) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeAgentParamsBodyQANMongodbProfilerAgent) UnmarshalBinary(b []byte) error { - var res ChangeAgentParamsBodyQANMongodbProfilerAgent - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeAgentParamsBodyQANMongodbProfilerAgentCustomLabels A wrapper for map[string]string. This type allows to distinguish between an empty map and a null value. -swagger:model ChangeAgentParamsBodyQANMongodbProfilerAgentCustomLabels -*/ -type ChangeAgentParamsBodyQANMongodbProfilerAgentCustomLabels struct { - // values - Values map[string]string `json:"values,omitempty"` -} - -// Validate validates this change agent params body QAN mongodb profiler agent custom labels -func (o *ChangeAgentParamsBodyQANMongodbProfilerAgentCustomLabels) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this change agent params body QAN mongodb profiler agent custom labels based on context it is used -func (o *ChangeAgentParamsBodyQANMongodbProfilerAgentCustomLabels) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeAgentParamsBodyQANMongodbProfilerAgentCustomLabels) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeAgentParamsBodyQANMongodbProfilerAgentCustomLabels) UnmarshalBinary(b []byte) error { - var res ChangeAgentParamsBodyQANMongodbProfilerAgentCustomLabels - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeAgentParamsBodyQANMongodbProfilerAgentMetricsResolutions MetricsResolutions represents Prometheus exporters metrics resolutions. -swagger:model ChangeAgentParamsBodyQANMongodbProfilerAgentMetricsResolutions -*/ -type ChangeAgentParamsBodyQANMongodbProfilerAgentMetricsResolutions struct { - // High resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Hr string `json:"hr,omitempty"` - - // Medium resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Mr string `json:"mr,omitempty"` - - // Low resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Lr string `json:"lr,omitempty"` -} - -// Validate validates this change agent params body QAN mongodb profiler agent metrics resolutions -func (o *ChangeAgentParamsBodyQANMongodbProfilerAgentMetricsResolutions) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this change agent params body QAN mongodb profiler agent metrics resolutions based on context it is used -func (o *ChangeAgentParamsBodyQANMongodbProfilerAgentMetricsResolutions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeAgentParamsBodyQANMongodbProfilerAgentMetricsResolutions) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeAgentParamsBodyQANMongodbProfilerAgentMetricsResolutions) UnmarshalBinary(b []byte) error { - var res ChangeAgentParamsBodyQANMongodbProfilerAgentMetricsResolutions - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeAgentParamsBodyQANMysqlPerfschemaAgent change agent params body QAN mysql perfschema agent -swagger:model ChangeAgentParamsBodyQANMysqlPerfschemaAgent -*/ -type ChangeAgentParamsBodyQANMysqlPerfschemaAgent struct { - // Enable this Agent. Agents are enabled by default when they get added. - Enable *bool `json:"enable,omitempty"` - - // Enables push metrics with vmagent. - EnablePushMetrics *bool `json:"enable_push_metrics,omitempty"` - - // custom labels - CustomLabels *ChangeAgentParamsBodyQANMysqlPerfschemaAgentCustomLabels `json:"custom_labels,omitempty"` - - // metrics resolutions - MetricsResolutions *ChangeAgentParamsBodyQANMysqlPerfschemaAgentMetricsResolutions `json:"metrics_resolutions,omitempty"` -} - -// Validate validates this change agent params body QAN mysql perfschema agent -func (o *ChangeAgentParamsBodyQANMysqlPerfschemaAgent) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateCustomLabels(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 -} - -func (o *ChangeAgentParamsBodyQANMysqlPerfschemaAgent) validateCustomLabels(formats strfmt.Registry) error { - if swag.IsZero(o.CustomLabels) { // not required - return nil - } - - if o.CustomLabels != nil { - if err := o.CustomLabels.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "qan_mysql_perfschema_agent" + "." + "custom_labels") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "qan_mysql_perfschema_agent" + "." + "custom_labels") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentParamsBodyQANMysqlPerfschemaAgent) 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("body" + "." + "qan_mysql_perfschema_agent" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "qan_mysql_perfschema_agent" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this change agent params body QAN mysql perfschema agent based on the context it is used -func (o *ChangeAgentParamsBodyQANMysqlPerfschemaAgent) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateCustomLabels(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateMetricsResolutions(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ChangeAgentParamsBodyQANMysqlPerfschemaAgent) contextValidateCustomLabels(ctx context.Context, formats strfmt.Registry) error { - if o.CustomLabels != nil { - - if swag.IsZero(o.CustomLabels) { // not required - return nil - } - - if err := o.CustomLabels.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "qan_mysql_perfschema_agent" + "." + "custom_labels") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "qan_mysql_perfschema_agent" + "." + "custom_labels") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentParamsBodyQANMysqlPerfschemaAgent) 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 { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "qan_mysql_perfschema_agent" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "qan_mysql_perfschema_agent" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeAgentParamsBodyQANMysqlPerfschemaAgent) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeAgentParamsBodyQANMysqlPerfschemaAgent) UnmarshalBinary(b []byte) error { - var res ChangeAgentParamsBodyQANMysqlPerfschemaAgent - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeAgentParamsBodyQANMysqlPerfschemaAgentCustomLabels A wrapper for map[string]string. This type allows to distinguish between an empty map and a null value. -swagger:model ChangeAgentParamsBodyQANMysqlPerfschemaAgentCustomLabels -*/ -type ChangeAgentParamsBodyQANMysqlPerfschemaAgentCustomLabels struct { - // values - Values map[string]string `json:"values,omitempty"` -} - -// Validate validates this change agent params body QAN mysql perfschema agent custom labels -func (o *ChangeAgentParamsBodyQANMysqlPerfschemaAgentCustomLabels) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this change agent params body QAN mysql perfschema agent custom labels based on context it is used -func (o *ChangeAgentParamsBodyQANMysqlPerfschemaAgentCustomLabels) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeAgentParamsBodyQANMysqlPerfschemaAgentCustomLabels) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeAgentParamsBodyQANMysqlPerfschemaAgentCustomLabels) UnmarshalBinary(b []byte) error { - var res ChangeAgentParamsBodyQANMysqlPerfschemaAgentCustomLabels - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeAgentParamsBodyQANMysqlPerfschemaAgentMetricsResolutions MetricsResolutions represents Prometheus exporters metrics resolutions. -swagger:model ChangeAgentParamsBodyQANMysqlPerfschemaAgentMetricsResolutions -*/ -type ChangeAgentParamsBodyQANMysqlPerfschemaAgentMetricsResolutions struct { - // High resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Hr string `json:"hr,omitempty"` - - // Medium resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Mr string `json:"mr,omitempty"` - - // Low resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Lr string `json:"lr,omitempty"` -} - -// Validate validates this change agent params body QAN mysql perfschema agent metrics resolutions -func (o *ChangeAgentParamsBodyQANMysqlPerfschemaAgentMetricsResolutions) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this change agent params body QAN mysql perfschema agent metrics resolutions based on context it is used -func (o *ChangeAgentParamsBodyQANMysqlPerfschemaAgentMetricsResolutions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeAgentParamsBodyQANMysqlPerfschemaAgentMetricsResolutions) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeAgentParamsBodyQANMysqlPerfschemaAgentMetricsResolutions) UnmarshalBinary(b []byte) error { - var res ChangeAgentParamsBodyQANMysqlPerfschemaAgentMetricsResolutions - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeAgentParamsBodyQANMysqlSlowlogAgent change agent params body QAN mysql slowlog agent -swagger:model ChangeAgentParamsBodyQANMysqlSlowlogAgent -*/ -type ChangeAgentParamsBodyQANMysqlSlowlogAgent struct { - // Enable this Agent. Agents are enabled by default when they get added. - Enable *bool `json:"enable,omitempty"` - - // Enables push metrics with vmagent. - EnablePushMetrics *bool `json:"enable_push_metrics,omitempty"` - - // custom labels - CustomLabels *ChangeAgentParamsBodyQANMysqlSlowlogAgentCustomLabels `json:"custom_labels,omitempty"` - - // metrics resolutions - MetricsResolutions *ChangeAgentParamsBodyQANMysqlSlowlogAgentMetricsResolutions `json:"metrics_resolutions,omitempty"` -} - -// Validate validates this change agent params body QAN mysql slowlog agent -func (o *ChangeAgentParamsBodyQANMysqlSlowlogAgent) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateCustomLabels(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 -} - -func (o *ChangeAgentParamsBodyQANMysqlSlowlogAgent) validateCustomLabels(formats strfmt.Registry) error { - if swag.IsZero(o.CustomLabels) { // not required - return nil - } - - if o.CustomLabels != nil { - if err := o.CustomLabels.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "qan_mysql_slowlog_agent" + "." + "custom_labels") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "qan_mysql_slowlog_agent" + "." + "custom_labels") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentParamsBodyQANMysqlSlowlogAgent) 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("body" + "." + "qan_mysql_slowlog_agent" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "qan_mysql_slowlog_agent" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this change agent params body QAN mysql slowlog agent based on the context it is used -func (o *ChangeAgentParamsBodyQANMysqlSlowlogAgent) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateCustomLabels(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateMetricsResolutions(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ChangeAgentParamsBodyQANMysqlSlowlogAgent) contextValidateCustomLabels(ctx context.Context, formats strfmt.Registry) error { - if o.CustomLabels != nil { - - if swag.IsZero(o.CustomLabels) { // not required - return nil - } - - if err := o.CustomLabels.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "qan_mysql_slowlog_agent" + "." + "custom_labels") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "qan_mysql_slowlog_agent" + "." + "custom_labels") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentParamsBodyQANMysqlSlowlogAgent) 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 { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "qan_mysql_slowlog_agent" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "qan_mysql_slowlog_agent" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeAgentParamsBodyQANMysqlSlowlogAgent) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeAgentParamsBodyQANMysqlSlowlogAgent) UnmarshalBinary(b []byte) error { - var res ChangeAgentParamsBodyQANMysqlSlowlogAgent - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeAgentParamsBodyQANMysqlSlowlogAgentCustomLabels A wrapper for map[string]string. This type allows to distinguish between an empty map and a null value. -swagger:model ChangeAgentParamsBodyQANMysqlSlowlogAgentCustomLabels -*/ -type ChangeAgentParamsBodyQANMysqlSlowlogAgentCustomLabels struct { - // values - Values map[string]string `json:"values,omitempty"` -} - -// Validate validates this change agent params body QAN mysql slowlog agent custom labels -func (o *ChangeAgentParamsBodyQANMysqlSlowlogAgentCustomLabels) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this change agent params body QAN mysql slowlog agent custom labels based on context it is used -func (o *ChangeAgentParamsBodyQANMysqlSlowlogAgentCustomLabels) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeAgentParamsBodyQANMysqlSlowlogAgentCustomLabels) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeAgentParamsBodyQANMysqlSlowlogAgentCustomLabels) UnmarshalBinary(b []byte) error { - var res ChangeAgentParamsBodyQANMysqlSlowlogAgentCustomLabels - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeAgentParamsBodyQANMysqlSlowlogAgentMetricsResolutions MetricsResolutions represents Prometheus exporters metrics resolutions. -swagger:model ChangeAgentParamsBodyQANMysqlSlowlogAgentMetricsResolutions -*/ -type ChangeAgentParamsBodyQANMysqlSlowlogAgentMetricsResolutions struct { - // High resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Hr string `json:"hr,omitempty"` - - // Medium resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Mr string `json:"mr,omitempty"` - - // Low resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Lr string `json:"lr,omitempty"` -} - -// Validate validates this change agent params body QAN mysql slowlog agent metrics resolutions -func (o *ChangeAgentParamsBodyQANMysqlSlowlogAgentMetricsResolutions) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this change agent params body QAN mysql slowlog agent metrics resolutions based on context it is used -func (o *ChangeAgentParamsBodyQANMysqlSlowlogAgentMetricsResolutions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeAgentParamsBodyQANMysqlSlowlogAgentMetricsResolutions) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeAgentParamsBodyQANMysqlSlowlogAgentMetricsResolutions) UnmarshalBinary(b []byte) error { - var res ChangeAgentParamsBodyQANMysqlSlowlogAgentMetricsResolutions - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeAgentParamsBodyQANPostgresqlPgstatementsAgent change agent params body QAN postgresql pgstatements agent -swagger:model ChangeAgentParamsBodyQANPostgresqlPgstatementsAgent -*/ -type ChangeAgentParamsBodyQANPostgresqlPgstatementsAgent struct { - // Enable this Agent. Agents are enabled by default when they get added. - Enable *bool `json:"enable,omitempty"` - - // Enables push metrics with vmagent. - EnablePushMetrics *bool `json:"enable_push_metrics,omitempty"` - - // custom labels - CustomLabels *ChangeAgentParamsBodyQANPostgresqlPgstatementsAgentCustomLabels `json:"custom_labels,omitempty"` - - // metrics resolutions - MetricsResolutions *ChangeAgentParamsBodyQANPostgresqlPgstatementsAgentMetricsResolutions `json:"metrics_resolutions,omitempty"` -} - -// Validate validates this change agent params body QAN postgresql pgstatements agent -func (o *ChangeAgentParamsBodyQANPostgresqlPgstatementsAgent) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateCustomLabels(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 -} - -func (o *ChangeAgentParamsBodyQANPostgresqlPgstatementsAgent) validateCustomLabels(formats strfmt.Registry) error { - if swag.IsZero(o.CustomLabels) { // not required - return nil - } - - if o.CustomLabels != nil { - if err := o.CustomLabels.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "qan_postgresql_pgstatements_agent" + "." + "custom_labels") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "qan_postgresql_pgstatements_agent" + "." + "custom_labels") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentParamsBodyQANPostgresqlPgstatementsAgent) 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("body" + "." + "qan_postgresql_pgstatements_agent" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "qan_postgresql_pgstatements_agent" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this change agent params body QAN postgresql pgstatements agent based on the context it is used -func (o *ChangeAgentParamsBodyQANPostgresqlPgstatementsAgent) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateCustomLabels(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateMetricsResolutions(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ChangeAgentParamsBodyQANPostgresqlPgstatementsAgent) contextValidateCustomLabels(ctx context.Context, formats strfmt.Registry) error { - if o.CustomLabels != nil { - - if swag.IsZero(o.CustomLabels) { // not required - return nil - } - - if err := o.CustomLabels.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "qan_postgresql_pgstatements_agent" + "." + "custom_labels") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "qan_postgresql_pgstatements_agent" + "." + "custom_labels") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentParamsBodyQANPostgresqlPgstatementsAgent) 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 { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "qan_postgresql_pgstatements_agent" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "qan_postgresql_pgstatements_agent" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeAgentParamsBodyQANPostgresqlPgstatementsAgent) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeAgentParamsBodyQANPostgresqlPgstatementsAgent) UnmarshalBinary(b []byte) error { - var res ChangeAgentParamsBodyQANPostgresqlPgstatementsAgent - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeAgentParamsBodyQANPostgresqlPgstatementsAgentCustomLabels A wrapper for map[string]string. This type allows to distinguish between an empty map and a null value. -swagger:model ChangeAgentParamsBodyQANPostgresqlPgstatementsAgentCustomLabels -*/ -type ChangeAgentParamsBodyQANPostgresqlPgstatementsAgentCustomLabels struct { - // values - Values map[string]string `json:"values,omitempty"` -} - -// Validate validates this change agent params body QAN postgresql pgstatements agent custom labels -func (o *ChangeAgentParamsBodyQANPostgresqlPgstatementsAgentCustomLabels) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this change agent params body QAN postgresql pgstatements agent custom labels based on context it is used -func (o *ChangeAgentParamsBodyQANPostgresqlPgstatementsAgentCustomLabels) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeAgentParamsBodyQANPostgresqlPgstatementsAgentCustomLabels) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeAgentParamsBodyQANPostgresqlPgstatementsAgentCustomLabels) UnmarshalBinary(b []byte) error { - var res ChangeAgentParamsBodyQANPostgresqlPgstatementsAgentCustomLabels - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeAgentParamsBodyQANPostgresqlPgstatementsAgentMetricsResolutions MetricsResolutions represents Prometheus exporters metrics resolutions. -swagger:model ChangeAgentParamsBodyQANPostgresqlPgstatementsAgentMetricsResolutions -*/ -type ChangeAgentParamsBodyQANPostgresqlPgstatementsAgentMetricsResolutions struct { - // High resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Hr string `json:"hr,omitempty"` - - // Medium resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Mr string `json:"mr,omitempty"` - - // Low resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Lr string `json:"lr,omitempty"` -} - -// Validate validates this change agent params body QAN postgresql pgstatements agent metrics resolutions -func (o *ChangeAgentParamsBodyQANPostgresqlPgstatementsAgentMetricsResolutions) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this change agent params body QAN postgresql pgstatements agent metrics resolutions based on context it is used -func (o *ChangeAgentParamsBodyQANPostgresqlPgstatementsAgentMetricsResolutions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeAgentParamsBodyQANPostgresqlPgstatementsAgentMetricsResolutions) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeAgentParamsBodyQANPostgresqlPgstatementsAgentMetricsResolutions) UnmarshalBinary(b []byte) error { - var res ChangeAgentParamsBodyQANPostgresqlPgstatementsAgentMetricsResolutions - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeAgentParamsBodyQANPostgresqlPgstatmonitorAgent change agent params body QAN postgresql pgstatmonitor agent -swagger:model ChangeAgentParamsBodyQANPostgresqlPgstatmonitorAgent -*/ -type ChangeAgentParamsBodyQANPostgresqlPgstatmonitorAgent struct { - // Enable this Agent. Agents are enabled by default when they get added. - Enable *bool `json:"enable,omitempty"` - - // Enables push metrics with vmagent. - EnablePushMetrics *bool `json:"enable_push_metrics,omitempty"` - - // custom labels - CustomLabels *ChangeAgentParamsBodyQANPostgresqlPgstatmonitorAgentCustomLabels `json:"custom_labels,omitempty"` - - // metrics resolutions - MetricsResolutions *ChangeAgentParamsBodyQANPostgresqlPgstatmonitorAgentMetricsResolutions `json:"metrics_resolutions,omitempty"` -} - -// Validate validates this change agent params body QAN postgresql pgstatmonitor agent -func (o *ChangeAgentParamsBodyQANPostgresqlPgstatmonitorAgent) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateCustomLabels(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 -} - -func (o *ChangeAgentParamsBodyQANPostgresqlPgstatmonitorAgent) validateCustomLabels(formats strfmt.Registry) error { - if swag.IsZero(o.CustomLabels) { // not required - return nil - } - - if o.CustomLabels != nil { - if err := o.CustomLabels.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "qan_postgresql_pgstatmonitor_agent" + "." + "custom_labels") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "qan_postgresql_pgstatmonitor_agent" + "." + "custom_labels") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentParamsBodyQANPostgresqlPgstatmonitorAgent) 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("body" + "." + "qan_postgresql_pgstatmonitor_agent" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "qan_postgresql_pgstatmonitor_agent" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this change agent params body QAN postgresql pgstatmonitor agent based on the context it is used -func (o *ChangeAgentParamsBodyQANPostgresqlPgstatmonitorAgent) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateCustomLabels(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateMetricsResolutions(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ChangeAgentParamsBodyQANPostgresqlPgstatmonitorAgent) contextValidateCustomLabels(ctx context.Context, formats strfmt.Registry) error { - if o.CustomLabels != nil { - - if swag.IsZero(o.CustomLabels) { // not required - return nil - } - - if err := o.CustomLabels.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "qan_postgresql_pgstatmonitor_agent" + "." + "custom_labels") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "qan_postgresql_pgstatmonitor_agent" + "." + "custom_labels") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentParamsBodyQANPostgresqlPgstatmonitorAgent) 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 { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "qan_postgresql_pgstatmonitor_agent" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "qan_postgresql_pgstatmonitor_agent" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeAgentParamsBodyQANPostgresqlPgstatmonitorAgent) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeAgentParamsBodyQANPostgresqlPgstatmonitorAgent) UnmarshalBinary(b []byte) error { - var res ChangeAgentParamsBodyQANPostgresqlPgstatmonitorAgent - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeAgentParamsBodyQANPostgresqlPgstatmonitorAgentCustomLabels A wrapper for map[string]string. This type allows to distinguish between an empty map and a null value. -swagger:model ChangeAgentParamsBodyQANPostgresqlPgstatmonitorAgentCustomLabels -*/ -type ChangeAgentParamsBodyQANPostgresqlPgstatmonitorAgentCustomLabels struct { - // values - Values map[string]string `json:"values,omitempty"` -} - -// Validate validates this change agent params body QAN postgresql pgstatmonitor agent custom labels -func (o *ChangeAgentParamsBodyQANPostgresqlPgstatmonitorAgentCustomLabels) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this change agent params body QAN postgresql pgstatmonitor agent custom labels based on context it is used -func (o *ChangeAgentParamsBodyQANPostgresqlPgstatmonitorAgentCustomLabels) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeAgentParamsBodyQANPostgresqlPgstatmonitorAgentCustomLabels) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeAgentParamsBodyQANPostgresqlPgstatmonitorAgentCustomLabels) UnmarshalBinary(b []byte) error { - var res ChangeAgentParamsBodyQANPostgresqlPgstatmonitorAgentCustomLabels - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeAgentParamsBodyQANPostgresqlPgstatmonitorAgentMetricsResolutions MetricsResolutions represents Prometheus exporters metrics resolutions. -swagger:model ChangeAgentParamsBodyQANPostgresqlPgstatmonitorAgentMetricsResolutions -*/ -type ChangeAgentParamsBodyQANPostgresqlPgstatmonitorAgentMetricsResolutions struct { - // High resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Hr string `json:"hr,omitempty"` - - // Medium resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Mr string `json:"mr,omitempty"` - - // Low resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Lr string `json:"lr,omitempty"` -} - -// Validate validates this change agent params body QAN postgresql pgstatmonitor agent metrics resolutions -func (o *ChangeAgentParamsBodyQANPostgresqlPgstatmonitorAgentMetricsResolutions) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this change agent params body QAN postgresql pgstatmonitor agent metrics resolutions based on context it is used -func (o *ChangeAgentParamsBodyQANPostgresqlPgstatmonitorAgentMetricsResolutions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeAgentParamsBodyQANPostgresqlPgstatmonitorAgentMetricsResolutions) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeAgentParamsBodyQANPostgresqlPgstatmonitorAgentMetricsResolutions) UnmarshalBinary(b []byte) error { - var res ChangeAgentParamsBodyQANPostgresqlPgstatmonitorAgentMetricsResolutions - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeAgentParamsBodyRDSExporter change agent params body RDS exporter -swagger:model ChangeAgentParamsBodyRDSExporter -*/ -type ChangeAgentParamsBodyRDSExporter struct { - // Enable this Agent. Agents are enabled by default when they get added. - Enable *bool `json:"enable,omitempty"` - - // Enables push metrics with vmagent. - EnablePushMetrics *bool `json:"enable_push_metrics,omitempty"` - - // custom labels - CustomLabels *ChangeAgentParamsBodyRDSExporterCustomLabels `json:"custom_labels,omitempty"` - - // metrics resolutions - MetricsResolutions *ChangeAgentParamsBodyRDSExporterMetricsResolutions `json:"metrics_resolutions,omitempty"` -} - -// Validate validates this change agent params body RDS exporter -func (o *ChangeAgentParamsBodyRDSExporter) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateCustomLabels(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 -} - -func (o *ChangeAgentParamsBodyRDSExporter) validateCustomLabels(formats strfmt.Registry) error { - if swag.IsZero(o.CustomLabels) { // not required - return nil - } - - if o.CustomLabels != nil { - if err := o.CustomLabels.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "rds_exporter" + "." + "custom_labels") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "rds_exporter" + "." + "custom_labels") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentParamsBodyRDSExporter) 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("body" + "." + "rds_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "rds_exporter" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this change agent params body RDS exporter based on the context it is used -func (o *ChangeAgentParamsBodyRDSExporter) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateCustomLabels(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateMetricsResolutions(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ChangeAgentParamsBodyRDSExporter) contextValidateCustomLabels(ctx context.Context, formats strfmt.Registry) error { - if o.CustomLabels != nil { - - if swag.IsZero(o.CustomLabels) { // not required - return nil - } - - if err := o.CustomLabels.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "rds_exporter" + "." + "custom_labels") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "rds_exporter" + "." + "custom_labels") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentParamsBodyRDSExporter) 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 { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "rds_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "rds_exporter" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeAgentParamsBodyRDSExporter) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeAgentParamsBodyRDSExporter) UnmarshalBinary(b []byte) error { - var res ChangeAgentParamsBodyRDSExporter - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeAgentParamsBodyRDSExporterCustomLabels A wrapper for map[string]string. This type allows to distinguish between an empty map and a null value. -swagger:model ChangeAgentParamsBodyRDSExporterCustomLabels -*/ -type ChangeAgentParamsBodyRDSExporterCustomLabels struct { - // values - Values map[string]string `json:"values,omitempty"` -} - -// Validate validates this change agent params body RDS exporter custom labels -func (o *ChangeAgentParamsBodyRDSExporterCustomLabels) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this change agent params body RDS exporter custom labels based on context it is used -func (o *ChangeAgentParamsBodyRDSExporterCustomLabels) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeAgentParamsBodyRDSExporterCustomLabels) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeAgentParamsBodyRDSExporterCustomLabels) UnmarshalBinary(b []byte) error { - var res ChangeAgentParamsBodyRDSExporterCustomLabels - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeAgentParamsBodyRDSExporterMetricsResolutions MetricsResolutions represents Prometheus exporters metrics resolutions. -swagger:model ChangeAgentParamsBodyRDSExporterMetricsResolutions -*/ -type ChangeAgentParamsBodyRDSExporterMetricsResolutions struct { - // High resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Hr string `json:"hr,omitempty"` - - // Medium resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Mr string `json:"mr,omitempty"` - - // Low resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Lr string `json:"lr,omitempty"` -} - -// Validate validates this change agent params body RDS exporter metrics resolutions -func (o *ChangeAgentParamsBodyRDSExporterMetricsResolutions) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this change agent params body RDS exporter metrics resolutions based on context it is used -func (o *ChangeAgentParamsBodyRDSExporterMetricsResolutions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeAgentParamsBodyRDSExporterMetricsResolutions) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeAgentParamsBodyRDSExporterMetricsResolutions) UnmarshalBinary(b []byte) error { - var res ChangeAgentParamsBodyRDSExporterMetricsResolutions - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeAgentParamsBodyValkeyExporter change agent params body valkey exporter -swagger:model ChangeAgentParamsBodyValkeyExporter -*/ -type ChangeAgentParamsBodyValkeyExporter struct { - // Enable this Agent. Agents are enabled by default when they get added. - Enable *bool `json:"enable,omitempty"` - - // Enables push metrics with vmagent. - EnablePushMetrics *bool `json:"enable_push_metrics,omitempty"` - - // custom labels - CustomLabels *ChangeAgentParamsBodyValkeyExporterCustomLabels `json:"custom_labels,omitempty"` - - // metrics resolutions - MetricsResolutions *ChangeAgentParamsBodyValkeyExporterMetricsResolutions `json:"metrics_resolutions,omitempty"` -} - -// Validate validates this change agent params body valkey exporter -func (o *ChangeAgentParamsBodyValkeyExporter) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateCustomLabels(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 -} - -func (o *ChangeAgentParamsBodyValkeyExporter) validateCustomLabels(formats strfmt.Registry) error { - if swag.IsZero(o.CustomLabels) { // not required - return nil - } - - if o.CustomLabels != nil { - if err := o.CustomLabels.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "valkey_exporter" + "." + "custom_labels") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "valkey_exporter" + "." + "custom_labels") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentParamsBodyValkeyExporter) 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("body" + "." + "valkey_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "valkey_exporter" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this change agent params body valkey exporter based on the context it is used -func (o *ChangeAgentParamsBodyValkeyExporter) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateCustomLabels(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateMetricsResolutions(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ChangeAgentParamsBodyValkeyExporter) contextValidateCustomLabels(ctx context.Context, formats strfmt.Registry) error { - if o.CustomLabels != nil { - - if swag.IsZero(o.CustomLabels) { // not required - return nil - } - - if err := o.CustomLabels.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "valkey_exporter" + "." + "custom_labels") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "valkey_exporter" + "." + "custom_labels") - } - - return err - } - } - - return nil -} - -func (o *ChangeAgentParamsBodyValkeyExporter) 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 { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "valkey_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "valkey_exporter" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeAgentParamsBodyValkeyExporter) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeAgentParamsBodyValkeyExporter) UnmarshalBinary(b []byte) error { - var res ChangeAgentParamsBodyValkeyExporter - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeAgentParamsBodyValkeyExporterCustomLabels A wrapper for map[string]string. This type allows to distinguish between an empty map and a null value. -swagger:model ChangeAgentParamsBodyValkeyExporterCustomLabels -*/ -type ChangeAgentParamsBodyValkeyExporterCustomLabels struct { - // values - Values map[string]string `json:"values,omitempty"` -} - -// Validate validates this change agent params body valkey exporter custom labels -func (o *ChangeAgentParamsBodyValkeyExporterCustomLabels) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this change agent params body valkey exporter custom labels based on context it is used -func (o *ChangeAgentParamsBodyValkeyExporterCustomLabels) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeAgentParamsBodyValkeyExporterCustomLabels) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeAgentParamsBodyValkeyExporterCustomLabels) UnmarshalBinary(b []byte) error { - var res ChangeAgentParamsBodyValkeyExporterCustomLabels - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeAgentParamsBodyValkeyExporterMetricsResolutions MetricsResolutions represents Prometheus exporters metrics resolutions. -swagger:model ChangeAgentParamsBodyValkeyExporterMetricsResolutions -*/ -type ChangeAgentParamsBodyValkeyExporterMetricsResolutions struct { - // High resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Hr string `json:"hr,omitempty"` - - // Medium resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Mr string `json:"mr,omitempty"` - - // Low resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Lr string `json:"lr,omitempty"` -} - -// Validate validates this change agent params body valkey exporter metrics resolutions -func (o *ChangeAgentParamsBodyValkeyExporterMetricsResolutions) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this change agent params body valkey exporter metrics resolutions based on context it is used -func (o *ChangeAgentParamsBodyValkeyExporterMetricsResolutions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeAgentParamsBodyValkeyExporterMetricsResolutions) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeAgentParamsBodyValkeyExporterMetricsResolutions) UnmarshalBinary(b []byte) error { - var res ChangeAgentParamsBodyValkeyExporterMetricsResolutions - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/inventory/v1/json/client/agents_service/get_agent_logs_parameters.go b/api/inventory/v1/json/client/agents_service/get_agent_logs_parameters.go deleted file mode 100644 index 97651a5eab8..00000000000 --- a/api/inventory/v1/json/client/agents_service/get_agent_logs_parameters.go +++ /dev/null @@ -1,185 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package agents_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" - "github.com/go-openapi/swag" -) - -// NewGetAgentLogsParams creates a new GetAgentLogsParams 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 NewGetAgentLogsParams() *GetAgentLogsParams { - return &GetAgentLogsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetAgentLogsParamsWithTimeout creates a new GetAgentLogsParams object -// with the ability to set a timeout on a request. -func NewGetAgentLogsParamsWithTimeout(timeout time.Duration) *GetAgentLogsParams { - return &GetAgentLogsParams{ - timeout: timeout, - } -} - -// NewGetAgentLogsParamsWithContext creates a new GetAgentLogsParams object -// with the ability to set a context for a request. -func NewGetAgentLogsParamsWithContext(ctx context.Context) *GetAgentLogsParams { - return &GetAgentLogsParams{ - Context: ctx, - } -} - -// NewGetAgentLogsParamsWithHTTPClient creates a new GetAgentLogsParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetAgentLogsParamsWithHTTPClient(client *http.Client) *GetAgentLogsParams { - return &GetAgentLogsParams{ - HTTPClient: client, - } -} - -/* -GetAgentLogsParams contains all the parameters to send to the API endpoint - - for the get agent logs operation. - - Typically these are written to a http.Request. -*/ -type GetAgentLogsParams struct { - /* AgentID. - - Unique randomly generated instance identifier. - */ - AgentID string - - /* Limit. - - Limit the number of log lines to this value. Pass 0 for no limit. - - Format: int64 - */ - Limit *int64 - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get agent logs params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetAgentLogsParams) WithDefaults() *GetAgentLogsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get agent logs params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetAgentLogsParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the get agent logs params -func (o *GetAgentLogsParams) WithTimeout(timeout time.Duration) *GetAgentLogsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get agent logs params -func (o *GetAgentLogsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get agent logs params -func (o *GetAgentLogsParams) WithContext(ctx context.Context) *GetAgentLogsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get agent logs params -func (o *GetAgentLogsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get agent logs params -func (o *GetAgentLogsParams) WithHTTPClient(client *http.Client) *GetAgentLogsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get agent logs params -func (o *GetAgentLogsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithAgentID adds the agentID to the get agent logs params -func (o *GetAgentLogsParams) WithAgentID(agentID string) *GetAgentLogsParams { - o.SetAgentID(agentID) - return o -} - -// SetAgentID adds the agentId to the get agent logs params -func (o *GetAgentLogsParams) SetAgentID(agentID string) { - o.AgentID = agentID -} - -// WithLimit adds the limit to the get agent logs params -func (o *GetAgentLogsParams) WithLimit(limit *int64) *GetAgentLogsParams { - o.SetLimit(limit) - return o -} - -// SetLimit adds the limit to the get agent logs params -func (o *GetAgentLogsParams) SetLimit(limit *int64) { - o.Limit = limit -} - -// WriteToRequest writes these params to a swagger request -func (o *GetAgentLogsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param agent_id - if err := r.SetPathParam("agent_id", o.AgentID); err != nil { - return err - } - - if o.Limit != nil { - - // query param limit - var qrLimit int64 - - if o.Limit != nil { - qrLimit = *o.Limit - } - qLimit := swag.FormatInt64(qrLimit) - if qLimit != "" { - if err := r.SetQueryParam("limit", qLimit); err != nil { - return err - } - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/api/inventory/v1/json/client/agents_service/get_agent_logs_responses.go b/api/inventory/v1/json/client/agents_service/get_agent_logs_responses.go deleted file mode 100644 index 4925d51c520..00000000000 --- a/api/inventory/v1/json/client/agents_service/get_agent_logs_responses.go +++ /dev/null @@ -1,456 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package agents_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" -) - -// GetAgentLogsReader is a Reader for the GetAgentLogs structure. -type GetAgentLogsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetAgentLogsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewGetAgentLogsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewGetAgentLogsDefault(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 - } -} - -// NewGetAgentLogsOK creates a GetAgentLogsOK with default headers values -func NewGetAgentLogsOK() *GetAgentLogsOK { - return &GetAgentLogsOK{} -} - -/* -GetAgentLogsOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type GetAgentLogsOK struct { - Payload *GetAgentLogsOKBody -} - -// IsSuccess returns true when this get agent logs Ok response has a 2xx status code -func (o *GetAgentLogsOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this get agent logs Ok response has a 3xx status code -func (o *GetAgentLogsOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this get agent logs Ok response has a 4xx status code -func (o *GetAgentLogsOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this get agent logs Ok response has a 5xx status code -func (o *GetAgentLogsOK) IsServerError() bool { - return false -} - -// IsCode returns true when this get agent logs Ok response a status code equal to that given -func (o *GetAgentLogsOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the get agent logs Ok response -func (o *GetAgentLogsOK) Code() int { - return 200 -} - -func (o *GetAgentLogsOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/inventory/agents/{agent_id}/logs][%d] getAgentLogsOk %s", 200, payload) -} - -func (o *GetAgentLogsOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/inventory/agents/{agent_id}/logs][%d] getAgentLogsOk %s", 200, payload) -} - -func (o *GetAgentLogsOK) GetPayload() *GetAgentLogsOKBody { - return o.Payload -} - -func (o *GetAgentLogsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(GetAgentLogsOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -// NewGetAgentLogsDefault creates a GetAgentLogsDefault with default headers values -func NewGetAgentLogsDefault(code int) *GetAgentLogsDefault { - return &GetAgentLogsDefault{ - _statusCode: code, - } -} - -/* -GetAgentLogsDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type GetAgentLogsDefault struct { - _statusCode int - - Payload *GetAgentLogsDefaultBody -} - -// IsSuccess returns true when this get agent logs default response has a 2xx status code -func (o *GetAgentLogsDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this get agent logs default response has a 3xx status code -func (o *GetAgentLogsDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this get agent logs default response has a 4xx status code -func (o *GetAgentLogsDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this get agent logs default response has a 5xx status code -func (o *GetAgentLogsDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this get agent logs default response a status code equal to that given -func (o *GetAgentLogsDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the get agent logs default response -func (o *GetAgentLogsDefault) Code() int { - return o._statusCode -} - -func (o *GetAgentLogsDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/inventory/agents/{agent_id}/logs][%d] GetAgentLogs default %s", o._statusCode, payload) -} - -func (o *GetAgentLogsDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/inventory/agents/{agent_id}/logs][%d] GetAgentLogs default %s", o._statusCode, payload) -} - -func (o *GetAgentLogsDefault) GetPayload() *GetAgentLogsDefaultBody { - return o.Payload -} - -func (o *GetAgentLogsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(GetAgentLogsDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -GetAgentLogsDefaultBody get agent logs default body -swagger:model GetAgentLogsDefaultBody -*/ -type GetAgentLogsDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*GetAgentLogsDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this get agent logs default body -func (o *GetAgentLogsDefaultBody) 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 *GetAgentLogsDefaultBody) 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("GetAgentLogs default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("GetAgentLogs default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this get agent logs default body based on the context it is used -func (o *GetAgentLogsDefaultBody) 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 *GetAgentLogsDefaultBody) 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("GetAgentLogs default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("GetAgentLogs default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetAgentLogsDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetAgentLogsDefaultBody) UnmarshalBinary(b []byte) error { - var res GetAgentLogsDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetAgentLogsDefaultBodyDetailsItems0 get agent logs default body details items0 -swagger:model GetAgentLogsDefaultBodyDetailsItems0 -*/ -type GetAgentLogsDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` - - // get agent logs default body details items0 - GetAgentLogsDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *GetAgentLogsDefaultBodyDetailsItems0) 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 GetAgentLogsDefaultBodyDetailsItems0 - - 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.GetAgentLogsDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o GetAgentLogsDefaultBodyDetailsItems0) 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.GetAgentLogsDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.GetAgentLogsDefaultBodyDetailsItems0) - 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 get agent logs default body details items0 -func (o *GetAgentLogsDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get agent logs default body details items0 based on context it is used -func (o *GetAgentLogsDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetAgentLogsDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetAgentLogsDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res GetAgentLogsDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetAgentLogsOKBody get agent logs OK body -swagger:model GetAgentLogsOKBody -*/ -type GetAgentLogsOKBody struct { - // logs - Logs []string `json:"logs"` - - // agent config log lines count - AgentConfigLogLinesCount int64 `json:"agent_config_log_lines_count,omitempty"` -} - -// Validate validates this get agent logs OK body -func (o *GetAgentLogsOKBody) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get agent logs OK body based on context it is used -func (o *GetAgentLogsOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetAgentLogsOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetAgentLogsOKBody) UnmarshalBinary(b []byte) error { - var res GetAgentLogsOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/inventory/v1/json/client/agents_service/get_agent_parameters.go b/api/inventory/v1/json/client/agents_service/get_agent_parameters.go deleted file mode 100644 index 05cb31a609f..00000000000 --- a/api/inventory/v1/json/client/agents_service/get_agent_parameters.go +++ /dev/null @@ -1,149 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package agents_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" -) - -// NewGetAgentParams creates a new GetAgentParams 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 NewGetAgentParams() *GetAgentParams { - return &GetAgentParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetAgentParamsWithTimeout creates a new GetAgentParams object -// with the ability to set a timeout on a request. -func NewGetAgentParamsWithTimeout(timeout time.Duration) *GetAgentParams { - return &GetAgentParams{ - timeout: timeout, - } -} - -// NewGetAgentParamsWithContext creates a new GetAgentParams object -// with the ability to set a context for a request. -func NewGetAgentParamsWithContext(ctx context.Context) *GetAgentParams { - return &GetAgentParams{ - Context: ctx, - } -} - -// NewGetAgentParamsWithHTTPClient creates a new GetAgentParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetAgentParamsWithHTTPClient(client *http.Client) *GetAgentParams { - return &GetAgentParams{ - HTTPClient: client, - } -} - -/* -GetAgentParams contains all the parameters to send to the API endpoint - - for the get agent operation. - - Typically these are written to a http.Request. -*/ -type GetAgentParams struct { - /* AgentID. - - Unique randomly generated instance identifier. - */ - AgentID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get agent params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetAgentParams) WithDefaults() *GetAgentParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get agent params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetAgentParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the get agent params -func (o *GetAgentParams) WithTimeout(timeout time.Duration) *GetAgentParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get agent params -func (o *GetAgentParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get agent params -func (o *GetAgentParams) WithContext(ctx context.Context) *GetAgentParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get agent params -func (o *GetAgentParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get agent params -func (o *GetAgentParams) WithHTTPClient(client *http.Client) *GetAgentParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get agent params -func (o *GetAgentParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithAgentID adds the agentID to the get agent params -func (o *GetAgentParams) WithAgentID(agentID string) *GetAgentParams { - o.SetAgentID(agentID) - return o -} - -// SetAgentID adds the agentId to the get agent params -func (o *GetAgentParams) SetAgentID(agentID string) { - o.AgentID = agentID -} - -// WriteToRequest writes these params to a swagger request -func (o *GetAgentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param agent_id - if err := r.SetPathParam("agent_id", o.AgentID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/api/inventory/v1/json/client/agents_service/get_agent_responses.go b/api/inventory/v1/json/client/agents_service/get_agent_responses.go deleted file mode 100644 index a96ef2c1ae8..00000000000 --- a/api/inventory/v1/json/client/agents_service/get_agent_responses.go +++ /dev/null @@ -1,5839 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package agents_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" -) - -// GetAgentReader is a Reader for the GetAgent structure. -type GetAgentReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetAgentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewGetAgentOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewGetAgentDefault(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 - } -} - -// NewGetAgentOK creates a GetAgentOK with default headers values -func NewGetAgentOK() *GetAgentOK { - return &GetAgentOK{} -} - -/* -GetAgentOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type GetAgentOK struct { - Payload *GetAgentOKBody -} - -// IsSuccess returns true when this get agent Ok response has a 2xx status code -func (o *GetAgentOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this get agent Ok response has a 3xx status code -func (o *GetAgentOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this get agent Ok response has a 4xx status code -func (o *GetAgentOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this get agent Ok response has a 5xx status code -func (o *GetAgentOK) IsServerError() bool { - return false -} - -// IsCode returns true when this get agent Ok response a status code equal to that given -func (o *GetAgentOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the get agent Ok response -func (o *GetAgentOK) Code() int { - return 200 -} - -func (o *GetAgentOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/inventory/agents/{agent_id}][%d] getAgentOk %s", 200, payload) -} - -func (o *GetAgentOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/inventory/agents/{agent_id}][%d] getAgentOk %s", 200, payload) -} - -func (o *GetAgentOK) GetPayload() *GetAgentOKBody { - return o.Payload -} - -func (o *GetAgentOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(GetAgentOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -// NewGetAgentDefault creates a GetAgentDefault with default headers values -func NewGetAgentDefault(code int) *GetAgentDefault { - return &GetAgentDefault{ - _statusCode: code, - } -} - -/* -GetAgentDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type GetAgentDefault struct { - _statusCode int - - Payload *GetAgentDefaultBody -} - -// IsSuccess returns true when this get agent default response has a 2xx status code -func (o *GetAgentDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this get agent default response has a 3xx status code -func (o *GetAgentDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this get agent default response has a 4xx status code -func (o *GetAgentDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this get agent default response has a 5xx status code -func (o *GetAgentDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this get agent default response a status code equal to that given -func (o *GetAgentDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the get agent default response -func (o *GetAgentDefault) Code() int { - return o._statusCode -} - -func (o *GetAgentDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/inventory/agents/{agent_id}][%d] GetAgent default %s", o._statusCode, payload) -} - -func (o *GetAgentDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/inventory/agents/{agent_id}][%d] GetAgent default %s", o._statusCode, payload) -} - -func (o *GetAgentDefault) GetPayload() *GetAgentDefaultBody { - return o.Payload -} - -func (o *GetAgentDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(GetAgentDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -GetAgentDefaultBody get agent default body -swagger:model GetAgentDefaultBody -*/ -type GetAgentDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*GetAgentDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this get agent default body -func (o *GetAgentDefaultBody) 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 *GetAgentDefaultBody) 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("GetAgent default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("GetAgent default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this get agent default body based on the context it is used -func (o *GetAgentDefaultBody) 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 *GetAgentDefaultBody) 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("GetAgent default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("GetAgent default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetAgentDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetAgentDefaultBody) UnmarshalBinary(b []byte) error { - var res GetAgentDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetAgentDefaultBodyDetailsItems0 get agent default body details items0 -swagger:model GetAgentDefaultBodyDetailsItems0 -*/ -type GetAgentDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` - - // get agent default body details items0 - GetAgentDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *GetAgentDefaultBodyDetailsItems0) 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 GetAgentDefaultBodyDetailsItems0 - - 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.GetAgentDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o GetAgentDefaultBodyDetailsItems0) 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.GetAgentDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.GetAgentDefaultBodyDetailsItems0) - 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 get agent default body details items0 -func (o *GetAgentDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get agent default body details items0 based on context it is used -func (o *GetAgentDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetAgentDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetAgentDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res GetAgentDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetAgentOKBody get agent OK body -swagger:model GetAgentOKBody -*/ -type GetAgentOKBody struct { - // azure database exporter - AzureDatabaseExporter *GetAgentOKBodyAzureDatabaseExporter `json:"azure_database_exporter,omitempty"` - - // external exporter - ExternalExporter *GetAgentOKBodyExternalExporter `json:"external_exporter,omitempty"` - - // mongodb exporter - MongodbExporter *GetAgentOKBodyMongodbExporter `json:"mongodb_exporter,omitempty"` - - // mysqld exporter - MysqldExporter *GetAgentOKBodyMysqldExporter `json:"mysqld_exporter,omitempty"` - - // node exporter - NodeExporter *GetAgentOKBodyNodeExporter `json:"node_exporter,omitempty"` - - // nomad agent - NomadAgent *GetAgentOKBodyNomadAgent `json:"nomad_agent,omitempty"` - - // pmm agent - PMMAgent *GetAgentOKBodyPMMAgent `json:"pmm_agent,omitempty"` - - // postgres exporter - PostgresExporter *GetAgentOKBodyPostgresExporter `json:"postgres_exporter,omitempty"` - - // proxysql exporter - ProxysqlExporter *GetAgentOKBodyProxysqlExporter `json:"proxysql_exporter,omitempty"` - - // qan mongodb mongolog agent - QANMongodbMongologAgent *GetAgentOKBodyQANMongodbMongologAgent `json:"qan_mongodb_mongolog_agent,omitempty"` - - // qan mongodb profiler agent - QANMongodbProfilerAgent *GetAgentOKBodyQANMongodbProfilerAgent `json:"qan_mongodb_profiler_agent,omitempty"` - - // qan mysql perfschema agent - QANMysqlPerfschemaAgent *GetAgentOKBodyQANMysqlPerfschemaAgent `json:"qan_mysql_perfschema_agent,omitempty"` - - // qan mysql slowlog agent - QANMysqlSlowlogAgent *GetAgentOKBodyQANMysqlSlowlogAgent `json:"qan_mysql_slowlog_agent,omitempty"` - - // qan postgresql pgstatements agent - QANPostgresqlPgstatementsAgent *GetAgentOKBodyQANPostgresqlPgstatementsAgent `json:"qan_postgresql_pgstatements_agent,omitempty"` - - // qan postgresql pgstatmonitor agent - QANPostgresqlPgstatmonitorAgent *GetAgentOKBodyQANPostgresqlPgstatmonitorAgent `json:"qan_postgresql_pgstatmonitor_agent,omitempty"` - - // rds exporter - RDSExporter *GetAgentOKBodyRDSExporter `json:"rds_exporter,omitempty"` - - // valkey exporter - ValkeyExporter *GetAgentOKBodyValkeyExporter `json:"valkey_exporter,omitempty"` - - // vmagent - Vmagent *GetAgentOKBodyVmagent `json:"vmagent,omitempty"` -} - -// Validate validates this get agent OK body -func (o *GetAgentOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateAzureDatabaseExporter(formats); err != nil { - res = append(res, err) - } - - if err := o.validateExternalExporter(formats); err != nil { - res = append(res, err) - } - - if err := o.validateMongodbExporter(formats); err != nil { - res = append(res, err) - } - - if err := o.validateMysqldExporter(formats); err != nil { - res = append(res, err) - } - - if err := o.validateNodeExporter(formats); err != nil { - res = append(res, err) - } - - if err := o.validateNomadAgent(formats); err != nil { - res = append(res, err) - } - - if err := o.validatePMMAgent(formats); err != nil { - res = append(res, err) - } - - if err := o.validatePostgresExporter(formats); err != nil { - res = append(res, err) - } - - if err := o.validateProxysqlExporter(formats); err != nil { - res = append(res, err) - } - - if err := o.validateQANMongodbMongologAgent(formats); err != nil { - res = append(res, err) - } - - if err := o.validateQANMongodbProfilerAgent(formats); err != nil { - res = append(res, err) - } - - if err := o.validateQANMysqlPerfschemaAgent(formats); err != nil { - res = append(res, err) - } - - if err := o.validateQANMysqlSlowlogAgent(formats); err != nil { - res = append(res, err) - } - - if err := o.validateQANPostgresqlPgstatementsAgent(formats); err != nil { - res = append(res, err) - } - - if err := o.validateQANPostgresqlPgstatmonitorAgent(formats); err != nil { - res = append(res, err) - } - - if err := o.validateRDSExporter(formats); err != nil { - res = append(res, err) - } - - if err := o.validateValkeyExporter(formats); err != nil { - res = append(res, err) - } - - if err := o.validateVmagent(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetAgentOKBody) validateAzureDatabaseExporter(formats strfmt.Registry) error { - if swag.IsZero(o.AzureDatabaseExporter) { // not required - return nil - } - - if o.AzureDatabaseExporter != nil { - if err := o.AzureDatabaseExporter.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getAgentOk" + "." + "azure_database_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getAgentOk" + "." + "azure_database_exporter") - } - - return err - } - } - - return nil -} - -func (o *GetAgentOKBody) validateExternalExporter(formats strfmt.Registry) error { - if swag.IsZero(o.ExternalExporter) { // not required - return nil - } - - if o.ExternalExporter != nil { - if err := o.ExternalExporter.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getAgentOk" + "." + "external_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getAgentOk" + "." + "external_exporter") - } - - return err - } - } - - return nil -} - -func (o *GetAgentOKBody) validateMongodbExporter(formats strfmt.Registry) error { - if swag.IsZero(o.MongodbExporter) { // not required - return nil - } - - if o.MongodbExporter != nil { - if err := o.MongodbExporter.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getAgentOk" + "." + "mongodb_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getAgentOk" + "." + "mongodb_exporter") - } - - return err - } - } - - return nil -} - -func (o *GetAgentOKBody) validateMysqldExporter(formats strfmt.Registry) error { - if swag.IsZero(o.MysqldExporter) { // not required - return nil - } - - if o.MysqldExporter != nil { - if err := o.MysqldExporter.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getAgentOk" + "." + "mysqld_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getAgentOk" + "." + "mysqld_exporter") - } - - return err - } - } - - return nil -} - -func (o *GetAgentOKBody) validateNodeExporter(formats strfmt.Registry) error { - if swag.IsZero(o.NodeExporter) { // not required - return nil - } - - if o.NodeExporter != nil { - if err := o.NodeExporter.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getAgentOk" + "." + "node_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getAgentOk" + "." + "node_exporter") - } - - return err - } - } - - return nil -} - -func (o *GetAgentOKBody) validateNomadAgent(formats strfmt.Registry) error { - if swag.IsZero(o.NomadAgent) { // not required - return nil - } - - if o.NomadAgent != nil { - if err := o.NomadAgent.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getAgentOk" + "." + "nomad_agent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getAgentOk" + "." + "nomad_agent") - } - - return err - } - } - - return nil -} - -func (o *GetAgentOKBody) validatePMMAgent(formats strfmt.Registry) error { - if swag.IsZero(o.PMMAgent) { // not required - return nil - } - - if o.PMMAgent != nil { - if err := o.PMMAgent.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getAgentOk" + "." + "pmm_agent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getAgentOk" + "." + "pmm_agent") - } - - return err - } - } - - return nil -} - -func (o *GetAgentOKBody) validatePostgresExporter(formats strfmt.Registry) error { - if swag.IsZero(o.PostgresExporter) { // not required - return nil - } - - if o.PostgresExporter != nil { - if err := o.PostgresExporter.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getAgentOk" + "." + "postgres_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getAgentOk" + "." + "postgres_exporter") - } - - return err - } - } - - return nil -} - -func (o *GetAgentOKBody) validateProxysqlExporter(formats strfmt.Registry) error { - if swag.IsZero(o.ProxysqlExporter) { // not required - return nil - } - - if o.ProxysqlExporter != nil { - if err := o.ProxysqlExporter.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getAgentOk" + "." + "proxysql_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getAgentOk" + "." + "proxysql_exporter") - } - - return err - } - } - - return nil -} - -func (o *GetAgentOKBody) validateQANMongodbMongologAgent(formats strfmt.Registry) error { - if swag.IsZero(o.QANMongodbMongologAgent) { // not required - return nil - } - - if o.QANMongodbMongologAgent != nil { - if err := o.QANMongodbMongologAgent.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getAgentOk" + "." + "qan_mongodb_mongolog_agent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getAgentOk" + "." + "qan_mongodb_mongolog_agent") - } - - return err - } - } - - return nil -} - -func (o *GetAgentOKBody) validateQANMongodbProfilerAgent(formats strfmt.Registry) error { - if swag.IsZero(o.QANMongodbProfilerAgent) { // not required - return nil - } - - if o.QANMongodbProfilerAgent != nil { - if err := o.QANMongodbProfilerAgent.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getAgentOk" + "." + "qan_mongodb_profiler_agent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getAgentOk" + "." + "qan_mongodb_profiler_agent") - } - - return err - } - } - - return nil -} - -func (o *GetAgentOKBody) validateQANMysqlPerfschemaAgent(formats strfmt.Registry) error { - if swag.IsZero(o.QANMysqlPerfschemaAgent) { // not required - return nil - } - - if o.QANMysqlPerfschemaAgent != nil { - if err := o.QANMysqlPerfschemaAgent.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getAgentOk" + "." + "qan_mysql_perfschema_agent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getAgentOk" + "." + "qan_mysql_perfschema_agent") - } - - return err - } - } - - return nil -} - -func (o *GetAgentOKBody) validateQANMysqlSlowlogAgent(formats strfmt.Registry) error { - if swag.IsZero(o.QANMysqlSlowlogAgent) { // not required - return nil - } - - if o.QANMysqlSlowlogAgent != nil { - if err := o.QANMysqlSlowlogAgent.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getAgentOk" + "." + "qan_mysql_slowlog_agent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getAgentOk" + "." + "qan_mysql_slowlog_agent") - } - - return err - } - } - - return nil -} - -func (o *GetAgentOKBody) validateQANPostgresqlPgstatementsAgent(formats strfmt.Registry) error { - if swag.IsZero(o.QANPostgresqlPgstatementsAgent) { // not required - return nil - } - - if o.QANPostgresqlPgstatementsAgent != nil { - if err := o.QANPostgresqlPgstatementsAgent.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getAgentOk" + "." + "qan_postgresql_pgstatements_agent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getAgentOk" + "." + "qan_postgresql_pgstatements_agent") - } - - return err - } - } - - return nil -} - -func (o *GetAgentOKBody) validateQANPostgresqlPgstatmonitorAgent(formats strfmt.Registry) error { - if swag.IsZero(o.QANPostgresqlPgstatmonitorAgent) { // not required - return nil - } - - if o.QANPostgresqlPgstatmonitorAgent != nil { - if err := o.QANPostgresqlPgstatmonitorAgent.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getAgentOk" + "." + "qan_postgresql_pgstatmonitor_agent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getAgentOk" + "." + "qan_postgresql_pgstatmonitor_agent") - } - - return err - } - } - - return nil -} - -func (o *GetAgentOKBody) validateRDSExporter(formats strfmt.Registry) error { - if swag.IsZero(o.RDSExporter) { // not required - return nil - } - - if o.RDSExporter != nil { - if err := o.RDSExporter.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getAgentOk" + "." + "rds_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getAgentOk" + "." + "rds_exporter") - } - - return err - } - } - - return nil -} - -func (o *GetAgentOKBody) validateValkeyExporter(formats strfmt.Registry) error { - if swag.IsZero(o.ValkeyExporter) { // not required - return nil - } - - if o.ValkeyExporter != nil { - if err := o.ValkeyExporter.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getAgentOk" + "." + "valkey_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getAgentOk" + "." + "valkey_exporter") - } - - return err - } - } - - return nil -} - -func (o *GetAgentOKBody) validateVmagent(formats strfmt.Registry) error { - if swag.IsZero(o.Vmagent) { // not required - return nil - } - - if o.Vmagent != nil { - if err := o.Vmagent.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getAgentOk" + "." + "vmagent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getAgentOk" + "." + "vmagent") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this get agent OK body based on the context it is used -func (o *GetAgentOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateAzureDatabaseExporter(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateExternalExporter(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateMongodbExporter(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateMysqldExporter(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateNodeExporter(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateNomadAgent(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidatePMMAgent(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidatePostgresExporter(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateProxysqlExporter(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateQANMongodbMongologAgent(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateQANMongodbProfilerAgent(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateQANMysqlPerfschemaAgent(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateQANMysqlSlowlogAgent(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateQANPostgresqlPgstatementsAgent(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateQANPostgresqlPgstatmonitorAgent(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateRDSExporter(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateValkeyExporter(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateVmagent(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetAgentOKBody) contextValidateAzureDatabaseExporter(ctx context.Context, formats strfmt.Registry) error { - if o.AzureDatabaseExporter != nil { - - if swag.IsZero(o.AzureDatabaseExporter) { // not required - return nil - } - - if err := o.AzureDatabaseExporter.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getAgentOk" + "." + "azure_database_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getAgentOk" + "." + "azure_database_exporter") - } - - return err - } - } - - return nil -} - -func (o *GetAgentOKBody) contextValidateExternalExporter(ctx context.Context, formats strfmt.Registry) error { - if o.ExternalExporter != nil { - - if swag.IsZero(o.ExternalExporter) { // not required - return nil - } - - if err := o.ExternalExporter.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getAgentOk" + "." + "external_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getAgentOk" + "." + "external_exporter") - } - - return err - } - } - - return nil -} - -func (o *GetAgentOKBody) contextValidateMongodbExporter(ctx context.Context, formats strfmt.Registry) error { - if o.MongodbExporter != nil { - - if swag.IsZero(o.MongodbExporter) { // not required - return nil - } - - if err := o.MongodbExporter.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getAgentOk" + "." + "mongodb_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getAgentOk" + "." + "mongodb_exporter") - } - - return err - } - } - - return nil -} - -func (o *GetAgentOKBody) contextValidateMysqldExporter(ctx context.Context, formats strfmt.Registry) error { - if o.MysqldExporter != nil { - - if swag.IsZero(o.MysqldExporter) { // not required - return nil - } - - if err := o.MysqldExporter.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getAgentOk" + "." + "mysqld_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getAgentOk" + "." + "mysqld_exporter") - } - - return err - } - } - - return nil -} - -func (o *GetAgentOKBody) contextValidateNodeExporter(ctx context.Context, formats strfmt.Registry) error { - if o.NodeExporter != nil { - - if swag.IsZero(o.NodeExporter) { // not required - return nil - } - - if err := o.NodeExporter.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getAgentOk" + "." + "node_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getAgentOk" + "." + "node_exporter") - } - - return err - } - } - - return nil -} - -func (o *GetAgentOKBody) contextValidateNomadAgent(ctx context.Context, formats strfmt.Registry) error { - if o.NomadAgent != nil { - - if swag.IsZero(o.NomadAgent) { // not required - return nil - } - - if err := o.NomadAgent.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getAgentOk" + "." + "nomad_agent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getAgentOk" + "." + "nomad_agent") - } - - return err - } - } - - return nil -} - -func (o *GetAgentOKBody) contextValidatePMMAgent(ctx context.Context, formats strfmt.Registry) error { - if o.PMMAgent != nil { - - if swag.IsZero(o.PMMAgent) { // not required - return nil - } - - if err := o.PMMAgent.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getAgentOk" + "." + "pmm_agent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getAgentOk" + "." + "pmm_agent") - } - - return err - } - } - - return nil -} - -func (o *GetAgentOKBody) contextValidatePostgresExporter(ctx context.Context, formats strfmt.Registry) error { - if o.PostgresExporter != nil { - - if swag.IsZero(o.PostgresExporter) { // not required - return nil - } - - if err := o.PostgresExporter.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getAgentOk" + "." + "postgres_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getAgentOk" + "." + "postgres_exporter") - } - - return err - } - } - - return nil -} - -func (o *GetAgentOKBody) contextValidateProxysqlExporter(ctx context.Context, formats strfmt.Registry) error { - if o.ProxysqlExporter != nil { - - if swag.IsZero(o.ProxysqlExporter) { // not required - return nil - } - - if err := o.ProxysqlExporter.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getAgentOk" + "." + "proxysql_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getAgentOk" + "." + "proxysql_exporter") - } - - return err - } - } - - return nil -} - -func (o *GetAgentOKBody) contextValidateQANMongodbMongologAgent(ctx context.Context, formats strfmt.Registry) error { - if o.QANMongodbMongologAgent != nil { - - if swag.IsZero(o.QANMongodbMongologAgent) { // not required - return nil - } - - if err := o.QANMongodbMongologAgent.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getAgentOk" + "." + "qan_mongodb_mongolog_agent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getAgentOk" + "." + "qan_mongodb_mongolog_agent") - } - - return err - } - } - - return nil -} - -func (o *GetAgentOKBody) contextValidateQANMongodbProfilerAgent(ctx context.Context, formats strfmt.Registry) error { - if o.QANMongodbProfilerAgent != nil { - - if swag.IsZero(o.QANMongodbProfilerAgent) { // not required - return nil - } - - if err := o.QANMongodbProfilerAgent.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getAgentOk" + "." + "qan_mongodb_profiler_agent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getAgentOk" + "." + "qan_mongodb_profiler_agent") - } - - return err - } - } - - return nil -} - -func (o *GetAgentOKBody) contextValidateQANMysqlPerfschemaAgent(ctx context.Context, formats strfmt.Registry) error { - if o.QANMysqlPerfschemaAgent != nil { - - if swag.IsZero(o.QANMysqlPerfschemaAgent) { // not required - return nil - } - - if err := o.QANMysqlPerfschemaAgent.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getAgentOk" + "." + "qan_mysql_perfschema_agent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getAgentOk" + "." + "qan_mysql_perfschema_agent") - } - - return err - } - } - - return nil -} - -func (o *GetAgentOKBody) contextValidateQANMysqlSlowlogAgent(ctx context.Context, formats strfmt.Registry) error { - if o.QANMysqlSlowlogAgent != nil { - - if swag.IsZero(o.QANMysqlSlowlogAgent) { // not required - return nil - } - - if err := o.QANMysqlSlowlogAgent.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getAgentOk" + "." + "qan_mysql_slowlog_agent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getAgentOk" + "." + "qan_mysql_slowlog_agent") - } - - return err - } - } - - return nil -} - -func (o *GetAgentOKBody) contextValidateQANPostgresqlPgstatementsAgent(ctx context.Context, formats strfmt.Registry) error { - if o.QANPostgresqlPgstatementsAgent != nil { - - if swag.IsZero(o.QANPostgresqlPgstatementsAgent) { // not required - return nil - } - - if err := o.QANPostgresqlPgstatementsAgent.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getAgentOk" + "." + "qan_postgresql_pgstatements_agent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getAgentOk" + "." + "qan_postgresql_pgstatements_agent") - } - - return err - } - } - - return nil -} - -func (o *GetAgentOKBody) contextValidateQANPostgresqlPgstatmonitorAgent(ctx context.Context, formats strfmt.Registry) error { - if o.QANPostgresqlPgstatmonitorAgent != nil { - - if swag.IsZero(o.QANPostgresqlPgstatmonitorAgent) { // not required - return nil - } - - if err := o.QANPostgresqlPgstatmonitorAgent.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getAgentOk" + "." + "qan_postgresql_pgstatmonitor_agent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getAgentOk" + "." + "qan_postgresql_pgstatmonitor_agent") - } - - return err - } - } - - return nil -} - -func (o *GetAgentOKBody) contextValidateRDSExporter(ctx context.Context, formats strfmt.Registry) error { - if o.RDSExporter != nil { - - if swag.IsZero(o.RDSExporter) { // not required - return nil - } - - if err := o.RDSExporter.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getAgentOk" + "." + "rds_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getAgentOk" + "." + "rds_exporter") - } - - return err - } - } - - return nil -} - -func (o *GetAgentOKBody) contextValidateValkeyExporter(ctx context.Context, formats strfmt.Registry) error { - if o.ValkeyExporter != nil { - - if swag.IsZero(o.ValkeyExporter) { // not required - return nil - } - - if err := o.ValkeyExporter.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getAgentOk" + "." + "valkey_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getAgentOk" + "." + "valkey_exporter") - } - - return err - } - } - - return nil -} - -func (o *GetAgentOKBody) contextValidateVmagent(ctx context.Context, formats strfmt.Registry) error { - if o.Vmagent != nil { - - if swag.IsZero(o.Vmagent) { // not required - return nil - } - - if err := o.Vmagent.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getAgentOk" + "." + "vmagent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getAgentOk" + "." + "vmagent") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetAgentOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetAgentOKBody) UnmarshalBinary(b []byte) error { - var res GetAgentOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetAgentOKBodyAzureDatabaseExporter AzureDatabaseExporter runs on Generic or Container Node and exposes RemoteAzure Node metrics. -swagger:model GetAgentOKBodyAzureDatabaseExporter -*/ -type GetAgentOKBodyAzureDatabaseExporter struct { - // Unique randomly generated instance identifier. - AgentID string `json:"agent_id,omitempty"` - - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `json:"disabled,omitempty"` - - // Node identifier. - NodeID string `json:"node_id,omitempty"` - - // Azure database subscription ID. - AzureDatabaseSubscriptionID string `json:"azure_database_subscription_id,omitempty"` - - // Azure database resource type (mysql, maria, postgres) - AzureDatabaseResourceType string `json:"azure_database_resource_type,omitempty"` - - // 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"` - - // True if the exporter operates in push metrics mode. - PushMetricsEnabled bool `json:"push_metrics_enabled,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"` - - // metrics resolutions - MetricsResolutions *GetAgentOKBodyAzureDatabaseExporterMetricsResolutions `json:"metrics_resolutions,omitempty"` -} - -// Validate validates this get agent OK body azure database exporter -func (o *GetAgentOKBodyAzureDatabaseExporter) 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 getAgentOkBodyAzureDatabaseExporterTypeStatusPropEnum []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 { - getAgentOkBodyAzureDatabaseExporterTypeStatusPropEnum = append(getAgentOkBodyAzureDatabaseExporterTypeStatusPropEnum, v) - } -} - -const ( - - // GetAgentOKBodyAzureDatabaseExporterStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - GetAgentOKBodyAzureDatabaseExporterStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // GetAgentOKBodyAzureDatabaseExporterStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - GetAgentOKBodyAzureDatabaseExporterStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // GetAgentOKBodyAzureDatabaseExporterStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - GetAgentOKBodyAzureDatabaseExporterStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - - // GetAgentOKBodyAzureDatabaseExporterStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - GetAgentOKBodyAzureDatabaseExporterStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - - // GetAgentOKBodyAzureDatabaseExporterStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - GetAgentOKBodyAzureDatabaseExporterStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - - // GetAgentOKBodyAzureDatabaseExporterStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - GetAgentOKBodyAzureDatabaseExporterStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" - - // GetAgentOKBodyAzureDatabaseExporterStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - GetAgentOKBodyAzureDatabaseExporterStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" - - // GetAgentOKBodyAzureDatabaseExporterStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - GetAgentOKBodyAzureDatabaseExporterStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" -) - -// prop value enum -func (o *GetAgentOKBodyAzureDatabaseExporter) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, getAgentOkBodyAzureDatabaseExporterTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *GetAgentOKBodyAzureDatabaseExporter) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required - return nil - } - - // value enum - if err := o.validateStatusEnum("getAgentOk"+"."+"azure_database_exporter"+"."+"status", "body", *o.Status); err != nil { - return err - } - - return nil -} - -var getAgentOkBodyAzureDatabaseExporterTypeLogLevelPropEnum []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 { - getAgentOkBodyAzureDatabaseExporterTypeLogLevelPropEnum = append(getAgentOkBodyAzureDatabaseExporterTypeLogLevelPropEnum, v) - } -} - -const ( - - // GetAgentOKBodyAzureDatabaseExporterLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - GetAgentOKBodyAzureDatabaseExporterLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // GetAgentOKBodyAzureDatabaseExporterLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - GetAgentOKBodyAzureDatabaseExporterLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // GetAgentOKBodyAzureDatabaseExporterLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - GetAgentOKBodyAzureDatabaseExporterLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // GetAgentOKBodyAzureDatabaseExporterLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - GetAgentOKBodyAzureDatabaseExporterLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // GetAgentOKBodyAzureDatabaseExporterLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - GetAgentOKBodyAzureDatabaseExporterLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // GetAgentOKBodyAzureDatabaseExporterLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - GetAgentOKBodyAzureDatabaseExporterLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -func (o *GetAgentOKBodyAzureDatabaseExporter) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, getAgentOkBodyAzureDatabaseExporterTypeLogLevelPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *GetAgentOKBodyAzureDatabaseExporter) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("getAgentOk"+"."+"azure_database_exporter"+"."+"log_level", "body", *o.LogLevel); err != nil { - return err - } - - return nil -} - -func (o *GetAgentOKBodyAzureDatabaseExporter) 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("getAgentOk" + "." + "azure_database_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getAgentOk" + "." + "azure_database_exporter" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this get agent OK body azure database exporter based on the context it is used -func (o *GetAgentOKBodyAzureDatabaseExporter) 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 *GetAgentOKBodyAzureDatabaseExporter) 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 { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getAgentOk" + "." + "azure_database_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getAgentOk" + "." + "azure_database_exporter" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetAgentOKBodyAzureDatabaseExporter) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetAgentOKBodyAzureDatabaseExporter) UnmarshalBinary(b []byte) error { - var res GetAgentOKBodyAzureDatabaseExporter - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetAgentOKBodyAzureDatabaseExporterMetricsResolutions MetricsResolutions represents Prometheus exporters metrics resolutions. -swagger:model GetAgentOKBodyAzureDatabaseExporterMetricsResolutions -*/ -type GetAgentOKBodyAzureDatabaseExporterMetricsResolutions struct { - // High resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Hr string `json:"hr,omitempty"` - - // Medium resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Mr string `json:"mr,omitempty"` - - // Low resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Lr string `json:"lr,omitempty"` -} - -// Validate validates this get agent OK body azure database exporter metrics resolutions -func (o *GetAgentOKBodyAzureDatabaseExporterMetricsResolutions) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get agent OK body azure database exporter metrics resolutions based on context it is used -func (o *GetAgentOKBodyAzureDatabaseExporterMetricsResolutions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetAgentOKBodyAzureDatabaseExporterMetricsResolutions) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetAgentOKBodyAzureDatabaseExporterMetricsResolutions) UnmarshalBinary(b []byte) error { - var res GetAgentOKBodyAzureDatabaseExporterMetricsResolutions - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetAgentOKBodyExternalExporter ExternalExporter runs on any Node type, including Remote Node. -swagger:model GetAgentOKBodyExternalExporter -*/ -type GetAgentOKBodyExternalExporter struct { - // Unique randomly generated instance identifier. - AgentID string `json:"agent_id,omitempty"` - - // Node identifier where this instance runs. - RunsOnNodeID string `json:"runs_on_node_id,omitempty"` - - // If disabled, metrics from this exporter will not be collected. - Disabled bool `json:"disabled,omitempty"` - - // Service identifier. - ServiceID string `json:"service_id,omitempty"` - - // HTTP basic auth username for collecting metrics. - Username string `json:"username,omitempty"` - - // Scheme to generate URI to exporter metrics endpoints. - Scheme string `json:"scheme,omitempty"` - - // Path under which metrics are exposed, used to generate URI. - MetricsPath string `json:"metrics_path,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // Listen port for scraping metrics. - ListenPort int64 `json:"listen_port,omitempty"` - - // True if exporter uses push metrics mode. - PushMetricsEnabled bool `json:"push_metrics_enabled,omitempty"` - - // Path to exec process. - ProcessExecPath string `json:"process_exec_path,omitempty"` - - // Skip TLS certificate and hostname verification. - TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - - // metrics resolutions - MetricsResolutions *GetAgentOKBodyExternalExporterMetricsResolutions `json:"metrics_resolutions,omitempty"` -} - -// Validate validates this get agent OK body external exporter -func (o *GetAgentOKBodyExternalExporter) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateMetricsResolutions(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetAgentOKBodyExternalExporter) 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("getAgentOk" + "." + "external_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getAgentOk" + "." + "external_exporter" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this get agent OK body external exporter based on the context it is used -func (o *GetAgentOKBodyExternalExporter) 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 *GetAgentOKBodyExternalExporter) 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 { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getAgentOk" + "." + "external_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getAgentOk" + "." + "external_exporter" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetAgentOKBodyExternalExporter) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetAgentOKBodyExternalExporter) UnmarshalBinary(b []byte) error { - var res GetAgentOKBodyExternalExporter - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetAgentOKBodyExternalExporterMetricsResolutions MetricsResolutions represents Prometheus exporters metrics resolutions. -swagger:model GetAgentOKBodyExternalExporterMetricsResolutions -*/ -type GetAgentOKBodyExternalExporterMetricsResolutions struct { - // High resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Hr string `json:"hr,omitempty"` - - // Medium resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Mr string `json:"mr,omitempty"` - - // Low resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Lr string `json:"lr,omitempty"` -} - -// Validate validates this get agent OK body external exporter metrics resolutions -func (o *GetAgentOKBodyExternalExporterMetricsResolutions) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get agent OK body external exporter metrics resolutions based on context it is used -func (o *GetAgentOKBodyExternalExporterMetricsResolutions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetAgentOKBodyExternalExporterMetricsResolutions) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetAgentOKBodyExternalExporterMetricsResolutions) UnmarshalBinary(b []byte) error { - var res GetAgentOKBodyExternalExporterMetricsResolutions - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetAgentOKBodyMongodbExporter MongoDBExporter runs on Generic or Container Node and exposes MongoDB Service metrics. -swagger:model GetAgentOKBodyMongodbExporter -*/ -type GetAgentOKBodyMongodbExporter struct { - // Unique randomly generated instance identifier. - AgentID string `json:"agent_id,omitempty"` - - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `json:"disabled,omitempty"` - - // Service identifier. - ServiceID string `json:"service_id,omitempty"` - - // MongoDB username for scraping metrics. - Username string `json:"username,omitempty"` - - // Use TLS for database connections. - TLS bool `json:"tls,omitempty"` - - // Skip TLS certificate and hostname validation. - TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // True if exporter uses push metrics mode. - PushMetricsEnabled bool `json:"push_metrics_enabled,omitempty"` - - // 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"` - - // 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. - EnableAllCollectors bool `json:"enable_all_collectors,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"` - - // Optionally expose the exporter process on all public interfaces - ExposeExporter bool `json:"expose_exporter,omitempty"` - - // metrics resolutions - MetricsResolutions *GetAgentOKBodyMongodbExporterMetricsResolutions `json:"metrics_resolutions,omitempty"` -} - -// Validate validates this get agent OK body mongodb exporter -func (o *GetAgentOKBodyMongodbExporter) 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 getAgentOkBodyMongodbExporterTypeStatusPropEnum []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 { - getAgentOkBodyMongodbExporterTypeStatusPropEnum = append(getAgentOkBodyMongodbExporterTypeStatusPropEnum, v) - } -} - -const ( - - // GetAgentOKBodyMongodbExporterStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - GetAgentOKBodyMongodbExporterStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // GetAgentOKBodyMongodbExporterStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - GetAgentOKBodyMongodbExporterStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // GetAgentOKBodyMongodbExporterStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - GetAgentOKBodyMongodbExporterStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - - // GetAgentOKBodyMongodbExporterStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - GetAgentOKBodyMongodbExporterStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - - // GetAgentOKBodyMongodbExporterStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - GetAgentOKBodyMongodbExporterStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - - // GetAgentOKBodyMongodbExporterStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - GetAgentOKBodyMongodbExporterStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" - - // GetAgentOKBodyMongodbExporterStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - GetAgentOKBodyMongodbExporterStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" - - // GetAgentOKBodyMongodbExporterStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - GetAgentOKBodyMongodbExporterStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" -) - -// prop value enum -func (o *GetAgentOKBodyMongodbExporter) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, getAgentOkBodyMongodbExporterTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *GetAgentOKBodyMongodbExporter) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required - return nil - } - - // value enum - if err := o.validateStatusEnum("getAgentOk"+"."+"mongodb_exporter"+"."+"status", "body", *o.Status); err != nil { - return err - } - - return nil -} - -var getAgentOkBodyMongodbExporterTypeLogLevelPropEnum []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 { - getAgentOkBodyMongodbExporterTypeLogLevelPropEnum = append(getAgentOkBodyMongodbExporterTypeLogLevelPropEnum, v) - } -} - -const ( - - // GetAgentOKBodyMongodbExporterLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - GetAgentOKBodyMongodbExporterLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // GetAgentOKBodyMongodbExporterLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - GetAgentOKBodyMongodbExporterLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // GetAgentOKBodyMongodbExporterLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - GetAgentOKBodyMongodbExporterLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // GetAgentOKBodyMongodbExporterLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - GetAgentOKBodyMongodbExporterLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // GetAgentOKBodyMongodbExporterLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - GetAgentOKBodyMongodbExporterLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // GetAgentOKBodyMongodbExporterLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - GetAgentOKBodyMongodbExporterLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -func (o *GetAgentOKBodyMongodbExporter) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, getAgentOkBodyMongodbExporterTypeLogLevelPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *GetAgentOKBodyMongodbExporter) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("getAgentOk"+"."+"mongodb_exporter"+"."+"log_level", "body", *o.LogLevel); err != nil { - return err - } - - return nil -} - -func (o *GetAgentOKBodyMongodbExporter) 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("getAgentOk" + "." + "mongodb_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getAgentOk" + "." + "mongodb_exporter" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this get agent OK body mongodb exporter based on the context it is used -func (o *GetAgentOKBodyMongodbExporter) 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 *GetAgentOKBodyMongodbExporter) 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 { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getAgentOk" + "." + "mongodb_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getAgentOk" + "." + "mongodb_exporter" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetAgentOKBodyMongodbExporter) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetAgentOKBodyMongodbExporter) UnmarshalBinary(b []byte) error { - var res GetAgentOKBodyMongodbExporter - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetAgentOKBodyMongodbExporterMetricsResolutions MetricsResolutions represents Prometheus exporters metrics resolutions. -swagger:model GetAgentOKBodyMongodbExporterMetricsResolutions -*/ -type GetAgentOKBodyMongodbExporterMetricsResolutions struct { - // High resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Hr string `json:"hr,omitempty"` - - // Medium resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Mr string `json:"mr,omitempty"` - - // Low resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Lr string `json:"lr,omitempty"` -} - -// Validate validates this get agent OK body mongodb exporter metrics resolutions -func (o *GetAgentOKBodyMongodbExporterMetricsResolutions) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get agent OK body mongodb exporter metrics resolutions based on context it is used -func (o *GetAgentOKBodyMongodbExporterMetricsResolutions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetAgentOKBodyMongodbExporterMetricsResolutions) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetAgentOKBodyMongodbExporterMetricsResolutions) UnmarshalBinary(b []byte) error { - var res GetAgentOKBodyMongodbExporterMetricsResolutions - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetAgentOKBodyMysqldExporter MySQLdExporter runs on Generic or Container Node and exposes MySQL Service metrics. -swagger:model GetAgentOKBodyMysqldExporter -*/ -type GetAgentOKBodyMysqldExporter struct { - // Unique randomly generated instance identifier. - AgentID string `json:"agent_id,omitempty"` - - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `json:"disabled,omitempty"` - - // Service identifier. - ServiceID string `json:"service_id,omitempty"` - - // MySQL username for scraping metrics. - Username string `json:"username,omitempty"` - - // Use TLS for database connections. - TLS bool `json:"tls,omitempty"` - - // Skip TLS certificate and hostname validation. - TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - - // Certificate Authority certificate chain. - TLSCa string `json:"tls_ca,omitempty"` - - // Client certificate. - TLSCert string `json:"tls_cert,omitempty"` - - // Password for decrypting tls_cert. - TLSKey string `json:"tls_key,omitempty"` - - // Tablestats group collectors are disabled if there are more than that number of tables. - // 0 means tablestats group collectors are always enabled (no limit). - // Negative value means tablestats group collectors are always disabled. - TablestatsGroupTableLimit int32 `json:"tablestats_group_table_limit,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // True if exporter uses push metrics mode. - PushMetricsEnabled bool `json:"push_metrics_enabled,omitempty"` - - // List of disabled collector names. - DisabledCollectors []string `json:"disabled_collectors"` - - // 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"` - - // True if tablestats group collectors are currently disabled. - TablestatsGroupDisabled bool `json:"tablestats_group_disabled,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"` - - // 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 *GetAgentOKBodyMysqldExporterMetricsResolutions `json:"metrics_resolutions,omitempty"` -} - -// Validate validates this get agent OK body mysqld exporter -func (o *GetAgentOKBodyMysqldExporter) 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 getAgentOkBodyMysqldExporterTypeStatusPropEnum []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 { - getAgentOkBodyMysqldExporterTypeStatusPropEnum = append(getAgentOkBodyMysqldExporterTypeStatusPropEnum, v) - } -} - -const ( - - // GetAgentOKBodyMysqldExporterStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - GetAgentOKBodyMysqldExporterStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // GetAgentOKBodyMysqldExporterStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - GetAgentOKBodyMysqldExporterStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // GetAgentOKBodyMysqldExporterStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - GetAgentOKBodyMysqldExporterStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - - // GetAgentOKBodyMysqldExporterStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - GetAgentOKBodyMysqldExporterStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - - // GetAgentOKBodyMysqldExporterStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - GetAgentOKBodyMysqldExporterStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - - // GetAgentOKBodyMysqldExporterStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - GetAgentOKBodyMysqldExporterStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" - - // GetAgentOKBodyMysqldExporterStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - GetAgentOKBodyMysqldExporterStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" - - // GetAgentOKBodyMysqldExporterStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - GetAgentOKBodyMysqldExporterStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" -) - -// prop value enum -func (o *GetAgentOKBodyMysqldExporter) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, getAgentOkBodyMysqldExporterTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *GetAgentOKBodyMysqldExporter) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required - return nil - } - - // value enum - if err := o.validateStatusEnum("getAgentOk"+"."+"mysqld_exporter"+"."+"status", "body", *o.Status); err != nil { - return err - } - - return nil -} - -var getAgentOkBodyMysqldExporterTypeLogLevelPropEnum []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 { - getAgentOkBodyMysqldExporterTypeLogLevelPropEnum = append(getAgentOkBodyMysqldExporterTypeLogLevelPropEnum, v) - } -} - -const ( - - // GetAgentOKBodyMysqldExporterLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - GetAgentOKBodyMysqldExporterLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // GetAgentOKBodyMysqldExporterLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - GetAgentOKBodyMysqldExporterLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // GetAgentOKBodyMysqldExporterLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - GetAgentOKBodyMysqldExporterLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // GetAgentOKBodyMysqldExporterLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - GetAgentOKBodyMysqldExporterLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // GetAgentOKBodyMysqldExporterLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - GetAgentOKBodyMysqldExporterLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // GetAgentOKBodyMysqldExporterLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - GetAgentOKBodyMysqldExporterLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -func (o *GetAgentOKBodyMysqldExporter) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, getAgentOkBodyMysqldExporterTypeLogLevelPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *GetAgentOKBodyMysqldExporter) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("getAgentOk"+"."+"mysqld_exporter"+"."+"log_level", "body", *o.LogLevel); err != nil { - return err - } - - return nil -} - -func (o *GetAgentOKBodyMysqldExporter) 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("getAgentOk" + "." + "mysqld_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getAgentOk" + "." + "mysqld_exporter" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this get agent OK body mysqld exporter based on the context it is used -func (o *GetAgentOKBodyMysqldExporter) 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 *GetAgentOKBodyMysqldExporter) 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 { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getAgentOk" + "." + "mysqld_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getAgentOk" + "." + "mysqld_exporter" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetAgentOKBodyMysqldExporter) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetAgentOKBodyMysqldExporter) UnmarshalBinary(b []byte) error { - var res GetAgentOKBodyMysqldExporter - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetAgentOKBodyMysqldExporterMetricsResolutions MetricsResolutions represents Prometheus exporters metrics resolutions. -swagger:model GetAgentOKBodyMysqldExporterMetricsResolutions -*/ -type GetAgentOKBodyMysqldExporterMetricsResolutions struct { - // High resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Hr string `json:"hr,omitempty"` - - // Medium resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Mr string `json:"mr,omitempty"` - - // Low resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Lr string `json:"lr,omitempty"` -} - -// Validate validates this get agent OK body mysqld exporter metrics resolutions -func (o *GetAgentOKBodyMysqldExporterMetricsResolutions) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get agent OK body mysqld exporter metrics resolutions based on context it is used -func (o *GetAgentOKBodyMysqldExporterMetricsResolutions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetAgentOKBodyMysqldExporterMetricsResolutions) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetAgentOKBodyMysqldExporterMetricsResolutions) UnmarshalBinary(b []byte) error { - var res GetAgentOKBodyMysqldExporterMetricsResolutions - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetAgentOKBodyNodeExporter NodeExporter runs on Generic or Container Node and exposes its metrics. -swagger:model GetAgentOKBodyNodeExporter -*/ -type GetAgentOKBodyNodeExporter struct { - // Unique randomly generated instance identifier. - AgentID string `json:"agent_id,omitempty"` - - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `json:"disabled,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // True if exporter uses push metrics mode. - PushMetricsEnabled bool `json:"push_metrics_enabled,omitempty"` - - // 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"` - - // Optionally expose the exporter process on all public interfaces - ExposeExporter bool `json:"expose_exporter,omitempty"` - - // metrics resolutions - MetricsResolutions *GetAgentOKBodyNodeExporterMetricsResolutions `json:"metrics_resolutions,omitempty"` -} - -// Validate validates this get agent OK body node exporter -func (o *GetAgentOKBodyNodeExporter) 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 getAgentOkBodyNodeExporterTypeStatusPropEnum []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 { - getAgentOkBodyNodeExporterTypeStatusPropEnum = append(getAgentOkBodyNodeExporterTypeStatusPropEnum, v) - } -} - -const ( - - // GetAgentOKBodyNodeExporterStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - GetAgentOKBodyNodeExporterStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // GetAgentOKBodyNodeExporterStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - GetAgentOKBodyNodeExporterStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // GetAgentOKBodyNodeExporterStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - GetAgentOKBodyNodeExporterStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - - // GetAgentOKBodyNodeExporterStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - GetAgentOKBodyNodeExporterStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - - // GetAgentOKBodyNodeExporterStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - GetAgentOKBodyNodeExporterStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - - // GetAgentOKBodyNodeExporterStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - GetAgentOKBodyNodeExporterStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" - - // GetAgentOKBodyNodeExporterStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - GetAgentOKBodyNodeExporterStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" - - // GetAgentOKBodyNodeExporterStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - GetAgentOKBodyNodeExporterStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" -) - -// prop value enum -func (o *GetAgentOKBodyNodeExporter) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, getAgentOkBodyNodeExporterTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *GetAgentOKBodyNodeExporter) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required - return nil - } - - // value enum - if err := o.validateStatusEnum("getAgentOk"+"."+"node_exporter"+"."+"status", "body", *o.Status); err != nil { - return err - } - - return nil -} - -var getAgentOkBodyNodeExporterTypeLogLevelPropEnum []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 { - getAgentOkBodyNodeExporterTypeLogLevelPropEnum = append(getAgentOkBodyNodeExporterTypeLogLevelPropEnum, v) - } -} - -const ( - - // GetAgentOKBodyNodeExporterLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - GetAgentOKBodyNodeExporterLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // GetAgentOKBodyNodeExporterLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - GetAgentOKBodyNodeExporterLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // GetAgentOKBodyNodeExporterLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - GetAgentOKBodyNodeExporterLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // GetAgentOKBodyNodeExporterLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - GetAgentOKBodyNodeExporterLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // GetAgentOKBodyNodeExporterLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - GetAgentOKBodyNodeExporterLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // GetAgentOKBodyNodeExporterLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - GetAgentOKBodyNodeExporterLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -func (o *GetAgentOKBodyNodeExporter) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, getAgentOkBodyNodeExporterTypeLogLevelPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *GetAgentOKBodyNodeExporter) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("getAgentOk"+"."+"node_exporter"+"."+"log_level", "body", *o.LogLevel); err != nil { - return err - } - - return nil -} - -func (o *GetAgentOKBodyNodeExporter) 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("getAgentOk" + "." + "node_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getAgentOk" + "." + "node_exporter" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this get agent OK body node exporter based on the context it is used -func (o *GetAgentOKBodyNodeExporter) 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 *GetAgentOKBodyNodeExporter) 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 { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getAgentOk" + "." + "node_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getAgentOk" + "." + "node_exporter" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetAgentOKBodyNodeExporter) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetAgentOKBodyNodeExporter) UnmarshalBinary(b []byte) error { - var res GetAgentOKBodyNodeExporter - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetAgentOKBodyNodeExporterMetricsResolutions MetricsResolutions represents Prometheus exporters metrics resolutions. -swagger:model GetAgentOKBodyNodeExporterMetricsResolutions -*/ -type GetAgentOKBodyNodeExporterMetricsResolutions struct { - // High resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Hr string `json:"hr,omitempty"` - - // Medium resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Mr string `json:"mr,omitempty"` - - // Low resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Lr string `json:"lr,omitempty"` -} - -// Validate validates this get agent OK body node exporter metrics resolutions -func (o *GetAgentOKBodyNodeExporterMetricsResolutions) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get agent OK body node exporter metrics resolutions based on context it is used -func (o *GetAgentOKBodyNodeExporterMetricsResolutions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetAgentOKBodyNodeExporterMetricsResolutions) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetAgentOKBodyNodeExporterMetricsResolutions) UnmarshalBinary(b []byte) error { - var res GetAgentOKBodyNodeExporterMetricsResolutions - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetAgentOKBodyNomadAgent get agent OK body nomad agent -swagger:model GetAgentOKBodyNomadAgent -*/ -type GetAgentOKBodyNomadAgent struct { - // Unique randomly generated instance identifier. - AgentID string `json:"agent_id,omitempty"` - - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `json:"disabled,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"` - - // Path to exec process. - ProcessExecPath string `json:"process_exec_path,omitempty"` - - // Listen port for scraping metrics. - ListenPort int64 `json:"listen_port,omitempty"` -} - -// Validate validates this get agent OK body nomad agent -func (o *GetAgentOKBodyNomadAgent) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateStatus(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var getAgentOkBodyNomadAgentTypeStatusPropEnum []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 { - getAgentOkBodyNomadAgentTypeStatusPropEnum = append(getAgentOkBodyNomadAgentTypeStatusPropEnum, v) - } -} - -const ( - - // GetAgentOKBodyNomadAgentStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - GetAgentOKBodyNomadAgentStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // GetAgentOKBodyNomadAgentStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - GetAgentOKBodyNomadAgentStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // GetAgentOKBodyNomadAgentStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - GetAgentOKBodyNomadAgentStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - - // GetAgentOKBodyNomadAgentStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - GetAgentOKBodyNomadAgentStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - - // GetAgentOKBodyNomadAgentStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - GetAgentOKBodyNomadAgentStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - - // GetAgentOKBodyNomadAgentStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - GetAgentOKBodyNomadAgentStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" - - // GetAgentOKBodyNomadAgentStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - GetAgentOKBodyNomadAgentStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" - - // GetAgentOKBodyNomadAgentStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - GetAgentOKBodyNomadAgentStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" -) - -// prop value enum -func (o *GetAgentOKBodyNomadAgent) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, getAgentOkBodyNomadAgentTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *GetAgentOKBodyNomadAgent) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required - return nil - } - - // value enum - if err := o.validateStatusEnum("getAgentOk"+"."+"nomad_agent"+"."+"status", "body", *o.Status); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this get agent OK body nomad agent based on context it is used -func (o *GetAgentOKBodyNomadAgent) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetAgentOKBodyNomadAgent) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetAgentOKBodyNomadAgent) UnmarshalBinary(b []byte) error { - var res GetAgentOKBodyNomadAgent - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetAgentOKBodyPMMAgent PMMAgent runs on Generic or Container Node. -swagger:model GetAgentOKBodyPMMAgent -*/ -type GetAgentOKBodyPMMAgent struct { - // Unique randomly generated instance identifier. - AgentID string `json:"agent_id,omitempty"` - - // Node identifier where this instance runs. - RunsOnNodeID string `json:"runs_on_node_id,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // True if Agent is running and connected to pmm-managed. - Connected bool `json:"connected,omitempty"` - - // Path to exec process. - ProcessExecPath string `json:"process_exec_path,omitempty"` -} - -// Validate validates this get agent OK body PMM agent -func (o *GetAgentOKBodyPMMAgent) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get agent OK body PMM agent based on context it is used -func (o *GetAgentOKBodyPMMAgent) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetAgentOKBodyPMMAgent) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetAgentOKBodyPMMAgent) UnmarshalBinary(b []byte) error { - var res GetAgentOKBodyPMMAgent - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetAgentOKBodyPostgresExporter PostgresExporter runs on Generic or Container Node and exposes PostgreSQL Service metrics. -swagger:model GetAgentOKBodyPostgresExporter -*/ -type GetAgentOKBodyPostgresExporter struct { - // Unique randomly generated instance identifier. - AgentID string `json:"agent_id,omitempty"` - - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `json:"disabled,omitempty"` - - // Service identifier. - ServiceID string `json:"service_id,omitempty"` - - // PostgreSQL username for scraping metrics. - Username string `json:"username,omitempty"` - - // Use TLS for database connections. - TLS bool `json:"tls,omitempty"` - - // Skip TLS certificate and hostname validation. Uses sslmode=required instead of verify-full. - TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // True if exporter uses push metrics mode. - PushMetricsEnabled bool `json:"push_metrics_enabled,omitempty"` - - // 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"` - - // Optionally expose the exporter process on all public interfaces - ExposeExporter bool `json:"expose_exporter,omitempty"` - - // Maximum number of connections that exporter can open to the database instance. - MaxExporterConnections int32 `json:"max_exporter_connections,omitempty"` - - // metrics resolutions - MetricsResolutions *GetAgentOKBodyPostgresExporterMetricsResolutions `json:"metrics_resolutions,omitempty"` -} - -// Validate validates this get agent OK body postgres exporter -func (o *GetAgentOKBodyPostgresExporter) 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 getAgentOkBodyPostgresExporterTypeStatusPropEnum []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 { - getAgentOkBodyPostgresExporterTypeStatusPropEnum = append(getAgentOkBodyPostgresExporterTypeStatusPropEnum, v) - } -} - -const ( - - // GetAgentOKBodyPostgresExporterStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - GetAgentOKBodyPostgresExporterStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // GetAgentOKBodyPostgresExporterStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - GetAgentOKBodyPostgresExporterStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // GetAgentOKBodyPostgresExporterStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - GetAgentOKBodyPostgresExporterStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - - // GetAgentOKBodyPostgresExporterStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - GetAgentOKBodyPostgresExporterStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - - // GetAgentOKBodyPostgresExporterStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - GetAgentOKBodyPostgresExporterStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - - // GetAgentOKBodyPostgresExporterStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - GetAgentOKBodyPostgresExporterStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" - - // GetAgentOKBodyPostgresExporterStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - GetAgentOKBodyPostgresExporterStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" - - // GetAgentOKBodyPostgresExporterStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - GetAgentOKBodyPostgresExporterStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" -) - -// prop value enum -func (o *GetAgentOKBodyPostgresExporter) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, getAgentOkBodyPostgresExporterTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *GetAgentOKBodyPostgresExporter) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required - return nil - } - - // value enum - if err := o.validateStatusEnum("getAgentOk"+"."+"postgres_exporter"+"."+"status", "body", *o.Status); err != nil { - return err - } - - return nil -} - -var getAgentOkBodyPostgresExporterTypeLogLevelPropEnum []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 { - getAgentOkBodyPostgresExporterTypeLogLevelPropEnum = append(getAgentOkBodyPostgresExporterTypeLogLevelPropEnum, v) - } -} - -const ( - - // GetAgentOKBodyPostgresExporterLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - GetAgentOKBodyPostgresExporterLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // GetAgentOKBodyPostgresExporterLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - GetAgentOKBodyPostgresExporterLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // GetAgentOKBodyPostgresExporterLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - GetAgentOKBodyPostgresExporterLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // GetAgentOKBodyPostgresExporterLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - GetAgentOKBodyPostgresExporterLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // GetAgentOKBodyPostgresExporterLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - GetAgentOKBodyPostgresExporterLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // GetAgentOKBodyPostgresExporterLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - GetAgentOKBodyPostgresExporterLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -func (o *GetAgentOKBodyPostgresExporter) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, getAgentOkBodyPostgresExporterTypeLogLevelPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *GetAgentOKBodyPostgresExporter) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("getAgentOk"+"."+"postgres_exporter"+"."+"log_level", "body", *o.LogLevel); err != nil { - return err - } - - return nil -} - -func (o *GetAgentOKBodyPostgresExporter) 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("getAgentOk" + "." + "postgres_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getAgentOk" + "." + "postgres_exporter" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this get agent OK body postgres exporter based on the context it is used -func (o *GetAgentOKBodyPostgresExporter) 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 *GetAgentOKBodyPostgresExporter) 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 { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getAgentOk" + "." + "postgres_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getAgentOk" + "." + "postgres_exporter" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetAgentOKBodyPostgresExporter) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetAgentOKBodyPostgresExporter) UnmarshalBinary(b []byte) error { - var res GetAgentOKBodyPostgresExporter - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetAgentOKBodyPostgresExporterMetricsResolutions MetricsResolutions represents Prometheus exporters metrics resolutions. -swagger:model GetAgentOKBodyPostgresExporterMetricsResolutions -*/ -type GetAgentOKBodyPostgresExporterMetricsResolutions struct { - // High resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Hr string `json:"hr,omitempty"` - - // Medium resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Mr string `json:"mr,omitempty"` - - // Low resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Lr string `json:"lr,omitempty"` -} - -// Validate validates this get agent OK body postgres exporter metrics resolutions -func (o *GetAgentOKBodyPostgresExporterMetricsResolutions) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get agent OK body postgres exporter metrics resolutions based on context it is used -func (o *GetAgentOKBodyPostgresExporterMetricsResolutions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetAgentOKBodyPostgresExporterMetricsResolutions) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetAgentOKBodyPostgresExporterMetricsResolutions) UnmarshalBinary(b []byte) error { - var res GetAgentOKBodyPostgresExporterMetricsResolutions - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetAgentOKBodyProxysqlExporter ProxySQLExporter runs on Generic or Container Node and exposes ProxySQL Service metrics. -swagger:model GetAgentOKBodyProxysqlExporter -*/ -type GetAgentOKBodyProxysqlExporter struct { - // Unique randomly generated instance identifier. - AgentID string `json:"agent_id,omitempty"` - - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `json:"disabled,omitempty"` - - // Service identifier. - ServiceID string `json:"service_id,omitempty"` - - // ProxySQL username for scraping metrics. - Username string `json:"username,omitempty"` - - // Use TLS for database connections. - TLS bool `json:"tls,omitempty"` - - // Skip TLS certificate and hostname validation. - TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // True if exporter uses push metrics mode. - PushMetricsEnabled bool `json:"push_metrics_enabled,omitempty"` - - // 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"` - - // Optionally expose the exporter process on all public interfaces - ExposeExporter bool `json:"expose_exporter,omitempty"` - - // metrics resolutions - MetricsResolutions *GetAgentOKBodyProxysqlExporterMetricsResolutions `json:"metrics_resolutions,omitempty"` -} - -// Validate validates this get agent OK body proxysql exporter -func (o *GetAgentOKBodyProxysqlExporter) 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 getAgentOkBodyProxysqlExporterTypeStatusPropEnum []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 { - getAgentOkBodyProxysqlExporterTypeStatusPropEnum = append(getAgentOkBodyProxysqlExporterTypeStatusPropEnum, v) - } -} - -const ( - - // GetAgentOKBodyProxysqlExporterStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - GetAgentOKBodyProxysqlExporterStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // GetAgentOKBodyProxysqlExporterStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - GetAgentOKBodyProxysqlExporterStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // GetAgentOKBodyProxysqlExporterStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - GetAgentOKBodyProxysqlExporterStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - - // GetAgentOKBodyProxysqlExporterStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - GetAgentOKBodyProxysqlExporterStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - - // GetAgentOKBodyProxysqlExporterStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - GetAgentOKBodyProxysqlExporterStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - - // GetAgentOKBodyProxysqlExporterStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - GetAgentOKBodyProxysqlExporterStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" - - // GetAgentOKBodyProxysqlExporterStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - GetAgentOKBodyProxysqlExporterStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" - - // GetAgentOKBodyProxysqlExporterStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - GetAgentOKBodyProxysqlExporterStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" -) - -// prop value enum -func (o *GetAgentOKBodyProxysqlExporter) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, getAgentOkBodyProxysqlExporterTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *GetAgentOKBodyProxysqlExporter) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required - return nil - } - - // value enum - if err := o.validateStatusEnum("getAgentOk"+"."+"proxysql_exporter"+"."+"status", "body", *o.Status); err != nil { - return err - } - - return nil -} - -var getAgentOkBodyProxysqlExporterTypeLogLevelPropEnum []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 { - getAgentOkBodyProxysqlExporterTypeLogLevelPropEnum = append(getAgentOkBodyProxysqlExporterTypeLogLevelPropEnum, v) - } -} - -const ( - - // GetAgentOKBodyProxysqlExporterLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - GetAgentOKBodyProxysqlExporterLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // GetAgentOKBodyProxysqlExporterLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - GetAgentOKBodyProxysqlExporterLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // GetAgentOKBodyProxysqlExporterLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - GetAgentOKBodyProxysqlExporterLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // GetAgentOKBodyProxysqlExporterLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - GetAgentOKBodyProxysqlExporterLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // GetAgentOKBodyProxysqlExporterLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - GetAgentOKBodyProxysqlExporterLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // GetAgentOKBodyProxysqlExporterLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - GetAgentOKBodyProxysqlExporterLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -func (o *GetAgentOKBodyProxysqlExporter) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, getAgentOkBodyProxysqlExporterTypeLogLevelPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *GetAgentOKBodyProxysqlExporter) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("getAgentOk"+"."+"proxysql_exporter"+"."+"log_level", "body", *o.LogLevel); err != nil { - return err - } - - return nil -} - -func (o *GetAgentOKBodyProxysqlExporter) 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("getAgentOk" + "." + "proxysql_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getAgentOk" + "." + "proxysql_exporter" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this get agent OK body proxysql exporter based on the context it is used -func (o *GetAgentOKBodyProxysqlExporter) 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 *GetAgentOKBodyProxysqlExporter) 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 { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getAgentOk" + "." + "proxysql_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getAgentOk" + "." + "proxysql_exporter" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetAgentOKBodyProxysqlExporter) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetAgentOKBodyProxysqlExporter) UnmarshalBinary(b []byte) error { - var res GetAgentOKBodyProxysqlExporter - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetAgentOKBodyProxysqlExporterMetricsResolutions MetricsResolutions represents Prometheus exporters metrics resolutions. -swagger:model GetAgentOKBodyProxysqlExporterMetricsResolutions -*/ -type GetAgentOKBodyProxysqlExporterMetricsResolutions struct { - // High resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Hr string `json:"hr,omitempty"` - - // Medium resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Mr string `json:"mr,omitempty"` - - // Low resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Lr string `json:"lr,omitempty"` -} - -// Validate validates this get agent OK body proxysql exporter metrics resolutions -func (o *GetAgentOKBodyProxysqlExporterMetricsResolutions) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get agent OK body proxysql exporter metrics resolutions based on context it is used -func (o *GetAgentOKBodyProxysqlExporterMetricsResolutions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetAgentOKBodyProxysqlExporterMetricsResolutions) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetAgentOKBodyProxysqlExporterMetricsResolutions) UnmarshalBinary(b []byte) error { - var res GetAgentOKBodyProxysqlExporterMetricsResolutions - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetAgentOKBodyQANMongodbMongologAgent QANMongoDBMongologAgent runs within pmm-agent and sends MongoDB Query Analytics data to the PMM Server. -swagger:model GetAgentOKBodyQANMongodbMongologAgent -*/ -type GetAgentOKBodyQANMongodbMongologAgent struct { - // Unique randomly generated instance identifier. - AgentID string `json:"agent_id,omitempty"` - - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `json:"disabled,omitempty"` - - // Service identifier. - ServiceID string `json:"service_id,omitempty"` - - // MongoDB username for getting profiler data. - Username string `json:"username,omitempty"` - - // Use TLS for database connections. - TLS bool `json:"tls,omitempty"` - - // Skip TLS certificate and hostname validation. - TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - - // Limit query length in QAN (default: server-defined; -1: no limit). - MaxQueryLength int32 `json:"max_query_length,omitempty"` - - // 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"` - - // 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 get agent OK body QAN mongodb mongolog agent -func (o *GetAgentOKBodyQANMongodbMongologAgent) 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 getAgentOkBodyQanMongodbMongologAgentTypeStatusPropEnum []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 { - getAgentOkBodyQanMongodbMongologAgentTypeStatusPropEnum = append(getAgentOkBodyQanMongodbMongologAgentTypeStatusPropEnum, v) - } -} - -const ( - - // GetAgentOKBodyQANMongodbMongologAgentStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - GetAgentOKBodyQANMongodbMongologAgentStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // GetAgentOKBodyQANMongodbMongologAgentStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - GetAgentOKBodyQANMongodbMongologAgentStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // GetAgentOKBodyQANMongodbMongologAgentStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - GetAgentOKBodyQANMongodbMongologAgentStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - - // GetAgentOKBodyQANMongodbMongologAgentStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - GetAgentOKBodyQANMongodbMongologAgentStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - - // GetAgentOKBodyQANMongodbMongologAgentStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - GetAgentOKBodyQANMongodbMongologAgentStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - - // GetAgentOKBodyQANMongodbMongologAgentStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - GetAgentOKBodyQANMongodbMongologAgentStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" - - // GetAgentOKBodyQANMongodbMongologAgentStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - GetAgentOKBodyQANMongodbMongologAgentStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" - - // GetAgentOKBodyQANMongodbMongologAgentStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - GetAgentOKBodyQANMongodbMongologAgentStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" -) - -// prop value enum -func (o *GetAgentOKBodyQANMongodbMongologAgent) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, getAgentOkBodyQanMongodbMongologAgentTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *GetAgentOKBodyQANMongodbMongologAgent) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required - return nil - } - - // value enum - if err := o.validateStatusEnum("getAgentOk"+"."+"qan_mongodb_mongolog_agent"+"."+"status", "body", *o.Status); err != nil { - return err - } - - return nil -} - -var getAgentOkBodyQanMongodbMongologAgentTypeLogLevelPropEnum []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 { - getAgentOkBodyQanMongodbMongologAgentTypeLogLevelPropEnum = append(getAgentOkBodyQanMongodbMongologAgentTypeLogLevelPropEnum, v) - } -} - -const ( - - // GetAgentOKBodyQANMongodbMongologAgentLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - GetAgentOKBodyQANMongodbMongologAgentLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // GetAgentOKBodyQANMongodbMongologAgentLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - GetAgentOKBodyQANMongodbMongologAgentLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // GetAgentOKBodyQANMongodbMongologAgentLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - GetAgentOKBodyQANMongodbMongologAgentLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // GetAgentOKBodyQANMongodbMongologAgentLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - GetAgentOKBodyQANMongodbMongologAgentLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // GetAgentOKBodyQANMongodbMongologAgentLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - GetAgentOKBodyQANMongodbMongologAgentLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // GetAgentOKBodyQANMongodbMongologAgentLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - GetAgentOKBodyQANMongodbMongologAgentLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -func (o *GetAgentOKBodyQANMongodbMongologAgent) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, getAgentOkBodyQanMongodbMongologAgentTypeLogLevelPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *GetAgentOKBodyQANMongodbMongologAgent) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("getAgentOk"+"."+"qan_mongodb_mongolog_agent"+"."+"log_level", "body", *o.LogLevel); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this get agent OK body QAN mongodb mongolog agent based on context it is used -func (o *GetAgentOKBodyQANMongodbMongologAgent) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetAgentOKBodyQANMongodbMongologAgent) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetAgentOKBodyQANMongodbMongologAgent) UnmarshalBinary(b []byte) error { - var res GetAgentOKBodyQANMongodbMongologAgent - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetAgentOKBodyQANMongodbProfilerAgent QANMongoDBProfilerAgent runs within pmm-agent and sends MongoDB Query Analytics data to the PMM Server. -swagger:model GetAgentOKBodyQANMongodbProfilerAgent -*/ -type GetAgentOKBodyQANMongodbProfilerAgent struct { - // Unique randomly generated instance identifier. - AgentID string `json:"agent_id,omitempty"` - - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `json:"disabled,omitempty"` - - // Service identifier. - ServiceID string `json:"service_id,omitempty"` - - // MongoDB username for getting profiler data. - Username string `json:"username,omitempty"` - - // Use TLS for database connections. - TLS bool `json:"tls,omitempty"` - - // Skip TLS certificate and hostname validation. - TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - - // Limit query length in QAN (default: server-defined; -1: no limit). - MaxQueryLength int32 `json:"max_query_length,omitempty"` - - // 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"` - - // 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 get agent OK body QAN mongodb profiler agent -func (o *GetAgentOKBodyQANMongodbProfilerAgent) 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 getAgentOkBodyQanMongodbProfilerAgentTypeStatusPropEnum []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 { - getAgentOkBodyQanMongodbProfilerAgentTypeStatusPropEnum = append(getAgentOkBodyQanMongodbProfilerAgentTypeStatusPropEnum, v) - } -} - -const ( - - // GetAgentOKBodyQANMongodbProfilerAgentStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - GetAgentOKBodyQANMongodbProfilerAgentStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // GetAgentOKBodyQANMongodbProfilerAgentStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - GetAgentOKBodyQANMongodbProfilerAgentStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // GetAgentOKBodyQANMongodbProfilerAgentStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - GetAgentOKBodyQANMongodbProfilerAgentStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - - // GetAgentOKBodyQANMongodbProfilerAgentStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - GetAgentOKBodyQANMongodbProfilerAgentStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - - // GetAgentOKBodyQANMongodbProfilerAgentStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - GetAgentOKBodyQANMongodbProfilerAgentStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - - // GetAgentOKBodyQANMongodbProfilerAgentStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - GetAgentOKBodyQANMongodbProfilerAgentStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" - - // GetAgentOKBodyQANMongodbProfilerAgentStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - GetAgentOKBodyQANMongodbProfilerAgentStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" - - // GetAgentOKBodyQANMongodbProfilerAgentStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - GetAgentOKBodyQANMongodbProfilerAgentStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" -) - -// prop value enum -func (o *GetAgentOKBodyQANMongodbProfilerAgent) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, getAgentOkBodyQanMongodbProfilerAgentTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *GetAgentOKBodyQANMongodbProfilerAgent) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required - return nil - } - - // value enum - if err := o.validateStatusEnum("getAgentOk"+"."+"qan_mongodb_profiler_agent"+"."+"status", "body", *o.Status); err != nil { - return err - } - - return nil -} - -var getAgentOkBodyQanMongodbProfilerAgentTypeLogLevelPropEnum []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 { - getAgentOkBodyQanMongodbProfilerAgentTypeLogLevelPropEnum = append(getAgentOkBodyQanMongodbProfilerAgentTypeLogLevelPropEnum, v) - } -} - -const ( - - // GetAgentOKBodyQANMongodbProfilerAgentLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - GetAgentOKBodyQANMongodbProfilerAgentLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // GetAgentOKBodyQANMongodbProfilerAgentLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - GetAgentOKBodyQANMongodbProfilerAgentLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // GetAgentOKBodyQANMongodbProfilerAgentLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - GetAgentOKBodyQANMongodbProfilerAgentLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // GetAgentOKBodyQANMongodbProfilerAgentLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - GetAgentOKBodyQANMongodbProfilerAgentLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // GetAgentOKBodyQANMongodbProfilerAgentLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - GetAgentOKBodyQANMongodbProfilerAgentLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // GetAgentOKBodyQANMongodbProfilerAgentLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - GetAgentOKBodyQANMongodbProfilerAgentLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -func (o *GetAgentOKBodyQANMongodbProfilerAgent) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, getAgentOkBodyQanMongodbProfilerAgentTypeLogLevelPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *GetAgentOKBodyQANMongodbProfilerAgent) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("getAgentOk"+"."+"qan_mongodb_profiler_agent"+"."+"log_level", "body", *o.LogLevel); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this get agent OK body QAN mongodb profiler agent based on context it is used -func (o *GetAgentOKBodyQANMongodbProfilerAgent) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetAgentOKBodyQANMongodbProfilerAgent) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetAgentOKBodyQANMongodbProfilerAgent) UnmarshalBinary(b []byte) error { - var res GetAgentOKBodyQANMongodbProfilerAgent - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetAgentOKBodyQANMysqlPerfschemaAgent QANMySQLPerfSchemaAgent runs within pmm-agent and sends MySQL Query Analytics data to the PMM Server. -swagger:model GetAgentOKBodyQANMysqlPerfschemaAgent -*/ -type GetAgentOKBodyQANMysqlPerfschemaAgent struct { - // Unique randomly generated instance identifier. - AgentID string `json:"agent_id,omitempty"` - - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `json:"disabled,omitempty"` - - // Service identifier. - ServiceID string `json:"service_id,omitempty"` - - // MySQL username for getting performance data. - Username string `json:"username,omitempty"` - - // Use TLS for database connections. - TLS bool `json:"tls,omitempty"` - - // Skip TLS certificate and hostname validation. - TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - - // Certificate Authority certificate chain. - TLSCa string `json:"tls_ca,omitempty"` - - // Client certificate. - TLSCert string `json:"tls_cert,omitempty"` - - // Password for decrypting tls_cert. - TLSKey string `json:"tls_key,omitempty"` - - // Disable parsing comments from queries and showing them in QAN. - DisableCommentsParsing bool `json:"disable_comments_parsing,omitempty"` - - // Limit query length in QAN (default: server-defined; -1: no limit). - MaxQueryLength int32 `json:"max_query_length,omitempty"` - - // True if query examples are disabled. - QueryExamplesDisabled bool `json:"query_examples_disabled,omitempty"` - - // 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"` - - // 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 get agent OK body QAN mysql perfschema agent -func (o *GetAgentOKBodyQANMysqlPerfschemaAgent) 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 getAgentOkBodyQanMysqlPerfschemaAgentTypeStatusPropEnum []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 { - getAgentOkBodyQanMysqlPerfschemaAgentTypeStatusPropEnum = append(getAgentOkBodyQanMysqlPerfschemaAgentTypeStatusPropEnum, v) - } -} - -const ( - - // GetAgentOKBodyQANMysqlPerfschemaAgentStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - GetAgentOKBodyQANMysqlPerfschemaAgentStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // GetAgentOKBodyQANMysqlPerfschemaAgentStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - GetAgentOKBodyQANMysqlPerfschemaAgentStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // GetAgentOKBodyQANMysqlPerfschemaAgentStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - GetAgentOKBodyQANMysqlPerfschemaAgentStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - - // GetAgentOKBodyQANMysqlPerfschemaAgentStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - GetAgentOKBodyQANMysqlPerfschemaAgentStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - - // GetAgentOKBodyQANMysqlPerfschemaAgentStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - GetAgentOKBodyQANMysqlPerfschemaAgentStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - - // GetAgentOKBodyQANMysqlPerfschemaAgentStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - GetAgentOKBodyQANMysqlPerfschemaAgentStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" - - // GetAgentOKBodyQANMysqlPerfschemaAgentStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - GetAgentOKBodyQANMysqlPerfschemaAgentStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" - - // GetAgentOKBodyQANMysqlPerfschemaAgentStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - GetAgentOKBodyQANMysqlPerfschemaAgentStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" -) - -// prop value enum -func (o *GetAgentOKBodyQANMysqlPerfschemaAgent) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, getAgentOkBodyQanMysqlPerfschemaAgentTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *GetAgentOKBodyQANMysqlPerfschemaAgent) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required - return nil - } - - // value enum - if err := o.validateStatusEnum("getAgentOk"+"."+"qan_mysql_perfschema_agent"+"."+"status", "body", *o.Status); err != nil { - return err - } - - return nil -} - -var getAgentOkBodyQanMysqlPerfschemaAgentTypeLogLevelPropEnum []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 { - getAgentOkBodyQanMysqlPerfschemaAgentTypeLogLevelPropEnum = append(getAgentOkBodyQanMysqlPerfschemaAgentTypeLogLevelPropEnum, v) - } -} - -const ( - - // GetAgentOKBodyQANMysqlPerfschemaAgentLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - GetAgentOKBodyQANMysqlPerfschemaAgentLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // GetAgentOKBodyQANMysqlPerfschemaAgentLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - GetAgentOKBodyQANMysqlPerfschemaAgentLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // GetAgentOKBodyQANMysqlPerfschemaAgentLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - GetAgentOKBodyQANMysqlPerfschemaAgentLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // GetAgentOKBodyQANMysqlPerfschemaAgentLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - GetAgentOKBodyQANMysqlPerfschemaAgentLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // GetAgentOKBodyQANMysqlPerfschemaAgentLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - GetAgentOKBodyQANMysqlPerfschemaAgentLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // GetAgentOKBodyQANMysqlPerfschemaAgentLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - GetAgentOKBodyQANMysqlPerfschemaAgentLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -func (o *GetAgentOKBodyQANMysqlPerfschemaAgent) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, getAgentOkBodyQanMysqlPerfschemaAgentTypeLogLevelPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *GetAgentOKBodyQANMysqlPerfschemaAgent) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("getAgentOk"+"."+"qan_mysql_perfschema_agent"+"."+"log_level", "body", *o.LogLevel); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this get agent OK body QAN mysql perfschema agent based on context it is used -func (o *GetAgentOKBodyQANMysqlPerfschemaAgent) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetAgentOKBodyQANMysqlPerfschemaAgent) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetAgentOKBodyQANMysqlPerfschemaAgent) UnmarshalBinary(b []byte) error { - var res GetAgentOKBodyQANMysqlPerfschemaAgent - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetAgentOKBodyQANMysqlSlowlogAgent QANMySQLSlowlogAgent runs within pmm-agent and sends MySQL Query Analytics data to the PMM Server. -swagger:model GetAgentOKBodyQANMysqlSlowlogAgent -*/ -type GetAgentOKBodyQANMysqlSlowlogAgent struct { - // Unique randomly generated instance identifier. - AgentID string `json:"agent_id,omitempty"` - - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `json:"disabled,omitempty"` - - // Service identifier. - ServiceID string `json:"service_id,omitempty"` - - // MySQL username for getting performance data. - Username string `json:"username,omitempty"` - - // Use TLS for database connections. - TLS bool `json:"tls,omitempty"` - - // Skip TLS certificate and hostname validation. - TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - - // Certificate Authority certificate chain. - TLSCa string `json:"tls_ca,omitempty"` - - // Client certificate. - TLSCert string `json:"tls_cert,omitempty"` - - // Password for decrypting tls_cert. - TLSKey string `json:"tls_key,omitempty"` - - // Disable parsing comments from queries and showing them in QAN. - DisableCommentsParsing bool `json:"disable_comments_parsing,omitempty"` - - // Limit query length in QAN (default: server-defined; -1: no limit) - MaxQueryLength int32 `json:"max_query_length,omitempty"` - - // True if query examples are disabled. - QueryExamplesDisabled bool `json:"query_examples_disabled,omitempty"` - - // Slowlog file is rotated at this size if > 0. - MaxSlowlogFileSize string `json:"max_slowlog_file_size,omitempty"` - - // 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"` - - // 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 get agent OK body QAN mysql slowlog agent -func (o *GetAgentOKBodyQANMysqlSlowlogAgent) 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 getAgentOkBodyQanMysqlSlowlogAgentTypeStatusPropEnum []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 { - getAgentOkBodyQanMysqlSlowlogAgentTypeStatusPropEnum = append(getAgentOkBodyQanMysqlSlowlogAgentTypeStatusPropEnum, v) - } -} - -const ( - - // GetAgentOKBodyQANMysqlSlowlogAgentStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - GetAgentOKBodyQANMysqlSlowlogAgentStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // GetAgentOKBodyQANMysqlSlowlogAgentStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - GetAgentOKBodyQANMysqlSlowlogAgentStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // GetAgentOKBodyQANMysqlSlowlogAgentStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - GetAgentOKBodyQANMysqlSlowlogAgentStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - - // GetAgentOKBodyQANMysqlSlowlogAgentStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - GetAgentOKBodyQANMysqlSlowlogAgentStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - - // GetAgentOKBodyQANMysqlSlowlogAgentStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - GetAgentOKBodyQANMysqlSlowlogAgentStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - - // GetAgentOKBodyQANMysqlSlowlogAgentStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - GetAgentOKBodyQANMysqlSlowlogAgentStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" - - // GetAgentOKBodyQANMysqlSlowlogAgentStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - GetAgentOKBodyQANMysqlSlowlogAgentStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" - - // GetAgentOKBodyQANMysqlSlowlogAgentStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - GetAgentOKBodyQANMysqlSlowlogAgentStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" -) - -// prop value enum -func (o *GetAgentOKBodyQANMysqlSlowlogAgent) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, getAgentOkBodyQanMysqlSlowlogAgentTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *GetAgentOKBodyQANMysqlSlowlogAgent) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required - return nil - } - - // value enum - if err := o.validateStatusEnum("getAgentOk"+"."+"qan_mysql_slowlog_agent"+"."+"status", "body", *o.Status); err != nil { - return err - } - - return nil -} - -var getAgentOkBodyQanMysqlSlowlogAgentTypeLogLevelPropEnum []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 { - getAgentOkBodyQanMysqlSlowlogAgentTypeLogLevelPropEnum = append(getAgentOkBodyQanMysqlSlowlogAgentTypeLogLevelPropEnum, v) - } -} - -const ( - - // GetAgentOKBodyQANMysqlSlowlogAgentLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - GetAgentOKBodyQANMysqlSlowlogAgentLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // GetAgentOKBodyQANMysqlSlowlogAgentLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - GetAgentOKBodyQANMysqlSlowlogAgentLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // GetAgentOKBodyQANMysqlSlowlogAgentLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - GetAgentOKBodyQANMysqlSlowlogAgentLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // GetAgentOKBodyQANMysqlSlowlogAgentLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - GetAgentOKBodyQANMysqlSlowlogAgentLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // GetAgentOKBodyQANMysqlSlowlogAgentLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - GetAgentOKBodyQANMysqlSlowlogAgentLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // GetAgentOKBodyQANMysqlSlowlogAgentLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - GetAgentOKBodyQANMysqlSlowlogAgentLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -func (o *GetAgentOKBodyQANMysqlSlowlogAgent) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, getAgentOkBodyQanMysqlSlowlogAgentTypeLogLevelPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *GetAgentOKBodyQANMysqlSlowlogAgent) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("getAgentOk"+"."+"qan_mysql_slowlog_agent"+"."+"log_level", "body", *o.LogLevel); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this get agent OK body QAN mysql slowlog agent based on context it is used -func (o *GetAgentOKBodyQANMysqlSlowlogAgent) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetAgentOKBodyQANMysqlSlowlogAgent) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetAgentOKBodyQANMysqlSlowlogAgent) UnmarshalBinary(b []byte) error { - var res GetAgentOKBodyQANMysqlSlowlogAgent - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetAgentOKBodyQANPostgresqlPgstatementsAgent QANPostgreSQLPgStatementsAgent runs within pmm-agent and sends PostgreSQL Query Analytics data to the PMM Server. -swagger:model GetAgentOKBodyQANPostgresqlPgstatementsAgent -*/ -type GetAgentOKBodyQANPostgresqlPgstatementsAgent struct { - // Unique randomly generated instance identifier. - AgentID string `json:"agent_id,omitempty"` - - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `json:"disabled,omitempty"` - - // Service identifier. - ServiceID string `json:"service_id,omitempty"` - - // PostgreSQL username for getting pg stat statements data. - Username string `json:"username,omitempty"` - - // Disable parsing comments from queries and showing them in QAN. - DisableCommentsParsing bool `json:"disable_comments_parsing,omitempty"` - - // Limit query length in QAN (default: server-defined; -1: no limit). - MaxQueryLength int32 `json:"max_query_length,omitempty"` - - // Use TLS for database connections. - TLS bool `json:"tls,omitempty"` - - // Skip TLS certificate and hostname validation. - TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - - // 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"` - - // 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 get agent OK body QAN postgresql pgstatements agent -func (o *GetAgentOKBodyQANPostgresqlPgstatementsAgent) 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 getAgentOkBodyQanPostgresqlPgstatementsAgentTypeStatusPropEnum []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 { - getAgentOkBodyQanPostgresqlPgstatementsAgentTypeStatusPropEnum = append(getAgentOkBodyQanPostgresqlPgstatementsAgentTypeStatusPropEnum, v) - } -} - -const ( - - // GetAgentOKBodyQANPostgresqlPgstatementsAgentStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - GetAgentOKBodyQANPostgresqlPgstatementsAgentStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // GetAgentOKBodyQANPostgresqlPgstatementsAgentStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - GetAgentOKBodyQANPostgresqlPgstatementsAgentStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // GetAgentOKBodyQANPostgresqlPgstatementsAgentStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - GetAgentOKBodyQANPostgresqlPgstatementsAgentStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - - // GetAgentOKBodyQANPostgresqlPgstatementsAgentStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - GetAgentOKBodyQANPostgresqlPgstatementsAgentStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - - // GetAgentOKBodyQANPostgresqlPgstatementsAgentStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - GetAgentOKBodyQANPostgresqlPgstatementsAgentStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - - // GetAgentOKBodyQANPostgresqlPgstatementsAgentStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - GetAgentOKBodyQANPostgresqlPgstatementsAgentStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" - - // GetAgentOKBodyQANPostgresqlPgstatementsAgentStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - GetAgentOKBodyQANPostgresqlPgstatementsAgentStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" - - // GetAgentOKBodyQANPostgresqlPgstatementsAgentStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - GetAgentOKBodyQANPostgresqlPgstatementsAgentStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" -) - -// prop value enum -func (o *GetAgentOKBodyQANPostgresqlPgstatementsAgent) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, getAgentOkBodyQanPostgresqlPgstatementsAgentTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *GetAgentOKBodyQANPostgresqlPgstatementsAgent) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required - return nil - } - - // value enum - if err := o.validateStatusEnum("getAgentOk"+"."+"qan_postgresql_pgstatements_agent"+"."+"status", "body", *o.Status); err != nil { - return err - } - - return nil -} - -var getAgentOkBodyQanPostgresqlPgstatementsAgentTypeLogLevelPropEnum []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 { - getAgentOkBodyQanPostgresqlPgstatementsAgentTypeLogLevelPropEnum = append(getAgentOkBodyQanPostgresqlPgstatementsAgentTypeLogLevelPropEnum, v) - } -} - -const ( - - // GetAgentOKBodyQANPostgresqlPgstatementsAgentLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - GetAgentOKBodyQANPostgresqlPgstatementsAgentLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // GetAgentOKBodyQANPostgresqlPgstatementsAgentLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - GetAgentOKBodyQANPostgresqlPgstatementsAgentLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // GetAgentOKBodyQANPostgresqlPgstatementsAgentLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - GetAgentOKBodyQANPostgresqlPgstatementsAgentLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // GetAgentOKBodyQANPostgresqlPgstatementsAgentLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - GetAgentOKBodyQANPostgresqlPgstatementsAgentLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // GetAgentOKBodyQANPostgresqlPgstatementsAgentLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - GetAgentOKBodyQANPostgresqlPgstatementsAgentLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // GetAgentOKBodyQANPostgresqlPgstatementsAgentLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - GetAgentOKBodyQANPostgresqlPgstatementsAgentLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -func (o *GetAgentOKBodyQANPostgresqlPgstatementsAgent) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, getAgentOkBodyQanPostgresqlPgstatementsAgentTypeLogLevelPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *GetAgentOKBodyQANPostgresqlPgstatementsAgent) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("getAgentOk"+"."+"qan_postgresql_pgstatements_agent"+"."+"log_level", "body", *o.LogLevel); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this get agent OK body QAN postgresql pgstatements agent based on context it is used -func (o *GetAgentOKBodyQANPostgresqlPgstatementsAgent) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetAgentOKBodyQANPostgresqlPgstatementsAgent) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetAgentOKBodyQANPostgresqlPgstatementsAgent) UnmarshalBinary(b []byte) error { - var res GetAgentOKBodyQANPostgresqlPgstatementsAgent - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetAgentOKBodyQANPostgresqlPgstatmonitorAgent QANPostgreSQLPgStatMonitorAgent runs within pmm-agent and sends PostgreSQL Query Analytics data to the PMM Server. -swagger:model GetAgentOKBodyQANPostgresqlPgstatmonitorAgent -*/ -type GetAgentOKBodyQANPostgresqlPgstatmonitorAgent struct { - // Unique randomly generated instance identifier. - AgentID string `json:"agent_id,omitempty"` - - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `json:"disabled,omitempty"` - - // Service identifier. - ServiceID string `json:"service_id,omitempty"` - - // PostgreSQL username for getting pg stat monitor data. - Username string `json:"username,omitempty"` - - // Use TLS for database connections. - TLS bool `json:"tls,omitempty"` - - // Skip TLS certificate and hostname validation. - TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - - // Disable parsing comments from queries and showing them in QAN. - DisableCommentsParsing bool `json:"disable_comments_parsing,omitempty"` - - // Limit query length in QAN (default: server-defined; -1: no limit). - MaxQueryLength int32 `json:"max_query_length,omitempty"` - - // True if query examples are disabled. - QueryExamplesDisabled bool `json:"query_examples_disabled,omitempty"` - - // 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"` - - // 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 get agent OK body QAN postgresql pgstatmonitor agent -func (o *GetAgentOKBodyQANPostgresqlPgstatmonitorAgent) 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 getAgentOkBodyQanPostgresqlPgstatmonitorAgentTypeStatusPropEnum []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 { - getAgentOkBodyQanPostgresqlPgstatmonitorAgentTypeStatusPropEnum = append(getAgentOkBodyQanPostgresqlPgstatmonitorAgentTypeStatusPropEnum, v) - } -} - -const ( - - // GetAgentOKBodyQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - GetAgentOKBodyQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // GetAgentOKBodyQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - GetAgentOKBodyQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // GetAgentOKBodyQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - GetAgentOKBodyQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - - // GetAgentOKBodyQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - GetAgentOKBodyQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - - // GetAgentOKBodyQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - GetAgentOKBodyQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - - // GetAgentOKBodyQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - GetAgentOKBodyQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" - - // GetAgentOKBodyQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - GetAgentOKBodyQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" - - // GetAgentOKBodyQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - GetAgentOKBodyQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" -) - -// prop value enum -func (o *GetAgentOKBodyQANPostgresqlPgstatmonitorAgent) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, getAgentOkBodyQanPostgresqlPgstatmonitorAgentTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *GetAgentOKBodyQANPostgresqlPgstatmonitorAgent) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required - return nil - } - - // value enum - if err := o.validateStatusEnum("getAgentOk"+"."+"qan_postgresql_pgstatmonitor_agent"+"."+"status", "body", *o.Status); err != nil { - return err - } - - return nil -} - -var getAgentOkBodyQanPostgresqlPgstatmonitorAgentTypeLogLevelPropEnum []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 { - getAgentOkBodyQanPostgresqlPgstatmonitorAgentTypeLogLevelPropEnum = append(getAgentOkBodyQanPostgresqlPgstatmonitorAgentTypeLogLevelPropEnum, v) - } -} - -const ( - - // GetAgentOKBodyQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - GetAgentOKBodyQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // GetAgentOKBodyQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - GetAgentOKBodyQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // GetAgentOKBodyQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - GetAgentOKBodyQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // GetAgentOKBodyQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - GetAgentOKBodyQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // GetAgentOKBodyQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - GetAgentOKBodyQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // GetAgentOKBodyQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - GetAgentOKBodyQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -func (o *GetAgentOKBodyQANPostgresqlPgstatmonitorAgent) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, getAgentOkBodyQanPostgresqlPgstatmonitorAgentTypeLogLevelPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *GetAgentOKBodyQANPostgresqlPgstatmonitorAgent) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("getAgentOk"+"."+"qan_postgresql_pgstatmonitor_agent"+"."+"log_level", "body", *o.LogLevel); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this get agent OK body QAN postgresql pgstatmonitor agent based on context it is used -func (o *GetAgentOKBodyQANPostgresqlPgstatmonitorAgent) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetAgentOKBodyQANPostgresqlPgstatmonitorAgent) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetAgentOKBodyQANPostgresqlPgstatmonitorAgent) UnmarshalBinary(b []byte) error { - var res GetAgentOKBodyQANPostgresqlPgstatmonitorAgent - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetAgentOKBodyRDSExporter RDSExporter runs on Generic or Container Node and exposes RemoteRDS Node metrics. -swagger:model GetAgentOKBodyRDSExporter -*/ -type GetAgentOKBodyRDSExporter struct { - // Unique randomly generated instance identifier. - AgentID string `json:"agent_id,omitempty"` - - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `json:"disabled,omitempty"` - - // Node identifier. - NodeID string `json:"node_id,omitempty"` - - // AWS Access Key. - AWSAccessKey string `json:"aws_access_key,omitempty"` - - // 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"` - - // Basic metrics are disabled. - BasicMetricsDisabled bool `json:"basic_metrics_disabled,omitempty"` - - // Enhanced metrics are disabled. - EnhancedMetricsDisabled bool `json:"enhanced_metrics_disabled,omitempty"` - - // True if exporter uses push metrics mode. - PushMetricsEnabled bool `json:"push_metrics_enabled,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"` - - // metrics resolutions - MetricsResolutions *GetAgentOKBodyRDSExporterMetricsResolutions `json:"metrics_resolutions,omitempty"` -} - -// Validate validates this get agent OK body RDS exporter -func (o *GetAgentOKBodyRDSExporter) 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 getAgentOkBodyRdsExporterTypeStatusPropEnum []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 { - getAgentOkBodyRdsExporterTypeStatusPropEnum = append(getAgentOkBodyRdsExporterTypeStatusPropEnum, v) - } -} - -const ( - - // GetAgentOKBodyRDSExporterStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - GetAgentOKBodyRDSExporterStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // GetAgentOKBodyRDSExporterStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - GetAgentOKBodyRDSExporterStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // GetAgentOKBodyRDSExporterStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - GetAgentOKBodyRDSExporterStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - - // GetAgentOKBodyRDSExporterStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - GetAgentOKBodyRDSExporterStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - - // GetAgentOKBodyRDSExporterStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - GetAgentOKBodyRDSExporterStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - - // GetAgentOKBodyRDSExporterStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - GetAgentOKBodyRDSExporterStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" - - // GetAgentOKBodyRDSExporterStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - GetAgentOKBodyRDSExporterStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" - - // GetAgentOKBodyRDSExporterStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - GetAgentOKBodyRDSExporterStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" -) - -// prop value enum -func (o *GetAgentOKBodyRDSExporter) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, getAgentOkBodyRdsExporterTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *GetAgentOKBodyRDSExporter) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required - return nil - } - - // value enum - if err := o.validateStatusEnum("getAgentOk"+"."+"rds_exporter"+"."+"status", "body", *o.Status); err != nil { - return err - } - - return nil -} - -var getAgentOkBodyRdsExporterTypeLogLevelPropEnum []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 { - getAgentOkBodyRdsExporterTypeLogLevelPropEnum = append(getAgentOkBodyRdsExporterTypeLogLevelPropEnum, v) - } -} - -const ( - - // GetAgentOKBodyRDSExporterLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - GetAgentOKBodyRDSExporterLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // GetAgentOKBodyRDSExporterLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - GetAgentOKBodyRDSExporterLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // GetAgentOKBodyRDSExporterLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - GetAgentOKBodyRDSExporterLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // GetAgentOKBodyRDSExporterLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - GetAgentOKBodyRDSExporterLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // GetAgentOKBodyRDSExporterLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - GetAgentOKBodyRDSExporterLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // GetAgentOKBodyRDSExporterLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - GetAgentOKBodyRDSExporterLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -func (o *GetAgentOKBodyRDSExporter) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, getAgentOkBodyRdsExporterTypeLogLevelPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *GetAgentOKBodyRDSExporter) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("getAgentOk"+"."+"rds_exporter"+"."+"log_level", "body", *o.LogLevel); err != nil { - return err - } - - return nil -} - -func (o *GetAgentOKBodyRDSExporter) 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("getAgentOk" + "." + "rds_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getAgentOk" + "." + "rds_exporter" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this get agent OK body RDS exporter based on the context it is used -func (o *GetAgentOKBodyRDSExporter) 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 *GetAgentOKBodyRDSExporter) 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 { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getAgentOk" + "." + "rds_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getAgentOk" + "." + "rds_exporter" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetAgentOKBodyRDSExporter) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetAgentOKBodyRDSExporter) UnmarshalBinary(b []byte) error { - var res GetAgentOKBodyRDSExporter - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetAgentOKBodyRDSExporterMetricsResolutions MetricsResolutions represents Prometheus exporters metrics resolutions. -swagger:model GetAgentOKBodyRDSExporterMetricsResolutions -*/ -type GetAgentOKBodyRDSExporterMetricsResolutions struct { - // High resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Hr string `json:"hr,omitempty"` - - // Medium resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Mr string `json:"mr,omitempty"` - - // Low resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Lr string `json:"lr,omitempty"` -} - -// Validate validates this get agent OK body RDS exporter metrics resolutions -func (o *GetAgentOKBodyRDSExporterMetricsResolutions) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get agent OK body RDS exporter metrics resolutions based on context it is used -func (o *GetAgentOKBodyRDSExporterMetricsResolutions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetAgentOKBodyRDSExporterMetricsResolutions) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetAgentOKBodyRDSExporterMetricsResolutions) UnmarshalBinary(b []byte) error { - var res GetAgentOKBodyRDSExporterMetricsResolutions - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetAgentOKBodyValkeyExporter ValkeyExporter runs on Generic or Container Node and exposes Valkey Service metrics. -swagger:model GetAgentOKBodyValkeyExporter -*/ -type GetAgentOKBodyValkeyExporter struct { - // Unique randomly generated instance identifier. - AgentID string `json:"agent_id,omitempty"` - - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `json:"disabled,omitempty"` - - // Service identifier. - ServiceID string `json:"service_id,omitempty"` - - // Valkey username for scraping metrics. - Username string `json:"username,omitempty"` - - // Use TLS for database connections. - TLS bool `json:"tls,omitempty"` - - // Skip TLS certificate and hostname verification. - TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // True if exporter uses push metrics mode. - PushMetricsEnabled bool `json:"push_metrics_enabled,omitempty"` - - // 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"` - - // metrics resolutions - MetricsResolutions *GetAgentOKBodyValkeyExporterMetricsResolutions `json:"metrics_resolutions,omitempty"` -} - -// Validate validates this get agent OK body valkey exporter -func (o *GetAgentOKBodyValkeyExporter) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateStatus(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 getAgentOkBodyValkeyExporterTypeStatusPropEnum []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 { - getAgentOkBodyValkeyExporterTypeStatusPropEnum = append(getAgentOkBodyValkeyExporterTypeStatusPropEnum, v) - } -} - -const ( - - // GetAgentOKBodyValkeyExporterStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - GetAgentOKBodyValkeyExporterStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // GetAgentOKBodyValkeyExporterStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - GetAgentOKBodyValkeyExporterStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // GetAgentOKBodyValkeyExporterStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - GetAgentOKBodyValkeyExporterStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - - // GetAgentOKBodyValkeyExporterStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - GetAgentOKBodyValkeyExporterStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - - // GetAgentOKBodyValkeyExporterStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - GetAgentOKBodyValkeyExporterStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - - // GetAgentOKBodyValkeyExporterStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - GetAgentOKBodyValkeyExporterStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" - - // GetAgentOKBodyValkeyExporterStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - GetAgentOKBodyValkeyExporterStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" - - // GetAgentOKBodyValkeyExporterStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - GetAgentOKBodyValkeyExporterStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" -) - -// prop value enum -func (o *GetAgentOKBodyValkeyExporter) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, getAgentOkBodyValkeyExporterTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *GetAgentOKBodyValkeyExporter) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required - return nil - } - - // value enum - if err := o.validateStatusEnum("getAgentOk"+"."+"valkey_exporter"+"."+"status", "body", *o.Status); err != nil { - return err - } - - return nil -} - -func (o *GetAgentOKBodyValkeyExporter) 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("getAgentOk" + "." + "valkey_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getAgentOk" + "." + "valkey_exporter" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this get agent OK body valkey exporter based on the context it is used -func (o *GetAgentOKBodyValkeyExporter) 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 *GetAgentOKBodyValkeyExporter) 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 { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getAgentOk" + "." + "valkey_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getAgentOk" + "." + "valkey_exporter" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetAgentOKBodyValkeyExporter) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetAgentOKBodyValkeyExporter) UnmarshalBinary(b []byte) error { - var res GetAgentOKBodyValkeyExporter - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetAgentOKBodyValkeyExporterMetricsResolutions MetricsResolutions represents Prometheus exporters metrics resolutions. -swagger:model GetAgentOKBodyValkeyExporterMetricsResolutions -*/ -type GetAgentOKBodyValkeyExporterMetricsResolutions struct { - // High resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Hr string `json:"hr,omitempty"` - - // Medium resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Mr string `json:"mr,omitempty"` - - // Low resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Lr string `json:"lr,omitempty"` -} - -// Validate validates this get agent OK body valkey exporter metrics resolutions -func (o *GetAgentOKBodyValkeyExporterMetricsResolutions) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get agent OK body valkey exporter metrics resolutions based on context it is used -func (o *GetAgentOKBodyValkeyExporterMetricsResolutions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetAgentOKBodyValkeyExporterMetricsResolutions) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetAgentOKBodyValkeyExporterMetricsResolutions) UnmarshalBinary(b []byte) error { - var res GetAgentOKBodyValkeyExporterMetricsResolutions - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetAgentOKBodyVmagent VMAgent runs on Generic or Container Node alongside pmm-agent. -// It scrapes other exporter Agents that are configured with push_metrics_enabled -// and uses Prometheus remote write protocol to push metrics to PMM Server. -swagger:model GetAgentOKBodyVmagent -*/ -type GetAgentOKBodyVmagent struct { - // Unique randomly generated instance identifier. - AgentID string `json:"agent_id,omitempty"` - - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,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"` - - // Path to exec process. - ProcessExecPath string `json:"process_exec_path,omitempty"` - - // Listen port for scraping metrics. - ListenPort int64 `json:"listen_port,omitempty"` -} - -// Validate validates this get agent OK body vmagent -func (o *GetAgentOKBodyVmagent) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateStatus(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var getAgentOkBodyVmagentTypeStatusPropEnum []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 { - getAgentOkBodyVmagentTypeStatusPropEnum = append(getAgentOkBodyVmagentTypeStatusPropEnum, v) - } -} - -const ( - - // GetAgentOKBodyVmagentStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - GetAgentOKBodyVmagentStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // GetAgentOKBodyVmagentStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - GetAgentOKBodyVmagentStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // GetAgentOKBodyVmagentStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - GetAgentOKBodyVmagentStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - - // GetAgentOKBodyVmagentStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - GetAgentOKBodyVmagentStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - - // GetAgentOKBodyVmagentStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - GetAgentOKBodyVmagentStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - - // GetAgentOKBodyVmagentStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - GetAgentOKBodyVmagentStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" - - // GetAgentOKBodyVmagentStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - GetAgentOKBodyVmagentStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" - - // GetAgentOKBodyVmagentStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - GetAgentOKBodyVmagentStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" -) - -// prop value enum -func (o *GetAgentOKBodyVmagent) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, getAgentOkBodyVmagentTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *GetAgentOKBodyVmagent) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required - return nil - } - - // value enum - if err := o.validateStatusEnum("getAgentOk"+"."+"vmagent"+"."+"status", "body", *o.Status); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this get agent OK body vmagent based on context it is used -func (o *GetAgentOKBodyVmagent) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetAgentOKBodyVmagent) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetAgentOKBodyVmagent) UnmarshalBinary(b []byte) error { - var res GetAgentOKBodyVmagent - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/inventory/v1/json/client/agents_service/list_agents_parameters.go b/api/inventory/v1/json/client/agents_service/list_agents_parameters.go deleted file mode 100644 index 371c8f77c34..00000000000 --- a/api/inventory/v1/json/client/agents_service/list_agents_parameters.go +++ /dev/null @@ -1,273 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package agents_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" -) - -// NewListAgentsParams creates a new ListAgentsParams 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 NewListAgentsParams() *ListAgentsParams { - return &ListAgentsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListAgentsParamsWithTimeout creates a new ListAgentsParams object -// with the ability to set a timeout on a request. -func NewListAgentsParamsWithTimeout(timeout time.Duration) *ListAgentsParams { - return &ListAgentsParams{ - timeout: timeout, - } -} - -// NewListAgentsParamsWithContext creates a new ListAgentsParams object -// with the ability to set a context for a request. -func NewListAgentsParamsWithContext(ctx context.Context) *ListAgentsParams { - return &ListAgentsParams{ - Context: ctx, - } -} - -// NewListAgentsParamsWithHTTPClient creates a new ListAgentsParams object -// with the ability to set a custom HTTPClient for a request. -func NewListAgentsParamsWithHTTPClient(client *http.Client) *ListAgentsParams { - return &ListAgentsParams{ - HTTPClient: client, - } -} - -/* -ListAgentsParams contains all the parameters to send to the API endpoint - - for the list agents operation. - - Typically these are written to a http.Request. -*/ -type ListAgentsParams struct { - /* AgentType. - - Return only agents of a particular type. - - Default: "AGENT_TYPE_UNSPECIFIED" - */ - AgentType *string - - /* NodeID. - - Return only Agents that provide insights for that Node. - Exactly one of these parameters should be present: pmm_agent_id, node_id, service_id. - */ - NodeID *string - - /* PMMAgentID. - - Return only Agents started by this pmm-agent. - Exactly one of these parameters should be present: pmm_agent_id, node_id, service_id. - */ - PMMAgentID *string - - /* ServiceID. - - Return only Agents that provide insights for that Service. - Exactly one of these parameters should be present: pmm_agent_id, node_id, service_id. - */ - ServiceID *string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list agents params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListAgentsParams) WithDefaults() *ListAgentsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list agents params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListAgentsParams) SetDefaults() { - agentTypeDefault := string("AGENT_TYPE_UNSPECIFIED") - - val := ListAgentsParams{ - AgentType: &agentTypeDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the list agents params -func (o *ListAgentsParams) WithTimeout(timeout time.Duration) *ListAgentsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list agents params -func (o *ListAgentsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list agents params -func (o *ListAgentsParams) WithContext(ctx context.Context) *ListAgentsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list agents params -func (o *ListAgentsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list agents params -func (o *ListAgentsParams) WithHTTPClient(client *http.Client) *ListAgentsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list agents params -func (o *ListAgentsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithAgentType adds the agentType to the list agents params -func (o *ListAgentsParams) WithAgentType(agentType *string) *ListAgentsParams { - o.SetAgentType(agentType) - return o -} - -// SetAgentType adds the agentType to the list agents params -func (o *ListAgentsParams) SetAgentType(agentType *string) { - o.AgentType = agentType -} - -// WithNodeID adds the nodeID to the list agents params -func (o *ListAgentsParams) WithNodeID(nodeID *string) *ListAgentsParams { - o.SetNodeID(nodeID) - return o -} - -// SetNodeID adds the nodeId to the list agents params -func (o *ListAgentsParams) SetNodeID(nodeID *string) { - o.NodeID = nodeID -} - -// WithPMMAgentID adds the pMMAgentID to the list agents params -func (o *ListAgentsParams) WithPMMAgentID(pMMAgentID *string) *ListAgentsParams { - o.SetPMMAgentID(pMMAgentID) - return o -} - -// SetPMMAgentID adds the pmmAgentId to the list agents params -func (o *ListAgentsParams) SetPMMAgentID(pMMAgentID *string) { - o.PMMAgentID = pMMAgentID -} - -// WithServiceID adds the serviceID to the list agents params -func (o *ListAgentsParams) WithServiceID(serviceID *string) *ListAgentsParams { - o.SetServiceID(serviceID) - return o -} - -// SetServiceID adds the serviceId to the list agents params -func (o *ListAgentsParams) SetServiceID(serviceID *string) { - o.ServiceID = serviceID -} - -// 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 - } - var res []error - - if o.AgentType != nil { - - // query param agent_type - var qrAgentType string - - if o.AgentType != nil { - qrAgentType = *o.AgentType - } - qAgentType := qrAgentType - if qAgentType != "" { - if err := r.SetQueryParam("agent_type", qAgentType); err != nil { - return err - } - } - } - - if o.NodeID != nil { - - // query param node_id - var qrNodeID string - - if o.NodeID != nil { - qrNodeID = *o.NodeID - } - qNodeID := qrNodeID - if qNodeID != "" { - if err := r.SetQueryParam("node_id", qNodeID); err != nil { - return err - } - } - } - - if o.PMMAgentID != nil { - - // query param pmm_agent_id - var qrPMMAgentID string - - if o.PMMAgentID != nil { - qrPMMAgentID = *o.PMMAgentID - } - qPMMAgentID := qrPMMAgentID - if qPMMAgentID != "" { - if err := r.SetQueryParam("pmm_agent_id", qPMMAgentID); err != nil { - return err - } - } - } - - if o.ServiceID != nil { - - // query param service_id - var qrServiceID string - - if o.ServiceID != nil { - qrServiceID = *o.ServiceID - } - qServiceID := qrServiceID - if qServiceID != "" { - if err := r.SetQueryParam("service_id", qServiceID); err != nil { - return err - } - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/api/inventory/v1/json/client/agents_service/list_agents_responses.go b/api/inventory/v1/json/client/agents_service/list_agents_responses.go deleted file mode 100644 index 4829432f892..00000000000 --- a/api/inventory/v1/json/client/agents_service/list_agents_responses.go +++ /dev/null @@ -1,6001 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package agents_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" -) - -// ListAgentsReader is a Reader for the ListAgents structure. -type ListAgentsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListAgentsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewListAgentsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewListAgentsDefault(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 - } -} - -// NewListAgentsOK creates a ListAgentsOK with default headers values -func NewListAgentsOK() *ListAgentsOK { - return &ListAgentsOK{} -} - -/* -ListAgentsOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type ListAgentsOK struct { - Payload *ListAgentsOKBody -} - -// IsSuccess returns true when this list agents Ok response has a 2xx status code -func (o *ListAgentsOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this list agents Ok response has a 3xx status code -func (o *ListAgentsOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this list agents Ok response has a 4xx status code -func (o *ListAgentsOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this list agents Ok response has a 5xx status code -func (o *ListAgentsOK) IsServerError() bool { - return false -} - -// IsCode returns true when this list agents Ok response a status code equal to that given -func (o *ListAgentsOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the list agents Ok response -func (o *ListAgentsOK) Code() int { - return 200 -} - -func (o *ListAgentsOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/inventory/agents][%d] listAgentsOk %s", 200, payload) -} - -func (o *ListAgentsOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/inventory/agents][%d] listAgentsOk %s", 200, payload) -} - -func (o *ListAgentsOK) GetPayload() *ListAgentsOKBody { - return o.Payload -} - -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) { - return err - } - - return nil -} - -// NewListAgentsDefault creates a ListAgentsDefault with default headers values -func NewListAgentsDefault(code int) *ListAgentsDefault { - return &ListAgentsDefault{ - _statusCode: code, - } -} - -/* -ListAgentsDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type ListAgentsDefault struct { - _statusCode int - - Payload *ListAgentsDefaultBody -} - -// IsSuccess returns true when this list agents default response has a 2xx status code -func (o *ListAgentsDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this list agents default response has a 3xx status code -func (o *ListAgentsDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this list agents default response has a 4xx status code -func (o *ListAgentsDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this list agents default response has a 5xx status code -func (o *ListAgentsDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this list agents default response a status code equal to that given -func (o *ListAgentsDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the list agents default response -func (o *ListAgentsDefault) Code() int { - return o._statusCode -} - -func (o *ListAgentsDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/inventory/agents][%d] ListAgents default %s", o._statusCode, payload) -} - -func (o *ListAgentsDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/inventory/agents][%d] ListAgents default %s", o._statusCode, payload) -} - -func (o *ListAgentsDefault) GetPayload() *ListAgentsDefaultBody { - return o.Payload -} - -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) { - return err - } - - return nil -} - -/* -ListAgentsDefaultBody list agents default body -swagger:model ListAgentsDefaultBody -*/ -type ListAgentsDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*ListAgentsDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this list agents default body -func (o *ListAgentsDefaultBody) 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 *ListAgentsDefaultBody) 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("ListAgents default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("ListAgents default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this list agents default body based on the context it is used -func (o *ListAgentsDefaultBody) 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 *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 - return nil - } - - if err := o.Details[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("ListAgents default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("ListAgents default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListAgentsDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAgentsDefaultBody) UnmarshalBinary(b []byte) error { - var res ListAgentsDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -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:"-"` -} - -// 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"` - } - if err := json.Unmarshal(data, &stage1); err != nil { - return err - } - var rcv ListAgentsDefaultBodyDetailsItems0 - - 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.ListAgentsDefaultBodyDetailsItems0 = result - } - - return nil -} - -// 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"` - } - - stage1.AtType = o.AtType - - // make JSON object for known properties - props, err := json.Marshal(stage1) - if err != nil { - return nil, err - } - - if len(o.ListAgentsDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.ListAgentsDefaultBodyDetailsItems0) - 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 list agents default body details items0 -func (o *ListAgentsDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list agents default body details items0 based on context it is used -func (o *ListAgentsDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListAgentsDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAgentsDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res ListAgentsDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListAgentsOKBody list agents OK body -swagger:model ListAgentsOKBody -*/ -type ListAgentsOKBody struct { - // pmm agent - PMMAgent []*ListAgentsOKBodyPMMAgentItems0 `json:"pmm_agent"` - - // vm agent - VMAgent []*ListAgentsOKBodyVMAgentItems0 `json:"vm_agent"` - - // node exporter - NodeExporter []*ListAgentsOKBodyNodeExporterItems0 `json:"node_exporter"` - - // mysqld exporter - MysqldExporter []*ListAgentsOKBodyMysqldExporterItems0 `json:"mysqld_exporter"` - - // mongodb exporter - MongodbExporter []*ListAgentsOKBodyMongodbExporterItems0 `json:"mongodb_exporter"` - - // postgres exporter - PostgresExporter []*ListAgentsOKBodyPostgresExporterItems0 `json:"postgres_exporter"` - - // proxysql exporter - ProxysqlExporter []*ListAgentsOKBodyProxysqlExporterItems0 `json:"proxysql_exporter"` - - // qan mysql perfschema agent - QANMysqlPerfschemaAgent []*ListAgentsOKBodyQANMysqlPerfschemaAgentItems0 `json:"qan_mysql_perfschema_agent"` - - // qan mysql slowlog agent - QANMysqlSlowlogAgent []*ListAgentsOKBodyQANMysqlSlowlogAgentItems0 `json:"qan_mysql_slowlog_agent"` - - // qan mongodb profiler agent - QANMongodbProfilerAgent []*ListAgentsOKBodyQANMongodbProfilerAgentItems0 `json:"qan_mongodb_profiler_agent"` - - // qan mongodb mongolog agent - QANMongodbMongologAgent []*ListAgentsOKBodyQANMongodbMongologAgentItems0 `json:"qan_mongodb_mongolog_agent"` - - // qan postgresql pgstatements agent - QANPostgresqlPgstatementsAgent []*ListAgentsOKBodyQANPostgresqlPgstatementsAgentItems0 `json:"qan_postgresql_pgstatements_agent"` - - // qan postgresql pgstatmonitor agent - QANPostgresqlPgstatmonitorAgent []*ListAgentsOKBodyQANPostgresqlPgstatmonitorAgentItems0 `json:"qan_postgresql_pgstatmonitor_agent"` - - // external exporter - ExternalExporter []*ListAgentsOKBodyExternalExporterItems0 `json:"external_exporter"` - - // rds exporter - RDSExporter []*ListAgentsOKBodyRDSExporterItems0 `json:"rds_exporter"` - - // azure database exporter - AzureDatabaseExporter []*ListAgentsOKBodyAzureDatabaseExporterItems0 `json:"azure_database_exporter"` - - // nomad agent - NomadAgent []*ListAgentsOKBodyNomadAgentItems0 `json:"nomad_agent"` - - // valkey exporter - ValkeyExporter []*ListAgentsOKBodyValkeyExporterItems0 `json:"valkey_exporter"` -} - -// Validate validates this list agents OK body -func (o *ListAgentsOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validatePMMAgent(formats); err != nil { - res = append(res, err) - } - - if err := o.validateVMAgent(formats); err != nil { - res = append(res, err) - } - - if err := o.validateNodeExporter(formats); err != nil { - res = append(res, err) - } - - if err := o.validateMysqldExporter(formats); err != nil { - res = append(res, err) - } - - if err := o.validateMongodbExporter(formats); err != nil { - res = append(res, err) - } - - if err := o.validatePostgresExporter(formats); err != nil { - res = append(res, err) - } - - if err := o.validateProxysqlExporter(formats); err != nil { - res = append(res, err) - } - - if err := o.validateQANMysqlPerfschemaAgent(formats); err != nil { - res = append(res, err) - } - - if err := o.validateQANMysqlSlowlogAgent(formats); err != nil { - res = append(res, err) - } - - if err := o.validateQANMongodbProfilerAgent(formats); err != nil { - res = append(res, err) - } - - if err := o.validateQANMongodbMongologAgent(formats); err != nil { - res = append(res, err) - } - - if err := o.validateQANPostgresqlPgstatementsAgent(formats); err != nil { - res = append(res, err) - } - - if err := o.validateQANPostgresqlPgstatmonitorAgent(formats); err != nil { - res = append(res, err) - } - - if err := o.validateExternalExporter(formats); err != nil { - res = append(res, err) - } - - if err := o.validateRDSExporter(formats); err != nil { - res = append(res, err) - } - - if err := o.validateAzureDatabaseExporter(formats); err != nil { - res = append(res, err) - } - - if err := o.validateNomadAgent(formats); err != nil { - res = append(res, err) - } - - if err := o.validateValkeyExporter(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListAgentsOKBody) validatePMMAgent(formats strfmt.Registry) error { - if swag.IsZero(o.PMMAgent) { // not required - return nil - } - - for i := 0; i < len(o.PMMAgent); i++ { - if swag.IsZero(o.PMMAgent[i]) { // not required - continue - } - - if o.PMMAgent[i] != nil { - if err := o.PMMAgent[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listAgentsOk" + "." + "pmm_agent" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listAgentsOk" + "." + "pmm_agent" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -func (o *ListAgentsOKBody) validateVMAgent(formats strfmt.Registry) error { - if swag.IsZero(o.VMAgent) { // not required - return nil - } - - for i := 0; i < len(o.VMAgent); i++ { - if swag.IsZero(o.VMAgent[i]) { // not required - continue - } - - if o.VMAgent[i] != nil { - if err := o.VMAgent[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listAgentsOk" + "." + "vm_agent" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listAgentsOk" + "." + "vm_agent" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -func (o *ListAgentsOKBody) validateNodeExporter(formats strfmt.Registry) error { - if swag.IsZero(o.NodeExporter) { // not required - return nil - } - - for i := 0; i < len(o.NodeExporter); i++ { - if swag.IsZero(o.NodeExporter[i]) { // not required - continue - } - - if o.NodeExporter[i] != nil { - if err := o.NodeExporter[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listAgentsOk" + "." + "node_exporter" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listAgentsOk" + "." + "node_exporter" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -func (o *ListAgentsOKBody) validateMysqldExporter(formats strfmt.Registry) error { - if swag.IsZero(o.MysqldExporter) { // not required - return nil - } - - for i := 0; i < len(o.MysqldExporter); i++ { - if swag.IsZero(o.MysqldExporter[i]) { // not required - continue - } - - if o.MysqldExporter[i] != nil { - if err := o.MysqldExporter[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listAgentsOk" + "." + "mysqld_exporter" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listAgentsOk" + "." + "mysqld_exporter" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -func (o *ListAgentsOKBody) validateMongodbExporter(formats strfmt.Registry) error { - if swag.IsZero(o.MongodbExporter) { // not required - return nil - } - - for i := 0; i < len(o.MongodbExporter); i++ { - if swag.IsZero(o.MongodbExporter[i]) { // not required - continue - } - - if o.MongodbExporter[i] != nil { - if err := o.MongodbExporter[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listAgentsOk" + "." + "mongodb_exporter" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listAgentsOk" + "." + "mongodb_exporter" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -func (o *ListAgentsOKBody) validatePostgresExporter(formats strfmt.Registry) error { - if swag.IsZero(o.PostgresExporter) { // not required - return nil - } - - for i := 0; i < len(o.PostgresExporter); i++ { - if swag.IsZero(o.PostgresExporter[i]) { // not required - continue - } - - if o.PostgresExporter[i] != nil { - if err := o.PostgresExporter[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listAgentsOk" + "." + "postgres_exporter" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listAgentsOk" + "." + "postgres_exporter" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -func (o *ListAgentsOKBody) validateProxysqlExporter(formats strfmt.Registry) error { - if swag.IsZero(o.ProxysqlExporter) { // not required - return nil - } - - for i := 0; i < len(o.ProxysqlExporter); i++ { - if swag.IsZero(o.ProxysqlExporter[i]) { // not required - continue - } - - if o.ProxysqlExporter[i] != nil { - if err := o.ProxysqlExporter[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listAgentsOk" + "." + "proxysql_exporter" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listAgentsOk" + "." + "proxysql_exporter" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -func (o *ListAgentsOKBody) validateQANMysqlPerfschemaAgent(formats strfmt.Registry) error { - if swag.IsZero(o.QANMysqlPerfschemaAgent) { // not required - return nil - } - - for i := 0; i < len(o.QANMysqlPerfschemaAgent); i++ { - if swag.IsZero(o.QANMysqlPerfschemaAgent[i]) { // not required - continue - } - - if o.QANMysqlPerfschemaAgent[i] != nil { - if err := o.QANMysqlPerfschemaAgent[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listAgentsOk" + "." + "qan_mysql_perfschema_agent" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listAgentsOk" + "." + "qan_mysql_perfschema_agent" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -func (o *ListAgentsOKBody) validateQANMysqlSlowlogAgent(formats strfmt.Registry) error { - if swag.IsZero(o.QANMysqlSlowlogAgent) { // not required - return nil - } - - for i := 0; i < len(o.QANMysqlSlowlogAgent); i++ { - if swag.IsZero(o.QANMysqlSlowlogAgent[i]) { // not required - continue - } - - if o.QANMysqlSlowlogAgent[i] != nil { - if err := o.QANMysqlSlowlogAgent[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listAgentsOk" + "." + "qan_mysql_slowlog_agent" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listAgentsOk" + "." + "qan_mysql_slowlog_agent" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -func (o *ListAgentsOKBody) validateQANMongodbProfilerAgent(formats strfmt.Registry) error { - if swag.IsZero(o.QANMongodbProfilerAgent) { // not required - return nil - } - - for i := 0; i < len(o.QANMongodbProfilerAgent); i++ { - if swag.IsZero(o.QANMongodbProfilerAgent[i]) { // not required - continue - } - - if o.QANMongodbProfilerAgent[i] != nil { - if err := o.QANMongodbProfilerAgent[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listAgentsOk" + "." + "qan_mongodb_profiler_agent" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listAgentsOk" + "." + "qan_mongodb_profiler_agent" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -func (o *ListAgentsOKBody) validateQANMongodbMongologAgent(formats strfmt.Registry) error { - if swag.IsZero(o.QANMongodbMongologAgent) { // not required - return nil - } - - for i := 0; i < len(o.QANMongodbMongologAgent); i++ { - if swag.IsZero(o.QANMongodbMongologAgent[i]) { // not required - continue - } - - if o.QANMongodbMongologAgent[i] != nil { - if err := o.QANMongodbMongologAgent[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listAgentsOk" + "." + "qan_mongodb_mongolog_agent" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listAgentsOk" + "." + "qan_mongodb_mongolog_agent" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -func (o *ListAgentsOKBody) validateQANPostgresqlPgstatementsAgent(formats strfmt.Registry) error { - if swag.IsZero(o.QANPostgresqlPgstatementsAgent) { // not required - return nil - } - - for i := 0; i < len(o.QANPostgresqlPgstatementsAgent); i++ { - if swag.IsZero(o.QANPostgresqlPgstatementsAgent[i]) { // not required - continue - } - - if o.QANPostgresqlPgstatementsAgent[i] != nil { - if err := o.QANPostgresqlPgstatementsAgent[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listAgentsOk" + "." + "qan_postgresql_pgstatements_agent" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listAgentsOk" + "." + "qan_postgresql_pgstatements_agent" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -func (o *ListAgentsOKBody) validateQANPostgresqlPgstatmonitorAgent(formats strfmt.Registry) error { - if swag.IsZero(o.QANPostgresqlPgstatmonitorAgent) { // not required - return nil - } - - for i := 0; i < len(o.QANPostgresqlPgstatmonitorAgent); i++ { - if swag.IsZero(o.QANPostgresqlPgstatmonitorAgent[i]) { // not required - continue - } - - if o.QANPostgresqlPgstatmonitorAgent[i] != nil { - if err := o.QANPostgresqlPgstatmonitorAgent[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listAgentsOk" + "." + "qan_postgresql_pgstatmonitor_agent" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listAgentsOk" + "." + "qan_postgresql_pgstatmonitor_agent" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -func (o *ListAgentsOKBody) validateExternalExporter(formats strfmt.Registry) error { - if swag.IsZero(o.ExternalExporter) { // not required - return nil - } - - for i := 0; i < len(o.ExternalExporter); i++ { - if swag.IsZero(o.ExternalExporter[i]) { // not required - continue - } - - if o.ExternalExporter[i] != nil { - if err := o.ExternalExporter[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listAgentsOk" + "." + "external_exporter" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listAgentsOk" + "." + "external_exporter" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -func (o *ListAgentsOKBody) validateRDSExporter(formats strfmt.Registry) error { - if swag.IsZero(o.RDSExporter) { // not required - return nil - } - - for i := 0; i < len(o.RDSExporter); i++ { - if swag.IsZero(o.RDSExporter[i]) { // not required - continue - } - - if o.RDSExporter[i] != nil { - if err := o.RDSExporter[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listAgentsOk" + "." + "rds_exporter" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listAgentsOk" + "." + "rds_exporter" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -func (o *ListAgentsOKBody) validateAzureDatabaseExporter(formats strfmt.Registry) error { - if swag.IsZero(o.AzureDatabaseExporter) { // not required - return nil - } - - for i := 0; i < len(o.AzureDatabaseExporter); i++ { - if swag.IsZero(o.AzureDatabaseExporter[i]) { // not required - continue - } - - if o.AzureDatabaseExporter[i] != nil { - if err := o.AzureDatabaseExporter[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listAgentsOk" + "." + "azure_database_exporter" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listAgentsOk" + "." + "azure_database_exporter" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -func (o *ListAgentsOKBody) validateNomadAgent(formats strfmt.Registry) error { - if swag.IsZero(o.NomadAgent) { // not required - return nil - } - - for i := 0; i < len(o.NomadAgent); i++ { - if swag.IsZero(o.NomadAgent[i]) { // not required - continue - } - - if o.NomadAgent[i] != nil { - if err := o.NomadAgent[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listAgentsOk" + "." + "nomad_agent" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listAgentsOk" + "." + "nomad_agent" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -func (o *ListAgentsOKBody) validateValkeyExporter(formats strfmt.Registry) error { - if swag.IsZero(o.ValkeyExporter) { // not required - return nil - } - - for i := 0; i < len(o.ValkeyExporter); i++ { - if swag.IsZero(o.ValkeyExporter[i]) { // not required - continue - } - - if o.ValkeyExporter[i] != nil { - if err := o.ValkeyExporter[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listAgentsOk" + "." + "valkey_exporter" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listAgentsOk" + "." + "valkey_exporter" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this list agents OK body based on the context it is used -func (o *ListAgentsOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidatePMMAgent(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateVMAgent(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateNodeExporter(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateMysqldExporter(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateMongodbExporter(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidatePostgresExporter(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateProxysqlExporter(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateQANMysqlPerfschemaAgent(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateQANMysqlSlowlogAgent(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateQANMongodbProfilerAgent(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateQANMongodbMongologAgent(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateQANPostgresqlPgstatementsAgent(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateQANPostgresqlPgstatmonitorAgent(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateExternalExporter(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateRDSExporter(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateAzureDatabaseExporter(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateNomadAgent(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateValkeyExporter(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListAgentsOKBody) contextValidatePMMAgent(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.PMMAgent); i++ { - if o.PMMAgent[i] != nil { - - if swag.IsZero(o.PMMAgent[i]) { // not required - return nil - } - - if err := o.PMMAgent[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listAgentsOk" + "." + "pmm_agent" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listAgentsOk" + "." + "pmm_agent" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -func (o *ListAgentsOKBody) contextValidateVMAgent(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.VMAgent); i++ { - if o.VMAgent[i] != nil { - - if swag.IsZero(o.VMAgent[i]) { // not required - return nil - } - - if err := o.VMAgent[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listAgentsOk" + "." + "vm_agent" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listAgentsOk" + "." + "vm_agent" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -func (o *ListAgentsOKBody) contextValidateNodeExporter(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.NodeExporter); i++ { - if o.NodeExporter[i] != nil { - - if swag.IsZero(o.NodeExporter[i]) { // not required - return nil - } - - if err := o.NodeExporter[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listAgentsOk" + "." + "node_exporter" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listAgentsOk" + "." + "node_exporter" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -func (o *ListAgentsOKBody) contextValidateMysqldExporter(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.MysqldExporter); i++ { - if o.MysqldExporter[i] != nil { - - if swag.IsZero(o.MysqldExporter[i]) { // not required - return nil - } - - if err := o.MysqldExporter[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listAgentsOk" + "." + "mysqld_exporter" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listAgentsOk" + "." + "mysqld_exporter" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -func (o *ListAgentsOKBody) contextValidateMongodbExporter(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.MongodbExporter); i++ { - if o.MongodbExporter[i] != nil { - - if swag.IsZero(o.MongodbExporter[i]) { // not required - return nil - } - - if err := o.MongodbExporter[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listAgentsOk" + "." + "mongodb_exporter" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listAgentsOk" + "." + "mongodb_exporter" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -func (o *ListAgentsOKBody) contextValidatePostgresExporter(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.PostgresExporter); i++ { - if o.PostgresExporter[i] != nil { - - if swag.IsZero(o.PostgresExporter[i]) { // not required - return nil - } - - if err := o.PostgresExporter[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listAgentsOk" + "." + "postgres_exporter" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listAgentsOk" + "." + "postgres_exporter" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -func (o *ListAgentsOKBody) contextValidateProxysqlExporter(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.ProxysqlExporter); i++ { - if o.ProxysqlExporter[i] != nil { - - if swag.IsZero(o.ProxysqlExporter[i]) { // not required - return nil - } - - if err := o.ProxysqlExporter[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listAgentsOk" + "." + "proxysql_exporter" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listAgentsOk" + "." + "proxysql_exporter" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -func (o *ListAgentsOKBody) contextValidateQANMysqlPerfschemaAgent(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.QANMysqlPerfschemaAgent); i++ { - if o.QANMysqlPerfschemaAgent[i] != nil { - - if swag.IsZero(o.QANMysqlPerfschemaAgent[i]) { // not required - return nil - } - - if err := o.QANMysqlPerfschemaAgent[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listAgentsOk" + "." + "qan_mysql_perfschema_agent" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listAgentsOk" + "." + "qan_mysql_perfschema_agent" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -func (o *ListAgentsOKBody) contextValidateQANMysqlSlowlogAgent(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.QANMysqlSlowlogAgent); i++ { - if o.QANMysqlSlowlogAgent[i] != nil { - - if swag.IsZero(o.QANMysqlSlowlogAgent[i]) { // not required - return nil - } - - if err := o.QANMysqlSlowlogAgent[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listAgentsOk" + "." + "qan_mysql_slowlog_agent" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listAgentsOk" + "." + "qan_mysql_slowlog_agent" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -func (o *ListAgentsOKBody) contextValidateQANMongodbProfilerAgent(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.QANMongodbProfilerAgent); i++ { - if o.QANMongodbProfilerAgent[i] != nil { - - if swag.IsZero(o.QANMongodbProfilerAgent[i]) { // not required - return nil - } - - if err := o.QANMongodbProfilerAgent[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listAgentsOk" + "." + "qan_mongodb_profiler_agent" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listAgentsOk" + "." + "qan_mongodb_profiler_agent" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -func (o *ListAgentsOKBody) contextValidateQANMongodbMongologAgent(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.QANMongodbMongologAgent); i++ { - if o.QANMongodbMongologAgent[i] != nil { - - if swag.IsZero(o.QANMongodbMongologAgent[i]) { // not required - return nil - } - - if err := o.QANMongodbMongologAgent[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listAgentsOk" + "." + "qan_mongodb_mongolog_agent" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listAgentsOk" + "." + "qan_mongodb_mongolog_agent" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -func (o *ListAgentsOKBody) contextValidateQANPostgresqlPgstatementsAgent(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.QANPostgresqlPgstatementsAgent); i++ { - if o.QANPostgresqlPgstatementsAgent[i] != nil { - - if swag.IsZero(o.QANPostgresqlPgstatementsAgent[i]) { // not required - return nil - } - - if err := o.QANPostgresqlPgstatementsAgent[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listAgentsOk" + "." + "qan_postgresql_pgstatements_agent" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listAgentsOk" + "." + "qan_postgresql_pgstatements_agent" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -func (o *ListAgentsOKBody) contextValidateQANPostgresqlPgstatmonitorAgent(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.QANPostgresqlPgstatmonitorAgent); i++ { - if o.QANPostgresqlPgstatmonitorAgent[i] != nil { - - if swag.IsZero(o.QANPostgresqlPgstatmonitorAgent[i]) { // not required - return nil - } - - if err := o.QANPostgresqlPgstatmonitorAgent[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listAgentsOk" + "." + "qan_postgresql_pgstatmonitor_agent" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listAgentsOk" + "." + "qan_postgresql_pgstatmonitor_agent" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -func (o *ListAgentsOKBody) contextValidateExternalExporter(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.ExternalExporter); i++ { - if o.ExternalExporter[i] != nil { - - if swag.IsZero(o.ExternalExporter[i]) { // not required - return nil - } - - if err := o.ExternalExporter[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listAgentsOk" + "." + "external_exporter" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listAgentsOk" + "." + "external_exporter" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -func (o *ListAgentsOKBody) contextValidateRDSExporter(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.RDSExporter); i++ { - if o.RDSExporter[i] != nil { - - if swag.IsZero(o.RDSExporter[i]) { // not required - return nil - } - - if err := o.RDSExporter[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listAgentsOk" + "." + "rds_exporter" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listAgentsOk" + "." + "rds_exporter" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -func (o *ListAgentsOKBody) contextValidateAzureDatabaseExporter(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.AzureDatabaseExporter); i++ { - if o.AzureDatabaseExporter[i] != nil { - - if swag.IsZero(o.AzureDatabaseExporter[i]) { // not required - return nil - } - - if err := o.AzureDatabaseExporter[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listAgentsOk" + "." + "azure_database_exporter" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listAgentsOk" + "." + "azure_database_exporter" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -func (o *ListAgentsOKBody) contextValidateNomadAgent(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.NomadAgent); i++ { - if o.NomadAgent[i] != nil { - - if swag.IsZero(o.NomadAgent[i]) { // not required - return nil - } - - if err := o.NomadAgent[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listAgentsOk" + "." + "nomad_agent" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listAgentsOk" + "." + "nomad_agent" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -func (o *ListAgentsOKBody) contextValidateValkeyExporter(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.ValkeyExporter); i++ { - if o.ValkeyExporter[i] != nil { - - if swag.IsZero(o.ValkeyExporter[i]) { // not required - return nil - } - - if err := o.ValkeyExporter[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listAgentsOk" + "." + "valkey_exporter" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listAgentsOk" + "." + "valkey_exporter" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListAgentsOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAgentsOKBody) UnmarshalBinary(b []byte) error { - var res ListAgentsOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListAgentsOKBodyAzureDatabaseExporterItems0 AzureDatabaseExporter runs on Generic or Container Node and exposes RemoteAzure Node metrics. -swagger:model ListAgentsOKBodyAzureDatabaseExporterItems0 -*/ -type ListAgentsOKBodyAzureDatabaseExporterItems0 struct { - // Unique randomly generated instance identifier. - AgentID string `json:"agent_id,omitempty"` - - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `json:"disabled,omitempty"` - - // Node identifier. - NodeID string `json:"node_id,omitempty"` - - // Azure database subscription ID. - AzureDatabaseSubscriptionID string `json:"azure_database_subscription_id,omitempty"` - - // Azure database resource type (mysql, maria, postgres) - AzureDatabaseResourceType string `json:"azure_database_resource_type,omitempty"` - - // 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"` - - // True if the exporter operates in push metrics mode. - PushMetricsEnabled bool `json:"push_metrics_enabled,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"` - - // metrics resolutions - MetricsResolutions *ListAgentsOKBodyAzureDatabaseExporterItems0MetricsResolutions `json:"metrics_resolutions,omitempty"` -} - -// Validate validates this list agents OK body azure database exporter items0 -func (o *ListAgentsOKBodyAzureDatabaseExporterItems0) 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 listAgentsOkBodyAzureDatabaseExporterItems0TypeStatusPropEnum []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 { - listAgentsOkBodyAzureDatabaseExporterItems0TypeStatusPropEnum = append(listAgentsOkBodyAzureDatabaseExporterItems0TypeStatusPropEnum, v) - } -} - -const ( - - // ListAgentsOKBodyAzureDatabaseExporterItems0StatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - ListAgentsOKBodyAzureDatabaseExporterItems0StatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // ListAgentsOKBodyAzureDatabaseExporterItems0StatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - ListAgentsOKBodyAzureDatabaseExporterItems0StatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // ListAgentsOKBodyAzureDatabaseExporterItems0StatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - ListAgentsOKBodyAzureDatabaseExporterItems0StatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - - // ListAgentsOKBodyAzureDatabaseExporterItems0StatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - ListAgentsOKBodyAzureDatabaseExporterItems0StatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - - // ListAgentsOKBodyAzureDatabaseExporterItems0StatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - ListAgentsOKBodyAzureDatabaseExporterItems0StatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - - // ListAgentsOKBodyAzureDatabaseExporterItems0StatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - ListAgentsOKBodyAzureDatabaseExporterItems0StatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" - - // ListAgentsOKBodyAzureDatabaseExporterItems0StatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - ListAgentsOKBodyAzureDatabaseExporterItems0StatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" - - // ListAgentsOKBodyAzureDatabaseExporterItems0StatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - ListAgentsOKBodyAzureDatabaseExporterItems0StatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" -) - -// prop value enum -func (o *ListAgentsOKBodyAzureDatabaseExporterItems0) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, listAgentsOkBodyAzureDatabaseExporterItems0TypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ListAgentsOKBodyAzureDatabaseExporterItems0) 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 -} - -var listAgentsOkBodyAzureDatabaseExporterItems0TypeLogLevelPropEnum []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 { - listAgentsOkBodyAzureDatabaseExporterItems0TypeLogLevelPropEnum = append(listAgentsOkBodyAzureDatabaseExporterItems0TypeLogLevelPropEnum, v) - } -} - -const ( - - // ListAgentsOKBodyAzureDatabaseExporterItems0LogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - ListAgentsOKBodyAzureDatabaseExporterItems0LogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // ListAgentsOKBodyAzureDatabaseExporterItems0LogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - ListAgentsOKBodyAzureDatabaseExporterItems0LogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // ListAgentsOKBodyAzureDatabaseExporterItems0LogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - ListAgentsOKBodyAzureDatabaseExporterItems0LogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // ListAgentsOKBodyAzureDatabaseExporterItems0LogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - ListAgentsOKBodyAzureDatabaseExporterItems0LogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // ListAgentsOKBodyAzureDatabaseExporterItems0LogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - ListAgentsOKBodyAzureDatabaseExporterItems0LogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // ListAgentsOKBodyAzureDatabaseExporterItems0LogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - ListAgentsOKBodyAzureDatabaseExporterItems0LogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -func (o *ListAgentsOKBodyAzureDatabaseExporterItems0) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, listAgentsOkBodyAzureDatabaseExporterItems0TypeLogLevelPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ListAgentsOKBodyAzureDatabaseExporterItems0) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("log_level", "body", *o.LogLevel); err != nil { - return err - } - - return nil -} - -func (o *ListAgentsOKBodyAzureDatabaseExporterItems0) 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("metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("metrics_resolutions") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this list agents OK body azure database exporter items0 based on the context it is used -func (o *ListAgentsOKBodyAzureDatabaseExporterItems0) 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 *ListAgentsOKBodyAzureDatabaseExporterItems0) 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 { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("metrics_resolutions") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListAgentsOKBodyAzureDatabaseExporterItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAgentsOKBodyAzureDatabaseExporterItems0) UnmarshalBinary(b []byte) error { - var res ListAgentsOKBodyAzureDatabaseExporterItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListAgentsOKBodyAzureDatabaseExporterItems0MetricsResolutions MetricsResolutions represents Prometheus exporters metrics resolutions. -swagger:model ListAgentsOKBodyAzureDatabaseExporterItems0MetricsResolutions -*/ -type ListAgentsOKBodyAzureDatabaseExporterItems0MetricsResolutions struct { - // High resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Hr string `json:"hr,omitempty"` - - // Medium resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Mr string `json:"mr,omitempty"` - - // Low resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Lr string `json:"lr,omitempty"` -} - -// Validate validates this list agents OK body azure database exporter items0 metrics resolutions -func (o *ListAgentsOKBodyAzureDatabaseExporterItems0MetricsResolutions) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list agents OK body azure database exporter items0 metrics resolutions based on context it is used -func (o *ListAgentsOKBodyAzureDatabaseExporterItems0MetricsResolutions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListAgentsOKBodyAzureDatabaseExporterItems0MetricsResolutions) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAgentsOKBodyAzureDatabaseExporterItems0MetricsResolutions) UnmarshalBinary(b []byte) error { - var res ListAgentsOKBodyAzureDatabaseExporterItems0MetricsResolutions - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListAgentsOKBodyExternalExporterItems0 ExternalExporter runs on any Node type, including Remote Node. -swagger:model ListAgentsOKBodyExternalExporterItems0 -*/ -type ListAgentsOKBodyExternalExporterItems0 struct { - // Unique randomly generated instance identifier. - AgentID string `json:"agent_id,omitempty"` - - // Node identifier where this instance runs. - RunsOnNodeID string `json:"runs_on_node_id,omitempty"` - - // If disabled, metrics from this exporter will not be collected. - Disabled bool `json:"disabled,omitempty"` - - // Service identifier. - ServiceID string `json:"service_id,omitempty"` - - // HTTP basic auth username for collecting metrics. - Username string `json:"username,omitempty"` - - // Scheme to generate URI to exporter metrics endpoints. - Scheme string `json:"scheme,omitempty"` - - // Path under which metrics are exposed, used to generate URI. - MetricsPath string `json:"metrics_path,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // Listen port for scraping metrics. - ListenPort int64 `json:"listen_port,omitempty"` - - // True if exporter uses push metrics mode. - PushMetricsEnabled bool `json:"push_metrics_enabled,omitempty"` - - // Path to exec process. - ProcessExecPath string `json:"process_exec_path,omitempty"` - - // Skip TLS certificate and hostname verification. - TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - - // metrics resolutions - MetricsResolutions *ListAgentsOKBodyExternalExporterItems0MetricsResolutions `json:"metrics_resolutions,omitempty"` -} - -// Validate validates this list agents OK body external exporter items0 -func (o *ListAgentsOKBodyExternalExporterItems0) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateMetricsResolutions(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListAgentsOKBodyExternalExporterItems0) 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("metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("metrics_resolutions") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this list agents OK body external exporter items0 based on the context it is used -func (o *ListAgentsOKBodyExternalExporterItems0) 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 *ListAgentsOKBodyExternalExporterItems0) 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 { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("metrics_resolutions") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListAgentsOKBodyExternalExporterItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAgentsOKBodyExternalExporterItems0) UnmarshalBinary(b []byte) error { - var res ListAgentsOKBodyExternalExporterItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListAgentsOKBodyExternalExporterItems0MetricsResolutions MetricsResolutions represents Prometheus exporters metrics resolutions. -swagger:model ListAgentsOKBodyExternalExporterItems0MetricsResolutions -*/ -type ListAgentsOKBodyExternalExporterItems0MetricsResolutions struct { - // High resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Hr string `json:"hr,omitempty"` - - // Medium resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Mr string `json:"mr,omitempty"` - - // Low resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Lr string `json:"lr,omitempty"` -} - -// Validate validates this list agents OK body external exporter items0 metrics resolutions -func (o *ListAgentsOKBodyExternalExporterItems0MetricsResolutions) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list agents OK body external exporter items0 metrics resolutions based on context it is used -func (o *ListAgentsOKBodyExternalExporterItems0MetricsResolutions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListAgentsOKBodyExternalExporterItems0MetricsResolutions) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAgentsOKBodyExternalExporterItems0MetricsResolutions) UnmarshalBinary(b []byte) error { - var res ListAgentsOKBodyExternalExporterItems0MetricsResolutions - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListAgentsOKBodyMongodbExporterItems0 MongoDBExporter runs on Generic or Container Node and exposes MongoDB Service metrics. -swagger:model ListAgentsOKBodyMongodbExporterItems0 -*/ -type ListAgentsOKBodyMongodbExporterItems0 struct { - // Unique randomly generated instance identifier. - AgentID string `json:"agent_id,omitempty"` - - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `json:"disabled,omitempty"` - - // Service identifier. - ServiceID string `json:"service_id,omitempty"` - - // MongoDB username for scraping metrics. - Username string `json:"username,omitempty"` - - // Use TLS for database connections. - TLS bool `json:"tls,omitempty"` - - // Skip TLS certificate and hostname validation. - TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // True if exporter uses push metrics mode. - PushMetricsEnabled bool `json:"push_metrics_enabled,omitempty"` - - // 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"` - - // 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. - EnableAllCollectors bool `json:"enable_all_collectors,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"` - - // Optionally expose the exporter process on all public interfaces - ExposeExporter bool `json:"expose_exporter,omitempty"` - - // metrics resolutions - MetricsResolutions *ListAgentsOKBodyMongodbExporterItems0MetricsResolutions `json:"metrics_resolutions,omitempty"` -} - -// Validate validates this list agents OK body mongodb exporter items0 -func (o *ListAgentsOKBodyMongodbExporterItems0) 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 listAgentsOkBodyMongodbExporterItems0TypeStatusPropEnum []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 { - listAgentsOkBodyMongodbExporterItems0TypeStatusPropEnum = append(listAgentsOkBodyMongodbExporterItems0TypeStatusPropEnum, v) - } -} - -const ( - - // ListAgentsOKBodyMongodbExporterItems0StatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - ListAgentsOKBodyMongodbExporterItems0StatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // ListAgentsOKBodyMongodbExporterItems0StatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - ListAgentsOKBodyMongodbExporterItems0StatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // ListAgentsOKBodyMongodbExporterItems0StatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - ListAgentsOKBodyMongodbExporterItems0StatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - - // ListAgentsOKBodyMongodbExporterItems0StatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - ListAgentsOKBodyMongodbExporterItems0StatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - - // ListAgentsOKBodyMongodbExporterItems0StatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - ListAgentsOKBodyMongodbExporterItems0StatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - - // ListAgentsOKBodyMongodbExporterItems0StatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - ListAgentsOKBodyMongodbExporterItems0StatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" - - // ListAgentsOKBodyMongodbExporterItems0StatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - ListAgentsOKBodyMongodbExporterItems0StatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" - - // ListAgentsOKBodyMongodbExporterItems0StatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - ListAgentsOKBodyMongodbExporterItems0StatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" -) - -// prop value enum -func (o *ListAgentsOKBodyMongodbExporterItems0) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, listAgentsOkBodyMongodbExporterItems0TypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ListAgentsOKBodyMongodbExporterItems0) 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 -} - -var listAgentsOkBodyMongodbExporterItems0TypeLogLevelPropEnum []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 { - listAgentsOkBodyMongodbExporterItems0TypeLogLevelPropEnum = append(listAgentsOkBodyMongodbExporterItems0TypeLogLevelPropEnum, v) - } -} - -const ( - - // ListAgentsOKBodyMongodbExporterItems0LogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - ListAgentsOKBodyMongodbExporterItems0LogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // ListAgentsOKBodyMongodbExporterItems0LogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - ListAgentsOKBodyMongodbExporterItems0LogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // ListAgentsOKBodyMongodbExporterItems0LogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - ListAgentsOKBodyMongodbExporterItems0LogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // ListAgentsOKBodyMongodbExporterItems0LogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - ListAgentsOKBodyMongodbExporterItems0LogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // ListAgentsOKBodyMongodbExporterItems0LogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - ListAgentsOKBodyMongodbExporterItems0LogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // ListAgentsOKBodyMongodbExporterItems0LogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - ListAgentsOKBodyMongodbExporterItems0LogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -func (o *ListAgentsOKBodyMongodbExporterItems0) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, listAgentsOkBodyMongodbExporterItems0TypeLogLevelPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ListAgentsOKBodyMongodbExporterItems0) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("log_level", "body", *o.LogLevel); err != nil { - return err - } - - return nil -} - -func (o *ListAgentsOKBodyMongodbExporterItems0) 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("metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("metrics_resolutions") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this list agents OK body mongodb exporter items0 based on the context it is used -func (o *ListAgentsOKBodyMongodbExporterItems0) 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 *ListAgentsOKBodyMongodbExporterItems0) 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 { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("metrics_resolutions") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListAgentsOKBodyMongodbExporterItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAgentsOKBodyMongodbExporterItems0) UnmarshalBinary(b []byte) error { - var res ListAgentsOKBodyMongodbExporterItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListAgentsOKBodyMongodbExporterItems0MetricsResolutions MetricsResolutions represents Prometheus exporters metrics resolutions. -swagger:model ListAgentsOKBodyMongodbExporterItems0MetricsResolutions -*/ -type ListAgentsOKBodyMongodbExporterItems0MetricsResolutions struct { - // High resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Hr string `json:"hr,omitempty"` - - // Medium resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Mr string `json:"mr,omitempty"` - - // Low resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Lr string `json:"lr,omitempty"` -} - -// Validate validates this list agents OK body mongodb exporter items0 metrics resolutions -func (o *ListAgentsOKBodyMongodbExporterItems0MetricsResolutions) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list agents OK body mongodb exporter items0 metrics resolutions based on context it is used -func (o *ListAgentsOKBodyMongodbExporterItems0MetricsResolutions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListAgentsOKBodyMongodbExporterItems0MetricsResolutions) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAgentsOKBodyMongodbExporterItems0MetricsResolutions) UnmarshalBinary(b []byte) error { - var res ListAgentsOKBodyMongodbExporterItems0MetricsResolutions - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListAgentsOKBodyMysqldExporterItems0 MySQLdExporter runs on Generic or Container Node and exposes MySQL Service metrics. -swagger:model ListAgentsOKBodyMysqldExporterItems0 -*/ -type ListAgentsOKBodyMysqldExporterItems0 struct { - // Unique randomly generated instance identifier. - AgentID string `json:"agent_id,omitempty"` - - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `json:"disabled,omitempty"` - - // Service identifier. - ServiceID string `json:"service_id,omitempty"` - - // MySQL username for scraping metrics. - Username string `json:"username,omitempty"` - - // Use TLS for database connections. - TLS bool `json:"tls,omitempty"` - - // Skip TLS certificate and hostname validation. - TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - - // Certificate Authority certificate chain. - TLSCa string `json:"tls_ca,omitempty"` - - // Client certificate. - TLSCert string `json:"tls_cert,omitempty"` - - // Password for decrypting tls_cert. - TLSKey string `json:"tls_key,omitempty"` - - // Tablestats group collectors are disabled if there are more than that number of tables. - // 0 means tablestats group collectors are always enabled (no limit). - // Negative value means tablestats group collectors are always disabled. - TablestatsGroupTableLimit int32 `json:"tablestats_group_table_limit,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // True if exporter uses push metrics mode. - PushMetricsEnabled bool `json:"push_metrics_enabled,omitempty"` - - // List of disabled collector names. - DisabledCollectors []string `json:"disabled_collectors"` - - // 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"` - - // True if tablestats group collectors are currently disabled. - TablestatsGroupDisabled bool `json:"tablestats_group_disabled,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"` - - // 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 *ListAgentsOKBodyMysqldExporterItems0MetricsResolutions `json:"metrics_resolutions,omitempty"` -} - -// Validate validates this list agents OK body mysqld exporter items0 -func (o *ListAgentsOKBodyMysqldExporterItems0) 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 listAgentsOkBodyMysqldExporterItems0TypeStatusPropEnum []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 { - listAgentsOkBodyMysqldExporterItems0TypeStatusPropEnum = append(listAgentsOkBodyMysqldExporterItems0TypeStatusPropEnum, v) - } -} - -const ( - - // ListAgentsOKBodyMysqldExporterItems0StatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - ListAgentsOKBodyMysqldExporterItems0StatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // ListAgentsOKBodyMysqldExporterItems0StatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - ListAgentsOKBodyMysqldExporterItems0StatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // ListAgentsOKBodyMysqldExporterItems0StatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - ListAgentsOKBodyMysqldExporterItems0StatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - - // ListAgentsOKBodyMysqldExporterItems0StatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - ListAgentsOKBodyMysqldExporterItems0StatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - - // ListAgentsOKBodyMysqldExporterItems0StatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - ListAgentsOKBodyMysqldExporterItems0StatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - - // ListAgentsOKBodyMysqldExporterItems0StatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - ListAgentsOKBodyMysqldExporterItems0StatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" - - // ListAgentsOKBodyMysqldExporterItems0StatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - ListAgentsOKBodyMysqldExporterItems0StatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" - - // ListAgentsOKBodyMysqldExporterItems0StatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - ListAgentsOKBodyMysqldExporterItems0StatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" -) - -// prop value enum -func (o *ListAgentsOKBodyMysqldExporterItems0) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, listAgentsOkBodyMysqldExporterItems0TypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ListAgentsOKBodyMysqldExporterItems0) 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 -} - -var listAgentsOkBodyMysqldExporterItems0TypeLogLevelPropEnum []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 { - listAgentsOkBodyMysqldExporterItems0TypeLogLevelPropEnum = append(listAgentsOkBodyMysqldExporterItems0TypeLogLevelPropEnum, v) - } -} - -const ( - - // ListAgentsOKBodyMysqldExporterItems0LogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - ListAgentsOKBodyMysqldExporterItems0LogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // ListAgentsOKBodyMysqldExporterItems0LogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - ListAgentsOKBodyMysqldExporterItems0LogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // ListAgentsOKBodyMysqldExporterItems0LogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - ListAgentsOKBodyMysqldExporterItems0LogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // ListAgentsOKBodyMysqldExporterItems0LogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - ListAgentsOKBodyMysqldExporterItems0LogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // ListAgentsOKBodyMysqldExporterItems0LogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - ListAgentsOKBodyMysqldExporterItems0LogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // ListAgentsOKBodyMysqldExporterItems0LogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - ListAgentsOKBodyMysqldExporterItems0LogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -func (o *ListAgentsOKBodyMysqldExporterItems0) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, listAgentsOkBodyMysqldExporterItems0TypeLogLevelPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ListAgentsOKBodyMysqldExporterItems0) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("log_level", "body", *o.LogLevel); err != nil { - return err - } - - return nil -} - -func (o *ListAgentsOKBodyMysqldExporterItems0) 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("metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("metrics_resolutions") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this list agents OK body mysqld exporter items0 based on the context it is used -func (o *ListAgentsOKBodyMysqldExporterItems0) 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 *ListAgentsOKBodyMysqldExporterItems0) 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 { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("metrics_resolutions") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListAgentsOKBodyMysqldExporterItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAgentsOKBodyMysqldExporterItems0) UnmarshalBinary(b []byte) error { - var res ListAgentsOKBodyMysqldExporterItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListAgentsOKBodyMysqldExporterItems0MetricsResolutions MetricsResolutions represents Prometheus exporters metrics resolutions. -swagger:model ListAgentsOKBodyMysqldExporterItems0MetricsResolutions -*/ -type ListAgentsOKBodyMysqldExporterItems0MetricsResolutions struct { - // High resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Hr string `json:"hr,omitempty"` - - // Medium resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Mr string `json:"mr,omitempty"` - - // Low resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Lr string `json:"lr,omitempty"` -} - -// Validate validates this list agents OK body mysqld exporter items0 metrics resolutions -func (o *ListAgentsOKBodyMysqldExporterItems0MetricsResolutions) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list agents OK body mysqld exporter items0 metrics resolutions based on context it is used -func (o *ListAgentsOKBodyMysqldExporterItems0MetricsResolutions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListAgentsOKBodyMysqldExporterItems0MetricsResolutions) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAgentsOKBodyMysqldExporterItems0MetricsResolutions) UnmarshalBinary(b []byte) error { - var res ListAgentsOKBodyMysqldExporterItems0MetricsResolutions - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListAgentsOKBodyNodeExporterItems0 NodeExporter runs on Generic or Container Node and exposes its metrics. -swagger:model ListAgentsOKBodyNodeExporterItems0 -*/ -type ListAgentsOKBodyNodeExporterItems0 struct { - // Unique randomly generated instance identifier. - AgentID string `json:"agent_id,omitempty"` - - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `json:"disabled,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // True if exporter uses push metrics mode. - PushMetricsEnabled bool `json:"push_metrics_enabled,omitempty"` - - // 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"` - - // Optionally expose the exporter process on all public interfaces - ExposeExporter bool `json:"expose_exporter,omitempty"` - - // metrics resolutions - MetricsResolutions *ListAgentsOKBodyNodeExporterItems0MetricsResolutions `json:"metrics_resolutions,omitempty"` -} - -// Validate validates this list agents OK body node exporter items0 -func (o *ListAgentsOKBodyNodeExporterItems0) 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 listAgentsOkBodyNodeExporterItems0TypeStatusPropEnum []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 { - listAgentsOkBodyNodeExporterItems0TypeStatusPropEnum = append(listAgentsOkBodyNodeExporterItems0TypeStatusPropEnum, v) - } -} - -const ( - - // ListAgentsOKBodyNodeExporterItems0StatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - ListAgentsOKBodyNodeExporterItems0StatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // ListAgentsOKBodyNodeExporterItems0StatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - ListAgentsOKBodyNodeExporterItems0StatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // ListAgentsOKBodyNodeExporterItems0StatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - ListAgentsOKBodyNodeExporterItems0StatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - - // ListAgentsOKBodyNodeExporterItems0StatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - ListAgentsOKBodyNodeExporterItems0StatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - - // ListAgentsOKBodyNodeExporterItems0StatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - ListAgentsOKBodyNodeExporterItems0StatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - - // ListAgentsOKBodyNodeExporterItems0StatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - ListAgentsOKBodyNodeExporterItems0StatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" - - // ListAgentsOKBodyNodeExporterItems0StatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - ListAgentsOKBodyNodeExporterItems0StatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" - - // ListAgentsOKBodyNodeExporterItems0StatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - ListAgentsOKBodyNodeExporterItems0StatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" -) - -// prop value enum -func (o *ListAgentsOKBodyNodeExporterItems0) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, listAgentsOkBodyNodeExporterItems0TypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ListAgentsOKBodyNodeExporterItems0) 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 -} - -var listAgentsOkBodyNodeExporterItems0TypeLogLevelPropEnum []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 { - listAgentsOkBodyNodeExporterItems0TypeLogLevelPropEnum = append(listAgentsOkBodyNodeExporterItems0TypeLogLevelPropEnum, v) - } -} - -const ( - - // ListAgentsOKBodyNodeExporterItems0LogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - ListAgentsOKBodyNodeExporterItems0LogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // ListAgentsOKBodyNodeExporterItems0LogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - ListAgentsOKBodyNodeExporterItems0LogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // ListAgentsOKBodyNodeExporterItems0LogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - ListAgentsOKBodyNodeExporterItems0LogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // ListAgentsOKBodyNodeExporterItems0LogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - ListAgentsOKBodyNodeExporterItems0LogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // ListAgentsOKBodyNodeExporterItems0LogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - ListAgentsOKBodyNodeExporterItems0LogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // ListAgentsOKBodyNodeExporterItems0LogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - ListAgentsOKBodyNodeExporterItems0LogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -func (o *ListAgentsOKBodyNodeExporterItems0) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, listAgentsOkBodyNodeExporterItems0TypeLogLevelPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ListAgentsOKBodyNodeExporterItems0) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("log_level", "body", *o.LogLevel); err != nil { - return err - } - - return nil -} - -func (o *ListAgentsOKBodyNodeExporterItems0) 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("metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("metrics_resolutions") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this list agents OK body node exporter items0 based on the context it is used -func (o *ListAgentsOKBodyNodeExporterItems0) 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 *ListAgentsOKBodyNodeExporterItems0) 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 { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("metrics_resolutions") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListAgentsOKBodyNodeExporterItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAgentsOKBodyNodeExporterItems0) UnmarshalBinary(b []byte) error { - var res ListAgentsOKBodyNodeExporterItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListAgentsOKBodyNodeExporterItems0MetricsResolutions MetricsResolutions represents Prometheus exporters metrics resolutions. -swagger:model ListAgentsOKBodyNodeExporterItems0MetricsResolutions -*/ -type ListAgentsOKBodyNodeExporterItems0MetricsResolutions struct { - // High resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Hr string `json:"hr,omitempty"` - - // Medium resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Mr string `json:"mr,omitempty"` - - // Low resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Lr string `json:"lr,omitempty"` -} - -// Validate validates this list agents OK body node exporter items0 metrics resolutions -func (o *ListAgentsOKBodyNodeExporterItems0MetricsResolutions) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list agents OK body node exporter items0 metrics resolutions based on context it is used -func (o *ListAgentsOKBodyNodeExporterItems0MetricsResolutions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListAgentsOKBodyNodeExporterItems0MetricsResolutions) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAgentsOKBodyNodeExporterItems0MetricsResolutions) UnmarshalBinary(b []byte) error { - var res ListAgentsOKBodyNodeExporterItems0MetricsResolutions - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListAgentsOKBodyNomadAgentItems0 list agents OK body nomad agent items0 -swagger:model ListAgentsOKBodyNomadAgentItems0 -*/ -type ListAgentsOKBodyNomadAgentItems0 struct { - // Unique randomly generated instance identifier. - AgentID string `json:"agent_id,omitempty"` - - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `json:"disabled,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"` - - // Path to exec process. - ProcessExecPath string `json:"process_exec_path,omitempty"` - - // Listen port for scraping metrics. - ListenPort int64 `json:"listen_port,omitempty"` -} - -// Validate validates this list agents OK body nomad agent items0 -func (o *ListAgentsOKBodyNomadAgentItems0) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateStatus(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var listAgentsOkBodyNomadAgentItems0TypeStatusPropEnum []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 { - listAgentsOkBodyNomadAgentItems0TypeStatusPropEnum = append(listAgentsOkBodyNomadAgentItems0TypeStatusPropEnum, v) - } -} - -const ( - - // ListAgentsOKBodyNomadAgentItems0StatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - ListAgentsOKBodyNomadAgentItems0StatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // ListAgentsOKBodyNomadAgentItems0StatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - ListAgentsOKBodyNomadAgentItems0StatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // ListAgentsOKBodyNomadAgentItems0StatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - ListAgentsOKBodyNomadAgentItems0StatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - - // ListAgentsOKBodyNomadAgentItems0StatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - ListAgentsOKBodyNomadAgentItems0StatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - - // ListAgentsOKBodyNomadAgentItems0StatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - ListAgentsOKBodyNomadAgentItems0StatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - - // ListAgentsOKBodyNomadAgentItems0StatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - ListAgentsOKBodyNomadAgentItems0StatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" - - // ListAgentsOKBodyNomadAgentItems0StatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - ListAgentsOKBodyNomadAgentItems0StatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" - - // ListAgentsOKBodyNomadAgentItems0StatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - ListAgentsOKBodyNomadAgentItems0StatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" -) - -// prop value enum -func (o *ListAgentsOKBodyNomadAgentItems0) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, listAgentsOkBodyNomadAgentItems0TypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ListAgentsOKBodyNomadAgentItems0) 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 validates this list agents OK body nomad agent items0 based on context it is used -func (o *ListAgentsOKBodyNomadAgentItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListAgentsOKBodyNomadAgentItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAgentsOKBodyNomadAgentItems0) UnmarshalBinary(b []byte) error { - var res ListAgentsOKBodyNomadAgentItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListAgentsOKBodyPMMAgentItems0 PMMAgent runs on Generic or Container Node. -swagger:model ListAgentsOKBodyPMMAgentItems0 -*/ -type ListAgentsOKBodyPMMAgentItems0 struct { - // Unique randomly generated instance identifier. - AgentID string `json:"agent_id,omitempty"` - - // Node identifier where this instance runs. - RunsOnNodeID string `json:"runs_on_node_id,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // True if Agent is running and connected to pmm-managed. - Connected bool `json:"connected,omitempty"` - - // Path to exec process. - ProcessExecPath string `json:"process_exec_path,omitempty"` -} - -// Validate validates this list agents OK body PMM agent items0 -func (o *ListAgentsOKBodyPMMAgentItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list agents OK body PMM agent items0 based on context it is used -func (o *ListAgentsOKBodyPMMAgentItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListAgentsOKBodyPMMAgentItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAgentsOKBodyPMMAgentItems0) UnmarshalBinary(b []byte) error { - var res ListAgentsOKBodyPMMAgentItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListAgentsOKBodyPostgresExporterItems0 PostgresExporter runs on Generic or Container Node and exposes PostgreSQL Service metrics. -swagger:model ListAgentsOKBodyPostgresExporterItems0 -*/ -type ListAgentsOKBodyPostgresExporterItems0 struct { - // Unique randomly generated instance identifier. - AgentID string `json:"agent_id,omitempty"` - - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `json:"disabled,omitempty"` - - // Service identifier. - ServiceID string `json:"service_id,omitempty"` - - // PostgreSQL username for scraping metrics. - Username string `json:"username,omitempty"` - - // Use TLS for database connections. - TLS bool `json:"tls,omitempty"` - - // Skip TLS certificate and hostname validation. Uses sslmode=required instead of verify-full. - TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // True if exporter uses push metrics mode. - PushMetricsEnabled bool `json:"push_metrics_enabled,omitempty"` - - // 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"` - - // Optionally expose the exporter process on all public interfaces - ExposeExporter bool `json:"expose_exporter,omitempty"` - - // Maximum number of connections that exporter can open to the database instance. - MaxExporterConnections int32 `json:"max_exporter_connections,omitempty"` - - // metrics resolutions - MetricsResolutions *ListAgentsOKBodyPostgresExporterItems0MetricsResolutions `json:"metrics_resolutions,omitempty"` -} - -// Validate validates this list agents OK body postgres exporter items0 -func (o *ListAgentsOKBodyPostgresExporterItems0) 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 listAgentsOkBodyPostgresExporterItems0TypeStatusPropEnum []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 { - listAgentsOkBodyPostgresExporterItems0TypeStatusPropEnum = append(listAgentsOkBodyPostgresExporterItems0TypeStatusPropEnum, v) - } -} - -const ( - - // ListAgentsOKBodyPostgresExporterItems0StatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - ListAgentsOKBodyPostgresExporterItems0StatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // ListAgentsOKBodyPostgresExporterItems0StatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - ListAgentsOKBodyPostgresExporterItems0StatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // ListAgentsOKBodyPostgresExporterItems0StatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - ListAgentsOKBodyPostgresExporterItems0StatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - - // ListAgentsOKBodyPostgresExporterItems0StatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - ListAgentsOKBodyPostgresExporterItems0StatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - - // ListAgentsOKBodyPostgresExporterItems0StatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - ListAgentsOKBodyPostgresExporterItems0StatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - - // ListAgentsOKBodyPostgresExporterItems0StatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - ListAgentsOKBodyPostgresExporterItems0StatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" - - // ListAgentsOKBodyPostgresExporterItems0StatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - ListAgentsOKBodyPostgresExporterItems0StatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" - - // ListAgentsOKBodyPostgresExporterItems0StatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - ListAgentsOKBodyPostgresExporterItems0StatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" -) - -// prop value enum -func (o *ListAgentsOKBodyPostgresExporterItems0) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, listAgentsOkBodyPostgresExporterItems0TypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ListAgentsOKBodyPostgresExporterItems0) 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 -} - -var listAgentsOkBodyPostgresExporterItems0TypeLogLevelPropEnum []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 { - listAgentsOkBodyPostgresExporterItems0TypeLogLevelPropEnum = append(listAgentsOkBodyPostgresExporterItems0TypeLogLevelPropEnum, v) - } -} - -const ( - - // ListAgentsOKBodyPostgresExporterItems0LogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - ListAgentsOKBodyPostgresExporterItems0LogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // ListAgentsOKBodyPostgresExporterItems0LogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - ListAgentsOKBodyPostgresExporterItems0LogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // ListAgentsOKBodyPostgresExporterItems0LogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - ListAgentsOKBodyPostgresExporterItems0LogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // ListAgentsOKBodyPostgresExporterItems0LogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - ListAgentsOKBodyPostgresExporterItems0LogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // ListAgentsOKBodyPostgresExporterItems0LogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - ListAgentsOKBodyPostgresExporterItems0LogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // ListAgentsOKBodyPostgresExporterItems0LogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - ListAgentsOKBodyPostgresExporterItems0LogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -func (o *ListAgentsOKBodyPostgresExporterItems0) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, listAgentsOkBodyPostgresExporterItems0TypeLogLevelPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ListAgentsOKBodyPostgresExporterItems0) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("log_level", "body", *o.LogLevel); err != nil { - return err - } - - return nil -} - -func (o *ListAgentsOKBodyPostgresExporterItems0) 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("metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("metrics_resolutions") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this list agents OK body postgres exporter items0 based on the context it is used -func (o *ListAgentsOKBodyPostgresExporterItems0) 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 *ListAgentsOKBodyPostgresExporterItems0) 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 { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("metrics_resolutions") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListAgentsOKBodyPostgresExporterItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAgentsOKBodyPostgresExporterItems0) UnmarshalBinary(b []byte) error { - var res ListAgentsOKBodyPostgresExporterItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListAgentsOKBodyPostgresExporterItems0MetricsResolutions MetricsResolutions represents Prometheus exporters metrics resolutions. -swagger:model ListAgentsOKBodyPostgresExporterItems0MetricsResolutions -*/ -type ListAgentsOKBodyPostgresExporterItems0MetricsResolutions struct { - // High resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Hr string `json:"hr,omitempty"` - - // Medium resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Mr string `json:"mr,omitempty"` - - // Low resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Lr string `json:"lr,omitempty"` -} - -// Validate validates this list agents OK body postgres exporter items0 metrics resolutions -func (o *ListAgentsOKBodyPostgresExporterItems0MetricsResolutions) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list agents OK body postgres exporter items0 metrics resolutions based on context it is used -func (o *ListAgentsOKBodyPostgresExporterItems0MetricsResolutions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListAgentsOKBodyPostgresExporterItems0MetricsResolutions) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAgentsOKBodyPostgresExporterItems0MetricsResolutions) UnmarshalBinary(b []byte) error { - var res ListAgentsOKBodyPostgresExporterItems0MetricsResolutions - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListAgentsOKBodyProxysqlExporterItems0 ProxySQLExporter runs on Generic or Container Node and exposes ProxySQL Service metrics. -swagger:model ListAgentsOKBodyProxysqlExporterItems0 -*/ -type ListAgentsOKBodyProxysqlExporterItems0 struct { - // Unique randomly generated instance identifier. - AgentID string `json:"agent_id,omitempty"` - - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `json:"disabled,omitempty"` - - // Service identifier. - ServiceID string `json:"service_id,omitempty"` - - // ProxySQL username for scraping metrics. - Username string `json:"username,omitempty"` - - // Use TLS for database connections. - TLS bool `json:"tls,omitempty"` - - // Skip TLS certificate and hostname validation. - TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // True if exporter uses push metrics mode. - PushMetricsEnabled bool `json:"push_metrics_enabled,omitempty"` - - // 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"` - - // Optionally expose the exporter process on all public interfaces - ExposeExporter bool `json:"expose_exporter,omitempty"` - - // metrics resolutions - MetricsResolutions *ListAgentsOKBodyProxysqlExporterItems0MetricsResolutions `json:"metrics_resolutions,omitempty"` -} - -// Validate validates this list agents OK body proxysql exporter items0 -func (o *ListAgentsOKBodyProxysqlExporterItems0) 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 listAgentsOkBodyProxysqlExporterItems0TypeStatusPropEnum []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 { - listAgentsOkBodyProxysqlExporterItems0TypeStatusPropEnum = append(listAgentsOkBodyProxysqlExporterItems0TypeStatusPropEnum, v) - } -} - -const ( - - // ListAgentsOKBodyProxysqlExporterItems0StatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - ListAgentsOKBodyProxysqlExporterItems0StatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // ListAgentsOKBodyProxysqlExporterItems0StatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - ListAgentsOKBodyProxysqlExporterItems0StatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // ListAgentsOKBodyProxysqlExporterItems0StatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - ListAgentsOKBodyProxysqlExporterItems0StatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - - // ListAgentsOKBodyProxysqlExporterItems0StatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - ListAgentsOKBodyProxysqlExporterItems0StatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - - // ListAgentsOKBodyProxysqlExporterItems0StatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - ListAgentsOKBodyProxysqlExporterItems0StatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - - // ListAgentsOKBodyProxysqlExporterItems0StatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - ListAgentsOKBodyProxysqlExporterItems0StatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" - - // ListAgentsOKBodyProxysqlExporterItems0StatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - ListAgentsOKBodyProxysqlExporterItems0StatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" - - // ListAgentsOKBodyProxysqlExporterItems0StatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - ListAgentsOKBodyProxysqlExporterItems0StatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" -) - -// prop value enum -func (o *ListAgentsOKBodyProxysqlExporterItems0) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, listAgentsOkBodyProxysqlExporterItems0TypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ListAgentsOKBodyProxysqlExporterItems0) 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 -} - -var listAgentsOkBodyProxysqlExporterItems0TypeLogLevelPropEnum []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 { - listAgentsOkBodyProxysqlExporterItems0TypeLogLevelPropEnum = append(listAgentsOkBodyProxysqlExporterItems0TypeLogLevelPropEnum, v) - } -} - -const ( - - // ListAgentsOKBodyProxysqlExporterItems0LogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - ListAgentsOKBodyProxysqlExporterItems0LogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // ListAgentsOKBodyProxysqlExporterItems0LogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - ListAgentsOKBodyProxysqlExporterItems0LogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // ListAgentsOKBodyProxysqlExporterItems0LogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - ListAgentsOKBodyProxysqlExporterItems0LogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // ListAgentsOKBodyProxysqlExporterItems0LogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - ListAgentsOKBodyProxysqlExporterItems0LogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // ListAgentsOKBodyProxysqlExporterItems0LogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - ListAgentsOKBodyProxysqlExporterItems0LogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // ListAgentsOKBodyProxysqlExporterItems0LogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - ListAgentsOKBodyProxysqlExporterItems0LogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -func (o *ListAgentsOKBodyProxysqlExporterItems0) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, listAgentsOkBodyProxysqlExporterItems0TypeLogLevelPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ListAgentsOKBodyProxysqlExporterItems0) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("log_level", "body", *o.LogLevel); err != nil { - return err - } - - return nil -} - -func (o *ListAgentsOKBodyProxysqlExporterItems0) 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("metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("metrics_resolutions") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this list agents OK body proxysql exporter items0 based on the context it is used -func (o *ListAgentsOKBodyProxysqlExporterItems0) 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 *ListAgentsOKBodyProxysqlExporterItems0) 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 { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("metrics_resolutions") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListAgentsOKBodyProxysqlExporterItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAgentsOKBodyProxysqlExporterItems0) UnmarshalBinary(b []byte) error { - var res ListAgentsOKBodyProxysqlExporterItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListAgentsOKBodyProxysqlExporterItems0MetricsResolutions MetricsResolutions represents Prometheus exporters metrics resolutions. -swagger:model ListAgentsOKBodyProxysqlExporterItems0MetricsResolutions -*/ -type ListAgentsOKBodyProxysqlExporterItems0MetricsResolutions struct { - // High resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Hr string `json:"hr,omitempty"` - - // Medium resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Mr string `json:"mr,omitempty"` - - // Low resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Lr string `json:"lr,omitempty"` -} - -// Validate validates this list agents OK body proxysql exporter items0 metrics resolutions -func (o *ListAgentsOKBodyProxysqlExporterItems0MetricsResolutions) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list agents OK body proxysql exporter items0 metrics resolutions based on context it is used -func (o *ListAgentsOKBodyProxysqlExporterItems0MetricsResolutions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListAgentsOKBodyProxysqlExporterItems0MetricsResolutions) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAgentsOKBodyProxysqlExporterItems0MetricsResolutions) UnmarshalBinary(b []byte) error { - var res ListAgentsOKBodyProxysqlExporterItems0MetricsResolutions - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListAgentsOKBodyQANMongodbMongologAgentItems0 QANMongoDBMongologAgent runs within pmm-agent and sends MongoDB Query Analytics data to the PMM Server. -swagger:model ListAgentsOKBodyQANMongodbMongologAgentItems0 -*/ -type ListAgentsOKBodyQANMongodbMongologAgentItems0 struct { - // Unique randomly generated instance identifier. - AgentID string `json:"agent_id,omitempty"` - - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `json:"disabled,omitempty"` - - // Service identifier. - ServiceID string `json:"service_id,omitempty"` - - // MongoDB username for getting profiler data. - Username string `json:"username,omitempty"` - - // Use TLS for database connections. - TLS bool `json:"tls,omitempty"` - - // Skip TLS certificate and hostname validation. - TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - - // Limit query length in QAN (default: server-defined; -1: no limit). - MaxQueryLength int32 `json:"max_query_length,omitempty"` - - // 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"` - - // 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 list agents OK body QAN mongodb mongolog agent items0 -func (o *ListAgentsOKBodyQANMongodbMongologAgentItems0) 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 listAgentsOkBodyQanMongodbMongologAgentItems0TypeStatusPropEnum []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 { - listAgentsOkBodyQanMongodbMongologAgentItems0TypeStatusPropEnum = append(listAgentsOkBodyQanMongodbMongologAgentItems0TypeStatusPropEnum, v) - } -} - -const ( - - // ListAgentsOKBodyQANMongodbMongologAgentItems0StatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - ListAgentsOKBodyQANMongodbMongologAgentItems0StatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // ListAgentsOKBodyQANMongodbMongologAgentItems0StatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - ListAgentsOKBodyQANMongodbMongologAgentItems0StatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // ListAgentsOKBodyQANMongodbMongologAgentItems0StatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - ListAgentsOKBodyQANMongodbMongologAgentItems0StatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - - // ListAgentsOKBodyQANMongodbMongologAgentItems0StatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - ListAgentsOKBodyQANMongodbMongologAgentItems0StatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - - // ListAgentsOKBodyQANMongodbMongologAgentItems0StatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - ListAgentsOKBodyQANMongodbMongologAgentItems0StatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - - // ListAgentsOKBodyQANMongodbMongologAgentItems0StatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - ListAgentsOKBodyQANMongodbMongologAgentItems0StatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" - - // ListAgentsOKBodyQANMongodbMongologAgentItems0StatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - ListAgentsOKBodyQANMongodbMongologAgentItems0StatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" - - // ListAgentsOKBodyQANMongodbMongologAgentItems0StatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - ListAgentsOKBodyQANMongodbMongologAgentItems0StatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" -) - -// prop value enum -func (o *ListAgentsOKBodyQANMongodbMongologAgentItems0) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, listAgentsOkBodyQanMongodbMongologAgentItems0TypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ListAgentsOKBodyQANMongodbMongologAgentItems0) 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 -} - -var listAgentsOkBodyQanMongodbMongologAgentItems0TypeLogLevelPropEnum []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 { - listAgentsOkBodyQanMongodbMongologAgentItems0TypeLogLevelPropEnum = append(listAgentsOkBodyQanMongodbMongologAgentItems0TypeLogLevelPropEnum, v) - } -} - -const ( - - // ListAgentsOKBodyQANMongodbMongologAgentItems0LogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - ListAgentsOKBodyQANMongodbMongologAgentItems0LogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // ListAgentsOKBodyQANMongodbMongologAgentItems0LogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - ListAgentsOKBodyQANMongodbMongologAgentItems0LogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // ListAgentsOKBodyQANMongodbMongologAgentItems0LogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - ListAgentsOKBodyQANMongodbMongologAgentItems0LogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // ListAgentsOKBodyQANMongodbMongologAgentItems0LogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - ListAgentsOKBodyQANMongodbMongologAgentItems0LogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // ListAgentsOKBodyQANMongodbMongologAgentItems0LogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - ListAgentsOKBodyQANMongodbMongologAgentItems0LogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // ListAgentsOKBodyQANMongodbMongologAgentItems0LogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - ListAgentsOKBodyQANMongodbMongologAgentItems0LogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -func (o *ListAgentsOKBodyQANMongodbMongologAgentItems0) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, listAgentsOkBodyQanMongodbMongologAgentItems0TypeLogLevelPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ListAgentsOKBodyQANMongodbMongologAgentItems0) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("log_level", "body", *o.LogLevel); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this list agents OK body QAN mongodb mongolog agent items0 based on context it is used -func (o *ListAgentsOKBodyQANMongodbMongologAgentItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListAgentsOKBodyQANMongodbMongologAgentItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAgentsOKBodyQANMongodbMongologAgentItems0) UnmarshalBinary(b []byte) error { - var res ListAgentsOKBodyQANMongodbMongologAgentItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListAgentsOKBodyQANMongodbProfilerAgentItems0 QANMongoDBProfilerAgent runs within pmm-agent and sends MongoDB Query Analytics data to the PMM Server. -swagger:model ListAgentsOKBodyQANMongodbProfilerAgentItems0 -*/ -type ListAgentsOKBodyQANMongodbProfilerAgentItems0 struct { - // Unique randomly generated instance identifier. - AgentID string `json:"agent_id,omitempty"` - - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `json:"disabled,omitempty"` - - // Service identifier. - ServiceID string `json:"service_id,omitempty"` - - // MongoDB username for getting profiler data. - Username string `json:"username,omitempty"` - - // Use TLS for database connections. - TLS bool `json:"tls,omitempty"` - - // Skip TLS certificate and hostname validation. - TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - - // Limit query length in QAN (default: server-defined; -1: no limit). - MaxQueryLength int32 `json:"max_query_length,omitempty"` - - // 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"` - - // 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 list agents OK body QAN mongodb profiler agent items0 -func (o *ListAgentsOKBodyQANMongodbProfilerAgentItems0) 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 listAgentsOkBodyQanMongodbProfilerAgentItems0TypeStatusPropEnum []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 { - listAgentsOkBodyQanMongodbProfilerAgentItems0TypeStatusPropEnum = append(listAgentsOkBodyQanMongodbProfilerAgentItems0TypeStatusPropEnum, v) - } -} - -const ( - - // ListAgentsOKBodyQANMongodbProfilerAgentItems0StatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - ListAgentsOKBodyQANMongodbProfilerAgentItems0StatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // ListAgentsOKBodyQANMongodbProfilerAgentItems0StatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - ListAgentsOKBodyQANMongodbProfilerAgentItems0StatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // ListAgentsOKBodyQANMongodbProfilerAgentItems0StatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - ListAgentsOKBodyQANMongodbProfilerAgentItems0StatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - - // ListAgentsOKBodyQANMongodbProfilerAgentItems0StatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - ListAgentsOKBodyQANMongodbProfilerAgentItems0StatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - - // ListAgentsOKBodyQANMongodbProfilerAgentItems0StatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - ListAgentsOKBodyQANMongodbProfilerAgentItems0StatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - - // ListAgentsOKBodyQANMongodbProfilerAgentItems0StatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - ListAgentsOKBodyQANMongodbProfilerAgentItems0StatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" - - // ListAgentsOKBodyQANMongodbProfilerAgentItems0StatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - ListAgentsOKBodyQANMongodbProfilerAgentItems0StatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" - - // ListAgentsOKBodyQANMongodbProfilerAgentItems0StatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - ListAgentsOKBodyQANMongodbProfilerAgentItems0StatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" -) - -// prop value enum -func (o *ListAgentsOKBodyQANMongodbProfilerAgentItems0) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, listAgentsOkBodyQanMongodbProfilerAgentItems0TypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ListAgentsOKBodyQANMongodbProfilerAgentItems0) 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 -} - -var listAgentsOkBodyQanMongodbProfilerAgentItems0TypeLogLevelPropEnum []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 { - listAgentsOkBodyQanMongodbProfilerAgentItems0TypeLogLevelPropEnum = append(listAgentsOkBodyQanMongodbProfilerAgentItems0TypeLogLevelPropEnum, v) - } -} - -const ( - - // ListAgentsOKBodyQANMongodbProfilerAgentItems0LogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - ListAgentsOKBodyQANMongodbProfilerAgentItems0LogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // ListAgentsOKBodyQANMongodbProfilerAgentItems0LogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - ListAgentsOKBodyQANMongodbProfilerAgentItems0LogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // ListAgentsOKBodyQANMongodbProfilerAgentItems0LogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - ListAgentsOKBodyQANMongodbProfilerAgentItems0LogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // ListAgentsOKBodyQANMongodbProfilerAgentItems0LogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - ListAgentsOKBodyQANMongodbProfilerAgentItems0LogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // ListAgentsOKBodyQANMongodbProfilerAgentItems0LogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - ListAgentsOKBodyQANMongodbProfilerAgentItems0LogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // ListAgentsOKBodyQANMongodbProfilerAgentItems0LogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - ListAgentsOKBodyQANMongodbProfilerAgentItems0LogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -func (o *ListAgentsOKBodyQANMongodbProfilerAgentItems0) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, listAgentsOkBodyQanMongodbProfilerAgentItems0TypeLogLevelPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ListAgentsOKBodyQANMongodbProfilerAgentItems0) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("log_level", "body", *o.LogLevel); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this list agents OK body QAN mongodb profiler agent items0 based on context it is used -func (o *ListAgentsOKBodyQANMongodbProfilerAgentItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListAgentsOKBodyQANMongodbProfilerAgentItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAgentsOKBodyQANMongodbProfilerAgentItems0) UnmarshalBinary(b []byte) error { - var res ListAgentsOKBodyQANMongodbProfilerAgentItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListAgentsOKBodyQANMysqlPerfschemaAgentItems0 QANMySQLPerfSchemaAgent runs within pmm-agent and sends MySQL Query Analytics data to the PMM Server. -swagger:model ListAgentsOKBodyQANMysqlPerfschemaAgentItems0 -*/ -type ListAgentsOKBodyQANMysqlPerfschemaAgentItems0 struct { - // Unique randomly generated instance identifier. - AgentID string `json:"agent_id,omitempty"` - - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `json:"disabled,omitempty"` - - // Service identifier. - ServiceID string `json:"service_id,omitempty"` - - // MySQL username for getting performance data. - Username string `json:"username,omitempty"` - - // Use TLS for database connections. - TLS bool `json:"tls,omitempty"` - - // Skip TLS certificate and hostname validation. - TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - - // Certificate Authority certificate chain. - TLSCa string `json:"tls_ca,omitempty"` - - // Client certificate. - TLSCert string `json:"tls_cert,omitempty"` - - // Password for decrypting tls_cert. - TLSKey string `json:"tls_key,omitempty"` - - // Disable parsing comments from queries and showing them in QAN. - DisableCommentsParsing bool `json:"disable_comments_parsing,omitempty"` - - // Limit query length in QAN (default: server-defined; -1: no limit). - MaxQueryLength int32 `json:"max_query_length,omitempty"` - - // True if query examples are disabled. - QueryExamplesDisabled bool `json:"query_examples_disabled,omitempty"` - - // 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"` - - // 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 list agents OK body QAN mysql perfschema agent items0 -func (o *ListAgentsOKBodyQANMysqlPerfschemaAgentItems0) 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 listAgentsOkBodyQanMysqlPerfschemaAgentItems0TypeStatusPropEnum []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 { - listAgentsOkBodyQanMysqlPerfschemaAgentItems0TypeStatusPropEnum = append(listAgentsOkBodyQanMysqlPerfschemaAgentItems0TypeStatusPropEnum, v) - } -} - -const ( - - // ListAgentsOKBodyQANMysqlPerfschemaAgentItems0StatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - ListAgentsOKBodyQANMysqlPerfschemaAgentItems0StatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // ListAgentsOKBodyQANMysqlPerfschemaAgentItems0StatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - ListAgentsOKBodyQANMysqlPerfschemaAgentItems0StatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // ListAgentsOKBodyQANMysqlPerfschemaAgentItems0StatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - ListAgentsOKBodyQANMysqlPerfschemaAgentItems0StatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - - // ListAgentsOKBodyQANMysqlPerfschemaAgentItems0StatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - ListAgentsOKBodyQANMysqlPerfschemaAgentItems0StatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - - // ListAgentsOKBodyQANMysqlPerfschemaAgentItems0StatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - ListAgentsOKBodyQANMysqlPerfschemaAgentItems0StatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - - // ListAgentsOKBodyQANMysqlPerfschemaAgentItems0StatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - ListAgentsOKBodyQANMysqlPerfschemaAgentItems0StatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" - - // ListAgentsOKBodyQANMysqlPerfschemaAgentItems0StatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - ListAgentsOKBodyQANMysqlPerfschemaAgentItems0StatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" - - // ListAgentsOKBodyQANMysqlPerfschemaAgentItems0StatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - ListAgentsOKBodyQANMysqlPerfschemaAgentItems0StatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" -) - -// prop value enum -func (o *ListAgentsOKBodyQANMysqlPerfschemaAgentItems0) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, listAgentsOkBodyQanMysqlPerfschemaAgentItems0TypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ListAgentsOKBodyQANMysqlPerfschemaAgentItems0) 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 -} - -var listAgentsOkBodyQanMysqlPerfschemaAgentItems0TypeLogLevelPropEnum []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 { - listAgentsOkBodyQanMysqlPerfschemaAgentItems0TypeLogLevelPropEnum = append(listAgentsOkBodyQanMysqlPerfschemaAgentItems0TypeLogLevelPropEnum, v) - } -} - -const ( - - // ListAgentsOKBodyQANMysqlPerfschemaAgentItems0LogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - ListAgentsOKBodyQANMysqlPerfschemaAgentItems0LogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // ListAgentsOKBodyQANMysqlPerfschemaAgentItems0LogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - ListAgentsOKBodyQANMysqlPerfschemaAgentItems0LogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // ListAgentsOKBodyQANMysqlPerfschemaAgentItems0LogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - ListAgentsOKBodyQANMysqlPerfschemaAgentItems0LogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // ListAgentsOKBodyQANMysqlPerfschemaAgentItems0LogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - ListAgentsOKBodyQANMysqlPerfschemaAgentItems0LogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // ListAgentsOKBodyQANMysqlPerfschemaAgentItems0LogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - ListAgentsOKBodyQANMysqlPerfschemaAgentItems0LogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // ListAgentsOKBodyQANMysqlPerfschemaAgentItems0LogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - ListAgentsOKBodyQANMysqlPerfschemaAgentItems0LogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -func (o *ListAgentsOKBodyQANMysqlPerfschemaAgentItems0) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, listAgentsOkBodyQanMysqlPerfschemaAgentItems0TypeLogLevelPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ListAgentsOKBodyQANMysqlPerfschemaAgentItems0) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("log_level", "body", *o.LogLevel); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this list agents OK body QAN mysql perfschema agent items0 based on context it is used -func (o *ListAgentsOKBodyQANMysqlPerfschemaAgentItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListAgentsOKBodyQANMysqlPerfschemaAgentItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAgentsOKBodyQANMysqlPerfschemaAgentItems0) UnmarshalBinary(b []byte) error { - var res ListAgentsOKBodyQANMysqlPerfschemaAgentItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListAgentsOKBodyQANMysqlSlowlogAgentItems0 QANMySQLSlowlogAgent runs within pmm-agent and sends MySQL Query Analytics data to the PMM Server. -swagger:model ListAgentsOKBodyQANMysqlSlowlogAgentItems0 -*/ -type ListAgentsOKBodyQANMysqlSlowlogAgentItems0 struct { - // Unique randomly generated instance identifier. - AgentID string `json:"agent_id,omitempty"` - - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `json:"disabled,omitempty"` - - // Service identifier. - ServiceID string `json:"service_id,omitempty"` - - // MySQL username for getting performance data. - Username string `json:"username,omitempty"` - - // Use TLS for database connections. - TLS bool `json:"tls,omitempty"` - - // Skip TLS certificate and hostname validation. - TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - - // Certificate Authority certificate chain. - TLSCa string `json:"tls_ca,omitempty"` - - // Client certificate. - TLSCert string `json:"tls_cert,omitempty"` - - // Password for decrypting tls_cert. - TLSKey string `json:"tls_key,omitempty"` - - // Disable parsing comments from queries and showing them in QAN. - DisableCommentsParsing bool `json:"disable_comments_parsing,omitempty"` - - // Limit query length in QAN (default: server-defined; -1: no limit) - MaxQueryLength int32 `json:"max_query_length,omitempty"` - - // True if query examples are disabled. - QueryExamplesDisabled bool `json:"query_examples_disabled,omitempty"` - - // Slowlog file is rotated at this size if > 0. - MaxSlowlogFileSize string `json:"max_slowlog_file_size,omitempty"` - - // 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"` - - // 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 list agents OK body QAN mysql slowlog agent items0 -func (o *ListAgentsOKBodyQANMysqlSlowlogAgentItems0) 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 listAgentsOkBodyQanMysqlSlowlogAgentItems0TypeStatusPropEnum []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 { - listAgentsOkBodyQanMysqlSlowlogAgentItems0TypeStatusPropEnum = append(listAgentsOkBodyQanMysqlSlowlogAgentItems0TypeStatusPropEnum, v) - } -} - -const ( - - // ListAgentsOKBodyQANMysqlSlowlogAgentItems0StatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - ListAgentsOKBodyQANMysqlSlowlogAgentItems0StatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // ListAgentsOKBodyQANMysqlSlowlogAgentItems0StatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - ListAgentsOKBodyQANMysqlSlowlogAgentItems0StatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // ListAgentsOKBodyQANMysqlSlowlogAgentItems0StatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - ListAgentsOKBodyQANMysqlSlowlogAgentItems0StatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - - // ListAgentsOKBodyQANMysqlSlowlogAgentItems0StatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - ListAgentsOKBodyQANMysqlSlowlogAgentItems0StatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - - // ListAgentsOKBodyQANMysqlSlowlogAgentItems0StatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - ListAgentsOKBodyQANMysqlSlowlogAgentItems0StatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - - // ListAgentsOKBodyQANMysqlSlowlogAgentItems0StatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - ListAgentsOKBodyQANMysqlSlowlogAgentItems0StatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" - - // ListAgentsOKBodyQANMysqlSlowlogAgentItems0StatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - ListAgentsOKBodyQANMysqlSlowlogAgentItems0StatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" - - // ListAgentsOKBodyQANMysqlSlowlogAgentItems0StatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - ListAgentsOKBodyQANMysqlSlowlogAgentItems0StatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" -) - -// prop value enum -func (o *ListAgentsOKBodyQANMysqlSlowlogAgentItems0) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, listAgentsOkBodyQanMysqlSlowlogAgentItems0TypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ListAgentsOKBodyQANMysqlSlowlogAgentItems0) 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 -} - -var listAgentsOkBodyQanMysqlSlowlogAgentItems0TypeLogLevelPropEnum []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 { - listAgentsOkBodyQanMysqlSlowlogAgentItems0TypeLogLevelPropEnum = append(listAgentsOkBodyQanMysqlSlowlogAgentItems0TypeLogLevelPropEnum, v) - } -} - -const ( - - // ListAgentsOKBodyQANMysqlSlowlogAgentItems0LogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - ListAgentsOKBodyQANMysqlSlowlogAgentItems0LogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // ListAgentsOKBodyQANMysqlSlowlogAgentItems0LogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - ListAgentsOKBodyQANMysqlSlowlogAgentItems0LogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // ListAgentsOKBodyQANMysqlSlowlogAgentItems0LogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - ListAgentsOKBodyQANMysqlSlowlogAgentItems0LogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // ListAgentsOKBodyQANMysqlSlowlogAgentItems0LogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - ListAgentsOKBodyQANMysqlSlowlogAgentItems0LogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // ListAgentsOKBodyQANMysqlSlowlogAgentItems0LogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - ListAgentsOKBodyQANMysqlSlowlogAgentItems0LogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // ListAgentsOKBodyQANMysqlSlowlogAgentItems0LogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - ListAgentsOKBodyQANMysqlSlowlogAgentItems0LogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -func (o *ListAgentsOKBodyQANMysqlSlowlogAgentItems0) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, listAgentsOkBodyQanMysqlSlowlogAgentItems0TypeLogLevelPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ListAgentsOKBodyQANMysqlSlowlogAgentItems0) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("log_level", "body", *o.LogLevel); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this list agents OK body QAN mysql slowlog agent items0 based on context it is used -func (o *ListAgentsOKBodyQANMysqlSlowlogAgentItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListAgentsOKBodyQANMysqlSlowlogAgentItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAgentsOKBodyQANMysqlSlowlogAgentItems0) UnmarshalBinary(b []byte) error { - var res ListAgentsOKBodyQANMysqlSlowlogAgentItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListAgentsOKBodyQANPostgresqlPgstatementsAgentItems0 QANPostgreSQLPgStatementsAgent runs within pmm-agent and sends PostgreSQL Query Analytics data to the PMM Server. -swagger:model ListAgentsOKBodyQANPostgresqlPgstatementsAgentItems0 -*/ -type ListAgentsOKBodyQANPostgresqlPgstatementsAgentItems0 struct { - // Unique randomly generated instance identifier. - AgentID string `json:"agent_id,omitempty"` - - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `json:"disabled,omitempty"` - - // Service identifier. - ServiceID string `json:"service_id,omitempty"` - - // PostgreSQL username for getting pg stat statements data. - Username string `json:"username,omitempty"` - - // Disable parsing comments from queries and showing them in QAN. - DisableCommentsParsing bool `json:"disable_comments_parsing,omitempty"` - - // Limit query length in QAN (default: server-defined; -1: no limit). - MaxQueryLength int32 `json:"max_query_length,omitempty"` - - // Use TLS for database connections. - TLS bool `json:"tls,omitempty"` - - // Skip TLS certificate and hostname validation. - TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - - // 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"` - - // 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 list agents OK body QAN postgresql pgstatements agent items0 -func (o *ListAgentsOKBodyQANPostgresqlPgstatementsAgentItems0) 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 listAgentsOkBodyQanPostgresqlPgstatementsAgentItems0TypeStatusPropEnum []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 { - listAgentsOkBodyQanPostgresqlPgstatementsAgentItems0TypeStatusPropEnum = append(listAgentsOkBodyQanPostgresqlPgstatementsAgentItems0TypeStatusPropEnum, v) - } -} - -const ( - - // ListAgentsOKBodyQANPostgresqlPgstatementsAgentItems0StatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - ListAgentsOKBodyQANPostgresqlPgstatementsAgentItems0StatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // ListAgentsOKBodyQANPostgresqlPgstatementsAgentItems0StatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - ListAgentsOKBodyQANPostgresqlPgstatementsAgentItems0StatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // ListAgentsOKBodyQANPostgresqlPgstatementsAgentItems0StatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - ListAgentsOKBodyQANPostgresqlPgstatementsAgentItems0StatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - - // ListAgentsOKBodyQANPostgresqlPgstatementsAgentItems0StatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - ListAgentsOKBodyQANPostgresqlPgstatementsAgentItems0StatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - - // ListAgentsOKBodyQANPostgresqlPgstatementsAgentItems0StatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - ListAgentsOKBodyQANPostgresqlPgstatementsAgentItems0StatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - - // ListAgentsOKBodyQANPostgresqlPgstatementsAgentItems0StatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - ListAgentsOKBodyQANPostgresqlPgstatementsAgentItems0StatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" - - // ListAgentsOKBodyQANPostgresqlPgstatementsAgentItems0StatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - ListAgentsOKBodyQANPostgresqlPgstatementsAgentItems0StatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" - - // ListAgentsOKBodyQANPostgresqlPgstatementsAgentItems0StatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - ListAgentsOKBodyQANPostgresqlPgstatementsAgentItems0StatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" -) - -// prop value enum -func (o *ListAgentsOKBodyQANPostgresqlPgstatementsAgentItems0) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, listAgentsOkBodyQanPostgresqlPgstatementsAgentItems0TypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ListAgentsOKBodyQANPostgresqlPgstatementsAgentItems0) 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 -} - -var listAgentsOkBodyQanPostgresqlPgstatementsAgentItems0TypeLogLevelPropEnum []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 { - listAgentsOkBodyQanPostgresqlPgstatementsAgentItems0TypeLogLevelPropEnum = append(listAgentsOkBodyQanPostgresqlPgstatementsAgentItems0TypeLogLevelPropEnum, v) - } -} - -const ( - - // ListAgentsOKBodyQANPostgresqlPgstatementsAgentItems0LogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - ListAgentsOKBodyQANPostgresqlPgstatementsAgentItems0LogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // ListAgentsOKBodyQANPostgresqlPgstatementsAgentItems0LogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - ListAgentsOKBodyQANPostgresqlPgstatementsAgentItems0LogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // ListAgentsOKBodyQANPostgresqlPgstatementsAgentItems0LogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - ListAgentsOKBodyQANPostgresqlPgstatementsAgentItems0LogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // ListAgentsOKBodyQANPostgresqlPgstatementsAgentItems0LogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - ListAgentsOKBodyQANPostgresqlPgstatementsAgentItems0LogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // ListAgentsOKBodyQANPostgresqlPgstatementsAgentItems0LogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - ListAgentsOKBodyQANPostgresqlPgstatementsAgentItems0LogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // ListAgentsOKBodyQANPostgresqlPgstatementsAgentItems0LogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - ListAgentsOKBodyQANPostgresqlPgstatementsAgentItems0LogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -func (o *ListAgentsOKBodyQANPostgresqlPgstatementsAgentItems0) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, listAgentsOkBodyQanPostgresqlPgstatementsAgentItems0TypeLogLevelPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ListAgentsOKBodyQANPostgresqlPgstatementsAgentItems0) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("log_level", "body", *o.LogLevel); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this list agents OK body QAN postgresql pgstatements agent items0 based on context it is used -func (o *ListAgentsOKBodyQANPostgresqlPgstatementsAgentItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListAgentsOKBodyQANPostgresqlPgstatementsAgentItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAgentsOKBodyQANPostgresqlPgstatementsAgentItems0) UnmarshalBinary(b []byte) error { - var res ListAgentsOKBodyQANPostgresqlPgstatementsAgentItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListAgentsOKBodyQANPostgresqlPgstatmonitorAgentItems0 QANPostgreSQLPgStatMonitorAgent runs within pmm-agent and sends PostgreSQL Query Analytics data to the PMM Server. -swagger:model ListAgentsOKBodyQANPostgresqlPgstatmonitorAgentItems0 -*/ -type ListAgentsOKBodyQANPostgresqlPgstatmonitorAgentItems0 struct { - // Unique randomly generated instance identifier. - AgentID string `json:"agent_id,omitempty"` - - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `json:"disabled,omitempty"` - - // Service identifier. - ServiceID string `json:"service_id,omitempty"` - - // PostgreSQL username for getting pg stat monitor data. - Username string `json:"username,omitempty"` - - // Use TLS for database connections. - TLS bool `json:"tls,omitempty"` - - // Skip TLS certificate and hostname validation. - TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - - // Disable parsing comments from queries and showing them in QAN. - DisableCommentsParsing bool `json:"disable_comments_parsing,omitempty"` - - // Limit query length in QAN (default: server-defined; -1: no limit). - MaxQueryLength int32 `json:"max_query_length,omitempty"` - - // True if query examples are disabled. - QueryExamplesDisabled bool `json:"query_examples_disabled,omitempty"` - - // 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"` - - // 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 list agents OK body QAN postgresql pgstatmonitor agent items0 -func (o *ListAgentsOKBodyQANPostgresqlPgstatmonitorAgentItems0) 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 listAgentsOkBodyQanPostgresqlPgstatmonitorAgentItems0TypeStatusPropEnum []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 { - listAgentsOkBodyQanPostgresqlPgstatmonitorAgentItems0TypeStatusPropEnum = append(listAgentsOkBodyQanPostgresqlPgstatmonitorAgentItems0TypeStatusPropEnum, v) - } -} - -const ( - - // ListAgentsOKBodyQANPostgresqlPgstatmonitorAgentItems0StatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - ListAgentsOKBodyQANPostgresqlPgstatmonitorAgentItems0StatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // ListAgentsOKBodyQANPostgresqlPgstatmonitorAgentItems0StatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - ListAgentsOKBodyQANPostgresqlPgstatmonitorAgentItems0StatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // ListAgentsOKBodyQANPostgresqlPgstatmonitorAgentItems0StatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - ListAgentsOKBodyQANPostgresqlPgstatmonitorAgentItems0StatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - - // ListAgentsOKBodyQANPostgresqlPgstatmonitorAgentItems0StatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - ListAgentsOKBodyQANPostgresqlPgstatmonitorAgentItems0StatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - - // ListAgentsOKBodyQANPostgresqlPgstatmonitorAgentItems0StatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - ListAgentsOKBodyQANPostgresqlPgstatmonitorAgentItems0StatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - - // ListAgentsOKBodyQANPostgresqlPgstatmonitorAgentItems0StatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - ListAgentsOKBodyQANPostgresqlPgstatmonitorAgentItems0StatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" - - // ListAgentsOKBodyQANPostgresqlPgstatmonitorAgentItems0StatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - ListAgentsOKBodyQANPostgresqlPgstatmonitorAgentItems0StatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" - - // ListAgentsOKBodyQANPostgresqlPgstatmonitorAgentItems0StatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - ListAgentsOKBodyQANPostgresqlPgstatmonitorAgentItems0StatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" -) - -// prop value enum -func (o *ListAgentsOKBodyQANPostgresqlPgstatmonitorAgentItems0) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, listAgentsOkBodyQanPostgresqlPgstatmonitorAgentItems0TypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ListAgentsOKBodyQANPostgresqlPgstatmonitorAgentItems0) 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 -} - -var listAgentsOkBodyQanPostgresqlPgstatmonitorAgentItems0TypeLogLevelPropEnum []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 { - listAgentsOkBodyQanPostgresqlPgstatmonitorAgentItems0TypeLogLevelPropEnum = append(listAgentsOkBodyQanPostgresqlPgstatmonitorAgentItems0TypeLogLevelPropEnum, v) - } -} - -const ( - - // ListAgentsOKBodyQANPostgresqlPgstatmonitorAgentItems0LogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - ListAgentsOKBodyQANPostgresqlPgstatmonitorAgentItems0LogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // ListAgentsOKBodyQANPostgresqlPgstatmonitorAgentItems0LogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - ListAgentsOKBodyQANPostgresqlPgstatmonitorAgentItems0LogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // ListAgentsOKBodyQANPostgresqlPgstatmonitorAgentItems0LogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - ListAgentsOKBodyQANPostgresqlPgstatmonitorAgentItems0LogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // ListAgentsOKBodyQANPostgresqlPgstatmonitorAgentItems0LogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - ListAgentsOKBodyQANPostgresqlPgstatmonitorAgentItems0LogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // ListAgentsOKBodyQANPostgresqlPgstatmonitorAgentItems0LogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - ListAgentsOKBodyQANPostgresqlPgstatmonitorAgentItems0LogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // ListAgentsOKBodyQANPostgresqlPgstatmonitorAgentItems0LogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - ListAgentsOKBodyQANPostgresqlPgstatmonitorAgentItems0LogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -func (o *ListAgentsOKBodyQANPostgresqlPgstatmonitorAgentItems0) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, listAgentsOkBodyQanPostgresqlPgstatmonitorAgentItems0TypeLogLevelPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ListAgentsOKBodyQANPostgresqlPgstatmonitorAgentItems0) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("log_level", "body", *o.LogLevel); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this list agents OK body QAN postgresql pgstatmonitor agent items0 based on context it is used -func (o *ListAgentsOKBodyQANPostgresqlPgstatmonitorAgentItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListAgentsOKBodyQANPostgresqlPgstatmonitorAgentItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAgentsOKBodyQANPostgresqlPgstatmonitorAgentItems0) UnmarshalBinary(b []byte) error { - var res ListAgentsOKBodyQANPostgresqlPgstatmonitorAgentItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListAgentsOKBodyRDSExporterItems0 RDSExporter runs on Generic or Container Node and exposes RemoteRDS Node metrics. -swagger:model ListAgentsOKBodyRDSExporterItems0 -*/ -type ListAgentsOKBodyRDSExporterItems0 struct { - // Unique randomly generated instance identifier. - AgentID string `json:"agent_id,omitempty"` - - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `json:"disabled,omitempty"` - - // Node identifier. - NodeID string `json:"node_id,omitempty"` - - // AWS Access Key. - AWSAccessKey string `json:"aws_access_key,omitempty"` - - // 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"` - - // Basic metrics are disabled. - BasicMetricsDisabled bool `json:"basic_metrics_disabled,omitempty"` - - // Enhanced metrics are disabled. - EnhancedMetricsDisabled bool `json:"enhanced_metrics_disabled,omitempty"` - - // True if exporter uses push metrics mode. - PushMetricsEnabled bool `json:"push_metrics_enabled,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"` - - // metrics resolutions - MetricsResolutions *ListAgentsOKBodyRDSExporterItems0MetricsResolutions `json:"metrics_resolutions,omitempty"` -} - -// Validate validates this list agents OK body RDS exporter items0 -func (o *ListAgentsOKBodyRDSExporterItems0) 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 listAgentsOkBodyRdsExporterItems0TypeStatusPropEnum []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 { - listAgentsOkBodyRdsExporterItems0TypeStatusPropEnum = append(listAgentsOkBodyRdsExporterItems0TypeStatusPropEnum, v) - } -} - -const ( - - // ListAgentsOKBodyRDSExporterItems0StatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - ListAgentsOKBodyRDSExporterItems0StatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // ListAgentsOKBodyRDSExporterItems0StatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - ListAgentsOKBodyRDSExporterItems0StatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // ListAgentsOKBodyRDSExporterItems0StatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - ListAgentsOKBodyRDSExporterItems0StatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - - // ListAgentsOKBodyRDSExporterItems0StatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - ListAgentsOKBodyRDSExporterItems0StatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - - // ListAgentsOKBodyRDSExporterItems0StatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - ListAgentsOKBodyRDSExporterItems0StatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - - // ListAgentsOKBodyRDSExporterItems0StatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - ListAgentsOKBodyRDSExporterItems0StatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" - - // ListAgentsOKBodyRDSExporterItems0StatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - ListAgentsOKBodyRDSExporterItems0StatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" - - // ListAgentsOKBodyRDSExporterItems0StatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - ListAgentsOKBodyRDSExporterItems0StatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" -) - -// prop value enum -func (o *ListAgentsOKBodyRDSExporterItems0) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, listAgentsOkBodyRdsExporterItems0TypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ListAgentsOKBodyRDSExporterItems0) 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 -} - -var listAgentsOkBodyRdsExporterItems0TypeLogLevelPropEnum []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 { - listAgentsOkBodyRdsExporterItems0TypeLogLevelPropEnum = append(listAgentsOkBodyRdsExporterItems0TypeLogLevelPropEnum, v) - } -} - -const ( - - // ListAgentsOKBodyRDSExporterItems0LogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - ListAgentsOKBodyRDSExporterItems0LogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // ListAgentsOKBodyRDSExporterItems0LogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - ListAgentsOKBodyRDSExporterItems0LogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // ListAgentsOKBodyRDSExporterItems0LogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - ListAgentsOKBodyRDSExporterItems0LogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // ListAgentsOKBodyRDSExporterItems0LogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - ListAgentsOKBodyRDSExporterItems0LogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // ListAgentsOKBodyRDSExporterItems0LogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - ListAgentsOKBodyRDSExporterItems0LogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // ListAgentsOKBodyRDSExporterItems0LogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - ListAgentsOKBodyRDSExporterItems0LogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -func (o *ListAgentsOKBodyRDSExporterItems0) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, listAgentsOkBodyRdsExporterItems0TypeLogLevelPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ListAgentsOKBodyRDSExporterItems0) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("log_level", "body", *o.LogLevel); err != nil { - return err - } - - return nil -} - -func (o *ListAgentsOKBodyRDSExporterItems0) 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("metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("metrics_resolutions") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this list agents OK body RDS exporter items0 based on the context it is used -func (o *ListAgentsOKBodyRDSExporterItems0) 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 *ListAgentsOKBodyRDSExporterItems0) 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 { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("metrics_resolutions") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListAgentsOKBodyRDSExporterItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAgentsOKBodyRDSExporterItems0) UnmarshalBinary(b []byte) error { - var res ListAgentsOKBodyRDSExporterItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListAgentsOKBodyRDSExporterItems0MetricsResolutions MetricsResolutions represents Prometheus exporters metrics resolutions. -swagger:model ListAgentsOKBodyRDSExporterItems0MetricsResolutions -*/ -type ListAgentsOKBodyRDSExporterItems0MetricsResolutions struct { - // High resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Hr string `json:"hr,omitempty"` - - // Medium resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Mr string `json:"mr,omitempty"` - - // Low resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Lr string `json:"lr,omitempty"` -} - -// Validate validates this list agents OK body RDS exporter items0 metrics resolutions -func (o *ListAgentsOKBodyRDSExporterItems0MetricsResolutions) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list agents OK body RDS exporter items0 metrics resolutions based on context it is used -func (o *ListAgentsOKBodyRDSExporterItems0MetricsResolutions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListAgentsOKBodyRDSExporterItems0MetricsResolutions) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAgentsOKBodyRDSExporterItems0MetricsResolutions) UnmarshalBinary(b []byte) error { - var res ListAgentsOKBodyRDSExporterItems0MetricsResolutions - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListAgentsOKBodyVMAgentItems0 VMAgent runs on Generic or Container Node alongside pmm-agent. -// It scrapes other exporter Agents that are configured with push_metrics_enabled -// and uses Prometheus remote write protocol to push metrics to PMM Server. -swagger:model ListAgentsOKBodyVMAgentItems0 -*/ -type ListAgentsOKBodyVMAgentItems0 struct { - // Unique randomly generated instance identifier. - AgentID string `json:"agent_id,omitempty"` - - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,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"` - - // Path to exec process. - ProcessExecPath string `json:"process_exec_path,omitempty"` - - // Listen port for scraping metrics. - ListenPort int64 `json:"listen_port,omitempty"` -} - -// Validate validates this list agents OK body VM agent items0 -func (o *ListAgentsOKBodyVMAgentItems0) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateStatus(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var listAgentsOkBodyVmAgentItems0TypeStatusPropEnum []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 { - listAgentsOkBodyVmAgentItems0TypeStatusPropEnum = append(listAgentsOkBodyVmAgentItems0TypeStatusPropEnum, v) - } -} - -const ( - - // ListAgentsOKBodyVMAgentItems0StatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - ListAgentsOKBodyVMAgentItems0StatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // ListAgentsOKBodyVMAgentItems0StatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - ListAgentsOKBodyVMAgentItems0StatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // ListAgentsOKBodyVMAgentItems0StatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - ListAgentsOKBodyVMAgentItems0StatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - - // ListAgentsOKBodyVMAgentItems0StatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - ListAgentsOKBodyVMAgentItems0StatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - - // ListAgentsOKBodyVMAgentItems0StatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - ListAgentsOKBodyVMAgentItems0StatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - - // ListAgentsOKBodyVMAgentItems0StatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - ListAgentsOKBodyVMAgentItems0StatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" - - // ListAgentsOKBodyVMAgentItems0StatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - ListAgentsOKBodyVMAgentItems0StatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" - - // ListAgentsOKBodyVMAgentItems0StatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - ListAgentsOKBodyVMAgentItems0StatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" -) - -// prop value enum -func (o *ListAgentsOKBodyVMAgentItems0) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, listAgentsOkBodyVmAgentItems0TypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ListAgentsOKBodyVMAgentItems0) 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 validates this list agents OK body VM agent items0 based on context it is used -func (o *ListAgentsOKBodyVMAgentItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListAgentsOKBodyVMAgentItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAgentsOKBodyVMAgentItems0) UnmarshalBinary(b []byte) error { - var res ListAgentsOKBodyVMAgentItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListAgentsOKBodyValkeyExporterItems0 ValkeyExporter runs on Generic or Container Node and exposes Valkey Service metrics. -swagger:model ListAgentsOKBodyValkeyExporterItems0 -*/ -type ListAgentsOKBodyValkeyExporterItems0 struct { - // Unique randomly generated instance identifier. - AgentID string `json:"agent_id,omitempty"` - - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `json:"disabled,omitempty"` - - // Service identifier. - ServiceID string `json:"service_id,omitempty"` - - // Valkey username for scraping metrics. - Username string `json:"username,omitempty"` - - // Use TLS for database connections. - TLS bool `json:"tls,omitempty"` - - // Skip TLS certificate and hostname verification. - TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // True if exporter uses push metrics mode. - PushMetricsEnabled bool `json:"push_metrics_enabled,omitempty"` - - // 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"` - - // metrics resolutions - MetricsResolutions *ListAgentsOKBodyValkeyExporterItems0MetricsResolutions `json:"metrics_resolutions,omitempty"` -} - -// Validate validates this list agents OK body valkey exporter items0 -func (o *ListAgentsOKBodyValkeyExporterItems0) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateStatus(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 listAgentsOkBodyValkeyExporterItems0TypeStatusPropEnum []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 { - listAgentsOkBodyValkeyExporterItems0TypeStatusPropEnum = append(listAgentsOkBodyValkeyExporterItems0TypeStatusPropEnum, v) - } -} - -const ( - - // ListAgentsOKBodyValkeyExporterItems0StatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - ListAgentsOKBodyValkeyExporterItems0StatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // ListAgentsOKBodyValkeyExporterItems0StatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - ListAgentsOKBodyValkeyExporterItems0StatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // ListAgentsOKBodyValkeyExporterItems0StatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - ListAgentsOKBodyValkeyExporterItems0StatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - - // ListAgentsOKBodyValkeyExporterItems0StatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - ListAgentsOKBodyValkeyExporterItems0StatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - - // ListAgentsOKBodyValkeyExporterItems0StatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - ListAgentsOKBodyValkeyExporterItems0StatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - - // ListAgentsOKBodyValkeyExporterItems0StatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - ListAgentsOKBodyValkeyExporterItems0StatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" - - // ListAgentsOKBodyValkeyExporterItems0StatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - ListAgentsOKBodyValkeyExporterItems0StatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" - - // ListAgentsOKBodyValkeyExporterItems0StatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - ListAgentsOKBodyValkeyExporterItems0StatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" -) - -// prop value enum -func (o *ListAgentsOKBodyValkeyExporterItems0) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, listAgentsOkBodyValkeyExporterItems0TypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ListAgentsOKBodyValkeyExporterItems0) 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 *ListAgentsOKBodyValkeyExporterItems0) 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("metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("metrics_resolutions") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this list agents OK body valkey exporter items0 based on the context it is used -func (o *ListAgentsOKBodyValkeyExporterItems0) 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 *ListAgentsOKBodyValkeyExporterItems0) 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 { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("metrics_resolutions") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListAgentsOKBodyValkeyExporterItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAgentsOKBodyValkeyExporterItems0) UnmarshalBinary(b []byte) error { - var res ListAgentsOKBodyValkeyExporterItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListAgentsOKBodyValkeyExporterItems0MetricsResolutions MetricsResolutions represents Prometheus exporters metrics resolutions. -swagger:model ListAgentsOKBodyValkeyExporterItems0MetricsResolutions -*/ -type ListAgentsOKBodyValkeyExporterItems0MetricsResolutions struct { - // High resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Hr string `json:"hr,omitempty"` - - // Medium resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Mr string `json:"mr,omitempty"` - - // Low resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Lr string `json:"lr,omitempty"` -} - -// Validate validates this list agents OK body valkey exporter items0 metrics resolutions -func (o *ListAgentsOKBodyValkeyExporterItems0MetricsResolutions) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list agents OK body valkey exporter items0 metrics resolutions based on context it is used -func (o *ListAgentsOKBodyValkeyExporterItems0MetricsResolutions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListAgentsOKBodyValkeyExporterItems0MetricsResolutions) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAgentsOKBodyValkeyExporterItems0MetricsResolutions) UnmarshalBinary(b []byte) error { - var res ListAgentsOKBodyValkeyExporterItems0MetricsResolutions - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/inventory/v1/json/client/agents_service/remove_agent_parameters.go b/api/inventory/v1/json/client/agents_service/remove_agent_parameters.go deleted file mode 100644 index fd762f29720..00000000000 --- a/api/inventory/v1/json/client/agents_service/remove_agent_parameters.go +++ /dev/null @@ -1,180 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package agents_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" - "github.com/go-openapi/swag" -) - -// NewRemoveAgentParams creates a new RemoveAgentParams 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 NewRemoveAgentParams() *RemoveAgentParams { - return &RemoveAgentParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewRemoveAgentParamsWithTimeout creates a new RemoveAgentParams object -// with the ability to set a timeout on a request. -func NewRemoveAgentParamsWithTimeout(timeout time.Duration) *RemoveAgentParams { - return &RemoveAgentParams{ - timeout: timeout, - } -} - -// NewRemoveAgentParamsWithContext creates a new RemoveAgentParams object -// with the ability to set a context for a request. -func NewRemoveAgentParamsWithContext(ctx context.Context) *RemoveAgentParams { - return &RemoveAgentParams{ - Context: ctx, - } -} - -// NewRemoveAgentParamsWithHTTPClient creates a new RemoveAgentParams object -// with the ability to set a custom HTTPClient for a request. -func NewRemoveAgentParamsWithHTTPClient(client *http.Client) *RemoveAgentParams { - return &RemoveAgentParams{ - HTTPClient: client, - } -} - -/* -RemoveAgentParams contains all the parameters to send to the API endpoint - - for the remove agent operation. - - Typically these are written to a http.Request. -*/ -type RemoveAgentParams struct { - // AgentID. - AgentID string - - /* Force. - - Remove agent with all dependencies. - */ - Force *bool - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the remove agent params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *RemoveAgentParams) WithDefaults() *RemoveAgentParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the remove agent params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *RemoveAgentParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the remove agent params -func (o *RemoveAgentParams) WithTimeout(timeout time.Duration) *RemoveAgentParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the remove agent params -func (o *RemoveAgentParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the remove agent params -func (o *RemoveAgentParams) WithContext(ctx context.Context) *RemoveAgentParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the remove agent params -func (o *RemoveAgentParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the remove agent params -func (o *RemoveAgentParams) WithHTTPClient(client *http.Client) *RemoveAgentParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the remove agent params -func (o *RemoveAgentParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithAgentID adds the agentID to the remove agent params -func (o *RemoveAgentParams) WithAgentID(agentID string) *RemoveAgentParams { - o.SetAgentID(agentID) - return o -} - -// SetAgentID adds the agentId to the remove agent params -func (o *RemoveAgentParams) SetAgentID(agentID string) { - o.AgentID = agentID -} - -// WithForce adds the force to the remove agent params -func (o *RemoveAgentParams) WithForce(force *bool) *RemoveAgentParams { - o.SetForce(force) - return o -} - -// SetForce adds the force to the remove agent params -func (o *RemoveAgentParams) SetForce(force *bool) { - o.Force = force -} - -// WriteToRequest writes these params to a swagger request -func (o *RemoveAgentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param agent_id - if err := r.SetPathParam("agent_id", o.AgentID); err != nil { - return err - } - - if o.Force != nil { - - // query param force - var qrForce bool - - if o.Force != nil { - qrForce = *o.Force - } - qForce := swag.FormatBool(qrForce) - if qForce != "" { - if err := r.SetQueryParam("force", qForce); err != nil { - return err - } - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/api/inventory/v1/json/client/agents_service/remove_agent_responses.go b/api/inventory/v1/json/client/agents_service/remove_agent_responses.go deleted file mode 100644 index 15ce395fa19..00000000000 --- a/api/inventory/v1/json/client/agents_service/remove_agent_responses.go +++ /dev/null @@ -1,414 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package agents_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" -) - -// RemoveAgentReader is a Reader for the RemoveAgent structure. -type RemoveAgentReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *RemoveAgentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewRemoveAgentOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewRemoveAgentDefault(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 - } -} - -// NewRemoveAgentOK creates a RemoveAgentOK with default headers values -func NewRemoveAgentOK() *RemoveAgentOK { - return &RemoveAgentOK{} -} - -/* -RemoveAgentOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type RemoveAgentOK struct { - Payload any -} - -// IsSuccess returns true when this remove agent Ok response has a 2xx status code -func (o *RemoveAgentOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this remove agent Ok response has a 3xx status code -func (o *RemoveAgentOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this remove agent Ok response has a 4xx status code -func (o *RemoveAgentOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this remove agent Ok response has a 5xx status code -func (o *RemoveAgentOK) IsServerError() bool { - return false -} - -// IsCode returns true when this remove agent Ok response a status code equal to that given -func (o *RemoveAgentOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the remove agent Ok response -func (o *RemoveAgentOK) Code() int { - return 200 -} - -func (o *RemoveAgentOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/inventory/agents/{agent_id}][%d] removeAgentOk %s", 200, payload) -} - -func (o *RemoveAgentOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/inventory/agents/{agent_id}][%d] removeAgentOk %s", 200, payload) -} - -func (o *RemoveAgentOK) GetPayload() any { - return o.Payload -} - -func (o *RemoveAgentOK) 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) { - return err - } - - return nil -} - -// NewRemoveAgentDefault creates a RemoveAgentDefault with default headers values -func NewRemoveAgentDefault(code int) *RemoveAgentDefault { - return &RemoveAgentDefault{ - _statusCode: code, - } -} - -/* -RemoveAgentDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type RemoveAgentDefault struct { - _statusCode int - - Payload *RemoveAgentDefaultBody -} - -// IsSuccess returns true when this remove agent default response has a 2xx status code -func (o *RemoveAgentDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this remove agent default response has a 3xx status code -func (o *RemoveAgentDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this remove agent default response has a 4xx status code -func (o *RemoveAgentDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this remove agent default response has a 5xx status code -func (o *RemoveAgentDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this remove agent default response a status code equal to that given -func (o *RemoveAgentDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the remove agent default response -func (o *RemoveAgentDefault) Code() int { - return o._statusCode -} - -func (o *RemoveAgentDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/inventory/agents/{agent_id}][%d] RemoveAgent default %s", o._statusCode, payload) -} - -func (o *RemoveAgentDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/inventory/agents/{agent_id}][%d] RemoveAgent default %s", o._statusCode, payload) -} - -func (o *RemoveAgentDefault) GetPayload() *RemoveAgentDefaultBody { - return o.Payload -} - -func (o *RemoveAgentDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(RemoveAgentDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -RemoveAgentDefaultBody remove agent default body -swagger:model RemoveAgentDefaultBody -*/ -type RemoveAgentDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*RemoveAgentDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this remove agent default body -func (o *RemoveAgentDefaultBody) 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 *RemoveAgentDefaultBody) 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("RemoveAgent default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("RemoveAgent default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this remove agent default body based on the context it is used -func (o *RemoveAgentDefaultBody) 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 *RemoveAgentDefaultBody) 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("RemoveAgent default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("RemoveAgent default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *RemoveAgentDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *RemoveAgentDefaultBody) UnmarshalBinary(b []byte) error { - var res RemoveAgentDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -RemoveAgentDefaultBodyDetailsItems0 remove agent default body details items0 -swagger:model RemoveAgentDefaultBodyDetailsItems0 -*/ -type RemoveAgentDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` - - // remove agent default body details items0 - RemoveAgentDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *RemoveAgentDefaultBodyDetailsItems0) 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 RemoveAgentDefaultBodyDetailsItems0 - - 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.RemoveAgentDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o RemoveAgentDefaultBodyDetailsItems0) 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.RemoveAgentDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.RemoveAgentDefaultBodyDetailsItems0) - 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 remove agent default body details items0 -func (o *RemoveAgentDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this remove agent default body details items0 based on context it is used -func (o *RemoveAgentDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *RemoveAgentDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *RemoveAgentDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res RemoveAgentDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/inventory/v1/json/client/nodes_service/add_node_parameters.go b/api/inventory/v1/json/client/nodes_service/add_node_parameters.go deleted file mode 100644 index 67702dfa372..00000000000 --- a/api/inventory/v1/json/client/nodes_service/add_node_parameters.go +++ /dev/null @@ -1,144 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package nodes_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" -) - -// NewAddNodeParams creates a new AddNodeParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewAddNodeParams() *AddNodeParams { - return &AddNodeParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewAddNodeParamsWithTimeout creates a new AddNodeParams object -// with the ability to set a timeout on a request. -func NewAddNodeParamsWithTimeout(timeout time.Duration) *AddNodeParams { - return &AddNodeParams{ - timeout: timeout, - } -} - -// NewAddNodeParamsWithContext creates a new AddNodeParams object -// with the ability to set a context for a request. -func NewAddNodeParamsWithContext(ctx context.Context) *AddNodeParams { - return &AddNodeParams{ - Context: ctx, - } -} - -// NewAddNodeParamsWithHTTPClient creates a new AddNodeParams object -// with the ability to set a custom HTTPClient for a request. -func NewAddNodeParamsWithHTTPClient(client *http.Client) *AddNodeParams { - return &AddNodeParams{ - HTTPClient: client, - } -} - -/* -AddNodeParams contains all the parameters to send to the API endpoint - - for the add node operation. - - Typically these are written to a http.Request. -*/ -type AddNodeParams struct { - // Body. - Body AddNodeBody - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the add node params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *AddNodeParams) WithDefaults() *AddNodeParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the add node params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *AddNodeParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the add node params -func (o *AddNodeParams) WithTimeout(timeout time.Duration) *AddNodeParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the add node params -func (o *AddNodeParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the add node params -func (o *AddNodeParams) WithContext(ctx context.Context) *AddNodeParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the add node params -func (o *AddNodeParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the add node params -func (o *AddNodeParams) WithHTTPClient(client *http.Client) *AddNodeParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the add node params -func (o *AddNodeParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the add node params -func (o *AddNodeParams) WithBody(body AddNodeBody) *AddNodeParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the add node params -func (o *AddNodeParams) SetBody(body AddNodeBody) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *AddNodeParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/api/inventory/v1/json/client/nodes_service/add_node_responses.go b/api/inventory/v1/json/client/nodes_service/add_node_responses.go deleted file mode 100644 index 026b8d616a0..00000000000 --- a/api/inventory/v1/json/client/nodes_service/add_node_responses.go +++ /dev/null @@ -1,1652 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package nodes_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" -) - -// AddNodeReader is a Reader for the AddNode structure. -type AddNodeReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *AddNodeReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewAddNodeOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewAddNodeDefault(response.Code()) - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - if response.Code()/100 == 2 { - return result, nil - } - return nil, result - } -} - -// NewAddNodeOK creates a AddNodeOK with default headers values -func NewAddNodeOK() *AddNodeOK { - return &AddNodeOK{} -} - -/* -AddNodeOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type AddNodeOK struct { - Payload *AddNodeOKBody -} - -// IsSuccess returns true when this add node Ok response has a 2xx status code -func (o *AddNodeOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this add node Ok response has a 3xx status code -func (o *AddNodeOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this add node Ok response has a 4xx status code -func (o *AddNodeOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this add node Ok response has a 5xx status code -func (o *AddNodeOK) IsServerError() bool { - return false -} - -// IsCode returns true when this add node Ok response a status code equal to that given -func (o *AddNodeOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the add node Ok response -func (o *AddNodeOK) Code() int { - return 200 -} - -func (o *AddNodeOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/inventory/nodes][%d] addNodeOk %s", 200, payload) -} - -func (o *AddNodeOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/inventory/nodes][%d] addNodeOk %s", 200, payload) -} - -func (o *AddNodeOK) GetPayload() *AddNodeOKBody { - return o.Payload -} - -func (o *AddNodeOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(AddNodeOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -// NewAddNodeDefault creates a AddNodeDefault with default headers values -func NewAddNodeDefault(code int) *AddNodeDefault { - return &AddNodeDefault{ - _statusCode: code, - } -} - -/* -AddNodeDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type AddNodeDefault struct { - _statusCode int - - Payload *AddNodeDefaultBody -} - -// IsSuccess returns true when this add node default response has a 2xx status code -func (o *AddNodeDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this add node default response has a 3xx status code -func (o *AddNodeDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this add node default response has a 4xx status code -func (o *AddNodeDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this add node default response has a 5xx status code -func (o *AddNodeDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this add node default response a status code equal to that given -func (o *AddNodeDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the add node default response -func (o *AddNodeDefault) Code() int { - return o._statusCode -} - -func (o *AddNodeDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/inventory/nodes][%d] AddNode default %s", o._statusCode, payload) -} - -func (o *AddNodeDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/inventory/nodes][%d] AddNode default %s", o._statusCode, payload) -} - -func (o *AddNodeDefault) GetPayload() *AddNodeDefaultBody { - return o.Payload -} - -func (o *AddNodeDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(AddNodeDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -AddNodeBody add node body -swagger:model AddNodeBody -*/ -type AddNodeBody struct { - // container - Container *AddNodeParamsBodyContainer `json:"container,omitempty"` - - // generic - Generic *AddNodeParamsBodyGeneric `json:"generic,omitempty"` - - // remote - Remote *AddNodeParamsBodyRemote `json:"remote,omitempty"` - - // remote azure - RemoteAzure *AddNodeParamsBodyRemoteAzure `json:"remote_azure,omitempty"` - - // remote rds - RemoteRDS *AddNodeParamsBodyRemoteRDS `json:"remote_rds,omitempty"` -} - -// Validate validates this add node body -func (o *AddNodeBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateContainer(formats); err != nil { - res = append(res, err) - } - - if err := o.validateGeneric(formats); err != nil { - res = append(res, err) - } - - if err := o.validateRemote(formats); err != nil { - res = append(res, err) - } - - if err := o.validateRemoteAzure(formats); err != nil { - res = append(res, err) - } - - if err := o.validateRemoteRDS(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *AddNodeBody) validateContainer(formats strfmt.Registry) error { - if swag.IsZero(o.Container) { // not required - return nil - } - - if o.Container != nil { - if err := o.Container.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "container") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "container") - } - - return err - } - } - - return nil -} - -func (o *AddNodeBody) validateGeneric(formats strfmt.Registry) error { - if swag.IsZero(o.Generic) { // not required - return nil - } - - if o.Generic != nil { - if err := o.Generic.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "generic") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "generic") - } - - return err - } - } - - return nil -} - -func (o *AddNodeBody) validateRemote(formats strfmt.Registry) error { - if swag.IsZero(o.Remote) { // not required - return nil - } - - if o.Remote != nil { - if err := o.Remote.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "remote") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "remote") - } - - return err - } - } - - return nil -} - -func (o *AddNodeBody) validateRemoteAzure(formats strfmt.Registry) error { - if swag.IsZero(o.RemoteAzure) { // not required - return nil - } - - if o.RemoteAzure != nil { - if err := o.RemoteAzure.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "remote_azure") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "remote_azure") - } - - return err - } - } - - return nil -} - -func (o *AddNodeBody) validateRemoteRDS(formats strfmt.Registry) error { - if swag.IsZero(o.RemoteRDS) { // not required - return nil - } - - if o.RemoteRDS != nil { - if err := o.RemoteRDS.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "remote_rds") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "remote_rds") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this add node body based on the context it is used -func (o *AddNodeBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateContainer(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateGeneric(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateRemote(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateRemoteAzure(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateRemoteRDS(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *AddNodeBody) contextValidateContainer(ctx context.Context, formats strfmt.Registry) error { - if o.Container != nil { - - if swag.IsZero(o.Container) { // not required - return nil - } - - if err := o.Container.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "container") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "container") - } - - return err - } - } - - return nil -} - -func (o *AddNodeBody) contextValidateGeneric(ctx context.Context, formats strfmt.Registry) error { - if o.Generic != nil { - - if swag.IsZero(o.Generic) { // not required - return nil - } - - if err := o.Generic.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "generic") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "generic") - } - - return err - } - } - - return nil -} - -func (o *AddNodeBody) contextValidateRemote(ctx context.Context, formats strfmt.Registry) error { - if o.Remote != nil { - - if swag.IsZero(o.Remote) { // not required - return nil - } - - if err := o.Remote.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "remote") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "remote") - } - - return err - } - } - - return nil -} - -func (o *AddNodeBody) contextValidateRemoteAzure(ctx context.Context, formats strfmt.Registry) error { - if o.RemoteAzure != nil { - - if swag.IsZero(o.RemoteAzure) { // not required - return nil - } - - if err := o.RemoteAzure.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "remote_azure") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "remote_azure") - } - - return err - } - } - - return nil -} - -func (o *AddNodeBody) contextValidateRemoteRDS(ctx context.Context, formats strfmt.Registry) error { - if o.RemoteRDS != nil { - - if swag.IsZero(o.RemoteRDS) { // not required - return nil - } - - if err := o.RemoteRDS.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "remote_rds") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "remote_rds") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *AddNodeBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddNodeBody) UnmarshalBinary(b []byte) error { - var res AddNodeBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddNodeDefaultBody add node default body -swagger:model AddNodeDefaultBody -*/ -type AddNodeDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*AddNodeDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this add node default body -func (o *AddNodeDefaultBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateDetails(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *AddNodeDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required - return nil - } - - for i := 0; i < len(o.Details); i++ { - if swag.IsZero(o.Details[i]) { // not required - continue - } - - if o.Details[i] != nil { - if err := o.Details[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("AddNode default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("AddNode default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this add node default body based on the context it is used -func (o *AddNodeDefaultBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateDetails(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *AddNodeDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Details); i++ { - if o.Details[i] != nil { - - if 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("AddNode default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("AddNode default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *AddNodeDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddNodeDefaultBody) UnmarshalBinary(b []byte) error { - var res AddNodeDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddNodeDefaultBodyDetailsItems0 add node default body details items0 -swagger:model AddNodeDefaultBodyDetailsItems0 -*/ -type AddNodeDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` - - // add node default body details items0 - AddNodeDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *AddNodeDefaultBodyDetailsItems0) 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 AddNodeDefaultBodyDetailsItems0 - - 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.AddNodeDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o AddNodeDefaultBodyDetailsItems0) 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.AddNodeDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.AddNodeDefaultBodyDetailsItems0) - 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 add node default body details items0 -func (o *AddNodeDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this add node default body details items0 based on context it is used -func (o *AddNodeDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddNodeDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddNodeDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res AddNodeDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddNodeOKBody add node OK body -swagger:model AddNodeOKBody -*/ -type AddNodeOKBody struct { - // container - Container *AddNodeOKBodyContainer `json:"container,omitempty"` - - // generic - Generic *AddNodeOKBodyGeneric `json:"generic,omitempty"` - - // remote - Remote *AddNodeOKBodyRemote `json:"remote,omitempty"` - - // remote azure database - RemoteAzureDatabase *AddNodeOKBodyRemoteAzureDatabase `json:"remote_azure_database,omitempty"` - - // remote rds - RemoteRDS *AddNodeOKBodyRemoteRDS `json:"remote_rds,omitempty"` -} - -// Validate validates this add node OK body -func (o *AddNodeOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateContainer(formats); err != nil { - res = append(res, err) - } - - if err := o.validateGeneric(formats); err != nil { - res = append(res, err) - } - - if err := o.validateRemote(formats); err != nil { - res = append(res, err) - } - - if err := o.validateRemoteAzureDatabase(formats); err != nil { - res = append(res, err) - } - - if err := o.validateRemoteRDS(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *AddNodeOKBody) validateContainer(formats strfmt.Registry) error { - if swag.IsZero(o.Container) { // not required - return nil - } - - if o.Container != nil { - if err := o.Container.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addNodeOk" + "." + "container") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addNodeOk" + "." + "container") - } - - return err - } - } - - return nil -} - -func (o *AddNodeOKBody) validateGeneric(formats strfmt.Registry) error { - if swag.IsZero(o.Generic) { // not required - return nil - } - - if o.Generic != nil { - if err := o.Generic.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addNodeOk" + "." + "generic") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addNodeOk" + "." + "generic") - } - - return err - } - } - - return nil -} - -func (o *AddNodeOKBody) validateRemote(formats strfmt.Registry) error { - if swag.IsZero(o.Remote) { // not required - return nil - } - - if o.Remote != nil { - if err := o.Remote.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addNodeOk" + "." + "remote") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addNodeOk" + "." + "remote") - } - - return err - } - } - - return nil -} - -func (o *AddNodeOKBody) validateRemoteAzureDatabase(formats strfmt.Registry) error { - if swag.IsZero(o.RemoteAzureDatabase) { // not required - return nil - } - - if o.RemoteAzureDatabase != nil { - if err := o.RemoteAzureDatabase.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addNodeOk" + "." + "remote_azure_database") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addNodeOk" + "." + "remote_azure_database") - } - - return err - } - } - - return nil -} - -func (o *AddNodeOKBody) validateRemoteRDS(formats strfmt.Registry) error { - if swag.IsZero(o.RemoteRDS) { // not required - return nil - } - - if o.RemoteRDS != nil { - if err := o.RemoteRDS.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addNodeOk" + "." + "remote_rds") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addNodeOk" + "." + "remote_rds") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this add node OK body based on the context it is used -func (o *AddNodeOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateContainer(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateGeneric(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateRemote(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateRemoteAzureDatabase(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateRemoteRDS(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *AddNodeOKBody) contextValidateContainer(ctx context.Context, formats strfmt.Registry) error { - if o.Container != nil { - - if swag.IsZero(o.Container) { // not required - return nil - } - - if err := o.Container.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addNodeOk" + "." + "container") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addNodeOk" + "." + "container") - } - - return err - } - } - - return nil -} - -func (o *AddNodeOKBody) contextValidateGeneric(ctx context.Context, formats strfmt.Registry) error { - if o.Generic != nil { - - if swag.IsZero(o.Generic) { // not required - return nil - } - - if err := o.Generic.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addNodeOk" + "." + "generic") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addNodeOk" + "." + "generic") - } - - return err - } - } - - return nil -} - -func (o *AddNodeOKBody) contextValidateRemote(ctx context.Context, formats strfmt.Registry) error { - if o.Remote != nil { - - if swag.IsZero(o.Remote) { // not required - return nil - } - - if err := o.Remote.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addNodeOk" + "." + "remote") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addNodeOk" + "." + "remote") - } - - return err - } - } - - return nil -} - -func (o *AddNodeOKBody) contextValidateRemoteAzureDatabase(ctx context.Context, formats strfmt.Registry) error { - if o.RemoteAzureDatabase != nil { - - if swag.IsZero(o.RemoteAzureDatabase) { // not required - return nil - } - - if err := o.RemoteAzureDatabase.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addNodeOk" + "." + "remote_azure_database") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addNodeOk" + "." + "remote_azure_database") - } - - return err - } - } - - return nil -} - -func (o *AddNodeOKBody) contextValidateRemoteRDS(ctx context.Context, formats strfmt.Registry) error { - if o.RemoteRDS != nil { - - if swag.IsZero(o.RemoteRDS) { // not required - return nil - } - - if err := o.RemoteRDS.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addNodeOk" + "." + "remote_rds") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addNodeOk" + "." + "remote_rds") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *AddNodeOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddNodeOKBody) UnmarshalBinary(b []byte) error { - var res AddNodeOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddNodeOKBodyContainer ContainerNode represents a Docker container. -swagger:model AddNodeOKBodyContainer -*/ -type AddNodeOKBodyContainer struct { - // Unique randomly generated instance identifier. - NodeID string `json:"node_id,omitempty"` - - // Unique across all Nodes user-defined name. - NodeName string `json:"node_name,omitempty"` - - // Node address (DNS name or IP). - Address string `json:"address,omitempty"` - - // Linux machine-id of the Generic Node where this Container Node runs. - MachineID string `json:"machine_id,omitempty"` - - // Container identifier. If specified, must be a unique Docker container identifier. - ContainerID string `json:"container_id,omitempty"` - - // Container name. - ContainerName string `json:"container_name,omitempty"` - - // Node model. - NodeModel string `json:"node_model,omitempty"` - - // Node region. - Region string `json:"region,omitempty"` - - // Node availability zone. - Az string `json:"az,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` -} - -// Validate validates this add node OK body container -func (o *AddNodeOKBodyContainer) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this add node OK body container based on context it is used -func (o *AddNodeOKBodyContainer) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddNodeOKBodyContainer) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddNodeOKBodyContainer) UnmarshalBinary(b []byte) error { - var res AddNodeOKBodyContainer - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddNodeOKBodyGeneric GenericNode represents a bare metal server or virtual machine. -swagger:model AddNodeOKBodyGeneric -*/ -type AddNodeOKBodyGeneric struct { - // Unique randomly generated instance identifier. - NodeID string `json:"node_id,omitempty"` - - // Unique across all Nodes user-defined name. - NodeName string `json:"node_name,omitempty"` - - // Node address (DNS name or IP). - Address string `json:"address,omitempty"` - - // Linux machine-id. - MachineID string `json:"machine_id,omitempty"` - - // Linux distribution name and version. - Distro string `json:"distro,omitempty"` - - // Node model. - NodeModel string `json:"node_model,omitempty"` - - // Node region. - Region string `json:"region,omitempty"` - - // Node availability zone. - Az string `json:"az,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` -} - -// Validate validates this add node OK body generic -func (o *AddNodeOKBodyGeneric) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this add node OK body generic based on context it is used -func (o *AddNodeOKBodyGeneric) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddNodeOKBodyGeneric) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddNodeOKBodyGeneric) UnmarshalBinary(b []byte) error { - var res AddNodeOKBodyGeneric - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddNodeOKBodyRemote RemoteNode represents generic remote Node. It's a node where we don't run pmm-agents. Only external exporters can run on Remote Nodes. -swagger:model AddNodeOKBodyRemote -*/ -type AddNodeOKBodyRemote struct { - // Unique randomly generated instance identifier. - NodeID string `json:"node_id,omitempty"` - - // Unique across all Nodes user-defined name. - NodeName string `json:"node_name,omitempty"` - - // Node address (DNS name or IP). - Address string `json:"address,omitempty"` - - // Node model. - NodeModel string `json:"node_model,omitempty"` - - // Node region. - Region string `json:"region,omitempty"` - - // Node availability zone. - Az string `json:"az,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` -} - -// Validate validates this add node OK body remote -func (o *AddNodeOKBodyRemote) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this add node OK body remote based on context it is used -func (o *AddNodeOKBodyRemote) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddNodeOKBodyRemote) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddNodeOKBodyRemote) UnmarshalBinary(b []byte) error { - var res AddNodeOKBodyRemote - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddNodeOKBodyRemoteAzureDatabase RemoteAzureDatabaseNode represents remote AzureDatabase Node. Agents can't run on Remote AzureDatabase Nodes. -swagger:model AddNodeOKBodyRemoteAzureDatabase -*/ -type AddNodeOKBodyRemoteAzureDatabase struct { - // Unique randomly generated instance identifier. - NodeID string `json:"node_id,omitempty"` - - // Unique across all Nodes user-defined name. - NodeName string `json:"node_name,omitempty"` - - // DB instance identifier. - Address string `json:"address,omitempty"` - - // Node model. - NodeModel string `json:"node_model,omitempty"` - - // Node region. - Region string `json:"region,omitempty"` - - // Node availability zone. - Az string `json:"az,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` -} - -// Validate validates this add node OK body remote azure database -func (o *AddNodeOKBodyRemoteAzureDatabase) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this add node OK body remote azure database based on context it is used -func (o *AddNodeOKBodyRemoteAzureDatabase) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddNodeOKBodyRemoteAzureDatabase) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddNodeOKBodyRemoteAzureDatabase) UnmarshalBinary(b []byte) error { - var res AddNodeOKBodyRemoteAzureDatabase - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddNodeOKBodyRemoteRDS RemoteRDSNode represents remote RDS Node. Agents can't run on Remote RDS Nodes. -swagger:model AddNodeOKBodyRemoteRDS -*/ -type AddNodeOKBodyRemoteRDS struct { - // Unique randomly generated instance identifier. - NodeID string `json:"node_id,omitempty"` - - // Unique across all Nodes user-defined name. - NodeName string `json:"node_name,omitempty"` - - // DB instance identifier. - Address string `json:"address,omitempty"` - - // Node model. - NodeModel string `json:"node_model,omitempty"` - - // Node region. - Region string `json:"region,omitempty"` - - // Node availability zone. - Az string `json:"az,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // AWS instance ID. - InstanceID string `json:"instance_id,omitempty"` -} - -// Validate validates this add node OK body remote RDS -func (o *AddNodeOKBodyRemoteRDS) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this add node OK body remote RDS based on context it is used -func (o *AddNodeOKBodyRemoteRDS) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddNodeOKBodyRemoteRDS) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddNodeOKBodyRemoteRDS) UnmarshalBinary(b []byte) error { - var res AddNodeOKBodyRemoteRDS - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddNodeParamsBodyContainer add node params body container -swagger:model AddNodeParamsBodyContainer -*/ -type AddNodeParamsBodyContainer struct { - // Unique across all Nodes user-defined name. - NodeName string `json:"node_name,omitempty"` - - // Node address (DNS name or IP). - Address string `json:"address,omitempty"` - - // Linux machine-id of the Generic Node where this Container Node runs. - MachineID string `json:"machine_id,omitempty"` - - // Container identifier. If specified, must be a unique Docker container identifier. - ContainerID string `json:"container_id,omitempty"` - - // Container name. - ContainerName string `json:"container_name,omitempty"` - - // Node model. - NodeModel string `json:"node_model,omitempty"` - - // Node region. - Region string `json:"region,omitempty"` - - // Node availability zone. - Az string `json:"az,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` -} - -// Validate validates this add node params body container -func (o *AddNodeParamsBodyContainer) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this add node params body container based on context it is used -func (o *AddNodeParamsBodyContainer) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddNodeParamsBodyContainer) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddNodeParamsBodyContainer) UnmarshalBinary(b []byte) error { - var res AddNodeParamsBodyContainer - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddNodeParamsBodyGeneric add node params body generic -swagger:model AddNodeParamsBodyGeneric -*/ -type AddNodeParamsBodyGeneric struct { - // Unique across all Nodes user-defined name. - NodeName string `json:"node_name,omitempty"` - - // Node address (DNS name or IP). - Address string `json:"address,omitempty"` - - // Linux machine-id. - MachineID string `json:"machine_id,omitempty"` - - // Linux distribution name and version. - Distro string `json:"distro,omitempty"` - - // Node model. - NodeModel string `json:"node_model,omitempty"` - - // Node region. - Region string `json:"region,omitempty"` - - // Node availability zone. - Az string `json:"az,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` -} - -// Validate validates this add node params body generic -func (o *AddNodeParamsBodyGeneric) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this add node params body generic based on context it is used -func (o *AddNodeParamsBodyGeneric) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddNodeParamsBodyGeneric) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddNodeParamsBodyGeneric) UnmarshalBinary(b []byte) error { - var res AddNodeParamsBodyGeneric - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddNodeParamsBodyRemote add node params body remote -swagger:model AddNodeParamsBodyRemote -*/ -type AddNodeParamsBodyRemote struct { - // Unique across all Nodes user-defined name. - NodeName string `json:"node_name,omitempty"` - - // Node address (DNS name or IP). - Address string `json:"address,omitempty"` - - // Node model. - NodeModel string `json:"node_model,omitempty"` - - // Node region. - Region string `json:"region,omitempty"` - - // Node availability zone. - Az string `json:"az,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` -} - -// Validate validates this add node params body remote -func (o *AddNodeParamsBodyRemote) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this add node params body remote based on context it is used -func (o *AddNodeParamsBodyRemote) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddNodeParamsBodyRemote) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddNodeParamsBodyRemote) UnmarshalBinary(b []byte) error { - var res AddNodeParamsBodyRemote - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddNodeParamsBodyRemoteAzure add node params body remote azure -swagger:model AddNodeParamsBodyRemoteAzure -*/ -type AddNodeParamsBodyRemoteAzure struct { - // Unique across all Nodes user-defined name. - NodeName string `json:"node_name,omitempty"` - - // DB instance identifier. - Address string `json:"address,omitempty"` - - // Node model. - NodeModel string `json:"node_model,omitempty"` - - // Node region. - Region string `json:"region,omitempty"` - - // Node availability zone. - Az string `json:"az,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` -} - -// Validate validates this add node params body remote azure -func (o *AddNodeParamsBodyRemoteAzure) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this add node params body remote azure based on context it is used -func (o *AddNodeParamsBodyRemoteAzure) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddNodeParamsBodyRemoteAzure) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddNodeParamsBodyRemoteAzure) UnmarshalBinary(b []byte) error { - var res AddNodeParamsBodyRemoteAzure - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddNodeParamsBodyRemoteRDS add node params body remote RDS -swagger:model AddNodeParamsBodyRemoteRDS -*/ -type AddNodeParamsBodyRemoteRDS struct { - // Unique across all Nodes user-defined name. - NodeName string `json:"node_name,omitempty"` - - // DB instance identifier. - Address string `json:"address,omitempty"` - - // Node model. - NodeModel string `json:"node_model,omitempty"` - - // Node region. - Region string `json:"region,omitempty"` - - // Node availability zone. - Az string `json:"az,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` -} - -// Validate validates this add node params body remote RDS -func (o *AddNodeParamsBodyRemoteRDS) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this add node params body remote RDS based on context it is used -func (o *AddNodeParamsBodyRemoteRDS) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddNodeParamsBodyRemoteRDS) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddNodeParamsBodyRemoteRDS) UnmarshalBinary(b []byte) error { - var res AddNodeParamsBodyRemoteRDS - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/inventory/v1/json/client/nodes_service/get_node_parameters.go b/api/inventory/v1/json/client/nodes_service/get_node_parameters.go deleted file mode 100644 index 3498346e1f1..00000000000 --- a/api/inventory/v1/json/client/nodes_service/get_node_parameters.go +++ /dev/null @@ -1,149 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package nodes_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" -) - -// NewGetNodeParams creates a new GetNodeParams 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 NewGetNodeParams() *GetNodeParams { - return &GetNodeParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetNodeParamsWithTimeout creates a new GetNodeParams object -// with the ability to set a timeout on a request. -func NewGetNodeParamsWithTimeout(timeout time.Duration) *GetNodeParams { - return &GetNodeParams{ - timeout: timeout, - } -} - -// NewGetNodeParamsWithContext creates a new GetNodeParams object -// with the ability to set a context for a request. -func NewGetNodeParamsWithContext(ctx context.Context) *GetNodeParams { - return &GetNodeParams{ - Context: ctx, - } -} - -// NewGetNodeParamsWithHTTPClient creates a new GetNodeParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetNodeParamsWithHTTPClient(client *http.Client) *GetNodeParams { - return &GetNodeParams{ - HTTPClient: client, - } -} - -/* -GetNodeParams contains all the parameters to send to the API endpoint - - for the get node operation. - - Typically these are written to a http.Request. -*/ -type GetNodeParams struct { - /* NodeID. - - Unique randomly generated instance identifier. - */ - NodeID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get node params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetNodeParams) WithDefaults() *GetNodeParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get node params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetNodeParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the get node params -func (o *GetNodeParams) WithTimeout(timeout time.Duration) *GetNodeParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get node params -func (o *GetNodeParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get node params -func (o *GetNodeParams) WithContext(ctx context.Context) *GetNodeParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get node params -func (o *GetNodeParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get node params -func (o *GetNodeParams) WithHTTPClient(client *http.Client) *GetNodeParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get node params -func (o *GetNodeParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithNodeID adds the nodeID to the get node params -func (o *GetNodeParams) WithNodeID(nodeID string) *GetNodeParams { - o.SetNodeID(nodeID) - return o -} - -// SetNodeID adds the nodeId to the get node params -func (o *GetNodeParams) SetNodeID(nodeID string) { - o.NodeID = nodeID -} - -// 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 - } - var res []error - - // path param node_id - if err := r.SetPathParam("node_id", o.NodeID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/api/inventory/v1/json/client/nodes_service/get_node_responses.go b/api/inventory/v1/json/client/nodes_service/get_node_responses.go deleted file mode 100644 index 4970213d76f..00000000000 --- a/api/inventory/v1/json/client/nodes_service/get_node_responses.go +++ /dev/null @@ -1,1043 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package nodes_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" -) - -// GetNodeReader is a Reader for the GetNode structure. -type GetNodeReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetNodeReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewGetNodeOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewGetNodeDefault(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 - } -} - -// NewGetNodeOK creates a GetNodeOK with default headers values -func NewGetNodeOK() *GetNodeOK { - return &GetNodeOK{} -} - -/* -GetNodeOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type GetNodeOK struct { - Payload *GetNodeOKBody -} - -// IsSuccess returns true when this get node Ok response has a 2xx status code -func (o *GetNodeOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this get node Ok response has a 3xx status code -func (o *GetNodeOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this get node Ok response has a 4xx status code -func (o *GetNodeOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this get node Ok response has a 5xx status code -func (o *GetNodeOK) IsServerError() bool { - return false -} - -// IsCode returns true when this get node Ok response a status code equal to that given -func (o *GetNodeOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the get node Ok response -func (o *GetNodeOK) Code() int { - return 200 -} - -func (o *GetNodeOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/inventory/nodes/{node_id}][%d] getNodeOk %s", 200, payload) -} - -func (o *GetNodeOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/inventory/nodes/{node_id}][%d] getNodeOk %s", 200, payload) -} - -func (o *GetNodeOK) GetPayload() *GetNodeOKBody { - return o.Payload -} - -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) { - return err - } - - return nil -} - -// NewGetNodeDefault creates a GetNodeDefault with default headers values -func NewGetNodeDefault(code int) *GetNodeDefault { - return &GetNodeDefault{ - _statusCode: code, - } -} - -/* -GetNodeDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type GetNodeDefault struct { - _statusCode int - - Payload *GetNodeDefaultBody -} - -// IsSuccess returns true when this get node default response has a 2xx status code -func (o *GetNodeDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this get node default response has a 3xx status code -func (o *GetNodeDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this get node default response has a 4xx status code -func (o *GetNodeDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this get node default response has a 5xx status code -func (o *GetNodeDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this get node default response a status code equal to that given -func (o *GetNodeDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the get node default response -func (o *GetNodeDefault) Code() int { - return o._statusCode -} - -func (o *GetNodeDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/inventory/nodes/{node_id}][%d] GetNode default %s", o._statusCode, payload) -} - -func (o *GetNodeDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/inventory/nodes/{node_id}][%d] GetNode default %s", o._statusCode, payload) -} - -func (o *GetNodeDefault) GetPayload() *GetNodeDefaultBody { - return o.Payload -} - -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) { - return err - } - - return nil -} - -/* -GetNodeDefaultBody get node default body -swagger:model GetNodeDefaultBody -*/ -type GetNodeDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*GetNodeDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this get node default body -func (o *GetNodeDefaultBody) 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 *GetNodeDefaultBody) 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("GetNode default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("GetNode default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this get node default body based on the context it is used -func (o *GetNodeDefaultBody) 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 *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 - return nil - } - - if err := o.Details[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("GetNode default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("GetNode default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetNodeDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetNodeDefaultBody) UnmarshalBinary(b []byte) error { - var res GetNodeDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -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:"-"` -} - -// 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"` - } - if err := json.Unmarshal(data, &stage1); err != nil { - return err - } - var rcv GetNodeDefaultBodyDetailsItems0 - - 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.GetNodeDefaultBodyDetailsItems0 = result - } - - return nil -} - -// 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"` - } - - stage1.AtType = o.AtType - - // make JSON object for known properties - props, err := json.Marshal(stage1) - if err != nil { - return nil, err - } - - if len(o.GetNodeDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.GetNodeDefaultBodyDetailsItems0) - 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 get node default body details items0 -func (o *GetNodeDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get node default body details items0 based on context it is used -func (o *GetNodeDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetNodeDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetNodeDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res GetNodeDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetNodeOKBody get node OK body -swagger:model GetNodeOKBody -*/ -type GetNodeOKBody struct { - // container - Container *GetNodeOKBodyContainer `json:"container,omitempty"` - - // generic - Generic *GetNodeOKBodyGeneric `json:"generic,omitempty"` - - // remote - Remote *GetNodeOKBodyRemote `json:"remote,omitempty"` - - // remote azure database - RemoteAzureDatabase *GetNodeOKBodyRemoteAzureDatabase `json:"remote_azure_database,omitempty"` - - // remote rds - RemoteRDS *GetNodeOKBodyRemoteRDS `json:"remote_rds,omitempty"` -} - -// Validate validates this get node OK body -func (o *GetNodeOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateContainer(formats); err != nil { - res = append(res, err) - } - - if err := o.validateGeneric(formats); err != nil { - res = append(res, err) - } - - if err := o.validateRemote(formats); err != nil { - res = append(res, err) - } - - if err := o.validateRemoteAzureDatabase(formats); err != nil { - res = append(res, err) - } - - if err := o.validateRemoteRDS(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetNodeOKBody) validateContainer(formats strfmt.Registry) error { - if swag.IsZero(o.Container) { // not required - return nil - } - - if o.Container != nil { - if err := o.Container.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getNodeOk" + "." + "container") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getNodeOk" + "." + "container") - } - - return err - } - } - - return nil -} - -func (o *GetNodeOKBody) validateGeneric(formats strfmt.Registry) error { - if swag.IsZero(o.Generic) { // not required - return nil - } - - if o.Generic != nil { - if err := o.Generic.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getNodeOk" + "." + "generic") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getNodeOk" + "." + "generic") - } - - return err - } - } - - return nil -} - -func (o *GetNodeOKBody) validateRemote(formats strfmt.Registry) error { - if swag.IsZero(o.Remote) { // not required - return nil - } - - if o.Remote != nil { - if err := o.Remote.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getNodeOk" + "." + "remote") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getNodeOk" + "." + "remote") - } - - return err - } - } - - return nil -} - -func (o *GetNodeOKBody) validateRemoteAzureDatabase(formats strfmt.Registry) error { - if swag.IsZero(o.RemoteAzureDatabase) { // not required - return nil - } - - if o.RemoteAzureDatabase != nil { - if err := o.RemoteAzureDatabase.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getNodeOk" + "." + "remote_azure_database") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getNodeOk" + "." + "remote_azure_database") - } - - return err - } - } - - return nil -} - -func (o *GetNodeOKBody) validateRemoteRDS(formats strfmt.Registry) error { - if swag.IsZero(o.RemoteRDS) { // not required - return nil - } - - if o.RemoteRDS != nil { - if err := o.RemoteRDS.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getNodeOk" + "." + "remote_rds") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getNodeOk" + "." + "remote_rds") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this get node OK body based on the context it is used -func (o *GetNodeOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateContainer(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateGeneric(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateRemote(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateRemoteAzureDatabase(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateRemoteRDS(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetNodeOKBody) contextValidateContainer(ctx context.Context, formats strfmt.Registry) error { - if o.Container != nil { - - if swag.IsZero(o.Container) { // not required - return nil - } - - if err := o.Container.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getNodeOk" + "." + "container") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getNodeOk" + "." + "container") - } - - return err - } - } - - return nil -} - -func (o *GetNodeOKBody) contextValidateGeneric(ctx context.Context, formats strfmt.Registry) error { - if o.Generic != nil { - - if swag.IsZero(o.Generic) { // not required - return nil - } - - if err := o.Generic.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getNodeOk" + "." + "generic") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getNodeOk" + "." + "generic") - } - - return err - } - } - - return nil -} - -func (o *GetNodeOKBody) contextValidateRemote(ctx context.Context, formats strfmt.Registry) error { - if o.Remote != nil { - - if swag.IsZero(o.Remote) { // not required - return nil - } - - if err := o.Remote.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getNodeOk" + "." + "remote") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getNodeOk" + "." + "remote") - } - - return err - } - } - - return nil -} - -func (o *GetNodeOKBody) contextValidateRemoteAzureDatabase(ctx context.Context, formats strfmt.Registry) error { - if o.RemoteAzureDatabase != nil { - - if swag.IsZero(o.RemoteAzureDatabase) { // not required - return nil - } - - if err := o.RemoteAzureDatabase.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getNodeOk" + "." + "remote_azure_database") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getNodeOk" + "." + "remote_azure_database") - } - - return err - } - } - - return nil -} - -func (o *GetNodeOKBody) contextValidateRemoteRDS(ctx context.Context, formats strfmt.Registry) error { - if o.RemoteRDS != nil { - - if swag.IsZero(o.RemoteRDS) { // not required - return nil - } - - if err := o.RemoteRDS.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getNodeOk" + "." + "remote_rds") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getNodeOk" + "." + "remote_rds") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetNodeOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetNodeOKBody) UnmarshalBinary(b []byte) error { - var res GetNodeOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetNodeOKBodyContainer ContainerNode represents a Docker container. -swagger:model GetNodeOKBodyContainer -*/ -type GetNodeOKBodyContainer struct { - // Unique randomly generated instance identifier. - NodeID string `json:"node_id,omitempty"` - - // Unique across all Nodes user-defined name. - NodeName string `json:"node_name,omitempty"` - - // Node address (DNS name or IP). - Address string `json:"address,omitempty"` - - // Linux machine-id of the Generic Node where this Container Node runs. - MachineID string `json:"machine_id,omitempty"` - - // Container identifier. If specified, must be a unique Docker container identifier. - ContainerID string `json:"container_id,omitempty"` - - // Container name. - ContainerName string `json:"container_name,omitempty"` - - // Node model. - NodeModel string `json:"node_model,omitempty"` - - // Node region. - Region string `json:"region,omitempty"` - - // Node availability zone. - Az string `json:"az,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` -} - -// Validate validates this get node OK body container -func (o *GetNodeOKBodyContainer) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get node OK body container based on context it is used -func (o *GetNodeOKBodyContainer) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetNodeOKBodyContainer) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetNodeOKBodyContainer) UnmarshalBinary(b []byte) error { - var res GetNodeOKBodyContainer - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetNodeOKBodyGeneric GenericNode represents a bare metal server or virtual machine. -swagger:model GetNodeOKBodyGeneric -*/ -type GetNodeOKBodyGeneric struct { - // Unique randomly generated instance identifier. - NodeID string `json:"node_id,omitempty"` - - // Unique across all Nodes user-defined name. - NodeName string `json:"node_name,omitempty"` - - // Node address (DNS name or IP). - Address string `json:"address,omitempty"` - - // Linux machine-id. - MachineID string `json:"machine_id,omitempty"` - - // Linux distribution name and version. - Distro string `json:"distro,omitempty"` - - // Node model. - NodeModel string `json:"node_model,omitempty"` - - // Node region. - Region string `json:"region,omitempty"` - - // Node availability zone. - Az string `json:"az,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` -} - -// Validate validates this get node OK body generic -func (o *GetNodeOKBodyGeneric) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get node OK body generic based on context it is used -func (o *GetNodeOKBodyGeneric) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetNodeOKBodyGeneric) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetNodeOKBodyGeneric) UnmarshalBinary(b []byte) error { - var res GetNodeOKBodyGeneric - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetNodeOKBodyRemote RemoteNode represents generic remote Node. It's a node where we don't run pmm-agents. Only external exporters can run on Remote Nodes. -swagger:model GetNodeOKBodyRemote -*/ -type GetNodeOKBodyRemote struct { - // Unique randomly generated instance identifier. - NodeID string `json:"node_id,omitempty"` - - // Unique across all Nodes user-defined name. - NodeName string `json:"node_name,omitempty"` - - // Node address (DNS name or IP). - Address string `json:"address,omitempty"` - - // Node model. - NodeModel string `json:"node_model,omitempty"` - - // Node region. - Region string `json:"region,omitempty"` - - // Node availability zone. - Az string `json:"az,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` -} - -// Validate validates this get node OK body remote -func (o *GetNodeOKBodyRemote) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get node OK body remote based on context it is used -func (o *GetNodeOKBodyRemote) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetNodeOKBodyRemote) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetNodeOKBodyRemote) UnmarshalBinary(b []byte) error { - var res GetNodeOKBodyRemote - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetNodeOKBodyRemoteAzureDatabase RemoteAzureDatabaseNode represents remote AzureDatabase Node. Agents can't run on Remote AzureDatabase Nodes. -swagger:model GetNodeOKBodyRemoteAzureDatabase -*/ -type GetNodeOKBodyRemoteAzureDatabase struct { - // Unique randomly generated instance identifier. - NodeID string `json:"node_id,omitempty"` - - // Unique across all Nodes user-defined name. - NodeName string `json:"node_name,omitempty"` - - // DB instance identifier. - Address string `json:"address,omitempty"` - - // Node model. - NodeModel string `json:"node_model,omitempty"` - - // Node region. - Region string `json:"region,omitempty"` - - // Node availability zone. - Az string `json:"az,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` -} - -// Validate validates this get node OK body remote azure database -func (o *GetNodeOKBodyRemoteAzureDatabase) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get node OK body remote azure database based on context it is used -func (o *GetNodeOKBodyRemoteAzureDatabase) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetNodeOKBodyRemoteAzureDatabase) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetNodeOKBodyRemoteAzureDatabase) UnmarshalBinary(b []byte) error { - var res GetNodeOKBodyRemoteAzureDatabase - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetNodeOKBodyRemoteRDS RemoteRDSNode represents remote RDS Node. Agents can't run on Remote RDS Nodes. -swagger:model GetNodeOKBodyRemoteRDS -*/ -type GetNodeOKBodyRemoteRDS struct { - // Unique randomly generated instance identifier. - NodeID string `json:"node_id,omitempty"` - - // Unique across all Nodes user-defined name. - NodeName string `json:"node_name,omitempty"` - - // DB instance identifier. - Address string `json:"address,omitempty"` - - // Node model. - NodeModel string `json:"node_model,omitempty"` - - // Node region. - Region string `json:"region,omitempty"` - - // Node availability zone. - Az string `json:"az,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // AWS instance ID. - InstanceID string `json:"instance_id,omitempty"` -} - -// Validate validates this get node OK body remote RDS -func (o *GetNodeOKBodyRemoteRDS) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get node OK body remote RDS based on context it is used -func (o *GetNodeOKBodyRemoteRDS) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetNodeOKBodyRemoteRDS) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetNodeOKBodyRemoteRDS) UnmarshalBinary(b []byte) error { - var res GetNodeOKBodyRemoteRDS - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/inventory/v1/json/client/nodes_service/list_nodes_parameters.go b/api/inventory/v1/json/client/nodes_service/list_nodes_parameters.go deleted file mode 100644 index 63128821ce8..00000000000 --- a/api/inventory/v1/json/client/nodes_service/list_nodes_parameters.go +++ /dev/null @@ -1,171 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package nodes_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" -) - -// NewListNodesParams creates a new ListNodesParams 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 NewListNodesParams() *ListNodesParams { - return &ListNodesParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListNodesParamsWithTimeout creates a new ListNodesParams object -// with the ability to set a timeout on a request. -func NewListNodesParamsWithTimeout(timeout time.Duration) *ListNodesParams { - return &ListNodesParams{ - timeout: timeout, - } -} - -// NewListNodesParamsWithContext creates a new ListNodesParams object -// with the ability to set a context for a request. -func NewListNodesParamsWithContext(ctx context.Context) *ListNodesParams { - return &ListNodesParams{ - Context: ctx, - } -} - -// NewListNodesParamsWithHTTPClient creates a new ListNodesParams object -// with the ability to set a custom HTTPClient for a request. -func NewListNodesParamsWithHTTPClient(client *http.Client) *ListNodesParams { - return &ListNodesParams{ - HTTPClient: client, - } -} - -/* -ListNodesParams contains all the parameters to send to the API endpoint - - for the list nodes operation. - - Typically these are written to a http.Request. -*/ -type ListNodesParams struct { - /* NodeType. - - Return only Nodes with matching Node type. - - Default: "NODE_TYPE_UNSPECIFIED" - */ - NodeType *string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list nodes params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListNodesParams) WithDefaults() *ListNodesParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list nodes params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListNodesParams) SetDefaults() { - nodeTypeDefault := string("NODE_TYPE_UNSPECIFIED") - - val := ListNodesParams{ - NodeType: &nodeTypeDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the list nodes params -func (o *ListNodesParams) WithTimeout(timeout time.Duration) *ListNodesParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list nodes params -func (o *ListNodesParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list nodes params -func (o *ListNodesParams) WithContext(ctx context.Context) *ListNodesParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list nodes params -func (o *ListNodesParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list nodes params -func (o *ListNodesParams) WithHTTPClient(client *http.Client) *ListNodesParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list nodes params -func (o *ListNodesParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithNodeType adds the nodeType to the list nodes params -func (o *ListNodesParams) WithNodeType(nodeType *string) *ListNodesParams { - o.SetNodeType(nodeType) - return o -} - -// SetNodeType adds the nodeType to the list nodes params -func (o *ListNodesParams) SetNodeType(nodeType *string) { - o.NodeType = nodeType -} - -// 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 - } - var res []error - - if o.NodeType != nil { - - // query param node_type - var qrNodeType string - - if o.NodeType != nil { - qrNodeType = *o.NodeType - } - qNodeType := qrNodeType - if qNodeType != "" { - if err := r.SetQueryParam("node_type", qNodeType); err != nil { - return err - } - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/api/inventory/v1/json/client/nodes_service/list_nodes_responses.go b/api/inventory/v1/json/client/nodes_service/list_nodes_responses.go deleted file mode 100644 index 2af35dd6bc9..00000000000 --- a/api/inventory/v1/json/client/nodes_service/list_nodes_responses.go +++ /dev/null @@ -1,1088 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package nodes_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" -) - -// ListNodesReader is a Reader for the ListNodes structure. -type ListNodesReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListNodesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewListNodesOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewListNodesDefault(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 - } -} - -// NewListNodesOK creates a ListNodesOK with default headers values -func NewListNodesOK() *ListNodesOK { - return &ListNodesOK{} -} - -/* -ListNodesOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type ListNodesOK struct { - Payload *ListNodesOKBody -} - -// IsSuccess returns true when this list nodes Ok response has a 2xx status code -func (o *ListNodesOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this list nodes Ok response has a 3xx status code -func (o *ListNodesOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this list nodes Ok response has a 4xx status code -func (o *ListNodesOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this list nodes Ok response has a 5xx status code -func (o *ListNodesOK) IsServerError() bool { - return false -} - -// IsCode returns true when this list nodes Ok response a status code equal to that given -func (o *ListNodesOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the list nodes Ok response -func (o *ListNodesOK) Code() int { - return 200 -} - -func (o *ListNodesOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/inventory/nodes][%d] listNodesOk %s", 200, payload) -} - -func (o *ListNodesOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/inventory/nodes][%d] listNodesOk %s", 200, payload) -} - -func (o *ListNodesOK) GetPayload() *ListNodesOKBody { - return o.Payload -} - -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) { - return err - } - - return nil -} - -// NewListNodesDefault creates a ListNodesDefault with default headers values -func NewListNodesDefault(code int) *ListNodesDefault { - return &ListNodesDefault{ - _statusCode: code, - } -} - -/* -ListNodesDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type ListNodesDefault struct { - _statusCode int - - Payload *ListNodesDefaultBody -} - -// IsSuccess returns true when this list nodes default response has a 2xx status code -func (o *ListNodesDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this list nodes default response has a 3xx status code -func (o *ListNodesDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this list nodes default response has a 4xx status code -func (o *ListNodesDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this list nodes default response has a 5xx status code -func (o *ListNodesDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this list nodes default response a status code equal to that given -func (o *ListNodesDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the list nodes default response -func (o *ListNodesDefault) Code() int { - return o._statusCode -} - -func (o *ListNodesDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/inventory/nodes][%d] ListNodes default %s", o._statusCode, payload) -} - -func (o *ListNodesDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/inventory/nodes][%d] ListNodes default %s", o._statusCode, payload) -} - -func (o *ListNodesDefault) GetPayload() *ListNodesDefaultBody { - return o.Payload -} - -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) { - return err - } - - return nil -} - -/* -ListNodesDefaultBody list nodes default body -swagger:model ListNodesDefaultBody -*/ -type ListNodesDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*ListNodesDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this list nodes default body -func (o *ListNodesDefaultBody) 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 *ListNodesDefaultBody) 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("ListNodes default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("ListNodes default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this list nodes default body based on the context it is used -func (o *ListNodesDefaultBody) 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 *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 - return nil - } - - if err := o.Details[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("ListNodes default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("ListNodes default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListNodesDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListNodesDefaultBody) UnmarshalBinary(b []byte) error { - var res ListNodesDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -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:"-"` -} - -// 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"` - } - if err := json.Unmarshal(data, &stage1); err != nil { - return err - } - var rcv ListNodesDefaultBodyDetailsItems0 - - 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.ListNodesDefaultBodyDetailsItems0 = result - } - - return nil -} - -// 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"` - } - - stage1.AtType = o.AtType - - // make JSON object for known properties - props, err := json.Marshal(stage1) - if err != nil { - return nil, err - } - - if len(o.ListNodesDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.ListNodesDefaultBodyDetailsItems0) - 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 list nodes default body details items0 -func (o *ListNodesDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list nodes default body details items0 based on context it is used -func (o *ListNodesDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListNodesDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListNodesDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res ListNodesDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListNodesOKBody list nodes OK body -swagger:model ListNodesOKBody -*/ -type ListNodesOKBody struct { - // generic - Generic []*ListNodesOKBodyGenericItems0 `json:"generic"` - - // container - Container []*ListNodesOKBodyContainerItems0 `json:"container"` - - // remote - Remote []*ListNodesOKBodyRemoteItems0 `json:"remote"` - - // remote rds - RemoteRDS []*ListNodesOKBodyRemoteRDSItems0 `json:"remote_rds"` - - // remote azure database - RemoteAzureDatabase []*ListNodesOKBodyRemoteAzureDatabaseItems0 `json:"remote_azure_database"` -} - -// Validate validates this list nodes OK body -func (o *ListNodesOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateGeneric(formats); err != nil { - res = append(res, err) - } - - if err := o.validateContainer(formats); err != nil { - res = append(res, err) - } - - if err := o.validateRemote(formats); err != nil { - res = append(res, err) - } - - if err := o.validateRemoteRDS(formats); err != nil { - res = append(res, err) - } - - if err := o.validateRemoteAzureDatabase(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListNodesOKBody) validateGeneric(formats strfmt.Registry) error { - if swag.IsZero(o.Generic) { // not required - return nil - } - - for i := 0; i < len(o.Generic); i++ { - if swag.IsZero(o.Generic[i]) { // not required - continue - } - - if o.Generic[i] != nil { - if err := o.Generic[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listNodesOk" + "." + "generic" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listNodesOk" + "." + "generic" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -func (o *ListNodesOKBody) validateContainer(formats strfmt.Registry) error { - if swag.IsZero(o.Container) { // not required - return nil - } - - for i := 0; i < len(o.Container); i++ { - if swag.IsZero(o.Container[i]) { // not required - continue - } - - if o.Container[i] != nil { - if err := o.Container[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listNodesOk" + "." + "container" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listNodesOk" + "." + "container" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -func (o *ListNodesOKBody) validateRemote(formats strfmt.Registry) error { - if swag.IsZero(o.Remote) { // not required - return nil - } - - for i := 0; i < len(o.Remote); i++ { - if swag.IsZero(o.Remote[i]) { // not required - continue - } - - if o.Remote[i] != nil { - if err := o.Remote[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listNodesOk" + "." + "remote" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listNodesOk" + "." + "remote" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -func (o *ListNodesOKBody) validateRemoteRDS(formats strfmt.Registry) error { - if swag.IsZero(o.RemoteRDS) { // not required - return nil - } - - for i := 0; i < len(o.RemoteRDS); i++ { - if swag.IsZero(o.RemoteRDS[i]) { // not required - continue - } - - if o.RemoteRDS[i] != nil { - if err := o.RemoteRDS[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listNodesOk" + "." + "remote_rds" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listNodesOk" + "." + "remote_rds" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -func (o *ListNodesOKBody) validateRemoteAzureDatabase(formats strfmt.Registry) error { - if swag.IsZero(o.RemoteAzureDatabase) { // not required - return nil - } - - for i := 0; i < len(o.RemoteAzureDatabase); i++ { - if swag.IsZero(o.RemoteAzureDatabase[i]) { // not required - continue - } - - if o.RemoteAzureDatabase[i] != nil { - if err := o.RemoteAzureDatabase[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listNodesOk" + "." + "remote_azure_database" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listNodesOk" + "." + "remote_azure_database" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this list nodes OK body based on the context it is used -func (o *ListNodesOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateGeneric(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateContainer(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateRemote(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateRemoteRDS(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateRemoteAzureDatabase(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListNodesOKBody) contextValidateGeneric(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Generic); i++ { - if o.Generic[i] != nil { - - if swag.IsZero(o.Generic[i]) { // not required - return nil - } - - if err := o.Generic[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listNodesOk" + "." + "generic" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listNodesOk" + "." + "generic" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -func (o *ListNodesOKBody) contextValidateContainer(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Container); i++ { - if o.Container[i] != nil { - - if swag.IsZero(o.Container[i]) { // not required - return nil - } - - if err := o.Container[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listNodesOk" + "." + "container" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listNodesOk" + "." + "container" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -func (o *ListNodesOKBody) contextValidateRemote(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Remote); i++ { - if o.Remote[i] != nil { - - if swag.IsZero(o.Remote[i]) { // not required - return nil - } - - if err := o.Remote[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listNodesOk" + "." + "remote" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listNodesOk" + "." + "remote" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -func (o *ListNodesOKBody) contextValidateRemoteRDS(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.RemoteRDS); i++ { - if o.RemoteRDS[i] != nil { - - if swag.IsZero(o.RemoteRDS[i]) { // not required - return nil - } - - if err := o.RemoteRDS[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listNodesOk" + "." + "remote_rds" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listNodesOk" + "." + "remote_rds" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -func (o *ListNodesOKBody) contextValidateRemoteAzureDatabase(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.RemoteAzureDatabase); i++ { - if o.RemoteAzureDatabase[i] != nil { - - if swag.IsZero(o.RemoteAzureDatabase[i]) { // not required - return nil - } - - if err := o.RemoteAzureDatabase[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listNodesOk" + "." + "remote_azure_database" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listNodesOk" + "." + "remote_azure_database" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListNodesOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListNodesOKBody) UnmarshalBinary(b []byte) error { - var res ListNodesOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListNodesOKBodyContainerItems0 ContainerNode represents a Docker container. -swagger:model ListNodesOKBodyContainerItems0 -*/ -type ListNodesOKBodyContainerItems0 struct { - // Unique randomly generated instance identifier. - NodeID string `json:"node_id,omitempty"` - - // Unique across all Nodes user-defined name. - NodeName string `json:"node_name,omitempty"` - - // Node address (DNS name or IP). - Address string `json:"address,omitempty"` - - // Linux machine-id of the Generic Node where this Container Node runs. - MachineID string `json:"machine_id,omitempty"` - - // Container identifier. If specified, must be a unique Docker container identifier. - ContainerID string `json:"container_id,omitempty"` - - // Container name. - ContainerName string `json:"container_name,omitempty"` - - // Node model. - NodeModel string `json:"node_model,omitempty"` - - // Node region. - Region string `json:"region,omitempty"` - - // Node availability zone. - Az string `json:"az,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` -} - -// Validate validates this list nodes OK body container items0 -func (o *ListNodesOKBodyContainerItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list nodes OK body container items0 based on context it is used -func (o *ListNodesOKBodyContainerItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListNodesOKBodyContainerItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListNodesOKBodyContainerItems0) UnmarshalBinary(b []byte) error { - var res ListNodesOKBodyContainerItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListNodesOKBodyGenericItems0 GenericNode represents a bare metal server or virtual machine. -swagger:model ListNodesOKBodyGenericItems0 -*/ -type ListNodesOKBodyGenericItems0 struct { - // Unique randomly generated instance identifier. - NodeID string `json:"node_id,omitempty"` - - // Unique across all Nodes user-defined name. - NodeName string `json:"node_name,omitempty"` - - // Node address (DNS name or IP). - Address string `json:"address,omitempty"` - - // Linux machine-id. - MachineID string `json:"machine_id,omitempty"` - - // Linux distribution name and version. - Distro string `json:"distro,omitempty"` - - // Node model. - NodeModel string `json:"node_model,omitempty"` - - // Node region. - Region string `json:"region,omitempty"` - - // Node availability zone. - Az string `json:"az,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` -} - -// Validate validates this list nodes OK body generic items0 -func (o *ListNodesOKBodyGenericItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list nodes OK body generic items0 based on context it is used -func (o *ListNodesOKBodyGenericItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListNodesOKBodyGenericItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListNodesOKBodyGenericItems0) UnmarshalBinary(b []byte) error { - var res ListNodesOKBodyGenericItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListNodesOKBodyRemoteAzureDatabaseItems0 RemoteAzureDatabaseNode represents remote AzureDatabase Node. Agents can't run on Remote AzureDatabase Nodes. -swagger:model ListNodesOKBodyRemoteAzureDatabaseItems0 -*/ -type ListNodesOKBodyRemoteAzureDatabaseItems0 struct { - // Unique randomly generated instance identifier. - NodeID string `json:"node_id,omitempty"` - - // Unique across all Nodes user-defined name. - NodeName string `json:"node_name,omitempty"` - - // DB instance identifier. - Address string `json:"address,omitempty"` - - // Node model. - NodeModel string `json:"node_model,omitempty"` - - // Node region. - Region string `json:"region,omitempty"` - - // Node availability zone. - Az string `json:"az,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` -} - -// Validate validates this list nodes OK body remote azure database items0 -func (o *ListNodesOKBodyRemoteAzureDatabaseItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list nodes OK body remote azure database items0 based on context it is used -func (o *ListNodesOKBodyRemoteAzureDatabaseItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListNodesOKBodyRemoteAzureDatabaseItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListNodesOKBodyRemoteAzureDatabaseItems0) UnmarshalBinary(b []byte) error { - var res ListNodesOKBodyRemoteAzureDatabaseItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListNodesOKBodyRemoteItems0 RemoteNode represents generic remote Node. It's a node where we don't run pmm-agents. Only external exporters can run on Remote Nodes. -swagger:model ListNodesOKBodyRemoteItems0 -*/ -type ListNodesOKBodyRemoteItems0 struct { - // Unique randomly generated instance identifier. - NodeID string `json:"node_id,omitempty"` - - // Unique across all Nodes user-defined name. - NodeName string `json:"node_name,omitempty"` - - // Node address (DNS name or IP). - Address string `json:"address,omitempty"` - - // Node model. - NodeModel string `json:"node_model,omitempty"` - - // Node region. - Region string `json:"region,omitempty"` - - // Node availability zone. - Az string `json:"az,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` -} - -// Validate validates this list nodes OK body remote items0 -func (o *ListNodesOKBodyRemoteItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list nodes OK body remote items0 based on context it is used -func (o *ListNodesOKBodyRemoteItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListNodesOKBodyRemoteItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListNodesOKBodyRemoteItems0) UnmarshalBinary(b []byte) error { - var res ListNodesOKBodyRemoteItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListNodesOKBodyRemoteRDSItems0 RemoteRDSNode represents remote RDS Node. Agents can't run on Remote RDS Nodes. -swagger:model ListNodesOKBodyRemoteRDSItems0 -*/ -type ListNodesOKBodyRemoteRDSItems0 struct { - // Unique randomly generated instance identifier. - NodeID string `json:"node_id,omitempty"` - - // Unique across all Nodes user-defined name. - NodeName string `json:"node_name,omitempty"` - - // DB instance identifier. - Address string `json:"address,omitempty"` - - // Node model. - NodeModel string `json:"node_model,omitempty"` - - // Node region. - Region string `json:"region,omitempty"` - - // Node availability zone. - Az string `json:"az,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // AWS instance ID. - InstanceID string `json:"instance_id,omitempty"` -} - -// Validate validates this list nodes OK body remote RDS items0 -func (o *ListNodesOKBodyRemoteRDSItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list nodes OK body remote RDS items0 based on context it is used -func (o *ListNodesOKBodyRemoteRDSItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListNodesOKBodyRemoteRDSItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListNodesOKBodyRemoteRDSItems0) UnmarshalBinary(b []byte) error { - var res ListNodesOKBodyRemoteRDSItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/inventory/v1/json/client/nodes_service/nodes_service_client.go b/api/inventory/v1/json/client/nodes_service/nodes_service_client.go deleted file mode 100644 index 5ffebdeb27f..00000000000 --- a/api/inventory/v1/json/client/nodes_service/nodes_service_client.go +++ /dev/null @@ -1,247 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package nodes_service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// New creates a new nodes service API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -// New creates a new nodes service API client with basic auth credentials. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - user: user for basic authentication header. -// - password: password for basic authentication header. -func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BasicAuth(user, password) - return &Client{transport: transport, formats: strfmt.Default} -} - -// New creates a new nodes service API client with a bearer token for authentication. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - bearerToken: bearer token for Bearer authentication header. -func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BearerToken(bearerToken) - return &Client{transport: transport, formats: strfmt.Default} -} - -/* -Client for nodes service API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption may be used to customize the behavior of Client methods. -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - AddNode(params *AddNodeParams, opts ...ClientOption) (*AddNodeOK, error) - - GetNode(params *GetNodeParams, opts ...ClientOption) (*GetNodeOK, error) - - ListNodes(params *ListNodesParams, opts ...ClientOption) (*ListNodesOK, error) - - RemoveNode(params *RemoveNodeParams, opts ...ClientOption) (*RemoveNodeOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -AddNode adds a node - -Adds a Node. -*/ -func (a *Client) AddNode(params *AddNodeParams, opts ...ClientOption) (*AddNodeOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewAddNodeParams() - } - op := &runtime.ClientOperation{ - ID: "AddNode", - Method: "POST", - PathPattern: "/v1/inventory/nodes", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &AddNodeReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - - // only one success response has to be checked - success, ok := result.(*AddNodeOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*AddNodeDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -GetNode gets a node - -Returns a single Node by ID. -*/ -func (a *Client) GetNode(params *GetNodeParams, opts ...ClientOption) (*GetNodeOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewGetNodeParams() - } - op := &runtime.ClientOperation{ - ID: "GetNode", - Method: "GET", - PathPattern: "/v1/inventory/nodes/{node_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &GetNodeReader{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.(*GetNodeOK) - if ok { - return success, nil - } - - // 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()) -} - -/* -ListNodes lists nodes - -Returns a list of all Nodes. -*/ -func (a *Client) ListNodes(params *ListNodesParams, opts ...ClientOption) (*ListNodesOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewListNodesParams() - } - op := &runtime.ClientOperation{ - ID: "ListNodes", - Method: "GET", - PathPattern: "/v1/inventory/nodes", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &ListNodesReader{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.(*ListNodesOK) - if ok { - return success, nil - } - - // 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()) -} - -/* -RemoveNode removes a node - -Removes a Node. -*/ -func (a *Client) RemoveNode(params *RemoveNodeParams, opts ...ClientOption) (*RemoveNodeOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewRemoveNodeParams() - } - op := &runtime.ClientOperation{ - ID: "RemoveNode", - Method: "DELETE", - PathPattern: "/v1/inventory/nodes/{node_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &RemoveNodeReader{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.(*RemoveNodeOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*RemoveNodeDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/api/inventory/v1/json/client/nodes_service/remove_node_parameters.go b/api/inventory/v1/json/client/nodes_service/remove_node_parameters.go deleted file mode 100644 index 62194bd1a8e..00000000000 --- a/api/inventory/v1/json/client/nodes_service/remove_node_parameters.go +++ /dev/null @@ -1,183 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package nodes_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" - "github.com/go-openapi/swag" -) - -// NewRemoveNodeParams creates a new RemoveNodeParams 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 NewRemoveNodeParams() *RemoveNodeParams { - return &RemoveNodeParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewRemoveNodeParamsWithTimeout creates a new RemoveNodeParams object -// with the ability to set a timeout on a request. -func NewRemoveNodeParamsWithTimeout(timeout time.Duration) *RemoveNodeParams { - return &RemoveNodeParams{ - timeout: timeout, - } -} - -// NewRemoveNodeParamsWithContext creates a new RemoveNodeParams object -// with the ability to set a context for a request. -func NewRemoveNodeParamsWithContext(ctx context.Context) *RemoveNodeParams { - return &RemoveNodeParams{ - Context: ctx, - } -} - -// NewRemoveNodeParamsWithHTTPClient creates a new RemoveNodeParams object -// with the ability to set a custom HTTPClient for a request. -func NewRemoveNodeParamsWithHTTPClient(client *http.Client) *RemoveNodeParams { - return &RemoveNodeParams{ - HTTPClient: client, - } -} - -/* -RemoveNodeParams contains all the parameters to send to the API endpoint - - for the remove node operation. - - Typically these are written to a http.Request. -*/ -type RemoveNodeParams struct { - /* Force. - - Remove node with all dependencies. - */ - Force *bool - - /* NodeID. - - Unique randomly generated instance identifier. - */ - NodeID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the remove node params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *RemoveNodeParams) WithDefaults() *RemoveNodeParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the remove node params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *RemoveNodeParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the remove node params -func (o *RemoveNodeParams) WithTimeout(timeout time.Duration) *RemoveNodeParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the remove node params -func (o *RemoveNodeParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the remove node params -func (o *RemoveNodeParams) WithContext(ctx context.Context) *RemoveNodeParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the remove node params -func (o *RemoveNodeParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the remove node params -func (o *RemoveNodeParams) WithHTTPClient(client *http.Client) *RemoveNodeParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the remove node params -func (o *RemoveNodeParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithForce adds the force to the remove node params -func (o *RemoveNodeParams) WithForce(force *bool) *RemoveNodeParams { - o.SetForce(force) - return o -} - -// SetForce adds the force to the remove node params -func (o *RemoveNodeParams) SetForce(force *bool) { - o.Force = force -} - -// WithNodeID adds the nodeID to the remove node params -func (o *RemoveNodeParams) WithNodeID(nodeID string) *RemoveNodeParams { - o.SetNodeID(nodeID) - return o -} - -// SetNodeID adds the nodeId to the remove node params -func (o *RemoveNodeParams) SetNodeID(nodeID string) { - o.NodeID = nodeID -} - -// WriteToRequest writes these params to a swagger request -func (o *RemoveNodeParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.Force != nil { - - // query param force - var qrForce bool - - if o.Force != nil { - qrForce = *o.Force - } - qForce := swag.FormatBool(qrForce) - if qForce != "" { - if err := r.SetQueryParam("force", qForce); err != nil { - return err - } - } - } - - // path param node_id - if err := r.SetPathParam("node_id", o.NodeID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/api/inventory/v1/json/client/nodes_service/remove_node_responses.go b/api/inventory/v1/json/client/nodes_service/remove_node_responses.go deleted file mode 100644 index 4fc5f3a61c4..00000000000 --- a/api/inventory/v1/json/client/nodes_service/remove_node_responses.go +++ /dev/null @@ -1,414 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package nodes_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" -) - -// RemoveNodeReader is a Reader for the RemoveNode structure. -type RemoveNodeReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *RemoveNodeReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewRemoveNodeOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewRemoveNodeDefault(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 - } -} - -// NewRemoveNodeOK creates a RemoveNodeOK with default headers values -func NewRemoveNodeOK() *RemoveNodeOK { - return &RemoveNodeOK{} -} - -/* -RemoveNodeOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type RemoveNodeOK struct { - Payload any -} - -// IsSuccess returns true when this remove node Ok response has a 2xx status code -func (o *RemoveNodeOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this remove node Ok response has a 3xx status code -func (o *RemoveNodeOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this remove node Ok response has a 4xx status code -func (o *RemoveNodeOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this remove node Ok response has a 5xx status code -func (o *RemoveNodeOK) IsServerError() bool { - return false -} - -// IsCode returns true when this remove node Ok response a status code equal to that given -func (o *RemoveNodeOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the remove node Ok response -func (o *RemoveNodeOK) Code() int { - return 200 -} - -func (o *RemoveNodeOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/inventory/nodes/{node_id}][%d] removeNodeOk %s", 200, payload) -} - -func (o *RemoveNodeOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/inventory/nodes/{node_id}][%d] removeNodeOk %s", 200, payload) -} - -func (o *RemoveNodeOK) GetPayload() any { - return o.Payload -} - -func (o *RemoveNodeOK) 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) { - return err - } - - return nil -} - -// NewRemoveNodeDefault creates a RemoveNodeDefault with default headers values -func NewRemoveNodeDefault(code int) *RemoveNodeDefault { - return &RemoveNodeDefault{ - _statusCode: code, - } -} - -/* -RemoveNodeDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type RemoveNodeDefault struct { - _statusCode int - - Payload *RemoveNodeDefaultBody -} - -// IsSuccess returns true when this remove node default response has a 2xx status code -func (o *RemoveNodeDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this remove node default response has a 3xx status code -func (o *RemoveNodeDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this remove node default response has a 4xx status code -func (o *RemoveNodeDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this remove node default response has a 5xx status code -func (o *RemoveNodeDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this remove node default response a status code equal to that given -func (o *RemoveNodeDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the remove node default response -func (o *RemoveNodeDefault) Code() int { - return o._statusCode -} - -func (o *RemoveNodeDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/inventory/nodes/{node_id}][%d] RemoveNode default %s", o._statusCode, payload) -} - -func (o *RemoveNodeDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/inventory/nodes/{node_id}][%d] RemoveNode default %s", o._statusCode, payload) -} - -func (o *RemoveNodeDefault) GetPayload() *RemoveNodeDefaultBody { - return o.Payload -} - -func (o *RemoveNodeDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(RemoveNodeDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -RemoveNodeDefaultBody remove node default body -swagger:model RemoveNodeDefaultBody -*/ -type RemoveNodeDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*RemoveNodeDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this remove node default body -func (o *RemoveNodeDefaultBody) 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 *RemoveNodeDefaultBody) 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("RemoveNode default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("RemoveNode default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this remove node default body based on the context it is used -func (o *RemoveNodeDefaultBody) 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 *RemoveNodeDefaultBody) 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("RemoveNode default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("RemoveNode default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *RemoveNodeDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *RemoveNodeDefaultBody) UnmarshalBinary(b []byte) error { - var res RemoveNodeDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -RemoveNodeDefaultBodyDetailsItems0 remove node default body details items0 -swagger:model RemoveNodeDefaultBodyDetailsItems0 -*/ -type RemoveNodeDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` - - // remove node default body details items0 - RemoveNodeDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *RemoveNodeDefaultBodyDetailsItems0) 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 RemoveNodeDefaultBodyDetailsItems0 - - 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.RemoveNodeDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o RemoveNodeDefaultBodyDetailsItems0) 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.RemoveNodeDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.RemoveNodeDefaultBodyDetailsItems0) - 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 remove node default body details items0 -func (o *RemoveNodeDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this remove node default body details items0 based on context it is used -func (o *RemoveNodeDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *RemoveNodeDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *RemoveNodeDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res RemoveNodeDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/inventory/v1/json/client/pmm_inventory_api_client.go b/api/inventory/v1/json/client/pmm_inventory_api_client.go deleted file mode 100644 index f6a427d38e6..00000000000 --- a/api/inventory/v1/json/client/pmm_inventory_api_client.go +++ /dev/null @@ -1,122 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package client - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/percona/pmm/api/inventory/v1/json/client/agents_service" - "github.com/percona/pmm/api/inventory/v1/json/client/nodes_service" - "github.com/percona/pmm/api/inventory/v1/json/client/services_service" -) - -// Default PMM inventory API HTTP client. -var Default = NewHTTPClient(nil) - -const ( - // DefaultHost is the default Host - // found in Meta (info) section of spec file - DefaultHost string = "localhost" - // DefaultBasePath is the default BasePath - // found in Meta (info) section of spec file - DefaultBasePath string = "/" -) - -// DefaultSchemes are the default schemes found in Meta (info) section of spec file -var DefaultSchemes = []string{"http", "https"} - -// NewHTTPClient creates a new PMM inventory API HTTP client. -func NewHTTPClient(formats strfmt.Registry) *PMMInventoryAPI { - return NewHTTPClientWithConfig(formats, nil) -} - -// NewHTTPClientWithConfig creates a new PMM inventory API HTTP client, -// using a customizable transport config. -func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *PMMInventoryAPI { - // ensure nullable parameters have default - if cfg == nil { - cfg = DefaultTransportConfig() - } - - // create transport and client - transport := httptransport.New(cfg.Host, cfg.BasePath, cfg.Schemes) - return New(transport, formats) -} - -// New creates a new PMM inventory API client -func New(transport runtime.ClientTransport, formats strfmt.Registry) *PMMInventoryAPI { - // ensure nullable parameters have default - if formats == nil { - formats = strfmt.Default - } - - cli := new(PMMInventoryAPI) - cli.Transport = transport - cli.AgentsService = agents_service.New(transport, formats) - cli.NodesService = nodes_service.New(transport, formats) - cli.ServicesService = services_service.New(transport, formats) - return cli -} - -// DefaultTransportConfig creates a TransportConfig with the -// default settings taken from the meta section of the spec file. -func DefaultTransportConfig() *TransportConfig { - return &TransportConfig{ - Host: DefaultHost, - BasePath: DefaultBasePath, - Schemes: DefaultSchemes, - } -} - -// TransportConfig contains the transport related info, -// found in the meta section of the spec file. -type TransportConfig struct { - Host string - BasePath string - Schemes []string -} - -// WithHost overrides the default host, -// provided by the meta section of the spec file. -func (cfg *TransportConfig) WithHost(host string) *TransportConfig { - cfg.Host = host - return cfg -} - -// WithBasePath overrides the default basePath, -// provided by the meta section of the spec file. -func (cfg *TransportConfig) WithBasePath(basePath string) *TransportConfig { - cfg.BasePath = basePath - return cfg -} - -// WithSchemes overrides the default schemes, -// provided by the meta section of the spec file. -func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig { - cfg.Schemes = schemes - return cfg -} - -// PMMInventoryAPI is a client for PMM inventory API -type PMMInventoryAPI struct { - AgentsService agents_service.ClientService - - NodesService nodes_service.ClientService - - ServicesService services_service.ClientService - - Transport runtime.ClientTransport -} - -// SetTransport changes the transport on the client and all its subresources -func (c *PMMInventoryAPI) SetTransport(transport runtime.ClientTransport) { - c.Transport = transport - c.AgentsService.SetTransport(transport) - c.NodesService.SetTransport(transport) - c.ServicesService.SetTransport(transport) -} diff --git a/api/inventory/v1/json/client/services_service/add_service_parameters.go b/api/inventory/v1/json/client/services_service/add_service_parameters.go deleted file mode 100644 index ed2a7830ee1..00000000000 --- a/api/inventory/v1/json/client/services_service/add_service_parameters.go +++ /dev/null @@ -1,144 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package services_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" -) - -// NewAddServiceParams creates a new AddServiceParams 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 NewAddServiceParams() *AddServiceParams { - return &AddServiceParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewAddServiceParamsWithTimeout creates a new AddServiceParams object -// with the ability to set a timeout on a request. -func NewAddServiceParamsWithTimeout(timeout time.Duration) *AddServiceParams { - return &AddServiceParams{ - timeout: timeout, - } -} - -// NewAddServiceParamsWithContext creates a new AddServiceParams object -// with the ability to set a context for a request. -func NewAddServiceParamsWithContext(ctx context.Context) *AddServiceParams { - return &AddServiceParams{ - Context: ctx, - } -} - -// NewAddServiceParamsWithHTTPClient creates a new AddServiceParams object -// with the ability to set a custom HTTPClient for a request. -func NewAddServiceParamsWithHTTPClient(client *http.Client) *AddServiceParams { - return &AddServiceParams{ - HTTPClient: client, - } -} - -/* -AddServiceParams contains all the parameters to send to the API endpoint - - for the add service operation. - - Typically these are written to a http.Request. -*/ -type AddServiceParams struct { - // Body. - Body AddServiceBody - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the add service params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *AddServiceParams) WithDefaults() *AddServiceParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the add service params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *AddServiceParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the add service params -func (o *AddServiceParams) WithTimeout(timeout time.Duration) *AddServiceParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the add service params -func (o *AddServiceParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the add service params -func (o *AddServiceParams) WithContext(ctx context.Context) *AddServiceParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the add service params -func (o *AddServiceParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the add service params -func (o *AddServiceParams) WithHTTPClient(client *http.Client) *AddServiceParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the add service params -func (o *AddServiceParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the add service params -func (o *AddServiceParams) WithBody(body AddServiceBody) *AddServiceParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the add service params -func (o *AddServiceParams) SetBody(body AddServiceBody) { - o.Body = body -} - -// 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 - } - 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/inventory/v1/json/client/services_service/add_service_responses.go b/api/inventory/v1/json/client/services_service/add_service_responses.go deleted file mode 100644 index d996fe20064..00000000000 --- a/api/inventory/v1/json/client/services_service/add_service_responses.go +++ /dev/null @@ -1,2221 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package services_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" -) - -// AddServiceReader is a Reader for the AddService structure. -type AddServiceReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *AddServiceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewAddServiceOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewAddServiceDefault(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 - } -} - -// NewAddServiceOK creates a AddServiceOK with default headers values -func NewAddServiceOK() *AddServiceOK { - return &AddServiceOK{} -} - -/* -AddServiceOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type AddServiceOK struct { - Payload *AddServiceOKBody -} - -// IsSuccess returns true when this add service Ok response has a 2xx status code -func (o *AddServiceOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this add service Ok response has a 3xx status code -func (o *AddServiceOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this add service Ok response has a 4xx status code -func (o *AddServiceOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this add service Ok response has a 5xx status code -func (o *AddServiceOK) IsServerError() bool { - return false -} - -// IsCode returns true when this add service Ok response a status code equal to that given -func (o *AddServiceOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the add service Ok response -func (o *AddServiceOK) Code() int { - return 200 -} - -func (o *AddServiceOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/inventory/services][%d] addServiceOk %s", 200, payload) -} - -func (o *AddServiceOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/inventory/services][%d] addServiceOk %s", 200, payload) -} - -func (o *AddServiceOK) GetPayload() *AddServiceOKBody { - return o.Payload -} - -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) { - return err - } - - return nil -} - -// NewAddServiceDefault creates a AddServiceDefault with default headers values -func NewAddServiceDefault(code int) *AddServiceDefault { - return &AddServiceDefault{ - _statusCode: code, - } -} - -/* -AddServiceDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type AddServiceDefault struct { - _statusCode int - - Payload *AddServiceDefaultBody -} - -// IsSuccess returns true when this add service default response has a 2xx status code -func (o *AddServiceDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this add service default response has a 3xx status code -func (o *AddServiceDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this add service default response has a 4xx status code -func (o *AddServiceDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this add service default response has a 5xx status code -func (o *AddServiceDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this add service default response a status code equal to that given -func (o *AddServiceDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the add service default response -func (o *AddServiceDefault) Code() int { - return o._statusCode -} - -func (o *AddServiceDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/inventory/services][%d] AddService default %s", o._statusCode, payload) -} - -func (o *AddServiceDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/inventory/services][%d] AddService default %s", o._statusCode, payload) -} - -func (o *AddServiceDefault) GetPayload() *AddServiceDefaultBody { - return o.Payload -} - -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) { - return err - } - - return nil -} - -/* -AddServiceBody add service body -swagger:model AddServiceBody -*/ -type AddServiceBody struct { - // external - External *AddServiceParamsBodyExternal `json:"external,omitempty"` - - // haproxy - Haproxy *AddServiceParamsBodyHaproxy `json:"haproxy,omitempty"` - - // mongodb - Mongodb *AddServiceParamsBodyMongodb `json:"mongodb,omitempty"` - - // mysql - Mysql *AddServiceParamsBodyMysql `json:"mysql,omitempty"` - - // postgresql - Postgresql *AddServiceParamsBodyPostgresql `json:"postgresql,omitempty"` - - // proxysql - Proxysql *AddServiceParamsBodyProxysql `json:"proxysql,omitempty"` - - // valkey - Valkey *AddServiceParamsBodyValkey `json:"valkey,omitempty"` -} - -// Validate validates this add service body -func (o *AddServiceBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateExternal(formats); err != nil { - res = append(res, err) - } - - if err := o.validateHaproxy(formats); err != nil { - res = append(res, err) - } - - if err := o.validateMongodb(formats); err != nil { - res = append(res, err) - } - - if err := o.validateMysql(formats); err != nil { - res = append(res, err) - } - - if err := o.validatePostgresql(formats); err != nil { - res = append(res, err) - } - - if err := o.validateProxysql(formats); err != nil { - res = append(res, err) - } - - if err := o.validateValkey(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *AddServiceBody) validateExternal(formats strfmt.Registry) error { - if swag.IsZero(o.External) { // not required - return nil - } - - if o.External != nil { - if err := o.External.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "external") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "external") - } - - return err - } - } - - return nil -} - -func (o *AddServiceBody) validateHaproxy(formats strfmt.Registry) error { - if swag.IsZero(o.Haproxy) { // not required - return nil - } - - if o.Haproxy != nil { - if err := o.Haproxy.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "haproxy") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "haproxy") - } - - return err - } - } - - return nil -} - -func (o *AddServiceBody) validateMongodb(formats strfmt.Registry) error { - if swag.IsZero(o.Mongodb) { // not required - return nil - } - - if o.Mongodb != nil { - if err := o.Mongodb.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "mongodb") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "mongodb") - } - - return err - } - } - - return nil -} - -func (o *AddServiceBody) validateMysql(formats strfmt.Registry) error { - if swag.IsZero(o.Mysql) { // not required - return nil - } - - if o.Mysql != nil { - if err := o.Mysql.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "mysql") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "mysql") - } - - return err - } - } - - return nil -} - -func (o *AddServiceBody) validatePostgresql(formats strfmt.Registry) error { - if swag.IsZero(o.Postgresql) { // not required - return nil - } - - if o.Postgresql != nil { - if err := o.Postgresql.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "postgresql") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "postgresql") - } - - return err - } - } - - return nil -} - -func (o *AddServiceBody) validateProxysql(formats strfmt.Registry) error { - if swag.IsZero(o.Proxysql) { // not required - return nil - } - - if o.Proxysql != nil { - if err := o.Proxysql.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "proxysql") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "proxysql") - } - - return err - } - } - - return nil -} - -func (o *AddServiceBody) validateValkey(formats strfmt.Registry) error { - if swag.IsZero(o.Valkey) { // not required - return nil - } - - if o.Valkey != nil { - if err := o.Valkey.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "valkey") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "valkey") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this add service body based on the context it is used -func (o *AddServiceBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateExternal(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateHaproxy(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateMongodb(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateMysql(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidatePostgresql(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateProxysql(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateValkey(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *AddServiceBody) contextValidateExternal(ctx context.Context, formats strfmt.Registry) error { - if o.External != nil { - - if swag.IsZero(o.External) { // not required - return nil - } - - if err := o.External.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "external") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "external") - } - - return err - } - } - - return nil -} - -func (o *AddServiceBody) contextValidateHaproxy(ctx context.Context, formats strfmt.Registry) error { - if o.Haproxy != nil { - - if swag.IsZero(o.Haproxy) { // not required - return nil - } - - if err := o.Haproxy.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "haproxy") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "haproxy") - } - - return err - } - } - - return nil -} - -func (o *AddServiceBody) contextValidateMongodb(ctx context.Context, formats strfmt.Registry) error { - if o.Mongodb != nil { - - if swag.IsZero(o.Mongodb) { // not required - return nil - } - - if err := o.Mongodb.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "mongodb") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "mongodb") - } - - return err - } - } - - return nil -} - -func (o *AddServiceBody) contextValidateMysql(ctx context.Context, formats strfmt.Registry) error { - if o.Mysql != nil { - - if swag.IsZero(o.Mysql) { // not required - return nil - } - - if err := o.Mysql.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "mysql") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "mysql") - } - - return err - } - } - - return nil -} - -func (o *AddServiceBody) contextValidatePostgresql(ctx context.Context, formats strfmt.Registry) error { - if o.Postgresql != nil { - - if swag.IsZero(o.Postgresql) { // not required - return nil - } - - if err := o.Postgresql.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "postgresql") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "postgresql") - } - - return err - } - } - - return nil -} - -func (o *AddServiceBody) contextValidateProxysql(ctx context.Context, formats strfmt.Registry) error { - if o.Proxysql != nil { - - if swag.IsZero(o.Proxysql) { // not required - return nil - } - - if err := o.Proxysql.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "proxysql") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "proxysql") - } - - return err - } - } - - return nil -} - -func (o *AddServiceBody) contextValidateValkey(ctx context.Context, formats strfmt.Registry) error { - if o.Valkey != nil { - - if swag.IsZero(o.Valkey) { // not required - return nil - } - - if err := o.Valkey.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "valkey") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "valkey") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *AddServiceBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddServiceBody) UnmarshalBinary(b []byte) error { - var res AddServiceBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddServiceDefaultBody add service default body -swagger:model AddServiceDefaultBody -*/ -type AddServiceDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*AddServiceDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this add service default body -func (o *AddServiceDefaultBody) 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 *AddServiceDefaultBody) 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("AddService default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("AddService default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this add service default body based on the context it is used -func (o *AddServiceDefaultBody) 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 *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 - return nil - } - - if err := o.Details[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("AddService default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("AddService default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *AddServiceDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddServiceDefaultBody) UnmarshalBinary(b []byte) error { - var res AddServiceDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -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:"-"` -} - -// 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"` - } - if err := json.Unmarshal(data, &stage1); err != nil { - return err - } - var rcv AddServiceDefaultBodyDetailsItems0 - - 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.AddServiceDefaultBodyDetailsItems0 = result - } - - return nil -} - -// 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"` - } - - stage1.AtType = o.AtType - - // make JSON object for known properties - props, err := json.Marshal(stage1) - if err != nil { - return nil, err - } - - if len(o.AddServiceDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.AddServiceDefaultBodyDetailsItems0) - 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 add service default body details items0 -func (o *AddServiceDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this add service default body details items0 based on context it is used -func (o *AddServiceDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddServiceDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddServiceDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res AddServiceDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddServiceOKBody add service OK body -swagger:model AddServiceOKBody -*/ -type AddServiceOKBody struct { - // external - External *AddServiceOKBodyExternal `json:"external,omitempty"` - - // haproxy - Haproxy *AddServiceOKBodyHaproxy `json:"haproxy,omitempty"` - - // mongodb - Mongodb *AddServiceOKBodyMongodb `json:"mongodb,omitempty"` - - // mysql - Mysql *AddServiceOKBodyMysql `json:"mysql,omitempty"` - - // postgresql - Postgresql *AddServiceOKBodyPostgresql `json:"postgresql,omitempty"` - - // proxysql - Proxysql *AddServiceOKBodyProxysql `json:"proxysql,omitempty"` - - // valkey - Valkey *AddServiceOKBodyValkey `json:"valkey,omitempty"` -} - -// Validate validates this add service OK body -func (o *AddServiceOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateExternal(formats); err != nil { - res = append(res, err) - } - - if err := o.validateHaproxy(formats); err != nil { - res = append(res, err) - } - - if err := o.validateMongodb(formats); err != nil { - res = append(res, err) - } - - if err := o.validateMysql(formats); err != nil { - res = append(res, err) - } - - if err := o.validatePostgresql(formats); err != nil { - res = append(res, err) - } - - if err := o.validateProxysql(formats); err != nil { - res = append(res, err) - } - - if err := o.validateValkey(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *AddServiceOKBody) validateExternal(formats strfmt.Registry) error { - if swag.IsZero(o.External) { // not required - return nil - } - - if o.External != nil { - if err := o.External.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "external") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "external") - } - - return err - } - } - - return nil -} - -func (o *AddServiceOKBody) validateHaproxy(formats strfmt.Registry) error { - if swag.IsZero(o.Haproxy) { // not required - return nil - } - - if o.Haproxy != nil { - if err := o.Haproxy.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "haproxy") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "haproxy") - } - - return err - } - } - - return nil -} - -func (o *AddServiceOKBody) validateMongodb(formats strfmt.Registry) error { - if swag.IsZero(o.Mongodb) { // not required - return nil - } - - if o.Mongodb != nil { - if err := o.Mongodb.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "mongodb") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "mongodb") - } - - return err - } - } - - return nil -} - -func (o *AddServiceOKBody) validateMysql(formats strfmt.Registry) error { - if swag.IsZero(o.Mysql) { // not required - return nil - } - - if o.Mysql != nil { - if err := o.Mysql.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "mysql") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "mysql") - } - - return err - } - } - - return nil -} - -func (o *AddServiceOKBody) validatePostgresql(formats strfmt.Registry) error { - if swag.IsZero(o.Postgresql) { // not required - return nil - } - - if o.Postgresql != nil { - if err := o.Postgresql.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "postgresql") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "postgresql") - } - - return err - } - } - - return nil -} - -func (o *AddServiceOKBody) validateProxysql(formats strfmt.Registry) error { - if swag.IsZero(o.Proxysql) { // not required - return nil - } - - if o.Proxysql != nil { - if err := o.Proxysql.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "proxysql") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "proxysql") - } - - return err - } - } - - return nil -} - -func (o *AddServiceOKBody) validateValkey(formats strfmt.Registry) error { - if swag.IsZero(o.Valkey) { // not required - return nil - } - - if o.Valkey != nil { - if err := o.Valkey.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "valkey") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "valkey") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this add service OK body based on the context it is used -func (o *AddServiceOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateExternal(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateHaproxy(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateMongodb(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateMysql(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidatePostgresql(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateProxysql(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateValkey(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *AddServiceOKBody) contextValidateExternal(ctx context.Context, formats strfmt.Registry) error { - if o.External != nil { - - if swag.IsZero(o.External) { // not required - return nil - } - - if err := o.External.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "external") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "external") - } - - return err - } - } - - return nil -} - -func (o *AddServiceOKBody) contextValidateHaproxy(ctx context.Context, formats strfmt.Registry) error { - if o.Haproxy != nil { - - if swag.IsZero(o.Haproxy) { // not required - return nil - } - - if err := o.Haproxy.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "haproxy") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "haproxy") - } - - return err - } - } - - return nil -} - -func (o *AddServiceOKBody) contextValidateMongodb(ctx context.Context, formats strfmt.Registry) error { - if o.Mongodb != nil { - - if swag.IsZero(o.Mongodb) { // not required - return nil - } - - if err := o.Mongodb.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "mongodb") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "mongodb") - } - - return err - } - } - - return nil -} - -func (o *AddServiceOKBody) contextValidateMysql(ctx context.Context, formats strfmt.Registry) error { - if o.Mysql != nil { - - if swag.IsZero(o.Mysql) { // not required - return nil - } - - if err := o.Mysql.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "mysql") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "mysql") - } - - return err - } - } - - return nil -} - -func (o *AddServiceOKBody) contextValidatePostgresql(ctx context.Context, formats strfmt.Registry) error { - if o.Postgresql != nil { - - if swag.IsZero(o.Postgresql) { // not required - return nil - } - - if err := o.Postgresql.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "postgresql") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "postgresql") - } - - return err - } - } - - return nil -} - -func (o *AddServiceOKBody) contextValidateProxysql(ctx context.Context, formats strfmt.Registry) error { - if o.Proxysql != nil { - - if swag.IsZero(o.Proxysql) { // not required - return nil - } - - if err := o.Proxysql.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "proxysql") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "proxysql") - } - - return err - } - } - - return nil -} - -func (o *AddServiceOKBody) contextValidateValkey(ctx context.Context, formats strfmt.Registry) error { - if o.Valkey != nil { - - if swag.IsZero(o.Valkey) { // not required - return nil - } - - if err := o.Valkey.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "valkey") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "valkey") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *AddServiceOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddServiceOKBody) UnmarshalBinary(b []byte) error { - var res AddServiceOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddServiceOKBodyExternal ExternalService represents a generic External service instance. -swagger:model AddServiceOKBodyExternal -*/ -type AddServiceOKBodyExternal struct { - // Unique randomly generated instance identifier. - ServiceID string `json:"service_id,omitempty"` - - // Unique across all Services user-defined name. - ServiceName string `json:"service_name,omitempty"` - - // Node identifier where this service instance runs. - NodeID string `json:"node_id,omitempty"` - - // Environment name. - Environment string `json:"environment,omitempty"` - - // Cluster name. - Cluster string `json:"cluster,omitempty"` - - // Replication set name. - ReplicationSet string `json:"replication_set,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // Group name of external service. - Group string `json:"group,omitempty"` -} - -// Validate validates this add service OK body external -func (o *AddServiceOKBodyExternal) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this add service OK body external based on context it is used -func (o *AddServiceOKBodyExternal) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddServiceOKBodyExternal) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddServiceOKBodyExternal) UnmarshalBinary(b []byte) error { - var res AddServiceOKBodyExternal - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddServiceOKBodyHaproxy HAProxyService represents a generic HAProxy service instance. -swagger:model AddServiceOKBodyHaproxy -*/ -type AddServiceOKBodyHaproxy struct { - // Unique randomly generated instance identifier. - ServiceID string `json:"service_id,omitempty"` - - // Unique across all Services user-defined name. - ServiceName string `json:"service_name,omitempty"` - - // Node identifier where this service instance runs. - NodeID string `json:"node_id,omitempty"` - - // Environment name. - Environment string `json:"environment,omitempty"` - - // Cluster name. - Cluster string `json:"cluster,omitempty"` - - // Replication set name. - ReplicationSet string `json:"replication_set,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` -} - -// Validate validates this add service OK body haproxy -func (o *AddServiceOKBodyHaproxy) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this add service OK body haproxy based on context it is used -func (o *AddServiceOKBodyHaproxy) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddServiceOKBodyHaproxy) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddServiceOKBodyHaproxy) UnmarshalBinary(b []byte) error { - var res AddServiceOKBodyHaproxy - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddServiceOKBodyMongodb MongoDBService represents a generic MongoDB instance. -swagger:model AddServiceOKBodyMongodb -*/ -type AddServiceOKBodyMongodb struct { - // Unique randomly generated instance identifier. - ServiceID string `json:"service_id,omitempty"` - - // Unique across all Services user-defined name. - ServiceName string `json:"service_name,omitempty"` - - // Node identifier where this instance runs. - NodeID string `json:"node_id,omitempty"` - - // Access address (DNS name or IP). - // Address (and port) or socket is required. - Address string `json:"address,omitempty"` - - // Access port. - // Port is required when the address present. - Port int64 `json:"port,omitempty"` - - // Access unix socket. - // Address (and port) or socket is required. - Socket string `json:"socket,omitempty"` - - // Environment name. - Environment string `json:"environment,omitempty"` - - // Cluster name. - Cluster string `json:"cluster,omitempty"` - - // Replication set name. - ReplicationSet string `json:"replication_set,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // MongoDB version. - Version string `json:"version,omitempty"` -} - -// Validate validates this add service OK body mongodb -func (o *AddServiceOKBodyMongodb) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this add service OK body mongodb based on context it is used -func (o *AddServiceOKBodyMongodb) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddServiceOKBodyMongodb) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddServiceOKBodyMongodb) UnmarshalBinary(b []byte) error { - var res AddServiceOKBodyMongodb - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddServiceOKBodyMysql MySQLService represents a generic MySQL instance. -swagger:model AddServiceOKBodyMysql -*/ -type AddServiceOKBodyMysql struct { - // Unique randomly generated instance identifier. - ServiceID string `json:"service_id,omitempty"` - - // Unique across all Services user-defined name. - ServiceName string `json:"service_name,omitempty"` - - // Node identifier where this instance runs. - NodeID string `json:"node_id,omitempty"` - - // Access address (DNS name or IP). - // Address (and port) or socket is required. - Address string `json:"address,omitempty"` - - // Access port. - // Port is required when the address present. - Port int64 `json:"port,omitempty"` - - // Access unix socket. - // Address (and port) or socket is required. - Socket string `json:"socket,omitempty"` - - // Environment name. - Environment string `json:"environment,omitempty"` - - // Cluster name. - Cluster string `json:"cluster,omitempty"` - - // Replication set name. - ReplicationSet string `json:"replication_set,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // MySQL version. - Version string `json:"version,omitempty"` - - // Extra parameters to be added to the DSN. - ExtraDsnParams map[string]string `json:"extra_dsn_params,omitempty"` -} - -// Validate validates this add service OK body mysql -func (o *AddServiceOKBodyMysql) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this add service OK body mysql based on context it is used -func (o *AddServiceOKBodyMysql) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddServiceOKBodyMysql) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddServiceOKBodyMysql) UnmarshalBinary(b []byte) error { - var res AddServiceOKBodyMysql - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddServiceOKBodyPostgresql PostgreSQLService represents a generic PostgreSQL instance. -swagger:model AddServiceOKBodyPostgresql -*/ -type AddServiceOKBodyPostgresql struct { - // Unique randomly generated instance identifier. - ServiceID string `json:"service_id,omitempty"` - - // Unique across all Services user-defined name. - ServiceName string `json:"service_name,omitempty"` - - // Database name. - DatabaseName string `json:"database_name,omitempty"` - - // Node identifier where this instance runs. - NodeID string `json:"node_id,omitempty"` - - // Access address (DNS name or IP). - // Address (and port) or socket is required. - Address string `json:"address,omitempty"` - - // Access port. - // Port is required when the address present. - Port int64 `json:"port,omitempty"` - - // Access unix socket. - // Address (and port) or socket is required. - Socket string `json:"socket,omitempty"` - - // Environment name. - Environment string `json:"environment,omitempty"` - - // Cluster name. - Cluster string `json:"cluster,omitempty"` - - // Replication set name. - ReplicationSet string `json:"replication_set,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // PostgreSQL version. - Version string `json:"version,omitempty"` - - // Limit of databases for auto-discovery. - AutoDiscoveryLimit int32 `json:"auto_discovery_limit,omitempty"` -} - -// Validate validates this add service OK body postgresql -func (o *AddServiceOKBodyPostgresql) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this add service OK body postgresql based on context it is used -func (o *AddServiceOKBodyPostgresql) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddServiceOKBodyPostgresql) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddServiceOKBodyPostgresql) UnmarshalBinary(b []byte) error { - var res AddServiceOKBodyPostgresql - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddServiceOKBodyProxysql ProxySQLService represents a generic ProxySQL instance. -swagger:model AddServiceOKBodyProxysql -*/ -type AddServiceOKBodyProxysql struct { - // Unique randomly generated instance identifier. - ServiceID string `json:"service_id,omitempty"` - - // Unique across all Services user-defined name. - ServiceName string `json:"service_name,omitempty"` - - // Node identifier where this instance runs. - NodeID string `json:"node_id,omitempty"` - - // Access address (DNS name or IP). - // Address (and port) or socket is required. - Address string `json:"address,omitempty"` - - // Access port. - // Port is required when the address present. - Port int64 `json:"port,omitempty"` - - // Access unix socket. - // Address (and port) or socket is required. - Socket string `json:"socket,omitempty"` - - // Environment name. - Environment string `json:"environment,omitempty"` - - // Cluster name. - Cluster string `json:"cluster,omitempty"` - - // Replication set name. - ReplicationSet string `json:"replication_set,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // ProxySQL version. - Version string `json:"version,omitempty"` -} - -// Validate validates this add service OK body proxysql -func (o *AddServiceOKBodyProxysql) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this add service OK body proxysql based on context it is used -func (o *AddServiceOKBodyProxysql) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddServiceOKBodyProxysql) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddServiceOKBodyProxysql) UnmarshalBinary(b []byte) error { - var res AddServiceOKBodyProxysql - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddServiceOKBodyValkey ValkeyService represents a generic Valkey instance. -swagger:model AddServiceOKBodyValkey -*/ -type AddServiceOKBodyValkey struct { - // Unique randomly generated instance identifier. - ServiceID string `json:"service_id,omitempty"` - - // Unique across all Services user-defined name. - ServiceName string `json:"service_name,omitempty"` - - // Node identifier where this instance runs. - NodeID string `json:"node_id,omitempty"` - - // Access address (DNS name or IP). - // Address (and port) or socket is required. - Address string `json:"address,omitempty"` - - // Access port. - // Port is required when the address present. - Port int64 `json:"port,omitempty"` - - // Access unix socket. - // Address (and port) or socket is required. - Socket string `json:"socket,omitempty"` - - // Environment name. - Environment string `json:"environment,omitempty"` - - // Cluster name. - Cluster string `json:"cluster,omitempty"` - - // Replication set name. - ReplicationSet string `json:"replication_set,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // Valkey version. - Version string `json:"version,omitempty"` -} - -// Validate validates this add service OK body valkey -func (o *AddServiceOKBodyValkey) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this add service OK body valkey based on context it is used -func (o *AddServiceOKBodyValkey) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddServiceOKBodyValkey) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddServiceOKBodyValkey) UnmarshalBinary(b []byte) error { - var res AddServiceOKBodyValkey - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddServiceParamsBodyExternal add service params body external -swagger:model AddServiceParamsBodyExternal -*/ -type AddServiceParamsBodyExternal struct { - // Unique across all Services user-defined name. Required. - ServiceName string `json:"service_name,omitempty"` - - // Node identifier where this instance runs. Required. - NodeID string `json:"node_id,omitempty"` - - // Environment name. - Environment string `json:"environment,omitempty"` - - // Cluster name. - Cluster string `json:"cluster,omitempty"` - - // Replication set name. - ReplicationSet string `json:"replication_set,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // Group name of external service. - Group string `json:"group,omitempty"` -} - -// Validate validates this add service params body external -func (o *AddServiceParamsBodyExternal) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this add service params body external based on context it is used -func (o *AddServiceParamsBodyExternal) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddServiceParamsBodyExternal) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddServiceParamsBodyExternal) UnmarshalBinary(b []byte) error { - var res AddServiceParamsBodyExternal - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddServiceParamsBodyHaproxy add service params body haproxy -swagger:model AddServiceParamsBodyHaproxy -*/ -type AddServiceParamsBodyHaproxy struct { - // Unique across all Services user-defined name. Required. - ServiceName string `json:"service_name,omitempty"` - - // Node identifier where this instance runs. Required. - NodeID string `json:"node_id,omitempty"` - - // Environment name. - Environment string `json:"environment,omitempty"` - - // Cluster name. - Cluster string `json:"cluster,omitempty"` - - // Replication set name. - ReplicationSet string `json:"replication_set,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` -} - -// Validate validates this add service params body haproxy -func (o *AddServiceParamsBodyHaproxy) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this add service params body haproxy based on context it is used -func (o *AddServiceParamsBodyHaproxy) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddServiceParamsBodyHaproxy) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddServiceParamsBodyHaproxy) UnmarshalBinary(b []byte) error { - var res AddServiceParamsBodyHaproxy - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddServiceParamsBodyMongodb add service params body mongodb -swagger:model AddServiceParamsBodyMongodb -*/ -type AddServiceParamsBodyMongodb struct { - // Unique across all Services user-defined name. Required. - ServiceName string `json:"service_name,omitempty"` - - // Node identifier where this instance runs. Required. - NodeID string `json:"node_id,omitempty"` - - // Access address (DNS name or IP). - // Address (and port) or socket is required. - Address string `json:"address,omitempty"` - - // Access port. - // Port is required when the address present. - Port int64 `json:"port,omitempty"` - - // Access unix socket. - // Address (and port) or socket is required. - Socket string `json:"socket,omitempty"` - - // Environment name. - Environment string `json:"environment,omitempty"` - - // Cluster name. - Cluster string `json:"cluster,omitempty"` - - // Replication set name. - ReplicationSet string `json:"replication_set,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` -} - -// Validate validates this add service params body mongodb -func (o *AddServiceParamsBodyMongodb) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this add service params body mongodb based on context it is used -func (o *AddServiceParamsBodyMongodb) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddServiceParamsBodyMongodb) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddServiceParamsBodyMongodb) UnmarshalBinary(b []byte) error { - var res AddServiceParamsBodyMongodb - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddServiceParamsBodyMysql add service params body mysql -swagger:model AddServiceParamsBodyMysql -*/ -type AddServiceParamsBodyMysql struct { - // Unique across all Services user-defined name. Required. - ServiceName string `json:"service_name,omitempty"` - - // Node identifier where this instance runs. Required. - NodeID string `json:"node_id,omitempty"` - - // Access address (DNS name or IP). - // Address (and port) or socket is required. - Address string `json:"address,omitempty"` - - // Access port. - // Port is required when the address present. - Port int64 `json:"port,omitempty"` - - // Access unix socket. - // Address (and port) or socket is required. - Socket string `json:"socket,omitempty"` - - // Environment name. - Environment string `json:"environment,omitempty"` - - // Cluster name. - Cluster string `json:"cluster,omitempty"` - - // Replication set name. - ReplicationSet string `json:"replication_set,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // Extra parameters to be added to the DSN. - ExtraDsnParams map[string]string `json:"extra_dsn_params,omitempty"` -} - -// Validate validates this add service params body mysql -func (o *AddServiceParamsBodyMysql) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this add service params body mysql based on context it is used -func (o *AddServiceParamsBodyMysql) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddServiceParamsBodyMysql) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddServiceParamsBodyMysql) UnmarshalBinary(b []byte) error { - var res AddServiceParamsBodyMysql - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddServiceParamsBodyPostgresql add service params body postgresql -swagger:model AddServiceParamsBodyPostgresql -*/ -type AddServiceParamsBodyPostgresql struct { - // Unique across all Services user-defined name. Required. - ServiceName string `json:"service_name,omitempty"` - - // Node identifier where this instance runs. Required. - NodeID string `json:"node_id,omitempty"` - - // Access address (DNS name or IP). - // Address (and port) or socket is required. - Address string `json:"address,omitempty"` - - // Access port. - // Port is required when the address present. - Port int64 `json:"port,omitempty"` - - // Access unix socket. - // Address (and port) or socket is required. - Socket string `json:"socket,omitempty"` - - // Environment name. - Environment string `json:"environment,omitempty"` - - // Cluster name. - Cluster string `json:"cluster,omitempty"` - - // Replication set name. - ReplicationSet string `json:"replication_set,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // Limit of databases for auto-discovery. - AutoDiscoveryLimit int32 `json:"auto_discovery_limit,omitempty"` -} - -// Validate validates this add service params body postgresql -func (o *AddServiceParamsBodyPostgresql) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this add service params body postgresql based on context it is used -func (o *AddServiceParamsBodyPostgresql) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddServiceParamsBodyPostgresql) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddServiceParamsBodyPostgresql) UnmarshalBinary(b []byte) error { - var res AddServiceParamsBodyPostgresql - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddServiceParamsBodyProxysql add service params body proxysql -swagger:model AddServiceParamsBodyProxysql -*/ -type AddServiceParamsBodyProxysql struct { - // Unique across all Services user-defined name. Required. - ServiceName string `json:"service_name,omitempty"` - - // Node identifier where this instance runs. Required. - NodeID string `json:"node_id,omitempty"` - - // Access address (DNS name or IP). - // Address (and port) or socket is required. - Address string `json:"address,omitempty"` - - // Access port. - // Port is required when the address present. - Port int64 `json:"port,omitempty"` - - // Access unix socket. - // Address (and port) or socket is required. - Socket string `json:"socket,omitempty"` - - // Environment name. - Environment string `json:"environment,omitempty"` - - // Cluster name. - Cluster string `json:"cluster,omitempty"` - - // Replication set name. - ReplicationSet string `json:"replication_set,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` -} - -// Validate validates this add service params body proxysql -func (o *AddServiceParamsBodyProxysql) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this add service params body proxysql based on context it is used -func (o *AddServiceParamsBodyProxysql) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddServiceParamsBodyProxysql) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddServiceParamsBodyProxysql) UnmarshalBinary(b []byte) error { - var res AddServiceParamsBodyProxysql - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddServiceParamsBodyValkey add service params body valkey -swagger:model AddServiceParamsBodyValkey -*/ -type AddServiceParamsBodyValkey struct { - // Unique across all Services user-defined name. Required. - ServiceName string `json:"service_name,omitempty"` - - // Node identifier where this instance runs. Required. - NodeID string `json:"node_id,omitempty"` - - // Access address (DNS name or IP). - // Address (and port) or socket is required. - Address string `json:"address,omitempty"` - - // Access port. - // Port is required when the address present. - Port int64 `json:"port,omitempty"` - - // Access unix socket. - // Address (and port) or socket is required. - Socket string `json:"socket,omitempty"` - - // Environment name. - Environment string `json:"environment,omitempty"` - - // Cluster name. - Cluster string `json:"cluster,omitempty"` - - // Replication set name. - ReplicationSet string `json:"replication_set,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` -} - -// Validate validates this add service params body valkey -func (o *AddServiceParamsBodyValkey) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this add service params body valkey based on context it is used -func (o *AddServiceParamsBodyValkey) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddServiceParamsBodyValkey) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddServiceParamsBodyValkey) UnmarshalBinary(b []byte) error { - var res AddServiceParamsBodyValkey - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/inventory/v1/json/client/services_service/change_service_parameters.go b/api/inventory/v1/json/client/services_service/change_service_parameters.go deleted file mode 100644 index d718cb7f5b9..00000000000 --- a/api/inventory/v1/json/client/services_service/change_service_parameters.go +++ /dev/null @@ -1,163 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package services_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" -) - -// NewChangeServiceParams creates a new ChangeServiceParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewChangeServiceParams() *ChangeServiceParams { - return &ChangeServiceParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewChangeServiceParamsWithTimeout creates a new ChangeServiceParams object -// with the ability to set a timeout on a request. -func NewChangeServiceParamsWithTimeout(timeout time.Duration) *ChangeServiceParams { - return &ChangeServiceParams{ - timeout: timeout, - } -} - -// NewChangeServiceParamsWithContext creates a new ChangeServiceParams object -// with the ability to set a context for a request. -func NewChangeServiceParamsWithContext(ctx context.Context) *ChangeServiceParams { - return &ChangeServiceParams{ - Context: ctx, - } -} - -// NewChangeServiceParamsWithHTTPClient creates a new ChangeServiceParams object -// with the ability to set a custom HTTPClient for a request. -func NewChangeServiceParamsWithHTTPClient(client *http.Client) *ChangeServiceParams { - return &ChangeServiceParams{ - HTTPClient: client, - } -} - -/* -ChangeServiceParams contains all the parameters to send to the API endpoint - - for the change service operation. - - Typically these are written to a http.Request. -*/ -type ChangeServiceParams struct { - // Body. - Body ChangeServiceBody - - // ServiceID. - ServiceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the change service params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ChangeServiceParams) WithDefaults() *ChangeServiceParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the change service params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ChangeServiceParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the change service params -func (o *ChangeServiceParams) WithTimeout(timeout time.Duration) *ChangeServiceParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the change service params -func (o *ChangeServiceParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the change service params -func (o *ChangeServiceParams) WithContext(ctx context.Context) *ChangeServiceParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the change service params -func (o *ChangeServiceParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the change service params -func (o *ChangeServiceParams) WithHTTPClient(client *http.Client) *ChangeServiceParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the change service params -func (o *ChangeServiceParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the change service params -func (o *ChangeServiceParams) WithBody(body ChangeServiceBody) *ChangeServiceParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the change service params -func (o *ChangeServiceParams) SetBody(body ChangeServiceBody) { - o.Body = body -} - -// WithServiceID adds the serviceID to the change service params -func (o *ChangeServiceParams) WithServiceID(serviceID string) *ChangeServiceParams { - o.SetServiceID(serviceID) - return o -} - -// SetServiceID adds the serviceId to the change service params -func (o *ChangeServiceParams) SetServiceID(serviceID string) { - o.ServiceID = serviceID -} - -// WriteToRequest writes these params to a swagger request -func (o *ChangeServiceParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - - // path param service_id - if err := r.SetPathParam("service_id", o.ServiceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/api/inventory/v1/json/client/services_service/change_service_responses.go b/api/inventory/v1/json/client/services_service/change_service_responses.go deleted file mode 100644 index 328bed109a1..00000000000 --- a/api/inventory/v1/json/client/services_service/change_service_responses.go +++ /dev/null @@ -1,1489 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package services_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" -) - -// ChangeServiceReader is a Reader for the ChangeService structure. -type ChangeServiceReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ChangeServiceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewChangeServiceOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewChangeServiceDefault(response.Code()) - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - if response.Code()/100 == 2 { - return result, nil - } - return nil, result - } -} - -// NewChangeServiceOK creates a ChangeServiceOK with default headers values -func NewChangeServiceOK() *ChangeServiceOK { - return &ChangeServiceOK{} -} - -/* -ChangeServiceOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type ChangeServiceOK struct { - Payload *ChangeServiceOKBody -} - -// IsSuccess returns true when this change service Ok response has a 2xx status code -func (o *ChangeServiceOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this change service Ok response has a 3xx status code -func (o *ChangeServiceOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this change service Ok response has a 4xx status code -func (o *ChangeServiceOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this change service Ok response has a 5xx status code -func (o *ChangeServiceOK) IsServerError() bool { - return false -} - -// IsCode returns true when this change service Ok response a status code equal to that given -func (o *ChangeServiceOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the change service Ok response -func (o *ChangeServiceOK) Code() int { - return 200 -} - -func (o *ChangeServiceOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/inventory/services/{service_id}][%d] changeServiceOk %s", 200, payload) -} - -func (o *ChangeServiceOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/inventory/services/{service_id}][%d] changeServiceOk %s", 200, payload) -} - -func (o *ChangeServiceOK) GetPayload() *ChangeServiceOKBody { - return o.Payload -} - -func (o *ChangeServiceOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(ChangeServiceOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -// NewChangeServiceDefault creates a ChangeServiceDefault with default headers values -func NewChangeServiceDefault(code int) *ChangeServiceDefault { - return &ChangeServiceDefault{ - _statusCode: code, - } -} - -/* -ChangeServiceDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type ChangeServiceDefault struct { - _statusCode int - - Payload *ChangeServiceDefaultBody -} - -// IsSuccess returns true when this change service default response has a 2xx status code -func (o *ChangeServiceDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this change service default response has a 3xx status code -func (o *ChangeServiceDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this change service default response has a 4xx status code -func (o *ChangeServiceDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this change service default response has a 5xx status code -func (o *ChangeServiceDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this change service default response a status code equal to that given -func (o *ChangeServiceDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the change service default response -func (o *ChangeServiceDefault) Code() int { - return o._statusCode -} - -func (o *ChangeServiceDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/inventory/services/{service_id}][%d] ChangeService default %s", o._statusCode, payload) -} - -func (o *ChangeServiceDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/inventory/services/{service_id}][%d] ChangeService default %s", o._statusCode, payload) -} - -func (o *ChangeServiceDefault) GetPayload() *ChangeServiceDefaultBody { - return o.Payload -} - -func (o *ChangeServiceDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(ChangeServiceDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -ChangeServiceBody change service body -swagger:model ChangeServiceBody -*/ -type ChangeServiceBody struct { - // environment - Environment *string `json:"environment,omitempty"` - - // cluster - Cluster *string `json:"cluster,omitempty"` - - // replication set - ReplicationSet *string `json:"replication_set,omitempty"` - - // external group - ExternalGroup *string `json:"external_group,omitempty"` - - // custom labels - CustomLabels *ChangeServiceParamsBodyCustomLabels `json:"custom_labels,omitempty"` -} - -// Validate validates this change service body -func (o *ChangeServiceBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateCustomLabels(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ChangeServiceBody) validateCustomLabels(formats strfmt.Registry) error { - if swag.IsZero(o.CustomLabels) { // not required - return nil - } - - if o.CustomLabels != nil { - if err := o.CustomLabels.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "custom_labels") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "custom_labels") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this change service body based on the context it is used -func (o *ChangeServiceBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateCustomLabels(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ChangeServiceBody) contextValidateCustomLabels(ctx context.Context, formats strfmt.Registry) error { - if o.CustomLabels != nil { - - if swag.IsZero(o.CustomLabels) { // not required - return nil - } - - if err := o.CustomLabels.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "custom_labels") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "custom_labels") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeServiceBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeServiceBody) UnmarshalBinary(b []byte) error { - var res ChangeServiceBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeServiceDefaultBody change service default body -swagger:model ChangeServiceDefaultBody -*/ -type ChangeServiceDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*ChangeServiceDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this change service default body -func (o *ChangeServiceDefaultBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateDetails(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ChangeServiceDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required - return nil - } - - for i := 0; i < len(o.Details); i++ { - if swag.IsZero(o.Details[i]) { // not required - continue - } - - if o.Details[i] != nil { - if err := o.Details[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("ChangeService default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("ChangeService default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this change service default body based on the context it is used -func (o *ChangeServiceDefaultBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateDetails(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ChangeServiceDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Details); i++ { - if o.Details[i] != nil { - - if 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("ChangeService default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("ChangeService default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeServiceDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeServiceDefaultBody) UnmarshalBinary(b []byte) error { - var res ChangeServiceDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeServiceDefaultBodyDetailsItems0 change service default body details items0 -swagger:model ChangeServiceDefaultBodyDetailsItems0 -*/ -type ChangeServiceDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` - - // change service default body details items0 - ChangeServiceDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *ChangeServiceDefaultBodyDetailsItems0) 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 ChangeServiceDefaultBodyDetailsItems0 - - 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.ChangeServiceDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o ChangeServiceDefaultBodyDetailsItems0) 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.ChangeServiceDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.ChangeServiceDefaultBodyDetailsItems0) - 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 change service default body details items0 -func (o *ChangeServiceDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this change service default body details items0 based on context it is used -func (o *ChangeServiceDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeServiceDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeServiceDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res ChangeServiceDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeServiceOKBody change service OK body -swagger:model ChangeServiceOKBody -*/ -type ChangeServiceOKBody struct { - // external - External *ChangeServiceOKBodyExternal `json:"external,omitempty"` - - // haproxy - Haproxy *ChangeServiceOKBodyHaproxy `json:"haproxy,omitempty"` - - // mongodb - Mongodb *ChangeServiceOKBodyMongodb `json:"mongodb,omitempty"` - - // mysql - Mysql *ChangeServiceOKBodyMysql `json:"mysql,omitempty"` - - // postgresql - Postgresql *ChangeServiceOKBodyPostgresql `json:"postgresql,omitempty"` - - // proxysql - Proxysql *ChangeServiceOKBodyProxysql `json:"proxysql,omitempty"` - - // valkey - Valkey *ChangeServiceOKBodyValkey `json:"valkey,omitempty"` -} - -// Validate validates this change service OK body -func (o *ChangeServiceOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateExternal(formats); err != nil { - res = append(res, err) - } - - if err := o.validateHaproxy(formats); err != nil { - res = append(res, err) - } - - if err := o.validateMongodb(formats); err != nil { - res = append(res, err) - } - - if err := o.validateMysql(formats); err != nil { - res = append(res, err) - } - - if err := o.validatePostgresql(formats); err != nil { - res = append(res, err) - } - - if err := o.validateProxysql(formats); err != nil { - res = append(res, err) - } - - if err := o.validateValkey(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ChangeServiceOKBody) validateExternal(formats strfmt.Registry) error { - if swag.IsZero(o.External) { // not required - return nil - } - - if o.External != nil { - if err := o.External.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("changeServiceOk" + "." + "external") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("changeServiceOk" + "." + "external") - } - - return err - } - } - - return nil -} - -func (o *ChangeServiceOKBody) validateHaproxy(formats strfmt.Registry) error { - if swag.IsZero(o.Haproxy) { // not required - return nil - } - - if o.Haproxy != nil { - if err := o.Haproxy.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("changeServiceOk" + "." + "haproxy") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("changeServiceOk" + "." + "haproxy") - } - - return err - } - } - - return nil -} - -func (o *ChangeServiceOKBody) validateMongodb(formats strfmt.Registry) error { - if swag.IsZero(o.Mongodb) { // not required - return nil - } - - if o.Mongodb != nil { - if err := o.Mongodb.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("changeServiceOk" + "." + "mongodb") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("changeServiceOk" + "." + "mongodb") - } - - return err - } - } - - return nil -} - -func (o *ChangeServiceOKBody) validateMysql(formats strfmt.Registry) error { - if swag.IsZero(o.Mysql) { // not required - return nil - } - - if o.Mysql != nil { - if err := o.Mysql.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("changeServiceOk" + "." + "mysql") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("changeServiceOk" + "." + "mysql") - } - - return err - } - } - - return nil -} - -func (o *ChangeServiceOKBody) validatePostgresql(formats strfmt.Registry) error { - if swag.IsZero(o.Postgresql) { // not required - return nil - } - - if o.Postgresql != nil { - if err := o.Postgresql.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("changeServiceOk" + "." + "postgresql") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("changeServiceOk" + "." + "postgresql") - } - - return err - } - } - - return nil -} - -func (o *ChangeServiceOKBody) validateProxysql(formats strfmt.Registry) error { - if swag.IsZero(o.Proxysql) { // not required - return nil - } - - if o.Proxysql != nil { - if err := o.Proxysql.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("changeServiceOk" + "." + "proxysql") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("changeServiceOk" + "." + "proxysql") - } - - return err - } - } - - return nil -} - -func (o *ChangeServiceOKBody) validateValkey(formats strfmt.Registry) error { - if swag.IsZero(o.Valkey) { // not required - return nil - } - - if o.Valkey != nil { - if err := o.Valkey.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("changeServiceOk" + "." + "valkey") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("changeServiceOk" + "." + "valkey") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this change service OK body based on the context it is used -func (o *ChangeServiceOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateExternal(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateHaproxy(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateMongodb(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateMysql(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidatePostgresql(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateProxysql(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateValkey(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ChangeServiceOKBody) contextValidateExternal(ctx context.Context, formats strfmt.Registry) error { - if o.External != nil { - - if swag.IsZero(o.External) { // not required - return nil - } - - if err := o.External.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("changeServiceOk" + "." + "external") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("changeServiceOk" + "." + "external") - } - - return err - } - } - - return nil -} - -func (o *ChangeServiceOKBody) contextValidateHaproxy(ctx context.Context, formats strfmt.Registry) error { - if o.Haproxy != nil { - - if swag.IsZero(o.Haproxy) { // not required - return nil - } - - if err := o.Haproxy.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("changeServiceOk" + "." + "haproxy") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("changeServiceOk" + "." + "haproxy") - } - - return err - } - } - - return nil -} - -func (o *ChangeServiceOKBody) contextValidateMongodb(ctx context.Context, formats strfmt.Registry) error { - if o.Mongodb != nil { - - if swag.IsZero(o.Mongodb) { // not required - return nil - } - - if err := o.Mongodb.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("changeServiceOk" + "." + "mongodb") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("changeServiceOk" + "." + "mongodb") - } - - return err - } - } - - return nil -} - -func (o *ChangeServiceOKBody) contextValidateMysql(ctx context.Context, formats strfmt.Registry) error { - if o.Mysql != nil { - - if swag.IsZero(o.Mysql) { // not required - return nil - } - - if err := o.Mysql.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("changeServiceOk" + "." + "mysql") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("changeServiceOk" + "." + "mysql") - } - - return err - } - } - - return nil -} - -func (o *ChangeServiceOKBody) contextValidatePostgresql(ctx context.Context, formats strfmt.Registry) error { - if o.Postgresql != nil { - - if swag.IsZero(o.Postgresql) { // not required - return nil - } - - if err := o.Postgresql.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("changeServiceOk" + "." + "postgresql") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("changeServiceOk" + "." + "postgresql") - } - - return err - } - } - - return nil -} - -func (o *ChangeServiceOKBody) contextValidateProxysql(ctx context.Context, formats strfmt.Registry) error { - if o.Proxysql != nil { - - if swag.IsZero(o.Proxysql) { // not required - return nil - } - - if err := o.Proxysql.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("changeServiceOk" + "." + "proxysql") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("changeServiceOk" + "." + "proxysql") - } - - return err - } - } - - return nil -} - -func (o *ChangeServiceOKBody) contextValidateValkey(ctx context.Context, formats strfmt.Registry) error { - if o.Valkey != nil { - - if swag.IsZero(o.Valkey) { // not required - return nil - } - - if err := o.Valkey.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("changeServiceOk" + "." + "valkey") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("changeServiceOk" + "." + "valkey") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeServiceOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeServiceOKBody) UnmarshalBinary(b []byte) error { - var res ChangeServiceOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeServiceOKBodyExternal ExternalService represents a generic External service instance. -swagger:model ChangeServiceOKBodyExternal -*/ -type ChangeServiceOKBodyExternal struct { - // Unique randomly generated instance identifier. - ServiceID string `json:"service_id,omitempty"` - - // Unique across all Services user-defined name. - ServiceName string `json:"service_name,omitempty"` - - // Node identifier where this service instance runs. - NodeID string `json:"node_id,omitempty"` - - // Environment name. - Environment string `json:"environment,omitempty"` - - // Cluster name. - Cluster string `json:"cluster,omitempty"` - - // Replication set name. - ReplicationSet string `json:"replication_set,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // Group name of external service. - Group string `json:"group,omitempty"` -} - -// Validate validates this change service OK body external -func (o *ChangeServiceOKBodyExternal) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this change service OK body external based on context it is used -func (o *ChangeServiceOKBodyExternal) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeServiceOKBodyExternal) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeServiceOKBodyExternal) UnmarshalBinary(b []byte) error { - var res ChangeServiceOKBodyExternal - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeServiceOKBodyHaproxy HAProxyService represents a generic HAProxy service instance. -swagger:model ChangeServiceOKBodyHaproxy -*/ -type ChangeServiceOKBodyHaproxy struct { - // Unique randomly generated instance identifier. - ServiceID string `json:"service_id,omitempty"` - - // Unique across all Services user-defined name. - ServiceName string `json:"service_name,omitempty"` - - // Node identifier where this service instance runs. - NodeID string `json:"node_id,omitempty"` - - // Environment name. - Environment string `json:"environment,omitempty"` - - // Cluster name. - Cluster string `json:"cluster,omitempty"` - - // Replication set name. - ReplicationSet string `json:"replication_set,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` -} - -// Validate validates this change service OK body haproxy -func (o *ChangeServiceOKBodyHaproxy) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this change service OK body haproxy based on context it is used -func (o *ChangeServiceOKBodyHaproxy) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeServiceOKBodyHaproxy) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeServiceOKBodyHaproxy) UnmarshalBinary(b []byte) error { - var res ChangeServiceOKBodyHaproxy - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeServiceOKBodyMongodb MongoDBService represents a generic MongoDB instance. -swagger:model ChangeServiceOKBodyMongodb -*/ -type ChangeServiceOKBodyMongodb struct { - // Unique randomly generated instance identifier. - ServiceID string `json:"service_id,omitempty"` - - // Unique across all Services user-defined name. - ServiceName string `json:"service_name,omitempty"` - - // Node identifier where this instance runs. - NodeID string `json:"node_id,omitempty"` - - // Access address (DNS name or IP). - // Address (and port) or socket is required. - Address string `json:"address,omitempty"` - - // Access port. - // Port is required when the address present. - Port int64 `json:"port,omitempty"` - - // Access unix socket. - // Address (and port) or socket is required. - Socket string `json:"socket,omitempty"` - - // Environment name. - Environment string `json:"environment,omitempty"` - - // Cluster name. - Cluster string `json:"cluster,omitempty"` - - // Replication set name. - ReplicationSet string `json:"replication_set,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // MongoDB version. - Version string `json:"version,omitempty"` -} - -// Validate validates this change service OK body mongodb -func (o *ChangeServiceOKBodyMongodb) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this change service OK body mongodb based on context it is used -func (o *ChangeServiceOKBodyMongodb) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeServiceOKBodyMongodb) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeServiceOKBodyMongodb) UnmarshalBinary(b []byte) error { - var res ChangeServiceOKBodyMongodb - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeServiceOKBodyMysql MySQLService represents a generic MySQL instance. -swagger:model ChangeServiceOKBodyMysql -*/ -type ChangeServiceOKBodyMysql struct { - // Unique randomly generated instance identifier. - ServiceID string `json:"service_id,omitempty"` - - // Unique across all Services user-defined name. - ServiceName string `json:"service_name,omitempty"` - - // Node identifier where this instance runs. - NodeID string `json:"node_id,omitempty"` - - // Access address (DNS name or IP). - // Address (and port) or socket is required. - Address string `json:"address,omitempty"` - - // Access port. - // Port is required when the address present. - Port int64 `json:"port,omitempty"` - - // Access unix socket. - // Address (and port) or socket is required. - Socket string `json:"socket,omitempty"` - - // Environment name. - Environment string `json:"environment,omitempty"` - - // Cluster name. - Cluster string `json:"cluster,omitempty"` - - // Replication set name. - ReplicationSet string `json:"replication_set,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // MySQL version. - Version string `json:"version,omitempty"` - - // Extra parameters to be added to the DSN. - ExtraDsnParams map[string]string `json:"extra_dsn_params,omitempty"` -} - -// Validate validates this change service OK body mysql -func (o *ChangeServiceOKBodyMysql) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this change service OK body mysql based on context it is used -func (o *ChangeServiceOKBodyMysql) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeServiceOKBodyMysql) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeServiceOKBodyMysql) UnmarshalBinary(b []byte) error { - var res ChangeServiceOKBodyMysql - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeServiceOKBodyPostgresql PostgreSQLService represents a generic PostgreSQL instance. -swagger:model ChangeServiceOKBodyPostgresql -*/ -type ChangeServiceOKBodyPostgresql struct { - // Unique randomly generated instance identifier. - ServiceID string `json:"service_id,omitempty"` - - // Unique across all Services user-defined name. - ServiceName string `json:"service_name,omitempty"` - - // Database name. - DatabaseName string `json:"database_name,omitempty"` - - // Node identifier where this instance runs. - NodeID string `json:"node_id,omitempty"` - - // Access address (DNS name or IP). - // Address (and port) or socket is required. - Address string `json:"address,omitempty"` - - // Access port. - // Port is required when the address present. - Port int64 `json:"port,omitempty"` - - // Access unix socket. - // Address (and port) or socket is required. - Socket string `json:"socket,omitempty"` - - // Environment name. - Environment string `json:"environment,omitempty"` - - // Cluster name. - Cluster string `json:"cluster,omitempty"` - - // Replication set name. - ReplicationSet string `json:"replication_set,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // PostgreSQL version. - Version string `json:"version,omitempty"` - - // Limit of databases for auto-discovery. - AutoDiscoveryLimit int32 `json:"auto_discovery_limit,omitempty"` -} - -// Validate validates this change service OK body postgresql -func (o *ChangeServiceOKBodyPostgresql) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this change service OK body postgresql based on context it is used -func (o *ChangeServiceOKBodyPostgresql) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeServiceOKBodyPostgresql) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeServiceOKBodyPostgresql) UnmarshalBinary(b []byte) error { - var res ChangeServiceOKBodyPostgresql - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeServiceOKBodyProxysql ProxySQLService represents a generic ProxySQL instance. -swagger:model ChangeServiceOKBodyProxysql -*/ -type ChangeServiceOKBodyProxysql struct { - // Unique randomly generated instance identifier. - ServiceID string `json:"service_id,omitempty"` - - // Unique across all Services user-defined name. - ServiceName string `json:"service_name,omitempty"` - - // Node identifier where this instance runs. - NodeID string `json:"node_id,omitempty"` - - // Access address (DNS name or IP). - // Address (and port) or socket is required. - Address string `json:"address,omitempty"` - - // Access port. - // Port is required when the address present. - Port int64 `json:"port,omitempty"` - - // Access unix socket. - // Address (and port) or socket is required. - Socket string `json:"socket,omitempty"` - - // Environment name. - Environment string `json:"environment,omitempty"` - - // Cluster name. - Cluster string `json:"cluster,omitempty"` - - // Replication set name. - ReplicationSet string `json:"replication_set,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // ProxySQL version. - Version string `json:"version,omitempty"` -} - -// Validate validates this change service OK body proxysql -func (o *ChangeServiceOKBodyProxysql) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this change service OK body proxysql based on context it is used -func (o *ChangeServiceOKBodyProxysql) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeServiceOKBodyProxysql) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeServiceOKBodyProxysql) UnmarshalBinary(b []byte) error { - var res ChangeServiceOKBodyProxysql - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeServiceOKBodyValkey ValkeyService represents a generic Valkey instance. -swagger:model ChangeServiceOKBodyValkey -*/ -type ChangeServiceOKBodyValkey struct { - // Unique randomly generated instance identifier. - ServiceID string `json:"service_id,omitempty"` - - // Unique across all Services user-defined name. - ServiceName string `json:"service_name,omitempty"` - - // Node identifier where this instance runs. - NodeID string `json:"node_id,omitempty"` - - // Access address (DNS name or IP). - // Address (and port) or socket is required. - Address string `json:"address,omitempty"` - - // Access port. - // Port is required when the address present. - Port int64 `json:"port,omitempty"` - - // Access unix socket. - // Address (and port) or socket is required. - Socket string `json:"socket,omitempty"` - - // Environment name. - Environment string `json:"environment,omitempty"` - - // Cluster name. - Cluster string `json:"cluster,omitempty"` - - // Replication set name. - ReplicationSet string `json:"replication_set,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // Valkey version. - Version string `json:"version,omitempty"` -} - -// Validate validates this change service OK body valkey -func (o *ChangeServiceOKBodyValkey) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this change service OK body valkey based on context it is used -func (o *ChangeServiceOKBodyValkey) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeServiceOKBodyValkey) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeServiceOKBodyValkey) UnmarshalBinary(b []byte) error { - var res ChangeServiceOKBodyValkey - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeServiceParamsBodyCustomLabels A wrapper for map[string]string. This type allows to distinguish between an empty map and a null value. -swagger:model ChangeServiceParamsBodyCustomLabels -*/ -type ChangeServiceParamsBodyCustomLabels struct { - // values - Values map[string]string `json:"values,omitempty"` -} - -// Validate validates this change service params body custom labels -func (o *ChangeServiceParamsBodyCustomLabels) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this change service params body custom labels based on context it is used -func (o *ChangeServiceParamsBodyCustomLabels) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeServiceParamsBodyCustomLabels) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeServiceParamsBodyCustomLabels) UnmarshalBinary(b []byte) error { - var res ChangeServiceParamsBodyCustomLabels - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/inventory/v1/json/client/services_service/get_service_parameters.go b/api/inventory/v1/json/client/services_service/get_service_parameters.go deleted file mode 100644 index 8569bce763c..00000000000 --- a/api/inventory/v1/json/client/services_service/get_service_parameters.go +++ /dev/null @@ -1,149 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package services_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" -) - -// NewGetServiceParams creates a new GetServiceParams 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 NewGetServiceParams() *GetServiceParams { - return &GetServiceParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetServiceParamsWithTimeout creates a new GetServiceParams object -// with the ability to set a timeout on a request. -func NewGetServiceParamsWithTimeout(timeout time.Duration) *GetServiceParams { - return &GetServiceParams{ - timeout: timeout, - } -} - -// NewGetServiceParamsWithContext creates a new GetServiceParams object -// with the ability to set a context for a request. -func NewGetServiceParamsWithContext(ctx context.Context) *GetServiceParams { - return &GetServiceParams{ - Context: ctx, - } -} - -// NewGetServiceParamsWithHTTPClient creates a new GetServiceParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetServiceParamsWithHTTPClient(client *http.Client) *GetServiceParams { - return &GetServiceParams{ - HTTPClient: client, - } -} - -/* -GetServiceParams contains all the parameters to send to the API endpoint - - for the get service operation. - - Typically these are written to a http.Request. -*/ -type GetServiceParams struct { - /* ServiceID. - - Unique randomly generated instance identifier. - */ - ServiceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get service params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetServiceParams) WithDefaults() *GetServiceParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get service params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetServiceParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the get service params -func (o *GetServiceParams) WithTimeout(timeout time.Duration) *GetServiceParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get service params -func (o *GetServiceParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get service params -func (o *GetServiceParams) WithContext(ctx context.Context) *GetServiceParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get service params -func (o *GetServiceParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get service params -func (o *GetServiceParams) WithHTTPClient(client *http.Client) *GetServiceParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get service params -func (o *GetServiceParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithServiceID adds the serviceID to the get service params -func (o *GetServiceParams) WithServiceID(serviceID string) *GetServiceParams { - o.SetServiceID(serviceID) - return o -} - -// SetServiceID adds the serviceId to the get service params -func (o *GetServiceParams) SetServiceID(serviceID string) { - o.ServiceID = serviceID -} - -// WriteToRequest writes these params to a swagger request -func (o *GetServiceParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param service_id - if err := r.SetPathParam("service_id", o.ServiceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/api/inventory/v1/json/client/services_service/get_service_responses.go b/api/inventory/v1/json/client/services_service/get_service_responses.go deleted file mode 100644 index 3f2530b39c7..00000000000 --- a/api/inventory/v1/json/client/services_service/get_service_responses.go +++ /dev/null @@ -1,1338 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package services_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" -) - -// GetServiceReader is a Reader for the GetService structure. -type GetServiceReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetServiceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewGetServiceOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewGetServiceDefault(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 - } -} - -// NewGetServiceOK creates a GetServiceOK with default headers values -func NewGetServiceOK() *GetServiceOK { - return &GetServiceOK{} -} - -/* -GetServiceOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type GetServiceOK struct { - Payload *GetServiceOKBody -} - -// IsSuccess returns true when this get service Ok response has a 2xx status code -func (o *GetServiceOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this get service Ok response has a 3xx status code -func (o *GetServiceOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this get service Ok response has a 4xx status code -func (o *GetServiceOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this get service Ok response has a 5xx status code -func (o *GetServiceOK) IsServerError() bool { - return false -} - -// IsCode returns true when this get service Ok response a status code equal to that given -func (o *GetServiceOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the get service Ok response -func (o *GetServiceOK) Code() int { - return 200 -} - -func (o *GetServiceOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/inventory/services/{service_id}][%d] getServiceOk %s", 200, payload) -} - -func (o *GetServiceOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/inventory/services/{service_id}][%d] getServiceOk %s", 200, payload) -} - -func (o *GetServiceOK) GetPayload() *GetServiceOKBody { - return o.Payload -} - -func (o *GetServiceOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(GetServiceOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -// NewGetServiceDefault creates a GetServiceDefault with default headers values -func NewGetServiceDefault(code int) *GetServiceDefault { - return &GetServiceDefault{ - _statusCode: code, - } -} - -/* -GetServiceDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type GetServiceDefault struct { - _statusCode int - - Payload *GetServiceDefaultBody -} - -// IsSuccess returns true when this get service default response has a 2xx status code -func (o *GetServiceDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this get service default response has a 3xx status code -func (o *GetServiceDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this get service default response has a 4xx status code -func (o *GetServiceDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this get service default response has a 5xx status code -func (o *GetServiceDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this get service default response a status code equal to that given -func (o *GetServiceDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the get service default response -func (o *GetServiceDefault) Code() int { - return o._statusCode -} - -func (o *GetServiceDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/inventory/services/{service_id}][%d] GetService default %s", o._statusCode, payload) -} - -func (o *GetServiceDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/inventory/services/{service_id}][%d] GetService default %s", o._statusCode, payload) -} - -func (o *GetServiceDefault) GetPayload() *GetServiceDefaultBody { - return o.Payload -} - -func (o *GetServiceDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(GetServiceDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -GetServiceDefaultBody get service default body -swagger:model GetServiceDefaultBody -*/ -type GetServiceDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*GetServiceDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this get service default body -func (o *GetServiceDefaultBody) 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 *GetServiceDefaultBody) 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("GetService default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("GetService default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this get service default body based on the context it is used -func (o *GetServiceDefaultBody) 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 *GetServiceDefaultBody) 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("GetService default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("GetService default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetServiceDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetServiceDefaultBody) UnmarshalBinary(b []byte) error { - var res GetServiceDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetServiceDefaultBodyDetailsItems0 get service default body details items0 -swagger:model GetServiceDefaultBodyDetailsItems0 -*/ -type GetServiceDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` - - // get service default body details items0 - GetServiceDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *GetServiceDefaultBodyDetailsItems0) 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 GetServiceDefaultBodyDetailsItems0 - - 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.GetServiceDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o GetServiceDefaultBodyDetailsItems0) 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.GetServiceDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.GetServiceDefaultBodyDetailsItems0) - 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 get service default body details items0 -func (o *GetServiceDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get service default body details items0 based on context it is used -func (o *GetServiceDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetServiceDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetServiceDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res GetServiceDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetServiceOKBody get service OK body -swagger:model GetServiceOKBody -*/ -type GetServiceOKBody struct { - // external - External *GetServiceOKBodyExternal `json:"external,omitempty"` - - // haproxy - Haproxy *GetServiceOKBodyHaproxy `json:"haproxy,omitempty"` - - // mongodb - Mongodb *GetServiceOKBodyMongodb `json:"mongodb,omitempty"` - - // mysql - Mysql *GetServiceOKBodyMysql `json:"mysql,omitempty"` - - // postgresql - Postgresql *GetServiceOKBodyPostgresql `json:"postgresql,omitempty"` - - // proxysql - Proxysql *GetServiceOKBodyProxysql `json:"proxysql,omitempty"` - - // valkey - Valkey *GetServiceOKBodyValkey `json:"valkey,omitempty"` -} - -// Validate validates this get service OK body -func (o *GetServiceOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateExternal(formats); err != nil { - res = append(res, err) - } - - if err := o.validateHaproxy(formats); err != nil { - res = append(res, err) - } - - if err := o.validateMongodb(formats); err != nil { - res = append(res, err) - } - - if err := o.validateMysql(formats); err != nil { - res = append(res, err) - } - - if err := o.validatePostgresql(formats); err != nil { - res = append(res, err) - } - - if err := o.validateProxysql(formats); err != nil { - res = append(res, err) - } - - if err := o.validateValkey(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetServiceOKBody) validateExternal(formats strfmt.Registry) error { - if swag.IsZero(o.External) { // not required - return nil - } - - if o.External != nil { - if err := o.External.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getServiceOk" + "." + "external") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getServiceOk" + "." + "external") - } - - return err - } - } - - return nil -} - -func (o *GetServiceOKBody) validateHaproxy(formats strfmt.Registry) error { - if swag.IsZero(o.Haproxy) { // not required - return nil - } - - if o.Haproxy != nil { - if err := o.Haproxy.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getServiceOk" + "." + "haproxy") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getServiceOk" + "." + "haproxy") - } - - return err - } - } - - return nil -} - -func (o *GetServiceOKBody) validateMongodb(formats strfmt.Registry) error { - if swag.IsZero(o.Mongodb) { // not required - return nil - } - - if o.Mongodb != nil { - if err := o.Mongodb.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getServiceOk" + "." + "mongodb") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getServiceOk" + "." + "mongodb") - } - - return err - } - } - - return nil -} - -func (o *GetServiceOKBody) validateMysql(formats strfmt.Registry) error { - if swag.IsZero(o.Mysql) { // not required - return nil - } - - if o.Mysql != nil { - if err := o.Mysql.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getServiceOk" + "." + "mysql") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getServiceOk" + "." + "mysql") - } - - return err - } - } - - return nil -} - -func (o *GetServiceOKBody) validatePostgresql(formats strfmt.Registry) error { - if swag.IsZero(o.Postgresql) { // not required - return nil - } - - if o.Postgresql != nil { - if err := o.Postgresql.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getServiceOk" + "." + "postgresql") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getServiceOk" + "." + "postgresql") - } - - return err - } - } - - return nil -} - -func (o *GetServiceOKBody) validateProxysql(formats strfmt.Registry) error { - if swag.IsZero(o.Proxysql) { // not required - return nil - } - - if o.Proxysql != nil { - if err := o.Proxysql.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getServiceOk" + "." + "proxysql") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getServiceOk" + "." + "proxysql") - } - - return err - } - } - - return nil -} - -func (o *GetServiceOKBody) validateValkey(formats strfmt.Registry) error { - if swag.IsZero(o.Valkey) { // not required - return nil - } - - if o.Valkey != nil { - if err := o.Valkey.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getServiceOk" + "." + "valkey") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getServiceOk" + "." + "valkey") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this get service OK body based on the context it is used -func (o *GetServiceOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateExternal(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateHaproxy(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateMongodb(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateMysql(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidatePostgresql(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateProxysql(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateValkey(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetServiceOKBody) contextValidateExternal(ctx context.Context, formats strfmt.Registry) error { - if o.External != nil { - - if swag.IsZero(o.External) { // not required - return nil - } - - if err := o.External.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getServiceOk" + "." + "external") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getServiceOk" + "." + "external") - } - - return err - } - } - - return nil -} - -func (o *GetServiceOKBody) contextValidateHaproxy(ctx context.Context, formats strfmt.Registry) error { - if o.Haproxy != nil { - - if swag.IsZero(o.Haproxy) { // not required - return nil - } - - if err := o.Haproxy.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getServiceOk" + "." + "haproxy") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getServiceOk" + "." + "haproxy") - } - - return err - } - } - - return nil -} - -func (o *GetServiceOKBody) contextValidateMongodb(ctx context.Context, formats strfmt.Registry) error { - if o.Mongodb != nil { - - if swag.IsZero(o.Mongodb) { // not required - return nil - } - - if err := o.Mongodb.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getServiceOk" + "." + "mongodb") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getServiceOk" + "." + "mongodb") - } - - return err - } - } - - return nil -} - -func (o *GetServiceOKBody) contextValidateMysql(ctx context.Context, formats strfmt.Registry) error { - if o.Mysql != nil { - - if swag.IsZero(o.Mysql) { // not required - return nil - } - - if err := o.Mysql.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getServiceOk" + "." + "mysql") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getServiceOk" + "." + "mysql") - } - - return err - } - } - - return nil -} - -func (o *GetServiceOKBody) contextValidatePostgresql(ctx context.Context, formats strfmt.Registry) error { - if o.Postgresql != nil { - - if swag.IsZero(o.Postgresql) { // not required - return nil - } - - if err := o.Postgresql.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getServiceOk" + "." + "postgresql") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getServiceOk" + "." + "postgresql") - } - - return err - } - } - - return nil -} - -func (o *GetServiceOKBody) contextValidateProxysql(ctx context.Context, formats strfmt.Registry) error { - if o.Proxysql != nil { - - if swag.IsZero(o.Proxysql) { // not required - return nil - } - - if err := o.Proxysql.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getServiceOk" + "." + "proxysql") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getServiceOk" + "." + "proxysql") - } - - return err - } - } - - return nil -} - -func (o *GetServiceOKBody) contextValidateValkey(ctx context.Context, formats strfmt.Registry) error { - if o.Valkey != nil { - - if swag.IsZero(o.Valkey) { // not required - return nil - } - - if err := o.Valkey.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getServiceOk" + "." + "valkey") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getServiceOk" + "." + "valkey") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetServiceOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetServiceOKBody) UnmarshalBinary(b []byte) error { - var res GetServiceOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetServiceOKBodyExternal ExternalService represents a generic External service instance. -swagger:model GetServiceOKBodyExternal -*/ -type GetServiceOKBodyExternal struct { - // Unique randomly generated instance identifier. - ServiceID string `json:"service_id,omitempty"` - - // Unique across all Services user-defined name. - ServiceName string `json:"service_name,omitempty"` - - // Node identifier where this service instance runs. - NodeID string `json:"node_id,omitempty"` - - // Environment name. - Environment string `json:"environment,omitempty"` - - // Cluster name. - Cluster string `json:"cluster,omitempty"` - - // Replication set name. - ReplicationSet string `json:"replication_set,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // Group name of external service. - Group string `json:"group,omitempty"` -} - -// Validate validates this get service OK body external -func (o *GetServiceOKBodyExternal) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get service OK body external based on context it is used -func (o *GetServiceOKBodyExternal) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetServiceOKBodyExternal) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetServiceOKBodyExternal) UnmarshalBinary(b []byte) error { - var res GetServiceOKBodyExternal - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetServiceOKBodyHaproxy HAProxyService represents a generic HAProxy service instance. -swagger:model GetServiceOKBodyHaproxy -*/ -type GetServiceOKBodyHaproxy struct { - // Unique randomly generated instance identifier. - ServiceID string `json:"service_id,omitempty"` - - // Unique across all Services user-defined name. - ServiceName string `json:"service_name,omitempty"` - - // Node identifier where this service instance runs. - NodeID string `json:"node_id,omitempty"` - - // Environment name. - Environment string `json:"environment,omitempty"` - - // Cluster name. - Cluster string `json:"cluster,omitempty"` - - // Replication set name. - ReplicationSet string `json:"replication_set,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` -} - -// Validate validates this get service OK body haproxy -func (o *GetServiceOKBodyHaproxy) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get service OK body haproxy based on context it is used -func (o *GetServiceOKBodyHaproxy) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetServiceOKBodyHaproxy) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetServiceOKBodyHaproxy) UnmarshalBinary(b []byte) error { - var res GetServiceOKBodyHaproxy - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetServiceOKBodyMongodb MongoDBService represents a generic MongoDB instance. -swagger:model GetServiceOKBodyMongodb -*/ -type GetServiceOKBodyMongodb struct { - // Unique randomly generated instance identifier. - ServiceID string `json:"service_id,omitempty"` - - // Unique across all Services user-defined name. - ServiceName string `json:"service_name,omitempty"` - - // Node identifier where this instance runs. - NodeID string `json:"node_id,omitempty"` - - // Access address (DNS name or IP). - // Address (and port) or socket is required. - Address string `json:"address,omitempty"` - - // Access port. - // Port is required when the address present. - Port int64 `json:"port,omitempty"` - - // Access unix socket. - // Address (and port) or socket is required. - Socket string `json:"socket,omitempty"` - - // Environment name. - Environment string `json:"environment,omitempty"` - - // Cluster name. - Cluster string `json:"cluster,omitempty"` - - // Replication set name. - ReplicationSet string `json:"replication_set,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // MongoDB version. - Version string `json:"version,omitempty"` -} - -// Validate validates this get service OK body mongodb -func (o *GetServiceOKBodyMongodb) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get service OK body mongodb based on context it is used -func (o *GetServiceOKBodyMongodb) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetServiceOKBodyMongodb) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetServiceOKBodyMongodb) UnmarshalBinary(b []byte) error { - var res GetServiceOKBodyMongodb - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetServiceOKBodyMysql MySQLService represents a generic MySQL instance. -swagger:model GetServiceOKBodyMysql -*/ -type GetServiceOKBodyMysql struct { - // Unique randomly generated instance identifier. - ServiceID string `json:"service_id,omitempty"` - - // Unique across all Services user-defined name. - ServiceName string `json:"service_name,omitempty"` - - // Node identifier where this instance runs. - NodeID string `json:"node_id,omitempty"` - - // Access address (DNS name or IP). - // Address (and port) or socket is required. - Address string `json:"address,omitempty"` - - // Access port. - // Port is required when the address present. - Port int64 `json:"port,omitempty"` - - // Access unix socket. - // Address (and port) or socket is required. - Socket string `json:"socket,omitempty"` - - // Environment name. - Environment string `json:"environment,omitempty"` - - // Cluster name. - Cluster string `json:"cluster,omitempty"` - - // Replication set name. - ReplicationSet string `json:"replication_set,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // MySQL version. - Version string `json:"version,omitempty"` - - // Extra parameters to be added to the DSN. - ExtraDsnParams map[string]string `json:"extra_dsn_params,omitempty"` -} - -// Validate validates this get service OK body mysql -func (o *GetServiceOKBodyMysql) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get service OK body mysql based on context it is used -func (o *GetServiceOKBodyMysql) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetServiceOKBodyMysql) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetServiceOKBodyMysql) UnmarshalBinary(b []byte) error { - var res GetServiceOKBodyMysql - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetServiceOKBodyPostgresql PostgreSQLService represents a generic PostgreSQL instance. -swagger:model GetServiceOKBodyPostgresql -*/ -type GetServiceOKBodyPostgresql struct { - // Unique randomly generated instance identifier. - ServiceID string `json:"service_id,omitempty"` - - // Unique across all Services user-defined name. - ServiceName string `json:"service_name,omitempty"` - - // Database name. - DatabaseName string `json:"database_name,omitempty"` - - // Node identifier where this instance runs. - NodeID string `json:"node_id,omitempty"` - - // Access address (DNS name or IP). - // Address (and port) or socket is required. - Address string `json:"address,omitempty"` - - // Access port. - // Port is required when the address present. - Port int64 `json:"port,omitempty"` - - // Access unix socket. - // Address (and port) or socket is required. - Socket string `json:"socket,omitempty"` - - // Environment name. - Environment string `json:"environment,omitempty"` - - // Cluster name. - Cluster string `json:"cluster,omitempty"` - - // Replication set name. - ReplicationSet string `json:"replication_set,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // PostgreSQL version. - Version string `json:"version,omitempty"` - - // Limit of databases for auto-discovery. - AutoDiscoveryLimit int32 `json:"auto_discovery_limit,omitempty"` -} - -// Validate validates this get service OK body postgresql -func (o *GetServiceOKBodyPostgresql) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get service OK body postgresql based on context it is used -func (o *GetServiceOKBodyPostgresql) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetServiceOKBodyPostgresql) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetServiceOKBodyPostgresql) UnmarshalBinary(b []byte) error { - var res GetServiceOKBodyPostgresql - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetServiceOKBodyProxysql ProxySQLService represents a generic ProxySQL instance. -swagger:model GetServiceOKBodyProxysql -*/ -type GetServiceOKBodyProxysql struct { - // Unique randomly generated instance identifier. - ServiceID string `json:"service_id,omitempty"` - - // Unique across all Services user-defined name. - ServiceName string `json:"service_name,omitempty"` - - // Node identifier where this instance runs. - NodeID string `json:"node_id,omitempty"` - - // Access address (DNS name or IP). - // Address (and port) or socket is required. - Address string `json:"address,omitempty"` - - // Access port. - // Port is required when the address present. - Port int64 `json:"port,omitempty"` - - // Access unix socket. - // Address (and port) or socket is required. - Socket string `json:"socket,omitempty"` - - // Environment name. - Environment string `json:"environment,omitempty"` - - // Cluster name. - Cluster string `json:"cluster,omitempty"` - - // Replication set name. - ReplicationSet string `json:"replication_set,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // ProxySQL version. - Version string `json:"version,omitempty"` -} - -// Validate validates this get service OK body proxysql -func (o *GetServiceOKBodyProxysql) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get service OK body proxysql based on context it is used -func (o *GetServiceOKBodyProxysql) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetServiceOKBodyProxysql) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetServiceOKBodyProxysql) UnmarshalBinary(b []byte) error { - var res GetServiceOKBodyProxysql - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetServiceOKBodyValkey ValkeyService represents a generic Valkey instance. -swagger:model GetServiceOKBodyValkey -*/ -type GetServiceOKBodyValkey struct { - // Unique randomly generated instance identifier. - ServiceID string `json:"service_id,omitempty"` - - // Unique across all Services user-defined name. - ServiceName string `json:"service_name,omitempty"` - - // Node identifier where this instance runs. - NodeID string `json:"node_id,omitempty"` - - // Access address (DNS name or IP). - // Address (and port) or socket is required. - Address string `json:"address,omitempty"` - - // Access port. - // Port is required when the address present. - Port int64 `json:"port,omitempty"` - - // Access unix socket. - // Address (and port) or socket is required. - Socket string `json:"socket,omitempty"` - - // Environment name. - Environment string `json:"environment,omitempty"` - - // Cluster name. - Cluster string `json:"cluster,omitempty"` - - // Replication set name. - ReplicationSet string `json:"replication_set,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // Valkey version. - Version string `json:"version,omitempty"` -} - -// Validate validates this get service OK body valkey -func (o *GetServiceOKBodyValkey) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get service OK body valkey based on context it is used -func (o *GetServiceOKBodyValkey) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetServiceOKBodyValkey) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetServiceOKBodyValkey) UnmarshalBinary(b []byte) error { - var res GetServiceOKBodyValkey - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/inventory/v1/json/client/services_service/list_active_service_types_parameters.go b/api/inventory/v1/json/client/services_service/list_active_service_types_parameters.go deleted file mode 100644 index 9415db910a0..00000000000 --- a/api/inventory/v1/json/client/services_service/list_active_service_types_parameters.go +++ /dev/null @@ -1,146 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package services_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" -) - -// NewListActiveServiceTypesParams creates a new ListActiveServiceTypesParams 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 NewListActiveServiceTypesParams() *ListActiveServiceTypesParams { - return &ListActiveServiceTypesParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListActiveServiceTypesParamsWithTimeout creates a new ListActiveServiceTypesParams object -// with the ability to set a timeout on a request. -func NewListActiveServiceTypesParamsWithTimeout(timeout time.Duration) *ListActiveServiceTypesParams { - return &ListActiveServiceTypesParams{ - timeout: timeout, - } -} - -// NewListActiveServiceTypesParamsWithContext creates a new ListActiveServiceTypesParams object -// with the ability to set a context for a request. -func NewListActiveServiceTypesParamsWithContext(ctx context.Context) *ListActiveServiceTypesParams { - return &ListActiveServiceTypesParams{ - Context: ctx, - } -} - -// NewListActiveServiceTypesParamsWithHTTPClient creates a new ListActiveServiceTypesParams object -// with the ability to set a custom HTTPClient for a request. -func NewListActiveServiceTypesParamsWithHTTPClient(client *http.Client) *ListActiveServiceTypesParams { - return &ListActiveServiceTypesParams{ - HTTPClient: client, - } -} - -/* -ListActiveServiceTypesParams contains all the parameters to send to the API endpoint - - for the list active service types operation. - - Typically these are written to a http.Request. -*/ -type ListActiveServiceTypesParams struct { - // Body. - Body any - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list active service types params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListActiveServiceTypesParams) WithDefaults() *ListActiveServiceTypesParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list active service types params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListActiveServiceTypesParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list active service types params -func (o *ListActiveServiceTypesParams) WithTimeout(timeout time.Duration) *ListActiveServiceTypesParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list active service types params -func (o *ListActiveServiceTypesParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list active service types params -func (o *ListActiveServiceTypesParams) WithContext(ctx context.Context) *ListActiveServiceTypesParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list active service types params -func (o *ListActiveServiceTypesParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list active service types params -func (o *ListActiveServiceTypesParams) WithHTTPClient(client *http.Client) *ListActiveServiceTypesParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list active service types params -func (o *ListActiveServiceTypesParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the list active service types params -func (o *ListActiveServiceTypesParams) WithBody(body any) *ListActiveServiceTypesParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the list active service types params -func (o *ListActiveServiceTypesParams) SetBody(body any) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *ListActiveServiceTypesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/api/inventory/v1/json/client/services_service/list_active_service_types_responses.go b/api/inventory/v1/json/client/services_service/list_active_service_types_responses.go deleted file mode 100644 index d973352a1e6..00000000000 --- a/api/inventory/v1/json/client/services_service/list_active_service_types_responses.go +++ /dev/null @@ -1,502 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package services_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" -) - -// ListActiveServiceTypesReader is a Reader for the ListActiveServiceTypes structure. -type ListActiveServiceTypesReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListActiveServiceTypesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewListActiveServiceTypesOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewListActiveServiceTypesDefault(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 - } -} - -// NewListActiveServiceTypesOK creates a ListActiveServiceTypesOK with default headers values -func NewListActiveServiceTypesOK() *ListActiveServiceTypesOK { - return &ListActiveServiceTypesOK{} -} - -/* -ListActiveServiceTypesOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type ListActiveServiceTypesOK struct { - Payload *ListActiveServiceTypesOKBody -} - -// IsSuccess returns true when this list active service types Ok response has a 2xx status code -func (o *ListActiveServiceTypesOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this list active service types Ok response has a 3xx status code -func (o *ListActiveServiceTypesOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this list active service types Ok response has a 4xx status code -func (o *ListActiveServiceTypesOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this list active service types Ok response has a 5xx status code -func (o *ListActiveServiceTypesOK) IsServerError() bool { - return false -} - -// IsCode returns true when this list active service types Ok response a status code equal to that given -func (o *ListActiveServiceTypesOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the list active service types Ok response -func (o *ListActiveServiceTypesOK) Code() int { - return 200 -} - -func (o *ListActiveServiceTypesOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/inventory/services:getTypes][%d] listActiveServiceTypesOk %s", 200, payload) -} - -func (o *ListActiveServiceTypesOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/inventory/services:getTypes][%d] listActiveServiceTypesOk %s", 200, payload) -} - -func (o *ListActiveServiceTypesOK) GetPayload() *ListActiveServiceTypesOKBody { - return o.Payload -} - -func (o *ListActiveServiceTypesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(ListActiveServiceTypesOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -// NewListActiveServiceTypesDefault creates a ListActiveServiceTypesDefault with default headers values -func NewListActiveServiceTypesDefault(code int) *ListActiveServiceTypesDefault { - return &ListActiveServiceTypesDefault{ - _statusCode: code, - } -} - -/* -ListActiveServiceTypesDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type ListActiveServiceTypesDefault struct { - _statusCode int - - Payload *ListActiveServiceTypesDefaultBody -} - -// IsSuccess returns true when this list active service types default response has a 2xx status code -func (o *ListActiveServiceTypesDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this list active service types default response has a 3xx status code -func (o *ListActiveServiceTypesDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this list active service types default response has a 4xx status code -func (o *ListActiveServiceTypesDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this list active service types default response has a 5xx status code -func (o *ListActiveServiceTypesDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this list active service types default response a status code equal to that given -func (o *ListActiveServiceTypesDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the list active service types default response -func (o *ListActiveServiceTypesDefault) Code() int { - return o._statusCode -} - -func (o *ListActiveServiceTypesDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/inventory/services:getTypes][%d] ListActiveServiceTypes default %s", o._statusCode, payload) -} - -func (o *ListActiveServiceTypesDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/inventory/services:getTypes][%d] ListActiveServiceTypes default %s", o._statusCode, payload) -} - -func (o *ListActiveServiceTypesDefault) GetPayload() *ListActiveServiceTypesDefaultBody { - return o.Payload -} - -func (o *ListActiveServiceTypesDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(ListActiveServiceTypesDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -ListActiveServiceTypesDefaultBody list active service types default body -swagger:model ListActiveServiceTypesDefaultBody -*/ -type ListActiveServiceTypesDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*ListActiveServiceTypesDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this list active service types default body -func (o *ListActiveServiceTypesDefaultBody) 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 *ListActiveServiceTypesDefaultBody) 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("ListActiveServiceTypes default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("ListActiveServiceTypes default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this list active service types default body based on the context it is used -func (o *ListActiveServiceTypesDefaultBody) 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 *ListActiveServiceTypesDefaultBody) 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("ListActiveServiceTypes default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("ListActiveServiceTypes default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListActiveServiceTypesDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListActiveServiceTypesDefaultBody) UnmarshalBinary(b []byte) error { - var res ListActiveServiceTypesDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListActiveServiceTypesDefaultBodyDetailsItems0 list active service types default body details items0 -swagger:model ListActiveServiceTypesDefaultBodyDetailsItems0 -*/ -type ListActiveServiceTypesDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` - - // list active service types default body details items0 - ListActiveServiceTypesDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *ListActiveServiceTypesDefaultBodyDetailsItems0) 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 ListActiveServiceTypesDefaultBodyDetailsItems0 - - 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.ListActiveServiceTypesDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o ListActiveServiceTypesDefaultBodyDetailsItems0) 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.ListActiveServiceTypesDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.ListActiveServiceTypesDefaultBodyDetailsItems0) - 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 list active service types default body details items0 -func (o *ListActiveServiceTypesDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list active service types default body details items0 based on context it is used -func (o *ListActiveServiceTypesDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListActiveServiceTypesDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListActiveServiceTypesDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res ListActiveServiceTypesDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListActiveServiceTypesOKBody list active service types OK body -swagger:model ListActiveServiceTypesOKBody -*/ -type ListActiveServiceTypesOKBody struct { - // service types - ServiceTypes []*string `json:"service_types"` -} - -// Validate validates this list active service types OK body -func (o *ListActiveServiceTypesOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateServiceTypes(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var listActiveServiceTypesOkBodyServiceTypesItemsEnum []any - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["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"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - listActiveServiceTypesOkBodyServiceTypesItemsEnum = append(listActiveServiceTypesOkBodyServiceTypesItemsEnum, v) - } -} - -func (o *ListActiveServiceTypesOKBody) validateServiceTypesItemsEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, listActiveServiceTypesOkBodyServiceTypesItemsEnum, true); err != nil { - return err - } - return nil -} - -func (o *ListActiveServiceTypesOKBody) validateServiceTypes(formats strfmt.Registry) error { - if swag.IsZero(o.ServiceTypes) { // not required - return nil - } - - for i := 0; i < len(o.ServiceTypes); i++ { - if swag.IsZero(o.ServiceTypes[i]) { // not required - continue - } - - // value enum - if err := o.validateServiceTypesItemsEnum("listActiveServiceTypesOk"+"."+"service_types"+"."+strconv.Itoa(i), "body", *o.ServiceTypes[i]); err != nil { - return err - } - - } - - return nil -} - -// ContextValidate validates this list active service types OK body based on context it is used -func (o *ListActiveServiceTypesOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListActiveServiceTypesOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListActiveServiceTypesOKBody) UnmarshalBinary(b []byte) error { - var res ListActiveServiceTypesOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/inventory/v1/json/client/services_service/list_services_parameters.go b/api/inventory/v1/json/client/services_service/list_services_parameters.go deleted file mode 100644 index 2173e7e1824..00000000000 --- a/api/inventory/v1/json/client/services_service/list_services_parameters.go +++ /dev/null @@ -1,237 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package services_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" -) - -// NewListServicesParams creates a new ListServicesParams 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 NewListServicesParams() *ListServicesParams { - return &ListServicesParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListServicesParamsWithTimeout creates a new ListServicesParams object -// with the ability to set a timeout on a request. -func NewListServicesParamsWithTimeout(timeout time.Duration) *ListServicesParams { - return &ListServicesParams{ - timeout: timeout, - } -} - -// NewListServicesParamsWithContext creates a new ListServicesParams object -// with the ability to set a context for a request. -func NewListServicesParamsWithContext(ctx context.Context) *ListServicesParams { - return &ListServicesParams{ - Context: ctx, - } -} - -// NewListServicesParamsWithHTTPClient creates a new ListServicesParams object -// with the ability to set a custom HTTPClient for a request. -func NewListServicesParamsWithHTTPClient(client *http.Client) *ListServicesParams { - return &ListServicesParams{ - HTTPClient: client, - } -} - -/* -ListServicesParams contains all the parameters to send to the API endpoint - - for the list services operation. - - Typically these are written to a http.Request. -*/ -type ListServicesParams struct { - /* ExternalGroup. - - Return only services in this external group. - */ - ExternalGroup *string - - /* NodeID. - - Return only Services running on that Node. - */ - NodeID *string - - /* ServiceType. - - Return only services filtered by service type. - - Default: "SERVICE_TYPE_UNSPECIFIED" - */ - ServiceType *string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list services params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListServicesParams) WithDefaults() *ListServicesParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list services params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListServicesParams) SetDefaults() { - serviceTypeDefault := string("SERVICE_TYPE_UNSPECIFIED") - - val := ListServicesParams{ - ServiceType: &serviceTypeDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the list services params -func (o *ListServicesParams) WithTimeout(timeout time.Duration) *ListServicesParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list services params -func (o *ListServicesParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list services params -func (o *ListServicesParams) WithContext(ctx context.Context) *ListServicesParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list services params -func (o *ListServicesParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list services params -func (o *ListServicesParams) WithHTTPClient(client *http.Client) *ListServicesParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list services params -func (o *ListServicesParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithExternalGroup adds the externalGroup to the list services params -func (o *ListServicesParams) WithExternalGroup(externalGroup *string) *ListServicesParams { - o.SetExternalGroup(externalGroup) - return o -} - -// SetExternalGroup adds the externalGroup to the list services params -func (o *ListServicesParams) SetExternalGroup(externalGroup *string) { - o.ExternalGroup = externalGroup -} - -// WithNodeID adds the nodeID to the list services params -func (o *ListServicesParams) WithNodeID(nodeID *string) *ListServicesParams { - o.SetNodeID(nodeID) - return o -} - -// SetNodeID adds the nodeId to the list services params -func (o *ListServicesParams) SetNodeID(nodeID *string) { - o.NodeID = nodeID -} - -// WithServiceType adds the serviceType to the list services params -func (o *ListServicesParams) WithServiceType(serviceType *string) *ListServicesParams { - o.SetServiceType(serviceType) - return o -} - -// SetServiceType adds the serviceType to the list services params -func (o *ListServicesParams) SetServiceType(serviceType *string) { - o.ServiceType = serviceType -} - -// 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 - } - var res []error - - if o.ExternalGroup != nil { - - // query param external_group - var qrExternalGroup string - - if o.ExternalGroup != nil { - qrExternalGroup = *o.ExternalGroup - } - qExternalGroup := qrExternalGroup - if qExternalGroup != "" { - if err := r.SetQueryParam("external_group", qExternalGroup); err != nil { - return err - } - } - } - - if o.NodeID != nil { - - // query param node_id - var qrNodeID string - - if o.NodeID != nil { - qrNodeID = *o.NodeID - } - qNodeID := qrNodeID - if qNodeID != "" { - if err := r.SetQueryParam("node_id", qNodeID); err != nil { - return err - } - } - } - - if o.ServiceType != nil { - - // query param service_type - var qrServiceType string - - if o.ServiceType != nil { - qrServiceType = *o.ServiceType - } - qServiceType := qrServiceType - if qServiceType != "" { - if err := r.SetQueryParam("service_type", qServiceType); err != nil { - return err - } - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/api/inventory/v1/json/client/services_service/list_services_responses.go b/api/inventory/v1/json/client/services_service/list_services_responses.go deleted file mode 100644 index 30514f2a1a7..00000000000 --- a/api/inventory/v1/json/client/services_service/list_services_responses.go +++ /dev/null @@ -1,1401 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package services_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" -) - -// ListServicesReader is a Reader for the ListServices structure. -type ListServicesReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListServicesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewListServicesOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewListServicesDefault(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 - } -} - -// NewListServicesOK creates a ListServicesOK with default headers values -func NewListServicesOK() *ListServicesOK { - return &ListServicesOK{} -} - -/* -ListServicesOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type ListServicesOK struct { - Payload *ListServicesOKBody -} - -// IsSuccess returns true when this list services Ok response has a 2xx status code -func (o *ListServicesOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this list services Ok response has a 3xx status code -func (o *ListServicesOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this list services Ok response has a 4xx status code -func (o *ListServicesOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this list services Ok response has a 5xx status code -func (o *ListServicesOK) IsServerError() bool { - return false -} - -// IsCode returns true when this list services Ok response a status code equal to that given -func (o *ListServicesOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the list services Ok response -func (o *ListServicesOK) Code() int { - return 200 -} - -func (o *ListServicesOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/inventory/services][%d] listServicesOk %s", 200, payload) -} - -func (o *ListServicesOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/inventory/services][%d] listServicesOk %s", 200, payload) -} - -func (o *ListServicesOK) GetPayload() *ListServicesOKBody { - return o.Payload -} - -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) { - return err - } - - return nil -} - -// NewListServicesDefault creates a ListServicesDefault with default headers values -func NewListServicesDefault(code int) *ListServicesDefault { - return &ListServicesDefault{ - _statusCode: code, - } -} - -/* -ListServicesDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type ListServicesDefault struct { - _statusCode int - - Payload *ListServicesDefaultBody -} - -// IsSuccess returns true when this list services default response has a 2xx status code -func (o *ListServicesDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this list services default response has a 3xx status code -func (o *ListServicesDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this list services default response has a 4xx status code -func (o *ListServicesDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this list services default response has a 5xx status code -func (o *ListServicesDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this list services default response a status code equal to that given -func (o *ListServicesDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the list services default response -func (o *ListServicesDefault) Code() int { - return o._statusCode -} - -func (o *ListServicesDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/inventory/services][%d] ListServices default %s", o._statusCode, payload) -} - -func (o *ListServicesDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/inventory/services][%d] ListServices default %s", o._statusCode, payload) -} - -func (o *ListServicesDefault) GetPayload() *ListServicesDefaultBody { - return o.Payload -} - -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) { - return err - } - - return nil -} - -/* -ListServicesDefaultBody list services default body -swagger:model ListServicesDefaultBody -*/ -type ListServicesDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*ListServicesDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this list services default body -func (o *ListServicesDefaultBody) 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 *ListServicesDefaultBody) 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("ListServices default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("ListServices default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this list services default body based on the context it is used -func (o *ListServicesDefaultBody) 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 *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 - return nil - } - - if err := o.Details[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("ListServices default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("ListServices default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListServicesDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListServicesDefaultBody) UnmarshalBinary(b []byte) error { - var res ListServicesDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -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:"-"` -} - -// 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"` - } - if err := json.Unmarshal(data, &stage1); err != nil { - return err - } - var rcv ListServicesDefaultBodyDetailsItems0 - - 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.ListServicesDefaultBodyDetailsItems0 = result - } - - return nil -} - -// 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"` - } - - stage1.AtType = o.AtType - - // make JSON object for known properties - props, err := json.Marshal(stage1) - if err != nil { - return nil, err - } - - if len(o.ListServicesDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.ListServicesDefaultBodyDetailsItems0) - 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 list services default body details items0 -func (o *ListServicesDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list services default body details items0 based on context it is used -func (o *ListServicesDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListServicesDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListServicesDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res ListServicesDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListServicesOKBody list services OK body -swagger:model ListServicesOKBody -*/ -type ListServicesOKBody struct { - // mysql - Mysql []*ListServicesOKBodyMysqlItems0 `json:"mysql"` - - // mongodb - Mongodb []*ListServicesOKBodyMongodbItems0 `json:"mongodb"` - - // postgresql - Postgresql []*ListServicesOKBodyPostgresqlItems0 `json:"postgresql"` - - // proxysql - Proxysql []*ListServicesOKBodyProxysqlItems0 `json:"proxysql"` - - // haproxy - Haproxy []*ListServicesOKBodyHaproxyItems0 `json:"haproxy"` - - // external - External []*ListServicesOKBodyExternalItems0 `json:"external"` - - // valkey - Valkey []*ListServicesOKBodyValkeyItems0 `json:"valkey"` -} - -// Validate validates this list services OK body -func (o *ListServicesOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateMysql(formats); err != nil { - res = append(res, err) - } - - if err := o.validateMongodb(formats); err != nil { - res = append(res, err) - } - - if err := o.validatePostgresql(formats); err != nil { - res = append(res, err) - } - - if err := o.validateProxysql(formats); err != nil { - res = append(res, err) - } - - if err := o.validateHaproxy(formats); err != nil { - res = append(res, err) - } - - if err := o.validateExternal(formats); err != nil { - res = append(res, err) - } - - if err := o.validateValkey(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListServicesOKBody) validateMysql(formats strfmt.Registry) error { - if swag.IsZero(o.Mysql) { // not required - return nil - } - - for i := 0; i < len(o.Mysql); i++ { - if swag.IsZero(o.Mysql[i]) { // not required - continue - } - - if o.Mysql[i] != nil { - if err := o.Mysql[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listServicesOk" + "." + "mysql" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listServicesOk" + "." + "mysql" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -func (o *ListServicesOKBody) validateMongodb(formats strfmt.Registry) error { - if swag.IsZero(o.Mongodb) { // not required - return nil - } - - for i := 0; i < len(o.Mongodb); i++ { - if swag.IsZero(o.Mongodb[i]) { // not required - continue - } - - if o.Mongodb[i] != nil { - if err := o.Mongodb[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listServicesOk" + "." + "mongodb" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listServicesOk" + "." + "mongodb" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -func (o *ListServicesOKBody) validatePostgresql(formats strfmt.Registry) error { - if swag.IsZero(o.Postgresql) { // not required - return nil - } - - for i := 0; i < len(o.Postgresql); i++ { - if swag.IsZero(o.Postgresql[i]) { // not required - continue - } - - if o.Postgresql[i] != nil { - if err := o.Postgresql[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listServicesOk" + "." + "postgresql" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listServicesOk" + "." + "postgresql" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -func (o *ListServicesOKBody) validateProxysql(formats strfmt.Registry) error { - if swag.IsZero(o.Proxysql) { // not required - return nil - } - - for i := 0; i < len(o.Proxysql); i++ { - if swag.IsZero(o.Proxysql[i]) { // not required - continue - } - - if o.Proxysql[i] != nil { - if err := o.Proxysql[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listServicesOk" + "." + "proxysql" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listServicesOk" + "." + "proxysql" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -func (o *ListServicesOKBody) validateHaproxy(formats strfmt.Registry) error { - if swag.IsZero(o.Haproxy) { // not required - return nil - } - - for i := 0; i < len(o.Haproxy); i++ { - if swag.IsZero(o.Haproxy[i]) { // not required - continue - } - - if o.Haproxy[i] != nil { - if err := o.Haproxy[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listServicesOk" + "." + "haproxy" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listServicesOk" + "." + "haproxy" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -func (o *ListServicesOKBody) validateExternal(formats strfmt.Registry) error { - if swag.IsZero(o.External) { // not required - return nil - } - - for i := 0; i < len(o.External); i++ { - if swag.IsZero(o.External[i]) { // not required - continue - } - - if o.External[i] != nil { - if err := o.External[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listServicesOk" + "." + "external" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listServicesOk" + "." + "external" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -func (o *ListServicesOKBody) validateValkey(formats strfmt.Registry) error { - if swag.IsZero(o.Valkey) { // not required - return nil - } - - for i := 0; i < len(o.Valkey); i++ { - if swag.IsZero(o.Valkey[i]) { // not required - continue - } - - if o.Valkey[i] != nil { - if err := o.Valkey[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listServicesOk" + "." + "valkey" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listServicesOk" + "." + "valkey" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this list services OK body based on the context it is used -func (o *ListServicesOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateMysql(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateMongodb(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidatePostgresql(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateProxysql(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateHaproxy(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateExternal(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateValkey(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListServicesOKBody) contextValidateMysql(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Mysql); i++ { - if o.Mysql[i] != nil { - - if swag.IsZero(o.Mysql[i]) { // not required - return nil - } - - if err := o.Mysql[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listServicesOk" + "." + "mysql" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listServicesOk" + "." + "mysql" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -func (o *ListServicesOKBody) contextValidateMongodb(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Mongodb); i++ { - if o.Mongodb[i] != nil { - - if swag.IsZero(o.Mongodb[i]) { // not required - return nil - } - - if err := o.Mongodb[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listServicesOk" + "." + "mongodb" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listServicesOk" + "." + "mongodb" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -func (o *ListServicesOKBody) contextValidatePostgresql(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Postgresql); i++ { - if o.Postgresql[i] != nil { - - if swag.IsZero(o.Postgresql[i]) { // not required - return nil - } - - if err := o.Postgresql[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listServicesOk" + "." + "postgresql" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listServicesOk" + "." + "postgresql" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -func (o *ListServicesOKBody) contextValidateProxysql(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Proxysql); i++ { - if o.Proxysql[i] != nil { - - if swag.IsZero(o.Proxysql[i]) { // not required - return nil - } - - if err := o.Proxysql[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listServicesOk" + "." + "proxysql" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listServicesOk" + "." + "proxysql" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -func (o *ListServicesOKBody) contextValidateHaproxy(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Haproxy); i++ { - if o.Haproxy[i] != nil { - - if swag.IsZero(o.Haproxy[i]) { // not required - return nil - } - - if err := o.Haproxy[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listServicesOk" + "." + "haproxy" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listServicesOk" + "." + "haproxy" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -func (o *ListServicesOKBody) contextValidateExternal(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.External); i++ { - if o.External[i] != nil { - - if swag.IsZero(o.External[i]) { // not required - return nil - } - - if err := o.External[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listServicesOk" + "." + "external" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listServicesOk" + "." + "external" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -func (o *ListServicesOKBody) contextValidateValkey(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Valkey); i++ { - if o.Valkey[i] != nil { - - if swag.IsZero(o.Valkey[i]) { // not required - return nil - } - - if err := o.Valkey[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listServicesOk" + "." + "valkey" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listServicesOk" + "." + "valkey" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListServicesOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListServicesOKBody) UnmarshalBinary(b []byte) error { - var res ListServicesOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListServicesOKBodyExternalItems0 ExternalService represents a generic External service instance. -swagger:model ListServicesOKBodyExternalItems0 -*/ -type ListServicesOKBodyExternalItems0 struct { - // Unique randomly generated instance identifier. - ServiceID string `json:"service_id,omitempty"` - - // Unique across all Services user-defined name. - ServiceName string `json:"service_name,omitempty"` - - // Node identifier where this service instance runs. - NodeID string `json:"node_id,omitempty"` - - // Environment name. - Environment string `json:"environment,omitempty"` - - // Cluster name. - Cluster string `json:"cluster,omitempty"` - - // Replication set name. - ReplicationSet string `json:"replication_set,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // Group name of external service. - Group string `json:"group,omitempty"` -} - -// Validate validates this list services OK body external items0 -func (o *ListServicesOKBodyExternalItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list services OK body external items0 based on context it is used -func (o *ListServicesOKBodyExternalItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListServicesOKBodyExternalItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListServicesOKBodyExternalItems0) UnmarshalBinary(b []byte) error { - var res ListServicesOKBodyExternalItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListServicesOKBodyHaproxyItems0 HAProxyService represents a generic HAProxy service instance. -swagger:model ListServicesOKBodyHaproxyItems0 -*/ -type ListServicesOKBodyHaproxyItems0 struct { - // Unique randomly generated instance identifier. - ServiceID string `json:"service_id,omitempty"` - - // Unique across all Services user-defined name. - ServiceName string `json:"service_name,omitempty"` - - // Node identifier where this service instance runs. - NodeID string `json:"node_id,omitempty"` - - // Environment name. - Environment string `json:"environment,omitempty"` - - // Cluster name. - Cluster string `json:"cluster,omitempty"` - - // Replication set name. - ReplicationSet string `json:"replication_set,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` -} - -// Validate validates this list services OK body haproxy items0 -func (o *ListServicesOKBodyHaproxyItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list services OK body haproxy items0 based on context it is used -func (o *ListServicesOKBodyHaproxyItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListServicesOKBodyHaproxyItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListServicesOKBodyHaproxyItems0) UnmarshalBinary(b []byte) error { - var res ListServicesOKBodyHaproxyItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListServicesOKBodyMongodbItems0 MongoDBService represents a generic MongoDB instance. -swagger:model ListServicesOKBodyMongodbItems0 -*/ -type ListServicesOKBodyMongodbItems0 struct { - // Unique randomly generated instance identifier. - ServiceID string `json:"service_id,omitempty"` - - // Unique across all Services user-defined name. - ServiceName string `json:"service_name,omitempty"` - - // Node identifier where this instance runs. - NodeID string `json:"node_id,omitempty"` - - // Access address (DNS name or IP). - // Address (and port) or socket is required. - Address string `json:"address,omitempty"` - - // Access port. - // Port is required when the address present. - Port int64 `json:"port,omitempty"` - - // Access unix socket. - // Address (and port) or socket is required. - Socket string `json:"socket,omitempty"` - - // Environment name. - Environment string `json:"environment,omitempty"` - - // Cluster name. - Cluster string `json:"cluster,omitempty"` - - // Replication set name. - ReplicationSet string `json:"replication_set,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // MongoDB version. - Version string `json:"version,omitempty"` -} - -// Validate validates this list services OK body mongodb items0 -func (o *ListServicesOKBodyMongodbItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list services OK body mongodb items0 based on context it is used -func (o *ListServicesOKBodyMongodbItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListServicesOKBodyMongodbItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListServicesOKBodyMongodbItems0) UnmarshalBinary(b []byte) error { - var res ListServicesOKBodyMongodbItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListServicesOKBodyMysqlItems0 MySQLService represents a generic MySQL instance. -swagger:model ListServicesOKBodyMysqlItems0 -*/ -type ListServicesOKBodyMysqlItems0 struct { - // Unique randomly generated instance identifier. - ServiceID string `json:"service_id,omitempty"` - - // Unique across all Services user-defined name. - ServiceName string `json:"service_name,omitempty"` - - // Node identifier where this instance runs. - NodeID string `json:"node_id,omitempty"` - - // Access address (DNS name or IP). - // Address (and port) or socket is required. - Address string `json:"address,omitempty"` - - // Access port. - // Port is required when the address present. - Port int64 `json:"port,omitempty"` - - // Access unix socket. - // Address (and port) or socket is required. - Socket string `json:"socket,omitempty"` - - // Environment name. - Environment string `json:"environment,omitempty"` - - // Cluster name. - Cluster string `json:"cluster,omitempty"` - - // Replication set name. - ReplicationSet string `json:"replication_set,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // MySQL version. - Version string `json:"version,omitempty"` - - // Extra parameters to be added to the DSN. - ExtraDsnParams map[string]string `json:"extra_dsn_params,omitempty"` -} - -// Validate validates this list services OK body mysql items0 -func (o *ListServicesOKBodyMysqlItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list services OK body mysql items0 based on context it is used -func (o *ListServicesOKBodyMysqlItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListServicesOKBodyMysqlItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListServicesOKBodyMysqlItems0) UnmarshalBinary(b []byte) error { - var res ListServicesOKBodyMysqlItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListServicesOKBodyPostgresqlItems0 PostgreSQLService represents a generic PostgreSQL instance. -swagger:model ListServicesOKBodyPostgresqlItems0 -*/ -type ListServicesOKBodyPostgresqlItems0 struct { - // Unique randomly generated instance identifier. - ServiceID string `json:"service_id,omitempty"` - - // Unique across all Services user-defined name. - ServiceName string `json:"service_name,omitempty"` - - // Database name. - DatabaseName string `json:"database_name,omitempty"` - - // Node identifier where this instance runs. - NodeID string `json:"node_id,omitempty"` - - // Access address (DNS name or IP). - // Address (and port) or socket is required. - Address string `json:"address,omitempty"` - - // Access port. - // Port is required when the address present. - Port int64 `json:"port,omitempty"` - - // Access unix socket. - // Address (and port) or socket is required. - Socket string `json:"socket,omitempty"` - - // Environment name. - Environment string `json:"environment,omitempty"` - - // Cluster name. - Cluster string `json:"cluster,omitempty"` - - // Replication set name. - ReplicationSet string `json:"replication_set,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // PostgreSQL version. - Version string `json:"version,omitempty"` - - // Limit of databases for auto-discovery. - AutoDiscoveryLimit int32 `json:"auto_discovery_limit,omitempty"` -} - -// Validate validates this list services OK body postgresql items0 -func (o *ListServicesOKBodyPostgresqlItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list services OK body postgresql items0 based on context it is used -func (o *ListServicesOKBodyPostgresqlItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListServicesOKBodyPostgresqlItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListServicesOKBodyPostgresqlItems0) UnmarshalBinary(b []byte) error { - var res ListServicesOKBodyPostgresqlItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListServicesOKBodyProxysqlItems0 ProxySQLService represents a generic ProxySQL instance. -swagger:model ListServicesOKBodyProxysqlItems0 -*/ -type ListServicesOKBodyProxysqlItems0 struct { - // Unique randomly generated instance identifier. - ServiceID string `json:"service_id,omitempty"` - - // Unique across all Services user-defined name. - ServiceName string `json:"service_name,omitempty"` - - // Node identifier where this instance runs. - NodeID string `json:"node_id,omitempty"` - - // Access address (DNS name or IP). - // Address (and port) or socket is required. - Address string `json:"address,omitempty"` - - // Access port. - // Port is required when the address present. - Port int64 `json:"port,omitempty"` - - // Access unix socket. - // Address (and port) or socket is required. - Socket string `json:"socket,omitempty"` - - // Environment name. - Environment string `json:"environment,omitempty"` - - // Cluster name. - Cluster string `json:"cluster,omitempty"` - - // Replication set name. - ReplicationSet string `json:"replication_set,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // ProxySQL version. - Version string `json:"version,omitempty"` -} - -// Validate validates this list services OK body proxysql items0 -func (o *ListServicesOKBodyProxysqlItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list services OK body proxysql items0 based on context it is used -func (o *ListServicesOKBodyProxysqlItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListServicesOKBodyProxysqlItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListServicesOKBodyProxysqlItems0) UnmarshalBinary(b []byte) error { - var res ListServicesOKBodyProxysqlItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListServicesOKBodyValkeyItems0 ValkeyService represents a generic Valkey instance. -swagger:model ListServicesOKBodyValkeyItems0 -*/ -type ListServicesOKBodyValkeyItems0 struct { - // Unique randomly generated instance identifier. - ServiceID string `json:"service_id,omitempty"` - - // Unique across all Services user-defined name. - ServiceName string `json:"service_name,omitempty"` - - // Node identifier where this instance runs. - NodeID string `json:"node_id,omitempty"` - - // Access address (DNS name or IP). - // Address (and port) or socket is required. - Address string `json:"address,omitempty"` - - // Access port. - // Port is required when the address present. - Port int64 `json:"port,omitempty"` - - // Access unix socket. - // Address (and port) or socket is required. - Socket string `json:"socket,omitempty"` - - // Environment name. - Environment string `json:"environment,omitempty"` - - // Cluster name. - Cluster string `json:"cluster,omitempty"` - - // Replication set name. - ReplicationSet string `json:"replication_set,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // Valkey version. - Version string `json:"version,omitempty"` -} - -// Validate validates this list services OK body valkey items0 -func (o *ListServicesOKBodyValkeyItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list services OK body valkey items0 based on context it is used -func (o *ListServicesOKBodyValkeyItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListServicesOKBodyValkeyItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListServicesOKBodyValkeyItems0) UnmarshalBinary(b []byte) error { - var res ListServicesOKBodyValkeyItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/inventory/v1/json/client/services_service/remove_service_parameters.go b/api/inventory/v1/json/client/services_service/remove_service_parameters.go deleted file mode 100644 index 876f2945e99..00000000000 --- a/api/inventory/v1/json/client/services_service/remove_service_parameters.go +++ /dev/null @@ -1,183 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package services_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" - "github.com/go-openapi/swag" -) - -// NewRemoveServiceParams creates a new RemoveServiceParams 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 NewRemoveServiceParams() *RemoveServiceParams { - return &RemoveServiceParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewRemoveServiceParamsWithTimeout creates a new RemoveServiceParams object -// with the ability to set a timeout on a request. -func NewRemoveServiceParamsWithTimeout(timeout time.Duration) *RemoveServiceParams { - return &RemoveServiceParams{ - timeout: timeout, - } -} - -// NewRemoveServiceParamsWithContext creates a new RemoveServiceParams object -// with the ability to set a context for a request. -func NewRemoveServiceParamsWithContext(ctx context.Context) *RemoveServiceParams { - return &RemoveServiceParams{ - Context: ctx, - } -} - -// NewRemoveServiceParamsWithHTTPClient creates a new RemoveServiceParams object -// with the ability to set a custom HTTPClient for a request. -func NewRemoveServiceParamsWithHTTPClient(client *http.Client) *RemoveServiceParams { - return &RemoveServiceParams{ - HTTPClient: client, - } -} - -/* -RemoveServiceParams contains all the parameters to send to the API endpoint - - for the remove service operation. - - Typically these are written to a http.Request. -*/ -type RemoveServiceParams struct { - /* Force. - - Remove service with all dependencies. - */ - Force *bool - - /* ServiceID. - - Unique randomly generated instance identifier. Required. - */ - ServiceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the remove service params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *RemoveServiceParams) WithDefaults() *RemoveServiceParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the remove service params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *RemoveServiceParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the remove service params -func (o *RemoveServiceParams) WithTimeout(timeout time.Duration) *RemoveServiceParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the remove service params -func (o *RemoveServiceParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the remove service params -func (o *RemoveServiceParams) WithContext(ctx context.Context) *RemoveServiceParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the remove service params -func (o *RemoveServiceParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the remove service params -func (o *RemoveServiceParams) WithHTTPClient(client *http.Client) *RemoveServiceParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the remove service params -func (o *RemoveServiceParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithForce adds the force to the remove service params -func (o *RemoveServiceParams) WithForce(force *bool) *RemoveServiceParams { - o.SetForce(force) - return o -} - -// SetForce adds the force to the remove service params -func (o *RemoveServiceParams) SetForce(force *bool) { - o.Force = force -} - -// WithServiceID adds the serviceID to the remove service params -func (o *RemoveServiceParams) WithServiceID(serviceID string) *RemoveServiceParams { - o.SetServiceID(serviceID) - return o -} - -// SetServiceID adds the serviceId to the remove service params -func (o *RemoveServiceParams) SetServiceID(serviceID string) { - o.ServiceID = serviceID -} - -// 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 - } - var res []error - - if o.Force != nil { - - // query param force - var qrForce bool - - if o.Force != nil { - qrForce = *o.Force - } - qForce := swag.FormatBool(qrForce) - if qForce != "" { - if err := r.SetQueryParam("force", qForce); err != nil { - return err - } - } - } - - // path param service_id - if err := r.SetPathParam("service_id", o.ServiceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/api/inventory/v1/json/client/services_service/remove_service_responses.go b/api/inventory/v1/json/client/services_service/remove_service_responses.go deleted file mode 100644 index 399b18b8cf9..00000000000 --- a/api/inventory/v1/json/client/services_service/remove_service_responses.go +++ /dev/null @@ -1,414 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package services_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" -) - -// RemoveServiceReader is a Reader for the RemoveService structure. -type RemoveServiceReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *RemoveServiceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewRemoveServiceOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewRemoveServiceDefault(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 - } -} - -// NewRemoveServiceOK creates a RemoveServiceOK with default headers values -func NewRemoveServiceOK() *RemoveServiceOK { - return &RemoveServiceOK{} -} - -/* -RemoveServiceOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type RemoveServiceOK struct { - Payload any -} - -// IsSuccess returns true when this remove service Ok response has a 2xx status code -func (o *RemoveServiceOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this remove service Ok response has a 3xx status code -func (o *RemoveServiceOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this remove service Ok response has a 4xx status code -func (o *RemoveServiceOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this remove service Ok response has a 5xx status code -func (o *RemoveServiceOK) IsServerError() bool { - return false -} - -// IsCode returns true when this remove service Ok response a status code equal to that given -func (o *RemoveServiceOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the remove service Ok response -func (o *RemoveServiceOK) Code() int { - return 200 -} - -func (o *RemoveServiceOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/inventory/services/{service_id}][%d] removeServiceOk %s", 200, payload) -} - -func (o *RemoveServiceOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/inventory/services/{service_id}][%d] removeServiceOk %s", 200, payload) -} - -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 && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -// NewRemoveServiceDefault creates a RemoveServiceDefault with default headers values -func NewRemoveServiceDefault(code int) *RemoveServiceDefault { - return &RemoveServiceDefault{ - _statusCode: code, - } -} - -/* -RemoveServiceDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type RemoveServiceDefault struct { - _statusCode int - - Payload *RemoveServiceDefaultBody -} - -// IsSuccess returns true when this remove service default response has a 2xx status code -func (o *RemoveServiceDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this remove service default response has a 3xx status code -func (o *RemoveServiceDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this remove service default response has a 4xx status code -func (o *RemoveServiceDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this remove service default response has a 5xx status code -func (o *RemoveServiceDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this remove service default response a status code equal to that given -func (o *RemoveServiceDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the remove service default response -func (o *RemoveServiceDefault) Code() int { - return o._statusCode -} - -func (o *RemoveServiceDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/inventory/services/{service_id}][%d] RemoveService default %s", o._statusCode, payload) -} - -func (o *RemoveServiceDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/inventory/services/{service_id}][%d] RemoveService default %s", o._statusCode, payload) -} - -func (o *RemoveServiceDefault) GetPayload() *RemoveServiceDefaultBody { - return o.Payload -} - -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) { - return err - } - - return nil -} - -/* -RemoveServiceDefaultBody remove service default body -swagger:model RemoveServiceDefaultBody -*/ -type RemoveServiceDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*RemoveServiceDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this remove service default body -func (o *RemoveServiceDefaultBody) 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 *RemoveServiceDefaultBody) 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("RemoveService default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("RemoveService default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this remove service default body based on the context it is used -func (o *RemoveServiceDefaultBody) 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 *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 - return nil - } - - if err := o.Details[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("RemoveService default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("RemoveService default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *RemoveServiceDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *RemoveServiceDefaultBody) UnmarshalBinary(b []byte) error { - var res RemoveServiceDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -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:"-"` -} - -// 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"` - } - if err := json.Unmarshal(data, &stage1); err != nil { - return err - } - var rcv RemoveServiceDefaultBodyDetailsItems0 - - 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.RemoveServiceDefaultBodyDetailsItems0 = result - } - - return nil -} - -// 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"` - } - - stage1.AtType = o.AtType - - // make JSON object for known properties - props, err := json.Marshal(stage1) - if err != nil { - return nil, err - } - - if len(o.RemoveServiceDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.RemoveServiceDefaultBodyDetailsItems0) - 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 remove service default body details items0 -func (o *RemoveServiceDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this remove service default body details items0 based on context it is used -func (o *RemoveServiceDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *RemoveServiceDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *RemoveServiceDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res RemoveServiceDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/inventory/v1/json/client/services_service/services_service_client.go b/api/inventory/v1/json/client/services_service/services_service_client.go deleted file mode 100644 index 253f88d29e4..00000000000 --- a/api/inventory/v1/json/client/services_service/services_service_client.go +++ /dev/null @@ -1,339 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package services_service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// New creates a new services service API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -// New creates a new services service API client with basic auth credentials. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - user: user for basic authentication header. -// - password: password for basic authentication header. -func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BasicAuth(user, password) - return &Client{transport: transport, formats: strfmt.Default} -} - -// New creates a new services service API client with a bearer token for authentication. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - bearerToken: bearer token for Bearer authentication header. -func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BearerToken(bearerToken) - return &Client{transport: transport, formats: strfmt.Default} -} - -/* -Client for services service API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption may be used to customize the behavior of Client methods. -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - AddService(params *AddServiceParams, opts ...ClientOption) (*AddServiceOK, error) - - ChangeService(params *ChangeServiceParams, opts ...ClientOption) (*ChangeServiceOK, error) - - GetService(params *GetServiceParams, opts ...ClientOption) (*GetServiceOK, error) - - ListActiveServiceTypes(params *ListActiveServiceTypesParams, opts ...ClientOption) (*ListActiveServiceTypesOK, error) - - ListServices(params *ListServicesParams, opts ...ClientOption) (*ListServicesOK, error) - - RemoveService(params *RemoveServiceParams, opts ...ClientOption) (*RemoveServiceOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -AddService adds a service - -Adds a Service. -*/ -func (a *Client) AddService(params *AddServiceParams, opts ...ClientOption) (*AddServiceOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewAddServiceParams() - } - op := &runtime.ClientOperation{ - ID: "AddService", - Method: "POST", - PathPattern: "/v1/inventory/services", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &AddServiceReader{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.(*AddServiceOK) - if ok { - return success, nil - } - - // 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()) -} - -/* -ChangeService changes service - -Changes service configuration. If a new cluster label is specified, it removes all backup/restore tasks scheduled for the related services. Fails if there are running backup/restore tasks. -*/ -func (a *Client) ChangeService(params *ChangeServiceParams, opts ...ClientOption) (*ChangeServiceOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewChangeServiceParams() - } - op := &runtime.ClientOperation{ - ID: "ChangeService", - Method: "PUT", - PathPattern: "/v1/inventory/services/{service_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &ChangeServiceReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - - // only one success response has to be checked - success, ok := result.(*ChangeServiceOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*ChangeServiceDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -GetService gets a service - -Returns a single Service by ID. -*/ -func (a *Client) GetService(params *GetServiceParams, opts ...ClientOption) (*GetServiceOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewGetServiceParams() - } - op := &runtime.ClientOperation{ - ID: "GetService", - Method: "GET", - PathPattern: "/v1/inventory/services/{service_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &GetServiceReader{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.(*GetServiceOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*GetServiceDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -ListActiveServiceTypes lists active service types - -Returns a list of active Service types. -*/ -func (a *Client) ListActiveServiceTypes(params *ListActiveServiceTypesParams, opts ...ClientOption) (*ListActiveServiceTypesOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewListActiveServiceTypesParams() - } - op := &runtime.ClientOperation{ - ID: "ListActiveServiceTypes", - Method: "POST", - PathPattern: "/v1/inventory/services:getTypes", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &ListActiveServiceTypesReader{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.(*ListActiveServiceTypesOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*ListActiveServiceTypesDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -ListServices lists services - -Returns a list of Services filtered by type. -*/ -func (a *Client) ListServices(params *ListServicesParams, opts ...ClientOption) (*ListServicesOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewListServicesParams() - } - op := &runtime.ClientOperation{ - ID: "ListServices", - Method: "GET", - PathPattern: "/v1/inventory/services", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &ListServicesReader{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.(*ListServicesOK) - if ok { - return success, nil - } - - // 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()) -} - -/* -RemoveService removes service - -Removes Service. -*/ -func (a *Client) RemoveService(params *RemoveServiceParams, opts ...ClientOption) (*RemoveServiceOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewRemoveServiceParams() - } - op := &runtime.ClientOperation{ - ID: "RemoveService", - Method: "DELETE", - PathPattern: "/v1/inventory/services/{service_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &RemoveServiceReader{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.(*RemoveServiceOK) - if ok { - return success, nil - } - - // 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()) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/api/inventory/v1/json/v1.json b/api/inventory/v1/json/v1.json deleted file mode 100644 index ecc1872f950..00000000000 --- a/api/inventory/v1/json/v1.json +++ /dev/null @@ -1,14144 +0,0 @@ -{ - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "schemes": [ - "https", - "http" - ], - "swagger": "2.0", - "info": { - "title": "PMM Inventory API", - "version": "v1" - }, - "paths": { - "/v1/inventory/agents": { - "get": { - "description": "Returns a list of all Agents.", - "tags": [ - "AgentsService" - ], - "summary": "List Agents", - "operationId": "ListAgents", - "parameters": [ - { - "type": "string", - "description": "Return only Agents started by this pmm-agent.\nExactly one of these parameters should be present: pmm_agent_id, node_id, service_id.", - "name": "pmm_agent_id", - "in": "query" - }, - { - "type": "string", - "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.", - "name": "node_id", - "in": "query" - }, - { - "type": "string", - "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.", - "name": "service_id", - "in": "query" - }, - { - "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" - ], - "type": "string", - "default": "AGENT_TYPE_UNSPECIFIED", - "description": "Return only agents of a particular type.", - "name": "agent_type", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "pmm_agent": { - "type": "array", - "items": { - "description": "PMMAgent runs on Generic or Container Node.", - "type": "object", - "properties": { - "agent_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "runs_on_node_id": { - "description": "Node identifier where this instance runs.", - "type": "string", - "x-order": 1 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 2 - }, - "connected": { - "description": "True if Agent is running and connected to pmm-managed.", - "type": "boolean", - "x-order": 3 - }, - "process_exec_path": { - "description": "Path to exec process.", - "type": "string", - "x-order": 4 - } - } - }, - "x-order": 0 - }, - "vm_agent": { - "type": "array", - "items": { - "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.", - "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 - }, - "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 - }, - "process_exec_path": { - "description": "Path to exec process.", - "type": "string", - "x-order": 3 - }, - "listen_port": { - "description": "Listen port for scraping metrics.", - "type": "integer", - "format": "int64", - "x-order": 4 - } - } - }, - "x-order": 1 - }, - "node_exporter": { - "type": "array", - "items": { - "description": "NodeExporter runs on Generic or Container Node and exposes its 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 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 3 - }, - "push_metrics_enabled": { - "description": "True if exporter uses push metrics mode.", - "type": "boolean", - "x-order": 4 - }, - "disabled_collectors": { - "description": "List of disabled collector names.", - "type": "array", - "items": { - "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.", - "type": "integer", - "format": "int64", - "x-order": 7 - }, - "process_exec_path": { - "description": "Path to exec process.", - "type": "string", - "x-order": 8 - }, - "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": 9 - }, - "expose_exporter": { - "type": "boolean", - "title": "Optionally expose the exporter process on all public interfaces", - "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 - } - } - }, - "x-order": 2 - }, - "mysqld_exporter": { - "type": "array", - "items": { - "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", - "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 - }, - "mongodb_exporter": { - "type": "array", - "items": { - "description": "MongoDBExporter runs on Generic or Container Node and exposes MongoDB 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": "MongoDB 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": 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 - }, - "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": 11 - }, - "stats_collections": { - "type": "array", - "title": "List of colletions to get stats from. Can use *", - "items": { - "type": "string" - }, - "x-order": 12 - }, - "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", - "x-order": 13 - }, - "enable_all_collectors": { - "description": "Enable All collectors.", - "type": "boolean", - "x-order": 14 - }, - "process_exec_path": { - "description": "Path to exec process.", - "type": "string", - "x-order": 15 - }, - "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 - }, - "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.", - "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": 18 - } - } - }, - "x-order": 4 - }, - "postgres_exporter": { - "type": "array", - "items": { - "description": "PostgresExporter runs on Generic or Container Node and exposes PostgreSQL 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": "PostgreSQL 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. Uses sslmode=required instead of verify-full.", - "type": "boolean", - "x-order": 6 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "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 - }, - "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": 11 - }, - "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" - ], - "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 - } - } - }, - "x-order": 5 - }, - "proxysql_exporter": { - "type": "array", - "items": { - "description": "ProxySQLExporter runs on Generic or Container Node and exposes ProxySQL 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": "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": 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 - }, - "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": 11 - }, - "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" - ], - "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.", - "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": 6 - }, - "qan_mysql_perfschema_agent": { - "type": "array", - "items": { - "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.", - "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", - "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 - } - } - }, - "x-order": 7 - }, - "qan_mysql_slowlog_agent": { - "type": "array", - "items": { - "description": "QANMySQLSlowlogAgent 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": { - "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 - }, - "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 - }, - "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": 8 - }, - "qan_mongodb_profiler_agent": { - "type": "array", - "items": { - "description": "QANMongoDBProfilerAgent runs within pmm-agent and sends MongoDB 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": "MongoDB username for getting profiler 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 - }, - "max_query_length": { - "description": "Limit query length in QAN (default: server-defined; -1: no limit).", - "type": "integer", - "format": "int32", - "x-order": 7 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "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", - "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": 9 - }, - "qan_mongodb_mongolog_agent": { - "type": "array", - "items": { - "description": "QANMongoDBMongologAgent runs within pmm-agent and sends MongoDB 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": "MongoDB username for getting profiler 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 - }, - "max_query_length": { - "description": "Limit query length in QAN (default: server-defined; -1: no limit).", - "type": "integer", - "format": "int32", - "x-order": 7 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "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", - "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": 10 - }, - "qan_postgresql_pgstatements_agent": { - "type": "array", - "items": { - "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.", - "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 - }, - "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": 11 - }, - "qan_postgresql_pgstatmonitor_agent": { - "type": "array", - "items": { - "description": "QANPostgreSQLPgStatMonitorAgent 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 monitor 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 - }, - "disable_comments_parsing": { - "description": "Disable parsing comments from queries and showing them in QAN.", - "type": "boolean", - "x-order": 7 - }, - "max_query_length": { - "description": "Limit query length in QAN (default: server-defined; -1: no limit).", - "type": "integer", - "format": "int32", - "x-order": 8 - }, - "query_examples_disabled": { - "description": "True if query examples are disabled.", - "type": "boolean", - "x-order": 9 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "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 - }, - "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" - ], - "x-order": 13 - } - } - }, - "x-order": 12 - }, - "external_exporter": { - "type": "array", - "items": { - "description": "ExternalExporter runs on any Node type, including Remote Node.", - "type": "object", - "properties": { - "agent_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "runs_on_node_id": { - "description": "Node identifier where this instance runs.", - "type": "string", - "x-order": 1 - }, - "disabled": { - "description": "If disabled, metrics from this exporter will not be collected.", - "type": "boolean", - "x-order": 2 - }, - "service_id": { - "description": "Service identifier.", - "type": "string", - "x-order": 3 - }, - "username": { - "description": "HTTP basic auth username for collecting metrics.", - "type": "string", - "x-order": 4 - }, - "scheme": { - "description": "Scheme to generate URI to exporter metrics endpoints.", - "type": "string", - "x-order": 5 - }, - "metrics_path": { - "description": "Path under which metrics are exposed, used to generate URI.", - "type": "string", - "x-order": 6 - }, - "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 - } - } - }, - "x-order": 13 - }, - "rds_exporter": { - "type": "array", - "items": { - "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 - }, - "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.", - "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": { - "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 - }, - "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.", - "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 - } - } - }, - "x-order": 14 - }, - "azure_database_exporter": { - "type": "array", - "items": { - "description": "AzureDatabaseExporter runs on Generic or Container Node and exposes RemoteAzure 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 - }, - "azure_database_subscription_id": { - "description": "Azure database subscription ID.", - "type": "string", - "x-order": 4 - }, - "azure_database_resource_type": { - "type": "string", - "title": "Azure database resource type (mysql, maria, postgres)", - "x-order": 5 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 6 - }, - "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 - }, - "listen_port": { - "description": "Listen port for scraping metrics (the same for several configurations).", - "type": "integer", - "format": "int64", - "x-order": 8 - }, - "push_metrics_enabled": { - "description": "True if the exporter operates in push metrics mode.", - "type": "boolean", - "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 - }, - "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": 12 - } - } - }, - "x-order": 15 - }, - "nomad_agent": { - "type": "array", - "items": { - "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 - }, - "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 - }, - "process_exec_path": { - "description": "Path to exec process.", - "type": "string", - "x-order": 4 - }, - "listen_port": { - "description": "Listen port for scraping metrics.", - "type": "integer", - "format": "int64", - "x-order": 5 - } - } - }, - "x-order": 16 - }, - "valkey_exporter": { - "type": "array", - "items": { - "description": "ValkeyExporter runs on Generic or Container Node and exposes Valkey 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": "Valkey 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 verification.", - "type": "boolean", - "x-order": 6 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "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 - }, - "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": 11 - }, - "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": 13 - }, - "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 - } - } - }, - "x-order": 17 - } - } - } - }, - "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 - } - } - } - } - } - }, - "post": { - "description": "Adds an Agent to Inventory. Only one agent at a time can be passed.", - "tags": [ - "AgentsService" - ], - "summary": "Add an Agent to Inventory", - "operationId": "AddAgent", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "pmm_agent": { - "type": "object", - "properties": { - "runs_on_node_id": { - "description": "Node identifier where this instance runs.", - "type": "string", - "x-order": 0 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 1 - } - }, - "x-order": 0 - }, - "node_exporter": { - "type": "object", - "properties": { - "pmm_agent_id": { - "description": "The pmm-agent identifier which runs this instance.", - "type": "string", - "x-order": 0 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 1 - }, - "push_metrics": { - "description": "Enables push metrics mode for exporter.", - "type": "boolean", - "x-order": 2 - }, - "disable_collectors": { - "description": "List of collector names to disable in this exporter.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 3 - }, - "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": 4 - }, - "expose_exporter": { - "type": "boolean", - "title": "Expose the node_exporter process on all public interfaces", - "x-order": 5 - } - }, - "x-order": 1 - }, - "mysqld_exporter": { - "type": "object", - "properties": { - "pmm_agent_id": { - "description": "The pmm-agent identifier which runs this instance.", - "type": "string", - "x-order": 0 - }, - "service_id": { - "description": "Service identifier.", - "type": "string", - "x-order": 1 - }, - "username": { - "description": "MySQL username for scraping metrics.", - "type": "string", - "x-order": 2 - }, - "password": { - "description": "MySQL password for scraping metrics.", - "type": "string", - "x-order": 3 - }, - "tls": { - "description": "Use TLS for database connections.", - "type": "boolean", - "x-order": 4 - }, - "tls_skip_verify": { - "description": "Skip TLS certificate and hostname validation.", - "type": "boolean", - "x-order": 5 - }, - "tls_ca": { - "description": "Certificate Authority certificate chain.", - "type": "string", - "x-order": 6 - }, - "tls_cert": { - "description": "Client certificate.", - "type": "string", - "x-order": 7 - }, - "tls_key": { - "description": "Password for decrypting tls_cert.", - "type": "string", - "x-order": 8 - }, - "tablestats_group_table_limit": { - "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.", - "type": "integer", - "format": "int32", - "x-order": 9 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 10 - }, - "skip_connection_check": { - "description": "Skip connection check.", - "type": "boolean", - "x-order": 11 - }, - "push_metrics": { - "description": "Enables push metrics mode for exporter.", - "type": "boolean", - "x-order": 12 - }, - "disable_collectors": { - "description": "List of collector names to disable in this exporter.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 13 - }, - "agent_password": { - "description": "Custom password for exporter endpoint /metrics.", - "type": "string", - "x-order": 14 - }, - "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": 15 - }, - "expose_exporter": { - "type": "boolean", - "title": "Optionally expose the exporter process on all public interfaces", - "x-order": 16 - }, - "extra_dsn_params": { - "description": "Extra DSN parameters for MySQL connection.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 17 - } - }, - "x-order": 2 - }, - "mongodb_exporter": { - "type": "object", - "properties": { - "pmm_agent_id": { - "description": "The pmm-agent identifier which runs this instance.", - "type": "string", - "x-order": 0 - }, - "service_id": { - "description": "Service identifier.", - "type": "string", - "x-order": 1 - }, - "username": { - "description": "MongoDB username for scraping metrics.", - "type": "string", - "x-order": 2 - }, - "password": { - "description": "MongoDB password for scraping metrics.", - "type": "string", - "x-order": 3 - }, - "tls": { - "description": "Use TLS for database connections.", - "type": "boolean", - "x-order": 4 - }, - "tls_skip_verify": { - "description": "Skip TLS certificate and hostname validation.", - "type": "boolean", - "x-order": 5 - }, - "tls_certificate_key": { - "description": "Client certificate and key.", - "type": "string", - "x-order": 6 - }, - "tls_certificate_key_file_password": { - "description": "Password for decrypting tls_certificate_key.", - "type": "string", - "x-order": 7 - }, - "tls_ca": { - "description": "Certificate Authority certificate chain.", - "type": "string", - "x-order": 8 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 9 - }, - "skip_connection_check": { - "description": "Skip connection check.", - "type": "boolean", - "x-order": 10 - }, - "push_metrics": { - "description": "Enables push metrics mode for exporter.", - "type": "boolean", - "x-order": 11 - }, - "disable_collectors": { - "description": "List of collector names to disable in this exporter.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 12 - }, - "authentication_mechanism": { - "description": "Authentication mechanism.\nSee https://docs.mongodb.com/manual/reference/connection-string/#mongodb-urioption-urioption.authMechanism\nfor details.", - "type": "string", - "x-order": 13 - }, - "authentication_database": { - "description": "Authentication database.", - "type": "string", - "x-order": 14 - }, - "agent_password": { - "description": "Custom password for exporter endpoint /metrics.", - "type": "string", - "x-order": 15 - }, - "stats_collections": { - "type": "array", - "title": "List of colletions to get stats from. Can use *", - "items": { - "type": "string" - }, - "x-order": 16 - }, - "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", - "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", - "x-order": 19 - } - }, - "x-order": 3 - }, - "postgres_exporter": { - "type": "object", - "properties": { - "pmm_agent_id": { - "description": "The pmm-agent identifier which runs this instance.", - "type": "string", - "x-order": 0 - }, - "service_id": { - "description": "Service identifier.", - "type": "string", - "x-order": 1 - }, - "username": { - "description": "PostgreSQL username for scraping metrics.", - "type": "string", - "x-order": 2 - }, - "password": { - "description": "PostgreSQL password for scraping metrics.", - "type": "string", - "x-order": 3 - }, - "tls": { - "description": "Use TLS for database connections.", - "type": "boolean", - "x-order": 4 - }, - "tls_skip_verify": { - "description": "Skip TLS certificate and hostname validation. Uses sslmode=required instead of verify-full.", - "type": "boolean", - "x-order": 5 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 6 - }, - "skip_connection_check": { - "description": "Skip connection check.", - "type": "boolean", - "x-order": 7 - }, - "push_metrics": { - "description": "Enables push metrics mode for exporter.", - "type": "boolean", - "x-order": 8 - }, - "disable_collectors": { - "description": "List of collector names to disable in this exporter.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 9 - }, - "tls_ca": { - "description": "TLS CA certificate.", - "type": "string", - "x-order": 10 - }, - "tls_cert": { - "description": "TLS Certifcate.", - "type": "string", - "x-order": 11 - }, - "tls_key": { - "description": "TLS Certificate Key.", - "type": "string", - "x-order": 12 - }, - "agent_password": { - "description": "Custom password for exporter endpoint /metrics.", - "type": "string", - "x-order": 13 - }, - "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": 14 - }, - "auto_discovery_limit": { - "description": "Limit of databases for auto-discovery.", - "type": "integer", - "format": "int32", - "x-order": 15 - }, - "expose_exporter": { - "type": "boolean", - "title": "Optionally expose the exporter process on all public interfaces", - "x-order": 16 - }, - "max_exporter_connections": { - "description": "Maximum number of connections that exporter can open to the database instance.", - "type": "integer", - "format": "int32", - "x-order": 17 - } - }, - "x-order": 4 - }, - "proxysql_exporter": { - "type": "object", - "properties": { - "pmm_agent_id": { - "description": "The pmm-agent identifier which runs this instance.", - "type": "string", - "x-order": 0 - }, - "service_id": { - "description": "Service identifier.", - "type": "string", - "x-order": 1 - }, - "username": { - "description": "ProxySQL username for scraping metrics.", - "type": "string", - "x-order": 2 - }, - "password": { - "description": "ProxySQL password for scraping metrics.", - "type": "string", - "x-order": 3 - }, - "tls": { - "description": "Use TLS for database connections.", - "type": "boolean", - "x-order": 4 - }, - "tls_skip_verify": { - "description": "Skip TLS certificate and hostname validation.", - "type": "boolean", - "x-order": 5 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 6 - }, - "skip_connection_check": { - "description": "Skip connection check.", - "type": "boolean", - "x-order": 7 - }, - "push_metrics": { - "description": "Enables push metrics mode for exporter.", - "type": "boolean", - "x-order": 8 - }, - "disable_collectors": { - "description": "List of collector names to disable in this exporter.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 9 - }, - "agent_password": { - "description": "Custom password for exporter endpoint /metrics.", - "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 - }, - "expose_exporter": { - "type": "boolean", - "title": "Optionally expose the exporter process on all public interfaces", - "x-order": 12 - } - }, - "x-order": 5 - }, - "external_exporter": { - "type": "object", - "properties": { - "runs_on_node_id": { - "description": "The node identifier where this instance is run.", - "type": "string", - "x-order": 0 - }, - "service_id": { - "description": "Service identifier.", - "type": "string", - "x-order": 1 - }, - "username": { - "description": "HTTP basic auth username for collecting metrics.", - "type": "string", - "x-order": 2 - }, - "password": { - "description": "HTTP basic auth password for collecting metrics.", - "type": "string", - "x-order": 3 - }, - "scheme": { - "description": "Scheme to generate URI to exporter metrics endpoints(default: http).", - "type": "string", - "x-order": 4 - }, - "metrics_path": { - "description": "Path under which metrics are exposed, used to generate URI(default: /metrics).", - "type": "string", - "x-order": 5 - }, - "listen_port": { - "description": "Listen port for scraping metrics.", - "type": "integer", - "format": "int64", - "x-order": 6 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 7 - }, - "push_metrics": { - "description": "Enables push metrics mode for exporter.", - "type": "boolean", - "x-order": 8 - }, - "tls_skip_verify": { - "description": "Skip TLS certificate and hostname verification.", - "type": "boolean", - "x-order": 9 - } - }, - "x-order": 6 - }, - "rds_exporter": { - "type": "object", - "properties": { - "pmm_agent_id": { - "description": "The pmm-agent identifier which runs this instance.", - "type": "string", - "x-order": 0 - }, - "node_id": { - "description": "Node identifier.", - "type": "string", - "x-order": 1 - }, - "aws_access_key": { - "description": "AWS Access Key.", - "type": "string", - "x-order": 2 - }, - "aws_secret_key": { - "description": "AWS Secret Key.", - "type": "string", - "x-order": 3 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 4 - }, - "skip_connection_check": { - "description": "Skip connection check.", - "type": "boolean", - "x-order": 5 - }, - "disable_basic_metrics": { - "description": "Disable basic metrics.", - "type": "boolean", - "x-order": 6 - }, - "disable_enhanced_metrics": { - "description": "Disable enhanced metrics.", - "type": "boolean", - "x-order": 7 - }, - "push_metrics": { - "description": "Enables push metrics mode for exporter.", - "type": "boolean", - "x-order": 8 - }, - "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": 9 - } - }, - "x-order": 7 - }, - "azure_database_exporter": { - "type": "object", - "properties": { - "pmm_agent_id": { - "description": "The pmm-agent identifier which runs this instance.", - "type": "string", - "x-order": 0 - }, - "node_id": { - "description": "Node identifier.", - "type": "string", - "x-order": 1 - }, - "azure_client_id": { - "type": "string", - "title": "Azure client ID", - "x-order": 2 - }, - "azure_client_secret": { - "type": "string", - "title": "Azure client secret", - "x-order": 3 - }, - "azure_tenant_id": { - "type": "string", - "title": "Azure tanant ID", - "x-order": 4 - }, - "azure_subscription_id": { - "type": "string", - "title": "Azure subscription ID", - "x-order": 5 - }, - "azure_resource_group": { - "description": "Azure resource group.", - "type": "string", - "x-order": 6 - }, - "azure_database_resource_type": { - "type": "string", - "title": "Azure resource type (mysql, maria, postgres)", - "x-order": 7 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 8 - }, - "skip_connection_check": { - "description": "Skip connection check.", - "type": "boolean", - "x-order": 9 - }, - "push_metrics": { - "description": "Enables push metrics mode for exporter.", - "type": "boolean", - "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": 8 - }, - "qan_mysql_perfschema_agent": { - "type": "object", - "properties": { - "pmm_agent_id": { - "description": "The pmm-agent identifier which runs this instance.", - "type": "string", - "x-order": 0 - }, - "service_id": { - "description": "Service identifier.", - "type": "string", - "x-order": 1 - }, - "username": { - "description": "MySQL username for getting performance data.", - "type": "string", - "x-order": 2 - }, - "password": { - "description": "MySQL password for getting performance data.", - "type": "string", - "x-order": 3 - }, - "tls": { - "description": "Use TLS for database connections.", - "type": "boolean", - "x-order": 4 - }, - "tls_skip_verify": { - "description": "Skip TLS certificate and hostname validation.", - "type": "boolean", - "x-order": 5 - }, - "tls_ca": { - "description": "Certificate Authority certificate chain.", - "type": "string", - "x-order": 6 - }, - "tls_cert": { - "description": "Client certificate.", - "type": "string", - "x-order": 7 - }, - "tls_key": { - "description": "Password for decrypting tls_cert.", - "type": "string", - "x-order": 8 - }, - "max_query_length": { - "type": "integer", - "format": "int32", - "title": "Limit query length in QAN (default: server-defined; -1: no limit)", - "x-order": 9 - }, - "disable_query_examples": { - "description": "Disable query examples.", - "type": "boolean", - "x-order": 10 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 11 - }, - "skip_connection_check": { - "description": "Skip connection check.", - "type": "boolean", - "x-order": 12 - }, - "disable_comments_parsing": { - "description": "Disable parsing comments from queries and showing them in QAN.", - "type": "boolean", - "x-order": 13 - }, - "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": 14 - }, - "extra_dsn_params": { - "description": "Extra DSN parameters for MySQL connection.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 15 - } - }, - "x-order": 9 - }, - "qan_mysql_slowlog_agent": { - "type": "object", - "properties": { - "pmm_agent_id": { - "description": "The pmm-agent identifier which runs this instance.", - "type": "string", - "x-order": 0 - }, - "service_id": { - "description": "Service identifier.", - "type": "string", - "x-order": 1 - }, - "username": { - "description": "MySQL username for getting slowlog data.", - "type": "string", - "x-order": 2 - }, - "password": { - "description": "MySQL password for getting slowlog data.", - "type": "string", - "x-order": 3 - }, - "tls": { - "description": "Use TLS for database connections.", - "type": "boolean", - "x-order": 4 - }, - "tls_skip_verify": { - "description": "Skip TLS certificate and hostname validation.", - "type": "boolean", - "x-order": 5 - }, - "tls_ca": { - "description": "Certificate Authority certificate chain.", - "type": "string", - "x-order": 6 - }, - "tls_cert": { - "description": "Client certificate.", - "type": "string", - "x-order": 7 - }, - "tls_key": { - "description": "Password for decrypting tls_cert.", - "type": "string", - "x-order": 8 - }, - "max_query_length": { - "description": "Limit query length in QAN (default: server-defined; -1: no limit).", - "type": "integer", - "format": "int32", - "x-order": 9 - }, - "disable_query_examples": { - "description": "Disable query examples.", - "type": "boolean", - "x-order": 10 - }, - "max_slowlog_file_size": { - "description": "Rotate slowlog file at this size if \u003e 0.\nUse zero or negative value to disable rotation.", - "type": "string", - "format": "int64", - "x-order": 11 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 12 - }, - "skip_connection_check": { - "description": "Skip connection check.", - "type": "boolean", - "x-order": 13 - }, - "disable_comments_parsing": { - "description": "Disable parsing comments from queries and showing them in QAN.", - "type": "boolean", - "x-order": 14 - }, - "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": 15 - }, - "extra_dsn_params": { - "description": "Extra DSN parameters for MySQL connection.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 16 - } - }, - "x-order": 10 - }, - "qan_mongodb_profiler_agent": { - "type": "object", - "properties": { - "pmm_agent_id": { - "description": "The pmm-agent identifier which runs this instance.", - "type": "string", - "x-order": 0 - }, - "service_id": { - "description": "Service identifier.", - "type": "string", - "x-order": 1 - }, - "username": { - "description": "MongoDB username for getting profile data.", - "type": "string", - "x-order": 2 - }, - "password": { - "description": "MongoDB password for getting profile data.", - "type": "string", - "x-order": 3 - }, - "tls": { - "description": "Use TLS for database connections.", - "type": "boolean", - "x-order": 4 - }, - "tls_skip_verify": { - "description": "Skip TLS certificate and hostname validation.", - "type": "boolean", - "x-order": 5 - }, - "tls_certificate_key": { - "description": "Client certificate and key.", - "type": "string", - "x-order": 6 - }, - "tls_certificate_key_file_password": { - "description": "Password for decrypting tls_certificate_key.", - "type": "string", - "x-order": 7 - }, - "tls_ca": { - "description": "Certificate Authority certificate chain.", - "type": "string", - "x-order": 8 - }, - "max_query_length": { - "description": "Limit query length in QAN (default: server-defined; -1: no limit).", - "type": "integer", - "format": "int32", - "x-order": 9 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 10 - }, - "skip_connection_check": { - "description": "Skip connection check.", - "type": "boolean", - "x-order": 11 - }, - "authentication_mechanism": { - "description": "Authentication mechanism.\nSee https://docs.mongodb.com/manual/reference/connection-string/#mongodb-urioption-urioption.authMechanism\nfor details.", - "type": "string", - "x-order": 12 - }, - "authentication_database": { - "description": "Authentication database.", - "type": "string", - "x-order": 13 - }, - "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": 14 - } - }, - "x-order": 11 - }, - "qan_mongodb_mongolog_agent": { - "type": "object", - "properties": { - "pmm_agent_id": { - "description": "The pmm-agent identifier which runs this instance.", - "type": "string", - "x-order": 0 - }, - "service_id": { - "description": "Service identifier.", - "type": "string", - "x-order": 1 - }, - "username": { - "description": "MongoDB username for getting profile data.", - "type": "string", - "x-order": 2 - }, - "password": { - "description": "MongoDB password for getting profile data.", - "type": "string", - "x-order": 3 - }, - "tls": { - "description": "Use TLS for database connections.", - "type": "boolean", - "x-order": 4 - }, - "tls_skip_verify": { - "description": "Skip TLS certificate and hostname validation.", - "type": "boolean", - "x-order": 5 - }, - "tls_certificate_key": { - "description": "Client certificate and key.", - "type": "string", - "x-order": 6 - }, - "tls_certificate_key_file_password": { - "description": "Password for decrypting tls_certificate_key.", - "type": "string", - "x-order": 7 - }, - "tls_ca": { - "description": "Certificate Authority certificate chain.", - "type": "string", - "x-order": 8 - }, - "max_query_length": { - "description": "Limit query length in QAN (default: server-defined; -1: no limit).", - "type": "integer", - "format": "int32", - "x-order": 9 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 10 - }, - "skip_connection_check": { - "description": "Skip connection check.", - "type": "boolean", - "x-order": 11 - }, - "authentication_mechanism": { - "description": "Authentication mechanism.\nSee https://docs.mongodb.com/manual/reference/connection-string/#mongodb-urioption-urioption.authMechanism\nfor details.", - "type": "string", - "x-order": 12 - }, - "authentication_database": { - "description": "Authentication database.", - "type": "string", - "x-order": 13 - }, - "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": 14 - } - }, - "x-order": 12 - }, - "qan_postgresql_pgstatements_agent": { - "type": "object", - "properties": { - "pmm_agent_id": { - "description": "The pmm-agent identifier which runs this instance.", - "type": "string", - "x-order": 0 - }, - "service_id": { - "description": "Service identifier.", - "type": "string", - "x-order": 1 - }, - "username": { - "description": "PostgreSQL username for getting pg stat statements data.", - "type": "string", - "x-order": 2 - }, - "password": { - "description": "PostgreSQL password for getting pg stat statements data.", - "type": "string", - "x-order": 3 - }, - "tls": { - "description": "Use TLS for database connections.", - "type": "boolean", - "x-order": 4 - }, - "tls_skip_verify": { - "description": "Skip TLS certificate and hostname validation.", - "type": "boolean", - "x-order": 5 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 6 - }, - "skip_connection_check": { - "description": "Skip connection check.", - "type": "boolean", - "x-order": 7 - }, - "disable_comments_parsing": { - "description": "Disable parsing comments from queries and showing them in QAN.", - "type": "boolean", - "x-order": 8 - }, - "max_query_length": { - "description": "Limit query length in QAN (default: server-defined; -1: no limit).", - "type": "integer", - "format": "int32", - "x-order": 9 - }, - "tls_ca": { - "description": "TLS CA certificate.", - "type": "string", - "x-order": 10 - }, - "tls_cert": { - "description": "TLS Certifcate.", - "type": "string", - "x-order": 11 - }, - "tls_key": { - "description": "TLS Certificate Key.", - "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" - ], - "x-order": 13 - } - }, - "x-order": 13 - }, - "qan_postgresql_pgstatmonitor_agent": { - "type": "object", - "properties": { - "pmm_agent_id": { - "description": "The pmm-agent identifier which runs this instance.", - "type": "string", - "x-order": 0 - }, - "service_id": { - "description": "Service identifier.", - "type": "string", - "x-order": 1 - }, - "username": { - "description": "PostgreSQL username for getting pg stat monitor data.", - "type": "string", - "x-order": 2 - }, - "password": { - "description": "PostgreSQL password for getting pg stat monitor data.", - "type": "string", - "x-order": 3 - }, - "tls": { - "description": "Use TLS for database connections.", - "type": "boolean", - "x-order": 4 - }, - "tls_skip_verify": { - "description": "Skip TLS certificate and hostname validation.", - "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 - }, - "disable_query_examples": { - "description": "Disable query examples.", - "type": "boolean", - "x-order": 7 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 8 - }, - "skip_connection_check": { - "description": "Skip connection check.", - "type": "boolean", - "x-order": 9 - }, - "disable_comments_parsing": { - "description": "Disable parsing comments from queries and showing them in QAN.", - "type": "boolean", - "x-order": 10 - }, - "tls_ca": { - "description": "TLS CA certificate.", - "type": "string", - "x-order": 11 - }, - "tls_cert": { - "description": "TLS Certifcate.", - "type": "string", - "x-order": 12 - }, - "tls_key": { - "description": "TLS Certificate Key.", - "type": "string", - "x-order": 13 - }, - "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": 14 - } - }, - "x-order": 14 - }, - "valkey_exporter": { - "type": "object", - "properties": { - "pmm_agent_id": { - "description": "The pmm-agent identifier which runs this instance.", - "type": "string", - "x-order": 0 - }, - "service_id": { - "description": "Service identifier.", - "type": "string", - "x-order": 1 - }, - "username": { - "description": "Valkey username for scraping metrics.", - "type": "string", - "x-order": 2 - }, - "password": { - "description": "Valkey password for scraping metrics.", - "type": "string", - "x-order": 3 - }, - "tls": { - "description": "Use TLS for database connections.", - "type": "boolean", - "x-order": 4 - }, - "tls_skip_verify": { - "description": "Skip TLS certificate and hostname validation.", - "type": "boolean", - "x-order": 5 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 6 - }, - "skip_connection_check": { - "description": "Skip connection check.", - "type": "boolean", - "x-order": 7 - }, - "push_metrics": { - "description": "Enables push metrics mode for exporter.", - "type": "boolean", - "x-order": 8 - }, - "disable_collectors": { - "description": "List of collector names to disable in this exporter.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 9 - }, - "tls_ca": { - "description": "TLS CA certificate.", - "type": "string", - "x-order": 10 - }, - "tls_cert": { - "description": "TLS Certifcate.", - "type": "string", - "x-order": 11 - }, - "tls_key": { - "description": "TLS Certificate Key.", - "type": "string", - "x-order": 12 - }, - "agent_password": { - "description": "Custom password for exporter endpoint /metrics.", - "type": "string", - "x-order": 13 - }, - "expose_exporter": { - "type": "boolean", - "title": "Optionally expose the exporter process on all public interfaces", - "x-order": 14 - } - }, - "x-order": 15 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "pmm_agent": { - "description": "PMMAgent runs on Generic or Container Node.", - "type": "object", - "properties": { - "agent_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "runs_on_node_id": { - "description": "Node identifier where this instance runs.", - "type": "string", - "x-order": 1 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 2 - }, - "connected": { - "description": "True if Agent is running and connected to pmm-managed.", - "type": "boolean", - "x-order": 3 - }, - "process_exec_path": { - "description": "Path to exec process.", - "type": "string", - "x-order": 4 - } - }, - "x-order": 0 - }, - "node_exporter": { - "description": "NodeExporter runs on Generic or Container Node and exposes its 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 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 3 - }, - "push_metrics_enabled": { - "description": "True if exporter uses push metrics mode.", - "type": "boolean", - "x-order": 4 - }, - "disabled_collectors": { - "description": "List of disabled collector names.", - "type": "array", - "items": { - "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.", - "type": "integer", - "format": "int64", - "x-order": 7 - }, - "process_exec_path": { - "description": "Path to exec process.", - "type": "string", - "x-order": 8 - }, - "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": 9 - }, - "expose_exporter": { - "type": "boolean", - "title": "Optionally expose the exporter process on all public interfaces", - "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 - } - }, - "x-order": 1 - }, - "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", - "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": 2 - }, - "mongodb_exporter": { - "description": "MongoDBExporter runs on Generic or Container Node and exposes MongoDB 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": "MongoDB 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": 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 - }, - "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": 11 - }, - "stats_collections": { - "type": "array", - "title": "List of colletions to get stats from. Can use *", - "items": { - "type": "string" - }, - "x-order": 12 - }, - "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", - "x-order": 13 - }, - "enable_all_collectors": { - "description": "Enable All collectors.", - "type": "boolean", - "x-order": 14 - }, - "process_exec_path": { - "description": "Path to exec process.", - "type": "string", - "x-order": 15 - }, - "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 - }, - "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.", - "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": 18 - } - }, - "x-order": 3 - }, - "postgres_exporter": { - "description": "PostgresExporter runs on Generic or Container Node and exposes PostgreSQL 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": "PostgreSQL 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. Uses sslmode=required instead of verify-full.", - "type": "boolean", - "x-order": 6 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "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 - }, - "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": 11 - }, - "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" - ], - "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 - } - }, - "x-order": 4 - }, - "proxysql_exporter": { - "description": "ProxySQLExporter runs on Generic or Container Node and exposes ProxySQL 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": "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": 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 - }, - "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": 11 - }, - "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" - ], - "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.", - "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": 5 - }, - "external_exporter": { - "description": "ExternalExporter runs on any Node type, including Remote Node.", - "type": "object", - "properties": { - "agent_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "runs_on_node_id": { - "description": "Node identifier where this instance runs.", - "type": "string", - "x-order": 1 - }, - "disabled": { - "description": "If disabled, metrics from this exporter will not be collected.", - "type": "boolean", - "x-order": 2 - }, - "service_id": { - "description": "Service identifier.", - "type": "string", - "x-order": 3 - }, - "username": { - "description": "HTTP basic auth username for collecting metrics.", - "type": "string", - "x-order": 4 - }, - "scheme": { - "description": "Scheme to generate URI to exporter metrics endpoints.", - "type": "string", - "x-order": 5 - }, - "metrics_path": { - "description": "Path under which metrics are exposed, used to generate URI.", - "type": "string", - "x-order": 6 - }, - "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 - } - }, - "x-order": 6 - }, - "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 - }, - "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.", - "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": { - "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 - }, - "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.", - "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 - } - }, - "x-order": 7 - }, - "azure_database_exporter": { - "description": "AzureDatabaseExporter runs on Generic or Container Node and exposes RemoteAzure 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 - }, - "azure_database_subscription_id": { - "description": "Azure database subscription ID.", - "type": "string", - "x-order": 4 - }, - "azure_database_resource_type": { - "type": "string", - "title": "Azure database resource type (mysql, maria, postgres)", - "x-order": 5 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 6 - }, - "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 - }, - "listen_port": { - "description": "Listen port for scraping metrics (the same for several configurations).", - "type": "integer", - "format": "int64", - "x-order": 8 - }, - "push_metrics_enabled": { - "description": "True if the exporter operates in push metrics mode.", - "type": "boolean", - "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 - }, - "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": 12 - } - }, - "x-order": 8 - }, - "qan_mysql_perfschema_agent": { - "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.", - "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", - "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 - } - }, - "x-order": 9 - }, - "qan_mysql_slowlog_agent": { - "description": "QANMySQLSlowlogAgent 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": { - "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 - }, - "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 - }, - "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": 10 - }, - "qan_mongodb_profiler_agent": { - "description": "QANMongoDBProfilerAgent runs within pmm-agent and sends MongoDB 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": "MongoDB username for getting profiler 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 - }, - "max_query_length": { - "description": "Limit query length in QAN (default: server-defined; -1: no limit).", - "type": "integer", - "format": "int32", - "x-order": 7 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "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", - "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": 11 - }, - "qan_mongodb_mongolog_agent": { - "description": "QANMongoDBMongologAgent runs within pmm-agent and sends MongoDB 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": "MongoDB username for getting profiler 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 - }, - "max_query_length": { - "description": "Limit query length in QAN (default: server-defined; -1: no limit).", - "type": "integer", - "format": "int32", - "x-order": 7 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "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", - "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": 12 - }, - "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.", - "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 - }, - "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": 13 - }, - "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": { - "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 monitor 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 - }, - "disable_comments_parsing": { - "description": "Disable parsing comments from queries and showing them in QAN.", - "type": "boolean", - "x-order": 7 - }, - "max_query_length": { - "description": "Limit query length in QAN (default: server-defined; -1: no limit).", - "type": "integer", - "format": "int32", - "x-order": 8 - }, - "query_examples_disabled": { - "description": "True if query examples are disabled.", - "type": "boolean", - "x-order": 9 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "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 - }, - "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" - ], - "x-order": 13 - } - }, - "x-order": 14 - }, - "valkey_exporter": { - "description": "ValkeyExporter runs on Generic or Container Node and exposes Valkey 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": "Valkey 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 verification.", - "type": "boolean", - "x-order": 6 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "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 - }, - "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": 11 - }, - "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": 13 - }, - "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 - } - }, - "x-order": 15 - } - } - } - }, - "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/inventory/agents/{agent_id}": { - "get": { - "description": "Returns a single Agent by ID.", - "tags": [ - "AgentsService" - ], - "summary": "Get Agent", - "operationId": "GetAgent", - "parameters": [ - { - "type": "string", - "description": "Unique randomly generated instance identifier.", - "name": "agent_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "pmm_agent": { - "description": "PMMAgent runs on Generic or Container Node.", - "type": "object", - "properties": { - "agent_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "runs_on_node_id": { - "description": "Node identifier where this instance runs.", - "type": "string", - "x-order": 1 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 2 - }, - "connected": { - "description": "True if Agent is running and connected to pmm-managed.", - "type": "boolean", - "x-order": 3 - }, - "process_exec_path": { - "description": "Path to exec process.", - "type": "string", - "x-order": 4 - } - }, - "x-order": 0 - }, - "vmagent": { - "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.", - "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 - }, - "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 - }, - "process_exec_path": { - "description": "Path to exec process.", - "type": "string", - "x-order": 3 - }, - "listen_port": { - "description": "Listen port for scraping metrics.", - "type": "integer", - "format": "int64", - "x-order": 4 - } - }, - "x-order": 1 - }, - "node_exporter": { - "description": "NodeExporter runs on Generic or Container Node and exposes its 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 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 3 - }, - "push_metrics_enabled": { - "description": "True if exporter uses push metrics mode.", - "type": "boolean", - "x-order": 4 - }, - "disabled_collectors": { - "description": "List of disabled collector names.", - "type": "array", - "items": { - "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.", - "type": "integer", - "format": "int64", - "x-order": 7 - }, - "process_exec_path": { - "description": "Path to exec process.", - "type": "string", - "x-order": 8 - }, - "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": 9 - }, - "expose_exporter": { - "type": "boolean", - "title": "Optionally expose the exporter process on all public interfaces", - "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 - } - }, - "x-order": 2 - }, - "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", - "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 - }, - "mongodb_exporter": { - "description": "MongoDBExporter runs on Generic or Container Node and exposes MongoDB 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": "MongoDB 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": 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 - }, - "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": 11 - }, - "stats_collections": { - "type": "array", - "title": "List of colletions to get stats from. Can use *", - "items": { - "type": "string" - }, - "x-order": 12 - }, - "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", - "x-order": 13 - }, - "enable_all_collectors": { - "description": "Enable All collectors.", - "type": "boolean", - "x-order": 14 - }, - "process_exec_path": { - "description": "Path to exec process.", - "type": "string", - "x-order": 15 - }, - "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 - }, - "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.", - "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": 18 - } - }, - "x-order": 4 - }, - "postgres_exporter": { - "description": "PostgresExporter runs on Generic or Container Node and exposes PostgreSQL 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": "PostgreSQL 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. Uses sslmode=required instead of verify-full.", - "type": "boolean", - "x-order": 6 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "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 - }, - "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": 11 - }, - "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" - ], - "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 - } - }, - "x-order": 5 - }, - "proxysql_exporter": { - "description": "ProxySQLExporter runs on Generic or Container Node and exposes ProxySQL 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": "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": 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 - }, - "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": 11 - }, - "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" - ], - "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.", - "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": 6 - }, - "qan_mysql_perfschema_agent": { - "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.", - "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", - "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 - } - }, - "x-order": 7 - }, - "qan_mysql_slowlog_agent": { - "description": "QANMySQLSlowlogAgent 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": { - "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 - }, - "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 - }, - "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": 8 - }, - "qan_mongodb_profiler_agent": { - "description": "QANMongoDBProfilerAgent runs within pmm-agent and sends MongoDB 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": "MongoDB username for getting profiler 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 - }, - "max_query_length": { - "description": "Limit query length in QAN (default: server-defined; -1: no limit).", - "type": "integer", - "format": "int32", - "x-order": 7 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "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", - "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": 9 - }, - "qan_mongodb_mongolog_agent": { - "description": "QANMongoDBMongologAgent runs within pmm-agent and sends MongoDB 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": "MongoDB username for getting profiler 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 - }, - "max_query_length": { - "description": "Limit query length in QAN (default: server-defined; -1: no limit).", - "type": "integer", - "format": "int32", - "x-order": 7 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "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", - "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": 10 - }, - "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.", - "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 - }, - "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": 11 - }, - "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": { - "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 monitor 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 - }, - "disable_comments_parsing": { - "description": "Disable parsing comments from queries and showing them in QAN.", - "type": "boolean", - "x-order": 7 - }, - "max_query_length": { - "description": "Limit query length in QAN (default: server-defined; -1: no limit).", - "type": "integer", - "format": "int32", - "x-order": 8 - }, - "query_examples_disabled": { - "description": "True if query examples are disabled.", - "type": "boolean", - "x-order": 9 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "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 - }, - "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" - ], - "x-order": 13 - } - }, - "x-order": 12 - }, - "external_exporter": { - "description": "ExternalExporter runs on any Node type, including Remote Node.", - "type": "object", - "properties": { - "agent_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "runs_on_node_id": { - "description": "Node identifier where this instance runs.", - "type": "string", - "x-order": 1 - }, - "disabled": { - "description": "If disabled, metrics from this exporter will not be collected.", - "type": "boolean", - "x-order": 2 - }, - "service_id": { - "description": "Service identifier.", - "type": "string", - "x-order": 3 - }, - "username": { - "description": "HTTP basic auth username for collecting metrics.", - "type": "string", - "x-order": 4 - }, - "scheme": { - "description": "Scheme to generate URI to exporter metrics endpoints.", - "type": "string", - "x-order": 5 - }, - "metrics_path": { - "description": "Path under which metrics are exposed, used to generate URI.", - "type": "string", - "x-order": 6 - }, - "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 - } - }, - "x-order": 13 - }, - "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 - }, - "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.", - "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": { - "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 - }, - "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.", - "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 - } - }, - "x-order": 14 - }, - "azure_database_exporter": { - "description": "AzureDatabaseExporter runs on Generic or Container Node and exposes RemoteAzure 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 - }, - "azure_database_subscription_id": { - "description": "Azure database subscription ID.", - "type": "string", - "x-order": 4 - }, - "azure_database_resource_type": { - "type": "string", - "title": "Azure database resource type (mysql, maria, postgres)", - "x-order": 5 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 6 - }, - "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 - }, - "listen_port": { - "description": "Listen port for scraping metrics (the same for several configurations).", - "type": "integer", - "format": "int64", - "x-order": 8 - }, - "push_metrics_enabled": { - "description": "True if the exporter operates in push metrics mode.", - "type": "boolean", - "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 - }, - "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": 12 - } - }, - "x-order": 15 - }, - "nomad_agent": { - "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 - }, - "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 - }, - "process_exec_path": { - "description": "Path to exec process.", - "type": "string", - "x-order": 4 - }, - "listen_port": { - "description": "Listen port for scraping metrics.", - "type": "integer", - "format": "int64", - "x-order": 5 - } - }, - "x-order": 16 - }, - "valkey_exporter": { - "description": "ValkeyExporter runs on Generic or Container Node and exposes Valkey 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": "Valkey 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 verification.", - "type": "boolean", - "x-order": 6 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "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 - }, - "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": 11 - }, - "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": 13 - }, - "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 - } - }, - "x-order": 17 - } - } - } - }, - "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 - } - } - } - } - } - }, - "put": { - "description": "Updates an Agent in Inventory. Only one agent at a time can be passed.", - "tags": [ - "AgentsService" - ], - "summary": "Update an Agent in Inventory", - "operationId": "ChangeAgent", - "parameters": [ - { - "type": "string", - "name": "agent_id", - "in": "path", - "required": true - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "node_exporter": { - "type": "object", - "properties": { - "enable": { - "description": "Enable this Agent. Agents are enabled by default when they get added.", - "type": "boolean", - "x-nullable": true, - "x-order": 0 - }, - "custom_labels": { - "description": "A wrapper for map[string]string. This type allows to distinguish between an empty map and a null value.", - "type": "object", - "properties": { - "values": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 0 - } - }, - "x-nullable": true, - "x-order": 1 - }, - "enable_push_metrics": { - "description": "Enables push metrics with vmagent.", - "type": "boolean", - "x-nullable": true, - "x-order": 2 - }, - "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": 3 - } - }, - "x-order": 0 - }, - "mysqld_exporter": { - "type": "object", - "properties": { - "enable": { - "description": "Enable this Agent. Agents are enabled by default when they get added.", - "type": "boolean", - "x-nullable": true, - "x-order": 0 - }, - "custom_labels": { - "description": "A wrapper for map[string]string. This type allows to distinguish between an empty map and a null value.", - "type": "object", - "properties": { - "values": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 0 - } - }, - "x-nullable": true, - "x-order": 1 - }, - "enable_push_metrics": { - "description": "Enables push metrics with vmagent.", - "type": "boolean", - "x-nullable": true, - "x-order": 2 - }, - "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": 3 - } - }, - "x-order": 1 - }, - "mongodb_exporter": { - "type": "object", - "properties": { - "enable": { - "description": "Enable this Agent. Agents are enabled by default when they get added.", - "type": "boolean", - "x-nullable": true, - "x-order": 0 - }, - "custom_labels": { - "description": "A wrapper for map[string]string. This type allows to distinguish between an empty map and a null value.", - "type": "object", - "properties": { - "values": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 0 - } - }, - "x-nullable": true, - "x-order": 1 - }, - "enable_push_metrics": { - "description": "Enables push metrics with vmagent.", - "type": "boolean", - "x-nullable": true, - "x-order": 2 - }, - "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": 3 - } - }, - "x-order": 2 - }, - "postgres_exporter": { - "type": "object", - "properties": { - "enable": { - "description": "Enable this Agent. Agents are enabled by default when they get added.", - "type": "boolean", - "x-nullable": true, - "x-order": 0 - }, - "custom_labels": { - "description": "A wrapper for map[string]string. This type allows to distinguish between an empty map and a null value.", - "type": "object", - "properties": { - "values": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 0 - } - }, - "x-nullable": true, - "x-order": 1 - }, - "enable_push_metrics": { - "description": "Enables push metrics with vmagent.", - "type": "boolean", - "x-nullable": true, - "x-order": 2 - }, - "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": 3 - } - }, - "x-order": 3 - }, - "proxysql_exporter": { - "type": "object", - "properties": { - "enable": { - "description": "Enable this Agent. Agents are enabled by default when they get added.", - "type": "boolean", - "x-nullable": true, - "x-order": 0 - }, - "custom_labels": { - "description": "A wrapper for map[string]string. This type allows to distinguish between an empty map and a null value.", - "type": "object", - "properties": { - "values": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 0 - } - }, - "x-nullable": true, - "x-order": 1 - }, - "enable_push_metrics": { - "description": "Enables push metrics with vmagent.", - "type": "boolean", - "x-nullable": true, - "x-order": 2 - }, - "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": 3 - } - }, - "x-order": 4 - }, - "external_exporter": { - "type": "object", - "properties": { - "enable": { - "description": "Enable this Agent. Agents are enabled by default when they get added.", - "type": "boolean", - "x-nullable": true, - "x-order": 0 - }, - "custom_labels": { - "description": "A wrapper for map[string]string. This type allows to distinguish between an empty map and a null value.", - "type": "object", - "properties": { - "values": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 0 - } - }, - "x-nullable": true, - "x-order": 1 - }, - "enable_push_metrics": { - "description": "Enables push metrics with vmagent.", - "type": "boolean", - "x-nullable": true, - "x-order": 2 - }, - "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": 3 - } - }, - "x-order": 5 - }, - "rds_exporter": { - "type": "object", - "properties": { - "enable": { - "description": "Enable this Agent. Agents are enabled by default when they get added.", - "type": "boolean", - "x-nullable": true, - "x-order": 0 - }, - "custom_labels": { - "description": "A wrapper for map[string]string. This type allows to distinguish between an empty map and a null value.", - "type": "object", - "properties": { - "values": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 0 - } - }, - "x-nullable": true, - "x-order": 1 - }, - "enable_push_metrics": { - "description": "Enables push metrics with vmagent.", - "type": "boolean", - "x-nullable": true, - "x-order": 2 - }, - "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": 3 - } - }, - "x-order": 6 - }, - "azure_database_exporter": { - "type": "object", - "properties": { - "enable": { - "description": "Enable this Agent. Agents are enabled by default when they get added.", - "type": "boolean", - "x-nullable": true, - "x-order": 0 - }, - "custom_labels": { - "description": "A wrapper for map[string]string. This type allows to distinguish between an empty map and a null value.", - "type": "object", - "properties": { - "values": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 0 - } - }, - "x-nullable": true, - "x-order": 1 - }, - "enable_push_metrics": { - "description": "Enables push metrics with vmagent.", - "type": "boolean", - "x-nullable": true, - "x-order": 2 - }, - "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": 3 - } - }, - "x-order": 7 - }, - "qan_mysql_perfschema_agent": { - "type": "object", - "properties": { - "enable": { - "description": "Enable this Agent. Agents are enabled by default when they get added.", - "type": "boolean", - "x-nullable": true, - "x-order": 0 - }, - "custom_labels": { - "description": "A wrapper for map[string]string. This type allows to distinguish between an empty map and a null value.", - "type": "object", - "properties": { - "values": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 0 - } - }, - "x-nullable": true, - "x-order": 1 - }, - "enable_push_metrics": { - "description": "Enables push metrics with vmagent.", - "type": "boolean", - "x-nullable": true, - "x-order": 2 - }, - "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": 3 - } - }, - "x-order": 8 - }, - "qan_mysql_slowlog_agent": { - "type": "object", - "properties": { - "enable": { - "description": "Enable this Agent. Agents are enabled by default when they get added.", - "type": "boolean", - "x-nullable": true, - "x-order": 0 - }, - "custom_labels": { - "description": "A wrapper for map[string]string. This type allows to distinguish between an empty map and a null value.", - "type": "object", - "properties": { - "values": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 0 - } - }, - "x-nullable": true, - "x-order": 1 - }, - "enable_push_metrics": { - "description": "Enables push metrics with vmagent.", - "type": "boolean", - "x-nullable": true, - "x-order": 2 - }, - "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": 3 - } - }, - "x-order": 9 - }, - "qan_mongodb_profiler_agent": { - "type": "object", - "properties": { - "enable": { - "description": "Enable this Agent. Agents are enabled by default when they get added.", - "type": "boolean", - "x-nullable": true, - "x-order": 0 - }, - "custom_labels": { - "description": "A wrapper for map[string]string. This type allows to distinguish between an empty map and a null value.", - "type": "object", - "properties": { - "values": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 0 - } - }, - "x-nullable": true, - "x-order": 1 - }, - "enable_push_metrics": { - "description": "Enables push metrics with vmagent.", - "type": "boolean", - "x-nullable": true, - "x-order": 2 - }, - "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": 3 - } - }, - "x-order": 10 - }, - "qan_mongodb_mongolog_agent": { - "type": "object", - "properties": { - "enable": { - "description": "Enable this Agent. Agents are enabled by default when they get added.", - "type": "boolean", - "x-nullable": true, - "x-order": 0 - }, - "custom_labels": { - "description": "A wrapper for map[string]string. This type allows to distinguish between an empty map and a null value.", - "type": "object", - "properties": { - "values": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 0 - } - }, - "x-nullable": true, - "x-order": 1 - }, - "enable_push_metrics": { - "description": "Enables push metrics with vmagent.", - "type": "boolean", - "x-nullable": true, - "x-order": 2 - }, - "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": 3 - } - }, - "x-order": 11 - }, - "qan_postgresql_pgstatements_agent": { - "type": "object", - "properties": { - "enable": { - "description": "Enable this Agent. Agents are enabled by default when they get added.", - "type": "boolean", - "x-nullable": true, - "x-order": 0 - }, - "custom_labels": { - "description": "A wrapper for map[string]string. This type allows to distinguish between an empty map and a null value.", - "type": "object", - "properties": { - "values": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 0 - } - }, - "x-nullable": true, - "x-order": 1 - }, - "enable_push_metrics": { - "description": "Enables push metrics with vmagent.", - "type": "boolean", - "x-nullable": true, - "x-order": 2 - }, - "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": 3 - } - }, - "x-order": 12 - }, - "qan_postgresql_pgstatmonitor_agent": { - "type": "object", - "properties": { - "enable": { - "description": "Enable this Agent. Agents are enabled by default when they get added.", - "type": "boolean", - "x-nullable": true, - "x-order": 0 - }, - "custom_labels": { - "description": "A wrapper for map[string]string. This type allows to distinguish between an empty map and a null value.", - "type": "object", - "properties": { - "values": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 0 - } - }, - "x-nullable": true, - "x-order": 1 - }, - "enable_push_metrics": { - "description": "Enables push metrics with vmagent.", - "type": "boolean", - "x-nullable": true, - "x-order": 2 - }, - "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": 3 - } - }, - "x-order": 13 - }, - "nomad_agent": { - "type": "object", - "properties": { - "enable": { - "description": "Enable this Agent. Agents are enabled by default when they get added.", - "type": "boolean", - "x-nullable": true, - "x-order": 0 - } - }, - "x-order": 14 - }, - "valkey_exporter": { - "type": "object", - "properties": { - "enable": { - "description": "Enable this Agent. Agents are enabled by default when they get added.", - "type": "boolean", - "x-nullable": true, - "x-order": 0 - }, - "custom_labels": { - "description": "A wrapper for map[string]string. This type allows to distinguish between an empty map and a null value.", - "type": "object", - "properties": { - "values": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 0 - } - }, - "x-nullable": true, - "x-order": 1 - }, - "enable_push_metrics": { - "description": "Enables push metrics with vmagent.", - "type": "boolean", - "x-nullable": true, - "x-order": 2 - }, - "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": 3 - } - }, - "x-order": 15 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "node_exporter": { - "description": "NodeExporter runs on Generic or Container Node and exposes its 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 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 3 - }, - "push_metrics_enabled": { - "description": "True if exporter uses push metrics mode.", - "type": "boolean", - "x-order": 4 - }, - "disabled_collectors": { - "description": "List of disabled collector names.", - "type": "array", - "items": { - "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.", - "type": "integer", - "format": "int64", - "x-order": 7 - }, - "process_exec_path": { - "description": "Path to exec process.", - "type": "string", - "x-order": 8 - }, - "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": 9 - }, - "expose_exporter": { - "type": "boolean", - "title": "Optionally expose the exporter process on all public interfaces", - "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 - } - }, - "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", - "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": 1 - }, - "mongodb_exporter": { - "description": "MongoDBExporter runs on Generic or Container Node and exposes MongoDB 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": "MongoDB 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": 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 - }, - "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": 11 - }, - "stats_collections": { - "type": "array", - "title": "List of colletions to get stats from. Can use *", - "items": { - "type": "string" - }, - "x-order": 12 - }, - "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", - "x-order": 13 - }, - "enable_all_collectors": { - "description": "Enable All collectors.", - "type": "boolean", - "x-order": 14 - }, - "process_exec_path": { - "description": "Path to exec process.", - "type": "string", - "x-order": 15 - }, - "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 - }, - "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.", - "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": 18 - } - }, - "x-order": 2 - }, - "postgres_exporter": { - "description": "PostgresExporter runs on Generic or Container Node and exposes PostgreSQL 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": "PostgreSQL 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. Uses sslmode=required instead of verify-full.", - "type": "boolean", - "x-order": 6 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "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 - }, - "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": 11 - }, - "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" - ], - "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 - } - }, - "x-order": 3 - }, - "proxysql_exporter": { - "description": "ProxySQLExporter runs on Generic or Container Node and exposes ProxySQL 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": "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": 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 - }, - "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": 11 - }, - "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" - ], - "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.", - "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": 4 - }, - "external_exporter": { - "description": "ExternalExporter runs on any Node type, including Remote Node.", - "type": "object", - "properties": { - "agent_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "runs_on_node_id": { - "description": "Node identifier where this instance runs.", - "type": "string", - "x-order": 1 - }, - "disabled": { - "description": "If disabled, metrics from this exporter will not be collected.", - "type": "boolean", - "x-order": 2 - }, - "service_id": { - "description": "Service identifier.", - "type": "string", - "x-order": 3 - }, - "username": { - "description": "HTTP basic auth username for collecting metrics.", - "type": "string", - "x-order": 4 - }, - "scheme": { - "description": "Scheme to generate URI to exporter metrics endpoints.", - "type": "string", - "x-order": 5 - }, - "metrics_path": { - "description": "Path under which metrics are exposed, used to generate URI.", - "type": "string", - "x-order": 6 - }, - "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 - } - }, - "x-order": 5 - }, - "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 - }, - "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.", - "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": { - "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 - }, - "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.", - "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 - } - }, - "x-order": 6 - }, - "azure_database_exporter": { - "description": "AzureDatabaseExporter runs on Generic or Container Node and exposes RemoteAzure 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 - }, - "azure_database_subscription_id": { - "description": "Azure database subscription ID.", - "type": "string", - "x-order": 4 - }, - "azure_database_resource_type": { - "type": "string", - "title": "Azure database resource type (mysql, maria, postgres)", - "x-order": 5 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 6 - }, - "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 - }, - "listen_port": { - "description": "Listen port for scraping metrics (the same for several configurations).", - "type": "integer", - "format": "int64", - "x-order": 8 - }, - "push_metrics_enabled": { - "description": "True if the exporter operates in push metrics mode.", - "type": "boolean", - "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 - }, - "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": 12 - } - }, - "x-order": 7 - }, - "qan_mysql_perfschema_agent": { - "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.", - "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", - "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 - } - }, - "x-order": 8 - }, - "qan_mysql_slowlog_agent": { - "description": "QANMySQLSlowlogAgent 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": { - "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 - }, - "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 - }, - "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": 9 - }, - "qan_mongodb_profiler_agent": { - "description": "QANMongoDBProfilerAgent runs within pmm-agent and sends MongoDB 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": "MongoDB username for getting profiler 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 - }, - "max_query_length": { - "description": "Limit query length in QAN (default: server-defined; -1: no limit).", - "type": "integer", - "format": "int32", - "x-order": 7 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "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", - "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": 10 - }, - "qan_mongodb_mongolog_agent": { - "description": "QANMongoDBMongologAgent runs within pmm-agent and sends MongoDB 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": "MongoDB username for getting profiler 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 - }, - "max_query_length": { - "description": "Limit query length in QAN (default: server-defined; -1: no limit).", - "type": "integer", - "format": "int32", - "x-order": 7 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "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", - "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": 11 - }, - "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.", - "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 - }, - "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": 12 - }, - "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": { - "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 monitor 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 - }, - "disable_comments_parsing": { - "description": "Disable parsing comments from queries and showing them in QAN.", - "type": "boolean", - "x-order": 7 - }, - "max_query_length": { - "description": "Limit query length in QAN (default: server-defined; -1: no limit).", - "type": "integer", - "format": "int32", - "x-order": 8 - }, - "query_examples_disabled": { - "description": "True if query examples are disabled.", - "type": "boolean", - "x-order": 9 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "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 - }, - "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" - ], - "x-order": 13 - } - }, - "x-order": 13 - }, - "nomad_agent": { - "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 - }, - "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 - }, - "process_exec_path": { - "description": "Path to exec process.", - "type": "string", - "x-order": 4 - }, - "listen_port": { - "description": "Listen port for scraping metrics.", - "type": "integer", - "format": "int64", - "x-order": 5 - } - }, - "x-order": 14 - }, - "valkey_exporter": { - "description": "ValkeyExporter runs on Generic or Container Node and exposes Valkey 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": "Valkey 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 verification.", - "type": "boolean", - "x-order": 6 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "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 - }, - "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": 11 - }, - "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": 13 - }, - "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 - } - }, - "x-order": 15 - } - } - } - }, - "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 - } - } - } - } - } - }, - "delete": { - "description": "Removes an Agent from Inventory.", - "tags": [ - "AgentsService" - ], - "summary": "Remove an Agent from Inventory", - "operationId": "RemoveAgent", - "parameters": [ - { - "type": "string", - "name": "agent_id", - "in": "path", - "required": true - }, - { - "type": "boolean", - "description": "Remove agent with all dependencies.", - "name": "force", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/inventory/agents/{agent_id}/logs": { - "get": { - "description": "Returns Agent logs by ID.", - "tags": [ - "AgentsService" - ], - "summary": "Get Agent logs", - "operationId": "GetAgentLogs", - "parameters": [ - { - "type": "string", - "description": "Unique randomly generated instance identifier.", - "name": "agent_id", - "in": "path", - "required": true - }, - { - "type": "integer", - "format": "int64", - "description": "Limit the number of log lines to this value. Pass 0 for no limit.", - "name": "limit", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "logs": { - "type": "array", - "items": { - "type": "string" - }, - "x-order": 0 - }, - "agent_config_log_lines_count": { - "type": "integer", - "format": "int64", - "x-order": 1 - } - } - } - }, - "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/inventory/nodes": { - "get": { - "description": "Returns a list of all Nodes.", - "tags": [ - "NodesService" - ], - "summary": "List Nodes", - "operationId": "ListNodes", - "parameters": [ - { - "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" - ], - "type": "string", - "default": "NODE_TYPE_UNSPECIFIED", - "description": "Return only Nodes with matching Node type.", - "name": "node_type", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "generic": { - "type": "array", - "items": { - "description": "GenericNode represents a bare metal server or virtual machine.", - "type": "object", - "properties": { - "node_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "node_name": { - "description": "Unique across all Nodes user-defined name.", - "type": "string", - "x-order": 1 - }, - "address": { - "description": "Node address (DNS name or IP).", - "type": "string", - "x-order": 2 - }, - "machine_id": { - "description": "Linux machine-id.", - "type": "string", - "x-order": 3 - }, - "distro": { - "description": "Linux distribution name and version.", - "type": "string", - "x-order": 4 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 5 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 6 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 7 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 8 - } - } - }, - "x-order": 0 - }, - "container": { - "type": "array", - "items": { - "description": "ContainerNode represents a Docker container.", - "type": "object", - "properties": { - "node_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "node_name": { - "description": "Unique across all Nodes user-defined name.", - "type": "string", - "x-order": 1 - }, - "address": { - "description": "Node address (DNS name or IP).", - "type": "string", - "x-order": 2 - }, - "machine_id": { - "description": "Linux machine-id of the Generic Node where this Container Node runs.", - "type": "string", - "x-order": 3 - }, - "container_id": { - "description": "Container identifier. If specified, must be a unique Docker container identifier.", - "type": "string", - "x-order": 4 - }, - "container_name": { - "description": "Container name.", - "type": "string", - "x-order": 5 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 6 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 7 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 8 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 9 - } - } - }, - "x-order": 1 - }, - "remote": { - "type": "array", - "items": { - "description": "RemoteNode represents generic remote Node. It's a node where we don't run pmm-agents. Only external exporters can run on Remote Nodes.", - "type": "object", - "properties": { - "node_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "node_name": { - "description": "Unique across all Nodes user-defined name.", - "type": "string", - "x-order": 1 - }, - "address": { - "description": "Node address (DNS name or IP).", - "type": "string", - "x-order": 2 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 3 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 4 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 5 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 6 - } - } - }, - "x-order": 2 - }, - "remote_rds": { - "type": "array", - "items": { - "description": "RemoteRDSNode represents remote RDS Node. Agents can't run on Remote RDS Nodes.", - "type": "object", - "properties": { - "node_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "node_name": { - "description": "Unique across all Nodes user-defined name.", - "type": "string", - "x-order": 1 - }, - "address": { - "description": "DB instance identifier.", - "type": "string", - "x-order": 2 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 3 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 4 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 5 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 6 - }, - "instance_id": { - "description": "AWS instance ID.", - "type": "string", - "x-order": 7 - } - } - }, - "x-order": 3 - }, - "remote_azure_database": { - "type": "array", - "items": { - "description": "RemoteAzureDatabaseNode represents remote AzureDatabase Node. Agents can't run on Remote AzureDatabase Nodes.", - "type": "object", - "properties": { - "node_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "node_name": { - "description": "Unique across all Nodes user-defined name.", - "type": "string", - "x-order": 1 - }, - "address": { - "description": "DB instance identifier.", - "type": "string", - "x-order": 2 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 3 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 4 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 5 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 6 - } - } - }, - "x-order": 4 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - }, - "post": { - "description": "Adds a Node.", - "tags": [ - "NodesService" - ], - "summary": "Add a Node", - "operationId": "AddNode", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "generic": { - "type": "object", - "properties": { - "node_name": { - "description": "Unique across all Nodes user-defined name.", - "type": "string", - "x-order": 0 - }, - "address": { - "description": "Node address (DNS name or IP).", - "type": "string", - "x-order": 1 - }, - "machine_id": { - "description": "Linux machine-id.", - "type": "string", - "x-order": 2 - }, - "distro": { - "description": "Linux distribution name and version.", - "type": "string", - "x-order": 3 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 4 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 5 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 6 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 7 - } - }, - "x-order": 0 - }, - "container": { - "type": "object", - "properties": { - "node_name": { - "description": "Unique across all Nodes user-defined name.", - "type": "string", - "x-order": 0 - }, - "address": { - "description": "Node address (DNS name or IP).", - "type": "string", - "x-order": 1 - }, - "machine_id": { - "description": "Linux machine-id of the Generic Node where this Container Node runs.", - "type": "string", - "x-order": 2 - }, - "container_id": { - "description": "Container identifier. If specified, must be a unique Docker container identifier.", - "type": "string", - "x-order": 3 - }, - "container_name": { - "description": "Container name.", - "type": "string", - "x-order": 4 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 5 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 6 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 7 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 8 - } - }, - "x-order": 1 - }, - "remote": { - "type": "object", - "properties": { - "node_name": { - "description": "Unique across all Nodes user-defined name.", - "type": "string", - "x-order": 0 - }, - "address": { - "description": "Node address (DNS name or IP).", - "type": "string", - "x-order": 1 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 2 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 3 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 4 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 5 - } - }, - "x-order": 2 - }, - "remote_rds": { - "type": "object", - "properties": { - "node_name": { - "description": "Unique across all Nodes user-defined name.", - "type": "string", - "x-order": 0 - }, - "address": { - "description": "DB instance identifier.", - "type": "string", - "x-order": 1 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 2 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 3 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 4 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 5 - } - }, - "x-order": 3 - }, - "remote_azure": { - "type": "object", - "properties": { - "node_name": { - "description": "Unique across all Nodes user-defined name.", - "type": "string", - "x-order": 0 - }, - "address": { - "description": "DB instance identifier.", - "type": "string", - "x-order": 1 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 2 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 3 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 4 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 5 - } - }, - "x-order": 4 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "generic": { - "description": "GenericNode represents a bare metal server or virtual machine.", - "type": "object", - "properties": { - "node_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "node_name": { - "description": "Unique across all Nodes user-defined name.", - "type": "string", - "x-order": 1 - }, - "address": { - "description": "Node address (DNS name or IP).", - "type": "string", - "x-order": 2 - }, - "machine_id": { - "description": "Linux machine-id.", - "type": "string", - "x-order": 3 - }, - "distro": { - "description": "Linux distribution name and version.", - "type": "string", - "x-order": 4 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 5 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 6 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 7 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 8 - } - }, - "x-order": 0 - }, - "container": { - "description": "ContainerNode represents a Docker container.", - "type": "object", - "properties": { - "node_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "node_name": { - "description": "Unique across all Nodes user-defined name.", - "type": "string", - "x-order": 1 - }, - "address": { - "description": "Node address (DNS name or IP).", - "type": "string", - "x-order": 2 - }, - "machine_id": { - "description": "Linux machine-id of the Generic Node where this Container Node runs.", - "type": "string", - "x-order": 3 - }, - "container_id": { - "description": "Container identifier. If specified, must be a unique Docker container identifier.", - "type": "string", - "x-order": 4 - }, - "container_name": { - "description": "Container name.", - "type": "string", - "x-order": 5 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 6 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 7 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 8 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 9 - } - }, - "x-order": 1 - }, - "remote": { - "description": "RemoteNode represents generic remote Node. It's a node where we don't run pmm-agents. Only external exporters can run on Remote Nodes.", - "type": "object", - "properties": { - "node_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "node_name": { - "description": "Unique across all Nodes user-defined name.", - "type": "string", - "x-order": 1 - }, - "address": { - "description": "Node address (DNS name or IP).", - "type": "string", - "x-order": 2 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 3 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 4 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 5 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 6 - } - }, - "x-order": 2 - }, - "remote_rds": { - "description": "RemoteRDSNode represents remote RDS Node. Agents can't run on Remote RDS Nodes.", - "type": "object", - "properties": { - "node_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "node_name": { - "description": "Unique across all Nodes user-defined name.", - "type": "string", - "x-order": 1 - }, - "address": { - "description": "DB instance identifier.", - "type": "string", - "x-order": 2 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 3 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 4 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 5 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 6 - }, - "instance_id": { - "description": "AWS instance ID.", - "type": "string", - "x-order": 7 - } - }, - "x-order": 3 - }, - "remote_azure_database": { - "description": "RemoteAzureDatabaseNode represents remote AzureDatabase Node. Agents can't run on Remote AzureDatabase Nodes.", - "type": "object", - "properties": { - "node_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "node_name": { - "description": "Unique across all Nodes user-defined name.", - "type": "string", - "x-order": 1 - }, - "address": { - "description": "DB instance identifier.", - "type": "string", - "x-order": 2 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 3 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 4 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 5 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 6 - } - }, - "x-order": 4 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/inventory/nodes/{node_id}": { - "get": { - "description": "Returns a single Node by ID.", - "tags": [ - "NodesService" - ], - "summary": "Get a Node", - "operationId": "GetNode", - "parameters": [ - { - "type": "string", - "description": "Unique randomly generated instance identifier.", - "name": "node_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "generic": { - "description": "GenericNode represents a bare metal server or virtual machine.", - "type": "object", - "properties": { - "node_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "node_name": { - "description": "Unique across all Nodes user-defined name.", - "type": "string", - "x-order": 1 - }, - "address": { - "description": "Node address (DNS name or IP).", - "type": "string", - "x-order": 2 - }, - "machine_id": { - "description": "Linux machine-id.", - "type": "string", - "x-order": 3 - }, - "distro": { - "description": "Linux distribution name and version.", - "type": "string", - "x-order": 4 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 5 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 6 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 7 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 8 - } - }, - "x-order": 0 - }, - "container": { - "description": "ContainerNode represents a Docker container.", - "type": "object", - "properties": { - "node_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "node_name": { - "description": "Unique across all Nodes user-defined name.", - "type": "string", - "x-order": 1 - }, - "address": { - "description": "Node address (DNS name or IP).", - "type": "string", - "x-order": 2 - }, - "machine_id": { - "description": "Linux machine-id of the Generic Node where this Container Node runs.", - "type": "string", - "x-order": 3 - }, - "container_id": { - "description": "Container identifier. If specified, must be a unique Docker container identifier.", - "type": "string", - "x-order": 4 - }, - "container_name": { - "description": "Container name.", - "type": "string", - "x-order": 5 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 6 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 7 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 8 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 9 - } - }, - "x-order": 1 - }, - "remote": { - "description": "RemoteNode represents generic remote Node. It's a node where we don't run pmm-agents. Only external exporters can run on Remote Nodes.", - "type": "object", - "properties": { - "node_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "node_name": { - "description": "Unique across all Nodes user-defined name.", - "type": "string", - "x-order": 1 - }, - "address": { - "description": "Node address (DNS name or IP).", - "type": "string", - "x-order": 2 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 3 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 4 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 5 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 6 - } - }, - "x-order": 2 - }, - "remote_rds": { - "description": "RemoteRDSNode represents remote RDS Node. Agents can't run on Remote RDS Nodes.", - "type": "object", - "properties": { - "node_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "node_name": { - "description": "Unique across all Nodes user-defined name.", - "type": "string", - "x-order": 1 - }, - "address": { - "description": "DB instance identifier.", - "type": "string", - "x-order": 2 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 3 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 4 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 5 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 6 - }, - "instance_id": { - "description": "AWS instance ID.", - "type": "string", - "x-order": 7 - } - }, - "x-order": 3 - }, - "remote_azure_database": { - "description": "RemoteAzureDatabaseNode represents remote AzureDatabase Node. Agents can't run on Remote AzureDatabase Nodes.", - "type": "object", - "properties": { - "node_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "node_name": { - "description": "Unique across all Nodes user-defined name.", - "type": "string", - "x-order": 1 - }, - "address": { - "description": "DB instance identifier.", - "type": "string", - "x-order": 2 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 3 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 4 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 5 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 6 - } - }, - "x-order": 4 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - }, - "delete": { - "description": "Removes a Node.", - "tags": [ - "NodesService" - ], - "summary": "Remove a Node", - "operationId": "RemoveNode", - "parameters": [ - { - "type": "string", - "description": "Unique randomly generated instance identifier.", - "name": "node_id", - "in": "path", - "required": true - }, - { - "type": "boolean", - "description": "Remove node with all dependencies.", - "name": "force", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/inventory/services": { - "get": { - "description": "Returns a list of Services filtered by type.", - "tags": [ - "ServicesService" - ], - "summary": "List Services", - "operationId": "ListServices", - "parameters": [ - { - "type": "string", - "description": "Return only Services running on that Node.", - "name": "node_id", - "in": "query" - }, - { - "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" - ], - "type": "string", - "default": "SERVICE_TYPE_UNSPECIFIED", - "description": "Return only services filtered by service type.", - "name": "service_type", - "in": "query" - }, - { - "type": "string", - "description": "Return only services in this external group.", - "name": "external_group", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "mysql": { - "type": "array", - "items": { - "description": "MySQLService represents a generic MySQL 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": "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 - }, - "mongodb": { - "type": "array", - "items": { - "description": "MongoDBService represents a generic MongoDB 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": "MongoDB version.", - "type": "string", - "x-order": 10 - } - } - }, - "x-order": 1 - }, - "postgresql": { - "type": "array", - "items": { - "description": "PostgreSQLService represents a generic PostgreSQL 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 - }, - "database_name": { - "description": "Database name.", - "type": "string", - "x-order": 2 - }, - "node_id": { - "description": "Node identifier where this instance runs.", - "type": "string", - "x-order": 3 - }, - "address": { - "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required.", - "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.", - "type": "string", - "x-order": 9 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 10 - }, - "version": { - "description": "PostgreSQL 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": 2 - }, - "proxysql": { - "type": "array", - "items": { - "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": 3 - }, - "haproxy": { - "type": "array", - "items": { - "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.", - "type": "string", - "x-order": 5 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 6 - } - } - }, - "x-order": 4 - }, - "external": { - "type": "array", - "items": { - "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.", - "type": "string", - "x-order": 7 - } - } - }, - "x-order": 5 - }, - "valkey": { - "type": "array", - "items": { - "description": "ValkeyService represents a generic Valkey 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": "Valkey version.", - "type": "string", - "x-order": 10 - } - } - }, - "x-order": 6 - } - } - } - }, - "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 - } - } - } - } - } - }, - "post": { - "description": "Adds a Service.", - "tags": [ - "ServicesService" - ], - "summary": "Add a Service", - "operationId": "AddService", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "mysql": { - "type": "object", - "properties": { - "service_name": { - "description": "Unique across all Services user-defined name. Required.", - "type": "string", - "x-order": 0 - }, - "node_id": { - "description": "Node identifier where this instance runs. Required.", - "type": "string", - "x-order": 1 - }, - "address": { - "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required.", - "type": "string", - "x-order": 2 - }, - "port": { - "description": "Access port.\nPort is required when the address present.", - "type": "integer", - "format": "int64", - "x-order": 3 - }, - "socket": { - "description": "Access unix socket.\nAddress (and port) or socket is required.", - "type": "string", - "x-order": 4 - }, - "environment": { - "description": "Environment name.", - "type": "string", - "x-order": 5 - }, - "cluster": { - "description": "Cluster name.", - "type": "string", - "x-order": 6 - }, - "replication_set": { - "description": "Replication set name.", - "type": "string", - "x-order": 7 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 8 - }, - "extra_dsn_params": { - "description": "Extra parameters to be added to the DSN.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 9 - } - }, - "x-order": 0 - }, - "mongodb": { - "type": "object", - "properties": { - "service_name": { - "description": "Unique across all Services user-defined name. Required.", - "type": "string", - "x-order": 0 - }, - "node_id": { - "description": "Node identifier where this instance runs. Required.", - "type": "string", - "x-order": 1 - }, - "address": { - "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required.", - "type": "string", - "x-order": 2 - }, - "port": { - "description": "Access port.\nPort is required when the address present.", - "type": "integer", - "format": "int64", - "x-order": 3 - }, - "socket": { - "description": "Access unix socket.\nAddress (and port) or socket is required.", - "type": "string", - "x-order": 4 - }, - "environment": { - "description": "Environment name.", - "type": "string", - "x-order": 5 - }, - "cluster": { - "description": "Cluster name.", - "type": "string", - "x-order": 6 - }, - "replication_set": { - "description": "Replication set name.", - "type": "string", - "x-order": 7 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 8 - } - }, - "x-order": 1 - }, - "postgresql": { - "type": "object", - "properties": { - "service_name": { - "description": "Unique across all Services user-defined name. Required.", - "type": "string", - "x-order": 0 - }, - "node_id": { - "description": "Node identifier where this instance runs. Required.", - "type": "string", - "x-order": 1 - }, - "address": { - "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required.", - "type": "string", - "x-order": 2 - }, - "port": { - "description": "Access port.\nPort is required when the address present.", - "type": "integer", - "format": "int64", - "x-order": 3 - }, - "socket": { - "description": "Access unix socket.\nAddress (and port) or socket is required.", - "type": "string", - "x-order": 4 - }, - "environment": { - "description": "Environment name.", - "type": "string", - "x-order": 5 - }, - "cluster": { - "description": "Cluster name.", - "type": "string", - "x-order": 6 - }, - "replication_set": { - "description": "Replication set name.", - "type": "string", - "x-order": 7 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 8 - }, - "auto_discovery_limit": { - "description": "Limit of databases for auto-discovery.", - "type": "integer", - "format": "int32", - "x-order": 9 - } - }, - "x-order": 2 - }, - "proxysql": { - "type": "object", - "properties": { - "service_name": { - "description": "Unique across all Services user-defined name. Required.", - "type": "string", - "x-order": 0 - }, - "node_id": { - "description": "Node identifier where this instance runs. Required.", - "type": "string", - "x-order": 1 - }, - "address": { - "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required.", - "type": "string", - "x-order": 2 - }, - "port": { - "description": "Access port.\nPort is required when the address present.", - "type": "integer", - "format": "int64", - "x-order": 3 - }, - "socket": { - "description": "Access unix socket.\nAddress (and port) or socket is required.", - "type": "string", - "x-order": 4 - }, - "environment": { - "description": "Environment name.", - "type": "string", - "x-order": 5 - }, - "cluster": { - "description": "Cluster name.", - "type": "string", - "x-order": 6 - }, - "replication_set": { - "description": "Replication set name.", - "type": "string", - "x-order": 7 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 8 - } - }, - "x-order": 3 - }, - "haproxy": { - "type": "object", - "properties": { - "service_name": { - "description": "Unique across all Services user-defined name. Required.", - "type": "string", - "x-order": 0 - }, - "node_id": { - "description": "Node identifier where this instance runs. Required.", - "type": "string", - "x-order": 1 - }, - "environment": { - "description": "Environment name.", - "type": "string", - "x-order": 2 - }, - "cluster": { - "description": "Cluster name.", - "type": "string", - "x-order": 3 - }, - "replication_set": { - "description": "Replication set name.", - "type": "string", - "x-order": 4 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 5 - } - }, - "x-order": 4 - }, - "external": { - "type": "object", - "properties": { - "service_name": { - "description": "Unique across all Services user-defined name. Required.", - "type": "string", - "x-order": 0 - }, - "node_id": { - "description": "Node identifier where this instance runs. Required.", - "type": "string", - "x-order": 1 - }, - "environment": { - "description": "Environment name.", - "type": "string", - "x-order": 2 - }, - "cluster": { - "description": "Cluster name.", - "type": "string", - "x-order": 3 - }, - "replication_set": { - "description": "Replication set name.", - "type": "string", - "x-order": 4 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 5 - }, - "group": { - "description": "Group name of external service.", - "type": "string", - "x-order": 6 - } - }, - "x-order": 5 - }, - "valkey": { - "type": "object", - "properties": { - "service_name": { - "description": "Unique across all Services user-defined name. Required.", - "type": "string", - "x-order": 0 - }, - "node_id": { - "description": "Node identifier where this instance runs. Required.", - "type": "string", - "x-order": 1 - }, - "address": { - "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required.", - "type": "string", - "x-order": 2 - }, - "port": { - "description": "Access port.\nPort is required when the address present.", - "type": "integer", - "format": "int64", - "x-order": 3 - }, - "socket": { - "description": "Access unix socket.\nAddress (and port) or socket is required.", - "type": "string", - "x-order": 4 - }, - "environment": { - "description": "Environment name.", - "type": "string", - "x-order": 5 - }, - "cluster": { - "description": "Cluster name.", - "type": "string", - "x-order": 6 - }, - "replication_set": { - "description": "Replication set name.", - "type": "string", - "x-order": 7 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 8 - } - }, - "x-order": 6 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "mysql": { - "description": "MySQLService represents a generic MySQL 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": "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 - }, - "mongodb": { - "description": "MongoDBService represents a generic MongoDB 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": "MongoDB version.", - "type": "string", - "x-order": 10 - } - }, - "x-order": 1 - }, - "postgresql": { - "description": "PostgreSQLService represents a generic PostgreSQL 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 - }, - "database_name": { - "description": "Database name.", - "type": "string", - "x-order": 2 - }, - "node_id": { - "description": "Node identifier where this instance runs.", - "type": "string", - "x-order": 3 - }, - "address": { - "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required.", - "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.", - "type": "string", - "x-order": 9 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 10 - }, - "version": { - "description": "PostgreSQL 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": 2 - }, - "proxysql": { - "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": 3 - }, - "haproxy": { - "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.", - "type": "string", - "x-order": 5 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 6 - } - }, - "x-order": 4 - }, - "external": { - "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.", - "type": "string", - "x-order": 7 - } - }, - "x-order": 5 - }, - "valkey": { - "description": "ValkeyService represents a generic Valkey 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": "Valkey version.", - "type": "string", - "x-order": 10 - } - }, - "x-order": 6 - } - } - } - }, - "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/inventory/services/{service_id}": { - "get": { - "description": "Returns a single Service by ID.", - "tags": [ - "ServicesService" - ], - "summary": "Get a Service", - "operationId": "GetService", - "parameters": [ - { - "type": "string", - "description": "Unique randomly generated instance identifier.", - "name": "service_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "mysql": { - "description": "MySQLService represents a generic MySQL 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": "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 - }, - "mongodb": { - "description": "MongoDBService represents a generic MongoDB 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": "MongoDB version.", - "type": "string", - "x-order": 10 - } - }, - "x-order": 1 - }, - "postgresql": { - "description": "PostgreSQLService represents a generic PostgreSQL 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 - }, - "database_name": { - "description": "Database name.", - "type": "string", - "x-order": 2 - }, - "node_id": { - "description": "Node identifier where this instance runs.", - "type": "string", - "x-order": 3 - }, - "address": { - "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required.", - "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.", - "type": "string", - "x-order": 9 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 10 - }, - "version": { - "description": "PostgreSQL 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": 2 - }, - "proxysql": { - "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": 3 - }, - "haproxy": { - "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.", - "type": "string", - "x-order": 5 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 6 - } - }, - "x-order": 4 - }, - "external": { - "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.", - "type": "string", - "x-order": 7 - } - }, - "x-order": 5 - }, - "valkey": { - "description": "ValkeyService represents a generic Valkey 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": "Valkey version.", - "type": "string", - "x-order": 10 - } - }, - "x-order": 6 - } - } - } - }, - "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 - } - } - } - } - } - }, - "put": { - "description": "Changes service configuration. If a new cluster label is specified, it removes all backup/restore tasks scheduled for the related services. Fails if there are running backup/restore tasks.", - "tags": [ - "ServicesService" - ], - "summary": "Change service", - "operationId": "ChangeService", - "parameters": [ - { - "type": "string", - "name": "service_id", - "in": "path", - "required": true - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "environment": { - "type": "string", - "x-nullable": true, - "x-order": 0 - }, - "cluster": { - "type": "string", - "x-nullable": true, - "x-order": 1 - }, - "replication_set": { - "type": "string", - "x-nullable": true, - "x-order": 2 - }, - "external_group": { - "type": "string", - "x-nullable": true, - "x-order": 3 - }, - "custom_labels": { - "description": "A wrapper for map[string]string. This type allows to distinguish between an empty map and a null value.", - "type": "object", - "properties": { - "values": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 0 - } - }, - "x-nullable": true, - "x-order": 4 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "mysql": { - "description": "MySQLService represents a generic MySQL 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": "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 - }, - "mongodb": { - "description": "MongoDBService represents a generic MongoDB 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": "MongoDB version.", - "type": "string", - "x-order": 10 - } - }, - "x-order": 1 - }, - "postgresql": { - "description": "PostgreSQLService represents a generic PostgreSQL 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 - }, - "database_name": { - "description": "Database name.", - "type": "string", - "x-order": 2 - }, - "node_id": { - "description": "Node identifier where this instance runs.", - "type": "string", - "x-order": 3 - }, - "address": { - "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required.", - "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.", - "type": "string", - "x-order": 9 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 10 - }, - "version": { - "description": "PostgreSQL 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": 2 - }, - "proxysql": { - "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": 3 - }, - "haproxy": { - "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.", - "type": "string", - "x-order": 5 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 6 - } - }, - "x-order": 4 - }, - "external": { - "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.", - "type": "string", - "x-order": 7 - } - }, - "x-order": 5 - }, - "valkey": { - "description": "ValkeyService represents a generic Valkey 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": "Valkey version.", - "type": "string", - "x-order": 10 - } - }, - "x-order": 6 - } - } - } - }, - "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 - } - } - } - } - } - }, - "delete": { - "description": "Removes Service.", - "tags": [ - "ServicesService" - ], - "summary": "Remove Service", - "operationId": "RemoveService", - "parameters": [ - { - "type": "string", - "description": "Unique randomly generated instance identifier. Required.", - "name": "service_id", - "in": "path", - "required": true - }, - { - "type": "boolean", - "description": "Remove service with all dependencies.", - "name": "force", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/inventory/services:getTypes": { - "post": { - "description": "Returns a list of active Service types.", - "tags": [ - "ServicesService" - ], - "summary": "List Active Service Types", - "operationId": "ListActiveServiceTypes", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object" - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "service_types": { - "type": "array", - "items": { - "description": "ServiceType describes supported Service types.", - "type": "string", - "default": "SERVICE_TYPE_UNSPECIFIED", - "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" - ] - }, - "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 - } - } - } - } - } - } - } - }, - "tags": [ - { - "name": "AgentsService" - }, - { - "name": "NodesService" - }, - { - "name": "ServicesService" - } - ] -} \ No newline at end of file diff --git a/api/inventory/v1/log_level.pb.go b/api/inventory/v1/log_level.pb.go deleted file mode 100644 index e0f86d4e9a3..00000000000 --- a/api/inventory/v1/log_level.pb.go +++ /dev/null @@ -1,148 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.10 -// protoc (unknown) -// source: inventory/v1/log_level.proto - -package inventoryv1 - -import ( - reflect "reflect" - sync "sync" - unsafe "unsafe" - - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// Log level for exporters -type LogLevel int32 - -const ( - // Auto - LogLevel_LOG_LEVEL_UNSPECIFIED LogLevel = 0 - LogLevel_LOG_LEVEL_FATAL LogLevel = 1 - LogLevel_LOG_LEVEL_ERROR LogLevel = 2 - LogLevel_LOG_LEVEL_WARN LogLevel = 3 - LogLevel_LOG_LEVEL_INFO LogLevel = 4 - LogLevel_LOG_LEVEL_DEBUG LogLevel = 5 -) - -// Enum value maps for LogLevel. -var ( - LogLevel_name = map[int32]string{ - 0: "LOG_LEVEL_UNSPECIFIED", - 1: "LOG_LEVEL_FATAL", - 2: "LOG_LEVEL_ERROR", - 3: "LOG_LEVEL_WARN", - 4: "LOG_LEVEL_INFO", - 5: "LOG_LEVEL_DEBUG", - } - LogLevel_value = map[string]int32{ - "LOG_LEVEL_UNSPECIFIED": 0, - "LOG_LEVEL_FATAL": 1, - "LOG_LEVEL_ERROR": 2, - "LOG_LEVEL_WARN": 3, - "LOG_LEVEL_INFO": 4, - "LOG_LEVEL_DEBUG": 5, - } -) - -func (x LogLevel) Enum() *LogLevel { - p := new(LogLevel) - *p = x - return p -} - -func (x LogLevel) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (LogLevel) Descriptor() protoreflect.EnumDescriptor { - return file_inventory_v1_log_level_proto_enumTypes[0].Descriptor() -} - -func (LogLevel) Type() protoreflect.EnumType { - return &file_inventory_v1_log_level_proto_enumTypes[0] -} - -func (x LogLevel) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use LogLevel.Descriptor instead. -func (LogLevel) EnumDescriptor() ([]byte, []int) { - return file_inventory_v1_log_level_proto_rawDescGZIP(), []int{0} -} - -var File_inventory_v1_log_level_proto protoreflect.FileDescriptor - -const file_inventory_v1_log_level_proto_rawDesc = "" + - "\n" + - "\x1cinventory/v1/log_level.proto\x12\finventory.v1*\x8c\x01\n" + - "\bLogLevel\x12\x19\n" + - "\x15LOG_LEVEL_UNSPECIFIED\x10\x00\x12\x13\n" + - "\x0fLOG_LEVEL_FATAL\x10\x01\x12\x13\n" + - "\x0fLOG_LEVEL_ERROR\x10\x02\x12\x12\n" + - "\x0eLOG_LEVEL_WARN\x10\x03\x12\x12\n" + - "\x0eLOG_LEVEL_INFO\x10\x04\x12\x13\n" + - "\x0fLOG_LEVEL_DEBUG\x10\x05B\xa7\x01\n" + - "\x10com.inventory.v1B\rLogLevelProtoP\x01Z3github.com/percona/pmm/api/inventory/v1;inventoryv1\xa2\x02\x03IXX\xaa\x02\fInventory.V1\xca\x02\fInventory\\V1\xe2\x02\x18Inventory\\V1\\GPBMetadata\xea\x02\rInventory::V1b\x06proto3" - -var ( - file_inventory_v1_log_level_proto_rawDescOnce sync.Once - file_inventory_v1_log_level_proto_rawDescData []byte -) - -func file_inventory_v1_log_level_proto_rawDescGZIP() []byte { - file_inventory_v1_log_level_proto_rawDescOnce.Do(func() { - file_inventory_v1_log_level_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_inventory_v1_log_level_proto_rawDesc), len(file_inventory_v1_log_level_proto_rawDesc))) - }) - 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_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_inventory_v1_log_level_proto_init() } -func file_inventory_v1_log_level_proto_init() { - if File_inventory_v1_log_level_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_inventory_v1_log_level_proto_rawDesc), len(file_inventory_v1_log_level_proto_rawDesc)), - NumEnums: 1, - NumMessages: 0, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_inventory_v1_log_level_proto_goTypes, - DependencyIndexes: file_inventory_v1_log_level_proto_depIdxs, - EnumInfos: file_inventory_v1_log_level_proto_enumTypes, - }.Build() - File_inventory_v1_log_level_proto = out.File - file_inventory_v1_log_level_proto_goTypes = nil - file_inventory_v1_log_level_proto_depIdxs = nil -} diff --git a/api/inventory/v1/log_level.pb.validate.go b/api/inventory/v1/log_level.pb.validate.go deleted file mode 100644 index 3ab6c681903..00000000000 --- a/api/inventory/v1/log_level.pb.validate.go +++ /dev/null @@ -1,36 +0,0 @@ -// Code generated by protoc-gen-validate. DO NOT EDIT. -// source: inventory/v1/log_level.proto - -package inventoryv1 - -import ( - "bytes" - "errors" - "fmt" - "net" - "net/mail" - "net/url" - "regexp" - "sort" - "strings" - "time" - "unicode/utf8" - - "google.golang.org/protobuf/types/known/anypb" -) - -// ensure the imports are used -var ( - _ = bytes.MinRead - _ = errors.New("") - _ = fmt.Print - _ = utf8.UTFMax - _ = (*regexp.Regexp)(nil) - _ = (*strings.Reader)(nil) - _ = net.IPv4len - _ = time.Duration(0) - _ = (*url.URL)(nil) - _ = (*mail.Address)(nil) - _ = anypb.Any{} - _ = sort.Sort -) diff --git a/api/inventory/v1/nodes.pb.go b/api/inventory/v1/nodes.pb.go deleted file mode 100644 index 790d71eef51..00000000000 --- a/api/inventory/v1/nodes.pb.go +++ /dev/null @@ -1,2117 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.10 -// protoc (unknown) -// source: inventory/v1/nodes.proto - -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" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// NodeType describes supported Node types. -type NodeType int32 - -const ( - NodeType_NODE_TYPE_UNSPECIFIED NodeType = 0 - NodeType_NODE_TYPE_GENERIC_NODE NodeType = 1 - NodeType_NODE_TYPE_CONTAINER_NODE NodeType = 2 - NodeType_NODE_TYPE_REMOTE_NODE NodeType = 3 - NodeType_NODE_TYPE_REMOTE_RDS_NODE NodeType = 4 - NodeType_NODE_TYPE_REMOTE_AZURE_DATABASE_NODE NodeType = 5 -) - -// Enum value maps for NodeType. -var ( - NodeType_name = map[int32]string{ - 0: "NODE_TYPE_UNSPECIFIED", - 1: "NODE_TYPE_GENERIC_NODE", - 2: "NODE_TYPE_CONTAINER_NODE", - 3: "NODE_TYPE_REMOTE_NODE", - 4: "NODE_TYPE_REMOTE_RDS_NODE", - 5: "NODE_TYPE_REMOTE_AZURE_DATABASE_NODE", - } - NodeType_value = map[string]int32{ - "NODE_TYPE_UNSPECIFIED": 0, - "NODE_TYPE_GENERIC_NODE": 1, - "NODE_TYPE_CONTAINER_NODE": 2, - "NODE_TYPE_REMOTE_NODE": 3, - "NODE_TYPE_REMOTE_RDS_NODE": 4, - "NODE_TYPE_REMOTE_AZURE_DATABASE_NODE": 5, - } -) - -func (x NodeType) Enum() *NodeType { - p := new(NodeType) - *p = x - return p -} - -func (x NodeType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (NodeType) Descriptor() protoreflect.EnumDescriptor { - return file_inventory_v1_nodes_proto_enumTypes[0].Descriptor() -} - -func (NodeType) Type() protoreflect.EnumType { - return &file_inventory_v1_nodes_proto_enumTypes[0] -} - -func (x NodeType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use NodeType.Descriptor instead. -func (NodeType) EnumDescriptor() ([]byte, []int) { - return file_inventory_v1_nodes_proto_rawDescGZIP(), []int{0} -} - -// GenericNode represents a bare metal server or virtual machine. -type GenericNode struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Unique randomly generated instance identifier. - NodeId string `protobuf:"bytes,1,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` - // Unique across all Nodes user-defined name. - NodeName string `protobuf:"bytes,2,opt,name=node_name,json=nodeName,proto3" json:"node_name,omitempty"` - // Node address (DNS name or IP). - Address string `protobuf:"bytes,3,opt,name=address,proto3" json:"address,omitempty"` - // Linux machine-id. - MachineId string `protobuf:"bytes,4,opt,name=machine_id,json=machineId,proto3" json:"machine_id,omitempty"` - // Linux distribution name and version. - Distro string `protobuf:"bytes,5,opt,name=distro,proto3" json:"distro,omitempty"` - // Node model. - NodeModel string `protobuf:"bytes,6,opt,name=node_model,json=nodeModel,proto3" json:"node_model,omitempty"` - // Node region. - Region string `protobuf:"bytes,7,opt,name=region,proto3" json:"region,omitempty"` - // Node availability zone. - Az string `protobuf:"bytes,8,opt,name=az,proto3" json:"az,omitempty"` - // Custom user-assigned labels. - CustomLabels map[string]string `protobuf:"bytes,9,rep,name=custom_labels,json=customLabels,proto3" json:"custom_labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GenericNode) Reset() { - *x = GenericNode{} - mi := &file_inventory_v1_nodes_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GenericNode) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GenericNode) ProtoMessage() {} - -func (x *GenericNode) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_nodes_proto_msgTypes[0] - 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 GenericNode.ProtoReflect.Descriptor instead. -func (*GenericNode) Descriptor() ([]byte, []int) { - return file_inventory_v1_nodes_proto_rawDescGZIP(), []int{0} -} - -func (x *GenericNode) GetNodeId() string { - if x != nil { - return x.NodeId - } - return "" -} - -func (x *GenericNode) GetNodeName() string { - if x != nil { - return x.NodeName - } - return "" -} - -func (x *GenericNode) GetAddress() string { - if x != nil { - return x.Address - } - return "" -} - -func (x *GenericNode) GetMachineId() string { - if x != nil { - return x.MachineId - } - return "" -} - -func (x *GenericNode) GetDistro() string { - if x != nil { - return x.Distro - } - return "" -} - -func (x *GenericNode) GetNodeModel() string { - if x != nil { - return x.NodeModel - } - return "" -} - -func (x *GenericNode) GetRegion() string { - if x != nil { - return x.Region - } - return "" -} - -func (x *GenericNode) GetAz() string { - if x != nil { - return x.Az - } - return "" -} - -func (x *GenericNode) GetCustomLabels() map[string]string { - if x != nil { - return x.CustomLabels - } - return nil -} - -// ContainerNode represents a Docker container. -type ContainerNode struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Unique randomly generated instance identifier. - NodeId string `protobuf:"bytes,1,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` - // Unique across all Nodes user-defined name. - NodeName string `protobuf:"bytes,2,opt,name=node_name,json=nodeName,proto3" json:"node_name,omitempty"` - // Node address (DNS name or IP). - Address string `protobuf:"bytes,3,opt,name=address,proto3" json:"address,omitempty"` - // Linux machine-id of the Generic Node where this Container Node runs. - MachineId string `protobuf:"bytes,4,opt,name=machine_id,json=machineId,proto3" json:"machine_id,omitempty"` - // Container identifier. If specified, must be a unique Docker container identifier. - ContainerId string `protobuf:"bytes,5,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` - // Container name. - ContainerName string `protobuf:"bytes,6,opt,name=container_name,json=containerName,proto3" json:"container_name,omitempty"` - // Node model. - NodeModel string `protobuf:"bytes,7,opt,name=node_model,json=nodeModel,proto3" json:"node_model,omitempty"` - // Node region. - Region string `protobuf:"bytes,8,opt,name=region,proto3" json:"region,omitempty"` - // Node availability zone. - Az string `protobuf:"bytes,9,opt,name=az,proto3" json:"az,omitempty"` - // Custom user-assigned labels. - CustomLabels map[string]string `protobuf:"bytes,10,rep,name=custom_labels,json=customLabels,proto3" json:"custom_labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ContainerNode) Reset() { - *x = ContainerNode{} - mi := &file_inventory_v1_nodes_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ContainerNode) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ContainerNode) ProtoMessage() {} - -func (x *ContainerNode) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_nodes_proto_msgTypes[1] - 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 ContainerNode.ProtoReflect.Descriptor instead. -func (*ContainerNode) Descriptor() ([]byte, []int) { - return file_inventory_v1_nodes_proto_rawDescGZIP(), []int{1} -} - -func (x *ContainerNode) GetNodeId() string { - if x != nil { - return x.NodeId - } - return "" -} - -func (x *ContainerNode) GetNodeName() string { - if x != nil { - return x.NodeName - } - return "" -} - -func (x *ContainerNode) GetAddress() string { - if x != nil { - return x.Address - } - return "" -} - -func (x *ContainerNode) GetMachineId() string { - if x != nil { - return x.MachineId - } - return "" -} - -func (x *ContainerNode) GetContainerId() string { - if x != nil { - return x.ContainerId - } - return "" -} - -func (x *ContainerNode) GetContainerName() string { - if x != nil { - return x.ContainerName - } - return "" -} - -func (x *ContainerNode) GetNodeModel() string { - if x != nil { - return x.NodeModel - } - return "" -} - -func (x *ContainerNode) GetRegion() string { - if x != nil { - return x.Region - } - return "" -} - -func (x *ContainerNode) GetAz() string { - if x != nil { - return x.Az - } - return "" -} - -func (x *ContainerNode) GetCustomLabels() map[string]string { - if x != nil { - return x.CustomLabels - } - return nil -} - -// RemoteNode represents generic remote Node. It's a node where we don't run pmm-agents. Only external exporters can run on Remote Nodes. -type RemoteNode struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Unique randomly generated instance identifier. - NodeId string `protobuf:"bytes,1,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` - // Unique across all Nodes user-defined name. - NodeName string `protobuf:"bytes,2,opt,name=node_name,json=nodeName,proto3" json:"node_name,omitempty"` - // Node address (DNS name or IP). - Address string `protobuf:"bytes,3,opt,name=address,proto3" json:"address,omitempty"` - // Node model. - NodeModel string `protobuf:"bytes,4,opt,name=node_model,json=nodeModel,proto3" json:"node_model,omitempty"` - // Node region. - Region string `protobuf:"bytes,5,opt,name=region,proto3" json:"region,omitempty"` - // Node availability zone. - Az string `protobuf:"bytes,6,opt,name=az,proto3" json:"az,omitempty"` - // Custom user-assigned labels. - CustomLabels map[string]string `protobuf:"bytes,7,rep,name=custom_labels,json=customLabels,proto3" json:"custom_labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *RemoteNode) Reset() { - *x = RemoteNode{} - mi := &file_inventory_v1_nodes_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *RemoteNode) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RemoteNode) ProtoMessage() {} - -func (x *RemoteNode) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_nodes_proto_msgTypes[2] - 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 RemoteNode.ProtoReflect.Descriptor instead. -func (*RemoteNode) Descriptor() ([]byte, []int) { - return file_inventory_v1_nodes_proto_rawDescGZIP(), []int{2} -} - -func (x *RemoteNode) GetNodeId() string { - if x != nil { - return x.NodeId - } - return "" -} - -func (x *RemoteNode) GetNodeName() string { - if x != nil { - return x.NodeName - } - return "" -} - -func (x *RemoteNode) GetAddress() string { - if x != nil { - return x.Address - } - return "" -} - -func (x *RemoteNode) GetNodeModel() string { - if x != nil { - return x.NodeModel - } - return "" -} - -func (x *RemoteNode) GetRegion() string { - if x != nil { - return x.Region - } - return "" -} - -func (x *RemoteNode) GetAz() string { - if x != nil { - return x.Az - } - return "" -} - -func (x *RemoteNode) GetCustomLabels() map[string]string { - if x != nil { - return x.CustomLabels - } - return nil -} - -// RemoteRDSNode represents remote RDS Node. Agents can't run on Remote RDS Nodes. -type RemoteRDSNode struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Unique randomly generated instance identifier. - NodeId string `protobuf:"bytes,1,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` - // Unique across all Nodes user-defined name. - NodeName string `protobuf:"bytes,2,opt,name=node_name,json=nodeName,proto3" json:"node_name,omitempty"` - // DB instance identifier. - Address string `protobuf:"bytes,3,opt,name=address,proto3" json:"address,omitempty"` - // Node model. - NodeModel string `protobuf:"bytes,4,opt,name=node_model,json=nodeModel,proto3" json:"node_model,omitempty"` - // Node region. - Region string `protobuf:"bytes,5,opt,name=region,proto3" json:"region,omitempty"` - // Node availability zone. - Az string `protobuf:"bytes,6,opt,name=az,proto3" json:"az,omitempty"` - // Custom user-assigned labels. - CustomLabels map[string]string `protobuf:"bytes,7,rep,name=custom_labels,json=customLabels,proto3" json:"custom_labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - // AWS instance ID. - InstanceId string `protobuf:"bytes,8,opt,name=instance_id,json=instanceId,proto3" json:"instance_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *RemoteRDSNode) Reset() { - *x = RemoteRDSNode{} - mi := &file_inventory_v1_nodes_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *RemoteRDSNode) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RemoteRDSNode) ProtoMessage() {} - -func (x *RemoteRDSNode) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_nodes_proto_msgTypes[3] - 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 RemoteRDSNode.ProtoReflect.Descriptor instead. -func (*RemoteRDSNode) Descriptor() ([]byte, []int) { - return file_inventory_v1_nodes_proto_rawDescGZIP(), []int{3} -} - -func (x *RemoteRDSNode) GetNodeId() string { - if x != nil { - return x.NodeId - } - return "" -} - -func (x *RemoteRDSNode) GetNodeName() string { - if x != nil { - return x.NodeName - } - return "" -} - -func (x *RemoteRDSNode) GetAddress() string { - if x != nil { - return x.Address - } - return "" -} - -func (x *RemoteRDSNode) GetNodeModel() string { - if x != nil { - return x.NodeModel - } - return "" -} - -func (x *RemoteRDSNode) GetRegion() string { - if x != nil { - return x.Region - } - return "" -} - -func (x *RemoteRDSNode) GetAz() string { - if x != nil { - return x.Az - } - return "" -} - -func (x *RemoteRDSNode) GetCustomLabels() map[string]string { - if x != nil { - return x.CustomLabels - } - return nil -} - -func (x *RemoteRDSNode) GetInstanceId() string { - if x != nil { - return x.InstanceId - } - return "" -} - -// RemoteAzureDatabaseNode represents remote AzureDatabase Node. Agents can't run on Remote AzureDatabase Nodes. -type RemoteAzureDatabaseNode struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Unique randomly generated instance identifier. - NodeId string `protobuf:"bytes,1,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` - // Unique across all Nodes user-defined name. - NodeName string `protobuf:"bytes,2,opt,name=node_name,json=nodeName,proto3" json:"node_name,omitempty"` - // DB instance identifier. - Address string `protobuf:"bytes,3,opt,name=address,proto3" json:"address,omitempty"` - // Node model. - NodeModel string `protobuf:"bytes,4,opt,name=node_model,json=nodeModel,proto3" json:"node_model,omitempty"` - // Node region. - Region string `protobuf:"bytes,5,opt,name=region,proto3" json:"region,omitempty"` - // Node availability zone. - Az string `protobuf:"bytes,6,opt,name=az,proto3" json:"az,omitempty"` - // Custom user-assigned labels. - CustomLabels map[string]string `protobuf:"bytes,7,rep,name=custom_labels,json=customLabels,proto3" json:"custom_labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *RemoteAzureDatabaseNode) Reset() { - *x = RemoteAzureDatabaseNode{} - mi := &file_inventory_v1_nodes_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *RemoteAzureDatabaseNode) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RemoteAzureDatabaseNode) ProtoMessage() {} - -func (x *RemoteAzureDatabaseNode) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_nodes_proto_msgTypes[4] - 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 RemoteAzureDatabaseNode.ProtoReflect.Descriptor instead. -func (*RemoteAzureDatabaseNode) Descriptor() ([]byte, []int) { - return file_inventory_v1_nodes_proto_rawDescGZIP(), []int{4} -} - -func (x *RemoteAzureDatabaseNode) GetNodeId() string { - if x != nil { - return x.NodeId - } - return "" -} - -func (x *RemoteAzureDatabaseNode) GetNodeName() string { - if x != nil { - return x.NodeName - } - return "" -} - -func (x *RemoteAzureDatabaseNode) GetAddress() string { - if x != nil { - return x.Address - } - return "" -} - -func (x *RemoteAzureDatabaseNode) GetNodeModel() string { - if x != nil { - return x.NodeModel - } - return "" -} - -func (x *RemoteAzureDatabaseNode) GetRegion() string { - if x != nil { - return x.Region - } - return "" -} - -func (x *RemoteAzureDatabaseNode) GetAz() string { - if x != nil { - return x.Az - } - return "" -} - -func (x *RemoteAzureDatabaseNode) GetCustomLabels() map[string]string { - if x != nil { - return x.CustomLabels - } - return nil -} - -type ListNodesRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Return only Nodes with matching Node type. - NodeType NodeType `protobuf:"varint,1,opt,name=node_type,json=nodeType,proto3,enum=inventory.v1.NodeType" json:"node_type,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ListNodesRequest) Reset() { - *x = ListNodesRequest{} - mi := &file_inventory_v1_nodes_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ListNodesRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListNodesRequest) ProtoMessage() {} - -func (x *ListNodesRequest) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_nodes_proto_msgTypes[5] - 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 ListNodesRequest.ProtoReflect.Descriptor instead. -func (*ListNodesRequest) Descriptor() ([]byte, []int) { - return file_inventory_v1_nodes_proto_rawDescGZIP(), []int{5} -} - -func (x *ListNodesRequest) GetNodeType() NodeType { - if x != nil { - return x.NodeType - } - return NodeType_NODE_TYPE_UNSPECIFIED -} - -type ListNodesResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Generic []*GenericNode `protobuf:"bytes,1,rep,name=generic,proto3" json:"generic,omitempty"` - Container []*ContainerNode `protobuf:"bytes,2,rep,name=container,proto3" json:"container,omitempty"` - Remote []*RemoteNode `protobuf:"bytes,3,rep,name=remote,proto3" json:"remote,omitempty"` - RemoteRds []*RemoteRDSNode `protobuf:"bytes,4,rep,name=remote_rds,json=remoteRds,proto3" json:"remote_rds,omitempty"` - RemoteAzureDatabase []*RemoteAzureDatabaseNode `protobuf:"bytes,5,rep,name=remote_azure_database,json=remoteAzureDatabase,proto3" json:"remote_azure_database,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ListNodesResponse) Reset() { - *x = ListNodesResponse{} - mi := &file_inventory_v1_nodes_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ListNodesResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListNodesResponse) ProtoMessage() {} - -func (x *ListNodesResponse) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_nodes_proto_msgTypes[6] - 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 ListNodesResponse.ProtoReflect.Descriptor instead. -func (*ListNodesResponse) Descriptor() ([]byte, []int) { - return file_inventory_v1_nodes_proto_rawDescGZIP(), []int{6} -} - -func (x *ListNodesResponse) GetGeneric() []*GenericNode { - if x != nil { - return x.Generic - } - return nil -} - -func (x *ListNodesResponse) GetContainer() []*ContainerNode { - if x != nil { - return x.Container - } - return nil -} - -func (x *ListNodesResponse) GetRemote() []*RemoteNode { - if x != nil { - return x.Remote - } - return nil -} - -func (x *ListNodesResponse) GetRemoteRds() []*RemoteRDSNode { - if x != nil { - return x.RemoteRds - } - return nil -} - -func (x *ListNodesResponse) GetRemoteAzureDatabase() []*RemoteAzureDatabaseNode { - if x != nil { - return x.RemoteAzureDatabase - } - return nil -} - -type GetNodeRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Unique randomly generated instance identifier. - NodeId string `protobuf:"bytes,1,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetNodeRequest) Reset() { - *x = GetNodeRequest{} - mi := &file_inventory_v1_nodes_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetNodeRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetNodeRequest) ProtoMessage() {} - -func (x *GetNodeRequest) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_nodes_proto_msgTypes[7] - 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 GetNodeRequest.ProtoReflect.Descriptor instead. -func (*GetNodeRequest) Descriptor() ([]byte, []int) { - return file_inventory_v1_nodes_proto_rawDescGZIP(), []int{7} -} - -func (x *GetNodeRequest) GetNodeId() string { - if x != nil { - return x.NodeId - } - return "" -} - -type GetNodeResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Node: - // - // *GetNodeResponse_Generic - // *GetNodeResponse_Container - // *GetNodeResponse_Remote - // *GetNodeResponse_RemoteRds - // *GetNodeResponse_RemoteAzureDatabase - Node isGetNodeResponse_Node `protobuf_oneof:"node"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetNodeResponse) Reset() { - *x = GetNodeResponse{} - mi := &file_inventory_v1_nodes_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetNodeResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetNodeResponse) ProtoMessage() {} - -func (x *GetNodeResponse) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_nodes_proto_msgTypes[8] - 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 GetNodeResponse.ProtoReflect.Descriptor instead. -func (*GetNodeResponse) Descriptor() ([]byte, []int) { - return file_inventory_v1_nodes_proto_rawDescGZIP(), []int{8} -} - -func (x *GetNodeResponse) GetNode() isGetNodeResponse_Node { - if x != nil { - return x.Node - } - return nil -} - -func (x *GetNodeResponse) GetGeneric() *GenericNode { - if x != nil { - if x, ok := x.Node.(*GetNodeResponse_Generic); ok { - return x.Generic - } - } - return nil -} - -func (x *GetNodeResponse) GetContainer() *ContainerNode { - if x != nil { - if x, ok := x.Node.(*GetNodeResponse_Container); ok { - return x.Container - } - } - return nil -} - -func (x *GetNodeResponse) GetRemote() *RemoteNode { - if x != nil { - if x, ok := x.Node.(*GetNodeResponse_Remote); ok { - return x.Remote - } - } - return nil -} - -func (x *GetNodeResponse) GetRemoteRds() *RemoteRDSNode { - if x != nil { - if x, ok := x.Node.(*GetNodeResponse_RemoteRds); ok { - return x.RemoteRds - } - } - return nil -} - -func (x *GetNodeResponse) GetRemoteAzureDatabase() *RemoteAzureDatabaseNode { - if x != nil { - if x, ok := x.Node.(*GetNodeResponse_RemoteAzureDatabase); ok { - return x.RemoteAzureDatabase - } - } - return nil -} - -type isGetNodeResponse_Node interface { - isGetNodeResponse_Node() -} - -type GetNodeResponse_Generic struct { - Generic *GenericNode `protobuf:"bytes,1,opt,name=generic,proto3,oneof"` -} - -type GetNodeResponse_Container struct { - Container *ContainerNode `protobuf:"bytes,2,opt,name=container,proto3,oneof"` -} - -type GetNodeResponse_Remote struct { - Remote *RemoteNode `protobuf:"bytes,3,opt,name=remote,proto3,oneof"` -} - -type GetNodeResponse_RemoteRds struct { - RemoteRds *RemoteRDSNode `protobuf:"bytes,4,opt,name=remote_rds,json=remoteRds,proto3,oneof"` -} - -type GetNodeResponse_RemoteAzureDatabase struct { - RemoteAzureDatabase *RemoteAzureDatabaseNode `protobuf:"bytes,5,opt,name=remote_azure_database,json=remoteAzureDatabase,proto3,oneof"` -} - -func (*GetNodeResponse_Generic) isGetNodeResponse_Node() {} - -func (*GetNodeResponse_Container) isGetNodeResponse_Node() {} - -func (*GetNodeResponse_Remote) isGetNodeResponse_Node() {} - -func (*GetNodeResponse_RemoteRds) isGetNodeResponse_Node() {} - -func (*GetNodeResponse_RemoteAzureDatabase) isGetNodeResponse_Node() {} - -type AddNodeRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Node: - // - // *AddNodeRequest_Generic - // *AddNodeRequest_Container - // *AddNodeRequest_Remote - // *AddNodeRequest_RemoteRds - // *AddNodeRequest_RemoteAzure - Node isAddNodeRequest_Node `protobuf_oneof:"node"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AddNodeRequest) Reset() { - *x = AddNodeRequest{} - mi := &file_inventory_v1_nodes_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AddNodeRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddNodeRequest) ProtoMessage() {} - -func (x *AddNodeRequest) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_nodes_proto_msgTypes[9] - 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 AddNodeRequest.ProtoReflect.Descriptor instead. -func (*AddNodeRequest) Descriptor() ([]byte, []int) { - return file_inventory_v1_nodes_proto_rawDescGZIP(), []int{9} -} - -func (x *AddNodeRequest) GetNode() isAddNodeRequest_Node { - if x != nil { - return x.Node - } - return nil -} - -func (x *AddNodeRequest) GetGeneric() *AddGenericNodeParams { - if x != nil { - if x, ok := x.Node.(*AddNodeRequest_Generic); ok { - return x.Generic - } - } - return nil -} - -func (x *AddNodeRequest) GetContainer() *AddContainerNodeParams { - if x != nil { - if x, ok := x.Node.(*AddNodeRequest_Container); ok { - return x.Container - } - } - return nil -} - -func (x *AddNodeRequest) GetRemote() *AddRemoteNodeParams { - if x != nil { - if x, ok := x.Node.(*AddNodeRequest_Remote); ok { - return x.Remote - } - } - return nil -} - -func (x *AddNodeRequest) GetRemoteRds() *AddRemoteRDSNodeParams { - if x != nil { - if x, ok := x.Node.(*AddNodeRequest_RemoteRds); ok { - return x.RemoteRds - } - } - return nil -} - -func (x *AddNodeRequest) GetRemoteAzure() *AddRemoteAzureNodeParams { - if x != nil { - if x, ok := x.Node.(*AddNodeRequest_RemoteAzure); ok { - return x.RemoteAzure - } - } - return nil -} - -type isAddNodeRequest_Node interface { - isAddNodeRequest_Node() -} - -type AddNodeRequest_Generic struct { - Generic *AddGenericNodeParams `protobuf:"bytes,1,opt,name=generic,proto3,oneof"` -} - -type AddNodeRequest_Container struct { - Container *AddContainerNodeParams `protobuf:"bytes,2,opt,name=container,proto3,oneof"` -} - -type AddNodeRequest_Remote struct { - Remote *AddRemoteNodeParams `protobuf:"bytes,3,opt,name=remote,proto3,oneof"` -} - -type AddNodeRequest_RemoteRds struct { - RemoteRds *AddRemoteRDSNodeParams `protobuf:"bytes,4,opt,name=remote_rds,json=remoteRds,proto3,oneof"` -} - -type AddNodeRequest_RemoteAzure struct { - RemoteAzure *AddRemoteAzureNodeParams `protobuf:"bytes,5,opt,name=remote_azure,json=remoteAzure,proto3,oneof"` -} - -func (*AddNodeRequest_Generic) isAddNodeRequest_Node() {} - -func (*AddNodeRequest_Container) isAddNodeRequest_Node() {} - -func (*AddNodeRequest_Remote) isAddNodeRequest_Node() {} - -func (*AddNodeRequest_RemoteRds) isAddNodeRequest_Node() {} - -func (*AddNodeRequest_RemoteAzure) isAddNodeRequest_Node() {} - -type AddNodeResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Node: - // - // *AddNodeResponse_Generic - // *AddNodeResponse_Container - // *AddNodeResponse_Remote - // *AddNodeResponse_RemoteRds - // *AddNodeResponse_RemoteAzureDatabase - Node isAddNodeResponse_Node `protobuf_oneof:"node"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AddNodeResponse) Reset() { - *x = AddNodeResponse{} - mi := &file_inventory_v1_nodes_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AddNodeResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddNodeResponse) ProtoMessage() {} - -func (x *AddNodeResponse) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_nodes_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 AddNodeResponse.ProtoReflect.Descriptor instead. -func (*AddNodeResponse) Descriptor() ([]byte, []int) { - return file_inventory_v1_nodes_proto_rawDescGZIP(), []int{10} -} - -func (x *AddNodeResponse) GetNode() isAddNodeResponse_Node { - if x != nil { - return x.Node - } - return nil -} - -func (x *AddNodeResponse) GetGeneric() *GenericNode { - if x != nil { - if x, ok := x.Node.(*AddNodeResponse_Generic); ok { - return x.Generic - } - } - return nil -} - -func (x *AddNodeResponse) GetContainer() *ContainerNode { - if x != nil { - if x, ok := x.Node.(*AddNodeResponse_Container); ok { - return x.Container - } - } - return nil -} - -func (x *AddNodeResponse) GetRemote() *RemoteNode { - if x != nil { - if x, ok := x.Node.(*AddNodeResponse_Remote); ok { - return x.Remote - } - } - return nil -} - -func (x *AddNodeResponse) GetRemoteRds() *RemoteRDSNode { - if x != nil { - if x, ok := x.Node.(*AddNodeResponse_RemoteRds); ok { - return x.RemoteRds - } - } - return nil -} - -func (x *AddNodeResponse) GetRemoteAzureDatabase() *RemoteAzureDatabaseNode { - if x != nil { - if x, ok := x.Node.(*AddNodeResponse_RemoteAzureDatabase); ok { - return x.RemoteAzureDatabase - } - } - return nil -} - -type isAddNodeResponse_Node interface { - isAddNodeResponse_Node() -} - -type AddNodeResponse_Generic struct { - Generic *GenericNode `protobuf:"bytes,1,opt,name=generic,proto3,oneof"` -} - -type AddNodeResponse_Container struct { - Container *ContainerNode `protobuf:"bytes,2,opt,name=container,proto3,oneof"` -} - -type AddNodeResponse_Remote struct { - Remote *RemoteNode `protobuf:"bytes,3,opt,name=remote,proto3,oneof"` -} - -type AddNodeResponse_RemoteRds struct { - RemoteRds *RemoteRDSNode `protobuf:"bytes,4,opt,name=remote_rds,json=remoteRds,proto3,oneof"` -} - -type AddNodeResponse_RemoteAzureDatabase struct { - RemoteAzureDatabase *RemoteAzureDatabaseNode `protobuf:"bytes,5,opt,name=remote_azure_database,json=remoteAzureDatabase,proto3,oneof"` -} - -func (*AddNodeResponse_Generic) isAddNodeResponse_Node() {} - -func (*AddNodeResponse_Container) isAddNodeResponse_Node() {} - -func (*AddNodeResponse_Remote) isAddNodeResponse_Node() {} - -func (*AddNodeResponse_RemoteRds) isAddNodeResponse_Node() {} - -func (*AddNodeResponse_RemoteAzureDatabase) isAddNodeResponse_Node() {} - -type AddGenericNodeParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Unique across all Nodes user-defined name. - NodeName string `protobuf:"bytes,1,opt,name=node_name,json=nodeName,proto3" json:"node_name,omitempty"` - // Node address (DNS name or IP). - Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` - // Linux machine-id. - MachineId string `protobuf:"bytes,3,opt,name=machine_id,json=machineId,proto3" json:"machine_id,omitempty"` - // Linux distribution name and version. - Distro string `protobuf:"bytes,4,opt,name=distro,proto3" json:"distro,omitempty"` - // Node model. - NodeModel string `protobuf:"bytes,5,opt,name=node_model,json=nodeModel,proto3" json:"node_model,omitempty"` - // Node region. - Region string `protobuf:"bytes,6,opt,name=region,proto3" json:"region,omitempty"` - // Node availability zone. - Az string `protobuf:"bytes,7,opt,name=az,proto3" json:"az,omitempty"` - // Custom user-assigned labels. - CustomLabels map[string]string `protobuf:"bytes,8,rep,name=custom_labels,json=customLabels,proto3" json:"custom_labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AddGenericNodeParams) Reset() { - *x = AddGenericNodeParams{} - mi := &file_inventory_v1_nodes_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AddGenericNodeParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddGenericNodeParams) ProtoMessage() {} - -func (x *AddGenericNodeParams) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_nodes_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 AddGenericNodeParams.ProtoReflect.Descriptor instead. -func (*AddGenericNodeParams) Descriptor() ([]byte, []int) { - return file_inventory_v1_nodes_proto_rawDescGZIP(), []int{11} -} - -func (x *AddGenericNodeParams) GetNodeName() string { - if x != nil { - return x.NodeName - } - return "" -} - -func (x *AddGenericNodeParams) GetAddress() string { - if x != nil { - return x.Address - } - return "" -} - -func (x *AddGenericNodeParams) GetMachineId() string { - if x != nil { - return x.MachineId - } - return "" -} - -func (x *AddGenericNodeParams) GetDistro() string { - if x != nil { - return x.Distro - } - return "" -} - -func (x *AddGenericNodeParams) GetNodeModel() string { - if x != nil { - return x.NodeModel - } - return "" -} - -func (x *AddGenericNodeParams) GetRegion() string { - if x != nil { - return x.Region - } - return "" -} - -func (x *AddGenericNodeParams) GetAz() string { - if x != nil { - return x.Az - } - return "" -} - -func (x *AddGenericNodeParams) GetCustomLabels() map[string]string { - if x != nil { - return x.CustomLabels - } - return nil -} - -type AddContainerNodeParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Unique across all Nodes user-defined name. - NodeName string `protobuf:"bytes,1,opt,name=node_name,json=nodeName,proto3" json:"node_name,omitempty"` - // Node address (DNS name or IP). - Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` - // Linux machine-id of the Generic Node where this Container Node runs. - MachineId string `protobuf:"bytes,3,opt,name=machine_id,json=machineId,proto3" json:"machine_id,omitempty"` - // Container identifier. If specified, must be a unique Docker container identifier. - ContainerId string `protobuf:"bytes,4,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` - // Container name. - ContainerName string `protobuf:"bytes,5,opt,name=container_name,json=containerName,proto3" json:"container_name,omitempty"` - // Node model. - NodeModel string `protobuf:"bytes,6,opt,name=node_model,json=nodeModel,proto3" json:"node_model,omitempty"` - // Node region. - Region string `protobuf:"bytes,7,opt,name=region,proto3" json:"region,omitempty"` - // Node availability zone. - Az string `protobuf:"bytes,8,opt,name=az,proto3" json:"az,omitempty"` - // Custom user-assigned labels. - CustomLabels map[string]string `protobuf:"bytes,9,rep,name=custom_labels,json=customLabels,proto3" json:"custom_labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AddContainerNodeParams) Reset() { - *x = AddContainerNodeParams{} - mi := &file_inventory_v1_nodes_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AddContainerNodeParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddContainerNodeParams) ProtoMessage() {} - -func (x *AddContainerNodeParams) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_nodes_proto_msgTypes[12] - 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 AddContainerNodeParams.ProtoReflect.Descriptor instead. -func (*AddContainerNodeParams) Descriptor() ([]byte, []int) { - return file_inventory_v1_nodes_proto_rawDescGZIP(), []int{12} -} - -func (x *AddContainerNodeParams) GetNodeName() string { - if x != nil { - return x.NodeName - } - return "" -} - -func (x *AddContainerNodeParams) GetAddress() string { - if x != nil { - return x.Address - } - return "" -} - -func (x *AddContainerNodeParams) GetMachineId() string { - if x != nil { - return x.MachineId - } - return "" -} - -func (x *AddContainerNodeParams) GetContainerId() string { - if x != nil { - return x.ContainerId - } - return "" -} - -func (x *AddContainerNodeParams) GetContainerName() string { - if x != nil { - return x.ContainerName - } - return "" -} - -func (x *AddContainerNodeParams) GetNodeModel() string { - if x != nil { - return x.NodeModel - } - return "" -} - -func (x *AddContainerNodeParams) GetRegion() string { - if x != nil { - return x.Region - } - return "" -} - -func (x *AddContainerNodeParams) GetAz() string { - if x != nil { - return x.Az - } - return "" -} - -func (x *AddContainerNodeParams) GetCustomLabels() map[string]string { - if x != nil { - return x.CustomLabels - } - return nil -} - -type AddRemoteNodeParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Unique across all Nodes user-defined name. - NodeName string `protobuf:"bytes,1,opt,name=node_name,json=nodeName,proto3" json:"node_name,omitempty"` - // Node address (DNS name or IP). - Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` - // Node model. - NodeModel string `protobuf:"bytes,3,opt,name=node_model,json=nodeModel,proto3" json:"node_model,omitempty"` - // Node region. - Region string `protobuf:"bytes,4,opt,name=region,proto3" json:"region,omitempty"` - // Node availability zone. - Az string `protobuf:"bytes,5,opt,name=az,proto3" json:"az,omitempty"` - // Custom user-assigned labels. - CustomLabels map[string]string `protobuf:"bytes,6,rep,name=custom_labels,json=customLabels,proto3" json:"custom_labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AddRemoteNodeParams) Reset() { - *x = AddRemoteNodeParams{} - mi := &file_inventory_v1_nodes_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AddRemoteNodeParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddRemoteNodeParams) ProtoMessage() {} - -func (x *AddRemoteNodeParams) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_nodes_proto_msgTypes[13] - 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 AddRemoteNodeParams.ProtoReflect.Descriptor instead. -func (*AddRemoteNodeParams) Descriptor() ([]byte, []int) { - return file_inventory_v1_nodes_proto_rawDescGZIP(), []int{13} -} - -func (x *AddRemoteNodeParams) GetNodeName() string { - if x != nil { - return x.NodeName - } - return "" -} - -func (x *AddRemoteNodeParams) GetAddress() string { - if x != nil { - return x.Address - } - return "" -} - -func (x *AddRemoteNodeParams) GetNodeModel() string { - if x != nil { - return x.NodeModel - } - return "" -} - -func (x *AddRemoteNodeParams) GetRegion() string { - if x != nil { - return x.Region - } - return "" -} - -func (x *AddRemoteNodeParams) GetAz() string { - if x != nil { - return x.Az - } - return "" -} - -func (x *AddRemoteNodeParams) GetCustomLabels() map[string]string { - if x != nil { - return x.CustomLabels - } - return nil -} - -type AddRemoteRDSNodeParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Unique across all Nodes user-defined name. - NodeName string `protobuf:"bytes,1,opt,name=node_name,json=nodeName,proto3" json:"node_name,omitempty"` - // DB instance identifier. - Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` - // Node model. - NodeModel string `protobuf:"bytes,3,opt,name=node_model,json=nodeModel,proto3" json:"node_model,omitempty"` - // Node region. - Region string `protobuf:"bytes,4,opt,name=region,proto3" json:"region,omitempty"` - // Node availability zone. - Az string `protobuf:"bytes,5,opt,name=az,proto3" json:"az,omitempty"` - // Custom user-assigned labels. - CustomLabels map[string]string `protobuf:"bytes,6,rep,name=custom_labels,json=customLabels,proto3" json:"custom_labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AddRemoteRDSNodeParams) Reset() { - *x = AddRemoteRDSNodeParams{} - mi := &file_inventory_v1_nodes_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AddRemoteRDSNodeParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddRemoteRDSNodeParams) ProtoMessage() {} - -func (x *AddRemoteRDSNodeParams) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_nodes_proto_msgTypes[14] - 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 AddRemoteRDSNodeParams.ProtoReflect.Descriptor instead. -func (*AddRemoteRDSNodeParams) Descriptor() ([]byte, []int) { - return file_inventory_v1_nodes_proto_rawDescGZIP(), []int{14} -} - -func (x *AddRemoteRDSNodeParams) GetNodeName() string { - if x != nil { - return x.NodeName - } - return "" -} - -func (x *AddRemoteRDSNodeParams) GetAddress() string { - if x != nil { - return x.Address - } - return "" -} - -func (x *AddRemoteRDSNodeParams) GetNodeModel() string { - if x != nil { - return x.NodeModel - } - return "" -} - -func (x *AddRemoteRDSNodeParams) GetRegion() string { - if x != nil { - return x.Region - } - return "" -} - -func (x *AddRemoteRDSNodeParams) GetAz() string { - if x != nil { - return x.Az - } - return "" -} - -func (x *AddRemoteRDSNodeParams) GetCustomLabels() map[string]string { - if x != nil { - return x.CustomLabels - } - return nil -} - -type AddRemoteAzureNodeParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Unique across all Nodes user-defined name. - NodeName string `protobuf:"bytes,1,opt,name=node_name,json=nodeName,proto3" json:"node_name,omitempty"` - // DB instance identifier. - Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` - // Node model. - NodeModel string `protobuf:"bytes,3,opt,name=node_model,json=nodeModel,proto3" json:"node_model,omitempty"` - // Node region. - Region string `protobuf:"bytes,4,opt,name=region,proto3" json:"region,omitempty"` - // Node availability zone. - Az string `protobuf:"bytes,5,opt,name=az,proto3" json:"az,omitempty"` - // Custom user-assigned labels. - CustomLabels map[string]string `protobuf:"bytes,6,rep,name=custom_labels,json=customLabels,proto3" json:"custom_labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AddRemoteAzureNodeParams) Reset() { - *x = AddRemoteAzureNodeParams{} - mi := &file_inventory_v1_nodes_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AddRemoteAzureNodeParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddRemoteAzureNodeParams) ProtoMessage() {} - -func (x *AddRemoteAzureNodeParams) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_nodes_proto_msgTypes[15] - 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 AddRemoteAzureNodeParams.ProtoReflect.Descriptor instead. -func (*AddRemoteAzureNodeParams) Descriptor() ([]byte, []int) { - return file_inventory_v1_nodes_proto_rawDescGZIP(), []int{15} -} - -func (x *AddRemoteAzureNodeParams) GetNodeName() string { - if x != nil { - return x.NodeName - } - return "" -} - -func (x *AddRemoteAzureNodeParams) GetAddress() string { - if x != nil { - return x.Address - } - return "" -} - -func (x *AddRemoteAzureNodeParams) GetNodeModel() string { - if x != nil { - return x.NodeModel - } - return "" -} - -func (x *AddRemoteAzureNodeParams) GetRegion() string { - if x != nil { - return x.Region - } - return "" -} - -func (x *AddRemoteAzureNodeParams) GetAz() string { - if x != nil { - return x.Az - } - return "" -} - -func (x *AddRemoteAzureNodeParams) GetCustomLabels() map[string]string { - if x != nil { - return x.CustomLabels - } - return nil -} - -type RemoveNodeRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Unique randomly generated instance identifier. - NodeId string `protobuf:"bytes,1,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` - // Remove node with all dependencies. - Force bool `protobuf:"varint,2,opt,name=force,proto3" json:"force,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *RemoveNodeRequest) Reset() { - *x = RemoveNodeRequest{} - mi := &file_inventory_v1_nodes_proto_msgTypes[16] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *RemoveNodeRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RemoveNodeRequest) ProtoMessage() {} - -func (x *RemoveNodeRequest) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_nodes_proto_msgTypes[16] - 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 RemoveNodeRequest.ProtoReflect.Descriptor instead. -func (*RemoveNodeRequest) Descriptor() ([]byte, []int) { - return file_inventory_v1_nodes_proto_rawDescGZIP(), []int{16} -} - -func (x *RemoveNodeRequest) GetNodeId() string { - if x != nil { - return x.NodeId - } - return "" -} - -func (x *RemoveNodeRequest) GetForce() bool { - if x != nil { - return x.Force - } - return false -} - -type RemoveNodeResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *RemoveNodeResponse) Reset() { - *x = RemoveNodeResponse{} - mi := &file_inventory_v1_nodes_proto_msgTypes[17] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *RemoveNodeResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RemoveNodeResponse) ProtoMessage() {} - -func (x *RemoveNodeResponse) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_nodes_proto_msgTypes[17] - 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 RemoveNodeResponse.ProtoReflect.Descriptor instead. -func (*RemoveNodeResponse) Descriptor() ([]byte, []int) { - return file_inventory_v1_nodes_proto_rawDescGZIP(), []int{17} -} - -var File_inventory_v1_nodes_proto protoreflect.FileDescriptor - -const file_inventory_v1_nodes_proto_rawDesc = "" + - "\n" + - "\x18inventory/v1/nodes.proto\x12\finventory.v1\x1a\x1cgoogle/api/annotations.proto\x1a.protoc-gen-openapiv2/options/annotations.proto\x1a\x17validate/validate.proto\"\xee\x02\n" + - "\vGenericNode\x12\x17\n" + - "\anode_id\x18\x01 \x01(\tR\x06nodeId\x12\x1b\n" + - "\tnode_name\x18\x02 \x01(\tR\bnodeName\x12\x18\n" + - "\aaddress\x18\x03 \x01(\tR\aaddress\x12\x1d\n" + - "\n" + - "machine_id\x18\x04 \x01(\tR\tmachineId\x12\x16\n" + - "\x06distro\x18\x05 \x01(\tR\x06distro\x12\x1d\n" + - "\n" + - "node_model\x18\x06 \x01(\tR\tnodeModel\x12\x16\n" + - "\x06region\x18\a \x01(\tR\x06region\x12\x0e\n" + - "\x02az\x18\b \x01(\tR\x02az\x12P\n" + - "\rcustom_labels\x18\t \x03(\v2+.inventory.v1.GenericNode.CustomLabelsEntryR\fcustomLabels\x1a?\n" + - "\x11CustomLabelsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\xa4\x03\n" + - "\rContainerNode\x12\x17\n" + - "\anode_id\x18\x01 \x01(\tR\x06nodeId\x12\x1b\n" + - "\tnode_name\x18\x02 \x01(\tR\bnodeName\x12\x18\n" + - "\aaddress\x18\x03 \x01(\tR\aaddress\x12\x1d\n" + - "\n" + - "machine_id\x18\x04 \x01(\tR\tmachineId\x12!\n" + - "\fcontainer_id\x18\x05 \x01(\tR\vcontainerId\x12%\n" + - "\x0econtainer_name\x18\x06 \x01(\tR\rcontainerName\x12\x1d\n" + - "\n" + - "node_model\x18\a \x01(\tR\tnodeModel\x12\x16\n" + - "\x06region\x18\b \x01(\tR\x06region\x12\x0e\n" + - "\x02az\x18\t \x01(\tR\x02az\x12R\n" + - "\rcustom_labels\x18\n" + - " \x03(\v2-.inventory.v1.ContainerNode.CustomLabelsEntryR\fcustomLabels\x1a?\n" + - "\x11CustomLabelsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\xb5\x02\n" + - "\n" + - "RemoteNode\x12\x17\n" + - "\anode_id\x18\x01 \x01(\tR\x06nodeId\x12\x1b\n" + - "\tnode_name\x18\x02 \x01(\tR\bnodeName\x12\x18\n" + - "\aaddress\x18\x03 \x01(\tR\aaddress\x12\x1d\n" + - "\n" + - "node_model\x18\x04 \x01(\tR\tnodeModel\x12\x16\n" + - "\x06region\x18\x05 \x01(\tR\x06region\x12\x0e\n" + - "\x02az\x18\x06 \x01(\tR\x02az\x12O\n" + - "\rcustom_labels\x18\a \x03(\v2*.inventory.v1.RemoteNode.CustomLabelsEntryR\fcustomLabels\x1a?\n" + - "\x11CustomLabelsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\xdc\x02\n" + - "\rRemoteRDSNode\x12\x17\n" + - "\anode_id\x18\x01 \x01(\tR\x06nodeId\x12\x1b\n" + - "\tnode_name\x18\x02 \x01(\tR\bnodeName\x12\x18\n" + - "\aaddress\x18\x03 \x01(\tR\aaddress\x12\x1d\n" + - "\n" + - "node_model\x18\x04 \x01(\tR\tnodeModel\x12\x16\n" + - "\x06region\x18\x05 \x01(\tR\x06region\x12\x0e\n" + - "\x02az\x18\x06 \x01(\tR\x02az\x12R\n" + - "\rcustom_labels\x18\a \x03(\v2-.inventory.v1.RemoteRDSNode.CustomLabelsEntryR\fcustomLabels\x12\x1f\n" + - "\vinstance_id\x18\b \x01(\tR\n" + - "instanceId\x1a?\n" + - "\x11CustomLabelsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\xcf\x02\n" + - "\x17RemoteAzureDatabaseNode\x12\x17\n" + - "\anode_id\x18\x01 \x01(\tR\x06nodeId\x12\x1b\n" + - "\tnode_name\x18\x02 \x01(\tR\bnodeName\x12\x18\n" + - "\aaddress\x18\x03 \x01(\tR\aaddress\x12\x1d\n" + - "\n" + - "node_model\x18\x04 \x01(\tR\tnodeModel\x12\x16\n" + - "\x06region\x18\x05 \x01(\tR\x06region\x12\x0e\n" + - "\x02az\x18\x06 \x01(\tR\x02az\x12\\\n" + - "\rcustom_labels\x18\a \x03(\v27.inventory.v1.RemoteAzureDatabaseNode.CustomLabelsEntryR\fcustomLabels\x1a?\n" + - "\x11CustomLabelsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"G\n" + - "\x10ListNodesRequest\x123\n" + - "\tnode_type\x18\x01 \x01(\x0e2\x16.inventory.v1.NodeTypeR\bnodeType\"\xcc\x02\n" + - "\x11ListNodesResponse\x123\n" + - "\ageneric\x18\x01 \x03(\v2\x19.inventory.v1.GenericNodeR\ageneric\x129\n" + - "\tcontainer\x18\x02 \x03(\v2\x1b.inventory.v1.ContainerNodeR\tcontainer\x120\n" + - "\x06remote\x18\x03 \x03(\v2\x18.inventory.v1.RemoteNodeR\x06remote\x12:\n" + - "\n" + - "remote_rds\x18\x04 \x03(\v2\x1b.inventory.v1.RemoteRDSNodeR\tremoteRds\x12Y\n" + - "\x15remote_azure_database\x18\x05 \x03(\v2%.inventory.v1.RemoteAzureDatabaseNodeR\x13remoteAzureDatabase\"2\n" + - "\x0eGetNodeRequest\x12 \n" + - "\anode_id\x18\x01 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\x06nodeId\"\xdc\x02\n" + - "\x0fGetNodeResponse\x125\n" + - "\ageneric\x18\x01 \x01(\v2\x19.inventory.v1.GenericNodeH\x00R\ageneric\x12;\n" + - "\tcontainer\x18\x02 \x01(\v2\x1b.inventory.v1.ContainerNodeH\x00R\tcontainer\x122\n" + - "\x06remote\x18\x03 \x01(\v2\x18.inventory.v1.RemoteNodeH\x00R\x06remote\x12<\n" + - "\n" + - "remote_rds\x18\x04 \x01(\v2\x1b.inventory.v1.RemoteRDSNodeH\x00R\tremoteRds\x12[\n" + - "\x15remote_azure_database\x18\x05 \x01(\v2%.inventory.v1.RemoteAzureDatabaseNodeH\x00R\x13remoteAzureDatabaseB\x06\n" + - "\x04node\"\xef\x02\n" + - "\x0eAddNodeRequest\x12>\n" + - "\ageneric\x18\x01 \x01(\v2\".inventory.v1.AddGenericNodeParamsH\x00R\ageneric\x12D\n" + - "\tcontainer\x18\x02 \x01(\v2$.inventory.v1.AddContainerNodeParamsH\x00R\tcontainer\x12;\n" + - "\x06remote\x18\x03 \x01(\v2!.inventory.v1.AddRemoteNodeParamsH\x00R\x06remote\x12E\n" + - "\n" + - "remote_rds\x18\x04 \x01(\v2$.inventory.v1.AddRemoteRDSNodeParamsH\x00R\tremoteRds\x12K\n" + - "\fremote_azure\x18\x05 \x01(\v2&.inventory.v1.AddRemoteAzureNodeParamsH\x00R\vremoteAzureB\x06\n" + - "\x04node\"\xdc\x02\n" + - "\x0fAddNodeResponse\x125\n" + - "\ageneric\x18\x01 \x01(\v2\x19.inventory.v1.GenericNodeH\x00R\ageneric\x12;\n" + - "\tcontainer\x18\x02 \x01(\v2\x1b.inventory.v1.ContainerNodeH\x00R\tcontainer\x122\n" + - "\x06remote\x18\x03 \x01(\v2\x18.inventory.v1.RemoteNodeH\x00R\x06remote\x12<\n" + - "\n" + - "remote_rds\x18\x04 \x01(\v2\x1b.inventory.v1.RemoteRDSNodeH\x00R\tremoteRds\x12[\n" + - "\x15remote_azure_database\x18\x05 \x01(\v2%.inventory.v1.RemoteAzureDatabaseNodeH\x00R\x13remoteAzureDatabaseB\x06\n" + - "\x04node\"\xf9\x02\n" + - "\x14AddGenericNodeParams\x12$\n" + - "\tnode_name\x18\x01 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\bnodeName\x12!\n" + - "\aaddress\x18\x02 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\aaddress\x12\x1d\n" + - "\n" + - "machine_id\x18\x03 \x01(\tR\tmachineId\x12\x16\n" + - "\x06distro\x18\x04 \x01(\tR\x06distro\x12\x1d\n" + - "\n" + - "node_model\x18\x05 \x01(\tR\tnodeModel\x12\x16\n" + - "\x06region\x18\x06 \x01(\tR\x06region\x12\x0e\n" + - "\x02az\x18\a \x01(\tR\x02az\x12Y\n" + - "\rcustom_labels\x18\b \x03(\v24.inventory.v1.AddGenericNodeParams.CustomLabelsEntryR\fcustomLabels\x1a?\n" + - "\x11CustomLabelsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\xaf\x03\n" + - "\x16AddContainerNodeParams\x12$\n" + - "\tnode_name\x18\x01 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\bnodeName\x12!\n" + - "\aaddress\x18\x02 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\aaddress\x12\x1d\n" + - "\n" + - "machine_id\x18\x03 \x01(\tR\tmachineId\x12!\n" + - "\fcontainer_id\x18\x04 \x01(\tR\vcontainerId\x12%\n" + - "\x0econtainer_name\x18\x05 \x01(\tR\rcontainerName\x12\x1d\n" + - "\n" + - "node_model\x18\x06 \x01(\tR\tnodeModel\x12\x16\n" + - "\x06region\x18\a \x01(\tR\x06region\x12\x0e\n" + - "\x02az\x18\b \x01(\tR\x02az\x12[\n" + - "\rcustom_labels\x18\t \x03(\v26.inventory.v1.AddContainerNodeParams.CustomLabelsEntryR\fcustomLabels\x1a?\n" + - "\x11CustomLabelsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\xc0\x02\n" + - "\x13AddRemoteNodeParams\x12$\n" + - "\tnode_name\x18\x01 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\bnodeName\x12!\n" + - "\aaddress\x18\x02 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\aaddress\x12\x1d\n" + - "\n" + - "node_model\x18\x03 \x01(\tR\tnodeModel\x12\x16\n" + - "\x06region\x18\x04 \x01(\tR\x06region\x12\x0e\n" + - "\x02az\x18\x05 \x01(\tR\x02az\x12X\n" + - "\rcustom_labels\x18\x06 \x03(\v23.inventory.v1.AddRemoteNodeParams.CustomLabelsEntryR\fcustomLabels\x1a?\n" + - "\x11CustomLabelsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\xcf\x02\n" + - "\x16AddRemoteRDSNodeParams\x12$\n" + - "\tnode_name\x18\x01 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\bnodeName\x12!\n" + - "\aaddress\x18\x02 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\aaddress\x12\x1d\n" + - "\n" + - "node_model\x18\x03 \x01(\tR\tnodeModel\x12\x1f\n" + - "\x06region\x18\x04 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\x06region\x12\x0e\n" + - "\x02az\x18\x05 \x01(\tR\x02az\x12[\n" + - "\rcustom_labels\x18\x06 \x03(\v26.inventory.v1.AddRemoteRDSNodeParams.CustomLabelsEntryR\fcustomLabels\x1a?\n" + - "\x11CustomLabelsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\xd3\x02\n" + - "\x18AddRemoteAzureNodeParams\x12$\n" + - "\tnode_name\x18\x01 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\bnodeName\x12!\n" + - "\aaddress\x18\x02 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\aaddress\x12\x1d\n" + - "\n" + - "node_model\x18\x03 \x01(\tR\tnodeModel\x12\x1f\n" + - "\x06region\x18\x04 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\x06region\x12\x0e\n" + - "\x02az\x18\x05 \x01(\tR\x02az\x12]\n" + - "\rcustom_labels\x18\x06 \x03(\v28.inventory.v1.AddRemoteAzureNodeParams.CustomLabelsEntryR\fcustomLabels\x1a?\n" + - "\x11CustomLabelsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"K\n" + - "\x11RemoveNodeRequest\x12 \n" + - "\anode_id\x18\x01 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\x06nodeId\x12\x14\n" + - "\x05force\x18\x02 \x01(\bR\x05force\"\x14\n" + - "\x12RemoveNodeResponse*\xc3\x01\n" + - "\bNodeType\x12\x19\n" + - "\x15NODE_TYPE_UNSPECIFIED\x10\x00\x12\x1a\n" + - "\x16NODE_TYPE_GENERIC_NODE\x10\x01\x12\x1c\n" + - "\x18NODE_TYPE_CONTAINER_NODE\x10\x02\x12\x19\n" + - "\x15NODE_TYPE_REMOTE_NODE\x10\x03\x12\x1d\n" + - "\x19NODE_TYPE_REMOTE_RDS_NODE\x10\x04\x12(\n" + - "$NODE_TYPE_REMOTE_AZURE_DATABASE_NODE\x10\x052\xe6\x04\n" + - "\fNodesService\x12\x96\x01\n" + - "\tListNodes\x12\x1e.inventory.v1.ListNodesRequest\x1a\x1f.inventory.v1.ListNodesResponse\"H\x92A*\x12\n" + - "List Nodes\x1a\x1cReturns a list of all Nodes.\x82\xd3\xe4\x93\x02\x15\x12\x13/v1/inventory/nodes\x12\x9a\x01\n" + - "\aGetNode\x12\x1c.inventory.v1.GetNodeRequest\x1a\x1d.inventory.v1.GetNodeResponse\"R\x92A*\x12\n" + - "Get a Node\x1a\x1cReturns a single Node by ID.\x82\xd3\xe4\x93\x02\x1f\x12\x1d/v1/inventory/nodes/{node_id}\x12\x83\x01\n" + - "\aAddNode\x12\x1c.inventory.v1.AddNodeRequest\x1a\x1d.inventory.v1.AddNodeResponse\";\x92A\x1a\x12\n" + - "Add a Node\x1a\fAdds a Node.\x82\xd3\xe4\x93\x02\x18:\x01*\"\x13/v1/inventory/nodes\x12\x99\x01\n" + - "\n" + - "RemoveNode\x12\x1f.inventory.v1.RemoveNodeRequest\x1a .inventory.v1.RemoveNodeResponse\"H\x92A \x12\rRemove a Node\x1a\x0fRemoves a Node.\x82\xd3\xe4\x93\x02\x1f*\x1d/v1/inventory/nodes/{node_id}B\xa4\x01\n" + - "\x10com.inventory.v1B\n" + - "NodesProtoP\x01Z3github.com/percona/pmm/api/inventory/v1;inventoryv1\xa2\x02\x03IXX\xaa\x02\fInventory.V1\xca\x02\fInventory\\V1\xe2\x02\x18Inventory\\V1\\GPBMetadata\xea\x02\rInventory::V1b\x06proto3" - -var ( - file_inventory_v1_nodes_proto_rawDescOnce sync.Once - file_inventory_v1_nodes_proto_rawDescData []byte -) - -func file_inventory_v1_nodes_proto_rawDescGZIP() []byte { - file_inventory_v1_nodes_proto_rawDescOnce.Do(func() { - file_inventory_v1_nodes_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_inventory_v1_nodes_proto_rawDesc), len(file_inventory_v1_nodes_proto_rawDesc))) - }) - 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_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 - 21, // 2: inventory.v1.RemoteNode.custom_labels:type_name -> inventory.v1.RemoteNode.CustomLabelsEntry - 22, // 3: inventory.v1.RemoteRDSNode.custom_labels:type_name -> inventory.v1.RemoteRDSNode.CustomLabelsEntry - 23, // 4: inventory.v1.RemoteAzureDatabaseNode.custom_labels:type_name -> inventory.v1.RemoteAzureDatabaseNode.CustomLabelsEntry - 0, // 5: inventory.v1.ListNodesRequest.node_type:type_name -> inventory.v1.NodeType - 1, // 6: inventory.v1.ListNodesResponse.generic:type_name -> inventory.v1.GenericNode - 2, // 7: inventory.v1.ListNodesResponse.container:type_name -> inventory.v1.ContainerNode - 3, // 8: inventory.v1.ListNodesResponse.remote:type_name -> inventory.v1.RemoteNode - 4, // 9: inventory.v1.ListNodesResponse.remote_rds:type_name -> inventory.v1.RemoteRDSNode - 5, // 10: inventory.v1.ListNodesResponse.remote_azure_database:type_name -> inventory.v1.RemoteAzureDatabaseNode - 1, // 11: inventory.v1.GetNodeResponse.generic:type_name -> inventory.v1.GenericNode - 2, // 12: inventory.v1.GetNodeResponse.container:type_name -> inventory.v1.ContainerNode - 3, // 13: inventory.v1.GetNodeResponse.remote:type_name -> inventory.v1.RemoteNode - 4, // 14: inventory.v1.GetNodeResponse.remote_rds:type_name -> inventory.v1.RemoteRDSNode - 5, // 15: inventory.v1.GetNodeResponse.remote_azure_database:type_name -> inventory.v1.RemoteAzureDatabaseNode - 12, // 16: inventory.v1.AddNodeRequest.generic:type_name -> inventory.v1.AddGenericNodeParams - 13, // 17: inventory.v1.AddNodeRequest.container:type_name -> inventory.v1.AddContainerNodeParams - 14, // 18: inventory.v1.AddNodeRequest.remote:type_name -> inventory.v1.AddRemoteNodeParams - 15, // 19: inventory.v1.AddNodeRequest.remote_rds:type_name -> inventory.v1.AddRemoteRDSNodeParams - 16, // 20: inventory.v1.AddNodeRequest.remote_azure:type_name -> inventory.v1.AddRemoteAzureNodeParams - 1, // 21: inventory.v1.AddNodeResponse.generic:type_name -> inventory.v1.GenericNode - 2, // 22: inventory.v1.AddNodeResponse.container:type_name -> inventory.v1.ContainerNode - 3, // 23: inventory.v1.AddNodeResponse.remote:type_name -> inventory.v1.RemoteNode - 4, // 24: inventory.v1.AddNodeResponse.remote_rds:type_name -> inventory.v1.RemoteRDSNode - 5, // 25: inventory.v1.AddNodeResponse.remote_azure_database:type_name -> inventory.v1.RemoteAzureDatabaseNode - 24, // 26: inventory.v1.AddGenericNodeParams.custom_labels:type_name -> inventory.v1.AddGenericNodeParams.CustomLabelsEntry - 25, // 27: inventory.v1.AddContainerNodeParams.custom_labels:type_name -> inventory.v1.AddContainerNodeParams.CustomLabelsEntry - 26, // 28: inventory.v1.AddRemoteNodeParams.custom_labels:type_name -> inventory.v1.AddRemoteNodeParams.CustomLabelsEntry - 27, // 29: inventory.v1.AddRemoteRDSNodeParams.custom_labels:type_name -> inventory.v1.AddRemoteRDSNodeParams.CustomLabelsEntry - 28, // 30: inventory.v1.AddRemoteAzureNodeParams.custom_labels:type_name -> inventory.v1.AddRemoteAzureNodeParams.CustomLabelsEntry - 6, // 31: inventory.v1.NodesService.ListNodes:input_type -> inventory.v1.ListNodesRequest - 8, // 32: inventory.v1.NodesService.GetNode:input_type -> inventory.v1.GetNodeRequest - 10, // 33: inventory.v1.NodesService.AddNode:input_type -> inventory.v1.AddNodeRequest - 17, // 34: inventory.v1.NodesService.RemoveNode:input_type -> inventory.v1.RemoveNodeRequest - 7, // 35: inventory.v1.NodesService.ListNodes:output_type -> inventory.v1.ListNodesResponse - 9, // 36: inventory.v1.NodesService.GetNode:output_type -> inventory.v1.GetNodeResponse - 11, // 37: inventory.v1.NodesService.AddNode:output_type -> inventory.v1.AddNodeResponse - 18, // 38: inventory.v1.NodesService.RemoveNode:output_type -> inventory.v1.RemoveNodeResponse - 35, // [35:39] is the sub-list for method output_type - 31, // [31:35] is the sub-list for method input_type - 31, // [31:31] is the sub-list for extension type_name - 31, // [31:31] is the sub-list for extension extendee - 0, // [0:31] is the sub-list for field type_name -} - -func init() { file_inventory_v1_nodes_proto_init() } -func file_inventory_v1_nodes_proto_init() { - if File_inventory_v1_nodes_proto != nil { - return - } - file_inventory_v1_nodes_proto_msgTypes[8].OneofWrappers = []any{ - (*GetNodeResponse_Generic)(nil), - (*GetNodeResponse_Container)(nil), - (*GetNodeResponse_Remote)(nil), - (*GetNodeResponse_RemoteRds)(nil), - (*GetNodeResponse_RemoteAzureDatabase)(nil), - } - file_inventory_v1_nodes_proto_msgTypes[9].OneofWrappers = []any{ - (*AddNodeRequest_Generic)(nil), - (*AddNodeRequest_Container)(nil), - (*AddNodeRequest_Remote)(nil), - (*AddNodeRequest_RemoteRds)(nil), - (*AddNodeRequest_RemoteAzure)(nil), - } - file_inventory_v1_nodes_proto_msgTypes[10].OneofWrappers = []any{ - (*AddNodeResponse_Generic)(nil), - (*AddNodeResponse_Container)(nil), - (*AddNodeResponse_Remote)(nil), - (*AddNodeResponse_RemoteRds)(nil), - (*AddNodeResponse_RemoteAzureDatabase)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_inventory_v1_nodes_proto_rawDesc), len(file_inventory_v1_nodes_proto_rawDesc)), - NumEnums: 1, - NumMessages: 28, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_inventory_v1_nodes_proto_goTypes, - DependencyIndexes: file_inventory_v1_nodes_proto_depIdxs, - EnumInfos: file_inventory_v1_nodes_proto_enumTypes, - MessageInfos: file_inventory_v1_nodes_proto_msgTypes, - }.Build() - File_inventory_v1_nodes_proto = out.File - file_inventory_v1_nodes_proto_goTypes = nil - file_inventory_v1_nodes_proto_depIdxs = nil -} diff --git a/api/inventory/v1/nodes.pb.gw.go b/api/inventory/v1/nodes.pb.gw.go deleted file mode 100644 index 2019bc3fc93..00000000000 --- a/api/inventory/v1/nodes.pb.gw.go +++ /dev/null @@ -1,401 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: inventory/v1/nodes.proto - -/* -Package inventoryv1 is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package inventoryv1 - -import ( - "context" - "errors" - "io" - "net/http" - - "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" - "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" - "google.golang.org/protobuf/proto" -) - -// Suppress "imported and not used" errors -var ( - _ codes.Code - _ io.Reader - _ status.Status - _ = errors.New - _ = runtime.String - _ = utilities.NewDoubleArray - _ = metadata.Join -) - -var filter_NodesService_ListNodes_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} - -func request_NodesService_ListNodes_0(ctx context.Context, marshaler runtime.Marshaler, client NodesServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq ListNodesRequest - metadata runtime.ServerMetadata - ) - if req.Body != nil { - _, _ = io.Copy(io.Discard, req.Body) - } - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_NodesService_ListNodes_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - msg, err := client.ListNodes(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_NodesService_ListNodes_0(ctx context.Context, marshaler runtime.Marshaler, server NodesServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq ListNodesRequest - metadata runtime.ServerMetadata - ) - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_NodesService_ListNodes_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - msg, err := server.ListNodes(ctx, &protoReq) - return msg, metadata, err -} - -func request_NodesService_GetNode_0(ctx context.Context, marshaler runtime.Marshaler, client NodesServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq GetNodeRequest - metadata runtime.ServerMetadata - err error - ) - if req.Body != nil { - _, _ = io.Copy(io.Discard, req.Body) - } - val, ok := pathParams["node_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "node_id") - } - protoReq.NodeId, err = runtime.String(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "node_id", err) - } - msg, err := client.GetNode(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_NodesService_GetNode_0(ctx context.Context, marshaler runtime.Marshaler, server NodesServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq GetNodeRequest - metadata runtime.ServerMetadata - err error - ) - val, ok := pathParams["node_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "node_id") - } - protoReq.NodeId, err = runtime.String(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "node_id", err) - } - msg, err := server.GetNode(ctx, &protoReq) - return msg, metadata, err -} - -func request_NodesService_AddNode_0(ctx context.Context, marshaler runtime.Marshaler, client NodesServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq AddNodeRequest - 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.AddNode(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_NodesService_AddNode_0(ctx context.Context, marshaler runtime.Marshaler, server NodesServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq AddNodeRequest - 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.AddNode(ctx, &protoReq) - return msg, metadata, err -} - -var filter_NodesService_RemoveNode_0 = &utilities.DoubleArray{Encoding: map[string]int{"node_id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} - -func request_NodesService_RemoveNode_0(ctx context.Context, marshaler runtime.Marshaler, client NodesServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq RemoveNodeRequest - metadata runtime.ServerMetadata - err error - ) - if req.Body != nil { - _, _ = io.Copy(io.Discard, req.Body) - } - val, ok := pathParams["node_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "node_id") - } - protoReq.NodeId, err = runtime.String(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "node_id", err) - } - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_NodesService_RemoveNode_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - msg, err := client.RemoveNode(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_NodesService_RemoveNode_0(ctx context.Context, marshaler runtime.Marshaler, server NodesServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq RemoveNodeRequest - metadata runtime.ServerMetadata - err error - ) - val, ok := pathParams["node_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "node_id") - } - protoReq.NodeId, err = runtime.String(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "node_id", err) - } - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_NodesService_RemoveNode_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - msg, err := server.RemoveNode(ctx, &protoReq) - return msg, metadata, err -} - -// RegisterNodesServiceHandlerServer registers the http handlers for service NodesService to "mux". -// UnaryRPC :call NodesServiceServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterNodesServiceHandlerFromEndpoint instead. -// GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call. -func RegisterNodesServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server NodesServiceServer) error { - mux.Handle(http.MethodGet, pattern_NodesService_ListNodes_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, "/inventory.v1.NodesService/ListNodes", runtime.WithHTTPPathPattern("/v1/inventory/nodes")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_NodesService_ListNodes_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_NodesService_ListNodes_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodGet, pattern_NodesService_GetNode_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, "/inventory.v1.NodesService/GetNode", runtime.WithHTTPPathPattern("/v1/inventory/nodes/{node_id}")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_NodesService_GetNode_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_NodesService_GetNode_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPost, pattern_NodesService_AddNode_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/inventory.v1.NodesService/AddNode", runtime.WithHTTPPathPattern("/v1/inventory/nodes")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_NodesService_AddNode_0(annotatedContext, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_NodesService_AddNode_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodDelete, pattern_NodesService_RemoveNode_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, "/inventory.v1.NodesService/RemoveNode", runtime.WithHTTPPathPattern("/v1/inventory/nodes/{node_id}")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_NodesService_RemoveNode_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_NodesService_RemoveNode_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - return nil -} - -// RegisterNodesServiceHandlerFromEndpoint is same as RegisterNodesServiceHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterNodesServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.NewClient(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - return RegisterNodesServiceHandler(ctx, mux, conn) -} - -// RegisterNodesServiceHandler registers the http handlers for service NodesService to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterNodesServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterNodesServiceHandlerClient(ctx, mux, NewNodesServiceClient(conn)) -} - -// RegisterNodesServiceHandlerClient registers the http handlers for service NodesService -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "NodesServiceClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "NodesServiceClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "NodesServiceClient" to call the correct interceptors. This client ignores the HTTP middlewares. -func RegisterNodesServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client NodesServiceClient) error { - mux.Handle(http.MethodGet, pattern_NodesService_ListNodes_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, "/inventory.v1.NodesService/ListNodes", runtime.WithHTTPPathPattern("/v1/inventory/nodes")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_NodesService_ListNodes_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_NodesService_ListNodes_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodGet, pattern_NodesService_GetNode_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, "/inventory.v1.NodesService/GetNode", runtime.WithHTTPPathPattern("/v1/inventory/nodes/{node_id}")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_NodesService_GetNode_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_NodesService_GetNode_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPost, pattern_NodesService_AddNode_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/inventory.v1.NodesService/AddNode", runtime.WithHTTPPathPattern("/v1/inventory/nodes")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_NodesService_AddNode_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_NodesService_AddNode_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodDelete, pattern_NodesService_RemoveNode_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, "/inventory.v1.NodesService/RemoveNode", runtime.WithHTTPPathPattern("/v1/inventory/nodes/{node_id}")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_NodesService_RemoveNode_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_NodesService_RemoveNode_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - return nil -} - -var ( - pattern_NodesService_ListNodes_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "inventory", "nodes"}, "")) - pattern_NodesService_GetNode_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "inventory", "nodes", "node_id"}, "")) - pattern_NodesService_AddNode_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "inventory", "nodes"}, "")) - pattern_NodesService_RemoveNode_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "inventory", "nodes", "node_id"}, "")) -) - -var ( - forward_NodesService_ListNodes_0 = runtime.ForwardResponseMessage - forward_NodesService_GetNode_0 = runtime.ForwardResponseMessage - forward_NodesService_AddNode_0 = runtime.ForwardResponseMessage - forward_NodesService_RemoveNode_0 = runtime.ForwardResponseMessage -) diff --git a/api/inventory/v1/nodes.pb.validate.go b/api/inventory/v1/nodes.pb.validate.go deleted file mode 100644 index f80ee529abe..00000000000 --- a/api/inventory/v1/nodes.pb.validate.go +++ /dev/null @@ -1,2938 +0,0 @@ -// Code generated by protoc-gen-validate. DO NOT EDIT. -// source: inventory/v1/nodes.proto - -package inventoryv1 - -import ( - "bytes" - "errors" - "fmt" - "net" - "net/mail" - "net/url" - "regexp" - "sort" - "strings" - "time" - "unicode/utf8" - - "google.golang.org/protobuf/types/known/anypb" -) - -// ensure the imports are used -var ( - _ = bytes.MinRead - _ = errors.New("") - _ = fmt.Print - _ = utf8.UTFMax - _ = (*regexp.Regexp)(nil) - _ = (*strings.Reader)(nil) - _ = net.IPv4len - _ = time.Duration(0) - _ = (*url.URL)(nil) - _ = (*mail.Address)(nil) - _ = anypb.Any{} - _ = sort.Sort -) - -// Validate checks the field values on GenericNode 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 *GenericNode) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on GenericNode 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 GenericNodeMultiError, or -// nil if none found. -func (m *GenericNode) ValidateAll() error { - return m.validate(true) -} - -func (m *GenericNode) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for NodeId - - // no validation rules for NodeName - - // no validation rules for Address - - // no validation rules for MachineId - - // no validation rules for Distro - - // no validation rules for NodeModel - - // no validation rules for Region - - // no validation rules for Az - - // no validation rules for CustomLabels - - if len(errors) > 0 { - return GenericNodeMultiError(errors) - } - - return nil -} - -// GenericNodeMultiError is an error wrapping multiple validation errors -// returned by GenericNode.ValidateAll() if the designated constraints aren't met. -type GenericNodeMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m GenericNodeMultiError) 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 GenericNodeMultiError) AllErrors() []error { return m } - -// GenericNodeValidationError is the validation error returned by -// GenericNode.Validate if the designated constraints aren't met. -type GenericNodeValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e GenericNodeValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e GenericNodeValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e GenericNodeValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e GenericNodeValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e GenericNodeValidationError) ErrorName() string { return "GenericNodeValidationError" } - -// Error satisfies the builtin error interface -func (e GenericNodeValidationError) 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 %sGenericNode.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = GenericNodeValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = GenericNodeValidationError{} - -// Validate checks the field values on ContainerNode 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 *ContainerNode) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ContainerNode 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 ContainerNodeMultiError, or -// nil if none found. -func (m *ContainerNode) ValidateAll() error { - return m.validate(true) -} - -func (m *ContainerNode) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for NodeId - - // no validation rules for NodeName - - // no validation rules for Address - - // no validation rules for MachineId - - // no validation rules for ContainerId - - // no validation rules for ContainerName - - // no validation rules for NodeModel - - // no validation rules for Region - - // no validation rules for Az - - // no validation rules for CustomLabels - - if len(errors) > 0 { - return ContainerNodeMultiError(errors) - } - - return nil -} - -// ContainerNodeMultiError is an error wrapping multiple validation errors -// returned by ContainerNode.ValidateAll() if the designated constraints -// aren't met. -type ContainerNodeMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ContainerNodeMultiError) 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 ContainerNodeMultiError) AllErrors() []error { return m } - -// ContainerNodeValidationError is the validation error returned by -// ContainerNode.Validate if the designated constraints aren't met. -type ContainerNodeValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ContainerNodeValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ContainerNodeValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ContainerNodeValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ContainerNodeValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ContainerNodeValidationError) ErrorName() string { return "ContainerNodeValidationError" } - -// Error satisfies the builtin error interface -func (e ContainerNodeValidationError) 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 %sContainerNode.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ContainerNodeValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ContainerNodeValidationError{} - -// Validate checks the field values on RemoteNode 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 *RemoteNode) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on RemoteNode 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 RemoteNodeMultiError, or -// nil if none found. -func (m *RemoteNode) ValidateAll() error { - return m.validate(true) -} - -func (m *RemoteNode) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for NodeId - - // no validation rules for NodeName - - // no validation rules for Address - - // no validation rules for NodeModel - - // no validation rules for Region - - // no validation rules for Az - - // no validation rules for CustomLabels - - if len(errors) > 0 { - return RemoteNodeMultiError(errors) - } - - return nil -} - -// RemoteNodeMultiError is an error wrapping multiple validation errors -// returned by RemoteNode.ValidateAll() if the designated constraints aren't met. -type RemoteNodeMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m RemoteNodeMultiError) 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 RemoteNodeMultiError) AllErrors() []error { return m } - -// RemoteNodeValidationError is the validation error returned by -// RemoteNode.Validate if the designated constraints aren't met. -type RemoteNodeValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e RemoteNodeValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e RemoteNodeValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e RemoteNodeValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e RemoteNodeValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e RemoteNodeValidationError) ErrorName() string { return "RemoteNodeValidationError" } - -// Error satisfies the builtin error interface -func (e RemoteNodeValidationError) 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 %sRemoteNode.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = RemoteNodeValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = RemoteNodeValidationError{} - -// Validate checks the field values on RemoteRDSNode 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 *RemoteRDSNode) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on RemoteRDSNode 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 RemoteRDSNodeMultiError, or -// nil if none found. -func (m *RemoteRDSNode) ValidateAll() error { - return m.validate(true) -} - -func (m *RemoteRDSNode) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for NodeId - - // no validation rules for NodeName - - // no validation rules for Address - - // no validation rules for NodeModel - - // no validation rules for Region - - // no validation rules for Az - - // no validation rules for CustomLabels - - // no validation rules for InstanceId - - if len(errors) > 0 { - return RemoteRDSNodeMultiError(errors) - } - - return nil -} - -// RemoteRDSNodeMultiError is an error wrapping multiple validation errors -// returned by RemoteRDSNode.ValidateAll() if the designated constraints -// aren't met. -type RemoteRDSNodeMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m RemoteRDSNodeMultiError) 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 RemoteRDSNodeMultiError) AllErrors() []error { return m } - -// RemoteRDSNodeValidationError is the validation error returned by -// RemoteRDSNode.Validate if the designated constraints aren't met. -type RemoteRDSNodeValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e RemoteRDSNodeValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e RemoteRDSNodeValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e RemoteRDSNodeValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e RemoteRDSNodeValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e RemoteRDSNodeValidationError) ErrorName() string { return "RemoteRDSNodeValidationError" } - -// Error satisfies the builtin error interface -func (e RemoteRDSNodeValidationError) 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 %sRemoteRDSNode.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = RemoteRDSNodeValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = RemoteRDSNodeValidationError{} - -// Validate checks the field values on RemoteAzureDatabaseNode 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 *RemoteAzureDatabaseNode) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on RemoteAzureDatabaseNode 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 -// RemoteAzureDatabaseNodeMultiError, or nil if none found. -func (m *RemoteAzureDatabaseNode) ValidateAll() error { - return m.validate(true) -} - -func (m *RemoteAzureDatabaseNode) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for NodeId - - // no validation rules for NodeName - - // no validation rules for Address - - // no validation rules for NodeModel - - // no validation rules for Region - - // no validation rules for Az - - // no validation rules for CustomLabels - - if len(errors) > 0 { - return RemoteAzureDatabaseNodeMultiError(errors) - } - - return nil -} - -// RemoteAzureDatabaseNodeMultiError is an error wrapping multiple validation -// errors returned by RemoteAzureDatabaseNode.ValidateAll() if the designated -// constraints aren't met. -type RemoteAzureDatabaseNodeMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m RemoteAzureDatabaseNodeMultiError) 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 RemoteAzureDatabaseNodeMultiError) AllErrors() []error { return m } - -// RemoteAzureDatabaseNodeValidationError is the validation error returned by -// RemoteAzureDatabaseNode.Validate if the designated constraints aren't met. -type RemoteAzureDatabaseNodeValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e RemoteAzureDatabaseNodeValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e RemoteAzureDatabaseNodeValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e RemoteAzureDatabaseNodeValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e RemoteAzureDatabaseNodeValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e RemoteAzureDatabaseNodeValidationError) ErrorName() string { - return "RemoteAzureDatabaseNodeValidationError" -} - -// Error satisfies the builtin error interface -func (e RemoteAzureDatabaseNodeValidationError) 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 %sRemoteAzureDatabaseNode.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = RemoteAzureDatabaseNodeValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = RemoteAzureDatabaseNodeValidationError{} - -// Validate checks the field values on ListNodesRequest 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 *ListNodesRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ListNodesRequest 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 -// ListNodesRequestMultiError, or nil if none found. -func (m *ListNodesRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *ListNodesRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for NodeType - - if len(errors) > 0 { - return ListNodesRequestMultiError(errors) - } - - return nil -} - -// ListNodesRequestMultiError is an error wrapping multiple validation errors -// returned by ListNodesRequest.ValidateAll() if the designated constraints -// aren't met. -type ListNodesRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ListNodesRequestMultiError) 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 ListNodesRequestMultiError) AllErrors() []error { return m } - -// ListNodesRequestValidationError is the validation error returned by -// ListNodesRequest.Validate if the designated constraints aren't met. -type ListNodesRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ListNodesRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ListNodesRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ListNodesRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ListNodesRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ListNodesRequestValidationError) ErrorName() string { return "ListNodesRequestValidationError" } - -// Error satisfies the builtin error interface -func (e ListNodesRequestValidationError) 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 %sListNodesRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ListNodesRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ListNodesRequestValidationError{} - -// Validate checks the field values on ListNodesResponse 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 *ListNodesResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ListNodesResponse 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 -// ListNodesResponseMultiError, or nil if none found. -func (m *ListNodesResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *ListNodesResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - for idx, item := range m.GetGeneric() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ListNodesResponseValidationError{ - field: fmt.Sprintf("Generic[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ListNodesResponseValidationError{ - field: fmt.Sprintf("Generic[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ListNodesResponseValidationError{ - field: fmt.Sprintf("Generic[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - for idx, item := range m.GetContainer() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ListNodesResponseValidationError{ - field: fmt.Sprintf("Container[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ListNodesResponseValidationError{ - field: fmt.Sprintf("Container[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ListNodesResponseValidationError{ - field: fmt.Sprintf("Container[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - for idx, item := range m.GetRemote() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ListNodesResponseValidationError{ - field: fmt.Sprintf("Remote[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ListNodesResponseValidationError{ - field: fmt.Sprintf("Remote[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ListNodesResponseValidationError{ - field: fmt.Sprintf("Remote[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - for idx, item := range m.GetRemoteRds() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ListNodesResponseValidationError{ - field: fmt.Sprintf("RemoteRds[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ListNodesResponseValidationError{ - field: fmt.Sprintf("RemoteRds[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ListNodesResponseValidationError{ - field: fmt.Sprintf("RemoteRds[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - for idx, item := range m.GetRemoteAzureDatabase() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ListNodesResponseValidationError{ - field: fmt.Sprintf("RemoteAzureDatabase[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ListNodesResponseValidationError{ - field: fmt.Sprintf("RemoteAzureDatabase[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ListNodesResponseValidationError{ - field: fmt.Sprintf("RemoteAzureDatabase[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - if len(errors) > 0 { - return ListNodesResponseMultiError(errors) - } - - return nil -} - -// ListNodesResponseMultiError is an error wrapping multiple validation errors -// returned by ListNodesResponse.ValidateAll() if the designated constraints -// aren't met. -type ListNodesResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ListNodesResponseMultiError) 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 ListNodesResponseMultiError) AllErrors() []error { return m } - -// ListNodesResponseValidationError is the validation error returned by -// ListNodesResponse.Validate if the designated constraints aren't met. -type ListNodesResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ListNodesResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ListNodesResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ListNodesResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ListNodesResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ListNodesResponseValidationError) ErrorName() string { - return "ListNodesResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e ListNodesResponseValidationError) 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 %sListNodesResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ListNodesResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ListNodesResponseValidationError{} - -// Validate checks the field values on GetNodeRequest 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 *GetNodeRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on GetNodeRequest 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 GetNodeRequestMultiError, -// or nil if none found. -func (m *GetNodeRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *GetNodeRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetNodeId()) < 1 { - err := GetNodeRequestValidationError{ - field: "NodeId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if len(errors) > 0 { - return GetNodeRequestMultiError(errors) - } - - return nil -} - -// GetNodeRequestMultiError is an error wrapping multiple validation errors -// returned by GetNodeRequest.ValidateAll() if the designated constraints -// aren't met. -type GetNodeRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m GetNodeRequestMultiError) 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 GetNodeRequestMultiError) AllErrors() []error { return m } - -// GetNodeRequestValidationError is the validation error returned by -// GetNodeRequest.Validate if the designated constraints aren't met. -type GetNodeRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e GetNodeRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e GetNodeRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e GetNodeRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e GetNodeRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e GetNodeRequestValidationError) ErrorName() string { return "GetNodeRequestValidationError" } - -// Error satisfies the builtin error interface -func (e GetNodeRequestValidationError) 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 %sGetNodeRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = GetNodeRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = GetNodeRequestValidationError{} - -// Validate checks the field values on GetNodeResponse 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 *GetNodeResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on GetNodeResponse 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 -// GetNodeResponseMultiError, or nil if none found. -func (m *GetNodeResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *GetNodeResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - switch v := m.Node.(type) { - case *GetNodeResponse_Generic: - if v == nil { - err := GetNodeResponseValidationError{ - field: "Node", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetGeneric()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GetNodeResponseValidationError{ - field: "Generic", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GetNodeResponseValidationError{ - field: "Generic", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetGeneric()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GetNodeResponseValidationError{ - field: "Generic", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *GetNodeResponse_Container: - if v == nil { - err := GetNodeResponseValidationError{ - field: "Node", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetContainer()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GetNodeResponseValidationError{ - field: "Container", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GetNodeResponseValidationError{ - field: "Container", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetContainer()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GetNodeResponseValidationError{ - field: "Container", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *GetNodeResponse_Remote: - if v == nil { - err := GetNodeResponseValidationError{ - field: "Node", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetRemote()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GetNodeResponseValidationError{ - field: "Remote", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GetNodeResponseValidationError{ - field: "Remote", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetRemote()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GetNodeResponseValidationError{ - field: "Remote", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *GetNodeResponse_RemoteRds: - if v == nil { - err := GetNodeResponseValidationError{ - field: "Node", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetRemoteRds()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GetNodeResponseValidationError{ - field: "RemoteRds", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GetNodeResponseValidationError{ - field: "RemoteRds", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetRemoteRds()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GetNodeResponseValidationError{ - field: "RemoteRds", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *GetNodeResponse_RemoteAzureDatabase: - if v == nil { - err := GetNodeResponseValidationError{ - field: "Node", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetRemoteAzureDatabase()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GetNodeResponseValidationError{ - field: "RemoteAzureDatabase", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GetNodeResponseValidationError{ - field: "RemoteAzureDatabase", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetRemoteAzureDatabase()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GetNodeResponseValidationError{ - field: "RemoteAzureDatabase", - reason: "embedded message failed validation", - cause: err, - } - } - } - - default: - _ = v // ensures v is used - } - - if len(errors) > 0 { - return GetNodeResponseMultiError(errors) - } - - return nil -} - -// GetNodeResponseMultiError is an error wrapping multiple validation errors -// returned by GetNodeResponse.ValidateAll() if the designated constraints -// aren't met. -type GetNodeResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m GetNodeResponseMultiError) 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 GetNodeResponseMultiError) AllErrors() []error { return m } - -// GetNodeResponseValidationError is the validation error returned by -// GetNodeResponse.Validate if the designated constraints aren't met. -type GetNodeResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e GetNodeResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e GetNodeResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e GetNodeResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e GetNodeResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e GetNodeResponseValidationError) ErrorName() string { return "GetNodeResponseValidationError" } - -// Error satisfies the builtin error interface -func (e GetNodeResponseValidationError) 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 %sGetNodeResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = GetNodeResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = GetNodeResponseValidationError{} - -// Validate checks the field values on AddNodeRequest with the rules defined in -// the proto definition for this message. If any rules are violated, the first -// error encountered is returned, or nil if there are no violations. -func (m *AddNodeRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on AddNodeRequest with the rules defined -// in the proto definition for this message. If any rules are violated, the -// result is a list of violation errors wrapped in AddNodeRequestMultiError, -// or nil if none found. -func (m *AddNodeRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *AddNodeRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - switch v := m.Node.(type) { - case *AddNodeRequest_Generic: - if v == nil { - err := AddNodeRequestValidationError{ - field: "Node", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetGeneric()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AddNodeRequestValidationError{ - field: "Generic", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AddNodeRequestValidationError{ - field: "Generic", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetGeneric()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AddNodeRequestValidationError{ - field: "Generic", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *AddNodeRequest_Container: - if v == nil { - err := AddNodeRequestValidationError{ - field: "Node", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetContainer()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AddNodeRequestValidationError{ - field: "Container", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AddNodeRequestValidationError{ - field: "Container", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetContainer()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AddNodeRequestValidationError{ - field: "Container", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *AddNodeRequest_Remote: - if v == nil { - err := AddNodeRequestValidationError{ - field: "Node", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetRemote()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AddNodeRequestValidationError{ - field: "Remote", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AddNodeRequestValidationError{ - field: "Remote", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetRemote()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AddNodeRequestValidationError{ - field: "Remote", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *AddNodeRequest_RemoteRds: - if v == nil { - err := AddNodeRequestValidationError{ - field: "Node", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetRemoteRds()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AddNodeRequestValidationError{ - field: "RemoteRds", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AddNodeRequestValidationError{ - field: "RemoteRds", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetRemoteRds()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AddNodeRequestValidationError{ - field: "RemoteRds", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *AddNodeRequest_RemoteAzure: - if v == nil { - err := AddNodeRequestValidationError{ - field: "Node", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetRemoteAzure()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AddNodeRequestValidationError{ - field: "RemoteAzure", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AddNodeRequestValidationError{ - field: "RemoteAzure", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetRemoteAzure()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AddNodeRequestValidationError{ - field: "RemoteAzure", - reason: "embedded message failed validation", - cause: err, - } - } - } - - default: - _ = v // ensures v is used - } - - if len(errors) > 0 { - return AddNodeRequestMultiError(errors) - } - - return nil -} - -// AddNodeRequestMultiError is an error wrapping multiple validation errors -// returned by AddNodeRequest.ValidateAll() if the designated constraints -// aren't met. -type AddNodeRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m AddNodeRequestMultiError) Error() string { - 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 AddNodeRequestMultiError) AllErrors() []error { return m } - -// AddNodeRequestValidationError is the validation error returned by -// AddNodeRequest.Validate if the designated constraints aren't met. -type AddNodeRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e AddNodeRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e AddNodeRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e AddNodeRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e AddNodeRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e AddNodeRequestValidationError) ErrorName() string { return "AddNodeRequestValidationError" } - -// Error satisfies the builtin error interface -func (e AddNodeRequestValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sAddNodeRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = AddNodeRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = AddNodeRequestValidationError{} - -// Validate checks the field values on AddNodeResponse with the rules defined -// in the proto definition for this message. If any rules are violated, the -// first error encountered is returned, or nil if there are no violations. -func (m *AddNodeResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on AddNodeResponse with the rules -// defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// AddNodeResponseMultiError, or nil if none found. -func (m *AddNodeResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *AddNodeResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - switch v := m.Node.(type) { - case *AddNodeResponse_Generic: - if v == nil { - err := AddNodeResponseValidationError{ - field: "Node", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetGeneric()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AddNodeResponseValidationError{ - field: "Generic", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AddNodeResponseValidationError{ - field: "Generic", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetGeneric()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AddNodeResponseValidationError{ - field: "Generic", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *AddNodeResponse_Container: - if v == nil { - err := AddNodeResponseValidationError{ - field: "Node", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetContainer()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AddNodeResponseValidationError{ - field: "Container", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AddNodeResponseValidationError{ - field: "Container", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetContainer()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AddNodeResponseValidationError{ - field: "Container", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *AddNodeResponse_Remote: - if v == nil { - err := AddNodeResponseValidationError{ - field: "Node", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetRemote()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AddNodeResponseValidationError{ - field: "Remote", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AddNodeResponseValidationError{ - field: "Remote", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetRemote()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AddNodeResponseValidationError{ - field: "Remote", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *AddNodeResponse_RemoteRds: - if v == nil { - err := AddNodeResponseValidationError{ - field: "Node", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetRemoteRds()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AddNodeResponseValidationError{ - field: "RemoteRds", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AddNodeResponseValidationError{ - field: "RemoteRds", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetRemoteRds()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AddNodeResponseValidationError{ - field: "RemoteRds", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *AddNodeResponse_RemoteAzureDatabase: - if v == nil { - err := AddNodeResponseValidationError{ - field: "Node", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetRemoteAzureDatabase()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AddNodeResponseValidationError{ - field: "RemoteAzureDatabase", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AddNodeResponseValidationError{ - field: "RemoteAzureDatabase", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetRemoteAzureDatabase()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AddNodeResponseValidationError{ - field: "RemoteAzureDatabase", - reason: "embedded message failed validation", - cause: err, - } - } - } - - default: - _ = v // ensures v is used - } - - if len(errors) > 0 { - return AddNodeResponseMultiError(errors) - } - - return nil -} - -// AddNodeResponseMultiError is an error wrapping multiple validation errors -// returned by AddNodeResponse.ValidateAll() if the designated constraints -// aren't met. -type AddNodeResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m AddNodeResponseMultiError) Error() string { - 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 AddNodeResponseMultiError) AllErrors() []error { return m } - -// AddNodeResponseValidationError is the validation error returned by -// AddNodeResponse.Validate if the designated constraints aren't met. -type AddNodeResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e AddNodeResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e AddNodeResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e AddNodeResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e AddNodeResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e AddNodeResponseValidationError) ErrorName() string { return "AddNodeResponseValidationError" } - -// Error satisfies the builtin error interface -func (e AddNodeResponseValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sAddNodeResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = AddNodeResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = AddNodeResponseValidationError{} - -// Validate checks the field values on AddGenericNodeParams 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 *AddGenericNodeParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on AddGenericNodeParams 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 -// AddGenericNodeParamsMultiError, or nil if none found. -func (m *AddGenericNodeParams) ValidateAll() error { - return m.validate(true) -} - -func (m *AddGenericNodeParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetNodeName()) < 1 { - err := AddGenericNodeParamsValidationError{ - field: "NodeName", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if utf8.RuneCountInString(m.GetAddress()) < 1 { - err := AddGenericNodeParamsValidationError{ - field: "Address", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for MachineId - - // no validation rules for Distro - - // no validation rules for NodeModel - - // no validation rules for Region - - // no validation rules for Az - - // no validation rules for CustomLabels - - if len(errors) > 0 { - return AddGenericNodeParamsMultiError(errors) - } - - return nil -} - -// AddGenericNodeParamsMultiError is an error wrapping multiple validation -// errors returned by AddGenericNodeParams.ValidateAll() if the designated -// constraints aren't met. -type AddGenericNodeParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m AddGenericNodeParamsMultiError) 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 AddGenericNodeParamsMultiError) AllErrors() []error { return m } - -// AddGenericNodeParamsValidationError is the validation error returned by -// AddGenericNodeParams.Validate if the designated constraints aren't met. -type AddGenericNodeParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e AddGenericNodeParamsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e AddGenericNodeParamsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e AddGenericNodeParamsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e AddGenericNodeParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e AddGenericNodeParamsValidationError) ErrorName() string { - return "AddGenericNodeParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e AddGenericNodeParamsValidationError) 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 %sAddGenericNodeParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = AddGenericNodeParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = AddGenericNodeParamsValidationError{} - -// Validate checks the field values on AddContainerNodeParams 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 *AddContainerNodeParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on AddContainerNodeParams 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 -// AddContainerNodeParamsMultiError, or nil if none found. -func (m *AddContainerNodeParams) ValidateAll() error { - return m.validate(true) -} - -func (m *AddContainerNodeParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetNodeName()) < 1 { - err := AddContainerNodeParamsValidationError{ - field: "NodeName", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if utf8.RuneCountInString(m.GetAddress()) < 1 { - err := AddContainerNodeParamsValidationError{ - field: "Address", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for MachineId - - // no validation rules for ContainerId - - // no validation rules for ContainerName - - // no validation rules for NodeModel - - // no validation rules for Region - - // no validation rules for Az - - // no validation rules for CustomLabels - - if len(errors) > 0 { - return AddContainerNodeParamsMultiError(errors) - } - - return nil -} - -// AddContainerNodeParamsMultiError is an error wrapping multiple validation -// errors returned by AddContainerNodeParams.ValidateAll() if the designated -// constraints aren't met. -type AddContainerNodeParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m AddContainerNodeParamsMultiError) 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 AddContainerNodeParamsMultiError) AllErrors() []error { return m } - -// AddContainerNodeParamsValidationError is the validation error returned by -// AddContainerNodeParams.Validate if the designated constraints aren't met. -type AddContainerNodeParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e AddContainerNodeParamsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e AddContainerNodeParamsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e AddContainerNodeParamsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e AddContainerNodeParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e AddContainerNodeParamsValidationError) ErrorName() string { - return "AddContainerNodeParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e AddContainerNodeParamsValidationError) 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 %sAddContainerNodeParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = AddContainerNodeParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = AddContainerNodeParamsValidationError{} - -// Validate checks the field values on AddRemoteNodeParams 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 *AddRemoteNodeParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on AddRemoteNodeParams 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 -// AddRemoteNodeParamsMultiError, or nil if none found. -func (m *AddRemoteNodeParams) ValidateAll() error { - return m.validate(true) -} - -func (m *AddRemoteNodeParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetNodeName()) < 1 { - err := AddRemoteNodeParamsValidationError{ - field: "NodeName", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if utf8.RuneCountInString(m.GetAddress()) < 1 { - err := AddRemoteNodeParamsValidationError{ - field: "Address", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for NodeModel - - // no validation rules for Region - - // no validation rules for Az - - // no validation rules for CustomLabels - - if len(errors) > 0 { - return AddRemoteNodeParamsMultiError(errors) - } - - return nil -} - -// AddRemoteNodeParamsMultiError is an error wrapping multiple validation -// errors returned by AddRemoteNodeParams.ValidateAll() if the designated -// constraints aren't met. -type AddRemoteNodeParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m AddRemoteNodeParamsMultiError) 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 AddRemoteNodeParamsMultiError) AllErrors() []error { return m } - -// AddRemoteNodeParamsValidationError is the validation error returned by -// AddRemoteNodeParams.Validate if the designated constraints aren't met. -type AddRemoteNodeParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e AddRemoteNodeParamsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e AddRemoteNodeParamsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e AddRemoteNodeParamsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e AddRemoteNodeParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e AddRemoteNodeParamsValidationError) ErrorName() string { - return "AddRemoteNodeParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e AddRemoteNodeParamsValidationError) 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 %sAddRemoteNodeParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = AddRemoteNodeParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = AddRemoteNodeParamsValidationError{} - -// Validate checks the field values on AddRemoteRDSNodeParams 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 *AddRemoteRDSNodeParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on AddRemoteRDSNodeParams 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 -// AddRemoteRDSNodeParamsMultiError, or nil if none found. -func (m *AddRemoteRDSNodeParams) ValidateAll() error { - return m.validate(true) -} - -func (m *AddRemoteRDSNodeParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetNodeName()) < 1 { - err := AddRemoteRDSNodeParamsValidationError{ - field: "NodeName", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if utf8.RuneCountInString(m.GetAddress()) < 1 { - err := AddRemoteRDSNodeParamsValidationError{ - field: "Address", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for NodeModel - - if utf8.RuneCountInString(m.GetRegion()) < 1 { - err := AddRemoteRDSNodeParamsValidationError{ - field: "Region", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for Az - - // no validation rules for CustomLabels - - if len(errors) > 0 { - return AddRemoteRDSNodeParamsMultiError(errors) - } - - return nil -} - -// AddRemoteRDSNodeParamsMultiError is an error wrapping multiple validation -// errors returned by AddRemoteRDSNodeParams.ValidateAll() if the designated -// constraints aren't met. -type AddRemoteRDSNodeParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m AddRemoteRDSNodeParamsMultiError) 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 AddRemoteRDSNodeParamsMultiError) AllErrors() []error { return m } - -// AddRemoteRDSNodeParamsValidationError is the validation error returned by -// AddRemoteRDSNodeParams.Validate if the designated constraints aren't met. -type AddRemoteRDSNodeParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e AddRemoteRDSNodeParamsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e AddRemoteRDSNodeParamsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e AddRemoteRDSNodeParamsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e AddRemoteRDSNodeParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e AddRemoteRDSNodeParamsValidationError) ErrorName() string { - return "AddRemoteRDSNodeParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e AddRemoteRDSNodeParamsValidationError) 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 %sAddRemoteRDSNodeParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = AddRemoteRDSNodeParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = AddRemoteRDSNodeParamsValidationError{} - -// Validate checks the field values on AddRemoteAzureNodeParams 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 *AddRemoteAzureNodeParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on AddRemoteAzureNodeParams 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 -// AddRemoteAzureNodeParamsMultiError, or nil if none found. -func (m *AddRemoteAzureNodeParams) ValidateAll() error { - return m.validate(true) -} - -func (m *AddRemoteAzureNodeParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetNodeName()) < 1 { - err := AddRemoteAzureNodeParamsValidationError{ - field: "NodeName", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if utf8.RuneCountInString(m.GetAddress()) < 1 { - err := AddRemoteAzureNodeParamsValidationError{ - field: "Address", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for NodeModel - - if utf8.RuneCountInString(m.GetRegion()) < 1 { - err := AddRemoteAzureNodeParamsValidationError{ - field: "Region", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for Az - - // no validation rules for CustomLabels - - if len(errors) > 0 { - return AddRemoteAzureNodeParamsMultiError(errors) - } - - return nil -} - -// AddRemoteAzureNodeParamsMultiError is an error wrapping multiple validation -// errors returned by AddRemoteAzureNodeParams.ValidateAll() if the designated -// constraints aren't met. -type AddRemoteAzureNodeParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m AddRemoteAzureNodeParamsMultiError) 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 AddRemoteAzureNodeParamsMultiError) AllErrors() []error { return m } - -// AddRemoteAzureNodeParamsValidationError is the validation error returned by -// AddRemoteAzureNodeParams.Validate if the designated constraints aren't met. -type AddRemoteAzureNodeParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e AddRemoteAzureNodeParamsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e AddRemoteAzureNodeParamsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e AddRemoteAzureNodeParamsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e AddRemoteAzureNodeParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e AddRemoteAzureNodeParamsValidationError) ErrorName() string { - return "AddRemoteAzureNodeParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e AddRemoteAzureNodeParamsValidationError) 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 %sAddRemoteAzureNodeParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = AddRemoteAzureNodeParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = AddRemoteAzureNodeParamsValidationError{} - -// Validate checks the field values on RemoveNodeRequest 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 *RemoveNodeRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on RemoveNodeRequest 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 -// RemoveNodeRequestMultiError, or nil if none found. -func (m *RemoveNodeRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *RemoveNodeRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetNodeId()) < 1 { - err := RemoveNodeRequestValidationError{ - field: "NodeId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for Force - - if len(errors) > 0 { - return RemoveNodeRequestMultiError(errors) - } - - return nil -} - -// RemoveNodeRequestMultiError is an error wrapping multiple validation errors -// returned by RemoveNodeRequest.ValidateAll() if the designated constraints -// aren't met. -type RemoveNodeRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m RemoveNodeRequestMultiError) 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 RemoveNodeRequestMultiError) AllErrors() []error { return m } - -// RemoveNodeRequestValidationError is the validation error returned by -// RemoveNodeRequest.Validate if the designated constraints aren't met. -type RemoveNodeRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e RemoveNodeRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e RemoveNodeRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e RemoveNodeRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e RemoveNodeRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e RemoveNodeRequestValidationError) ErrorName() string { - return "RemoveNodeRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e RemoveNodeRequestValidationError) 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 %sRemoveNodeRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = RemoveNodeRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = RemoveNodeRequestValidationError{} - -// Validate checks the field values on RemoveNodeResponse 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 *RemoveNodeResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on RemoveNodeResponse 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 -// RemoveNodeResponseMultiError, or nil if none found. -func (m *RemoveNodeResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *RemoveNodeResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return RemoveNodeResponseMultiError(errors) - } - - return nil -} - -// RemoveNodeResponseMultiError is an error wrapping multiple validation errors -// returned by RemoveNodeResponse.ValidateAll() if the designated constraints -// aren't met. -type RemoveNodeResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m RemoveNodeResponseMultiError) 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 RemoveNodeResponseMultiError) AllErrors() []error { return m } - -// RemoveNodeResponseValidationError is the validation error returned by -// RemoveNodeResponse.Validate if the designated constraints aren't met. -type RemoveNodeResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e RemoveNodeResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e RemoveNodeResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e RemoveNodeResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e RemoveNodeResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e RemoveNodeResponseValidationError) ErrorName() string { - return "RemoveNodeResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e RemoveNodeResponseValidationError) 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 %sRemoveNodeResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = RemoveNodeResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = RemoveNodeResponseValidationError{} diff --git a/api/inventory/v1/nodes_grpc.pb.go b/api/inventory/v1/nodes_grpc.pb.go deleted file mode 100644 index 7142c1b4a15..00000000000 --- a/api/inventory/v1/nodes_grpc.pb.go +++ /dev/null @@ -1,251 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.6.0 -// - protoc (unknown) -// source: inventory/v1/nodes.proto - -package inventoryv1 - -import ( - context "context" - - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.64.0 or later. -const _ = grpc.SupportPackageIsVersion9 - -const ( - NodesService_ListNodes_FullMethodName = "/inventory.v1.NodesService/ListNodes" - NodesService_GetNode_FullMethodName = "/inventory.v1.NodesService/GetNode" - NodesService_AddNode_FullMethodName = "/inventory.v1.NodesService/AddNode" - NodesService_RemoveNode_FullMethodName = "/inventory.v1.NodesService/RemoveNode" -) - -// NodesServiceClient is the client API for NodesService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -// -// Nodes service provides public methods for managing Nodes. -type NodesServiceClient interface { - // ListNodes returns a list of all Nodes. - 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) - // AddNode adds any type of Node. - AddNode(ctx context.Context, in *AddNodeRequest, opts ...grpc.CallOption) (*AddNodeResponse, error) - // RemoveNode removes a Node. - RemoveNode(ctx context.Context, in *RemoveNodeRequest, opts ...grpc.CallOption) (*RemoveNodeResponse, error) -} - -type nodesServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewNodesServiceClient(cc grpc.ClientConnInterface) NodesServiceClient { - return &nodesServiceClient{cc} -} - -func (c *nodesServiceClient) ListNodes(ctx context.Context, in *ListNodesRequest, opts ...grpc.CallOption) (*ListNodesResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(ListNodesResponse) - err := c.cc.Invoke(ctx, NodesService_ListNodes_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *nodesServiceClient) GetNode(ctx context.Context, in *GetNodeRequest, opts ...grpc.CallOption) (*GetNodeResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetNodeResponse) - err := c.cc.Invoke(ctx, NodesService_GetNode_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *nodesServiceClient) AddNode(ctx context.Context, in *AddNodeRequest, opts ...grpc.CallOption) (*AddNodeResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(AddNodeResponse) - err := c.cc.Invoke(ctx, NodesService_AddNode_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *nodesServiceClient) RemoveNode(ctx context.Context, in *RemoveNodeRequest, opts ...grpc.CallOption) (*RemoveNodeResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(RemoveNodeResponse) - err := c.cc.Invoke(ctx, NodesService_RemoveNode_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -// NodesServiceServer is the server API for NodesService service. -// All implementations must embed UnimplementedNodesServiceServer -// for forward compatibility. -// -// Nodes service provides public methods for managing Nodes. -type NodesServiceServer interface { - // ListNodes returns a list of all Nodes. - ListNodes(context.Context, *ListNodesRequest) (*ListNodesResponse, error) - // GetNode returns a single Node by ID. - GetNode(context.Context, *GetNodeRequest) (*GetNodeResponse, error) - // AddNode adds any type of Node. - AddNode(context.Context, *AddNodeRequest) (*AddNodeResponse, error) - // RemoveNode removes a Node. - RemoveNode(context.Context, *RemoveNodeRequest) (*RemoveNodeResponse, error) - mustEmbedUnimplementedNodesServiceServer() -} - -// UnimplementedNodesServiceServer must be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -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") -} -func (UnimplementedNodesServiceServer) mustEmbedUnimplementedNodesServiceServer() {} -func (UnimplementedNodesServiceServer) testEmbeddedByValue() {} - -// UnsafeNodesServiceServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to NodesServiceServer will -// result in compilation errors. -type UnsafeNodesServiceServer interface { - mustEmbedUnimplementedNodesServiceServer() -} - -func RegisterNodesServiceServer(s grpc.ServiceRegistrar, srv NodesServiceServer) { - // If the following call panics, it indicates UnimplementedNodesServiceServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } - s.RegisterService(&NodesService_ServiceDesc, srv) -} - -func _NodesService_ListNodes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListNodesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(NodesServiceServer).ListNodes(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: NodesService_ListNodes_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(NodesServiceServer).ListNodes(ctx, req.(*ListNodesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _NodesService_GetNode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetNodeRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(NodesServiceServer).GetNode(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: NodesService_GetNode_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(NodesServiceServer).GetNode(ctx, req.(*GetNodeRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _NodesService_AddNode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AddNodeRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(NodesServiceServer).AddNode(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: NodesService_AddNode_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(NodesServiceServer).AddNode(ctx, req.(*AddNodeRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _NodesService_RemoveNode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RemoveNodeRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(NodesServiceServer).RemoveNode(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: NodesService_RemoveNode_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(NodesServiceServer).RemoveNode(ctx, req.(*RemoveNodeRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// NodesService_ServiceDesc is the grpc.ServiceDesc for NodesService service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var NodesService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "inventory.v1.NodesService", - HandlerType: (*NodesServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "ListNodes", - Handler: _NodesService_ListNodes_Handler, - }, - { - MethodName: "GetNode", - Handler: _NodesService_GetNode_Handler, - }, - { - MethodName: "AddNode", - Handler: _NodesService_AddNode_Handler, - }, - { - MethodName: "RemoveNode", - Handler: _NodesService_RemoveNode_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "inventory/v1/nodes.proto", -} diff --git a/api/inventory/v1/services.pb.go b/api/inventory/v1/services.pb.go deleted file mode 100644 index 7487bc5f8eb..00000000000 --- a/api/inventory/v1/services.pb.go +++ /dev/null @@ -1,3451 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.10 -// protoc (unknown) -// source: inventory/v1/services.proto - -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" - - common "github.com/percona/pmm/api/common" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// ServiceType describes supported Service types. -type ServiceType int32 - -const ( - ServiceType_SERVICE_TYPE_UNSPECIFIED ServiceType = 0 - ServiceType_SERVICE_TYPE_MYSQL_SERVICE ServiceType = 1 - ServiceType_SERVICE_TYPE_MONGODB_SERVICE ServiceType = 2 - ServiceType_SERVICE_TYPE_POSTGRESQL_SERVICE ServiceType = 3 - ServiceType_SERVICE_TYPE_VALKEY_SERVICE ServiceType = 7 - ServiceType_SERVICE_TYPE_PROXYSQL_SERVICE ServiceType = 4 - ServiceType_SERVICE_TYPE_HAPROXY_SERVICE ServiceType = 6 - ServiceType_SERVICE_TYPE_EXTERNAL_SERVICE ServiceType = 5 -) - -// Enum value maps for ServiceType. -var ( - ServiceType_name = map[int32]string{ - 0: "SERVICE_TYPE_UNSPECIFIED", - 1: "SERVICE_TYPE_MYSQL_SERVICE", - 2: "SERVICE_TYPE_MONGODB_SERVICE", - 3: "SERVICE_TYPE_POSTGRESQL_SERVICE", - 7: "SERVICE_TYPE_VALKEY_SERVICE", - 4: "SERVICE_TYPE_PROXYSQL_SERVICE", - 6: "SERVICE_TYPE_HAPROXY_SERVICE", - 5: "SERVICE_TYPE_EXTERNAL_SERVICE", - } - ServiceType_value = map[string]int32{ - "SERVICE_TYPE_UNSPECIFIED": 0, - "SERVICE_TYPE_MYSQL_SERVICE": 1, - "SERVICE_TYPE_MONGODB_SERVICE": 2, - "SERVICE_TYPE_POSTGRESQL_SERVICE": 3, - "SERVICE_TYPE_VALKEY_SERVICE": 7, - "SERVICE_TYPE_PROXYSQL_SERVICE": 4, - "SERVICE_TYPE_HAPROXY_SERVICE": 6, - "SERVICE_TYPE_EXTERNAL_SERVICE": 5, - } -) - -func (x ServiceType) Enum() *ServiceType { - p := new(ServiceType) - *p = x - return p -} - -func (x ServiceType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (ServiceType) Descriptor() protoreflect.EnumDescriptor { - return file_inventory_v1_services_proto_enumTypes[0].Descriptor() -} - -func (ServiceType) Type() protoreflect.EnumType { - return &file_inventory_v1_services_proto_enumTypes[0] -} - -func (x ServiceType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use ServiceType.Descriptor instead. -func (ServiceType) EnumDescriptor() ([]byte, []int) { - return file_inventory_v1_services_proto_rawDescGZIP(), []int{0} -} - -// MySQLService represents a generic MySQL instance. -type MySQLService struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Unique randomly generated instance identifier. - ServiceId string `protobuf:"bytes,1,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` - // Unique across all Services user-defined name. - ServiceName string `protobuf:"bytes,2,opt,name=service_name,json=serviceName,proto3" json:"service_name,omitempty"` - // Node identifier where this instance runs. - NodeId string `protobuf:"bytes,3,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` - // Access address (DNS name or IP). - // Address (and port) or socket is required. - Address string `protobuf:"bytes,4,opt,name=address,proto3" json:"address,omitempty"` - // Access port. - // Port is required when the address present. - Port uint32 `protobuf:"varint,5,opt,name=port,proto3" json:"port,omitempty"` - // Access unix socket. - // Address (and port) or socket is required. - Socket string `protobuf:"bytes,6,opt,name=socket,proto3" json:"socket,omitempty"` - // Environment name. - Environment string `protobuf:"bytes,7,opt,name=environment,proto3" json:"environment,omitempty"` - // Cluster name. - Cluster string `protobuf:"bytes,8,opt,name=cluster,proto3" json:"cluster,omitempty"` - // Replication set name. - ReplicationSet string `protobuf:"bytes,9,opt,name=replication_set,json=replicationSet,proto3" json:"replication_set,omitempty"` - // Custom user-assigned labels. - CustomLabels map[string]string `protobuf:"bytes,10,rep,name=custom_labels,json=customLabels,proto3" json:"custom_labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - // MySQL version. - Version string `protobuf:"bytes,11,opt,name=version,proto3" json:"version,omitempty"` - // Extra parameters to be added to the DSN. - ExtraDsnParams map[string]string `protobuf:"bytes,12,rep,name=extra_dsn_params,json=extraDsnParams,proto3" json:"extra_dsn_params,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *MySQLService) Reset() { - *x = MySQLService{} - mi := &file_inventory_v1_services_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *MySQLService) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MySQLService) ProtoMessage() {} - -func (x *MySQLService) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_services_proto_msgTypes[0] - 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 MySQLService.ProtoReflect.Descriptor instead. -func (*MySQLService) Descriptor() ([]byte, []int) { - return file_inventory_v1_services_proto_rawDescGZIP(), []int{0} -} - -func (x *MySQLService) GetServiceId() string { - if x != nil { - return x.ServiceId - } - return "" -} - -func (x *MySQLService) GetServiceName() string { - if x != nil { - return x.ServiceName - } - return "" -} - -func (x *MySQLService) GetNodeId() string { - if x != nil { - return x.NodeId - } - return "" -} - -func (x *MySQLService) GetAddress() string { - if x != nil { - return x.Address - } - return "" -} - -func (x *MySQLService) GetPort() uint32 { - if x != nil { - return x.Port - } - return 0 -} - -func (x *MySQLService) GetSocket() string { - if x != nil { - return x.Socket - } - return "" -} - -func (x *MySQLService) GetEnvironment() string { - if x != nil { - return x.Environment - } - return "" -} - -func (x *MySQLService) GetCluster() string { - if x != nil { - return x.Cluster - } - return "" -} - -func (x *MySQLService) GetReplicationSet() string { - if x != nil { - return x.ReplicationSet - } - return "" -} - -func (x *MySQLService) GetCustomLabels() map[string]string { - if x != nil { - return x.CustomLabels - } - return nil -} - -func (x *MySQLService) GetVersion() string { - if x != nil { - return x.Version - } - return "" -} - -func (x *MySQLService) GetExtraDsnParams() map[string]string { - if x != nil { - return x.ExtraDsnParams - } - return nil -} - -// MongoDBService represents a generic MongoDB instance. -type MongoDBService struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Unique randomly generated instance identifier. - ServiceId string `protobuf:"bytes,1,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` - // Unique across all Services user-defined name. - ServiceName string `protobuf:"bytes,2,opt,name=service_name,json=serviceName,proto3" json:"service_name,omitempty"` - // Node identifier where this instance runs. - NodeId string `protobuf:"bytes,3,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` - // Access address (DNS name or IP). - // Address (and port) or socket is required. - Address string `protobuf:"bytes,4,opt,name=address,proto3" json:"address,omitempty"` - // Access port. - // Port is required when the address present. - Port uint32 `protobuf:"varint,5,opt,name=port,proto3" json:"port,omitempty"` - // Access unix socket. - // Address (and port) or socket is required. - Socket string `protobuf:"bytes,6,opt,name=socket,proto3" json:"socket,omitempty"` - // Environment name. - Environment string `protobuf:"bytes,7,opt,name=environment,proto3" json:"environment,omitempty"` - // Cluster name. - Cluster string `protobuf:"bytes,8,opt,name=cluster,proto3" json:"cluster,omitempty"` - // Replication set name. - ReplicationSet string `protobuf:"bytes,9,opt,name=replication_set,json=replicationSet,proto3" json:"replication_set,omitempty"` - // Custom user-assigned labels. - CustomLabels map[string]string `protobuf:"bytes,10,rep,name=custom_labels,json=customLabels,proto3" json:"custom_labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - // MongoDB version. - Version string `protobuf:"bytes,11,opt,name=version,proto3" json:"version,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *MongoDBService) Reset() { - *x = MongoDBService{} - mi := &file_inventory_v1_services_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *MongoDBService) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MongoDBService) ProtoMessage() {} - -func (x *MongoDBService) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_services_proto_msgTypes[1] - 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 MongoDBService.ProtoReflect.Descriptor instead. -func (*MongoDBService) Descriptor() ([]byte, []int) { - return file_inventory_v1_services_proto_rawDescGZIP(), []int{1} -} - -func (x *MongoDBService) GetServiceId() string { - if x != nil { - return x.ServiceId - } - return "" -} - -func (x *MongoDBService) GetServiceName() string { - if x != nil { - return x.ServiceName - } - return "" -} - -func (x *MongoDBService) GetNodeId() string { - if x != nil { - return x.NodeId - } - return "" -} - -func (x *MongoDBService) GetAddress() string { - if x != nil { - return x.Address - } - return "" -} - -func (x *MongoDBService) GetPort() uint32 { - if x != nil { - return x.Port - } - return 0 -} - -func (x *MongoDBService) GetSocket() string { - if x != nil { - return x.Socket - } - return "" -} - -func (x *MongoDBService) GetEnvironment() string { - if x != nil { - return x.Environment - } - return "" -} - -func (x *MongoDBService) GetCluster() string { - if x != nil { - return x.Cluster - } - return "" -} - -func (x *MongoDBService) GetReplicationSet() string { - if x != nil { - return x.ReplicationSet - } - return "" -} - -func (x *MongoDBService) GetCustomLabels() map[string]string { - if x != nil { - return x.CustomLabels - } - return nil -} - -func (x *MongoDBService) GetVersion() string { - if x != nil { - return x.Version - } - return "" -} - -// PostgreSQLService represents a generic PostgreSQL instance. -type PostgreSQLService struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Unique randomly generated instance identifier. - ServiceId string `protobuf:"bytes,1,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` - // Unique across all Services user-defined name. - ServiceName string `protobuf:"bytes,2,opt,name=service_name,json=serviceName,proto3" json:"service_name,omitempty"` - // Database name. - DatabaseName string `protobuf:"bytes,3,opt,name=database_name,json=databaseName,proto3" json:"database_name,omitempty"` - // Node identifier where this instance runs. - NodeId string `protobuf:"bytes,4,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` - // Access address (DNS name or IP). - // Address (and port) or socket is required. - Address string `protobuf:"bytes,5,opt,name=address,proto3" json:"address,omitempty"` - // Access port. - // Port is required when the address present. - Port uint32 `protobuf:"varint,6,opt,name=port,proto3" json:"port,omitempty"` - // Access unix socket. - // Address (and port) or socket is required. - Socket string `protobuf:"bytes,7,opt,name=socket,proto3" json:"socket,omitempty"` - // Environment name. - Environment string `protobuf:"bytes,8,opt,name=environment,proto3" json:"environment,omitempty"` - // Cluster name. - Cluster string `protobuf:"bytes,9,opt,name=cluster,proto3" json:"cluster,omitempty"` - // Replication set name. - ReplicationSet string `protobuf:"bytes,10,opt,name=replication_set,json=replicationSet,proto3" json:"replication_set,omitempty"` - // Custom user-assigned labels. - CustomLabels map[string]string `protobuf:"bytes,11,rep,name=custom_labels,json=customLabels,proto3" json:"custom_labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - // PostgreSQL version. - Version string `protobuf:"bytes,12,opt,name=version,proto3" json:"version,omitempty"` - // Limit of databases for auto-discovery. - AutoDiscoveryLimit int32 `protobuf:"varint,13,opt,name=auto_discovery_limit,json=autoDiscoveryLimit,proto3" json:"auto_discovery_limit,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *PostgreSQLService) Reset() { - *x = PostgreSQLService{} - mi := &file_inventory_v1_services_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *PostgreSQLService) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PostgreSQLService) ProtoMessage() {} - -func (x *PostgreSQLService) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_services_proto_msgTypes[2] - 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 PostgreSQLService.ProtoReflect.Descriptor instead. -func (*PostgreSQLService) Descriptor() ([]byte, []int) { - return file_inventory_v1_services_proto_rawDescGZIP(), []int{2} -} - -func (x *PostgreSQLService) GetServiceId() string { - if x != nil { - return x.ServiceId - } - return "" -} - -func (x *PostgreSQLService) GetServiceName() string { - if x != nil { - return x.ServiceName - } - return "" -} - -func (x *PostgreSQLService) GetDatabaseName() string { - if x != nil { - return x.DatabaseName - } - return "" -} - -func (x *PostgreSQLService) GetNodeId() string { - if x != nil { - return x.NodeId - } - return "" -} - -func (x *PostgreSQLService) GetAddress() string { - if x != nil { - return x.Address - } - return "" -} - -func (x *PostgreSQLService) GetPort() uint32 { - if x != nil { - return x.Port - } - return 0 -} - -func (x *PostgreSQLService) GetSocket() string { - if x != nil { - return x.Socket - } - return "" -} - -func (x *PostgreSQLService) GetEnvironment() string { - if x != nil { - return x.Environment - } - return "" -} - -func (x *PostgreSQLService) GetCluster() string { - if x != nil { - return x.Cluster - } - return "" -} - -func (x *PostgreSQLService) GetReplicationSet() string { - if x != nil { - return x.ReplicationSet - } - return "" -} - -func (x *PostgreSQLService) GetCustomLabels() map[string]string { - if x != nil { - return x.CustomLabels - } - return nil -} - -func (x *PostgreSQLService) GetVersion() string { - if x != nil { - return x.Version - } - return "" -} - -func (x *PostgreSQLService) GetAutoDiscoveryLimit() int32 { - if x != nil { - return x.AutoDiscoveryLimit - } - return 0 -} - -// ValkeyService represents a generic Valkey instance. -type ValkeyService struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Unique randomly generated instance identifier. - ServiceId string `protobuf:"bytes,1,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` - // Unique across all Services user-defined name. - ServiceName string `protobuf:"bytes,2,opt,name=service_name,json=serviceName,proto3" json:"service_name,omitempty"` - // Node identifier where this instance runs. - NodeId string `protobuf:"bytes,3,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` - // Access address (DNS name or IP). - // Address (and port) or socket is required. - Address string `protobuf:"bytes,4,opt,name=address,proto3" json:"address,omitempty"` - // Access port. - // Port is required when the address present. - Port uint32 `protobuf:"varint,5,opt,name=port,proto3" json:"port,omitempty"` - // Access unix socket. - // Address (and port) or socket is required. - Socket string `protobuf:"bytes,6,opt,name=socket,proto3" json:"socket,omitempty"` - // Environment name. - Environment string `protobuf:"bytes,7,opt,name=environment,proto3" json:"environment,omitempty"` - // Cluster name. - Cluster string `protobuf:"bytes,8,opt,name=cluster,proto3" json:"cluster,omitempty"` - // Replication set name. - ReplicationSet string `protobuf:"bytes,9,opt,name=replication_set,json=replicationSet,proto3" json:"replication_set,omitempty"` - // Custom user-assigned labels. - CustomLabels map[string]string `protobuf:"bytes,10,rep,name=custom_labels,json=customLabels,proto3" json:"custom_labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - // Valkey version. - Version string `protobuf:"bytes,11,opt,name=version,proto3" json:"version,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ValkeyService) Reset() { - *x = ValkeyService{} - mi := &file_inventory_v1_services_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ValkeyService) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ValkeyService) ProtoMessage() {} - -func (x *ValkeyService) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_services_proto_msgTypes[3] - 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 ValkeyService.ProtoReflect.Descriptor instead. -func (*ValkeyService) Descriptor() ([]byte, []int) { - return file_inventory_v1_services_proto_rawDescGZIP(), []int{3} -} - -func (x *ValkeyService) GetServiceId() string { - if x != nil { - return x.ServiceId - } - return "" -} - -func (x *ValkeyService) GetServiceName() string { - if x != nil { - return x.ServiceName - } - return "" -} - -func (x *ValkeyService) GetNodeId() string { - if x != nil { - return x.NodeId - } - return "" -} - -func (x *ValkeyService) GetAddress() string { - if x != nil { - return x.Address - } - return "" -} - -func (x *ValkeyService) GetPort() uint32 { - if x != nil { - return x.Port - } - return 0 -} - -func (x *ValkeyService) GetSocket() string { - if x != nil { - return x.Socket - } - return "" -} - -func (x *ValkeyService) GetEnvironment() string { - if x != nil { - return x.Environment - } - return "" -} - -func (x *ValkeyService) GetCluster() string { - if x != nil { - return x.Cluster - } - return "" -} - -func (x *ValkeyService) GetReplicationSet() string { - if x != nil { - return x.ReplicationSet - } - return "" -} - -func (x *ValkeyService) GetCustomLabels() map[string]string { - if x != nil { - return x.CustomLabels - } - return nil -} - -func (x *ValkeyService) GetVersion() string { - if x != nil { - return x.Version - } - return "" -} - -// ProxySQLService represents a generic ProxySQL instance. -type ProxySQLService struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Unique randomly generated instance identifier. - ServiceId string `protobuf:"bytes,1,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` - // Unique across all Services user-defined name. - ServiceName string `protobuf:"bytes,2,opt,name=service_name,json=serviceName,proto3" json:"service_name,omitempty"` - // Node identifier where this instance runs. - NodeId string `protobuf:"bytes,3,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` - // Access address (DNS name or IP). - // Address (and port) or socket is required. - Address string `protobuf:"bytes,4,opt,name=address,proto3" json:"address,omitempty"` - // Access port. - // Port is required when the address present. - Port uint32 `protobuf:"varint,5,opt,name=port,proto3" json:"port,omitempty"` - // Access unix socket. - // Address (and port) or socket is required. - Socket string `protobuf:"bytes,6,opt,name=socket,proto3" json:"socket,omitempty"` - // Environment name. - Environment string `protobuf:"bytes,7,opt,name=environment,proto3" json:"environment,omitempty"` - // Cluster name. - Cluster string `protobuf:"bytes,8,opt,name=cluster,proto3" json:"cluster,omitempty"` - // Replication set name. - ReplicationSet string `protobuf:"bytes,9,opt,name=replication_set,json=replicationSet,proto3" json:"replication_set,omitempty"` - // Custom user-assigned labels. - CustomLabels map[string]string `protobuf:"bytes,10,rep,name=custom_labels,json=customLabels,proto3" json:"custom_labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - // ProxySQL version. - Version string `protobuf:"bytes,11,opt,name=version,proto3" json:"version,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ProxySQLService) Reset() { - *x = ProxySQLService{} - mi := &file_inventory_v1_services_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ProxySQLService) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ProxySQLService) ProtoMessage() {} - -func (x *ProxySQLService) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_services_proto_msgTypes[4] - 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 ProxySQLService.ProtoReflect.Descriptor instead. -func (*ProxySQLService) Descriptor() ([]byte, []int) { - return file_inventory_v1_services_proto_rawDescGZIP(), []int{4} -} - -func (x *ProxySQLService) GetServiceId() string { - if x != nil { - return x.ServiceId - } - return "" -} - -func (x *ProxySQLService) GetServiceName() string { - if x != nil { - return x.ServiceName - } - return "" -} - -func (x *ProxySQLService) GetNodeId() string { - if x != nil { - return x.NodeId - } - return "" -} - -func (x *ProxySQLService) GetAddress() string { - if x != nil { - return x.Address - } - return "" -} - -func (x *ProxySQLService) GetPort() uint32 { - if x != nil { - return x.Port - } - return 0 -} - -func (x *ProxySQLService) GetSocket() string { - if x != nil { - return x.Socket - } - return "" -} - -func (x *ProxySQLService) GetEnvironment() string { - if x != nil { - return x.Environment - } - return "" -} - -func (x *ProxySQLService) GetCluster() string { - if x != nil { - return x.Cluster - } - return "" -} - -func (x *ProxySQLService) GetReplicationSet() string { - if x != nil { - return x.ReplicationSet - } - return "" -} - -func (x *ProxySQLService) GetCustomLabels() map[string]string { - if x != nil { - return x.CustomLabels - } - return nil -} - -func (x *ProxySQLService) GetVersion() string { - if x != nil { - return x.Version - } - return "" -} - -// HAProxyService represents a generic HAProxy service instance. -type HAProxyService struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Unique randomly generated instance identifier. - ServiceId string `protobuf:"bytes,1,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` - // Unique across all Services user-defined name. - ServiceName string `protobuf:"bytes,2,opt,name=service_name,json=serviceName,proto3" json:"service_name,omitempty"` - // Node identifier where this service instance runs. - NodeId string `protobuf:"bytes,3,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` - // Environment name. - Environment string `protobuf:"bytes,4,opt,name=environment,proto3" json:"environment,omitempty"` - // Cluster name. - Cluster string `protobuf:"bytes,5,opt,name=cluster,proto3" json:"cluster,omitempty"` - // Replication set name. - ReplicationSet string `protobuf:"bytes,6,opt,name=replication_set,json=replicationSet,proto3" json:"replication_set,omitempty"` - // Custom user-assigned labels. - CustomLabels map[string]string `protobuf:"bytes,7,rep,name=custom_labels,json=customLabels,proto3" json:"custom_labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *HAProxyService) Reset() { - *x = HAProxyService{} - mi := &file_inventory_v1_services_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *HAProxyService) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*HAProxyService) ProtoMessage() {} - -func (x *HAProxyService) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_services_proto_msgTypes[5] - 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 HAProxyService.ProtoReflect.Descriptor instead. -func (*HAProxyService) Descriptor() ([]byte, []int) { - return file_inventory_v1_services_proto_rawDescGZIP(), []int{5} -} - -func (x *HAProxyService) GetServiceId() string { - if x != nil { - return x.ServiceId - } - return "" -} - -func (x *HAProxyService) GetServiceName() string { - if x != nil { - return x.ServiceName - } - return "" -} - -func (x *HAProxyService) GetNodeId() string { - if x != nil { - return x.NodeId - } - return "" -} - -func (x *HAProxyService) GetEnvironment() string { - if x != nil { - return x.Environment - } - return "" -} - -func (x *HAProxyService) GetCluster() string { - if x != nil { - return x.Cluster - } - return "" -} - -func (x *HAProxyService) GetReplicationSet() string { - if x != nil { - return x.ReplicationSet - } - return "" -} - -func (x *HAProxyService) GetCustomLabels() map[string]string { - if x != nil { - return x.CustomLabels - } - return nil -} - -// ExternalService represents a generic External service instance. -type ExternalService struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Unique randomly generated instance identifier. - ServiceId string `protobuf:"bytes,1,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` - // Unique across all Services user-defined name. - ServiceName string `protobuf:"bytes,2,opt,name=service_name,json=serviceName,proto3" json:"service_name,omitempty"` - // Node identifier where this service instance runs. - NodeId string `protobuf:"bytes,3,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` - // Environment name. - Environment string `protobuf:"bytes,4,opt,name=environment,proto3" json:"environment,omitempty"` - // Cluster name. - Cluster string `protobuf:"bytes,5,opt,name=cluster,proto3" json:"cluster,omitempty"` - // Replication set name. - ReplicationSet string `protobuf:"bytes,6,opt,name=replication_set,json=replicationSet,proto3" json:"replication_set,omitempty"` - // Custom user-assigned labels. - CustomLabels map[string]string `protobuf:"bytes,7,rep,name=custom_labels,json=customLabels,proto3" json:"custom_labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - // Group name of external service. - Group string `protobuf:"bytes,8,opt,name=group,proto3" json:"group,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ExternalService) Reset() { - *x = ExternalService{} - mi := &file_inventory_v1_services_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ExternalService) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ExternalService) ProtoMessage() {} - -func (x *ExternalService) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_services_proto_msgTypes[6] - 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 ExternalService.ProtoReflect.Descriptor instead. -func (*ExternalService) Descriptor() ([]byte, []int) { - return file_inventory_v1_services_proto_rawDescGZIP(), []int{6} -} - -func (x *ExternalService) GetServiceId() string { - if x != nil { - return x.ServiceId - } - return "" -} - -func (x *ExternalService) GetServiceName() string { - if x != nil { - return x.ServiceName - } - return "" -} - -func (x *ExternalService) GetNodeId() string { - if x != nil { - return x.NodeId - } - return "" -} - -func (x *ExternalService) GetEnvironment() string { - if x != nil { - return x.Environment - } - return "" -} - -func (x *ExternalService) GetCluster() string { - if x != nil { - return x.Cluster - } - return "" -} - -func (x *ExternalService) GetReplicationSet() string { - if x != nil { - return x.ReplicationSet - } - return "" -} - -func (x *ExternalService) GetCustomLabels() map[string]string { - if x != nil { - return x.CustomLabels - } - return nil -} - -func (x *ExternalService) GetGroup() string { - if x != nil { - return x.Group - } - return "" -} - -type ListServicesRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Return only Services running on that Node. - NodeId string `protobuf:"bytes,1,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` - // Return only services filtered by service type. - ServiceType ServiceType `protobuf:"varint,2,opt,name=service_type,json=serviceType,proto3,enum=inventory.v1.ServiceType" json:"service_type,omitempty"` - // Return only services in this external group. - ExternalGroup string `protobuf:"bytes,3,opt,name=external_group,json=externalGroup,proto3" json:"external_group,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ListServicesRequest) Reset() { - *x = ListServicesRequest{} - mi := &file_inventory_v1_services_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ListServicesRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListServicesRequest) ProtoMessage() {} - -func (x *ListServicesRequest) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_services_proto_msgTypes[7] - 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 ListServicesRequest.ProtoReflect.Descriptor instead. -func (*ListServicesRequest) Descriptor() ([]byte, []int) { - return file_inventory_v1_services_proto_rawDescGZIP(), []int{7} -} - -func (x *ListServicesRequest) GetNodeId() string { - if x != nil { - return x.NodeId - } - return "" -} - -func (x *ListServicesRequest) GetServiceType() ServiceType { - if x != nil { - return x.ServiceType - } - return ServiceType_SERVICE_TYPE_UNSPECIFIED -} - -func (x *ListServicesRequest) GetExternalGroup() string { - if x != nil { - return x.ExternalGroup - } - return "" -} - -type ListServicesResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Mysql []*MySQLService `protobuf:"bytes,1,rep,name=mysql,proto3" json:"mysql,omitempty"` - Mongodb []*MongoDBService `protobuf:"bytes,2,rep,name=mongodb,proto3" json:"mongodb,omitempty"` - Postgresql []*PostgreSQLService `protobuf:"bytes,3,rep,name=postgresql,proto3" json:"postgresql,omitempty"` - Proxysql []*ProxySQLService `protobuf:"bytes,4,rep,name=proxysql,proto3" json:"proxysql,omitempty"` - Haproxy []*HAProxyService `protobuf:"bytes,5,rep,name=haproxy,proto3" json:"haproxy,omitempty"` - External []*ExternalService `protobuf:"bytes,6,rep,name=external,proto3" json:"external,omitempty"` - Valkey []*ValkeyService `protobuf:"bytes,7,rep,name=valkey,proto3" json:"valkey,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ListServicesResponse) Reset() { - *x = ListServicesResponse{} - mi := &file_inventory_v1_services_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ListServicesResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListServicesResponse) ProtoMessage() {} - -func (x *ListServicesResponse) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_services_proto_msgTypes[8] - 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 ListServicesResponse.ProtoReflect.Descriptor instead. -func (*ListServicesResponse) Descriptor() ([]byte, []int) { - return file_inventory_v1_services_proto_rawDescGZIP(), []int{8} -} - -func (x *ListServicesResponse) GetMysql() []*MySQLService { - if x != nil { - return x.Mysql - } - return nil -} - -func (x *ListServicesResponse) GetMongodb() []*MongoDBService { - if x != nil { - return x.Mongodb - } - return nil -} - -func (x *ListServicesResponse) GetPostgresql() []*PostgreSQLService { - if x != nil { - return x.Postgresql - } - return nil -} - -func (x *ListServicesResponse) GetProxysql() []*ProxySQLService { - if x != nil { - return x.Proxysql - } - return nil -} - -func (x *ListServicesResponse) GetHaproxy() []*HAProxyService { - if x != nil { - return x.Haproxy - } - return nil -} - -func (x *ListServicesResponse) GetExternal() []*ExternalService { - if x != nil { - return x.External - } - return nil -} - -func (x *ListServicesResponse) GetValkey() []*ValkeyService { - if x != nil { - return x.Valkey - } - return nil -} - -type ListActiveServiceTypesRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ListActiveServiceTypesRequest) Reset() { - *x = ListActiveServiceTypesRequest{} - mi := &file_inventory_v1_services_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ListActiveServiceTypesRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListActiveServiceTypesRequest) ProtoMessage() {} - -func (x *ListActiveServiceTypesRequest) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_services_proto_msgTypes[9] - 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 ListActiveServiceTypesRequest.ProtoReflect.Descriptor instead. -func (*ListActiveServiceTypesRequest) Descriptor() ([]byte, []int) { - return file_inventory_v1_services_proto_rawDescGZIP(), []int{9} -} - -type ListActiveServiceTypesResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - ServiceTypes []ServiceType `protobuf:"varint,1,rep,packed,name=service_types,json=serviceTypes,proto3,enum=inventory.v1.ServiceType" json:"service_types,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ListActiveServiceTypesResponse) Reset() { - *x = ListActiveServiceTypesResponse{} - mi := &file_inventory_v1_services_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ListActiveServiceTypesResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListActiveServiceTypesResponse) ProtoMessage() {} - -func (x *ListActiveServiceTypesResponse) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_services_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 ListActiveServiceTypesResponse.ProtoReflect.Descriptor instead. -func (*ListActiveServiceTypesResponse) Descriptor() ([]byte, []int) { - return file_inventory_v1_services_proto_rawDescGZIP(), []int{10} -} - -func (x *ListActiveServiceTypesResponse) GetServiceTypes() []ServiceType { - if x != nil { - return x.ServiceTypes - } - return nil -} - -type GetServiceRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Unique randomly generated instance identifier. - ServiceId string `protobuf:"bytes,1,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetServiceRequest) Reset() { - *x = GetServiceRequest{} - mi := &file_inventory_v1_services_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetServiceRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetServiceRequest) ProtoMessage() {} - -func (x *GetServiceRequest) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_services_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 GetServiceRequest.ProtoReflect.Descriptor instead. -func (*GetServiceRequest) Descriptor() ([]byte, []int) { - return file_inventory_v1_services_proto_rawDescGZIP(), []int{11} -} - -func (x *GetServiceRequest) GetServiceId() string { - if x != nil { - return x.ServiceId - } - return "" -} - -type GetServiceResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Service: - // - // *GetServiceResponse_Mysql - // *GetServiceResponse_Mongodb - // *GetServiceResponse_Postgresql - // *GetServiceResponse_Proxysql - // *GetServiceResponse_Haproxy - // *GetServiceResponse_External - // *GetServiceResponse_Valkey - Service isGetServiceResponse_Service `protobuf_oneof:"service"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetServiceResponse) Reset() { - *x = GetServiceResponse{} - mi := &file_inventory_v1_services_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetServiceResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetServiceResponse) ProtoMessage() {} - -func (x *GetServiceResponse) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_services_proto_msgTypes[12] - 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 GetServiceResponse.ProtoReflect.Descriptor instead. -func (*GetServiceResponse) Descriptor() ([]byte, []int) { - return file_inventory_v1_services_proto_rawDescGZIP(), []int{12} -} - -func (x *GetServiceResponse) GetService() isGetServiceResponse_Service { - if x != nil { - return x.Service - } - return nil -} - -func (x *GetServiceResponse) GetMysql() *MySQLService { - if x != nil { - if x, ok := x.Service.(*GetServiceResponse_Mysql); ok { - return x.Mysql - } - } - return nil -} - -func (x *GetServiceResponse) GetMongodb() *MongoDBService { - if x != nil { - if x, ok := x.Service.(*GetServiceResponse_Mongodb); ok { - return x.Mongodb - } - } - return nil -} - -func (x *GetServiceResponse) GetPostgresql() *PostgreSQLService { - if x != nil { - if x, ok := x.Service.(*GetServiceResponse_Postgresql); ok { - return x.Postgresql - } - } - return nil -} - -func (x *GetServiceResponse) GetProxysql() *ProxySQLService { - if x != nil { - if x, ok := x.Service.(*GetServiceResponse_Proxysql); ok { - return x.Proxysql - } - } - return nil -} - -func (x *GetServiceResponse) GetHaproxy() *HAProxyService { - if x != nil { - if x, ok := x.Service.(*GetServiceResponse_Haproxy); ok { - return x.Haproxy - } - } - return nil -} - -func (x *GetServiceResponse) GetExternal() *ExternalService { - if x != nil { - if x, ok := x.Service.(*GetServiceResponse_External); ok { - return x.External - } - } - return nil -} - -func (x *GetServiceResponse) GetValkey() *ValkeyService { - if x != nil { - if x, ok := x.Service.(*GetServiceResponse_Valkey); ok { - return x.Valkey - } - } - return nil -} - -type isGetServiceResponse_Service interface { - isGetServiceResponse_Service() -} - -type GetServiceResponse_Mysql struct { - Mysql *MySQLService `protobuf:"bytes,1,opt,name=mysql,proto3,oneof"` -} - -type GetServiceResponse_Mongodb struct { - Mongodb *MongoDBService `protobuf:"bytes,2,opt,name=mongodb,proto3,oneof"` -} - -type GetServiceResponse_Postgresql struct { - Postgresql *PostgreSQLService `protobuf:"bytes,3,opt,name=postgresql,proto3,oneof"` -} - -type GetServiceResponse_Proxysql struct { - Proxysql *ProxySQLService `protobuf:"bytes,4,opt,name=proxysql,proto3,oneof"` -} - -type GetServiceResponse_Haproxy struct { - Haproxy *HAProxyService `protobuf:"bytes,5,opt,name=haproxy,proto3,oneof"` -} - -type GetServiceResponse_External struct { - External *ExternalService `protobuf:"bytes,6,opt,name=external,proto3,oneof"` -} - -type GetServiceResponse_Valkey struct { - Valkey *ValkeyService `protobuf:"bytes,7,opt,name=valkey,proto3,oneof"` -} - -func (*GetServiceResponse_Mysql) isGetServiceResponse_Service() {} - -func (*GetServiceResponse_Mongodb) isGetServiceResponse_Service() {} - -func (*GetServiceResponse_Postgresql) isGetServiceResponse_Service() {} - -func (*GetServiceResponse_Proxysql) isGetServiceResponse_Service() {} - -func (*GetServiceResponse_Haproxy) isGetServiceResponse_Service() {} - -func (*GetServiceResponse_External) isGetServiceResponse_Service() {} - -func (*GetServiceResponse_Valkey) isGetServiceResponse_Service() {} - -type AddServiceRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Service: - // - // *AddServiceRequest_Mysql - // *AddServiceRequest_Mongodb - // *AddServiceRequest_Postgresql - // *AddServiceRequest_Proxysql - // *AddServiceRequest_Haproxy - // *AddServiceRequest_External - // *AddServiceRequest_Valkey - Service isAddServiceRequest_Service `protobuf_oneof:"service"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AddServiceRequest) Reset() { - *x = AddServiceRequest{} - mi := &file_inventory_v1_services_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AddServiceRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddServiceRequest) ProtoMessage() {} - -func (x *AddServiceRequest) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_services_proto_msgTypes[13] - 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 AddServiceRequest.ProtoReflect.Descriptor instead. -func (*AddServiceRequest) Descriptor() ([]byte, []int) { - return file_inventory_v1_services_proto_rawDescGZIP(), []int{13} -} - -func (x *AddServiceRequest) GetService() isAddServiceRequest_Service { - if x != nil { - return x.Service - } - return nil -} - -func (x *AddServiceRequest) GetMysql() *AddMySQLServiceParams { - if x != nil { - if x, ok := x.Service.(*AddServiceRequest_Mysql); ok { - return x.Mysql - } - } - return nil -} - -func (x *AddServiceRequest) GetMongodb() *AddMongoDBServiceParams { - if x != nil { - if x, ok := x.Service.(*AddServiceRequest_Mongodb); ok { - return x.Mongodb - } - } - return nil -} - -func (x *AddServiceRequest) GetPostgresql() *AddPostgreSQLServiceParams { - if x != nil { - if x, ok := x.Service.(*AddServiceRequest_Postgresql); ok { - return x.Postgresql - } - } - return nil -} - -func (x *AddServiceRequest) GetProxysql() *AddProxySQLServiceParams { - if x != nil { - if x, ok := x.Service.(*AddServiceRequest_Proxysql); ok { - return x.Proxysql - } - } - return nil -} - -func (x *AddServiceRequest) GetHaproxy() *AddHAProxyServiceParams { - if x != nil { - if x, ok := x.Service.(*AddServiceRequest_Haproxy); ok { - return x.Haproxy - } - } - return nil -} - -func (x *AddServiceRequest) GetExternal() *AddExternalServiceParams { - if x != nil { - if x, ok := x.Service.(*AddServiceRequest_External); ok { - return x.External - } - } - return nil -} - -func (x *AddServiceRequest) GetValkey() *AddValkeyServiceParams { - if x != nil { - if x, ok := x.Service.(*AddServiceRequest_Valkey); ok { - return x.Valkey - } - } - return nil -} - -type isAddServiceRequest_Service interface { - isAddServiceRequest_Service() -} - -type AddServiceRequest_Mysql struct { - Mysql *AddMySQLServiceParams `protobuf:"bytes,1,opt,name=mysql,proto3,oneof"` -} - -type AddServiceRequest_Mongodb struct { - Mongodb *AddMongoDBServiceParams `protobuf:"bytes,2,opt,name=mongodb,proto3,oneof"` -} - -type AddServiceRequest_Postgresql struct { - Postgresql *AddPostgreSQLServiceParams `protobuf:"bytes,3,opt,name=postgresql,proto3,oneof"` -} - -type AddServiceRequest_Proxysql struct { - Proxysql *AddProxySQLServiceParams `protobuf:"bytes,4,opt,name=proxysql,proto3,oneof"` -} - -type AddServiceRequest_Haproxy struct { - Haproxy *AddHAProxyServiceParams `protobuf:"bytes,5,opt,name=haproxy,proto3,oneof"` -} - -type AddServiceRequest_External struct { - External *AddExternalServiceParams `protobuf:"bytes,6,opt,name=external,proto3,oneof"` -} - -type AddServiceRequest_Valkey struct { - Valkey *AddValkeyServiceParams `protobuf:"bytes,7,opt,name=valkey,proto3,oneof"` -} - -func (*AddServiceRequest_Mysql) isAddServiceRequest_Service() {} - -func (*AddServiceRequest_Mongodb) isAddServiceRequest_Service() {} - -func (*AddServiceRequest_Postgresql) isAddServiceRequest_Service() {} - -func (*AddServiceRequest_Proxysql) isAddServiceRequest_Service() {} - -func (*AddServiceRequest_Haproxy) isAddServiceRequest_Service() {} - -func (*AddServiceRequest_External) isAddServiceRequest_Service() {} - -func (*AddServiceRequest_Valkey) isAddServiceRequest_Service() {} - -type AddServiceResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Service: - // - // *AddServiceResponse_Mysql - // *AddServiceResponse_Mongodb - // *AddServiceResponse_Postgresql - // *AddServiceResponse_Proxysql - // *AddServiceResponse_Haproxy - // *AddServiceResponse_External - // *AddServiceResponse_Valkey - Service isAddServiceResponse_Service `protobuf_oneof:"service"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AddServiceResponse) Reset() { - *x = AddServiceResponse{} - mi := &file_inventory_v1_services_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AddServiceResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddServiceResponse) ProtoMessage() {} - -func (x *AddServiceResponse) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_services_proto_msgTypes[14] - 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 AddServiceResponse.ProtoReflect.Descriptor instead. -func (*AddServiceResponse) Descriptor() ([]byte, []int) { - return file_inventory_v1_services_proto_rawDescGZIP(), []int{14} -} - -func (x *AddServiceResponse) GetService() isAddServiceResponse_Service { - if x != nil { - return x.Service - } - return nil -} - -func (x *AddServiceResponse) GetMysql() *MySQLService { - if x != nil { - if x, ok := x.Service.(*AddServiceResponse_Mysql); ok { - return x.Mysql - } - } - return nil -} - -func (x *AddServiceResponse) GetMongodb() *MongoDBService { - if x != nil { - if x, ok := x.Service.(*AddServiceResponse_Mongodb); ok { - return x.Mongodb - } - } - return nil -} - -func (x *AddServiceResponse) GetPostgresql() *PostgreSQLService { - if x != nil { - if x, ok := x.Service.(*AddServiceResponse_Postgresql); ok { - return x.Postgresql - } - } - return nil -} - -func (x *AddServiceResponse) GetProxysql() *ProxySQLService { - if x != nil { - if x, ok := x.Service.(*AddServiceResponse_Proxysql); ok { - return x.Proxysql - } - } - return nil -} - -func (x *AddServiceResponse) GetHaproxy() *HAProxyService { - if x != nil { - if x, ok := x.Service.(*AddServiceResponse_Haproxy); ok { - return x.Haproxy - } - } - return nil -} - -func (x *AddServiceResponse) GetExternal() *ExternalService { - if x != nil { - if x, ok := x.Service.(*AddServiceResponse_External); ok { - return x.External - } - } - return nil -} - -func (x *AddServiceResponse) GetValkey() *ValkeyService { - if x != nil { - if x, ok := x.Service.(*AddServiceResponse_Valkey); ok { - return x.Valkey - } - } - return nil -} - -type isAddServiceResponse_Service interface { - isAddServiceResponse_Service() -} - -type AddServiceResponse_Mysql struct { - Mysql *MySQLService `protobuf:"bytes,1,opt,name=mysql,proto3,oneof"` -} - -type AddServiceResponse_Mongodb struct { - Mongodb *MongoDBService `protobuf:"bytes,2,opt,name=mongodb,proto3,oneof"` -} - -type AddServiceResponse_Postgresql struct { - Postgresql *PostgreSQLService `protobuf:"bytes,3,opt,name=postgresql,proto3,oneof"` -} - -type AddServiceResponse_Proxysql struct { - Proxysql *ProxySQLService `protobuf:"bytes,4,opt,name=proxysql,proto3,oneof"` -} - -type AddServiceResponse_Haproxy struct { - Haproxy *HAProxyService `protobuf:"bytes,5,opt,name=haproxy,proto3,oneof"` -} - -type AddServiceResponse_External struct { - External *ExternalService `protobuf:"bytes,6,opt,name=external,proto3,oneof"` -} - -type AddServiceResponse_Valkey struct { - Valkey *ValkeyService `protobuf:"bytes,7,opt,name=valkey,proto3,oneof"` -} - -func (*AddServiceResponse_Mysql) isAddServiceResponse_Service() {} - -func (*AddServiceResponse_Mongodb) isAddServiceResponse_Service() {} - -func (*AddServiceResponse_Postgresql) isAddServiceResponse_Service() {} - -func (*AddServiceResponse_Proxysql) isAddServiceResponse_Service() {} - -func (*AddServiceResponse_Haproxy) isAddServiceResponse_Service() {} - -func (*AddServiceResponse_External) isAddServiceResponse_Service() {} - -func (*AddServiceResponse_Valkey) isAddServiceResponse_Service() {} - -type AddMySQLServiceParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Unique across all Services user-defined name. Required. - ServiceName string `protobuf:"bytes,1,opt,name=service_name,json=serviceName,proto3" json:"service_name,omitempty"` - // Node identifier where this instance runs. Required. - NodeId string `protobuf:"bytes,2,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` - // Access address (DNS name or IP). - // Address (and port) or socket is required. - Address string `protobuf:"bytes,3,opt,name=address,proto3" json:"address,omitempty"` - // Access port. - // Port is required when the address present. - Port uint32 `protobuf:"varint,4,opt,name=port,proto3" json:"port,omitempty"` - // Access unix socket. - // Address (and port) or socket is required. - Socket string `protobuf:"bytes,5,opt,name=socket,proto3" json:"socket,omitempty"` - // Environment name. - Environment string `protobuf:"bytes,6,opt,name=environment,proto3" json:"environment,omitempty"` - // Cluster name. - Cluster string `protobuf:"bytes,7,opt,name=cluster,proto3" json:"cluster,omitempty"` - // Replication set name. - ReplicationSet string `protobuf:"bytes,8,opt,name=replication_set,json=replicationSet,proto3" json:"replication_set,omitempty"` - // Custom user-assigned labels. - CustomLabels map[string]string `protobuf:"bytes,9,rep,name=custom_labels,json=customLabels,proto3" json:"custom_labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - // Extra parameters to be added to the DSN. - ExtraDsnParams map[string]string `protobuf:"bytes,10,rep,name=extra_dsn_params,json=extraDsnParams,proto3" json:"extra_dsn_params,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AddMySQLServiceParams) Reset() { - *x = AddMySQLServiceParams{} - mi := &file_inventory_v1_services_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AddMySQLServiceParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddMySQLServiceParams) ProtoMessage() {} - -func (x *AddMySQLServiceParams) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_services_proto_msgTypes[15] - 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 AddMySQLServiceParams.ProtoReflect.Descriptor instead. -func (*AddMySQLServiceParams) Descriptor() ([]byte, []int) { - return file_inventory_v1_services_proto_rawDescGZIP(), []int{15} -} - -func (x *AddMySQLServiceParams) GetServiceName() string { - if x != nil { - return x.ServiceName - } - return "" -} - -func (x *AddMySQLServiceParams) GetNodeId() string { - if x != nil { - return x.NodeId - } - return "" -} - -func (x *AddMySQLServiceParams) GetAddress() string { - if x != nil { - return x.Address - } - return "" -} - -func (x *AddMySQLServiceParams) GetPort() uint32 { - if x != nil { - return x.Port - } - return 0 -} - -func (x *AddMySQLServiceParams) GetSocket() string { - if x != nil { - return x.Socket - } - return "" -} - -func (x *AddMySQLServiceParams) GetEnvironment() string { - if x != nil { - return x.Environment - } - return "" -} - -func (x *AddMySQLServiceParams) GetCluster() string { - if x != nil { - return x.Cluster - } - return "" -} - -func (x *AddMySQLServiceParams) GetReplicationSet() string { - if x != nil { - return x.ReplicationSet - } - return "" -} - -func (x *AddMySQLServiceParams) GetCustomLabels() map[string]string { - if x != nil { - return x.CustomLabels - } - return nil -} - -func (x *AddMySQLServiceParams) GetExtraDsnParams() map[string]string { - if x != nil { - return x.ExtraDsnParams - } - return nil -} - -type AddMongoDBServiceParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Unique across all Services user-defined name. Required. - ServiceName string `protobuf:"bytes,1,opt,name=service_name,json=serviceName,proto3" json:"service_name,omitempty"` - // Node identifier where this instance runs. Required. - NodeId string `protobuf:"bytes,2,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` - // Access address (DNS name or IP). - // Address (and port) or socket is required. - Address string `protobuf:"bytes,3,opt,name=address,proto3" json:"address,omitempty"` - // Access port. - // Port is required when the address present. - Port uint32 `protobuf:"varint,4,opt,name=port,proto3" json:"port,omitempty"` - // Access unix socket. - // Address (and port) or socket is required. - Socket string `protobuf:"bytes,5,opt,name=socket,proto3" json:"socket,omitempty"` - // Environment name. - Environment string `protobuf:"bytes,6,opt,name=environment,proto3" json:"environment,omitempty"` - // Cluster name. - Cluster string `protobuf:"bytes,7,opt,name=cluster,proto3" json:"cluster,omitempty"` - // Replication set name. - ReplicationSet string `protobuf:"bytes,8,opt,name=replication_set,json=replicationSet,proto3" json:"replication_set,omitempty"` - // Custom user-assigned labels. - CustomLabels map[string]string `protobuf:"bytes,9,rep,name=custom_labels,json=customLabels,proto3" json:"custom_labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AddMongoDBServiceParams) Reset() { - *x = AddMongoDBServiceParams{} - mi := &file_inventory_v1_services_proto_msgTypes[16] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AddMongoDBServiceParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddMongoDBServiceParams) ProtoMessage() {} - -func (x *AddMongoDBServiceParams) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_services_proto_msgTypes[16] - 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 AddMongoDBServiceParams.ProtoReflect.Descriptor instead. -func (*AddMongoDBServiceParams) Descriptor() ([]byte, []int) { - return file_inventory_v1_services_proto_rawDescGZIP(), []int{16} -} - -func (x *AddMongoDBServiceParams) GetServiceName() string { - if x != nil { - return x.ServiceName - } - return "" -} - -func (x *AddMongoDBServiceParams) GetNodeId() string { - if x != nil { - return x.NodeId - } - return "" -} - -func (x *AddMongoDBServiceParams) GetAddress() string { - if x != nil { - return x.Address - } - return "" -} - -func (x *AddMongoDBServiceParams) GetPort() uint32 { - if x != nil { - return x.Port - } - return 0 -} - -func (x *AddMongoDBServiceParams) GetSocket() string { - if x != nil { - return x.Socket - } - return "" -} - -func (x *AddMongoDBServiceParams) GetEnvironment() string { - if x != nil { - return x.Environment - } - return "" -} - -func (x *AddMongoDBServiceParams) GetCluster() string { - if x != nil { - return x.Cluster - } - return "" -} - -func (x *AddMongoDBServiceParams) GetReplicationSet() string { - if x != nil { - return x.ReplicationSet - } - return "" -} - -func (x *AddMongoDBServiceParams) GetCustomLabels() map[string]string { - if x != nil { - return x.CustomLabels - } - return nil -} - -type AddPostgreSQLServiceParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Unique across all Services user-defined name. Required. - ServiceName string `protobuf:"bytes,1,opt,name=service_name,json=serviceName,proto3" json:"service_name,omitempty"` - // Node identifier where this instance runs. Required. - NodeId string `protobuf:"bytes,2,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` - // Access address (DNS name or IP). - // Address (and port) or socket is required. - Address string `protobuf:"bytes,3,opt,name=address,proto3" json:"address,omitempty"` - // Access port. - // Port is required when the address present. - Port uint32 `protobuf:"varint,4,opt,name=port,proto3" json:"port,omitempty"` - // Access unix socket. - // Address (and port) or socket is required. - Socket string `protobuf:"bytes,5,opt,name=socket,proto3" json:"socket,omitempty"` - // Environment name. - Environment string `protobuf:"bytes,6,opt,name=environment,proto3" json:"environment,omitempty"` - // Cluster name. - Cluster string `protobuf:"bytes,7,opt,name=cluster,proto3" json:"cluster,omitempty"` - // Replication set name. - ReplicationSet string `protobuf:"bytes,8,opt,name=replication_set,json=replicationSet,proto3" json:"replication_set,omitempty"` - // Custom user-assigned labels. - CustomLabels map[string]string `protobuf:"bytes,9,rep,name=custom_labels,json=customLabels,proto3" json:"custom_labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - // Limit of databases for auto-discovery. - AutoDiscoveryLimit int32 `protobuf:"varint,10,opt,name=auto_discovery_limit,json=autoDiscoveryLimit,proto3" json:"auto_discovery_limit,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AddPostgreSQLServiceParams) Reset() { - *x = AddPostgreSQLServiceParams{} - mi := &file_inventory_v1_services_proto_msgTypes[17] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AddPostgreSQLServiceParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddPostgreSQLServiceParams) ProtoMessage() {} - -func (x *AddPostgreSQLServiceParams) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_services_proto_msgTypes[17] - 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 AddPostgreSQLServiceParams.ProtoReflect.Descriptor instead. -func (*AddPostgreSQLServiceParams) Descriptor() ([]byte, []int) { - return file_inventory_v1_services_proto_rawDescGZIP(), []int{17} -} - -func (x *AddPostgreSQLServiceParams) GetServiceName() string { - if x != nil { - return x.ServiceName - } - return "" -} - -func (x *AddPostgreSQLServiceParams) GetNodeId() string { - if x != nil { - return x.NodeId - } - return "" -} - -func (x *AddPostgreSQLServiceParams) GetAddress() string { - if x != nil { - return x.Address - } - return "" -} - -func (x *AddPostgreSQLServiceParams) GetPort() uint32 { - if x != nil { - return x.Port - } - return 0 -} - -func (x *AddPostgreSQLServiceParams) GetSocket() string { - if x != nil { - return x.Socket - } - return "" -} - -func (x *AddPostgreSQLServiceParams) GetEnvironment() string { - if x != nil { - return x.Environment - } - return "" -} - -func (x *AddPostgreSQLServiceParams) GetCluster() string { - if x != nil { - return x.Cluster - } - return "" -} - -func (x *AddPostgreSQLServiceParams) GetReplicationSet() string { - if x != nil { - return x.ReplicationSet - } - return "" -} - -func (x *AddPostgreSQLServiceParams) GetCustomLabels() map[string]string { - if x != nil { - return x.CustomLabels - } - return nil -} - -func (x *AddPostgreSQLServiceParams) GetAutoDiscoveryLimit() int32 { - if x != nil { - return x.AutoDiscoveryLimit - } - return 0 -} - -type AddValkeyServiceParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Unique across all Services user-defined name. Required. - ServiceName string `protobuf:"bytes,1,opt,name=service_name,json=serviceName,proto3" json:"service_name,omitempty"` - // Node identifier where this instance runs. Required. - NodeId string `protobuf:"bytes,2,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` - // Access address (DNS name or IP). - // Address (and port) or socket is required. - Address string `protobuf:"bytes,3,opt,name=address,proto3" json:"address,omitempty"` - // Access port. - // Port is required when the address present. - Port uint32 `protobuf:"varint,4,opt,name=port,proto3" json:"port,omitempty"` - // Access unix socket. - // Address (and port) or socket is required. - Socket string `protobuf:"bytes,5,opt,name=socket,proto3" json:"socket,omitempty"` - // Environment name. - Environment string `protobuf:"bytes,6,opt,name=environment,proto3" json:"environment,omitempty"` - // Cluster name. - Cluster string `protobuf:"bytes,7,opt,name=cluster,proto3" json:"cluster,omitempty"` - // Replication set name. - ReplicationSet string `protobuf:"bytes,8,opt,name=replication_set,json=replicationSet,proto3" json:"replication_set,omitempty"` - // Custom user-assigned labels. - CustomLabels map[string]string `protobuf:"bytes,9,rep,name=custom_labels,json=customLabels,proto3" json:"custom_labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AddValkeyServiceParams) Reset() { - *x = AddValkeyServiceParams{} - mi := &file_inventory_v1_services_proto_msgTypes[18] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AddValkeyServiceParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddValkeyServiceParams) ProtoMessage() {} - -func (x *AddValkeyServiceParams) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_services_proto_msgTypes[18] - 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 AddValkeyServiceParams.ProtoReflect.Descriptor instead. -func (*AddValkeyServiceParams) Descriptor() ([]byte, []int) { - return file_inventory_v1_services_proto_rawDescGZIP(), []int{18} -} - -func (x *AddValkeyServiceParams) GetServiceName() string { - if x != nil { - return x.ServiceName - } - return "" -} - -func (x *AddValkeyServiceParams) GetNodeId() string { - if x != nil { - return x.NodeId - } - return "" -} - -func (x *AddValkeyServiceParams) GetAddress() string { - if x != nil { - return x.Address - } - return "" -} - -func (x *AddValkeyServiceParams) GetPort() uint32 { - if x != nil { - return x.Port - } - return 0 -} - -func (x *AddValkeyServiceParams) GetSocket() string { - if x != nil { - return x.Socket - } - return "" -} - -func (x *AddValkeyServiceParams) GetEnvironment() string { - if x != nil { - return x.Environment - } - return "" -} - -func (x *AddValkeyServiceParams) GetCluster() string { - if x != nil { - return x.Cluster - } - return "" -} - -func (x *AddValkeyServiceParams) GetReplicationSet() string { - if x != nil { - return x.ReplicationSet - } - return "" -} - -func (x *AddValkeyServiceParams) GetCustomLabels() map[string]string { - if x != nil { - return x.CustomLabels - } - return nil -} - -type AddProxySQLServiceParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Unique across all Services user-defined name. Required. - ServiceName string `protobuf:"bytes,1,opt,name=service_name,json=serviceName,proto3" json:"service_name,omitempty"` - // Node identifier where this instance runs. Required. - NodeId string `protobuf:"bytes,2,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` - // Access address (DNS name or IP). - // Address (and port) or socket is required. - Address string `protobuf:"bytes,3,opt,name=address,proto3" json:"address,omitempty"` - // Access port. - // Port is required when the address present. - Port uint32 `protobuf:"varint,4,opt,name=port,proto3" json:"port,omitempty"` - // Access unix socket. - // Address (and port) or socket is required. - Socket string `protobuf:"bytes,5,opt,name=socket,proto3" json:"socket,omitempty"` - // Environment name. - Environment string `protobuf:"bytes,6,opt,name=environment,proto3" json:"environment,omitempty"` - // Cluster name. - Cluster string `protobuf:"bytes,7,opt,name=cluster,proto3" json:"cluster,omitempty"` - // Replication set name. - ReplicationSet string `protobuf:"bytes,8,opt,name=replication_set,json=replicationSet,proto3" json:"replication_set,omitempty"` - // Custom user-assigned labels. - CustomLabels map[string]string `protobuf:"bytes,9,rep,name=custom_labels,json=customLabels,proto3" json:"custom_labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AddProxySQLServiceParams) Reset() { - *x = AddProxySQLServiceParams{} - mi := &file_inventory_v1_services_proto_msgTypes[19] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AddProxySQLServiceParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddProxySQLServiceParams) ProtoMessage() {} - -func (x *AddProxySQLServiceParams) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_services_proto_msgTypes[19] - 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 AddProxySQLServiceParams.ProtoReflect.Descriptor instead. -func (*AddProxySQLServiceParams) Descriptor() ([]byte, []int) { - return file_inventory_v1_services_proto_rawDescGZIP(), []int{19} -} - -func (x *AddProxySQLServiceParams) GetServiceName() string { - if x != nil { - return x.ServiceName - } - return "" -} - -func (x *AddProxySQLServiceParams) GetNodeId() string { - if x != nil { - return x.NodeId - } - return "" -} - -func (x *AddProxySQLServiceParams) GetAddress() string { - if x != nil { - return x.Address - } - return "" -} - -func (x *AddProxySQLServiceParams) GetPort() uint32 { - if x != nil { - return x.Port - } - return 0 -} - -func (x *AddProxySQLServiceParams) GetSocket() string { - if x != nil { - return x.Socket - } - return "" -} - -func (x *AddProxySQLServiceParams) GetEnvironment() string { - if x != nil { - return x.Environment - } - return "" -} - -func (x *AddProxySQLServiceParams) GetCluster() string { - if x != nil { - return x.Cluster - } - return "" -} - -func (x *AddProxySQLServiceParams) GetReplicationSet() string { - if x != nil { - return x.ReplicationSet - } - return "" -} - -func (x *AddProxySQLServiceParams) GetCustomLabels() map[string]string { - if x != nil { - return x.CustomLabels - } - return nil -} - -type AddHAProxyServiceParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Unique across all Services user-defined name. Required. - ServiceName string `protobuf:"bytes,1,opt,name=service_name,json=serviceName,proto3" json:"service_name,omitempty"` - // Node identifier where this instance runs. Required. - NodeId string `protobuf:"bytes,2,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` - // Environment name. - Environment string `protobuf:"bytes,3,opt,name=environment,proto3" json:"environment,omitempty"` - // Cluster name. - Cluster string `protobuf:"bytes,4,opt,name=cluster,proto3" json:"cluster,omitempty"` - // Replication set name. - ReplicationSet string `protobuf:"bytes,5,opt,name=replication_set,json=replicationSet,proto3" json:"replication_set,omitempty"` - // Custom user-assigned labels. - CustomLabels map[string]string `protobuf:"bytes,6,rep,name=custom_labels,json=customLabels,proto3" json:"custom_labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AddHAProxyServiceParams) Reset() { - *x = AddHAProxyServiceParams{} - mi := &file_inventory_v1_services_proto_msgTypes[20] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AddHAProxyServiceParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddHAProxyServiceParams) ProtoMessage() {} - -func (x *AddHAProxyServiceParams) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_services_proto_msgTypes[20] - 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 AddHAProxyServiceParams.ProtoReflect.Descriptor instead. -func (*AddHAProxyServiceParams) Descriptor() ([]byte, []int) { - return file_inventory_v1_services_proto_rawDescGZIP(), []int{20} -} - -func (x *AddHAProxyServiceParams) GetServiceName() string { - if x != nil { - return x.ServiceName - } - return "" -} - -func (x *AddHAProxyServiceParams) GetNodeId() string { - if x != nil { - return x.NodeId - } - return "" -} - -func (x *AddHAProxyServiceParams) GetEnvironment() string { - if x != nil { - return x.Environment - } - return "" -} - -func (x *AddHAProxyServiceParams) GetCluster() string { - if x != nil { - return x.Cluster - } - return "" -} - -func (x *AddHAProxyServiceParams) GetReplicationSet() string { - if x != nil { - return x.ReplicationSet - } - return "" -} - -func (x *AddHAProxyServiceParams) GetCustomLabels() map[string]string { - if x != nil { - return x.CustomLabels - } - return nil -} - -type AddExternalServiceParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Unique across all Services user-defined name. Required. - ServiceName string `protobuf:"bytes,1,opt,name=service_name,json=serviceName,proto3" json:"service_name,omitempty"` - // Node identifier where this instance runs. Required. - NodeId string `protobuf:"bytes,2,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` - // Environment name. - Environment string `protobuf:"bytes,3,opt,name=environment,proto3" json:"environment,omitempty"` - // Cluster name. - Cluster string `protobuf:"bytes,4,opt,name=cluster,proto3" json:"cluster,omitempty"` - // Replication set name. - ReplicationSet string `protobuf:"bytes,5,opt,name=replication_set,json=replicationSet,proto3" json:"replication_set,omitempty"` - // Custom user-assigned labels. - CustomLabels map[string]string `protobuf:"bytes,6,rep,name=custom_labels,json=customLabels,proto3" json:"custom_labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - // Group name of external service. - Group string `protobuf:"bytes,7,opt,name=group,proto3" json:"group,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AddExternalServiceParams) Reset() { - *x = AddExternalServiceParams{} - mi := &file_inventory_v1_services_proto_msgTypes[21] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AddExternalServiceParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddExternalServiceParams) ProtoMessage() {} - -func (x *AddExternalServiceParams) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_services_proto_msgTypes[21] - 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 AddExternalServiceParams.ProtoReflect.Descriptor instead. -func (*AddExternalServiceParams) Descriptor() ([]byte, []int) { - return file_inventory_v1_services_proto_rawDescGZIP(), []int{21} -} - -func (x *AddExternalServiceParams) GetServiceName() string { - if x != nil { - return x.ServiceName - } - return "" -} - -func (x *AddExternalServiceParams) GetNodeId() string { - if x != nil { - return x.NodeId - } - return "" -} - -func (x *AddExternalServiceParams) GetEnvironment() string { - if x != nil { - return x.Environment - } - return "" -} - -func (x *AddExternalServiceParams) GetCluster() string { - if x != nil { - return x.Cluster - } - return "" -} - -func (x *AddExternalServiceParams) GetReplicationSet() string { - if x != nil { - return x.ReplicationSet - } - return "" -} - -func (x *AddExternalServiceParams) GetCustomLabels() map[string]string { - if x != nil { - return x.CustomLabels - } - return nil -} - -func (x *AddExternalServiceParams) GetGroup() string { - if x != nil { - return x.Group - } - return "" -} - -type RemoveServiceRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Unique randomly generated instance identifier. Required. - ServiceId string `protobuf:"bytes,1,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` - // Remove service with all dependencies. - Force bool `protobuf:"varint,2,opt,name=force,proto3" json:"force,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *RemoveServiceRequest) Reset() { - *x = RemoveServiceRequest{} - mi := &file_inventory_v1_services_proto_msgTypes[22] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *RemoveServiceRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RemoveServiceRequest) ProtoMessage() {} - -func (x *RemoveServiceRequest) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_services_proto_msgTypes[22] - 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 RemoveServiceRequest.ProtoReflect.Descriptor instead. -func (*RemoveServiceRequest) Descriptor() ([]byte, []int) { - return file_inventory_v1_services_proto_rawDescGZIP(), []int{22} -} - -func (x *RemoveServiceRequest) GetServiceId() string { - if x != nil { - return x.ServiceId - } - return "" -} - -func (x *RemoveServiceRequest) GetForce() bool { - if x != nil { - return x.Force - } - return false -} - -type RemoveServiceResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *RemoveServiceResponse) Reset() { - *x = RemoveServiceResponse{} - mi := &file_inventory_v1_services_proto_msgTypes[23] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *RemoveServiceResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RemoveServiceResponse) ProtoMessage() {} - -func (x *RemoveServiceResponse) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_services_proto_msgTypes[23] - 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 RemoveServiceResponse.ProtoReflect.Descriptor instead. -func (*RemoveServiceResponse) Descriptor() ([]byte, []int) { - return file_inventory_v1_services_proto_rawDescGZIP(), []int{23} -} - -type ChangeServiceRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - ServiceId string `protobuf:"bytes,1,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` - Environment *string `protobuf:"bytes,2,opt,name=environment,proto3,oneof" json:"environment,omitempty"` - Cluster *string `protobuf:"bytes,3,opt,name=cluster,proto3,oneof" json:"cluster,omitempty"` - ReplicationSet *string `protobuf:"bytes,4,opt,name=replication_set,json=replicationSet,proto3,oneof" json:"replication_set,omitempty"` - ExternalGroup *string `protobuf:"bytes,5,opt,name=external_group,json=externalGroup,proto3,oneof" json:"external_group,omitempty"` - // Replace all custom user-assigned labels. - CustomLabels *common.StringMap `protobuf:"bytes,6,opt,name=custom_labels,json=customLabels,proto3,oneof" json:"custom_labels,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ChangeServiceRequest) Reset() { - *x = ChangeServiceRequest{} - mi := &file_inventory_v1_services_proto_msgTypes[24] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ChangeServiceRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ChangeServiceRequest) ProtoMessage() {} - -func (x *ChangeServiceRequest) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_services_proto_msgTypes[24] - 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 ChangeServiceRequest.ProtoReflect.Descriptor instead. -func (*ChangeServiceRequest) Descriptor() ([]byte, []int) { - return file_inventory_v1_services_proto_rawDescGZIP(), []int{24} -} - -func (x *ChangeServiceRequest) GetServiceId() string { - if x != nil { - return x.ServiceId - } - return "" -} - -func (x *ChangeServiceRequest) GetEnvironment() string { - if x != nil && x.Environment != nil { - return *x.Environment - } - return "" -} - -func (x *ChangeServiceRequest) GetCluster() string { - if x != nil && x.Cluster != nil { - return *x.Cluster - } - return "" -} - -func (x *ChangeServiceRequest) GetReplicationSet() string { - if x != nil && x.ReplicationSet != nil { - return *x.ReplicationSet - } - return "" -} - -func (x *ChangeServiceRequest) GetExternalGroup() string { - if x != nil && x.ExternalGroup != nil { - return *x.ExternalGroup - } - return "" -} - -func (x *ChangeServiceRequest) GetCustomLabels() *common.StringMap { - if x != nil { - return x.CustomLabels - } - return nil -} - -type ChangeServiceResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Service: - // - // *ChangeServiceResponse_Mysql - // *ChangeServiceResponse_Mongodb - // *ChangeServiceResponse_Postgresql - // *ChangeServiceResponse_Proxysql - // *ChangeServiceResponse_Haproxy - // *ChangeServiceResponse_External - // *ChangeServiceResponse_Valkey - Service isChangeServiceResponse_Service `protobuf_oneof:"service"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ChangeServiceResponse) Reset() { - *x = ChangeServiceResponse{} - mi := &file_inventory_v1_services_proto_msgTypes[25] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ChangeServiceResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ChangeServiceResponse) ProtoMessage() {} - -func (x *ChangeServiceResponse) ProtoReflect() protoreflect.Message { - mi := &file_inventory_v1_services_proto_msgTypes[25] - 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 ChangeServiceResponse.ProtoReflect.Descriptor instead. -func (*ChangeServiceResponse) Descriptor() ([]byte, []int) { - return file_inventory_v1_services_proto_rawDescGZIP(), []int{25} -} - -func (x *ChangeServiceResponse) GetService() isChangeServiceResponse_Service { - if x != nil { - return x.Service - } - return nil -} - -func (x *ChangeServiceResponse) GetMysql() *MySQLService { - if x != nil { - if x, ok := x.Service.(*ChangeServiceResponse_Mysql); ok { - return x.Mysql - } - } - return nil -} - -func (x *ChangeServiceResponse) GetMongodb() *MongoDBService { - if x != nil { - if x, ok := x.Service.(*ChangeServiceResponse_Mongodb); ok { - return x.Mongodb - } - } - return nil -} - -func (x *ChangeServiceResponse) GetPostgresql() *PostgreSQLService { - if x != nil { - if x, ok := x.Service.(*ChangeServiceResponse_Postgresql); ok { - return x.Postgresql - } - } - return nil -} - -func (x *ChangeServiceResponse) GetProxysql() *ProxySQLService { - if x != nil { - if x, ok := x.Service.(*ChangeServiceResponse_Proxysql); ok { - return x.Proxysql - } - } - return nil -} - -func (x *ChangeServiceResponse) GetHaproxy() *HAProxyService { - if x != nil { - if x, ok := x.Service.(*ChangeServiceResponse_Haproxy); ok { - return x.Haproxy - } - } - return nil -} - -func (x *ChangeServiceResponse) GetExternal() *ExternalService { - if x != nil { - if x, ok := x.Service.(*ChangeServiceResponse_External); ok { - return x.External - } - } - return nil -} - -func (x *ChangeServiceResponse) GetValkey() *ValkeyService { - if x != nil { - if x, ok := x.Service.(*ChangeServiceResponse_Valkey); ok { - return x.Valkey - } - } - return nil -} - -type isChangeServiceResponse_Service interface { - isChangeServiceResponse_Service() -} - -type ChangeServiceResponse_Mysql struct { - Mysql *MySQLService `protobuf:"bytes,1,opt,name=mysql,proto3,oneof"` -} - -type ChangeServiceResponse_Mongodb struct { - Mongodb *MongoDBService `protobuf:"bytes,2,opt,name=mongodb,proto3,oneof"` -} - -type ChangeServiceResponse_Postgresql struct { - Postgresql *PostgreSQLService `protobuf:"bytes,3,opt,name=postgresql,proto3,oneof"` -} - -type ChangeServiceResponse_Proxysql struct { - Proxysql *ProxySQLService `protobuf:"bytes,4,opt,name=proxysql,proto3,oneof"` -} - -type ChangeServiceResponse_Haproxy struct { - Haproxy *HAProxyService `protobuf:"bytes,5,opt,name=haproxy,proto3,oneof"` -} - -type ChangeServiceResponse_External struct { - External *ExternalService `protobuf:"bytes,6,opt,name=external,proto3,oneof"` -} - -type ChangeServiceResponse_Valkey struct { - Valkey *ValkeyService `protobuf:"bytes,7,opt,name=valkey,proto3,oneof"` -} - -func (*ChangeServiceResponse_Mysql) isChangeServiceResponse_Service() {} - -func (*ChangeServiceResponse_Mongodb) isChangeServiceResponse_Service() {} - -func (*ChangeServiceResponse_Postgresql) isChangeServiceResponse_Service() {} - -func (*ChangeServiceResponse_Proxysql) isChangeServiceResponse_Service() {} - -func (*ChangeServiceResponse_Haproxy) isChangeServiceResponse_Service() {} - -func (*ChangeServiceResponse_External) isChangeServiceResponse_Service() {} - -func (*ChangeServiceResponse_Valkey) isChangeServiceResponse_Service() {} - -var File_inventory_v1_services_proto protoreflect.FileDescriptor - -const file_inventory_v1_services_proto_rawDesc = "" + - "\n" + - "\x1binventory/v1/services.proto\x12\finventory.v1\x1a\x13common/common.proto\x1a\x1cgoogle/api/annotations.proto\x1a.protoc-gen-openapiv2/options/annotations.proto\x1a\x17validate/validate.proto\"\xdf\x04\n" + - "\fMySQLService\x12\x1d\n" + - "\n" + - "service_id\x18\x01 \x01(\tR\tserviceId\x12!\n" + - "\fservice_name\x18\x02 \x01(\tR\vserviceName\x12\x17\n" + - "\anode_id\x18\x03 \x01(\tR\x06nodeId\x12\x18\n" + - "\aaddress\x18\x04 \x01(\tR\aaddress\x12\x12\n" + - "\x04port\x18\x05 \x01(\rR\x04port\x12\x16\n" + - "\x06socket\x18\x06 \x01(\tR\x06socket\x12 \n" + - "\venvironment\x18\a \x01(\tR\venvironment\x12\x18\n" + - "\acluster\x18\b \x01(\tR\acluster\x12'\n" + - "\x0freplication_set\x18\t \x01(\tR\x0ereplicationSet\x12Q\n" + - "\rcustom_labels\x18\n" + - " \x03(\v2,.inventory.v1.MySQLService.CustomLabelsEntryR\fcustomLabels\x12\x18\n" + - "\aversion\x18\v \x01(\tR\aversion\x12X\n" + - "\x10extra_dsn_params\x18\f \x03(\v2..inventory.v1.MySQLService.ExtraDsnParamsEntryR\x0eextraDsnParams\x1a?\n" + - "\x11CustomLabelsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\x1aA\n" + - "\x13ExtraDsnParamsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\xc6\x03\n" + - "\x0eMongoDBService\x12\x1d\n" + - "\n" + - "service_id\x18\x01 \x01(\tR\tserviceId\x12!\n" + - "\fservice_name\x18\x02 \x01(\tR\vserviceName\x12\x17\n" + - "\anode_id\x18\x03 \x01(\tR\x06nodeId\x12\x18\n" + - "\aaddress\x18\x04 \x01(\tR\aaddress\x12\x12\n" + - "\x04port\x18\x05 \x01(\rR\x04port\x12\x16\n" + - "\x06socket\x18\x06 \x01(\tR\x06socket\x12 \n" + - "\venvironment\x18\a \x01(\tR\venvironment\x12\x18\n" + - "\acluster\x18\b \x01(\tR\acluster\x12'\n" + - "\x0freplication_set\x18\t \x01(\tR\x0ereplicationSet\x12S\n" + - "\rcustom_labels\x18\n" + - " \x03(\v2..inventory.v1.MongoDBService.CustomLabelsEntryR\fcustomLabels\x12\x18\n" + - "\aversion\x18\v \x01(\tR\aversion\x1a?\n" + - "\x11CustomLabelsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\xa3\x04\n" + - "\x11PostgreSQLService\x12\x1d\n" + - "\n" + - "service_id\x18\x01 \x01(\tR\tserviceId\x12!\n" + - "\fservice_name\x18\x02 \x01(\tR\vserviceName\x12#\n" + - "\rdatabase_name\x18\x03 \x01(\tR\fdatabaseName\x12\x17\n" + - "\anode_id\x18\x04 \x01(\tR\x06nodeId\x12\x18\n" + - "\aaddress\x18\x05 \x01(\tR\aaddress\x12\x12\n" + - "\x04port\x18\x06 \x01(\rR\x04port\x12\x16\n" + - "\x06socket\x18\a \x01(\tR\x06socket\x12 \n" + - "\venvironment\x18\b \x01(\tR\venvironment\x12\x18\n" + - "\acluster\x18\t \x01(\tR\acluster\x12'\n" + - "\x0freplication_set\x18\n" + - " \x01(\tR\x0ereplicationSet\x12V\n" + - "\rcustom_labels\x18\v \x03(\v21.inventory.v1.PostgreSQLService.CustomLabelsEntryR\fcustomLabels\x12\x18\n" + - "\aversion\x18\f \x01(\tR\aversion\x120\n" + - "\x14auto_discovery_limit\x18\r \x01(\x05R\x12autoDiscoveryLimit\x1a?\n" + - "\x11CustomLabelsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\xc4\x03\n" + - "\rValkeyService\x12\x1d\n" + - "\n" + - "service_id\x18\x01 \x01(\tR\tserviceId\x12!\n" + - "\fservice_name\x18\x02 \x01(\tR\vserviceName\x12\x17\n" + - "\anode_id\x18\x03 \x01(\tR\x06nodeId\x12\x18\n" + - "\aaddress\x18\x04 \x01(\tR\aaddress\x12\x12\n" + - "\x04port\x18\x05 \x01(\rR\x04port\x12\x16\n" + - "\x06socket\x18\x06 \x01(\tR\x06socket\x12 \n" + - "\venvironment\x18\a \x01(\tR\venvironment\x12\x18\n" + - "\acluster\x18\b \x01(\tR\acluster\x12'\n" + - "\x0freplication_set\x18\t \x01(\tR\x0ereplicationSet\x12R\n" + - "\rcustom_labels\x18\n" + - " \x03(\v2-.inventory.v1.ValkeyService.CustomLabelsEntryR\fcustomLabels\x12\x18\n" + - "\aversion\x18\v \x01(\tR\aversion\x1a?\n" + - "\x11CustomLabelsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\xc8\x03\n" + - "\x0fProxySQLService\x12\x1d\n" + - "\n" + - "service_id\x18\x01 \x01(\tR\tserviceId\x12!\n" + - "\fservice_name\x18\x02 \x01(\tR\vserviceName\x12\x17\n" + - "\anode_id\x18\x03 \x01(\tR\x06nodeId\x12\x18\n" + - "\aaddress\x18\x04 \x01(\tR\aaddress\x12\x12\n" + - "\x04port\x18\x05 \x01(\rR\x04port\x12\x16\n" + - "\x06socket\x18\x06 \x01(\tR\x06socket\x12 \n" + - "\venvironment\x18\a \x01(\tR\venvironment\x12\x18\n" + - "\acluster\x18\b \x01(\tR\acluster\x12'\n" + - "\x0freplication_set\x18\t \x01(\tR\x0ereplicationSet\x12T\n" + - "\rcustom_labels\x18\n" + - " \x03(\v2/.inventory.v1.ProxySQLService.CustomLabelsEntryR\fcustomLabels\x12\x18\n" + - "\aversion\x18\v \x01(\tR\aversion\x1a?\n" + - "\x11CustomLabelsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\xe6\x02\n" + - "\x0eHAProxyService\x12\x1d\n" + - "\n" + - "service_id\x18\x01 \x01(\tR\tserviceId\x12!\n" + - "\fservice_name\x18\x02 \x01(\tR\vserviceName\x12\x17\n" + - "\anode_id\x18\x03 \x01(\tR\x06nodeId\x12 \n" + - "\venvironment\x18\x04 \x01(\tR\venvironment\x12\x18\n" + - "\acluster\x18\x05 \x01(\tR\acluster\x12'\n" + - "\x0freplication_set\x18\x06 \x01(\tR\x0ereplicationSet\x12S\n" + - "\rcustom_labels\x18\a \x03(\v2..inventory.v1.HAProxyService.CustomLabelsEntryR\fcustomLabels\x1a?\n" + - "\x11CustomLabelsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\xfe\x02\n" + - "\x0fExternalService\x12\x1d\n" + - "\n" + - "service_id\x18\x01 \x01(\tR\tserviceId\x12!\n" + - "\fservice_name\x18\x02 \x01(\tR\vserviceName\x12\x17\n" + - "\anode_id\x18\x03 \x01(\tR\x06nodeId\x12 \n" + - "\venvironment\x18\x04 \x01(\tR\venvironment\x12\x18\n" + - "\acluster\x18\x05 \x01(\tR\acluster\x12'\n" + - "\x0freplication_set\x18\x06 \x01(\tR\x0ereplicationSet\x12T\n" + - "\rcustom_labels\x18\a \x03(\v2/.inventory.v1.ExternalService.CustomLabelsEntryR\fcustomLabels\x12\x14\n" + - "\x05group\x18\b \x01(\tR\x05group\x1a?\n" + - "\x11CustomLabelsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\x93\x01\n" + - "\x13ListServicesRequest\x12\x17\n" + - "\anode_id\x18\x01 \x01(\tR\x06nodeId\x12<\n" + - "\fservice_type\x18\x02 \x01(\x0e2\x19.inventory.v1.ServiceTypeR\vserviceType\x12%\n" + - "\x0eexternal_group\x18\x03 \x01(\tR\rexternalGroup\"\xa4\x03\n" + - "\x14ListServicesResponse\x120\n" + - "\x05mysql\x18\x01 \x03(\v2\x1a.inventory.v1.MySQLServiceR\x05mysql\x126\n" + - "\amongodb\x18\x02 \x03(\v2\x1c.inventory.v1.MongoDBServiceR\amongodb\x12?\n" + - "\n" + - "postgresql\x18\x03 \x03(\v2\x1f.inventory.v1.PostgreSQLServiceR\n" + - "postgresql\x129\n" + - "\bproxysql\x18\x04 \x03(\v2\x1d.inventory.v1.ProxySQLServiceR\bproxysql\x126\n" + - "\ahaproxy\x18\x05 \x03(\v2\x1c.inventory.v1.HAProxyServiceR\ahaproxy\x129\n" + - "\bexternal\x18\x06 \x03(\v2\x1d.inventory.v1.ExternalServiceR\bexternal\x123\n" + - "\x06valkey\x18\a \x03(\v2\x1b.inventory.v1.ValkeyServiceR\x06valkey\"\x1f\n" + - "\x1dListActiveServiceTypesRequest\"`\n" + - "\x1eListActiveServiceTypesResponse\x12>\n" + - "\rservice_types\x18\x01 \x03(\x0e2\x19.inventory.v1.ServiceTypeR\fserviceTypes\";\n" + - "\x11GetServiceRequest\x12&\n" + - "\n" + - "service_id\x18\x01 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\tserviceId\"\xbb\x03\n" + - "\x12GetServiceResponse\x122\n" + - "\x05mysql\x18\x01 \x01(\v2\x1a.inventory.v1.MySQLServiceH\x00R\x05mysql\x128\n" + - "\amongodb\x18\x02 \x01(\v2\x1c.inventory.v1.MongoDBServiceH\x00R\amongodb\x12A\n" + - "\n" + - "postgresql\x18\x03 \x01(\v2\x1f.inventory.v1.PostgreSQLServiceH\x00R\n" + - "postgresql\x12;\n" + - "\bproxysql\x18\x04 \x01(\v2\x1d.inventory.v1.ProxySQLServiceH\x00R\bproxysql\x128\n" + - "\ahaproxy\x18\x05 \x01(\v2\x1c.inventory.v1.HAProxyServiceH\x00R\ahaproxy\x12;\n" + - "\bexternal\x18\x06 \x01(\v2\x1d.inventory.v1.ExternalServiceH\x00R\bexternal\x125\n" + - "\x06valkey\x18\a \x01(\v2\x1b.inventory.v1.ValkeyServiceH\x00R\x06valkeyB\t\n" + - "\aservice\"\xf9\x03\n" + - "\x11AddServiceRequest\x12;\n" + - "\x05mysql\x18\x01 \x01(\v2#.inventory.v1.AddMySQLServiceParamsH\x00R\x05mysql\x12A\n" + - "\amongodb\x18\x02 \x01(\v2%.inventory.v1.AddMongoDBServiceParamsH\x00R\amongodb\x12J\n" + - "\n" + - "postgresql\x18\x03 \x01(\v2(.inventory.v1.AddPostgreSQLServiceParamsH\x00R\n" + - "postgresql\x12D\n" + - "\bproxysql\x18\x04 \x01(\v2&.inventory.v1.AddProxySQLServiceParamsH\x00R\bproxysql\x12A\n" + - "\ahaproxy\x18\x05 \x01(\v2%.inventory.v1.AddHAProxyServiceParamsH\x00R\ahaproxy\x12D\n" + - "\bexternal\x18\x06 \x01(\v2&.inventory.v1.AddExternalServiceParamsH\x00R\bexternal\x12>\n" + - "\x06valkey\x18\a \x01(\v2$.inventory.v1.AddValkeyServiceParamsH\x00R\x06valkeyB\t\n" + - "\aservice\"\xbb\x03\n" + - "\x12AddServiceResponse\x122\n" + - "\x05mysql\x18\x01 \x01(\v2\x1a.inventory.v1.MySQLServiceH\x00R\x05mysql\x128\n" + - "\amongodb\x18\x02 \x01(\v2\x1c.inventory.v1.MongoDBServiceH\x00R\amongodb\x12A\n" + - "\n" + - "postgresql\x18\x03 \x01(\v2\x1f.inventory.v1.PostgreSQLServiceH\x00R\n" + - "postgresql\x12;\n" + - "\bproxysql\x18\x04 \x01(\v2\x1d.inventory.v1.ProxySQLServiceH\x00R\bproxysql\x128\n" + - "\ahaproxy\x18\x05 \x01(\v2\x1c.inventory.v1.HAProxyServiceH\x00R\ahaproxy\x12;\n" + - "\bexternal\x18\x06 \x01(\v2\x1d.inventory.v1.ExternalServiceH\x00R\bexternal\x125\n" + - "\x06valkey\x18\a \x01(\v2\x1b.inventory.v1.ValkeyServiceH\x00R\x06valkeyB\t\n" + - "\aservice\"\xd3\x04\n" + - "\x15AddMySQLServiceParams\x12*\n" + - "\fservice_name\x18\x01 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\vserviceName\x12 \n" + - "\anode_id\x18\x02 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\x06nodeId\x12\x18\n" + - "\aaddress\x18\x03 \x01(\tR\aaddress\x12\x12\n" + - "\x04port\x18\x04 \x01(\rR\x04port\x12\x16\n" + - "\x06socket\x18\x05 \x01(\tR\x06socket\x12 \n" + - "\venvironment\x18\x06 \x01(\tR\venvironment\x12\x18\n" + - "\acluster\x18\a \x01(\tR\acluster\x12'\n" + - "\x0freplication_set\x18\b \x01(\tR\x0ereplicationSet\x12Z\n" + - "\rcustom_labels\x18\t \x03(\v25.inventory.v1.AddMySQLServiceParams.CustomLabelsEntryR\fcustomLabels\x12a\n" + - "\x10extra_dsn_params\x18\n" + - " \x03(\v27.inventory.v1.AddMySQLServiceParams.ExtraDsnParamsEntryR\x0eextraDsnParams\x1a?\n" + - "\x11CustomLabelsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\x1aA\n" + - "\x13ExtraDsnParamsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\xb1\x03\n" + - "\x17AddMongoDBServiceParams\x12*\n" + - "\fservice_name\x18\x01 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\vserviceName\x12 \n" + - "\anode_id\x18\x02 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\x06nodeId\x12\x18\n" + - "\aaddress\x18\x03 \x01(\tR\aaddress\x12\x12\n" + - "\x04port\x18\x04 \x01(\rR\x04port\x12\x16\n" + - "\x06socket\x18\x05 \x01(\tR\x06socket\x12 \n" + - "\venvironment\x18\x06 \x01(\tR\venvironment\x12\x18\n" + - "\acluster\x18\a \x01(\tR\acluster\x12'\n" + - "\x0freplication_set\x18\b \x01(\tR\x0ereplicationSet\x12\\\n" + - "\rcustom_labels\x18\t \x03(\v27.inventory.v1.AddMongoDBServiceParams.CustomLabelsEntryR\fcustomLabels\x1a?\n" + - "\x11CustomLabelsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\xe9\x03\n" + - "\x1aAddPostgreSQLServiceParams\x12*\n" + - "\fservice_name\x18\x01 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\vserviceName\x12 \n" + - "\anode_id\x18\x02 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\x06nodeId\x12\x18\n" + - "\aaddress\x18\x03 \x01(\tR\aaddress\x12\x12\n" + - "\x04port\x18\x04 \x01(\rR\x04port\x12\x16\n" + - "\x06socket\x18\x05 \x01(\tR\x06socket\x12 \n" + - "\venvironment\x18\x06 \x01(\tR\venvironment\x12\x18\n" + - "\acluster\x18\a \x01(\tR\acluster\x12'\n" + - "\x0freplication_set\x18\b \x01(\tR\x0ereplicationSet\x12_\n" + - "\rcustom_labels\x18\t \x03(\v2:.inventory.v1.AddPostgreSQLServiceParams.CustomLabelsEntryR\fcustomLabels\x120\n" + - "\x14auto_discovery_limit\x18\n" + - " \x01(\x05R\x12autoDiscoveryLimit\x1a?\n" + - "\x11CustomLabelsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\xaf\x03\n" + - "\x16AddValkeyServiceParams\x12*\n" + - "\fservice_name\x18\x01 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\vserviceName\x12 \n" + - "\anode_id\x18\x02 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\x06nodeId\x12\x18\n" + - "\aaddress\x18\x03 \x01(\tR\aaddress\x12\x12\n" + - "\x04port\x18\x04 \x01(\rR\x04port\x12\x16\n" + - "\x06socket\x18\x05 \x01(\tR\x06socket\x12 \n" + - "\venvironment\x18\x06 \x01(\tR\venvironment\x12\x18\n" + - "\acluster\x18\a \x01(\tR\acluster\x12'\n" + - "\x0freplication_set\x18\b \x01(\tR\x0ereplicationSet\x12[\n" + - "\rcustom_labels\x18\t \x03(\v26.inventory.v1.AddValkeyServiceParams.CustomLabelsEntryR\fcustomLabels\x1a?\n" + - "\x11CustomLabelsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\xb3\x03\n" + - "\x18AddProxySQLServiceParams\x12*\n" + - "\fservice_name\x18\x01 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\vserviceName\x12 \n" + - "\anode_id\x18\x02 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\x06nodeId\x12\x18\n" + - "\aaddress\x18\x03 \x01(\tR\aaddress\x12\x12\n" + - "\x04port\x18\x04 \x01(\rR\x04port\x12\x16\n" + - "\x06socket\x18\x05 \x01(\tR\x06socket\x12 \n" + - "\venvironment\x18\x06 \x01(\tR\venvironment\x12\x18\n" + - "\acluster\x18\a \x01(\tR\acluster\x12'\n" + - "\x0freplication_set\x18\b \x01(\tR\x0ereplicationSet\x12]\n" + - "\rcustom_labels\x18\t \x03(\v28.inventory.v1.AddProxySQLServiceParams.CustomLabelsEntryR\fcustomLabels\x1a?\n" + - "\x11CustomLabelsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\xeb\x02\n" + - "\x17AddHAProxyServiceParams\x12*\n" + - "\fservice_name\x18\x01 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\vserviceName\x12 \n" + - "\anode_id\x18\x02 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\x06nodeId\x12 \n" + - "\venvironment\x18\x03 \x01(\tR\venvironment\x12\x18\n" + - "\acluster\x18\x04 \x01(\tR\acluster\x12'\n" + - "\x0freplication_set\x18\x05 \x01(\tR\x0ereplicationSet\x12\\\n" + - "\rcustom_labels\x18\x06 \x03(\v27.inventory.v1.AddHAProxyServiceParams.CustomLabelsEntryR\fcustomLabels\x1a?\n" + - "\x11CustomLabelsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\x83\x03\n" + - "\x18AddExternalServiceParams\x12*\n" + - "\fservice_name\x18\x01 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\vserviceName\x12 \n" + - "\anode_id\x18\x02 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\x06nodeId\x12 \n" + - "\venvironment\x18\x03 \x01(\tR\venvironment\x12\x18\n" + - "\acluster\x18\x04 \x01(\tR\acluster\x12'\n" + - "\x0freplication_set\x18\x05 \x01(\tR\x0ereplicationSet\x12]\n" + - "\rcustom_labels\x18\x06 \x03(\v28.inventory.v1.AddExternalServiceParams.CustomLabelsEntryR\fcustomLabels\x12\x14\n" + - "\x05group\x18\a \x01(\tR\x05group\x1a?\n" + - "\x11CustomLabelsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"T\n" + - "\x14RemoveServiceRequest\x12&\n" + - "\n" + - "service_id\x18\x01 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\tserviceId\x12\x14\n" + - "\x05force\x18\x02 \x01(\bR\x05force\"\x17\n" + - "\x15RemoveServiceResponse\"\xf0\x02\n" + - "\x14ChangeServiceRequest\x12&\n" + - "\n" + - "service_id\x18\x01 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\tserviceId\x12%\n" + - "\venvironment\x18\x02 \x01(\tH\x00R\venvironment\x88\x01\x01\x12\x1d\n" + - "\acluster\x18\x03 \x01(\tH\x01R\acluster\x88\x01\x01\x12,\n" + - "\x0freplication_set\x18\x04 \x01(\tH\x02R\x0ereplicationSet\x88\x01\x01\x12*\n" + - "\x0eexternal_group\x18\x05 \x01(\tH\x03R\rexternalGroup\x88\x01\x01\x12;\n" + - "\rcustom_labels\x18\x06 \x01(\v2\x11.common.StringMapH\x04R\fcustomLabels\x88\x01\x01B\x0e\n" + - "\f_environmentB\n" + - "\n" + - "\b_clusterB\x12\n" + - "\x10_replication_setB\x11\n" + - "\x0f_external_groupB\x10\n" + - "\x0e_custom_labels\"\xbe\x03\n" + - "\x15ChangeServiceResponse\x122\n" + - "\x05mysql\x18\x01 \x01(\v2\x1a.inventory.v1.MySQLServiceH\x00R\x05mysql\x128\n" + - "\amongodb\x18\x02 \x01(\v2\x1c.inventory.v1.MongoDBServiceH\x00R\amongodb\x12A\n" + - "\n" + - "postgresql\x18\x03 \x01(\v2\x1f.inventory.v1.PostgreSQLServiceH\x00R\n" + - "postgresql\x12;\n" + - "\bproxysql\x18\x04 \x01(\v2\x1d.inventory.v1.ProxySQLServiceH\x00R\bproxysql\x128\n" + - "\ahaproxy\x18\x05 \x01(\v2\x1c.inventory.v1.HAProxyServiceH\x00R\ahaproxy\x12;\n" + - "\bexternal\x18\x06 \x01(\v2\x1d.inventory.v1.ExternalServiceH\x00R\bexternal\x125\n" + - "\x06valkey\x18\a \x01(\v2\x1b.inventory.v1.ValkeyServiceH\x00R\x06valkeyB\t\n" + - "\aservice*\x9b\x02\n" + - "\vServiceType\x12\x1c\n" + - "\x18SERVICE_TYPE_UNSPECIFIED\x10\x00\x12\x1e\n" + - "\x1aSERVICE_TYPE_MYSQL_SERVICE\x10\x01\x12 \n" + - "\x1cSERVICE_TYPE_MONGODB_SERVICE\x10\x02\x12#\n" + - "\x1fSERVICE_TYPE_POSTGRESQL_SERVICE\x10\x03\x12\x1f\n" + - "\x1bSERVICE_TYPE_VALKEY_SERVICE\x10\a\x12!\n" + - "\x1dSERVICE_TYPE_PROXYSQL_SERVICE\x10\x04\x12 \n" + - "\x1cSERVICE_TYPE_HAPROXY_SERVICE\x10\x06\x12!\n" + - "\x1dSERVICE_TYPE_EXTERNAL_SERVICE\x10\x052\x88\n" + - "\n" + - "\x0fServicesService\x12\xb5\x01\n" + - "\fListServices\x12!.inventory.v1.ListServicesRequest\x1a\".inventory.v1.ListServicesResponse\"^\x92A=\x12\rList Services\x1a,Returns a list of Services filtered by type.\x82\xd3\xe4\x93\x02\x18\x12\x16/v1/inventory/services\x12\xe6\x01\n" + - "\x16ListActiveServiceTypes\x12+.inventory.v1.ListActiveServiceTypesRequest\x1a,.inventory.v1.ListActiveServiceTypesResponse\"q\x92AD\x12\x19List Active Service Types\x1a'Returns a list of active Service types.\x82\xd3\xe4\x93\x02$:\x01*\"\x1f/v1/inventory/services:getTypes\x12\xaf\x01\n" + - "\n" + - "GetService\x12\x1f.inventory.v1.GetServiceRequest\x1a .inventory.v1.GetServiceResponse\"^\x92A0\x12\rGet a Service\x1a\x1fReturns a single Service by ID.\x82\xd3\xe4\x93\x02%\x12#/v1/inventory/services/{service_id}\x12\x95\x01\n" + - "\n" + - "AddService\x12\x1f.inventory.v1.AddServiceRequest\x1a .inventory.v1.AddServiceResponse\"D\x92A \x12\rAdd a Service\x1a\x0fAdds a Service.\x82\xd3\xe4\x93\x02\x1b:\x01*\"\x16/v1/inventory/services\x12\xaa\x01\n" + - "\rRemoveService\x12\".inventory.v1.RemoveServiceRequest\x1a#.inventory.v1.RemoveServiceResponse\"P\x92A\"\x12\x0eRemove Service\x1a\x10Removes Service.\x82\xd3\xe4\x93\x02%*#/v1/inventory/services/{service_id}\x12\xdc\x02\n" + - "\rChangeService\x12\".inventory.v1.ChangeServiceRequest\x1a#.inventory.v1.ChangeServiceResponse\"\x81\x02\x92A\xcf\x01\x12\x0eChange service\x1a\xbc\x01Changes 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.\x82\xd3\xe4\x93\x02(:\x01*\x1a#/v1/inventory/services/{service_id}B\xa7\x01\n" + - "\x10com.inventory.v1B\rServicesProtoP\x01Z3github.com/percona/pmm/api/inventory/v1;inventoryv1\xa2\x02\x03IXX\xaa\x02\fInventory.V1\xca\x02\fInventory\\V1\xe2\x02\x18Inventory\\V1\\GPBMetadata\xea\x02\rInventory::V1b\x06proto3" - -var ( - file_inventory_v1_services_proto_rawDescOnce sync.Once - file_inventory_v1_services_proto_rawDescData []byte -) - -func file_inventory_v1_services_proto_rawDescGZIP() []byte { - file_inventory_v1_services_proto_rawDescOnce.Do(func() { - file_inventory_v1_services_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_inventory_v1_services_proto_rawDesc), len(file_inventory_v1_services_proto_rawDesc))) - }) - 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_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 - 29, // 2: inventory.v1.MongoDBService.custom_labels:type_name -> inventory.v1.MongoDBService.CustomLabelsEntry - 30, // 3: inventory.v1.PostgreSQLService.custom_labels:type_name -> inventory.v1.PostgreSQLService.CustomLabelsEntry - 31, // 4: inventory.v1.ValkeyService.custom_labels:type_name -> inventory.v1.ValkeyService.CustomLabelsEntry - 32, // 5: inventory.v1.ProxySQLService.custom_labels:type_name -> inventory.v1.ProxySQLService.CustomLabelsEntry - 33, // 6: inventory.v1.HAProxyService.custom_labels:type_name -> inventory.v1.HAProxyService.CustomLabelsEntry - 34, // 7: inventory.v1.ExternalService.custom_labels:type_name -> inventory.v1.ExternalService.CustomLabelsEntry - 0, // 8: inventory.v1.ListServicesRequest.service_type:type_name -> inventory.v1.ServiceType - 1, // 9: inventory.v1.ListServicesResponse.mysql:type_name -> inventory.v1.MySQLService - 2, // 10: inventory.v1.ListServicesResponse.mongodb:type_name -> inventory.v1.MongoDBService - 3, // 11: inventory.v1.ListServicesResponse.postgresql:type_name -> inventory.v1.PostgreSQLService - 5, // 12: inventory.v1.ListServicesResponse.proxysql:type_name -> inventory.v1.ProxySQLService - 6, // 13: inventory.v1.ListServicesResponse.haproxy:type_name -> inventory.v1.HAProxyService - 7, // 14: inventory.v1.ListServicesResponse.external:type_name -> inventory.v1.ExternalService - 4, // 15: inventory.v1.ListServicesResponse.valkey:type_name -> inventory.v1.ValkeyService - 0, // 16: inventory.v1.ListActiveServiceTypesResponse.service_types:type_name -> inventory.v1.ServiceType - 1, // 17: inventory.v1.GetServiceResponse.mysql:type_name -> inventory.v1.MySQLService - 2, // 18: inventory.v1.GetServiceResponse.mongodb:type_name -> inventory.v1.MongoDBService - 3, // 19: inventory.v1.GetServiceResponse.postgresql:type_name -> inventory.v1.PostgreSQLService - 5, // 20: inventory.v1.GetServiceResponse.proxysql:type_name -> inventory.v1.ProxySQLService - 6, // 21: inventory.v1.GetServiceResponse.haproxy:type_name -> inventory.v1.HAProxyService - 7, // 22: inventory.v1.GetServiceResponse.external:type_name -> inventory.v1.ExternalService - 4, // 23: inventory.v1.GetServiceResponse.valkey:type_name -> inventory.v1.ValkeyService - 16, // 24: inventory.v1.AddServiceRequest.mysql:type_name -> inventory.v1.AddMySQLServiceParams - 17, // 25: inventory.v1.AddServiceRequest.mongodb:type_name -> inventory.v1.AddMongoDBServiceParams - 18, // 26: inventory.v1.AddServiceRequest.postgresql:type_name -> inventory.v1.AddPostgreSQLServiceParams - 20, // 27: inventory.v1.AddServiceRequest.proxysql:type_name -> inventory.v1.AddProxySQLServiceParams - 21, // 28: inventory.v1.AddServiceRequest.haproxy:type_name -> inventory.v1.AddHAProxyServiceParams - 22, // 29: inventory.v1.AddServiceRequest.external:type_name -> inventory.v1.AddExternalServiceParams - 19, // 30: inventory.v1.AddServiceRequest.valkey:type_name -> inventory.v1.AddValkeyServiceParams - 1, // 31: inventory.v1.AddServiceResponse.mysql:type_name -> inventory.v1.MySQLService - 2, // 32: inventory.v1.AddServiceResponse.mongodb:type_name -> inventory.v1.MongoDBService - 3, // 33: inventory.v1.AddServiceResponse.postgresql:type_name -> inventory.v1.PostgreSQLService - 5, // 34: inventory.v1.AddServiceResponse.proxysql:type_name -> inventory.v1.ProxySQLService - 6, // 35: inventory.v1.AddServiceResponse.haproxy:type_name -> inventory.v1.HAProxyService - 7, // 36: inventory.v1.AddServiceResponse.external:type_name -> inventory.v1.ExternalService - 4, // 37: inventory.v1.AddServiceResponse.valkey:type_name -> inventory.v1.ValkeyService - 35, // 38: inventory.v1.AddMySQLServiceParams.custom_labels:type_name -> inventory.v1.AddMySQLServiceParams.CustomLabelsEntry - 36, // 39: inventory.v1.AddMySQLServiceParams.extra_dsn_params:type_name -> inventory.v1.AddMySQLServiceParams.ExtraDsnParamsEntry - 37, // 40: inventory.v1.AddMongoDBServiceParams.custom_labels:type_name -> inventory.v1.AddMongoDBServiceParams.CustomLabelsEntry - 38, // 41: inventory.v1.AddPostgreSQLServiceParams.custom_labels:type_name -> inventory.v1.AddPostgreSQLServiceParams.CustomLabelsEntry - 39, // 42: inventory.v1.AddValkeyServiceParams.custom_labels:type_name -> inventory.v1.AddValkeyServiceParams.CustomLabelsEntry - 40, // 43: inventory.v1.AddProxySQLServiceParams.custom_labels:type_name -> inventory.v1.AddProxySQLServiceParams.CustomLabelsEntry - 41, // 44: inventory.v1.AddHAProxyServiceParams.custom_labels:type_name -> inventory.v1.AddHAProxyServiceParams.CustomLabelsEntry - 42, // 45: inventory.v1.AddExternalServiceParams.custom_labels:type_name -> inventory.v1.AddExternalServiceParams.CustomLabelsEntry - 43, // 46: inventory.v1.ChangeServiceRequest.custom_labels:type_name -> common.StringMap - 1, // 47: inventory.v1.ChangeServiceResponse.mysql:type_name -> inventory.v1.MySQLService - 2, // 48: inventory.v1.ChangeServiceResponse.mongodb:type_name -> inventory.v1.MongoDBService - 3, // 49: inventory.v1.ChangeServiceResponse.postgresql:type_name -> inventory.v1.PostgreSQLService - 5, // 50: inventory.v1.ChangeServiceResponse.proxysql:type_name -> inventory.v1.ProxySQLService - 6, // 51: inventory.v1.ChangeServiceResponse.haproxy:type_name -> inventory.v1.HAProxyService - 7, // 52: inventory.v1.ChangeServiceResponse.external:type_name -> inventory.v1.ExternalService - 4, // 53: inventory.v1.ChangeServiceResponse.valkey:type_name -> inventory.v1.ValkeyService - 8, // 54: inventory.v1.ServicesService.ListServices:input_type -> inventory.v1.ListServicesRequest - 10, // 55: inventory.v1.ServicesService.ListActiveServiceTypes:input_type -> inventory.v1.ListActiveServiceTypesRequest - 12, // 56: inventory.v1.ServicesService.GetService:input_type -> inventory.v1.GetServiceRequest - 14, // 57: inventory.v1.ServicesService.AddService:input_type -> inventory.v1.AddServiceRequest - 23, // 58: inventory.v1.ServicesService.RemoveService:input_type -> inventory.v1.RemoveServiceRequest - 25, // 59: inventory.v1.ServicesService.ChangeService:input_type -> inventory.v1.ChangeServiceRequest - 9, // 60: inventory.v1.ServicesService.ListServices:output_type -> inventory.v1.ListServicesResponse - 11, // 61: inventory.v1.ServicesService.ListActiveServiceTypes:output_type -> inventory.v1.ListActiveServiceTypesResponse - 13, // 62: inventory.v1.ServicesService.GetService:output_type -> inventory.v1.GetServiceResponse - 15, // 63: inventory.v1.ServicesService.AddService:output_type -> inventory.v1.AddServiceResponse - 24, // 64: inventory.v1.ServicesService.RemoveService:output_type -> inventory.v1.RemoveServiceResponse - 26, // 65: inventory.v1.ServicesService.ChangeService:output_type -> inventory.v1.ChangeServiceResponse - 60, // [60:66] is the sub-list for method output_type - 54, // [54:60] is the sub-list for method input_type - 54, // [54:54] is the sub-list for extension type_name - 54, // [54:54] is the sub-list for extension extendee - 0, // [0:54] is the sub-list for field type_name -} - -func init() { file_inventory_v1_services_proto_init() } -func file_inventory_v1_services_proto_init() { - if File_inventory_v1_services_proto != nil { - return - } - file_inventory_v1_services_proto_msgTypes[12].OneofWrappers = []any{ - (*GetServiceResponse_Mysql)(nil), - (*GetServiceResponse_Mongodb)(nil), - (*GetServiceResponse_Postgresql)(nil), - (*GetServiceResponse_Proxysql)(nil), - (*GetServiceResponse_Haproxy)(nil), - (*GetServiceResponse_External)(nil), - (*GetServiceResponse_Valkey)(nil), - } - file_inventory_v1_services_proto_msgTypes[13].OneofWrappers = []any{ - (*AddServiceRequest_Mysql)(nil), - (*AddServiceRequest_Mongodb)(nil), - (*AddServiceRequest_Postgresql)(nil), - (*AddServiceRequest_Proxysql)(nil), - (*AddServiceRequest_Haproxy)(nil), - (*AddServiceRequest_External)(nil), - (*AddServiceRequest_Valkey)(nil), - } - file_inventory_v1_services_proto_msgTypes[14].OneofWrappers = []any{ - (*AddServiceResponse_Mysql)(nil), - (*AddServiceResponse_Mongodb)(nil), - (*AddServiceResponse_Postgresql)(nil), - (*AddServiceResponse_Proxysql)(nil), - (*AddServiceResponse_Haproxy)(nil), - (*AddServiceResponse_External)(nil), - (*AddServiceResponse_Valkey)(nil), - } - file_inventory_v1_services_proto_msgTypes[24].OneofWrappers = []any{} - file_inventory_v1_services_proto_msgTypes[25].OneofWrappers = []any{ - (*ChangeServiceResponse_Mysql)(nil), - (*ChangeServiceResponse_Mongodb)(nil), - (*ChangeServiceResponse_Postgresql)(nil), - (*ChangeServiceResponse_Proxysql)(nil), - (*ChangeServiceResponse_Haproxy)(nil), - (*ChangeServiceResponse_External)(nil), - (*ChangeServiceResponse_Valkey)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_inventory_v1_services_proto_rawDesc), len(file_inventory_v1_services_proto_rawDesc)), - NumEnums: 1, - NumMessages: 42, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_inventory_v1_services_proto_goTypes, - DependencyIndexes: file_inventory_v1_services_proto_depIdxs, - EnumInfos: file_inventory_v1_services_proto_enumTypes, - MessageInfos: file_inventory_v1_services_proto_msgTypes, - }.Build() - File_inventory_v1_services_proto = out.File - file_inventory_v1_services_proto_goTypes = nil - file_inventory_v1_services_proto_depIdxs = nil -} diff --git a/api/inventory/v1/services.pb.gw.go b/api/inventory/v1/services.pb.gw.go deleted file mode 100644 index e2edb914c78..00000000000 --- a/api/inventory/v1/services.pb.gw.go +++ /dev/null @@ -1,551 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: inventory/v1/services.proto - -/* -Package inventoryv1 is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package inventoryv1 - -import ( - "context" - "errors" - "io" - "net/http" - - "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" - "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" - "google.golang.org/protobuf/proto" -) - -// Suppress "imported and not used" errors -var ( - _ codes.Code - _ io.Reader - _ status.Status - _ = errors.New - _ = runtime.String - _ = utilities.NewDoubleArray - _ = metadata.Join -) - -var filter_ServicesService_ListServices_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} - -func request_ServicesService_ListServices_0(ctx context.Context, marshaler runtime.Marshaler, client ServicesServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq ListServicesRequest - metadata runtime.ServerMetadata - ) - if req.Body != nil { - _, _ = io.Copy(io.Discard, req.Body) - } - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_ServicesService_ListServices_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - msg, err := client.ListServices(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_ServicesService_ListServices_0(ctx context.Context, marshaler runtime.Marshaler, server ServicesServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq ListServicesRequest - metadata runtime.ServerMetadata - ) - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_ServicesService_ListServices_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - msg, err := server.ListServices(ctx, &protoReq) - return msg, metadata, err -} - -func request_ServicesService_ListActiveServiceTypes_0(ctx context.Context, marshaler runtime.Marshaler, client ServicesServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq ListActiveServiceTypesRequest - 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.ListActiveServiceTypes(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_ServicesService_ListActiveServiceTypes_0(ctx context.Context, marshaler runtime.Marshaler, server ServicesServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq ListActiveServiceTypesRequest - 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.ListActiveServiceTypes(ctx, &protoReq) - return msg, metadata, err -} - -func request_ServicesService_GetService_0(ctx context.Context, marshaler runtime.Marshaler, client ServicesServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq GetServiceRequest - metadata runtime.ServerMetadata - err error - ) - if req.Body != nil { - _, _ = io.Copy(io.Discard, req.Body) - } - val, ok := pathParams["service_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "service_id") - } - protoReq.ServiceId, err = runtime.String(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "service_id", err) - } - msg, err := client.GetService(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_ServicesService_GetService_0(ctx context.Context, marshaler runtime.Marshaler, server ServicesServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq GetServiceRequest - metadata runtime.ServerMetadata - err error - ) - val, ok := pathParams["service_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "service_id") - } - protoReq.ServiceId, err = runtime.String(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "service_id", err) - } - msg, err := server.GetService(ctx, &protoReq) - return msg, metadata, err -} - -func request_ServicesService_AddService_0(ctx context.Context, marshaler runtime.Marshaler, client ServicesServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq AddServiceRequest - 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.AddService(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_ServicesService_AddService_0(ctx context.Context, marshaler runtime.Marshaler, server ServicesServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq AddServiceRequest - 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.AddService(ctx, &protoReq) - return msg, metadata, err -} - -var filter_ServicesService_RemoveService_0 = &utilities.DoubleArray{Encoding: map[string]int{"service_id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} - -func request_ServicesService_RemoveService_0(ctx context.Context, marshaler runtime.Marshaler, client ServicesServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq RemoveServiceRequest - metadata runtime.ServerMetadata - err error - ) - if req.Body != nil { - _, _ = io.Copy(io.Discard, req.Body) - } - val, ok := pathParams["service_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "service_id") - } - protoReq.ServiceId, err = runtime.String(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "service_id", err) - } - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_ServicesService_RemoveService_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - msg, err := client.RemoveService(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_ServicesService_RemoveService_0(ctx context.Context, marshaler runtime.Marshaler, server ServicesServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq RemoveServiceRequest - metadata runtime.ServerMetadata - err error - ) - val, ok := pathParams["service_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "service_id") - } - protoReq.ServiceId, err = runtime.String(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "service_id", err) - } - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_ServicesService_RemoveService_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - msg, err := server.RemoveService(ctx, &protoReq) - return msg, metadata, err -} - -func request_ServicesService_ChangeService_0(ctx context.Context, marshaler runtime.Marshaler, client ServicesServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq ChangeServiceRequest - metadata runtime.ServerMetadata - err error - ) - 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) - } - val, ok := pathParams["service_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "service_id") - } - protoReq.ServiceId, err = runtime.String(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "service_id", err) - } - msg, err := client.ChangeService(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_ServicesService_ChangeService_0(ctx context.Context, marshaler runtime.Marshaler, server ServicesServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq ChangeServiceRequest - metadata runtime.ServerMetadata - err error - ) - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - val, ok := pathParams["service_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "service_id") - } - protoReq.ServiceId, err = runtime.String(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "service_id", err) - } - msg, err := server.ChangeService(ctx, &protoReq) - return msg, metadata, err -} - -// RegisterServicesServiceHandlerServer registers the http handlers for service ServicesService to "mux". -// UnaryRPC :call ServicesServiceServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterServicesServiceHandlerFromEndpoint instead. -// GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call. -func RegisterServicesServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ServicesServiceServer) error { - mux.Handle(http.MethodGet, pattern_ServicesService_ListServices_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, "/inventory.v1.ServicesService/ListServices", runtime.WithHTTPPathPattern("/v1/inventory/services")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_ServicesService_ListServices_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_ServicesService_ListServices_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPost, pattern_ServicesService_ListActiveServiceTypes_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, "/inventory.v1.ServicesService/ListActiveServiceTypes", runtime.WithHTTPPathPattern("/v1/inventory/services:getTypes")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_ServicesService_ListActiveServiceTypes_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_ServicesService_ListActiveServiceTypes_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodGet, pattern_ServicesService_GetService_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, "/inventory.v1.ServicesService/GetService", runtime.WithHTTPPathPattern("/v1/inventory/services/{service_id}")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_ServicesService_GetService_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_ServicesService_GetService_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPost, pattern_ServicesService_AddService_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, "/inventory.v1.ServicesService/AddService", runtime.WithHTTPPathPattern("/v1/inventory/services")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_ServicesService_AddService_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_ServicesService_AddService_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodDelete, pattern_ServicesService_RemoveService_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, "/inventory.v1.ServicesService/RemoveService", runtime.WithHTTPPathPattern("/v1/inventory/services/{service_id}")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_ServicesService_RemoveService_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_ServicesService_RemoveService_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPut, pattern_ServicesService_ChangeService_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/inventory.v1.ServicesService/ChangeService", runtime.WithHTTPPathPattern("/v1/inventory/services/{service_id}")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_ServicesService_ChangeService_0(annotatedContext, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_ServicesService_ChangeService_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - return nil -} - -// RegisterServicesServiceHandlerFromEndpoint is same as RegisterServicesServiceHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterServicesServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.NewClient(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - return RegisterServicesServiceHandler(ctx, mux, conn) -} - -// RegisterServicesServiceHandler registers the http handlers for service ServicesService to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterServicesServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterServicesServiceHandlerClient(ctx, mux, NewServicesServiceClient(conn)) -} - -// RegisterServicesServiceHandlerClient registers the http handlers for service ServicesService -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ServicesServiceClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ServicesServiceClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "ServicesServiceClient" to call the correct interceptors. This client ignores the HTTP middlewares. -func RegisterServicesServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ServicesServiceClient) error { - mux.Handle(http.MethodGet, pattern_ServicesService_ListServices_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, "/inventory.v1.ServicesService/ListServices", runtime.WithHTTPPathPattern("/v1/inventory/services")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_ServicesService_ListServices_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_ServicesService_ListServices_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPost, pattern_ServicesService_ListActiveServiceTypes_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, "/inventory.v1.ServicesService/ListActiveServiceTypes", runtime.WithHTTPPathPattern("/v1/inventory/services:getTypes")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_ServicesService_ListActiveServiceTypes_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_ServicesService_ListActiveServiceTypes_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodGet, pattern_ServicesService_GetService_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, "/inventory.v1.ServicesService/GetService", runtime.WithHTTPPathPattern("/v1/inventory/services/{service_id}")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_ServicesService_GetService_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_ServicesService_GetService_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPost, pattern_ServicesService_AddService_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, "/inventory.v1.ServicesService/AddService", runtime.WithHTTPPathPattern("/v1/inventory/services")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_ServicesService_AddService_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_ServicesService_AddService_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodDelete, pattern_ServicesService_RemoveService_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, "/inventory.v1.ServicesService/RemoveService", runtime.WithHTTPPathPattern("/v1/inventory/services/{service_id}")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_ServicesService_RemoveService_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_ServicesService_RemoveService_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPut, pattern_ServicesService_ChangeService_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/inventory.v1.ServicesService/ChangeService", runtime.WithHTTPPathPattern("/v1/inventory/services/{service_id}")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_ServicesService_ChangeService_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_ServicesService_ChangeService_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - return nil -} - -var ( - pattern_ServicesService_ListServices_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "inventory", "services"}, "")) - pattern_ServicesService_ListActiveServiceTypes_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "inventory", "services"}, "getTypes")) - pattern_ServicesService_GetService_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "inventory", "services", "service_id"}, "")) - pattern_ServicesService_AddService_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "inventory", "services"}, "")) - pattern_ServicesService_RemoveService_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "inventory", "services", "service_id"}, "")) - pattern_ServicesService_ChangeService_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "inventory", "services", "service_id"}, "")) -) - -var ( - forward_ServicesService_ListServices_0 = runtime.ForwardResponseMessage - forward_ServicesService_ListActiveServiceTypes_0 = runtime.ForwardResponseMessage - forward_ServicesService_GetService_0 = runtime.ForwardResponseMessage - forward_ServicesService_AddService_0 = runtime.ForwardResponseMessage - forward_ServicesService_RemoveService_0 = runtime.ForwardResponseMessage - forward_ServicesService_ChangeService_0 = runtime.ForwardResponseMessage -) diff --git a/api/inventory/v1/services.pb.validate.go b/api/inventory/v1/services.pb.validate.go deleted file mode 100644 index 5e1af4d587b..00000000000 --- a/api/inventory/v1/services.pb.validate.go +++ /dev/null @@ -1,4563 +0,0 @@ -// Code generated by protoc-gen-validate. DO NOT EDIT. -// source: inventory/v1/services.proto - -package inventoryv1 - -import ( - "bytes" - "errors" - "fmt" - "net" - "net/mail" - "net/url" - "regexp" - "sort" - "strings" - "time" - "unicode/utf8" - - "google.golang.org/protobuf/types/known/anypb" -) - -// ensure the imports are used -var ( - _ = bytes.MinRead - _ = errors.New("") - _ = fmt.Print - _ = utf8.UTFMax - _ = (*regexp.Regexp)(nil) - _ = (*strings.Reader)(nil) - _ = net.IPv4len - _ = time.Duration(0) - _ = (*url.URL)(nil) - _ = (*mail.Address)(nil) - _ = anypb.Any{} - _ = sort.Sort -) - -// Validate checks the field values on MySQLService 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 *MySQLService) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on MySQLService 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 MySQLServiceMultiError, or -// nil if none found. -func (m *MySQLService) ValidateAll() error { - return m.validate(true) -} - -func (m *MySQLService) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for ServiceId - - // no validation rules for ServiceName - - // no validation rules for NodeId - - // no validation rules for Address - - // no validation rules for Port - - // no validation rules for Socket - - // no validation rules for Environment - - // no validation rules for Cluster - - // no validation rules for ReplicationSet - - // no validation rules for CustomLabels - - // no validation rules for Version - - // no validation rules for ExtraDsnParams - - if len(errors) > 0 { - return MySQLServiceMultiError(errors) - } - - return nil -} - -// MySQLServiceMultiError is an error wrapping multiple validation errors -// returned by MySQLService.ValidateAll() if the designated constraints aren't met. -type MySQLServiceMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m MySQLServiceMultiError) 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 MySQLServiceMultiError) AllErrors() []error { return m } - -// MySQLServiceValidationError is the validation error returned by -// MySQLService.Validate if the designated constraints aren't met. -type MySQLServiceValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e MySQLServiceValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e MySQLServiceValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e MySQLServiceValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e MySQLServiceValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e MySQLServiceValidationError) ErrorName() string { return "MySQLServiceValidationError" } - -// Error satisfies the builtin error interface -func (e MySQLServiceValidationError) 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 %sMySQLService.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = MySQLServiceValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = MySQLServiceValidationError{} - -// Validate checks the field values on MongoDBService 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 *MongoDBService) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on MongoDBService 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 MongoDBServiceMultiError, -// or nil if none found. -func (m *MongoDBService) ValidateAll() error { - return m.validate(true) -} - -func (m *MongoDBService) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for ServiceId - - // no validation rules for ServiceName - - // no validation rules for NodeId - - // no validation rules for Address - - // no validation rules for Port - - // no validation rules for Socket - - // no validation rules for Environment - - // no validation rules for Cluster - - // no validation rules for ReplicationSet - - // no validation rules for CustomLabels - - // no validation rules for Version - - if len(errors) > 0 { - return MongoDBServiceMultiError(errors) - } - - return nil -} - -// MongoDBServiceMultiError is an error wrapping multiple validation errors -// returned by MongoDBService.ValidateAll() if the designated constraints -// aren't met. -type MongoDBServiceMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m MongoDBServiceMultiError) 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 MongoDBServiceMultiError) AllErrors() []error { return m } - -// MongoDBServiceValidationError is the validation error returned by -// MongoDBService.Validate if the designated constraints aren't met. -type MongoDBServiceValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e MongoDBServiceValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e MongoDBServiceValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e MongoDBServiceValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e MongoDBServiceValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e MongoDBServiceValidationError) ErrorName() string { return "MongoDBServiceValidationError" } - -// Error satisfies the builtin error interface -func (e MongoDBServiceValidationError) 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 %sMongoDBService.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = MongoDBServiceValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = MongoDBServiceValidationError{} - -// Validate checks the field values on PostgreSQLService 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 *PostgreSQLService) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on PostgreSQLService 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 -// PostgreSQLServiceMultiError, or nil if none found. -func (m *PostgreSQLService) ValidateAll() error { - return m.validate(true) -} - -func (m *PostgreSQLService) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for ServiceId - - // no validation rules for ServiceName - - // no validation rules for DatabaseName - - // no validation rules for NodeId - - // no validation rules for Address - - // no validation rules for Port - - // no validation rules for Socket - - // no validation rules for Environment - - // no validation rules for Cluster - - // no validation rules for ReplicationSet - - // no validation rules for CustomLabels - - // no validation rules for Version - - // no validation rules for AutoDiscoveryLimit - - if len(errors) > 0 { - return PostgreSQLServiceMultiError(errors) - } - - return nil -} - -// PostgreSQLServiceMultiError is an error wrapping multiple validation errors -// returned by PostgreSQLService.ValidateAll() if the designated constraints -// aren't met. -type PostgreSQLServiceMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m PostgreSQLServiceMultiError) 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 PostgreSQLServiceMultiError) AllErrors() []error { return m } - -// PostgreSQLServiceValidationError is the validation error returned by -// PostgreSQLService.Validate if the designated constraints aren't met. -type PostgreSQLServiceValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e PostgreSQLServiceValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e PostgreSQLServiceValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e PostgreSQLServiceValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e PostgreSQLServiceValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e PostgreSQLServiceValidationError) ErrorName() string { - return "PostgreSQLServiceValidationError" -} - -// Error satisfies the builtin error interface -func (e PostgreSQLServiceValidationError) 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 %sPostgreSQLService.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = PostgreSQLServiceValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = PostgreSQLServiceValidationError{} - -// Validate checks the field values on ValkeyService 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 *ValkeyService) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ValkeyService 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 ValkeyServiceMultiError, or -// nil if none found. -func (m *ValkeyService) ValidateAll() error { - return m.validate(true) -} - -func (m *ValkeyService) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for ServiceId - - // no validation rules for ServiceName - - // no validation rules for NodeId - - // no validation rules for Address - - // no validation rules for Port - - // no validation rules for Socket - - // no validation rules for Environment - - // no validation rules for Cluster - - // no validation rules for ReplicationSet - - // no validation rules for CustomLabels - - // no validation rules for Version - - if len(errors) > 0 { - return ValkeyServiceMultiError(errors) - } - - return nil -} - -// ValkeyServiceMultiError is an error wrapping multiple validation errors -// returned by ValkeyService.ValidateAll() if the designated constraints -// aren't met. -type ValkeyServiceMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ValkeyServiceMultiError) 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 ValkeyServiceMultiError) AllErrors() []error { return m } - -// ValkeyServiceValidationError is the validation error returned by -// ValkeyService.Validate if the designated constraints aren't met. -type ValkeyServiceValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ValkeyServiceValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ValkeyServiceValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ValkeyServiceValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ValkeyServiceValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ValkeyServiceValidationError) ErrorName() string { return "ValkeyServiceValidationError" } - -// Error satisfies the builtin error interface -func (e ValkeyServiceValidationError) 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 %sValkeyService.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ValkeyServiceValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ValkeyServiceValidationError{} - -// Validate checks the field values on ProxySQLService 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 *ProxySQLService) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ProxySQLService 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 -// ProxySQLServiceMultiError, or nil if none found. -func (m *ProxySQLService) ValidateAll() error { - return m.validate(true) -} - -func (m *ProxySQLService) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for ServiceId - - // no validation rules for ServiceName - - // no validation rules for NodeId - - // no validation rules for Address - - // no validation rules for Port - - // no validation rules for Socket - - // no validation rules for Environment - - // no validation rules for Cluster - - // no validation rules for ReplicationSet - - // no validation rules for CustomLabels - - // no validation rules for Version - - if len(errors) > 0 { - return ProxySQLServiceMultiError(errors) - } - - return nil -} - -// ProxySQLServiceMultiError is an error wrapping multiple validation errors -// returned by ProxySQLService.ValidateAll() if the designated constraints -// aren't met. -type ProxySQLServiceMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ProxySQLServiceMultiError) 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 ProxySQLServiceMultiError) AllErrors() []error { return m } - -// ProxySQLServiceValidationError is the validation error returned by -// ProxySQLService.Validate if the designated constraints aren't met. -type ProxySQLServiceValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ProxySQLServiceValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ProxySQLServiceValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ProxySQLServiceValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ProxySQLServiceValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ProxySQLServiceValidationError) ErrorName() string { return "ProxySQLServiceValidationError" } - -// Error satisfies the builtin error interface -func (e ProxySQLServiceValidationError) 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 %sProxySQLService.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ProxySQLServiceValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ProxySQLServiceValidationError{} - -// Validate checks the field values on HAProxyService 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 *HAProxyService) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on HAProxyService 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 HAProxyServiceMultiError, -// or nil if none found. -func (m *HAProxyService) ValidateAll() error { - return m.validate(true) -} - -func (m *HAProxyService) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for ServiceId - - // no validation rules for ServiceName - - // no validation rules for NodeId - - // no validation rules for Environment - - // no validation rules for Cluster - - // no validation rules for ReplicationSet - - // no validation rules for CustomLabels - - if len(errors) > 0 { - return HAProxyServiceMultiError(errors) - } - - return nil -} - -// HAProxyServiceMultiError is an error wrapping multiple validation errors -// returned by HAProxyService.ValidateAll() if the designated constraints -// aren't met. -type HAProxyServiceMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m HAProxyServiceMultiError) 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 HAProxyServiceMultiError) AllErrors() []error { return m } - -// HAProxyServiceValidationError is the validation error returned by -// HAProxyService.Validate if the designated constraints aren't met. -type HAProxyServiceValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e HAProxyServiceValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e HAProxyServiceValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e HAProxyServiceValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e HAProxyServiceValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e HAProxyServiceValidationError) ErrorName() string { return "HAProxyServiceValidationError" } - -// Error satisfies the builtin error interface -func (e HAProxyServiceValidationError) 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 %sHAProxyService.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = HAProxyServiceValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = HAProxyServiceValidationError{} - -// Validate checks the field values on ExternalService 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 *ExternalService) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ExternalService 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 -// ExternalServiceMultiError, or nil if none found. -func (m *ExternalService) ValidateAll() error { - return m.validate(true) -} - -func (m *ExternalService) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for ServiceId - - // no validation rules for ServiceName - - // no validation rules for NodeId - - // no validation rules for Environment - - // no validation rules for Cluster - - // no validation rules for ReplicationSet - - // no validation rules for CustomLabels - - // no validation rules for Group - - if len(errors) > 0 { - return ExternalServiceMultiError(errors) - } - - return nil -} - -// ExternalServiceMultiError is an error wrapping multiple validation errors -// returned by ExternalService.ValidateAll() if the designated constraints -// aren't met. -type ExternalServiceMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ExternalServiceMultiError) 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 ExternalServiceMultiError) AllErrors() []error { return m } - -// ExternalServiceValidationError is the validation error returned by -// ExternalService.Validate if the designated constraints aren't met. -type ExternalServiceValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ExternalServiceValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ExternalServiceValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ExternalServiceValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ExternalServiceValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ExternalServiceValidationError) ErrorName() string { return "ExternalServiceValidationError" } - -// Error satisfies the builtin error interface -func (e ExternalServiceValidationError) 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 %sExternalService.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ExternalServiceValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ExternalServiceValidationError{} - -// Validate checks the field values on ListServicesRequest 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 *ListServicesRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ListServicesRequest 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 -// ListServicesRequestMultiError, or nil if none found. -func (m *ListServicesRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *ListServicesRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for NodeId - - // no validation rules for ServiceType - - // no validation rules for ExternalGroup - - if len(errors) > 0 { - return ListServicesRequestMultiError(errors) - } - - return nil -} - -// ListServicesRequestMultiError is an error wrapping multiple validation -// errors returned by ListServicesRequest.ValidateAll() if the designated -// constraints aren't met. -type ListServicesRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ListServicesRequestMultiError) 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 ListServicesRequestMultiError) AllErrors() []error { return m } - -// ListServicesRequestValidationError is the validation error returned by -// ListServicesRequest.Validate if the designated constraints aren't met. -type ListServicesRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ListServicesRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ListServicesRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ListServicesRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ListServicesRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ListServicesRequestValidationError) ErrorName() string { - return "ListServicesRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e ListServicesRequestValidationError) 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 %sListServicesRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ListServicesRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ListServicesRequestValidationError{} - -// Validate checks the field values on ListServicesResponse 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 *ListServicesResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ListServicesResponse 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 -// ListServicesResponseMultiError, or nil if none found. -func (m *ListServicesResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *ListServicesResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - for idx, item := range m.GetMysql() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ListServicesResponseValidationError{ - field: fmt.Sprintf("Mysql[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ListServicesResponseValidationError{ - field: fmt.Sprintf("Mysql[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ListServicesResponseValidationError{ - field: fmt.Sprintf("Mysql[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - for idx, item := range m.GetMongodb() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ListServicesResponseValidationError{ - field: fmt.Sprintf("Mongodb[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ListServicesResponseValidationError{ - field: fmt.Sprintf("Mongodb[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ListServicesResponseValidationError{ - field: fmt.Sprintf("Mongodb[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - for idx, item := range m.GetPostgresql() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ListServicesResponseValidationError{ - field: fmt.Sprintf("Postgresql[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ListServicesResponseValidationError{ - field: fmt.Sprintf("Postgresql[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ListServicesResponseValidationError{ - field: fmt.Sprintf("Postgresql[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - for idx, item := range m.GetProxysql() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ListServicesResponseValidationError{ - field: fmt.Sprintf("Proxysql[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ListServicesResponseValidationError{ - field: fmt.Sprintf("Proxysql[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ListServicesResponseValidationError{ - field: fmt.Sprintf("Proxysql[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - for idx, item := range m.GetHaproxy() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ListServicesResponseValidationError{ - field: fmt.Sprintf("Haproxy[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ListServicesResponseValidationError{ - field: fmt.Sprintf("Haproxy[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ListServicesResponseValidationError{ - field: fmt.Sprintf("Haproxy[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - for idx, item := range m.GetExternal() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ListServicesResponseValidationError{ - field: fmt.Sprintf("External[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ListServicesResponseValidationError{ - field: fmt.Sprintf("External[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ListServicesResponseValidationError{ - field: fmt.Sprintf("External[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - for idx, item := range m.GetValkey() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ListServicesResponseValidationError{ - field: fmt.Sprintf("Valkey[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ListServicesResponseValidationError{ - field: fmt.Sprintf("Valkey[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ListServicesResponseValidationError{ - field: fmt.Sprintf("Valkey[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - if len(errors) > 0 { - return ListServicesResponseMultiError(errors) - } - - return nil -} - -// ListServicesResponseMultiError is an error wrapping multiple validation -// errors returned by ListServicesResponse.ValidateAll() if the designated -// constraints aren't met. -type ListServicesResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ListServicesResponseMultiError) 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 ListServicesResponseMultiError) AllErrors() []error { return m } - -// ListServicesResponseValidationError is the validation error returned by -// ListServicesResponse.Validate if the designated constraints aren't met. -type ListServicesResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ListServicesResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ListServicesResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ListServicesResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ListServicesResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ListServicesResponseValidationError) ErrorName() string { - return "ListServicesResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e ListServicesResponseValidationError) 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 %sListServicesResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ListServicesResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ListServicesResponseValidationError{} - -// Validate checks the field values on ListActiveServiceTypesRequest 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 *ListActiveServiceTypesRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ListActiveServiceTypesRequest 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 -// ListActiveServiceTypesRequestMultiError, or nil if none found. -func (m *ListActiveServiceTypesRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *ListActiveServiceTypesRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return ListActiveServiceTypesRequestMultiError(errors) - } - - return nil -} - -// ListActiveServiceTypesRequestMultiError is an error wrapping multiple -// validation errors returned by ListActiveServiceTypesRequest.ValidateAll() -// if the designated constraints aren't met. -type ListActiveServiceTypesRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ListActiveServiceTypesRequestMultiError) 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 ListActiveServiceTypesRequestMultiError) AllErrors() []error { return m } - -// ListActiveServiceTypesRequestValidationError is the validation error -// returned by ListActiveServiceTypesRequest.Validate if the designated -// constraints aren't met. -type ListActiveServiceTypesRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ListActiveServiceTypesRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ListActiveServiceTypesRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ListActiveServiceTypesRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ListActiveServiceTypesRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ListActiveServiceTypesRequestValidationError) ErrorName() string { - return "ListActiveServiceTypesRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e ListActiveServiceTypesRequestValidationError) 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 %sListActiveServiceTypesRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ListActiveServiceTypesRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ListActiveServiceTypesRequestValidationError{} - -// Validate checks the field values on ListActiveServiceTypesResponse 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 *ListActiveServiceTypesResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ListActiveServiceTypesResponse 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 -// ListActiveServiceTypesResponseMultiError, or nil if none found. -func (m *ListActiveServiceTypesResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *ListActiveServiceTypesResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return ListActiveServiceTypesResponseMultiError(errors) - } - - return nil -} - -// ListActiveServiceTypesResponseMultiError is an error wrapping multiple -// validation errors returned by ListActiveServiceTypesResponse.ValidateAll() -// if the designated constraints aren't met. -type ListActiveServiceTypesResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ListActiveServiceTypesResponseMultiError) 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 ListActiveServiceTypesResponseMultiError) AllErrors() []error { return m } - -// ListActiveServiceTypesResponseValidationError is the validation error -// returned by ListActiveServiceTypesResponse.Validate if the designated -// constraints aren't met. -type ListActiveServiceTypesResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ListActiveServiceTypesResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ListActiveServiceTypesResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ListActiveServiceTypesResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ListActiveServiceTypesResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ListActiveServiceTypesResponseValidationError) ErrorName() string { - return "ListActiveServiceTypesResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e ListActiveServiceTypesResponseValidationError) 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 %sListActiveServiceTypesResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ListActiveServiceTypesResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ListActiveServiceTypesResponseValidationError{} - -// Validate checks the field values on GetServiceRequest 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 *GetServiceRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on GetServiceRequest 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 -// GetServiceRequestMultiError, or nil if none found. -func (m *GetServiceRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *GetServiceRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetServiceId()) < 1 { - err := GetServiceRequestValidationError{ - field: "ServiceId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if len(errors) > 0 { - return GetServiceRequestMultiError(errors) - } - - return nil -} - -// GetServiceRequestMultiError is an error wrapping multiple validation errors -// returned by GetServiceRequest.ValidateAll() if the designated constraints -// aren't met. -type GetServiceRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m GetServiceRequestMultiError) 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 GetServiceRequestMultiError) AllErrors() []error { return m } - -// GetServiceRequestValidationError is the validation error returned by -// GetServiceRequest.Validate if the designated constraints aren't met. -type GetServiceRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e GetServiceRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e GetServiceRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e GetServiceRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e GetServiceRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e GetServiceRequestValidationError) ErrorName() string { - return "GetServiceRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e GetServiceRequestValidationError) 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 %sGetServiceRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = GetServiceRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = GetServiceRequestValidationError{} - -// Validate checks the field values on GetServiceResponse 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 *GetServiceResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on GetServiceResponse 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 -// GetServiceResponseMultiError, or nil if none found. -func (m *GetServiceResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *GetServiceResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - switch v := m.Service.(type) { - case *GetServiceResponse_Mysql: - if v == nil { - err := GetServiceResponseValidationError{ - field: "Service", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetMysql()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GetServiceResponseValidationError{ - field: "Mysql", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GetServiceResponseValidationError{ - field: "Mysql", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMysql()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GetServiceResponseValidationError{ - field: "Mysql", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *GetServiceResponse_Mongodb: - if v == nil { - err := GetServiceResponseValidationError{ - field: "Service", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetMongodb()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GetServiceResponseValidationError{ - field: "Mongodb", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GetServiceResponseValidationError{ - field: "Mongodb", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMongodb()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GetServiceResponseValidationError{ - field: "Mongodb", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *GetServiceResponse_Postgresql: - if v == nil { - err := GetServiceResponseValidationError{ - field: "Service", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetPostgresql()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GetServiceResponseValidationError{ - field: "Postgresql", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GetServiceResponseValidationError{ - field: "Postgresql", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetPostgresql()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GetServiceResponseValidationError{ - field: "Postgresql", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *GetServiceResponse_Proxysql: - if v == nil { - err := GetServiceResponseValidationError{ - field: "Service", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetProxysql()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GetServiceResponseValidationError{ - field: "Proxysql", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GetServiceResponseValidationError{ - field: "Proxysql", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetProxysql()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GetServiceResponseValidationError{ - field: "Proxysql", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *GetServiceResponse_Haproxy: - if v == nil { - err := GetServiceResponseValidationError{ - field: "Service", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetHaproxy()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GetServiceResponseValidationError{ - field: "Haproxy", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GetServiceResponseValidationError{ - field: "Haproxy", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetHaproxy()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GetServiceResponseValidationError{ - field: "Haproxy", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *GetServiceResponse_External: - if v == nil { - err := GetServiceResponseValidationError{ - field: "Service", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetExternal()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GetServiceResponseValidationError{ - field: "External", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GetServiceResponseValidationError{ - field: "External", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetExternal()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GetServiceResponseValidationError{ - field: "External", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *GetServiceResponse_Valkey: - if v == nil { - err := GetServiceResponseValidationError{ - field: "Service", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetValkey()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GetServiceResponseValidationError{ - field: "Valkey", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GetServiceResponseValidationError{ - field: "Valkey", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetValkey()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GetServiceResponseValidationError{ - field: "Valkey", - reason: "embedded message failed validation", - cause: err, - } - } - } - - default: - _ = v // ensures v is used - } - - if len(errors) > 0 { - return GetServiceResponseMultiError(errors) - } - - return nil -} - -// GetServiceResponseMultiError is an error wrapping multiple validation errors -// returned by GetServiceResponse.ValidateAll() if the designated constraints -// aren't met. -type GetServiceResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m GetServiceResponseMultiError) 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 GetServiceResponseMultiError) AllErrors() []error { return m } - -// GetServiceResponseValidationError is the validation error returned by -// GetServiceResponse.Validate if the designated constraints aren't met. -type GetServiceResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e GetServiceResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e GetServiceResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e GetServiceResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e GetServiceResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e GetServiceResponseValidationError) ErrorName() string { - return "GetServiceResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e GetServiceResponseValidationError) 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 %sGetServiceResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = GetServiceResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = GetServiceResponseValidationError{} - -// Validate checks the field values on AddServiceRequest 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 *AddServiceRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on AddServiceRequest 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 -// AddServiceRequestMultiError, or nil if none found. -func (m *AddServiceRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *AddServiceRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - switch v := m.Service.(type) { - case *AddServiceRequest_Mysql: - if v == nil { - err := AddServiceRequestValidationError{ - field: "Service", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetMysql()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AddServiceRequestValidationError{ - field: "Mysql", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AddServiceRequestValidationError{ - field: "Mysql", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMysql()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AddServiceRequestValidationError{ - field: "Mysql", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *AddServiceRequest_Mongodb: - if v == nil { - err := AddServiceRequestValidationError{ - field: "Service", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetMongodb()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AddServiceRequestValidationError{ - field: "Mongodb", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AddServiceRequestValidationError{ - field: "Mongodb", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMongodb()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AddServiceRequestValidationError{ - field: "Mongodb", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *AddServiceRequest_Postgresql: - if v == nil { - err := AddServiceRequestValidationError{ - field: "Service", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetPostgresql()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AddServiceRequestValidationError{ - field: "Postgresql", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AddServiceRequestValidationError{ - field: "Postgresql", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetPostgresql()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AddServiceRequestValidationError{ - field: "Postgresql", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *AddServiceRequest_Proxysql: - if v == nil { - err := AddServiceRequestValidationError{ - field: "Service", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetProxysql()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AddServiceRequestValidationError{ - field: "Proxysql", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AddServiceRequestValidationError{ - field: "Proxysql", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetProxysql()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AddServiceRequestValidationError{ - field: "Proxysql", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *AddServiceRequest_Haproxy: - if v == nil { - err := AddServiceRequestValidationError{ - field: "Service", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetHaproxy()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AddServiceRequestValidationError{ - field: "Haproxy", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AddServiceRequestValidationError{ - field: "Haproxy", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetHaproxy()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AddServiceRequestValidationError{ - field: "Haproxy", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *AddServiceRequest_External: - if v == nil { - err := AddServiceRequestValidationError{ - field: "Service", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetExternal()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AddServiceRequestValidationError{ - field: "External", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AddServiceRequestValidationError{ - field: "External", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetExternal()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AddServiceRequestValidationError{ - field: "External", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *AddServiceRequest_Valkey: - if v == nil { - err := AddServiceRequestValidationError{ - field: "Service", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetValkey()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AddServiceRequestValidationError{ - field: "Valkey", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AddServiceRequestValidationError{ - field: "Valkey", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetValkey()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AddServiceRequestValidationError{ - field: "Valkey", - reason: "embedded message failed validation", - cause: err, - } - } - } - - default: - _ = v // ensures v is used - } - - if len(errors) > 0 { - return AddServiceRequestMultiError(errors) - } - - return nil -} - -// AddServiceRequestMultiError is an error wrapping multiple validation errors -// returned by AddServiceRequest.ValidateAll() if the designated constraints -// aren't met. -type AddServiceRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m AddServiceRequestMultiError) 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 AddServiceRequestMultiError) AllErrors() []error { return m } - -// AddServiceRequestValidationError is the validation error returned by -// AddServiceRequest.Validate if the designated constraints aren't met. -type AddServiceRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e AddServiceRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e AddServiceRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e AddServiceRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e AddServiceRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e AddServiceRequestValidationError) ErrorName() string { - return "AddServiceRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e AddServiceRequestValidationError) 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 %sAddServiceRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = AddServiceRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = AddServiceRequestValidationError{} - -// Validate checks the field values on AddServiceResponse 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 *AddServiceResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on AddServiceResponse 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 -// AddServiceResponseMultiError, or nil if none found. -func (m *AddServiceResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *AddServiceResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - switch v := m.Service.(type) { - case *AddServiceResponse_Mysql: - if v == nil { - err := AddServiceResponseValidationError{ - field: "Service", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetMysql()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AddServiceResponseValidationError{ - field: "Mysql", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AddServiceResponseValidationError{ - field: "Mysql", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMysql()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AddServiceResponseValidationError{ - field: "Mysql", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *AddServiceResponse_Mongodb: - if v == nil { - err := AddServiceResponseValidationError{ - field: "Service", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetMongodb()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AddServiceResponseValidationError{ - field: "Mongodb", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AddServiceResponseValidationError{ - field: "Mongodb", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMongodb()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AddServiceResponseValidationError{ - field: "Mongodb", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *AddServiceResponse_Postgresql: - if v == nil { - err := AddServiceResponseValidationError{ - field: "Service", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetPostgresql()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AddServiceResponseValidationError{ - field: "Postgresql", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AddServiceResponseValidationError{ - field: "Postgresql", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetPostgresql()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AddServiceResponseValidationError{ - field: "Postgresql", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *AddServiceResponse_Proxysql: - if v == nil { - err := AddServiceResponseValidationError{ - field: "Service", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetProxysql()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AddServiceResponseValidationError{ - field: "Proxysql", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AddServiceResponseValidationError{ - field: "Proxysql", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetProxysql()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AddServiceResponseValidationError{ - field: "Proxysql", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *AddServiceResponse_Haproxy: - if v == nil { - err := AddServiceResponseValidationError{ - field: "Service", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetHaproxy()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AddServiceResponseValidationError{ - field: "Haproxy", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AddServiceResponseValidationError{ - field: "Haproxy", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetHaproxy()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AddServiceResponseValidationError{ - field: "Haproxy", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *AddServiceResponse_External: - if v == nil { - err := AddServiceResponseValidationError{ - field: "Service", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetExternal()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AddServiceResponseValidationError{ - field: "External", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AddServiceResponseValidationError{ - field: "External", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetExternal()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AddServiceResponseValidationError{ - field: "External", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *AddServiceResponse_Valkey: - if v == nil { - err := AddServiceResponseValidationError{ - field: "Service", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetValkey()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AddServiceResponseValidationError{ - field: "Valkey", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AddServiceResponseValidationError{ - field: "Valkey", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetValkey()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AddServiceResponseValidationError{ - field: "Valkey", - reason: "embedded message failed validation", - cause: err, - } - } - } - - default: - _ = v // ensures v is used - } - - if len(errors) > 0 { - return AddServiceResponseMultiError(errors) - } - - return nil -} - -// AddServiceResponseMultiError is an error wrapping multiple validation errors -// returned by AddServiceResponse.ValidateAll() if the designated constraints -// aren't met. -type AddServiceResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m AddServiceResponseMultiError) 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 AddServiceResponseMultiError) AllErrors() []error { return m } - -// AddServiceResponseValidationError is the validation error returned by -// AddServiceResponse.Validate if the designated constraints aren't met. -type AddServiceResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e AddServiceResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e AddServiceResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e AddServiceResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e AddServiceResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e AddServiceResponseValidationError) ErrorName() string { - return "AddServiceResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e AddServiceResponseValidationError) 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 %sAddServiceResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = AddServiceResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = AddServiceResponseValidationError{} - -// Validate checks the field values on AddMySQLServiceParams 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 *AddMySQLServiceParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on AddMySQLServiceParams 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 -// AddMySQLServiceParamsMultiError, or nil if none found. -func (m *AddMySQLServiceParams) ValidateAll() error { - return m.validate(true) -} - -func (m *AddMySQLServiceParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetServiceName()) < 1 { - err := AddMySQLServiceParamsValidationError{ - field: "ServiceName", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if utf8.RuneCountInString(m.GetNodeId()) < 1 { - err := AddMySQLServiceParamsValidationError{ - field: "NodeId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for Address - - // no validation rules for Port - - // no validation rules for Socket - - // no validation rules for Environment - - // no validation rules for Cluster - - // no validation rules for ReplicationSet - - // no validation rules for CustomLabels - - // no validation rules for ExtraDsnParams - - if len(errors) > 0 { - return AddMySQLServiceParamsMultiError(errors) - } - - return nil -} - -// AddMySQLServiceParamsMultiError is an error wrapping multiple validation -// errors returned by AddMySQLServiceParams.ValidateAll() if the designated -// constraints aren't met. -type AddMySQLServiceParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m AddMySQLServiceParamsMultiError) 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 AddMySQLServiceParamsMultiError) AllErrors() []error { return m } - -// AddMySQLServiceParamsValidationError is the validation error returned by -// AddMySQLServiceParams.Validate if the designated constraints aren't met. -type AddMySQLServiceParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e AddMySQLServiceParamsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e AddMySQLServiceParamsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e AddMySQLServiceParamsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e AddMySQLServiceParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e AddMySQLServiceParamsValidationError) ErrorName() string { - return "AddMySQLServiceParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e AddMySQLServiceParamsValidationError) 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 %sAddMySQLServiceParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = AddMySQLServiceParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = AddMySQLServiceParamsValidationError{} - -// Validate checks the field values on AddMongoDBServiceParams 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 *AddMongoDBServiceParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on AddMongoDBServiceParams 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 -// AddMongoDBServiceParamsMultiError, or nil if none found. -func (m *AddMongoDBServiceParams) ValidateAll() error { - return m.validate(true) -} - -func (m *AddMongoDBServiceParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetServiceName()) < 1 { - err := AddMongoDBServiceParamsValidationError{ - field: "ServiceName", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if utf8.RuneCountInString(m.GetNodeId()) < 1 { - err := AddMongoDBServiceParamsValidationError{ - field: "NodeId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for Address - - // no validation rules for Port - - // no validation rules for Socket - - // no validation rules for Environment - - // no validation rules for Cluster - - // no validation rules for ReplicationSet - - // no validation rules for CustomLabels - - if len(errors) > 0 { - return AddMongoDBServiceParamsMultiError(errors) - } - - return nil -} - -// AddMongoDBServiceParamsMultiError is an error wrapping multiple validation -// errors returned by AddMongoDBServiceParams.ValidateAll() if the designated -// constraints aren't met. -type AddMongoDBServiceParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m AddMongoDBServiceParamsMultiError) 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 AddMongoDBServiceParamsMultiError) AllErrors() []error { return m } - -// AddMongoDBServiceParamsValidationError is the validation error returned by -// AddMongoDBServiceParams.Validate if the designated constraints aren't met. -type AddMongoDBServiceParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e AddMongoDBServiceParamsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e AddMongoDBServiceParamsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e AddMongoDBServiceParamsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e AddMongoDBServiceParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e AddMongoDBServiceParamsValidationError) ErrorName() string { - return "AddMongoDBServiceParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e AddMongoDBServiceParamsValidationError) 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 %sAddMongoDBServiceParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = AddMongoDBServiceParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = AddMongoDBServiceParamsValidationError{} - -// Validate checks the field values on AddPostgreSQLServiceParams 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 *AddPostgreSQLServiceParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on AddPostgreSQLServiceParams 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 -// AddPostgreSQLServiceParamsMultiError, or nil if none found. -func (m *AddPostgreSQLServiceParams) ValidateAll() error { - return m.validate(true) -} - -func (m *AddPostgreSQLServiceParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetServiceName()) < 1 { - err := AddPostgreSQLServiceParamsValidationError{ - field: "ServiceName", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if utf8.RuneCountInString(m.GetNodeId()) < 1 { - err := AddPostgreSQLServiceParamsValidationError{ - field: "NodeId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for Address - - // no validation rules for Port - - // no validation rules for Socket - - // no validation rules for Environment - - // no validation rules for Cluster - - // no validation rules for ReplicationSet - - // no validation rules for CustomLabels - - // no validation rules for AutoDiscoveryLimit - - if len(errors) > 0 { - return AddPostgreSQLServiceParamsMultiError(errors) - } - - return nil -} - -// AddPostgreSQLServiceParamsMultiError is an error wrapping multiple -// validation errors returned by AddPostgreSQLServiceParams.ValidateAll() if -// the designated constraints aren't met. -type AddPostgreSQLServiceParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m AddPostgreSQLServiceParamsMultiError) 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 AddPostgreSQLServiceParamsMultiError) AllErrors() []error { return m } - -// AddPostgreSQLServiceParamsValidationError is the validation error returned -// by AddPostgreSQLServiceParams.Validate if the designated constraints aren't met. -type AddPostgreSQLServiceParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e AddPostgreSQLServiceParamsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e AddPostgreSQLServiceParamsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e AddPostgreSQLServiceParamsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e AddPostgreSQLServiceParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e AddPostgreSQLServiceParamsValidationError) ErrorName() string { - return "AddPostgreSQLServiceParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e AddPostgreSQLServiceParamsValidationError) 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 %sAddPostgreSQLServiceParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = AddPostgreSQLServiceParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = AddPostgreSQLServiceParamsValidationError{} - -// Validate checks the field values on AddValkeyServiceParams 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 *AddValkeyServiceParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on AddValkeyServiceParams 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 -// AddValkeyServiceParamsMultiError, or nil if none found. -func (m *AddValkeyServiceParams) ValidateAll() error { - return m.validate(true) -} - -func (m *AddValkeyServiceParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetServiceName()) < 1 { - err := AddValkeyServiceParamsValidationError{ - field: "ServiceName", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if utf8.RuneCountInString(m.GetNodeId()) < 1 { - err := AddValkeyServiceParamsValidationError{ - field: "NodeId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for Address - - // no validation rules for Port - - // no validation rules for Socket - - // no validation rules for Environment - - // no validation rules for Cluster - - // no validation rules for ReplicationSet - - // no validation rules for CustomLabels - - if len(errors) > 0 { - return AddValkeyServiceParamsMultiError(errors) - } - - return nil -} - -// AddValkeyServiceParamsMultiError is an error wrapping multiple validation -// errors returned by AddValkeyServiceParams.ValidateAll() if the designated -// constraints aren't met. -type AddValkeyServiceParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m AddValkeyServiceParamsMultiError) 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 AddValkeyServiceParamsMultiError) AllErrors() []error { return m } - -// AddValkeyServiceParamsValidationError is the validation error returned by -// AddValkeyServiceParams.Validate if the designated constraints aren't met. -type AddValkeyServiceParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e AddValkeyServiceParamsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e AddValkeyServiceParamsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e AddValkeyServiceParamsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e AddValkeyServiceParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e AddValkeyServiceParamsValidationError) ErrorName() string { - return "AddValkeyServiceParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e AddValkeyServiceParamsValidationError) 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 %sAddValkeyServiceParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = AddValkeyServiceParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = AddValkeyServiceParamsValidationError{} - -// Validate checks the field values on AddProxySQLServiceParams 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 *AddProxySQLServiceParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on AddProxySQLServiceParams 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 -// AddProxySQLServiceParamsMultiError, or nil if none found. -func (m *AddProxySQLServiceParams) ValidateAll() error { - return m.validate(true) -} - -func (m *AddProxySQLServiceParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetServiceName()) < 1 { - err := AddProxySQLServiceParamsValidationError{ - field: "ServiceName", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if utf8.RuneCountInString(m.GetNodeId()) < 1 { - err := AddProxySQLServiceParamsValidationError{ - field: "NodeId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for Address - - // no validation rules for Port - - // no validation rules for Socket - - // no validation rules for Environment - - // no validation rules for Cluster - - // no validation rules for ReplicationSet - - // no validation rules for CustomLabels - - if len(errors) > 0 { - return AddProxySQLServiceParamsMultiError(errors) - } - - return nil -} - -// AddProxySQLServiceParamsMultiError is an error wrapping multiple validation -// errors returned by AddProxySQLServiceParams.ValidateAll() if the designated -// constraints aren't met. -type AddProxySQLServiceParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m AddProxySQLServiceParamsMultiError) 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 AddProxySQLServiceParamsMultiError) AllErrors() []error { return m } - -// AddProxySQLServiceParamsValidationError is the validation error returned by -// AddProxySQLServiceParams.Validate if the designated constraints aren't met. -type AddProxySQLServiceParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e AddProxySQLServiceParamsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e AddProxySQLServiceParamsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e AddProxySQLServiceParamsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e AddProxySQLServiceParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e AddProxySQLServiceParamsValidationError) ErrorName() string { - return "AddProxySQLServiceParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e AddProxySQLServiceParamsValidationError) 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 %sAddProxySQLServiceParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = AddProxySQLServiceParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = AddProxySQLServiceParamsValidationError{} - -// Validate checks the field values on AddHAProxyServiceParams 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 *AddHAProxyServiceParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on AddHAProxyServiceParams 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 -// AddHAProxyServiceParamsMultiError, or nil if none found. -func (m *AddHAProxyServiceParams) ValidateAll() error { - return m.validate(true) -} - -func (m *AddHAProxyServiceParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetServiceName()) < 1 { - err := AddHAProxyServiceParamsValidationError{ - field: "ServiceName", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if utf8.RuneCountInString(m.GetNodeId()) < 1 { - err := AddHAProxyServiceParamsValidationError{ - field: "NodeId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for Environment - - // no validation rules for Cluster - - // no validation rules for ReplicationSet - - // no validation rules for CustomLabels - - if len(errors) > 0 { - return AddHAProxyServiceParamsMultiError(errors) - } - - return nil -} - -// AddHAProxyServiceParamsMultiError is an error wrapping multiple validation -// errors returned by AddHAProxyServiceParams.ValidateAll() if the designated -// constraints aren't met. -type AddHAProxyServiceParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m AddHAProxyServiceParamsMultiError) 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 AddHAProxyServiceParamsMultiError) AllErrors() []error { return m } - -// AddHAProxyServiceParamsValidationError is the validation error returned by -// AddHAProxyServiceParams.Validate if the designated constraints aren't met. -type AddHAProxyServiceParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e AddHAProxyServiceParamsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e AddHAProxyServiceParamsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e AddHAProxyServiceParamsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e AddHAProxyServiceParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e AddHAProxyServiceParamsValidationError) ErrorName() string { - return "AddHAProxyServiceParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e AddHAProxyServiceParamsValidationError) 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 %sAddHAProxyServiceParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = AddHAProxyServiceParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = AddHAProxyServiceParamsValidationError{} - -// Validate checks the field values on AddExternalServiceParams 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 *AddExternalServiceParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on AddExternalServiceParams 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 -// AddExternalServiceParamsMultiError, or nil if none found. -func (m *AddExternalServiceParams) ValidateAll() error { - return m.validate(true) -} - -func (m *AddExternalServiceParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetServiceName()) < 1 { - err := AddExternalServiceParamsValidationError{ - field: "ServiceName", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if utf8.RuneCountInString(m.GetNodeId()) < 1 { - err := AddExternalServiceParamsValidationError{ - field: "NodeId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for Environment - - // no validation rules for Cluster - - // no validation rules for ReplicationSet - - // no validation rules for CustomLabels - - // no validation rules for Group - - if len(errors) > 0 { - return AddExternalServiceParamsMultiError(errors) - } - - return nil -} - -// AddExternalServiceParamsMultiError is an error wrapping multiple validation -// errors returned by AddExternalServiceParams.ValidateAll() if the designated -// constraints aren't met. -type AddExternalServiceParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m AddExternalServiceParamsMultiError) 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 AddExternalServiceParamsMultiError) AllErrors() []error { return m } - -// AddExternalServiceParamsValidationError is the validation error returned by -// AddExternalServiceParams.Validate if the designated constraints aren't met. -type AddExternalServiceParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e AddExternalServiceParamsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e AddExternalServiceParamsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e AddExternalServiceParamsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e AddExternalServiceParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e AddExternalServiceParamsValidationError) ErrorName() string { - return "AddExternalServiceParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e AddExternalServiceParamsValidationError) 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 %sAddExternalServiceParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = AddExternalServiceParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = AddExternalServiceParamsValidationError{} - -// Validate checks the field values on RemoveServiceRequest 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 *RemoveServiceRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on RemoveServiceRequest 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 -// RemoveServiceRequestMultiError, or nil if none found. -func (m *RemoveServiceRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *RemoveServiceRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetServiceId()) < 1 { - err := RemoveServiceRequestValidationError{ - field: "ServiceId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for Force - - if len(errors) > 0 { - return RemoveServiceRequestMultiError(errors) - } - - return nil -} - -// RemoveServiceRequestMultiError is an error wrapping multiple validation -// errors returned by RemoveServiceRequest.ValidateAll() if the designated -// constraints aren't met. -type RemoveServiceRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m RemoveServiceRequestMultiError) 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 RemoveServiceRequestMultiError) AllErrors() []error { return m } - -// RemoveServiceRequestValidationError is the validation error returned by -// RemoveServiceRequest.Validate if the designated constraints aren't met. -type RemoveServiceRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e RemoveServiceRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e RemoveServiceRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e RemoveServiceRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e RemoveServiceRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e RemoveServiceRequestValidationError) ErrorName() string { - return "RemoveServiceRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e RemoveServiceRequestValidationError) 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 %sRemoveServiceRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = RemoveServiceRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = RemoveServiceRequestValidationError{} - -// Validate checks the field values on RemoveServiceResponse 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 *RemoveServiceResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on RemoveServiceResponse 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 -// RemoveServiceResponseMultiError, or nil if none found. -func (m *RemoveServiceResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *RemoveServiceResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return RemoveServiceResponseMultiError(errors) - } - - return nil -} - -// RemoveServiceResponseMultiError is an error wrapping multiple validation -// errors returned by RemoveServiceResponse.ValidateAll() if the designated -// constraints aren't met. -type RemoveServiceResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m RemoveServiceResponseMultiError) 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 RemoveServiceResponseMultiError) AllErrors() []error { return m } - -// RemoveServiceResponseValidationError is the validation error returned by -// RemoveServiceResponse.Validate if the designated constraints aren't met. -type RemoveServiceResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e RemoveServiceResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e RemoveServiceResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e RemoveServiceResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e RemoveServiceResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e RemoveServiceResponseValidationError) ErrorName() string { - return "RemoveServiceResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e RemoveServiceResponseValidationError) 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 %sRemoveServiceResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = RemoveServiceResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = RemoveServiceResponseValidationError{} - -// Validate checks the field values on ChangeServiceRequest with the rules -// defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *ChangeServiceRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ChangeServiceRequest with the rules -// defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// ChangeServiceRequestMultiError, or nil if none found. -func (m *ChangeServiceRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *ChangeServiceRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetServiceId()) < 1 { - err := ChangeServiceRequestValidationError{ - field: "ServiceId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if m.Environment != nil { - // no validation rules for Environment - } - - if m.Cluster != nil { - // no validation rules for Cluster - } - - if m.ReplicationSet != nil { - // no validation rules for ReplicationSet - } - - if m.ExternalGroup != nil { - // no validation rules for ExternalGroup - } - - if m.CustomLabels != nil { - if all { - switch v := interface{}(m.GetCustomLabels()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeServiceRequestValidationError{ - field: "CustomLabels", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeServiceRequestValidationError{ - field: "CustomLabels", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetCustomLabels()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeServiceRequestValidationError{ - field: "CustomLabels", - reason: "embedded message failed validation", - cause: err, - } - } - } - } - - if len(errors) > 0 { - return ChangeServiceRequestMultiError(errors) - } - - return nil -} - -// ChangeServiceRequestMultiError is an error wrapping multiple validation -// errors returned by ChangeServiceRequest.ValidateAll() if the designated -// constraints aren't met. -type ChangeServiceRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ChangeServiceRequestMultiError) Error() string { - 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 ChangeServiceRequestMultiError) AllErrors() []error { return m } - -// ChangeServiceRequestValidationError is the validation error returned by -// ChangeServiceRequest.Validate if the designated constraints aren't met. -type ChangeServiceRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ChangeServiceRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ChangeServiceRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ChangeServiceRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ChangeServiceRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ChangeServiceRequestValidationError) ErrorName() string { - return "ChangeServiceRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e ChangeServiceRequestValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sChangeServiceRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ChangeServiceRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ChangeServiceRequestValidationError{} - -// Validate checks the field values on ChangeServiceResponse with the rules -// defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *ChangeServiceResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ChangeServiceResponse with the rules -// defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// ChangeServiceResponseMultiError, or nil if none found. -func (m *ChangeServiceResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *ChangeServiceResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - switch v := m.Service.(type) { - case *ChangeServiceResponse_Mysql: - if v == nil { - err := ChangeServiceResponseValidationError{ - field: "Service", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetMysql()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeServiceResponseValidationError{ - field: "Mysql", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeServiceResponseValidationError{ - field: "Mysql", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMysql()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeServiceResponseValidationError{ - field: "Mysql", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *ChangeServiceResponse_Mongodb: - if v == nil { - err := ChangeServiceResponseValidationError{ - field: "Service", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetMongodb()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeServiceResponseValidationError{ - field: "Mongodb", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeServiceResponseValidationError{ - field: "Mongodb", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMongodb()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeServiceResponseValidationError{ - field: "Mongodb", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *ChangeServiceResponse_Postgresql: - if v == nil { - err := ChangeServiceResponseValidationError{ - field: "Service", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetPostgresql()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeServiceResponseValidationError{ - field: "Postgresql", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeServiceResponseValidationError{ - field: "Postgresql", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetPostgresql()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeServiceResponseValidationError{ - field: "Postgresql", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *ChangeServiceResponse_Proxysql: - if v == nil { - err := ChangeServiceResponseValidationError{ - field: "Service", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetProxysql()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeServiceResponseValidationError{ - field: "Proxysql", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeServiceResponseValidationError{ - field: "Proxysql", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetProxysql()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeServiceResponseValidationError{ - field: "Proxysql", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *ChangeServiceResponse_Haproxy: - if v == nil { - err := ChangeServiceResponseValidationError{ - field: "Service", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetHaproxy()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeServiceResponseValidationError{ - field: "Haproxy", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeServiceResponseValidationError{ - field: "Haproxy", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetHaproxy()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeServiceResponseValidationError{ - field: "Haproxy", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *ChangeServiceResponse_External: - if v == nil { - err := ChangeServiceResponseValidationError{ - field: "Service", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetExternal()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeServiceResponseValidationError{ - field: "External", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeServiceResponseValidationError{ - field: "External", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetExternal()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeServiceResponseValidationError{ - field: "External", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *ChangeServiceResponse_Valkey: - if v == nil { - err := ChangeServiceResponseValidationError{ - field: "Service", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetValkey()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeServiceResponseValidationError{ - field: "Valkey", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeServiceResponseValidationError{ - field: "Valkey", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetValkey()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeServiceResponseValidationError{ - field: "Valkey", - reason: "embedded message failed validation", - cause: err, - } - } - } - - default: - _ = v // ensures v is used - } - - if len(errors) > 0 { - return ChangeServiceResponseMultiError(errors) - } - - return nil -} - -// ChangeServiceResponseMultiError is an error wrapping multiple validation -// errors returned by ChangeServiceResponse.ValidateAll() if the designated -// constraints aren't met. -type ChangeServiceResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ChangeServiceResponseMultiError) Error() string { - 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 ChangeServiceResponseMultiError) AllErrors() []error { return m } - -// ChangeServiceResponseValidationError is the validation error returned by -// ChangeServiceResponse.Validate if the designated constraints aren't met. -type ChangeServiceResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ChangeServiceResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ChangeServiceResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ChangeServiceResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ChangeServiceResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ChangeServiceResponseValidationError) ErrorName() string { - return "ChangeServiceResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e ChangeServiceResponseValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sChangeServiceResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ChangeServiceResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ChangeServiceResponseValidationError{} diff --git a/api/inventory/v1/services_grpc.pb.go b/api/inventory/v1/services_grpc.pb.go deleted file mode 100644 index 1de232e4cc5..00000000000 --- a/api/inventory/v1/services_grpc.pb.go +++ /dev/null @@ -1,333 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.6.0 -// - protoc (unknown) -// source: inventory/v1/services.proto - -package inventoryv1 - -import ( - context "context" - - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.64.0 or later. -const _ = grpc.SupportPackageIsVersion9 - -const ( - ServicesService_ListServices_FullMethodName = "/inventory.v1.ServicesService/ListServices" - ServicesService_ListActiveServiceTypes_FullMethodName = "/inventory.v1.ServicesService/ListActiveServiceTypes" - ServicesService_GetService_FullMethodName = "/inventory.v1.ServicesService/GetService" - ServicesService_AddService_FullMethodName = "/inventory.v1.ServicesService/AddService" - ServicesService_RemoveService_FullMethodName = "/inventory.v1.ServicesService/RemoveService" - ServicesService_ChangeService_FullMethodName = "/inventory.v1.ServicesService/ChangeService" -) - -// ServicesServiceClient is the client API for ServicesService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -// -// Services service provides public methods for managing Services. -type ServicesServiceClient interface { - // ListServices returns a list of Services filtered by type. - ListServices(ctx context.Context, in *ListServicesRequest, opts ...grpc.CallOption) (*ListServicesResponse, error) - // ListActiveServiceTypes returns a list of active Services. - ListActiveServiceTypes(ctx context.Context, in *ListActiveServiceTypesRequest, opts ...grpc.CallOption) (*ListActiveServiceTypesResponse, error) - // GetService returns a single Service by ID. - GetService(ctx context.Context, in *GetServiceRequest, opts ...grpc.CallOption) (*GetServiceResponse, error) - // AddService adds any type of Service. - AddService(ctx context.Context, in *AddServiceRequest, opts ...grpc.CallOption) (*AddServiceResponse, error) - // RemoveService removes a Service. - RemoveService(ctx context.Context, in *RemoveServiceRequest, opts ...grpc.CallOption) (*RemoveServiceResponse, error) - // ChangeService allows changing configuration of a Service. - ChangeService(ctx context.Context, in *ChangeServiceRequest, opts ...grpc.CallOption) (*ChangeServiceResponse, error) -} - -type servicesServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewServicesServiceClient(cc grpc.ClientConnInterface) ServicesServiceClient { - return &servicesServiceClient{cc} -} - -func (c *servicesServiceClient) ListServices(ctx context.Context, in *ListServicesRequest, opts ...grpc.CallOption) (*ListServicesResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(ListServicesResponse) - err := c.cc.Invoke(ctx, ServicesService_ListServices_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *servicesServiceClient) ListActiveServiceTypes(ctx context.Context, in *ListActiveServiceTypesRequest, opts ...grpc.CallOption) (*ListActiveServiceTypesResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(ListActiveServiceTypesResponse) - err := c.cc.Invoke(ctx, ServicesService_ListActiveServiceTypes_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *servicesServiceClient) GetService(ctx context.Context, in *GetServiceRequest, opts ...grpc.CallOption) (*GetServiceResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetServiceResponse) - err := c.cc.Invoke(ctx, ServicesService_GetService_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *servicesServiceClient) AddService(ctx context.Context, in *AddServiceRequest, opts ...grpc.CallOption) (*AddServiceResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(AddServiceResponse) - err := c.cc.Invoke(ctx, ServicesService_AddService_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *servicesServiceClient) RemoveService(ctx context.Context, in *RemoveServiceRequest, opts ...grpc.CallOption) (*RemoveServiceResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(RemoveServiceResponse) - err := c.cc.Invoke(ctx, ServicesService_RemoveService_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *servicesServiceClient) ChangeService(ctx context.Context, in *ChangeServiceRequest, opts ...grpc.CallOption) (*ChangeServiceResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(ChangeServiceResponse) - err := c.cc.Invoke(ctx, ServicesService_ChangeService_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -// ServicesServiceServer is the server API for ServicesService service. -// All implementations must embed UnimplementedServicesServiceServer -// for forward compatibility. -// -// Services service provides public methods for managing Services. -type ServicesServiceServer interface { - // ListServices returns a list of Services filtered by type. - ListServices(context.Context, *ListServicesRequest) (*ListServicesResponse, error) - // ListActiveServiceTypes returns a list of active Services. - ListActiveServiceTypes(context.Context, *ListActiveServiceTypesRequest) (*ListActiveServiceTypesResponse, error) - // GetService returns a single Service by ID. - GetService(context.Context, *GetServiceRequest) (*GetServiceResponse, error) - // AddService adds any type of Service. - AddService(context.Context, *AddServiceRequest) (*AddServiceResponse, error) - // RemoveService removes a Service. - RemoveService(context.Context, *RemoveServiceRequest) (*RemoveServiceResponse, error) - // ChangeService allows changing configuration of a Service. - ChangeService(context.Context, *ChangeServiceRequest) (*ChangeServiceResponse, error) - mustEmbedUnimplementedServicesServiceServer() -} - -// UnimplementedServicesServiceServer must be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -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") -} -func (UnimplementedServicesServiceServer) mustEmbedUnimplementedServicesServiceServer() {} -func (UnimplementedServicesServiceServer) testEmbeddedByValue() {} - -// UnsafeServicesServiceServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to ServicesServiceServer will -// result in compilation errors. -type UnsafeServicesServiceServer interface { - mustEmbedUnimplementedServicesServiceServer() -} - -func RegisterServicesServiceServer(s grpc.ServiceRegistrar, srv ServicesServiceServer) { - // If the following call panics, it indicates UnimplementedServicesServiceServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } - s.RegisterService(&ServicesService_ServiceDesc, srv) -} - -func _ServicesService_ListServices_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListServicesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ServicesServiceServer).ListServices(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: ServicesService_ListServices_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ServicesServiceServer).ListServices(ctx, req.(*ListServicesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ServicesService_ListActiveServiceTypes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListActiveServiceTypesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ServicesServiceServer).ListActiveServiceTypes(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: ServicesService_ListActiveServiceTypes_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ServicesServiceServer).ListActiveServiceTypes(ctx, req.(*ListActiveServiceTypesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ServicesService_GetService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetServiceRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ServicesServiceServer).GetService(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: ServicesService_GetService_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ServicesServiceServer).GetService(ctx, req.(*GetServiceRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ServicesService_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 { - return nil, err - } - if interceptor == nil { - return srv.(ServicesServiceServer).AddService(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: ServicesService_AddService_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ServicesServiceServer).AddService(ctx, req.(*AddServiceRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ServicesService_RemoveService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RemoveServiceRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ServicesServiceServer).RemoveService(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: ServicesService_RemoveService_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ServicesServiceServer).RemoveService(ctx, req.(*RemoveServiceRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ServicesService_ChangeService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ChangeServiceRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ServicesServiceServer).ChangeService(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: ServicesService_ChangeService_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ServicesServiceServer).ChangeService(ctx, req.(*ChangeServiceRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// ServicesService_ServiceDesc is the grpc.ServiceDesc for ServicesService service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var ServicesService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "inventory.v1.ServicesService", - HandlerType: (*ServicesServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "ListServices", - Handler: _ServicesService_ListServices_Handler, - }, - { - MethodName: "ListActiveServiceTypes", - Handler: _ServicesService_ListActiveServiceTypes_Handler, - }, - { - MethodName: "GetService", - Handler: _ServicesService_GetService_Handler, - }, - { - MethodName: "AddService", - Handler: _ServicesService_AddService_Handler, - }, - { - MethodName: "RemoveService", - Handler: _ServicesService_RemoveService_Handler, - }, - { - MethodName: "ChangeService", - Handler: _ServicesService_ChangeService_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "inventory/v1/services.proto", -} diff --git a/api/management/v1/agent.pb.go b/api/management/v1/agent.pb.go deleted file mode 100644 index cd7cd3f4adb..00000000000 --- a/api/management/v1/agent.pb.go +++ /dev/null @@ -1,1264 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.10 -// protoc (unknown) -// source: management/v1/agent.proto - -package managementv1 - -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" - - v1 "github.com/percona/pmm/api/inventory/v1" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type UpdateSeverity int32 - -const ( - UpdateSeverity_UPDATE_SEVERITY_UNSPECIFIED UpdateSeverity = 0 - // The client version is newer than the server version. - UpdateSeverity_UPDATE_SEVERITY_UNSUPPORTED UpdateSeverity = 1 - // The client version matches the server version. - UpdateSeverity_UPDATE_SEVERITY_UP_TO_DATE UpdateSeverity = 2 - // The client's minor or patch version is older. - UpdateSeverity_UPDATE_SEVERITY_REQUIRED UpdateSeverity = 3 - // The client's major version is older. - UpdateSeverity_UPDATE_SEVERITY_CRITICAL UpdateSeverity = 4 -) - -// Enum value maps for UpdateSeverity. -var ( - UpdateSeverity_name = map[int32]string{ - 0: "UPDATE_SEVERITY_UNSPECIFIED", - 1: "UPDATE_SEVERITY_UNSUPPORTED", - 2: "UPDATE_SEVERITY_UP_TO_DATE", - 3: "UPDATE_SEVERITY_REQUIRED", - 4: "UPDATE_SEVERITY_CRITICAL", - } - UpdateSeverity_value = map[string]int32{ - "UPDATE_SEVERITY_UNSPECIFIED": 0, - "UPDATE_SEVERITY_UNSUPPORTED": 1, - "UPDATE_SEVERITY_UP_TO_DATE": 2, - "UPDATE_SEVERITY_REQUIRED": 3, - "UPDATE_SEVERITY_CRITICAL": 4, - } -) - -func (x UpdateSeverity) Enum() *UpdateSeverity { - p := new(UpdateSeverity) - *p = x - return p -} - -func (x UpdateSeverity) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (UpdateSeverity) Descriptor() protoreflect.EnumDescriptor { - return file_management_v1_agent_proto_enumTypes[0].Descriptor() -} - -func (UpdateSeverity) Type() protoreflect.EnumType { - return &file_management_v1_agent_proto_enumTypes[0] -} - -func (x UpdateSeverity) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use UpdateSeverity.Descriptor instead. -func (UpdateSeverity) EnumDescriptor() ([]byte, []int) { - return file_management_v1_agent_proto_rawDescGZIP(), []int{0} -} - -type UniversalAgent struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Unique agent identifier. - AgentId string `protobuf:"bytes,1,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"` - // True if the agent password is set. - IsAgentPasswordSet bool `protobuf:"varint,2,opt,name=is_agent_password_set,json=isAgentPasswordSet,proto3" json:"is_agent_password_set,omitempty"` - // Agent type. - AgentType string `protobuf:"bytes,3,opt,name=agent_type,json=agentType,proto3" json:"agent_type,omitempty"` - // AWS Access Key. - AwsAccessKey string `protobuf:"bytes,4,opt,name=aws_access_key,json=awsAccessKey,proto3" json:"aws_access_key,omitempty"` - // True if AWS Secret Key is set. - IsAwsSecretKeySet bool `protobuf:"varint,5,opt,name=is_aws_secret_key_set,json=isAwsSecretKeySet,proto3" json:"is_aws_secret_key_set,omitempty"` - // Options used for connecting to Azure. - AzureOptions *UniversalAgent_AzureOptions `protobuf:"bytes,6,opt,name=azure_options,json=azureOptions,proto3" json:"azure_options,omitempty"` - // Creation timestamp. - CreatedAt *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` - // Custom user-assigned labels. - CustomLabels map[string]string `protobuf:"bytes,8,rep,name=custom_labels,json=customLabels,proto3" json:"custom_labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `protobuf:"varint,9,opt,name=disabled,proto3" json:"disabled,omitempty"` - // List of disabled collector names. - DisabledCollectors []string `protobuf:"bytes,10,rep,name=disabled_collectors,json=disabledCollectors,proto3" json:"disabled_collectors,omitempty"` - // Listen port for scraping metrics. - ListenPort uint32 `protobuf:"varint,11,opt,name=listen_port,json=listenPort,proto3" json:"listen_port,omitempty"` - // Log level for exporter. - LogLevel v1.LogLevel `protobuf:"varint,12,opt,name=log_level,json=logLevel,proto3,enum=inventory.v1.LogLevel" json:"log_level,omitempty"` - // Limit query length in QAN. - MaxQueryLength int32 `protobuf:"varint,13,opt,name=max_query_length,json=maxQueryLength,proto3" json:"max_query_length,omitempty"` - // Limit query log size in QAN. - MaxQueryLogSize int64 `protobuf:"varint,14,opt,name=max_query_log_size,json=maxQueryLogSize,proto3" json:"max_query_log_size,omitempty"` - // Path under which metrics are exposed, used to generate URI. - MetricsPath string `protobuf:"bytes,15,opt,name=metrics_path,json=metricsPath,proto3" json:"metrics_path,omitempty"` - // Scheme to generate URI to exporter metrics endpoints. - MetricsScheme string `protobuf:"bytes,16,opt,name=metrics_scheme,json=metricsScheme,proto3" json:"metrics_scheme,omitempty"` - // TLS and other options for connecting to MongoDB. - MongoDbOptions *UniversalAgent_MongoDBOptions `protobuf:"bytes,17,opt,name=mongo_db_options,json=mongoDbOptions,proto3" json:"mongo_db_options,omitempty"` - // TLS and other options for connecting to MySQL. - MysqlOptions *UniversalAgent_MySQLOptions `protobuf:"bytes,18,opt,name=mysql_options,json=mysqlOptions,proto3" json:"mysql_options,omitempty"` - // A unique node identifier. - NodeId string `protobuf:"bytes,19,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` - // True if password for connecting the agent to the database is set. - IsPasswordSet bool `protobuf:"varint,20,opt,name=is_password_set,json=isPasswordSet,proto3" json:"is_password_set,omitempty"` - // The pmm-agent identifier. - PmmAgentId string `protobuf:"bytes,21,opt,name=pmm_agent_id,json=pmmAgentId,proto3" json:"pmm_agent_id,omitempty"` - // TLS options for connecting to PostgreSQL. - PostgresqlOptions *UniversalAgent_PostgreSQLOptions `protobuf:"bytes,22,opt,name=postgresql_options,json=postgresqlOptions,proto3" json:"postgresql_options,omitempty"` - // Path to exec process. - ProcessExecPath string `protobuf:"bytes,23,opt,name=process_exec_path,json=processExecPath,proto3" json:"process_exec_path,omitempty"` - // True if exporter uses push metrics mode. - PushMetrics bool `protobuf:"varint,24,opt,name=push_metrics,json=pushMetrics,proto3" json:"push_metrics,omitempty"` - // True if query examples are disabled. - QueryExamplesDisabled bool `protobuf:"varint,25,opt,name=query_examples_disabled,json=queryExamplesDisabled,proto3" json:"query_examples_disabled,omitempty"` - // True if query comments parsing is disabled. - CommentsParsingDisabled bool `protobuf:"varint,26,opt,name=comments_parsing_disabled,json=commentsParsingDisabled,proto3" json:"comments_parsing_disabled,omitempty"` - // True if RDS basic metrics are disdabled. - RdsBasicMetricsDisabled bool `protobuf:"varint,27,opt,name=rds_basic_metrics_disabled,json=rdsBasicMetricsDisabled,proto3" json:"rds_basic_metrics_disabled,omitempty"` - // True if RDS enhanced metrics are disdabled. - RdsEnhancedMetricsDisabled bool `protobuf:"varint,28,opt,name=rds_enhanced_metrics_disabled,json=rdsEnhancedMetricsDisabled,proto3" json:"rds_enhanced_metrics_disabled,omitempty"` - // Node identifier where this instance runs. - RunsOnNodeId string `protobuf:"bytes,29,opt,name=runs_on_node_id,json=runsOnNodeId,proto3" json:"runs_on_node_id,omitempty"` - // Service identifier. - ServiceId string `protobuf:"bytes,30,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` - // Actual Agent status. - Status string `protobuf:"bytes,31,opt,name=status,proto3" json:"status,omitempty"` - // Last known table count. - TableCount int32 `protobuf:"varint,32,opt,name=table_count,json=tableCount,proto3" json:"table_count,omitempty"` - // Tablestats group collectors are disabled if there are more than that number of tables. - // 0 means tablestats group collectors are always enabled (no limit). - // Negative value means tablestats group collectors are always disabled. - TableCountTablestatsGroupLimit int32 `protobuf:"varint,33,opt,name=table_count_tablestats_group_limit,json=tableCountTablestatsGroupLimit,proto3" json:"table_count_tablestats_group_limit,omitempty"` - // Use TLS for database connections. - Tls bool `protobuf:"varint,34,opt,name=tls,proto3" json:"tls,omitempty"` - // Skip TLS certificate and hostname validation. - TlsSkipVerify bool `protobuf:"varint,35,opt,name=tls_skip_verify,json=tlsSkipVerify,proto3" json:"tls_skip_verify,omitempty"` - // HTTP basic auth username for collecting metrics. - Username string `protobuf:"bytes,36,opt,name=username,proto3" json:"username,omitempty"` - // Last update timestamp. - UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,37,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` - // Agent version. - Version string `protobuf:"bytes,38,opt,name=version,proto3" json:"version,omitempty"` - // True if Agent is running and connected to pmm-managed. - IsConnected bool `protobuf:"varint,39,opt,name=is_connected,json=isConnected,proto3" json:"is_connected,omitempty"` - // True if an exporter agent is exposed on all host addresses. - ExposeExporter bool `protobuf:"varint,40,opt,name=expose_exporter,json=exposeExporter,proto3" json:"expose_exporter,omitempty"` - // Options for connecting to Valkey. - ValkeyOptions *UniversalAgent_ValkeyOptions `protobuf:"bytes,41,opt,name=valkey_options,json=valkeyOptions,proto3" json:"valkey_options,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *UniversalAgent) Reset() { - *x = UniversalAgent{} - mi := &file_management_v1_agent_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *UniversalAgent) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UniversalAgent) ProtoMessage() {} - -func (x *UniversalAgent) ProtoReflect() protoreflect.Message { - mi := &file_management_v1_agent_proto_msgTypes[0] - 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 UniversalAgent.ProtoReflect.Descriptor instead. -func (*UniversalAgent) Descriptor() ([]byte, []int) { - return file_management_v1_agent_proto_rawDescGZIP(), []int{0} -} - -func (x *UniversalAgent) GetAgentId() string { - if x != nil { - return x.AgentId - } - return "" -} - -func (x *UniversalAgent) GetIsAgentPasswordSet() bool { - if x != nil { - return x.IsAgentPasswordSet - } - return false -} - -func (x *UniversalAgent) GetAgentType() string { - if x != nil { - return x.AgentType - } - return "" -} - -func (x *UniversalAgent) GetAwsAccessKey() string { - if x != nil { - return x.AwsAccessKey - } - return "" -} - -func (x *UniversalAgent) GetIsAwsSecretKeySet() bool { - if x != nil { - return x.IsAwsSecretKeySet - } - return false -} - -func (x *UniversalAgent) GetAzureOptions() *UniversalAgent_AzureOptions { - if x != nil { - return x.AzureOptions - } - return nil -} - -func (x *UniversalAgent) GetCreatedAt() *timestamppb.Timestamp { - if x != nil { - return x.CreatedAt - } - return nil -} - -func (x *UniversalAgent) GetCustomLabels() map[string]string { - if x != nil { - return x.CustomLabels - } - return nil -} - -func (x *UniversalAgent) GetDisabled() bool { - if x != nil { - return x.Disabled - } - return false -} - -func (x *UniversalAgent) GetDisabledCollectors() []string { - if x != nil { - return x.DisabledCollectors - } - return nil -} - -func (x *UniversalAgent) GetListenPort() uint32 { - if x != nil { - return x.ListenPort - } - return 0 -} - -func (x *UniversalAgent) GetLogLevel() v1.LogLevel { - if x != nil { - return x.LogLevel - } - return v1.LogLevel(0) -} - -func (x *UniversalAgent) GetMaxQueryLength() int32 { - if x != nil { - return x.MaxQueryLength - } - return 0 -} - -func (x *UniversalAgent) GetMaxQueryLogSize() int64 { - if x != nil { - return x.MaxQueryLogSize - } - return 0 -} - -func (x *UniversalAgent) GetMetricsPath() string { - if x != nil { - return x.MetricsPath - } - return "" -} - -func (x *UniversalAgent) GetMetricsScheme() string { - if x != nil { - return x.MetricsScheme - } - return "" -} - -func (x *UniversalAgent) GetMongoDbOptions() *UniversalAgent_MongoDBOptions { - if x != nil { - return x.MongoDbOptions - } - return nil -} - -func (x *UniversalAgent) GetMysqlOptions() *UniversalAgent_MySQLOptions { - if x != nil { - return x.MysqlOptions - } - return nil -} - -func (x *UniversalAgent) GetNodeId() string { - if x != nil { - return x.NodeId - } - return "" -} - -func (x *UniversalAgent) GetIsPasswordSet() bool { - if x != nil { - return x.IsPasswordSet - } - return false -} - -func (x *UniversalAgent) GetPmmAgentId() string { - if x != nil { - return x.PmmAgentId - } - return "" -} - -func (x *UniversalAgent) GetPostgresqlOptions() *UniversalAgent_PostgreSQLOptions { - if x != nil { - return x.PostgresqlOptions - } - return nil -} - -func (x *UniversalAgent) GetProcessExecPath() string { - if x != nil { - return x.ProcessExecPath - } - return "" -} - -func (x *UniversalAgent) GetPushMetrics() bool { - if x != nil { - return x.PushMetrics - } - return false -} - -func (x *UniversalAgent) GetQueryExamplesDisabled() bool { - if x != nil { - return x.QueryExamplesDisabled - } - return false -} - -func (x *UniversalAgent) GetCommentsParsingDisabled() bool { - if x != nil { - return x.CommentsParsingDisabled - } - return false -} - -func (x *UniversalAgent) GetRdsBasicMetricsDisabled() bool { - if x != nil { - return x.RdsBasicMetricsDisabled - } - return false -} - -func (x *UniversalAgent) GetRdsEnhancedMetricsDisabled() bool { - if x != nil { - return x.RdsEnhancedMetricsDisabled - } - return false -} - -func (x *UniversalAgent) GetRunsOnNodeId() string { - if x != nil { - return x.RunsOnNodeId - } - return "" -} - -func (x *UniversalAgent) GetServiceId() string { - if x != nil { - return x.ServiceId - } - return "" -} - -func (x *UniversalAgent) GetStatus() string { - if x != nil { - return x.Status - } - return "" -} - -func (x *UniversalAgent) GetTableCount() int32 { - if x != nil { - return x.TableCount - } - return 0 -} - -func (x *UniversalAgent) GetTableCountTablestatsGroupLimit() int32 { - if x != nil { - return x.TableCountTablestatsGroupLimit - } - return 0 -} - -func (x *UniversalAgent) GetTls() bool { - if x != nil { - return x.Tls - } - return false -} - -func (x *UniversalAgent) GetTlsSkipVerify() bool { - if x != nil { - return x.TlsSkipVerify - } - return false -} - -func (x *UniversalAgent) GetUsername() string { - if x != nil { - return x.Username - } - return "" -} - -func (x *UniversalAgent) GetUpdatedAt() *timestamppb.Timestamp { - if x != nil { - return x.UpdatedAt - } - return nil -} - -func (x *UniversalAgent) GetVersion() string { - if x != nil { - return x.Version - } - return "" -} - -func (x *UniversalAgent) GetIsConnected() bool { - if x != nil { - return x.IsConnected - } - return false -} - -func (x *UniversalAgent) GetExposeExporter() bool { - if x != nil { - return x.ExposeExporter - } - return false -} - -func (x *UniversalAgent) GetValkeyOptions() *UniversalAgent_ValkeyOptions { - if x != nil { - return x.ValkeyOptions - } - return nil -} - -type ListAgentsRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Return only Agents that relate to a specific ServiceID. - ServiceId string `protobuf:"bytes,1,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` - // Return only Agents that relate to a specific NodeID. - NodeId string `protobuf:"bytes,2,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ListAgentsRequest) Reset() { - *x = ListAgentsRequest{} - mi := &file_management_v1_agent_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ListAgentsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListAgentsRequest) ProtoMessage() {} - -func (x *ListAgentsRequest) ProtoReflect() protoreflect.Message { - mi := &file_management_v1_agent_proto_msgTypes[1] - 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 ListAgentsRequest.ProtoReflect.Descriptor instead. -func (*ListAgentsRequest) Descriptor() ([]byte, []int) { - return file_management_v1_agent_proto_rawDescGZIP(), []int{1} -} - -func (x *ListAgentsRequest) GetServiceId() string { - if x != nil { - return x.ServiceId - } - return "" -} - -func (x *ListAgentsRequest) GetNodeId() string { - if x != nil { - return x.NodeId - } - return "" -} - -type ListAgentsResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // List of Agents. - Agents []*UniversalAgent `protobuf:"bytes,1,rep,name=agents,proto3" json:"agents,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ListAgentsResponse) Reset() { - *x = ListAgentsResponse{} - mi := &file_management_v1_agent_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ListAgentsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListAgentsResponse) ProtoMessage() {} - -func (x *ListAgentsResponse) ProtoReflect() protoreflect.Message { - mi := &file_management_v1_agent_proto_msgTypes[2] - 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 ListAgentsResponse.ProtoReflect.Descriptor instead. -func (*ListAgentsResponse) Descriptor() ([]byte, []int) { - return file_management_v1_agent_proto_rawDescGZIP(), []int{2} -} - -func (x *ListAgentsResponse) GetAgents() []*UniversalAgent { - if x != nil { - return x.Agents - } - return nil -} - -type AgentVersions struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Agent ID. - AgentId string `protobuf:"bytes,1,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"` - // Agent version. - Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` - // Node name where the agent runs. - NodeName string `protobuf:"bytes,3,opt,name=node_name,json=nodeName,proto3" json:"node_name,omitempty"` - // Update severity. - Severity UpdateSeverity `protobuf:"varint,4,opt,name=severity,proto3,enum=management.v1.UpdateSeverity" json:"severity,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AgentVersions) Reset() { - *x = AgentVersions{} - mi := &file_management_v1_agent_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AgentVersions) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AgentVersions) ProtoMessage() {} - -func (x *AgentVersions) ProtoReflect() protoreflect.Message { - mi := &file_management_v1_agent_proto_msgTypes[3] - 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 AgentVersions.ProtoReflect.Descriptor instead. -func (*AgentVersions) Descriptor() ([]byte, []int) { - return file_management_v1_agent_proto_rawDescGZIP(), []int{3} -} - -func (x *AgentVersions) GetAgentId() string { - if x != nil { - return x.AgentId - } - return "" -} - -func (x *AgentVersions) GetVersion() string { - if x != nil { - return x.Version - } - return "" -} - -func (x *AgentVersions) GetNodeName() string { - if x != nil { - return x.NodeName - } - return "" -} - -func (x *AgentVersions) GetSeverity() UpdateSeverity { - if x != nil { - return x.Severity - } - return UpdateSeverity_UPDATE_SEVERITY_UNSPECIFIED -} - -type ListAgentVersionsRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ListAgentVersionsRequest) Reset() { - *x = ListAgentVersionsRequest{} - mi := &file_management_v1_agent_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ListAgentVersionsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListAgentVersionsRequest) ProtoMessage() {} - -func (x *ListAgentVersionsRequest) ProtoReflect() protoreflect.Message { - mi := &file_management_v1_agent_proto_msgTypes[4] - 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 ListAgentVersionsRequest.ProtoReflect.Descriptor instead. -func (*ListAgentVersionsRequest) Descriptor() ([]byte, []int) { - return file_management_v1_agent_proto_rawDescGZIP(), []int{4} -} - -type ListAgentVersionsResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // List of Agent versions. - AgentVersions []*AgentVersions `protobuf:"bytes,1,rep,name=agent_versions,json=agentVersions,proto3" json:"agent_versions,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ListAgentVersionsResponse) Reset() { - *x = ListAgentVersionsResponse{} - mi := &file_management_v1_agent_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ListAgentVersionsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListAgentVersionsResponse) ProtoMessage() {} - -func (x *ListAgentVersionsResponse) ProtoReflect() protoreflect.Message { - mi := &file_management_v1_agent_proto_msgTypes[5] - 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 ListAgentVersionsResponse.ProtoReflect.Descriptor instead. -func (*ListAgentVersionsResponse) Descriptor() ([]byte, []int) { - return file_management_v1_agent_proto_rawDescGZIP(), []int{5} -} - -func (x *ListAgentVersionsResponse) GetAgentVersions() []*AgentVersions { - if x != nil { - return x.AgentVersions - } - return nil -} - -type UniversalAgent_MySQLOptions struct { - state protoimpl.MessageState `protogen:"open.v1"` - // True if TLS key is set. - IsTlsKeySet bool `protobuf:"varint,1,opt,name=is_tls_key_set,json=isTlsKeySet,proto3" json:"is_tls_key_set,omitempty"` - // Extra DSN parameters for MySQL connection. - ExtraDsnParams map[string]string `protobuf:"bytes,2,rep,name=extra_dsn_params,json=extraDsnParams,proto3" json:"extra_dsn_params,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *UniversalAgent_MySQLOptions) Reset() { - *x = UniversalAgent_MySQLOptions{} - mi := &file_management_v1_agent_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *UniversalAgent_MySQLOptions) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UniversalAgent_MySQLOptions) ProtoMessage() {} - -func (x *UniversalAgent_MySQLOptions) ProtoReflect() protoreflect.Message { - mi := &file_management_v1_agent_proto_msgTypes[6] - 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 UniversalAgent_MySQLOptions.ProtoReflect.Descriptor instead. -func (*UniversalAgent_MySQLOptions) Descriptor() ([]byte, []int) { - return file_management_v1_agent_proto_rawDescGZIP(), []int{0, 0} -} - -func (x *UniversalAgent_MySQLOptions) GetIsTlsKeySet() bool { - if x != nil { - return x.IsTlsKeySet - } - return false -} - -func (x *UniversalAgent_MySQLOptions) GetExtraDsnParams() map[string]string { - if x != nil { - return x.ExtraDsnParams - } - return nil -} - -type UniversalAgent_AzureOptions struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Azure client ID. - ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` - // True if Azure client secret is set. - IsClientSecretSet bool `protobuf:"varint,2,opt,name=is_client_secret_set,json=isClientSecretSet,proto3" json:"is_client_secret_set,omitempty"` - // Azure resource group. - ResourceGroup string `protobuf:"bytes,3,opt,name=resource_group,json=resourceGroup,proto3" json:"resource_group,omitempty"` - // Azure subscription ID. - SubscriptionId string `protobuf:"bytes,4,opt,name=subscription_id,json=subscriptionId,proto3" json:"subscription_id,omitempty"` - // Azure tenant ID. - TenantId string `protobuf:"bytes,5,opt,name=tenant_id,json=tenantId,proto3" json:"tenant_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *UniversalAgent_AzureOptions) Reset() { - *x = UniversalAgent_AzureOptions{} - mi := &file_management_v1_agent_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *UniversalAgent_AzureOptions) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UniversalAgent_AzureOptions) ProtoMessage() {} - -func (x *UniversalAgent_AzureOptions) ProtoReflect() protoreflect.Message { - mi := &file_management_v1_agent_proto_msgTypes[7] - 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 UniversalAgent_AzureOptions.ProtoReflect.Descriptor instead. -func (*UniversalAgent_AzureOptions) Descriptor() ([]byte, []int) { - return file_management_v1_agent_proto_rawDescGZIP(), []int{0, 1} -} - -func (x *UniversalAgent_AzureOptions) GetClientId() string { - if x != nil { - return x.ClientId - } - return "" -} - -func (x *UniversalAgent_AzureOptions) GetIsClientSecretSet() bool { - if x != nil { - return x.IsClientSecretSet - } - return false -} - -func (x *UniversalAgent_AzureOptions) GetResourceGroup() string { - if x != nil { - return x.ResourceGroup - } - return "" -} - -func (x *UniversalAgent_AzureOptions) GetSubscriptionId() string { - if x != nil { - return x.SubscriptionId - } - return "" -} - -func (x *UniversalAgent_AzureOptions) GetTenantId() string { - if x != nil { - return x.TenantId - } - return "" -} - -type UniversalAgent_MongoDBOptions struct { - state protoimpl.MessageState `protogen:"open.v1"` - // True if TLS certificate is set. - IsTlsCertificateKeySet bool `protobuf:"varint,1,opt,name=is_tls_certificate_key_set,json=isTlsCertificateKeySet,proto3" json:"is_tls_certificate_key_set,omitempty"` - // True if TLS certificate file password is set. - IsTlsCertificateKeyFilePasswordSet bool `protobuf:"varint,2,opt,name=is_tls_certificate_key_file_password_set,json=isTlsCertificateKeyFilePasswordSet,proto3" json:"is_tls_certificate_key_file_password_set,omitempty"` - // MongoDB auth mechanism. - AuthenticationMechanism string `protobuf:"bytes,3,opt,name=authentication_mechanism,json=authenticationMechanism,proto3" json:"authentication_mechanism,omitempty"` - // MongoDB auth database. - AuthenticationDatabase string `protobuf:"bytes,4,opt,name=authentication_database,json=authenticationDatabase,proto3" json:"authentication_database,omitempty"` - // MongoDB stats collections. - StatsCollections []string `protobuf:"bytes,5,rep,name=stats_collections,json=statsCollections,proto3" json:"stats_collections,omitempty"` - // MongoDB collections limit. - CollectionsLimit int32 `protobuf:"varint,6,opt,name=collections_limit,json=collectionsLimit,proto3" json:"collections_limit,omitempty"` - // True if all collectors are enabled. - EnableAllCollectors bool `protobuf:"varint,7,opt,name=enable_all_collectors,json=enableAllCollectors,proto3" json:"enable_all_collectors,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *UniversalAgent_MongoDBOptions) Reset() { - *x = UniversalAgent_MongoDBOptions{} - mi := &file_management_v1_agent_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *UniversalAgent_MongoDBOptions) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UniversalAgent_MongoDBOptions) ProtoMessage() {} - -func (x *UniversalAgent_MongoDBOptions) ProtoReflect() protoreflect.Message { - mi := &file_management_v1_agent_proto_msgTypes[8] - 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 UniversalAgent_MongoDBOptions.ProtoReflect.Descriptor instead. -func (*UniversalAgent_MongoDBOptions) Descriptor() ([]byte, []int) { - return file_management_v1_agent_proto_rawDescGZIP(), []int{0, 2} -} - -func (x *UniversalAgent_MongoDBOptions) GetIsTlsCertificateKeySet() bool { - if x != nil { - return x.IsTlsCertificateKeySet - } - return false -} - -func (x *UniversalAgent_MongoDBOptions) GetIsTlsCertificateKeyFilePasswordSet() bool { - if x != nil { - return x.IsTlsCertificateKeyFilePasswordSet - } - return false -} - -func (x *UniversalAgent_MongoDBOptions) GetAuthenticationMechanism() string { - if x != nil { - return x.AuthenticationMechanism - } - return "" -} - -func (x *UniversalAgent_MongoDBOptions) GetAuthenticationDatabase() string { - if x != nil { - return x.AuthenticationDatabase - } - return "" -} - -func (x *UniversalAgent_MongoDBOptions) GetStatsCollections() []string { - if x != nil { - return x.StatsCollections - } - return nil -} - -func (x *UniversalAgent_MongoDBOptions) GetCollectionsLimit() int32 { - if x != nil { - return x.CollectionsLimit - } - return 0 -} - -func (x *UniversalAgent_MongoDBOptions) GetEnableAllCollectors() bool { - if x != nil { - return x.EnableAllCollectors - } - return false -} - -type UniversalAgent_PostgreSQLOptions struct { - state protoimpl.MessageState `protogen:"open.v1"` - // True if TLS key is set. - IsSslKeySet bool `protobuf:"varint,1,opt,name=is_ssl_key_set,json=isSslKeySet,proto3" json:"is_ssl_key_set,omitempty"` - // Limit of databases for auto-discovery. - AutoDiscoveryLimit int32 `protobuf:"varint,2,opt,name=auto_discovery_limit,json=autoDiscoveryLimit,proto3" json:"auto_discovery_limit,omitempty"` - // Maximum number of connections from exporter to PostgreSQL instance. - MaxExporterConnections int32 `protobuf:"varint,3,opt,name=max_exporter_connections,json=maxExporterConnections,proto3" json:"max_exporter_connections,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *UniversalAgent_PostgreSQLOptions) Reset() { - *x = UniversalAgent_PostgreSQLOptions{} - mi := &file_management_v1_agent_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *UniversalAgent_PostgreSQLOptions) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UniversalAgent_PostgreSQLOptions) ProtoMessage() {} - -func (x *UniversalAgent_PostgreSQLOptions) ProtoReflect() protoreflect.Message { - mi := &file_management_v1_agent_proto_msgTypes[9] - 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 UniversalAgent_PostgreSQLOptions.ProtoReflect.Descriptor instead. -func (*UniversalAgent_PostgreSQLOptions) Descriptor() ([]byte, []int) { - return file_management_v1_agent_proto_rawDescGZIP(), []int{0, 3} -} - -func (x *UniversalAgent_PostgreSQLOptions) GetIsSslKeySet() bool { - if x != nil { - return x.IsSslKeySet - } - return false -} - -func (x *UniversalAgent_PostgreSQLOptions) GetAutoDiscoveryLimit() int32 { - if x != nil { - return x.AutoDiscoveryLimit - } - return 0 -} - -func (x *UniversalAgent_PostgreSQLOptions) GetMaxExporterConnections() int32 { - if x != nil { - return x.MaxExporterConnections - } - return 0 -} - -type UniversalAgent_ValkeyOptions struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *UniversalAgent_ValkeyOptions) Reset() { - *x = UniversalAgent_ValkeyOptions{} - mi := &file_management_v1_agent_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *UniversalAgent_ValkeyOptions) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UniversalAgent_ValkeyOptions) ProtoMessage() {} - -func (x *UniversalAgent_ValkeyOptions) ProtoReflect() protoreflect.Message { - mi := &file_management_v1_agent_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 UniversalAgent_ValkeyOptions.ProtoReflect.Descriptor instead. -func (*UniversalAgent_ValkeyOptions) Descriptor() ([]byte, []int) { - return file_management_v1_agent_proto_rawDescGZIP(), []int{0, 4} -} - -var File_management_v1_agent_proto protoreflect.FileDescriptor - -const file_management_v1_agent_proto_rawDesc = "" + - "\n" + - "\x19management/v1/agent.proto\x12\rmanagement.v1\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1cinventory/v1/log_level.proto\"\x8f\x18\n" + - "\x0eUniversalAgent\x12\x19\n" + - "\bagent_id\x18\x01 \x01(\tR\aagentId\x121\n" + - "\x15is_agent_password_set\x18\x02 \x01(\bR\x12isAgentPasswordSet\x12\x1d\n" + - "\n" + - "agent_type\x18\x03 \x01(\tR\tagentType\x12$\n" + - "\x0eaws_access_key\x18\x04 \x01(\tR\fawsAccessKey\x120\n" + - "\x15is_aws_secret_key_set\x18\x05 \x01(\bR\x11isAwsSecretKeySet\x12O\n" + - "\razure_options\x18\x06 \x01(\v2*.management.v1.UniversalAgent.AzureOptionsR\fazureOptions\x129\n" + - "\n" + - "created_at\x18\a \x01(\v2\x1a.google.protobuf.TimestampR\tcreatedAt\x12T\n" + - "\rcustom_labels\x18\b \x03(\v2/.management.v1.UniversalAgent.CustomLabelsEntryR\fcustomLabels\x12\x1a\n" + - "\bdisabled\x18\t \x01(\bR\bdisabled\x12/\n" + - "\x13disabled_collectors\x18\n" + - " \x03(\tR\x12disabledCollectors\x12\x1f\n" + - "\vlisten_port\x18\v \x01(\rR\n" + - "listenPort\x123\n" + - "\tlog_level\x18\f \x01(\x0e2\x16.inventory.v1.LogLevelR\blogLevel\x12(\n" + - "\x10max_query_length\x18\r \x01(\x05R\x0emaxQueryLength\x12+\n" + - "\x12max_query_log_size\x18\x0e \x01(\x03R\x0fmaxQueryLogSize\x12!\n" + - "\fmetrics_path\x18\x0f \x01(\tR\vmetricsPath\x12%\n" + - "\x0emetrics_scheme\x18\x10 \x01(\tR\rmetricsScheme\x12V\n" + - "\x10mongo_db_options\x18\x11 \x01(\v2,.management.v1.UniversalAgent.MongoDBOptionsR\x0emongoDbOptions\x12O\n" + - "\rmysql_options\x18\x12 \x01(\v2*.management.v1.UniversalAgent.MySQLOptionsR\fmysqlOptions\x12\x17\n" + - "\anode_id\x18\x13 \x01(\tR\x06nodeId\x12&\n" + - "\x0fis_password_set\x18\x14 \x01(\bR\risPasswordSet\x12 \n" + - "\fpmm_agent_id\x18\x15 \x01(\tR\n" + - "pmmAgentId\x12^\n" + - "\x12postgresql_options\x18\x16 \x01(\v2/.management.v1.UniversalAgent.PostgreSQLOptionsR\x11postgresqlOptions\x12*\n" + - "\x11process_exec_path\x18\x17 \x01(\tR\x0fprocessExecPath\x12!\n" + - "\fpush_metrics\x18\x18 \x01(\bR\vpushMetrics\x126\n" + - "\x17query_examples_disabled\x18\x19 \x01(\bR\x15queryExamplesDisabled\x12:\n" + - "\x19comments_parsing_disabled\x18\x1a \x01(\bR\x17commentsParsingDisabled\x12;\n" + - "\x1ards_basic_metrics_disabled\x18\x1b \x01(\bR\x17rdsBasicMetricsDisabled\x12A\n" + - "\x1drds_enhanced_metrics_disabled\x18\x1c \x01(\bR\x1ardsEnhancedMetricsDisabled\x12%\n" + - "\x0fruns_on_node_id\x18\x1d \x01(\tR\frunsOnNodeId\x12\x1d\n" + - "\n" + - "service_id\x18\x1e \x01(\tR\tserviceId\x12\x16\n" + - "\x06status\x18\x1f \x01(\tR\x06status\x12\x1f\n" + - "\vtable_count\x18 \x01(\x05R\n" + - "tableCount\x12J\n" + - "\"table_count_tablestats_group_limit\x18! \x01(\x05R\x1etableCountTablestatsGroupLimit\x12\x10\n" + - "\x03tls\x18\" \x01(\bR\x03tls\x12&\n" + - "\x0ftls_skip_verify\x18# \x01(\bR\rtlsSkipVerify\x12\x1a\n" + - "\busername\x18$ \x01(\tR\busername\x129\n" + - "\n" + - "updated_at\x18% \x01(\v2\x1a.google.protobuf.TimestampR\tupdatedAt\x12\x18\n" + - "\aversion\x18& \x01(\tR\aversion\x12!\n" + - "\fis_connected\x18' \x01(\bR\visConnected\x12'\n" + - "\x0fexpose_exporter\x18( \x01(\bR\x0eexposeExporter\x12R\n" + - "\x0evalkey_options\x18) \x01(\v2+.management.v1.UniversalAgent.ValkeyOptionsR\rvalkeyOptions\x1a\xe0\x01\n" + - "\fMySQLOptions\x12#\n" + - "\x0eis_tls_key_set\x18\x01 \x01(\bR\visTlsKeySet\x12h\n" + - "\x10extra_dsn_params\x18\x02 \x03(\v2>.management.v1.UniversalAgent.MySQLOptions.ExtraDsnParamsEntryR\x0eextraDsnParams\x1aA\n" + - "\x13ExtraDsnParamsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\x1a\xc9\x01\n" + - "\fAzureOptions\x12\x1b\n" + - "\tclient_id\x18\x01 \x01(\tR\bclientId\x12/\n" + - "\x14is_client_secret_set\x18\x02 \x01(\bR\x11isClientSecretSet\x12%\n" + - "\x0eresource_group\x18\x03 \x01(\tR\rresourceGroup\x12'\n" + - "\x0fsubscription_id\x18\x04 \x01(\tR\x0esubscriptionId\x12\x1b\n" + - "\ttenant_id\x18\x05 \x01(\tR\btenantId\x1a\xa4\x03\n" + - "\x0eMongoDBOptions\x12:\n" + - "\x1ais_tls_certificate_key_set\x18\x01 \x01(\bR\x16isTlsCertificateKeySet\x12T\n" + - "(is_tls_certificate_key_file_password_set\x18\x02 \x01(\bR\"isTlsCertificateKeyFilePasswordSet\x129\n" + - "\x18authentication_mechanism\x18\x03 \x01(\tR\x17authenticationMechanism\x127\n" + - "\x17authentication_database\x18\x04 \x01(\tR\x16authenticationDatabase\x12+\n" + - "\x11stats_collections\x18\x05 \x03(\tR\x10statsCollections\x12+\n" + - "\x11collections_limit\x18\x06 \x01(\x05R\x10collectionsLimit\x122\n" + - "\x15enable_all_collectors\x18\a \x01(\bR\x13enableAllCollectors\x1a\xa4\x01\n" + - "\x11PostgreSQLOptions\x12#\n" + - "\x0eis_ssl_key_set\x18\x01 \x01(\bR\visSslKeySet\x120\n" + - "\x14auto_discovery_limit\x18\x02 \x01(\x05R\x12autoDiscoveryLimit\x128\n" + - "\x18max_exporter_connections\x18\x03 \x01(\x05R\x16maxExporterConnections\x1a\x0f\n" + - "\rValkeyOptions\x1a?\n" + - "\x11CustomLabelsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"K\n" + - "\x11ListAgentsRequest\x12\x1d\n" + - "\n" + - "service_id\x18\x01 \x01(\tR\tserviceId\x12\x17\n" + - "\anode_id\x18\x02 \x01(\tR\x06nodeId\"K\n" + - "\x12ListAgentsResponse\x125\n" + - "\x06agents\x18\x01 \x03(\v2\x1d.management.v1.UniversalAgentR\x06agents\"\x9c\x01\n" + - "\rAgentVersions\x12\x19\n" + - "\bagent_id\x18\x01 \x01(\tR\aagentId\x12\x18\n" + - "\aversion\x18\x02 \x01(\tR\aversion\x12\x1b\n" + - "\tnode_name\x18\x03 \x01(\tR\bnodeName\x129\n" + - "\bseverity\x18\x04 \x01(\x0e2\x1d.management.v1.UpdateSeverityR\bseverity\"\x1a\n" + - "\x18ListAgentVersionsRequest\"`\n" + - "\x19ListAgentVersionsResponse\x12C\n" + - "\x0eagent_versions\x18\x01 \x03(\v2\x1c.management.v1.AgentVersionsR\ragentVersions*\xae\x01\n" + - "\x0eUpdateSeverity\x12\x1f\n" + - "\x1bUPDATE_SEVERITY_UNSPECIFIED\x10\x00\x12\x1f\n" + - "\x1bUPDATE_SEVERITY_UNSUPPORTED\x10\x01\x12\x1e\n" + - "\x1aUPDATE_SEVERITY_UP_TO_DATE\x10\x02\x12\x1c\n" + - "\x18UPDATE_SEVERITY_REQUIRED\x10\x03\x12\x1c\n" + - "\x18UPDATE_SEVERITY_CRITICAL\x10\x04B\xab\x01\n" + - "\x11com.management.v1B\n" + - "AgentProtoP\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 ( - file_management_v1_agent_proto_rawDescOnce sync.Once - file_management_v1_agent_proto_rawDescData []byte -) - -func file_management_v1_agent_proto_rawDescGZIP() []byte { - file_management_v1_agent_proto_rawDescOnce.Do(func() { - file_management_v1_agent_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_management_v1_agent_proto_rawDesc), len(file_management_v1_agent_proto_rawDesc))) - }) - 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 - } -) - -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 - 12, // 2: management.v1.UniversalAgent.custom_labels:type_name -> management.v1.UniversalAgent.CustomLabelsEntry - 15, // 3: management.v1.UniversalAgent.log_level:type_name -> inventory.v1.LogLevel - 9, // 4: management.v1.UniversalAgent.mongo_db_options:type_name -> management.v1.UniversalAgent.MongoDBOptions - 7, // 5: management.v1.UniversalAgent.mysql_options:type_name -> management.v1.UniversalAgent.MySQLOptions - 10, // 6: management.v1.UniversalAgent.postgresql_options:type_name -> management.v1.UniversalAgent.PostgreSQLOptions - 14, // 7: management.v1.UniversalAgent.updated_at:type_name -> google.protobuf.Timestamp - 11, // 8: management.v1.UniversalAgent.valkey_options:type_name -> management.v1.UniversalAgent.ValkeyOptions - 1, // 9: management.v1.ListAgentsResponse.agents:type_name -> management.v1.UniversalAgent - 0, // 10: management.v1.AgentVersions.severity:type_name -> management.v1.UpdateSeverity - 4, // 11: management.v1.ListAgentVersionsResponse.agent_versions:type_name -> management.v1.AgentVersions - 13, // 12: management.v1.UniversalAgent.MySQLOptions.extra_dsn_params:type_name -> management.v1.UniversalAgent.MySQLOptions.ExtraDsnParamsEntry - 13, // [13:13] is the sub-list for method output_type - 13, // [13:13] is the sub-list for method input_type - 13, // [13:13] is the sub-list for extension type_name - 13, // [13:13] is the sub-list for extension extendee - 0, // [0:13] is the sub-list for field type_name -} - -func init() { file_management_v1_agent_proto_init() } -func file_management_v1_agent_proto_init() { - if File_management_v1_agent_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_management_v1_agent_proto_rawDesc), len(file_management_v1_agent_proto_rawDesc)), - NumEnums: 1, - NumMessages: 13, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_management_v1_agent_proto_goTypes, - DependencyIndexes: file_management_v1_agent_proto_depIdxs, - EnumInfos: file_management_v1_agent_proto_enumTypes, - MessageInfos: file_management_v1_agent_proto_msgTypes, - }.Build() - File_management_v1_agent_proto = out.File - file_management_v1_agent_proto_goTypes = nil - file_management_v1_agent_proto_depIdxs = nil -} diff --git a/api/management/v1/agent.pb.validate.go b/api/management/v1/agent.pb.validate.go deleted file mode 100644 index edc758c4675..00000000000 --- a/api/management/v1/agent.pb.validate.go +++ /dev/null @@ -1,1546 +0,0 @@ -// Code generated by protoc-gen-validate. DO NOT EDIT. -// source: management/v1/agent.proto - -package managementv1 - -import ( - "bytes" - "errors" - "fmt" - "net" - "net/mail" - "net/url" - "regexp" - "sort" - "strings" - "time" - "unicode/utf8" - - "google.golang.org/protobuf/types/known/anypb" - - inventoryv1 "github.com/percona/pmm/api/inventory/v1" -) - -// ensure the imports are used -var ( - _ = bytes.MinRead - _ = errors.New("") - _ = fmt.Print - _ = utf8.UTFMax - _ = (*regexp.Regexp)(nil) - _ = (*strings.Reader)(nil) - _ = net.IPv4len - _ = time.Duration(0) - _ = (*url.URL)(nil) - _ = (*mail.Address)(nil) - _ = anypb.Any{} - _ = sort.Sort - - _ = inventoryv1.LogLevel(0) -) - -// Validate checks the field values on UniversalAgent 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 *UniversalAgent) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on UniversalAgent 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 UniversalAgentMultiError, -// or nil if none found. -func (m *UniversalAgent) ValidateAll() error { - return m.validate(true) -} - -func (m *UniversalAgent) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for AgentId - - // no validation rules for IsAgentPasswordSet - - // no validation rules for AgentType - - // no validation rules for AwsAccessKey - - // no validation rules for IsAwsSecretKeySet - - if all { - switch v := interface{}(m.GetAzureOptions()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, UniversalAgentValidationError{ - field: "AzureOptions", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, UniversalAgentValidationError{ - field: "AzureOptions", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetAzureOptions()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return UniversalAgentValidationError{ - field: "AzureOptions", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetCreatedAt()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, UniversalAgentValidationError{ - field: "CreatedAt", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, UniversalAgentValidationError{ - field: "CreatedAt", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetCreatedAt()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return UniversalAgentValidationError{ - field: "CreatedAt", - reason: "embedded message failed validation", - cause: err, - } - } - } - - // no validation rules for CustomLabels - - // no validation rules for Disabled - - // no validation rules for ListenPort - - // no validation rules for LogLevel - - // no validation rules for MaxQueryLength - - // no validation rules for MaxQueryLogSize - - // no validation rules for MetricsPath - - // no validation rules for MetricsScheme - - if all { - switch v := interface{}(m.GetMongoDbOptions()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, UniversalAgentValidationError{ - field: "MongoDbOptions", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, UniversalAgentValidationError{ - field: "MongoDbOptions", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMongoDbOptions()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return UniversalAgentValidationError{ - field: "MongoDbOptions", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetMysqlOptions()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, UniversalAgentValidationError{ - field: "MysqlOptions", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, UniversalAgentValidationError{ - field: "MysqlOptions", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMysqlOptions()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return UniversalAgentValidationError{ - field: "MysqlOptions", - reason: "embedded message failed validation", - cause: err, - } - } - } - - // no validation rules for NodeId - - // no validation rules for IsPasswordSet - - // no validation rules for PmmAgentId - - if all { - switch v := interface{}(m.GetPostgresqlOptions()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, UniversalAgentValidationError{ - field: "PostgresqlOptions", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, UniversalAgentValidationError{ - field: "PostgresqlOptions", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetPostgresqlOptions()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return UniversalAgentValidationError{ - field: "PostgresqlOptions", - reason: "embedded message failed validation", - cause: err, - } - } - } - - // no validation rules for ProcessExecPath - - // no validation rules for PushMetrics - - // no validation rules for QueryExamplesDisabled - - // no validation rules for CommentsParsingDisabled - - // no validation rules for RdsBasicMetricsDisabled - - // no validation rules for RdsEnhancedMetricsDisabled - - // no validation rules for RunsOnNodeId - - // no validation rules for ServiceId - - // no validation rules for Status - - // no validation rules for TableCount - - // no validation rules for TableCountTablestatsGroupLimit - - // no validation rules for Tls - - // no validation rules for TlsSkipVerify - - // no validation rules for Username - - if all { - switch v := interface{}(m.GetUpdatedAt()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, UniversalAgentValidationError{ - field: "UpdatedAt", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, UniversalAgentValidationError{ - field: "UpdatedAt", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetUpdatedAt()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return UniversalAgentValidationError{ - field: "UpdatedAt", - reason: "embedded message failed validation", - cause: err, - } - } - } - - // no validation rules for Version - - // no validation rules for IsConnected - - // no validation rules for ExposeExporter - - if all { - switch v := interface{}(m.GetValkeyOptions()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, UniversalAgentValidationError{ - field: "ValkeyOptions", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, UniversalAgentValidationError{ - field: "ValkeyOptions", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetValkeyOptions()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return UniversalAgentValidationError{ - field: "ValkeyOptions", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if len(errors) > 0 { - return UniversalAgentMultiError(errors) - } - - return nil -} - -// UniversalAgentMultiError is an error wrapping multiple validation errors -// returned by UniversalAgent.ValidateAll() if the designated constraints -// aren't met. -type UniversalAgentMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m UniversalAgentMultiError) 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 UniversalAgentMultiError) AllErrors() []error { return m } - -// UniversalAgentValidationError is the validation error returned by -// UniversalAgent.Validate if the designated constraints aren't met. -type UniversalAgentValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e UniversalAgentValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e UniversalAgentValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e UniversalAgentValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e UniversalAgentValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e UniversalAgentValidationError) ErrorName() string { return "UniversalAgentValidationError" } - -// Error satisfies the builtin error interface -func (e UniversalAgentValidationError) 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 %sUniversalAgent.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = UniversalAgentValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = UniversalAgentValidationError{} - -// Validate checks the field values on ListAgentsRequest 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 *ListAgentsRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ListAgentsRequest 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 -// ListAgentsRequestMultiError, or nil if none found. -func (m *ListAgentsRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *ListAgentsRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for ServiceId - - // no validation rules for NodeId - - if len(errors) > 0 { - return ListAgentsRequestMultiError(errors) - } - - return nil -} - -// ListAgentsRequestMultiError is an error wrapping multiple validation errors -// returned by ListAgentsRequest.ValidateAll() if the designated constraints -// aren't met. -type ListAgentsRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ListAgentsRequestMultiError) 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 ListAgentsRequestMultiError) AllErrors() []error { return m } - -// ListAgentsRequestValidationError is the validation error returned by -// ListAgentsRequest.Validate if the designated constraints aren't met. -type ListAgentsRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ListAgentsRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ListAgentsRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ListAgentsRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ListAgentsRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ListAgentsRequestValidationError) ErrorName() string { - return "ListAgentsRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e ListAgentsRequestValidationError) 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 %sListAgentsRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ListAgentsRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ListAgentsRequestValidationError{} - -// Validate checks the field values on ListAgentsResponse 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 *ListAgentsResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ListAgentsResponse 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 -// ListAgentsResponseMultiError, or nil if none found. -func (m *ListAgentsResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *ListAgentsResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - for idx, item := range m.GetAgents() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ListAgentsResponseValidationError{ - field: fmt.Sprintf("Agents[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ListAgentsResponseValidationError{ - field: fmt.Sprintf("Agents[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ListAgentsResponseValidationError{ - field: fmt.Sprintf("Agents[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - if len(errors) > 0 { - return ListAgentsResponseMultiError(errors) - } - - return nil -} - -// ListAgentsResponseMultiError is an error wrapping multiple validation errors -// returned by ListAgentsResponse.ValidateAll() if the designated constraints -// aren't met. -type ListAgentsResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ListAgentsResponseMultiError) 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 ListAgentsResponseMultiError) AllErrors() []error { return m } - -// ListAgentsResponseValidationError is the validation error returned by -// ListAgentsResponse.Validate if the designated constraints aren't met. -type ListAgentsResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ListAgentsResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ListAgentsResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ListAgentsResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ListAgentsResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ListAgentsResponseValidationError) ErrorName() string { - return "ListAgentsResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e ListAgentsResponseValidationError) 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 %sListAgentsResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ListAgentsResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ListAgentsResponseValidationError{} - -// Validate checks the field values on AgentVersions 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 *AgentVersions) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on AgentVersions 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 AgentVersionsMultiError, or -// nil if none found. -func (m *AgentVersions) ValidateAll() error { - return m.validate(true) -} - -func (m *AgentVersions) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for AgentId - - // no validation rules for Version - - // no validation rules for NodeName - - // no validation rules for Severity - - if len(errors) > 0 { - return AgentVersionsMultiError(errors) - } - - return nil -} - -// AgentVersionsMultiError is an error wrapping multiple validation errors -// returned by AgentVersions.ValidateAll() if the designated constraints -// aren't met. -type AgentVersionsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m AgentVersionsMultiError) 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 AgentVersionsMultiError) AllErrors() []error { return m } - -// AgentVersionsValidationError is the validation error returned by -// AgentVersions.Validate if the designated constraints aren't met. -type AgentVersionsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e AgentVersionsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e AgentVersionsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e AgentVersionsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e AgentVersionsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e AgentVersionsValidationError) ErrorName() string { return "AgentVersionsValidationError" } - -// Error satisfies the builtin error interface -func (e AgentVersionsValidationError) 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 %sAgentVersions.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = AgentVersionsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = AgentVersionsValidationError{} - -// Validate checks the field values on ListAgentVersionsRequest 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 *ListAgentVersionsRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ListAgentVersionsRequest 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 -// ListAgentVersionsRequestMultiError, or nil if none found. -func (m *ListAgentVersionsRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *ListAgentVersionsRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return ListAgentVersionsRequestMultiError(errors) - } - - return nil -} - -// ListAgentVersionsRequestMultiError is an error wrapping multiple validation -// errors returned by ListAgentVersionsRequest.ValidateAll() if the designated -// constraints aren't met. -type ListAgentVersionsRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ListAgentVersionsRequestMultiError) 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 ListAgentVersionsRequestMultiError) AllErrors() []error { return m } - -// ListAgentVersionsRequestValidationError is the validation error returned by -// ListAgentVersionsRequest.Validate if the designated constraints aren't met. -type ListAgentVersionsRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ListAgentVersionsRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ListAgentVersionsRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ListAgentVersionsRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ListAgentVersionsRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ListAgentVersionsRequestValidationError) ErrorName() string { - return "ListAgentVersionsRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e ListAgentVersionsRequestValidationError) 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 %sListAgentVersionsRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ListAgentVersionsRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ListAgentVersionsRequestValidationError{} - -// Validate checks the field values on ListAgentVersionsResponse 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 *ListAgentVersionsResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ListAgentVersionsResponse 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 -// ListAgentVersionsResponseMultiError, or nil if none found. -func (m *ListAgentVersionsResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *ListAgentVersionsResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - for idx, item := range m.GetAgentVersions() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ListAgentVersionsResponseValidationError{ - field: fmt.Sprintf("AgentVersions[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ListAgentVersionsResponseValidationError{ - field: fmt.Sprintf("AgentVersions[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ListAgentVersionsResponseValidationError{ - field: fmt.Sprintf("AgentVersions[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - if len(errors) > 0 { - return ListAgentVersionsResponseMultiError(errors) - } - - return nil -} - -// ListAgentVersionsResponseMultiError is an error wrapping multiple validation -// errors returned by ListAgentVersionsResponse.ValidateAll() if the -// designated constraints aren't met. -type ListAgentVersionsResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ListAgentVersionsResponseMultiError) 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 ListAgentVersionsResponseMultiError) AllErrors() []error { return m } - -// ListAgentVersionsResponseValidationError is the validation error returned by -// ListAgentVersionsResponse.Validate if the designated constraints aren't met. -type ListAgentVersionsResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ListAgentVersionsResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ListAgentVersionsResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ListAgentVersionsResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ListAgentVersionsResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ListAgentVersionsResponseValidationError) ErrorName() string { - return "ListAgentVersionsResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e ListAgentVersionsResponseValidationError) 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 %sListAgentVersionsResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ListAgentVersionsResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ListAgentVersionsResponseValidationError{} - -// Validate checks the field values on UniversalAgent_MySQLOptions 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 *UniversalAgent_MySQLOptions) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on UniversalAgent_MySQLOptions 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 -// UniversalAgent_MySQLOptionsMultiError, or nil if none found. -func (m *UniversalAgent_MySQLOptions) ValidateAll() error { - return m.validate(true) -} - -func (m *UniversalAgent_MySQLOptions) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for IsTlsKeySet - - // no validation rules for ExtraDsnParams - - if len(errors) > 0 { - return UniversalAgent_MySQLOptionsMultiError(errors) - } - - return nil -} - -// UniversalAgent_MySQLOptionsMultiError is an error wrapping multiple -// validation errors returned by UniversalAgent_MySQLOptions.ValidateAll() if -// the designated constraints aren't met. -type UniversalAgent_MySQLOptionsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m UniversalAgent_MySQLOptionsMultiError) 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 UniversalAgent_MySQLOptionsMultiError) AllErrors() []error { return m } - -// UniversalAgent_MySQLOptionsValidationError is the validation error returned -// by UniversalAgent_MySQLOptions.Validate if the designated constraints -// aren't met. -type UniversalAgent_MySQLOptionsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e UniversalAgent_MySQLOptionsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e UniversalAgent_MySQLOptionsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e UniversalAgent_MySQLOptionsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e UniversalAgent_MySQLOptionsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e UniversalAgent_MySQLOptionsValidationError) ErrorName() string { - return "UniversalAgent_MySQLOptionsValidationError" -} - -// Error satisfies the builtin error interface -func (e UniversalAgent_MySQLOptionsValidationError) 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 %sUniversalAgent_MySQLOptions.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = UniversalAgent_MySQLOptionsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = UniversalAgent_MySQLOptionsValidationError{} - -// Validate checks the field values on UniversalAgent_AzureOptions 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 *UniversalAgent_AzureOptions) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on UniversalAgent_AzureOptions 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 -// UniversalAgent_AzureOptionsMultiError, or nil if none found. -func (m *UniversalAgent_AzureOptions) ValidateAll() error { - return m.validate(true) -} - -func (m *UniversalAgent_AzureOptions) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for ClientId - - // no validation rules for IsClientSecretSet - - // no validation rules for ResourceGroup - - // no validation rules for SubscriptionId - - // no validation rules for TenantId - - if len(errors) > 0 { - return UniversalAgent_AzureOptionsMultiError(errors) - } - - return nil -} - -// UniversalAgent_AzureOptionsMultiError is an error wrapping multiple -// validation errors returned by UniversalAgent_AzureOptions.ValidateAll() if -// the designated constraints aren't met. -type UniversalAgent_AzureOptionsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m UniversalAgent_AzureOptionsMultiError) 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 UniversalAgent_AzureOptionsMultiError) AllErrors() []error { return m } - -// UniversalAgent_AzureOptionsValidationError is the validation error returned -// by UniversalAgent_AzureOptions.Validate if the designated constraints -// aren't met. -type UniversalAgent_AzureOptionsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e UniversalAgent_AzureOptionsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e UniversalAgent_AzureOptionsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e UniversalAgent_AzureOptionsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e UniversalAgent_AzureOptionsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e UniversalAgent_AzureOptionsValidationError) ErrorName() string { - return "UniversalAgent_AzureOptionsValidationError" -} - -// Error satisfies the builtin error interface -func (e UniversalAgent_AzureOptionsValidationError) 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 %sUniversalAgent_AzureOptions.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = UniversalAgent_AzureOptionsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = UniversalAgent_AzureOptionsValidationError{} - -// Validate checks the field values on UniversalAgent_MongoDBOptions 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 *UniversalAgent_MongoDBOptions) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on UniversalAgent_MongoDBOptions 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 -// UniversalAgent_MongoDBOptionsMultiError, or nil if none found. -func (m *UniversalAgent_MongoDBOptions) ValidateAll() error { - return m.validate(true) -} - -func (m *UniversalAgent_MongoDBOptions) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for IsTlsCertificateKeySet - - // no validation rules for IsTlsCertificateKeyFilePasswordSet - - // no validation rules for AuthenticationMechanism - - // no validation rules for AuthenticationDatabase - - // no validation rules for CollectionsLimit - - // no validation rules for EnableAllCollectors - - if len(errors) > 0 { - return UniversalAgent_MongoDBOptionsMultiError(errors) - } - - return nil -} - -// UniversalAgent_MongoDBOptionsMultiError is an error wrapping multiple -// validation errors returned by UniversalAgent_MongoDBOptions.ValidateAll() -// if the designated constraints aren't met. -type UniversalAgent_MongoDBOptionsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m UniversalAgent_MongoDBOptionsMultiError) 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 UniversalAgent_MongoDBOptionsMultiError) AllErrors() []error { return m } - -// UniversalAgent_MongoDBOptionsValidationError is the validation error -// returned by UniversalAgent_MongoDBOptions.Validate if the designated -// constraints aren't met. -type UniversalAgent_MongoDBOptionsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e UniversalAgent_MongoDBOptionsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e UniversalAgent_MongoDBOptionsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e UniversalAgent_MongoDBOptionsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e UniversalAgent_MongoDBOptionsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e UniversalAgent_MongoDBOptionsValidationError) ErrorName() string { - return "UniversalAgent_MongoDBOptionsValidationError" -} - -// Error satisfies the builtin error interface -func (e UniversalAgent_MongoDBOptionsValidationError) 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 %sUniversalAgent_MongoDBOptions.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = UniversalAgent_MongoDBOptionsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = UniversalAgent_MongoDBOptionsValidationError{} - -// Validate checks the field values on UniversalAgent_PostgreSQLOptions 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 *UniversalAgent_PostgreSQLOptions) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on UniversalAgent_PostgreSQLOptions 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 -// UniversalAgent_PostgreSQLOptionsMultiError, or nil if none found. -func (m *UniversalAgent_PostgreSQLOptions) ValidateAll() error { - return m.validate(true) -} - -func (m *UniversalAgent_PostgreSQLOptions) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for IsSslKeySet - - // no validation rules for AutoDiscoveryLimit - - // no validation rules for MaxExporterConnections - - if len(errors) > 0 { - return UniversalAgent_PostgreSQLOptionsMultiError(errors) - } - - return nil -} - -// UniversalAgent_PostgreSQLOptionsMultiError is an error wrapping multiple -// validation errors returned by -// UniversalAgent_PostgreSQLOptions.ValidateAll() if the designated -// constraints aren't met. -type UniversalAgent_PostgreSQLOptionsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m UniversalAgent_PostgreSQLOptionsMultiError) 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 UniversalAgent_PostgreSQLOptionsMultiError) AllErrors() []error { return m } - -// UniversalAgent_PostgreSQLOptionsValidationError is the validation error -// returned by UniversalAgent_PostgreSQLOptions.Validate if the designated -// constraints aren't met. -type UniversalAgent_PostgreSQLOptionsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e UniversalAgent_PostgreSQLOptionsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e UniversalAgent_PostgreSQLOptionsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e UniversalAgent_PostgreSQLOptionsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e UniversalAgent_PostgreSQLOptionsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e UniversalAgent_PostgreSQLOptionsValidationError) ErrorName() string { - return "UniversalAgent_PostgreSQLOptionsValidationError" -} - -// Error satisfies the builtin error interface -func (e UniversalAgent_PostgreSQLOptionsValidationError) 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 %sUniversalAgent_PostgreSQLOptions.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = UniversalAgent_PostgreSQLOptionsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = UniversalAgent_PostgreSQLOptionsValidationError{} - -// Validate checks the field values on UniversalAgent_ValkeyOptions 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 *UniversalAgent_ValkeyOptions) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on UniversalAgent_ValkeyOptions 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 -// UniversalAgent_ValkeyOptionsMultiError, or nil if none found. -func (m *UniversalAgent_ValkeyOptions) ValidateAll() error { - return m.validate(true) -} - -func (m *UniversalAgent_ValkeyOptions) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return UniversalAgent_ValkeyOptionsMultiError(errors) - } - - return nil -} - -// UniversalAgent_ValkeyOptionsMultiError is an error wrapping multiple -// validation errors returned by UniversalAgent_ValkeyOptions.ValidateAll() if -// the designated constraints aren't met. -type UniversalAgent_ValkeyOptionsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m UniversalAgent_ValkeyOptionsMultiError) 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 UniversalAgent_ValkeyOptionsMultiError) AllErrors() []error { return m } - -// UniversalAgent_ValkeyOptionsValidationError is the validation error returned -// by UniversalAgent_ValkeyOptions.Validate if the designated constraints -// aren't met. -type UniversalAgent_ValkeyOptionsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e UniversalAgent_ValkeyOptionsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e UniversalAgent_ValkeyOptionsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e UniversalAgent_ValkeyOptionsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e UniversalAgent_ValkeyOptionsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e UniversalAgent_ValkeyOptionsValidationError) ErrorName() string { - return "UniversalAgent_ValkeyOptionsValidationError" -} - -// Error satisfies the builtin error interface -func (e UniversalAgent_ValkeyOptionsValidationError) 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 %sUniversalAgent_ValkeyOptions.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = UniversalAgent_ValkeyOptionsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = UniversalAgent_ValkeyOptionsValidationError{} diff --git a/api/management/v1/annotation.pb.go b/api/management/v1/annotation.pb.go deleted file mode 100644 index ade934de3f1..00000000000 --- a/api/management/v1/annotation.pb.go +++ /dev/null @@ -1,198 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.10 -// protoc (unknown) -// source: management/v1/annotation.proto - -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" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// AddAnnotationRequest is a params to add new annotation. -type AddAnnotationRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // An annotation description. Required. - Text string `protobuf:"bytes,1,opt,name=text,proto3" json:"text,omitempty"` - // Tags are used to filter annotations. - Tags []string `protobuf:"bytes,2,rep,name=tags,proto3" json:"tags,omitempty"` - // Used for annotating a node. - NodeName string `protobuf:"bytes,3,opt,name=node_name,json=nodeName,proto3" json:"node_name,omitempty"` - // Used for annotating services. - ServiceNames []string `protobuf:"bytes,4,rep,name=service_names,json=serviceNames,proto3" json:"service_names,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AddAnnotationRequest) Reset() { - *x = AddAnnotationRequest{} - mi := &file_management_v1_annotation_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AddAnnotationRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddAnnotationRequest) ProtoMessage() {} - -func (x *AddAnnotationRequest) ProtoReflect() protoreflect.Message { - mi := &file_management_v1_annotation_proto_msgTypes[0] - 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 AddAnnotationRequest.ProtoReflect.Descriptor instead. -func (*AddAnnotationRequest) Descriptor() ([]byte, []int) { - return file_management_v1_annotation_proto_rawDescGZIP(), []int{0} -} - -func (x *AddAnnotationRequest) GetText() string { - if x != nil { - return x.Text - } - return "" -} - -func (x *AddAnnotationRequest) GetTags() []string { - if x != nil { - return x.Tags - } - return nil -} - -func (x *AddAnnotationRequest) GetNodeName() string { - if x != nil { - return x.NodeName - } - return "" -} - -func (x *AddAnnotationRequest) GetServiceNames() []string { - if x != nil { - return x.ServiceNames - } - return nil -} - -type AddAnnotationResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AddAnnotationResponse) Reset() { - *x = AddAnnotationResponse{} - mi := &file_management_v1_annotation_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AddAnnotationResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddAnnotationResponse) ProtoMessage() {} - -func (x *AddAnnotationResponse) ProtoReflect() protoreflect.Message { - mi := &file_management_v1_annotation_proto_msgTypes[1] - 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 AddAnnotationResponse.ProtoReflect.Descriptor instead. -func (*AddAnnotationResponse) Descriptor() ([]byte, []int) { - return file_management_v1_annotation_proto_rawDescGZIP(), []int{1} -} - -var File_management_v1_annotation_proto protoreflect.FileDescriptor - -const file_management_v1_annotation_proto_rawDesc = "" + - "\n" + - "\x1emanagement/v1/annotation.proto\x12\rmanagement.v1\x1a\x17validate/validate.proto\"\x89\x01\n" + - "\x14AddAnnotationRequest\x12\x1b\n" + - "\x04text\x18\x01 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\x04text\x12\x12\n" + - "\x04tags\x18\x02 \x03(\tR\x04tags\x12\x1b\n" + - "\tnode_name\x18\x03 \x01(\tR\bnodeName\x12#\n" + - "\rservice_names\x18\x04 \x03(\tR\fserviceNames\"\x17\n" + - "\x15AddAnnotationResponseB\xb0\x01\n" + - "\x11com.management.v1B\x0fAnnotationProtoP\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 ( - file_management_v1_annotation_proto_rawDescOnce sync.Once - file_management_v1_annotation_proto_rawDescData []byte -) - -func file_management_v1_annotation_proto_rawDescGZIP() []byte { - file_management_v1_annotation_proto_rawDescOnce.Do(func() { - file_management_v1_annotation_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_management_v1_annotation_proto_rawDesc), len(file_management_v1_annotation_proto_rawDesc))) - }) - 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_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_management_v1_annotation_proto_init() } -func file_management_v1_annotation_proto_init() { - if File_management_v1_annotation_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_management_v1_annotation_proto_rawDesc), len(file_management_v1_annotation_proto_rawDesc)), - NumEnums: 0, - NumMessages: 2, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_management_v1_annotation_proto_goTypes, - DependencyIndexes: file_management_v1_annotation_proto_depIdxs, - MessageInfos: file_management_v1_annotation_proto_msgTypes, - }.Build() - File_management_v1_annotation_proto = out.File - file_management_v1_annotation_proto_goTypes = nil - file_management_v1_annotation_proto_depIdxs = nil -} diff --git a/api/management/v1/annotation.pb.validate.go b/api/management/v1/annotation.pb.validate.go deleted file mode 100644 index 2a157cc3722..00000000000 --- a/api/management/v1/annotation.pb.validate.go +++ /dev/null @@ -1,253 +0,0 @@ -// Code generated by protoc-gen-validate. DO NOT EDIT. -// source: management/v1/annotation.proto - -package managementv1 - -import ( - "bytes" - "errors" - "fmt" - "net" - "net/mail" - "net/url" - "regexp" - "sort" - "strings" - "time" - "unicode/utf8" - - "google.golang.org/protobuf/types/known/anypb" -) - -// ensure the imports are used -var ( - _ = bytes.MinRead - _ = errors.New("") - _ = fmt.Print - _ = utf8.UTFMax - _ = (*regexp.Regexp)(nil) - _ = (*strings.Reader)(nil) - _ = net.IPv4len - _ = time.Duration(0) - _ = (*url.URL)(nil) - _ = (*mail.Address)(nil) - _ = anypb.Any{} - _ = sort.Sort -) - -// Validate checks the field values on AddAnnotationRequest 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 *AddAnnotationRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on AddAnnotationRequest 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 -// AddAnnotationRequestMultiError, or nil if none found. -func (m *AddAnnotationRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *AddAnnotationRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetText()) < 1 { - err := AddAnnotationRequestValidationError{ - field: "Text", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for NodeName - - if len(errors) > 0 { - return AddAnnotationRequestMultiError(errors) - } - - return nil -} - -// AddAnnotationRequestMultiError is an error wrapping multiple validation -// errors returned by AddAnnotationRequest.ValidateAll() if the designated -// constraints aren't met. -type AddAnnotationRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m AddAnnotationRequestMultiError) 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 AddAnnotationRequestMultiError) AllErrors() []error { return m } - -// AddAnnotationRequestValidationError is the validation error returned by -// AddAnnotationRequest.Validate if the designated constraints aren't met. -type AddAnnotationRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e AddAnnotationRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e AddAnnotationRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e AddAnnotationRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e AddAnnotationRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e AddAnnotationRequestValidationError) ErrorName() string { - return "AddAnnotationRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e AddAnnotationRequestValidationError) 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 %sAddAnnotationRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = AddAnnotationRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = AddAnnotationRequestValidationError{} - -// Validate checks the field values on AddAnnotationResponse 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 *AddAnnotationResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on AddAnnotationResponse 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 -// AddAnnotationResponseMultiError, or nil if none found. -func (m *AddAnnotationResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *AddAnnotationResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return AddAnnotationResponseMultiError(errors) - } - - return nil -} - -// AddAnnotationResponseMultiError is an error wrapping multiple validation -// errors returned by AddAnnotationResponse.ValidateAll() if the designated -// constraints aren't met. -type AddAnnotationResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m AddAnnotationResponseMultiError) 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 AddAnnotationResponseMultiError) AllErrors() []error { return m } - -// AddAnnotationResponseValidationError is the validation error returned by -// AddAnnotationResponse.Validate if the designated constraints aren't met. -type AddAnnotationResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e AddAnnotationResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e AddAnnotationResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e AddAnnotationResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e AddAnnotationResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e AddAnnotationResponseValidationError) ErrorName() string { - return "AddAnnotationResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e AddAnnotationResponseValidationError) 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 %sAddAnnotationResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = AddAnnotationResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = AddAnnotationResponseValidationError{} diff --git a/api/management/v1/azure.pb.go b/api/management/v1/azure.pb.go deleted file mode 100644 index 428d59ef43e..00000000000 --- a/api/management/v1/azure.pb.go +++ /dev/null @@ -1,751 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.10 -// protoc (unknown) -// source: management/v1/azure.proto - -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" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// DiscoverAzureDatabaseType describes supported Azure Database instance engines. -type DiscoverAzureDatabaseType int32 - -const ( - DiscoverAzureDatabaseType_DISCOVER_AZURE_DATABASE_TYPE_UNSPECIFIED DiscoverAzureDatabaseType = 0 - // MySQL type: microsoft.dbformysql or MariaDB type: microsoft.dbformariadb - DiscoverAzureDatabaseType_DISCOVER_AZURE_DATABASE_TYPE_MYSQL DiscoverAzureDatabaseType = 1 - // PostgreSQL type: microsoft.dbformysql - DiscoverAzureDatabaseType_DISCOVER_AZURE_DATABASE_TYPE_POSTGRESQL DiscoverAzureDatabaseType = 2 -) - -// Enum value maps for DiscoverAzureDatabaseType. -var ( - DiscoverAzureDatabaseType_name = map[int32]string{ - 0: "DISCOVER_AZURE_DATABASE_TYPE_UNSPECIFIED", - 1: "DISCOVER_AZURE_DATABASE_TYPE_MYSQL", - 2: "DISCOVER_AZURE_DATABASE_TYPE_POSTGRESQL", - } - DiscoverAzureDatabaseType_value = map[string]int32{ - "DISCOVER_AZURE_DATABASE_TYPE_UNSPECIFIED": 0, - "DISCOVER_AZURE_DATABASE_TYPE_MYSQL": 1, - "DISCOVER_AZURE_DATABASE_TYPE_POSTGRESQL": 2, - } -) - -func (x DiscoverAzureDatabaseType) Enum() *DiscoverAzureDatabaseType { - p := new(DiscoverAzureDatabaseType) - *p = x - return p -} - -func (x DiscoverAzureDatabaseType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (DiscoverAzureDatabaseType) Descriptor() protoreflect.EnumDescriptor { - return file_management_v1_azure_proto_enumTypes[0].Descriptor() -} - -func (DiscoverAzureDatabaseType) Type() protoreflect.EnumType { - return &file_management_v1_azure_proto_enumTypes[0] -} - -func (x DiscoverAzureDatabaseType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use DiscoverAzureDatabaseType.Descriptor instead. -func (DiscoverAzureDatabaseType) EnumDescriptor() ([]byte, []int) { - return file_management_v1_azure_proto_rawDescGZIP(), []int{0} -} - -// DiscoverAzureDatabaseRequest discover azure databases request. -type DiscoverAzureDatabaseRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Azure client ID. - AzureClientId string `protobuf:"bytes,1,opt,name=azure_client_id,json=azureClientId,proto3" json:"azure_client_id,omitempty"` - // Azure client secret. - AzureClientSecret string `protobuf:"bytes,2,opt,name=azure_client_secret,json=azureClientSecret,proto3" json:"azure_client_secret,omitempty"` - // Azure tanant ID. - AzureTenantId string `protobuf:"bytes,3,opt,name=azure_tenant_id,json=azureTenantId,proto3" json:"azure_tenant_id,omitempty"` - // Azure subscription ID. - AzureSubscriptionId string `protobuf:"bytes,4,opt,name=azure_subscription_id,json=azureSubscriptionId,proto3" json:"azure_subscription_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DiscoverAzureDatabaseRequest) Reset() { - *x = DiscoverAzureDatabaseRequest{} - mi := &file_management_v1_azure_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DiscoverAzureDatabaseRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DiscoverAzureDatabaseRequest) ProtoMessage() {} - -func (x *DiscoverAzureDatabaseRequest) ProtoReflect() protoreflect.Message { - mi := &file_management_v1_azure_proto_msgTypes[0] - 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 DiscoverAzureDatabaseRequest.ProtoReflect.Descriptor instead. -func (*DiscoverAzureDatabaseRequest) Descriptor() ([]byte, []int) { - return file_management_v1_azure_proto_rawDescGZIP(), []int{0} -} - -func (x *DiscoverAzureDatabaseRequest) GetAzureClientId() string { - if x != nil { - return x.AzureClientId - } - return "" -} - -func (x *DiscoverAzureDatabaseRequest) GetAzureClientSecret() string { - if x != nil { - return x.AzureClientSecret - } - return "" -} - -func (x *DiscoverAzureDatabaseRequest) GetAzureTenantId() string { - if x != nil { - return x.AzureTenantId - } - return "" -} - -func (x *DiscoverAzureDatabaseRequest) GetAzureSubscriptionId() string { - if x != nil { - return x.AzureSubscriptionId - } - return "" -} - -// DiscoverAzureDatabaseInstance models an unique Azure Database instance for the list of instances returned by Discovery. -type DiscoverAzureDatabaseInstance struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Azure database instance ID. - InstanceId string `protobuf:"bytes,1,opt,name=instance_id,json=instanceId,proto3" json:"instance_id,omitempty"` - // Azure database location. - Region string `protobuf:"bytes,2,opt,name=region,proto3" json:"region,omitempty"` - // Azure database server name. - ServiceName string `protobuf:"bytes,3,opt,name=service_name,json=serviceName,proto3" json:"service_name,omitempty"` - // Database username. - Username string `protobuf:"bytes,4,opt,name=username,proto3" json:"username,omitempty"` - // Address used to connect to it. - Address string `protobuf:"bytes,5,opt,name=address,proto3" json:"address,omitempty"` - // Azure Resource group. - AzureResourceGroup string `protobuf:"bytes,6,opt,name=azure_resource_group,json=azureResourceGroup,proto3" json:"azure_resource_group,omitempty"` - // Environment tag. - Environment string `protobuf:"bytes,7,opt,name=environment,proto3" json:"environment,omitempty"` - // Database type. - Type DiscoverAzureDatabaseType `protobuf:"varint,8,opt,name=type,proto3,enum=management.v1.DiscoverAzureDatabaseType" json:"type,omitempty"` - // Azure database availability zone. - Az string `protobuf:"bytes,9,opt,name=az,proto3" 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 `protobuf:"bytes,10,opt,name=node_model,json=nodeModel,proto3" json:"node_model,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DiscoverAzureDatabaseInstance) Reset() { - *x = DiscoverAzureDatabaseInstance{} - mi := &file_management_v1_azure_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DiscoverAzureDatabaseInstance) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DiscoverAzureDatabaseInstance) ProtoMessage() {} - -func (x *DiscoverAzureDatabaseInstance) ProtoReflect() protoreflect.Message { - mi := &file_management_v1_azure_proto_msgTypes[1] - 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 DiscoverAzureDatabaseInstance.ProtoReflect.Descriptor instead. -func (*DiscoverAzureDatabaseInstance) Descriptor() ([]byte, []int) { - return file_management_v1_azure_proto_rawDescGZIP(), []int{1} -} - -func (x *DiscoverAzureDatabaseInstance) GetInstanceId() string { - if x != nil { - return x.InstanceId - } - return "" -} - -func (x *DiscoverAzureDatabaseInstance) GetRegion() string { - if x != nil { - return x.Region - } - return "" -} - -func (x *DiscoverAzureDatabaseInstance) GetServiceName() string { - if x != nil { - return x.ServiceName - } - return "" -} - -func (x *DiscoverAzureDatabaseInstance) GetUsername() string { - if x != nil { - return x.Username - } - return "" -} - -func (x *DiscoverAzureDatabaseInstance) GetAddress() string { - if x != nil { - return x.Address - } - return "" -} - -func (x *DiscoverAzureDatabaseInstance) GetAzureResourceGroup() string { - if x != nil { - return x.AzureResourceGroup - } - return "" -} - -func (x *DiscoverAzureDatabaseInstance) GetEnvironment() string { - if x != nil { - return x.Environment - } - return "" -} - -func (x *DiscoverAzureDatabaseInstance) GetType() DiscoverAzureDatabaseType { - if x != nil { - return x.Type - } - return DiscoverAzureDatabaseType_DISCOVER_AZURE_DATABASE_TYPE_UNSPECIFIED -} - -func (x *DiscoverAzureDatabaseInstance) GetAz() string { - if x != nil { - return x.Az - } - return "" -} - -func (x *DiscoverAzureDatabaseInstance) GetNodeModel() string { - if x != nil { - return x.NodeModel - } - return "" -} - -// DiscoverAzureDatabaseResponse discover azure databases response. -type DiscoverAzureDatabaseResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - AzureDatabaseInstance []*DiscoverAzureDatabaseInstance `protobuf:"bytes,1,rep,name=azure_database_instance,json=azureDatabaseInstance,proto3" json:"azure_database_instance,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DiscoverAzureDatabaseResponse) Reset() { - *x = DiscoverAzureDatabaseResponse{} - mi := &file_management_v1_azure_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DiscoverAzureDatabaseResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DiscoverAzureDatabaseResponse) ProtoMessage() {} - -func (x *DiscoverAzureDatabaseResponse) ProtoReflect() protoreflect.Message { - mi := &file_management_v1_azure_proto_msgTypes[2] - 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 DiscoverAzureDatabaseResponse.ProtoReflect.Descriptor instead. -func (*DiscoverAzureDatabaseResponse) Descriptor() ([]byte, []int) { - return file_management_v1_azure_proto_rawDescGZIP(), []int{2} -} - -func (x *DiscoverAzureDatabaseResponse) GetAzureDatabaseInstance() []*DiscoverAzureDatabaseInstance { - if x != nil { - return x.AzureDatabaseInstance - } - return nil -} - -type AddAzureDatabaseRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Azure database location. - Region string `protobuf:"bytes,1,opt,name=region,proto3" json:"region,omitempty"` - // Azure database availability zone. - Az string `protobuf:"bytes,2,opt,name=az,proto3" json:"az,omitempty"` - // Azure database instance ID. - InstanceId string `protobuf:"bytes,3,opt,name=instance_id,json=instanceId,proto3" json:"instance_id,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 `protobuf:"bytes,4,opt,name=node_model,json=nodeModel,proto3" json:"node_model,omitempty"` - // Address used to connect to it. - Address string `protobuf:"bytes,5,opt,name=address,proto3" json:"address,omitempty"` - // Access port. - Port uint32 `protobuf:"varint,6,opt,name=port,proto3" json:"port,omitempty"` - // Unique across all Nodes user-defined name. Defaults to Azure Database instance ID. - NodeName string `protobuf:"bytes,7,opt,name=node_name,json=nodeName,proto3" json:"node_name,omitempty"` - // Unique across all Services user-defined name. Defaults to Azure Database instance ID. - ServiceName string `protobuf:"bytes,8,opt,name=service_name,json=serviceName,proto3" json:"service_name,omitempty"` - // Environment name. - Environment string `protobuf:"bytes,9,opt,name=environment,proto3" json:"environment,omitempty"` - // Username for scraping metrics. - Username string `protobuf:"bytes,10,opt,name=username,proto3" json:"username,omitempty"` - // Password for scraping metrics. - Password string `protobuf:"bytes,11,opt,name=password,proto3" json:"password,omitempty"` - // Azure client ID. - AzureClientId string `protobuf:"bytes,12,opt,name=azure_client_id,json=azureClientId,proto3" json:"azure_client_id,omitempty"` - // Azure client secret. - AzureClientSecret string `protobuf:"bytes,13,opt,name=azure_client_secret,json=azureClientSecret,proto3" json:"azure_client_secret,omitempty"` - // Azure tanant ID. - AzureTenantId string `protobuf:"bytes,14,opt,name=azure_tenant_id,json=azureTenantId,proto3" json:"azure_tenant_id,omitempty"` - // Azure subscription ID. - AzureSubscriptionId string `protobuf:"bytes,15,opt,name=azure_subscription_id,json=azureSubscriptionId,proto3" json:"azure_subscription_id,omitempty"` - // Azure resource group. - AzureResourceGroup string `protobuf:"bytes,16,opt,name=azure_resource_group,json=azureResourceGroup,proto3" json:"azure_resource_group,omitempty"` - // If true, adds azure_database_exporter. - AzureDatabaseExporter bool `protobuf:"varint,17,opt,name=azure_database_exporter,json=azureDatabaseExporter,proto3" json:"azure_database_exporter,omitempty"` - // If true, adds qan-mysql-perfschema-agent or qan-postgresql-pgstatements-agent. - Qan bool `protobuf:"varint,18,opt,name=qan,proto3" json:"qan,omitempty"` - // Custom user-assigned labels for Node and Service. - CustomLabels map[string]string `protobuf:"bytes,19,rep,name=custom_labels,json=customLabels,proto3" json:"custom_labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - // Skip connection check. - SkipConnectionCheck bool `protobuf:"varint,20,opt,name=skip_connection_check,json=skipConnectionCheck,proto3" json:"skip_connection_check,omitempty"` - // Use TLS for database connections. - Tls bool `protobuf:"varint,21,opt,name=tls,proto3" json:"tls,omitempty"` - // Skip TLS certificate and hostname validation. - TlsSkipVerify bool `protobuf:"varint,22,opt,name=tls_skip_verify,json=tlsSkipVerify,proto3" json:"tls_skip_verify,omitempty"` - // Disable query examples. - DisableQueryExamples bool `protobuf:"varint,23,opt,name=disable_query_examples,json=disableQueryExamples,proto3" json:"disable_query_examples,omitempty"` - // Tablestats group collectors will be disabled if there are more than that number of tables. - // If zero, server's default value is used. - // Use negative value to disable them. - TablestatsGroupTableLimit int32 `protobuf:"varint,24,opt,name=tablestats_group_table_limit,json=tablestatsGroupTableLimit,proto3" json:"tablestats_group_table_limit,omitempty"` - // Azure database resource type (mysql, maria, postgres) - Type DiscoverAzureDatabaseType `protobuf:"varint,25,opt,name=type,proto3,enum=management.v1.DiscoverAzureDatabaseType" json:"type,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AddAzureDatabaseRequest) Reset() { - *x = AddAzureDatabaseRequest{} - mi := &file_management_v1_azure_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AddAzureDatabaseRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddAzureDatabaseRequest) ProtoMessage() {} - -func (x *AddAzureDatabaseRequest) ProtoReflect() protoreflect.Message { - mi := &file_management_v1_azure_proto_msgTypes[3] - 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 AddAzureDatabaseRequest.ProtoReflect.Descriptor instead. -func (*AddAzureDatabaseRequest) Descriptor() ([]byte, []int) { - return file_management_v1_azure_proto_rawDescGZIP(), []int{3} -} - -func (x *AddAzureDatabaseRequest) GetRegion() string { - if x != nil { - return x.Region - } - return "" -} - -func (x *AddAzureDatabaseRequest) GetAz() string { - if x != nil { - return x.Az - } - return "" -} - -func (x *AddAzureDatabaseRequest) GetInstanceId() string { - if x != nil { - return x.InstanceId - } - return "" -} - -func (x *AddAzureDatabaseRequest) GetNodeModel() string { - if x != nil { - return x.NodeModel - } - return "" -} - -func (x *AddAzureDatabaseRequest) GetAddress() string { - if x != nil { - return x.Address - } - return "" -} - -func (x *AddAzureDatabaseRequest) GetPort() uint32 { - if x != nil { - return x.Port - } - return 0 -} - -func (x *AddAzureDatabaseRequest) GetNodeName() string { - if x != nil { - return x.NodeName - } - return "" -} - -func (x *AddAzureDatabaseRequest) GetServiceName() string { - if x != nil { - return x.ServiceName - } - return "" -} - -func (x *AddAzureDatabaseRequest) GetEnvironment() string { - if x != nil { - return x.Environment - } - return "" -} - -func (x *AddAzureDatabaseRequest) GetUsername() string { - if x != nil { - return x.Username - } - return "" -} - -func (x *AddAzureDatabaseRequest) GetPassword() string { - if x != nil { - return x.Password - } - return "" -} - -func (x *AddAzureDatabaseRequest) GetAzureClientId() string { - if x != nil { - return x.AzureClientId - } - return "" -} - -func (x *AddAzureDatabaseRequest) GetAzureClientSecret() string { - if x != nil { - return x.AzureClientSecret - } - return "" -} - -func (x *AddAzureDatabaseRequest) GetAzureTenantId() string { - if x != nil { - return x.AzureTenantId - } - return "" -} - -func (x *AddAzureDatabaseRequest) GetAzureSubscriptionId() string { - if x != nil { - return x.AzureSubscriptionId - } - return "" -} - -func (x *AddAzureDatabaseRequest) GetAzureResourceGroup() string { - if x != nil { - return x.AzureResourceGroup - } - return "" -} - -func (x *AddAzureDatabaseRequest) GetAzureDatabaseExporter() bool { - if x != nil { - return x.AzureDatabaseExporter - } - return false -} - -func (x *AddAzureDatabaseRequest) GetQan() bool { - if x != nil { - return x.Qan - } - return false -} - -func (x *AddAzureDatabaseRequest) GetCustomLabels() map[string]string { - if x != nil { - return x.CustomLabels - } - return nil -} - -func (x *AddAzureDatabaseRequest) GetSkipConnectionCheck() bool { - if x != nil { - return x.SkipConnectionCheck - } - return false -} - -func (x *AddAzureDatabaseRequest) GetTls() bool { - if x != nil { - return x.Tls - } - return false -} - -func (x *AddAzureDatabaseRequest) GetTlsSkipVerify() bool { - if x != nil { - return x.TlsSkipVerify - } - return false -} - -func (x *AddAzureDatabaseRequest) GetDisableQueryExamples() bool { - if x != nil { - return x.DisableQueryExamples - } - return false -} - -func (x *AddAzureDatabaseRequest) GetTablestatsGroupTableLimit() int32 { - if x != nil { - return x.TablestatsGroupTableLimit - } - return 0 -} - -func (x *AddAzureDatabaseRequest) GetType() DiscoverAzureDatabaseType { - if x != nil { - return x.Type - } - return DiscoverAzureDatabaseType_DISCOVER_AZURE_DATABASE_TYPE_UNSPECIFIED -} - -type AddAzureDatabaseResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AddAzureDatabaseResponse) Reset() { - *x = AddAzureDatabaseResponse{} - mi := &file_management_v1_azure_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AddAzureDatabaseResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddAzureDatabaseResponse) ProtoMessage() {} - -func (x *AddAzureDatabaseResponse) ProtoReflect() protoreflect.Message { - mi := &file_management_v1_azure_proto_msgTypes[4] - 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 AddAzureDatabaseResponse.ProtoReflect.Descriptor instead. -func (*AddAzureDatabaseResponse) Descriptor() ([]byte, []int) { - return file_management_v1_azure_proto_rawDescGZIP(), []int{4} -} - -var File_management_v1_azure_proto protoreflect.FileDescriptor - -const file_management_v1_azure_proto_rawDesc = "" + - "\n" + - "\x19management/v1/azure.proto\x12\rmanagement.v1\x1a\x17validate/validate.proto\"\xf6\x01\n" + - "\x1cDiscoverAzureDatabaseRequest\x12/\n" + - "\x0fazure_client_id\x18\x01 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\razureClientId\x127\n" + - "\x13azure_client_secret\x18\x02 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\x11azureClientSecret\x12/\n" + - "\x0fazure_tenant_id\x18\x03 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\razureTenantId\x12;\n" + - "\x15azure_subscription_id\x18\x04 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\x13azureSubscriptionId\"\xf2\x02\n" + - "\x1dDiscoverAzureDatabaseInstance\x12\x1f\n" + - "\vinstance_id\x18\x01 \x01(\tR\n" + - "instanceId\x12\x16\n" + - "\x06region\x18\x02 \x01(\tR\x06region\x12!\n" + - "\fservice_name\x18\x03 \x01(\tR\vserviceName\x12\x1a\n" + - "\busername\x18\x04 \x01(\tR\busername\x12\x18\n" + - "\aaddress\x18\x05 \x01(\tR\aaddress\x120\n" + - "\x14azure_resource_group\x18\x06 \x01(\tR\x12azureResourceGroup\x12 \n" + - "\venvironment\x18\a \x01(\tR\venvironment\x12<\n" + - "\x04type\x18\b \x01(\x0e2(.management.v1.DiscoverAzureDatabaseTypeR\x04type\x12\x0e\n" + - "\x02az\x18\t \x01(\tR\x02az\x12\x1d\n" + - "\n" + - "node_model\x18\n" + - " \x01(\tR\tnodeModel\"\x85\x01\n" + - "\x1dDiscoverAzureDatabaseResponse\x12d\n" + - "\x17azure_database_instance\x18\x01 \x03(\v2,.management.v1.DiscoverAzureDatabaseInstanceR\x15azureDatabaseInstance\"\x96\t\n" + - "\x17AddAzureDatabaseRequest\x12\x1f\n" + - "\x06region\x18\x01 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\x06region\x12\x0e\n" + - "\x02az\x18\x02 \x01(\tR\x02az\x12(\n" + - "\vinstance_id\x18\x03 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\n" + - "instanceId\x12\x1d\n" + - "\n" + - "node_model\x18\x04 \x01(\tR\tnodeModel\x12!\n" + - "\aaddress\x18\x05 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\aaddress\x12\x1b\n" + - "\x04port\x18\x06 \x01(\rB\a\xfaB\x04*\x02 \x00R\x04port\x12\x1b\n" + - "\tnode_name\x18\a \x01(\tR\bnodeName\x12!\n" + - "\fservice_name\x18\b \x01(\tR\vserviceName\x12 \n" + - "\venvironment\x18\t \x01(\tR\venvironment\x12#\n" + - "\busername\x18\n" + - " \x01(\tB\a\xfaB\x04r\x02\x10\x01R\busername\x12\x1a\n" + - "\bpassword\x18\v \x01(\tR\bpassword\x12/\n" + - "\x0fazure_client_id\x18\f \x01(\tB\a\xfaB\x04r\x02\x10\x01R\razureClientId\x127\n" + - "\x13azure_client_secret\x18\r \x01(\tB\a\xfaB\x04r\x02\x10\x01R\x11azureClientSecret\x12/\n" + - "\x0fazure_tenant_id\x18\x0e \x01(\tB\a\xfaB\x04r\x02\x10\x01R\razureTenantId\x12;\n" + - "\x15azure_subscription_id\x18\x0f \x01(\tB\a\xfaB\x04r\x02\x10\x01R\x13azureSubscriptionId\x129\n" + - "\x14azure_resource_group\x18\x10 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\x12azureResourceGroup\x126\n" + - "\x17azure_database_exporter\x18\x11 \x01(\bR\x15azureDatabaseExporter\x12\x10\n" + - "\x03qan\x18\x12 \x01(\bR\x03qan\x12]\n" + - "\rcustom_labels\x18\x13 \x03(\v28.management.v1.AddAzureDatabaseRequest.CustomLabelsEntryR\fcustomLabels\x122\n" + - "\x15skip_connection_check\x18\x14 \x01(\bR\x13skipConnectionCheck\x12\x10\n" + - "\x03tls\x18\x15 \x01(\bR\x03tls\x12&\n" + - "\x0ftls_skip_verify\x18\x16 \x01(\bR\rtlsSkipVerify\x124\n" + - "\x16disable_query_examples\x18\x17 \x01(\bR\x14disableQueryExamples\x12?\n" + - "\x1ctablestats_group_table_limit\x18\x18 \x01(\x05R\x19tablestatsGroupTableLimit\x12<\n" + - "\x04type\x18\x19 \x01(\x0e2(.management.v1.DiscoverAzureDatabaseTypeR\x04type\x1a?\n" + - "\x11CustomLabelsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\x1a\n" + - "\x18AddAzureDatabaseResponse*\x9e\x01\n" + - "\x19DiscoverAzureDatabaseType\x12,\n" + - "(DISCOVER_AZURE_DATABASE_TYPE_UNSPECIFIED\x10\x00\x12&\n" + - "\"DISCOVER_AZURE_DATABASE_TYPE_MYSQL\x10\x01\x12+\n" + - "'DISCOVER_AZURE_DATABASE_TYPE_POSTGRESQL\x10\x02B\xab\x01\n" + - "\x11com.management.v1B\n" + - "AzureProtoP\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 ( - file_management_v1_azure_proto_rawDescOnce sync.Once - file_management_v1_azure_proto_rawDescData []byte -) - -func file_management_v1_azure_proto_rawDescGZIP() []byte { - file_management_v1_azure_proto_rawDescOnce.Do(func() { - file_management_v1_azure_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_management_v1_azure_proto_rawDesc), len(file_management_v1_azure_proto_rawDesc))) - }) - 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_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 - 6, // 2: management.v1.AddAzureDatabaseRequest.custom_labels:type_name -> management.v1.AddAzureDatabaseRequest.CustomLabelsEntry - 0, // 3: management.v1.AddAzureDatabaseRequest.type:type_name -> management.v1.DiscoverAzureDatabaseType - 4, // [4:4] is the sub-list for method output_type - 4, // [4:4] is the sub-list for method input_type - 4, // [4:4] is the sub-list for extension type_name - 4, // [4:4] is the sub-list for extension extendee - 0, // [0:4] is the sub-list for field type_name -} - -func init() { file_management_v1_azure_proto_init() } -func file_management_v1_azure_proto_init() { - if File_management_v1_azure_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_management_v1_azure_proto_rawDesc), len(file_management_v1_azure_proto_rawDesc)), - NumEnums: 1, - NumMessages: 6, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_management_v1_azure_proto_goTypes, - DependencyIndexes: file_management_v1_azure_proto_depIdxs, - EnumInfos: file_management_v1_azure_proto_enumTypes, - MessageInfos: file_management_v1_azure_proto_msgTypes, - }.Build() - File_management_v1_azure_proto = out.File - file_management_v1_azure_proto_goTypes = nil - file_management_v1_azure_proto_depIdxs = nil -} diff --git a/api/management/v1/azure.pb.validate.go b/api/management/v1/azure.pb.validate.go deleted file mode 100644 index 6d5787b2687..00000000000 --- a/api/management/v1/azure.pb.validate.go +++ /dev/null @@ -1,787 +0,0 @@ -// Code generated by protoc-gen-validate. DO NOT EDIT. -// source: management/v1/azure.proto - -package managementv1 - -import ( - "bytes" - "errors" - "fmt" - "net" - "net/mail" - "net/url" - "regexp" - "sort" - "strings" - "time" - "unicode/utf8" - - "google.golang.org/protobuf/types/known/anypb" -) - -// ensure the imports are used -var ( - _ = bytes.MinRead - _ = errors.New("") - _ = fmt.Print - _ = utf8.UTFMax - _ = (*regexp.Regexp)(nil) - _ = (*strings.Reader)(nil) - _ = net.IPv4len - _ = time.Duration(0) - _ = (*url.URL)(nil) - _ = (*mail.Address)(nil) - _ = anypb.Any{} - _ = sort.Sort -) - -// Validate checks the field values on DiscoverAzureDatabaseRequest 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 *DiscoverAzureDatabaseRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on DiscoverAzureDatabaseRequest 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 -// DiscoverAzureDatabaseRequestMultiError, or nil if none found. -func (m *DiscoverAzureDatabaseRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *DiscoverAzureDatabaseRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetAzureClientId()) < 1 { - err := DiscoverAzureDatabaseRequestValidationError{ - field: "AzureClientId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if utf8.RuneCountInString(m.GetAzureClientSecret()) < 1 { - err := DiscoverAzureDatabaseRequestValidationError{ - field: "AzureClientSecret", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if utf8.RuneCountInString(m.GetAzureTenantId()) < 1 { - err := DiscoverAzureDatabaseRequestValidationError{ - field: "AzureTenantId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if utf8.RuneCountInString(m.GetAzureSubscriptionId()) < 1 { - err := DiscoverAzureDatabaseRequestValidationError{ - field: "AzureSubscriptionId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if len(errors) > 0 { - return DiscoverAzureDatabaseRequestMultiError(errors) - } - - return nil -} - -// DiscoverAzureDatabaseRequestMultiError is an error wrapping multiple -// validation errors returned by DiscoverAzureDatabaseRequest.ValidateAll() if -// the designated constraints aren't met. -type DiscoverAzureDatabaseRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m DiscoverAzureDatabaseRequestMultiError) 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 DiscoverAzureDatabaseRequestMultiError) AllErrors() []error { return m } - -// DiscoverAzureDatabaseRequestValidationError is the validation error returned -// by DiscoverAzureDatabaseRequest.Validate if the designated constraints -// aren't met. -type DiscoverAzureDatabaseRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e DiscoverAzureDatabaseRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e DiscoverAzureDatabaseRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e DiscoverAzureDatabaseRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e DiscoverAzureDatabaseRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e DiscoverAzureDatabaseRequestValidationError) ErrorName() string { - return "DiscoverAzureDatabaseRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e DiscoverAzureDatabaseRequestValidationError) 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 %sDiscoverAzureDatabaseRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = DiscoverAzureDatabaseRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = DiscoverAzureDatabaseRequestValidationError{} - -// Validate checks the field values on DiscoverAzureDatabaseInstance 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 *DiscoverAzureDatabaseInstance) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on DiscoverAzureDatabaseInstance 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 -// DiscoverAzureDatabaseInstanceMultiError, or nil if none found. -func (m *DiscoverAzureDatabaseInstance) ValidateAll() error { - return m.validate(true) -} - -func (m *DiscoverAzureDatabaseInstance) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for InstanceId - - // no validation rules for Region - - // no validation rules for ServiceName - - // no validation rules for Username - - // no validation rules for Address - - // no validation rules for AzureResourceGroup - - // no validation rules for Environment - - // no validation rules for Type - - // no validation rules for Az - - // no validation rules for NodeModel - - if len(errors) > 0 { - return DiscoverAzureDatabaseInstanceMultiError(errors) - } - - return nil -} - -// DiscoverAzureDatabaseInstanceMultiError is an error wrapping multiple -// validation errors returned by DiscoverAzureDatabaseInstance.ValidateAll() -// if the designated constraints aren't met. -type DiscoverAzureDatabaseInstanceMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m DiscoverAzureDatabaseInstanceMultiError) 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 DiscoverAzureDatabaseInstanceMultiError) AllErrors() []error { return m } - -// DiscoverAzureDatabaseInstanceValidationError is the validation error -// returned by DiscoverAzureDatabaseInstance.Validate if the designated -// constraints aren't met. -type DiscoverAzureDatabaseInstanceValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e DiscoverAzureDatabaseInstanceValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e DiscoverAzureDatabaseInstanceValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e DiscoverAzureDatabaseInstanceValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e DiscoverAzureDatabaseInstanceValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e DiscoverAzureDatabaseInstanceValidationError) ErrorName() string { - return "DiscoverAzureDatabaseInstanceValidationError" -} - -// Error satisfies the builtin error interface -func (e DiscoverAzureDatabaseInstanceValidationError) 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 %sDiscoverAzureDatabaseInstance.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = DiscoverAzureDatabaseInstanceValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = DiscoverAzureDatabaseInstanceValidationError{} - -// Validate checks the field values on DiscoverAzureDatabaseResponse 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 *DiscoverAzureDatabaseResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on DiscoverAzureDatabaseResponse 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 -// DiscoverAzureDatabaseResponseMultiError, or nil if none found. -func (m *DiscoverAzureDatabaseResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *DiscoverAzureDatabaseResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - for idx, item := range m.GetAzureDatabaseInstance() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, DiscoverAzureDatabaseResponseValidationError{ - field: fmt.Sprintf("AzureDatabaseInstance[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, DiscoverAzureDatabaseResponseValidationError{ - field: fmt.Sprintf("AzureDatabaseInstance[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return DiscoverAzureDatabaseResponseValidationError{ - field: fmt.Sprintf("AzureDatabaseInstance[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - if len(errors) > 0 { - return DiscoverAzureDatabaseResponseMultiError(errors) - } - - return nil -} - -// DiscoverAzureDatabaseResponseMultiError is an error wrapping multiple -// validation errors returned by DiscoverAzureDatabaseResponse.ValidateAll() -// if the designated constraints aren't met. -type DiscoverAzureDatabaseResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m DiscoverAzureDatabaseResponseMultiError) 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 DiscoverAzureDatabaseResponseMultiError) AllErrors() []error { return m } - -// DiscoverAzureDatabaseResponseValidationError is the validation error -// returned by DiscoverAzureDatabaseResponse.Validate if the designated -// constraints aren't met. -type DiscoverAzureDatabaseResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e DiscoverAzureDatabaseResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e DiscoverAzureDatabaseResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e DiscoverAzureDatabaseResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e DiscoverAzureDatabaseResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e DiscoverAzureDatabaseResponseValidationError) ErrorName() string { - return "DiscoverAzureDatabaseResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e DiscoverAzureDatabaseResponseValidationError) 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 %sDiscoverAzureDatabaseResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = DiscoverAzureDatabaseResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = DiscoverAzureDatabaseResponseValidationError{} - -// Validate checks the field values on AddAzureDatabaseRequest 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 *AddAzureDatabaseRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on AddAzureDatabaseRequest 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 -// AddAzureDatabaseRequestMultiError, or nil if none found. -func (m *AddAzureDatabaseRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *AddAzureDatabaseRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetRegion()) < 1 { - err := AddAzureDatabaseRequestValidationError{ - field: "Region", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for Az - - if utf8.RuneCountInString(m.GetInstanceId()) < 1 { - err := AddAzureDatabaseRequestValidationError{ - field: "InstanceId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for NodeModel - - if utf8.RuneCountInString(m.GetAddress()) < 1 { - err := AddAzureDatabaseRequestValidationError{ - field: "Address", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if m.GetPort() <= 0 { - err := AddAzureDatabaseRequestValidationError{ - field: "Port", - reason: "value must be greater than 0", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for NodeName - - // no validation rules for ServiceName - - // no validation rules for Environment - - if utf8.RuneCountInString(m.GetUsername()) < 1 { - err := AddAzureDatabaseRequestValidationError{ - field: "Username", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for Password - - if utf8.RuneCountInString(m.GetAzureClientId()) < 1 { - err := AddAzureDatabaseRequestValidationError{ - field: "AzureClientId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if utf8.RuneCountInString(m.GetAzureClientSecret()) < 1 { - err := AddAzureDatabaseRequestValidationError{ - field: "AzureClientSecret", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if utf8.RuneCountInString(m.GetAzureTenantId()) < 1 { - err := AddAzureDatabaseRequestValidationError{ - field: "AzureTenantId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if utf8.RuneCountInString(m.GetAzureSubscriptionId()) < 1 { - err := AddAzureDatabaseRequestValidationError{ - field: "AzureSubscriptionId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if utf8.RuneCountInString(m.GetAzureResourceGroup()) < 1 { - err := AddAzureDatabaseRequestValidationError{ - field: "AzureResourceGroup", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for AzureDatabaseExporter - - // no validation rules for Qan - - // no validation rules for CustomLabels - - // no validation rules for SkipConnectionCheck - - // no validation rules for Tls - - // no validation rules for TlsSkipVerify - - // no validation rules for DisableQueryExamples - - // no validation rules for TablestatsGroupTableLimit - - // no validation rules for Type - - if len(errors) > 0 { - return AddAzureDatabaseRequestMultiError(errors) - } - - return nil -} - -// AddAzureDatabaseRequestMultiError is an error wrapping multiple validation -// errors returned by AddAzureDatabaseRequest.ValidateAll() if the designated -// constraints aren't met. -type AddAzureDatabaseRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m AddAzureDatabaseRequestMultiError) 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 AddAzureDatabaseRequestMultiError) AllErrors() []error { return m } - -// AddAzureDatabaseRequestValidationError is the validation error returned by -// AddAzureDatabaseRequest.Validate if the designated constraints aren't met. -type AddAzureDatabaseRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e AddAzureDatabaseRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e AddAzureDatabaseRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e AddAzureDatabaseRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e AddAzureDatabaseRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e AddAzureDatabaseRequestValidationError) ErrorName() string { - return "AddAzureDatabaseRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e AddAzureDatabaseRequestValidationError) 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 %sAddAzureDatabaseRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = AddAzureDatabaseRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = AddAzureDatabaseRequestValidationError{} - -// Validate checks the field values on AddAzureDatabaseResponse 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 *AddAzureDatabaseResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on AddAzureDatabaseResponse 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 -// AddAzureDatabaseResponseMultiError, or nil if none found. -func (m *AddAzureDatabaseResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *AddAzureDatabaseResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return AddAzureDatabaseResponseMultiError(errors) - } - - return nil -} - -// AddAzureDatabaseResponseMultiError is an error wrapping multiple validation -// errors returned by AddAzureDatabaseResponse.ValidateAll() if the designated -// constraints aren't met. -type AddAzureDatabaseResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m AddAzureDatabaseResponseMultiError) 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 AddAzureDatabaseResponseMultiError) AllErrors() []error { return m } - -// AddAzureDatabaseResponseValidationError is the validation error returned by -// AddAzureDatabaseResponse.Validate if the designated constraints aren't met. -type AddAzureDatabaseResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e AddAzureDatabaseResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e AddAzureDatabaseResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e AddAzureDatabaseResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e AddAzureDatabaseResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e AddAzureDatabaseResponseValidationError) ErrorName() string { - return "AddAzureDatabaseResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e AddAzureDatabaseResponseValidationError) 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 %sAddAzureDatabaseResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = AddAzureDatabaseResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = AddAzureDatabaseResponseValidationError{} diff --git a/api/management/v1/external.pb.go b/api/management/v1/external.pb.go deleted file mode 100644 index 5a84db0e975..00000000000 --- a/api/management/v1/external.pb.go +++ /dev/null @@ -1,395 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.10 -// protoc (unknown) -// source: management/v1/external.proto - -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" - - v1 "github.com/percona/pmm/api/inventory/v1" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type AddExternalServiceParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - // 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. - RunsOnNodeId string `protobuf:"bytes,1,opt,name=runs_on_node_id,json=runsOnNodeId,proto3" json:"runs_on_node_id,omitempty"` - // Node name on which a service and node is been running. - // Exactly one of these parameters should be present: node_id, node_name, add_node. - NodeName string `protobuf:"bytes,2,opt,name=node_name,json=nodeName,proto3" json:"node_name,omitempty"` - // Create a new Node with those parameters. - // add_node should always be passed with address. - // Exactly one of these parameters should be present: node_id, node_name, add_node. - AddNode *AddNodeParams `protobuf:"bytes,3,opt,name=add_node,json=addNode,proto3" json:"add_node,omitempty"` - // Node and Exporter access address (DNS name or IP). - // address should always be passed with add_node. - Address string `protobuf:"bytes,4,opt,name=address,proto3" json:"address,omitempty"` - // Unique across all Services user-defined name. Required. - ServiceName string `protobuf:"bytes,5,opt,name=service_name,json=serviceName,proto3" json:"service_name,omitempty"` - // HTTP basic auth username for collecting metrics. - Username string `protobuf:"bytes,6,opt,name=username,proto3" json:"username,omitempty"` - // HTTP basic auth password for collecting metrics. - Password string `protobuf:"bytes,7,opt,name=password,proto3" json:"password,omitempty"` - // Scheme to generate URI to exporter metrics endpoints. - Scheme string `protobuf:"bytes,8,opt,name=scheme,proto3" json:"scheme,omitempty"` - // Path under which metrics are exposed, used to generate URI. - MetricsPath string `protobuf:"bytes,9,opt,name=metrics_path,json=metricsPath,proto3" json:"metrics_path,omitempty"` - // Listen port for scraping metrics. - ListenPort uint32 `protobuf:"varint,10,opt,name=listen_port,json=listenPort,proto3" json:"listen_port,omitempty"` - // Node identifier on which an external service is been running. - // node_id should always be passed with runs_on_node_id. - NodeId string `protobuf:"bytes,11,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` - // Environment name. - Environment string `protobuf:"bytes,12,opt,name=environment,proto3" json:"environment,omitempty"` - // Cluster name. - Cluster string `protobuf:"bytes,13,opt,name=cluster,proto3" json:"cluster,omitempty"` - // Replication set name. - ReplicationSet string `protobuf:"bytes,14,opt,name=replication_set,json=replicationSet,proto3" json:"replication_set,omitempty"` - // Custom user-assigned labels for Service. - CustomLabels map[string]string `protobuf:"bytes,15,rep,name=custom_labels,json=customLabels,proto3" json:"custom_labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - // Group name of external service. - Group string `protobuf:"bytes,16,opt,name=group,proto3" json:"group,omitempty"` - // Defines metrics flow model for this exporter. - // Metrics could be pushed to the server with vmagent, - // pulled by the server, or the server could choose behavior automatically. - // Node with registered pmm_agent_id must present at pmm-server - // in case of push metrics_mode. - MetricsMode MetricsMode `protobuf:"varint,17,opt,name=metrics_mode,json=metricsMode,proto3,enum=management.v1.MetricsMode" json:"metrics_mode,omitempty"` - // Skip connection check. - SkipConnectionCheck bool `protobuf:"varint,18,opt,name=skip_connection_check,json=skipConnectionCheck,proto3" json:"skip_connection_check,omitempty"` - // Skip TLS certificate and hostname validation. - TlsSkipVerify bool `protobuf:"varint,19,opt,name=tls_skip_verify,json=tlsSkipVerify,proto3" json:"tls_skip_verify,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AddExternalServiceParams) Reset() { - *x = AddExternalServiceParams{} - mi := &file_management_v1_external_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AddExternalServiceParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddExternalServiceParams) ProtoMessage() {} - -func (x *AddExternalServiceParams) ProtoReflect() protoreflect.Message { - mi := &file_management_v1_external_proto_msgTypes[0] - 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 AddExternalServiceParams.ProtoReflect.Descriptor instead. -func (*AddExternalServiceParams) Descriptor() ([]byte, []int) { - return file_management_v1_external_proto_rawDescGZIP(), []int{0} -} - -func (x *AddExternalServiceParams) GetRunsOnNodeId() string { - if x != nil { - return x.RunsOnNodeId - } - return "" -} - -func (x *AddExternalServiceParams) GetNodeName() string { - if x != nil { - return x.NodeName - } - return "" -} - -func (x *AddExternalServiceParams) GetAddNode() *AddNodeParams { - if x != nil { - return x.AddNode - } - return nil -} - -func (x *AddExternalServiceParams) GetAddress() string { - if x != nil { - return x.Address - } - return "" -} - -func (x *AddExternalServiceParams) GetServiceName() string { - if x != nil { - return x.ServiceName - } - return "" -} - -func (x *AddExternalServiceParams) GetUsername() string { - if x != nil { - return x.Username - } - return "" -} - -func (x *AddExternalServiceParams) GetPassword() string { - if x != nil { - return x.Password - } - return "" -} - -func (x *AddExternalServiceParams) GetScheme() string { - if x != nil { - return x.Scheme - } - return "" -} - -func (x *AddExternalServiceParams) GetMetricsPath() string { - if x != nil { - return x.MetricsPath - } - return "" -} - -func (x *AddExternalServiceParams) GetListenPort() uint32 { - if x != nil { - return x.ListenPort - } - return 0 -} - -func (x *AddExternalServiceParams) GetNodeId() string { - if x != nil { - return x.NodeId - } - return "" -} - -func (x *AddExternalServiceParams) GetEnvironment() string { - if x != nil { - return x.Environment - } - return "" -} - -func (x *AddExternalServiceParams) GetCluster() string { - if x != nil { - return x.Cluster - } - return "" -} - -func (x *AddExternalServiceParams) GetReplicationSet() string { - if x != nil { - return x.ReplicationSet - } - return "" -} - -func (x *AddExternalServiceParams) GetCustomLabels() map[string]string { - if x != nil { - return x.CustomLabels - } - return nil -} - -func (x *AddExternalServiceParams) GetGroup() string { - if x != nil { - return x.Group - } - return "" -} - -func (x *AddExternalServiceParams) GetMetricsMode() MetricsMode { - if x != nil { - return x.MetricsMode - } - return MetricsMode_METRICS_MODE_UNSPECIFIED -} - -func (x *AddExternalServiceParams) GetSkipConnectionCheck() bool { - if x != nil { - return x.SkipConnectionCheck - } - return false -} - -func (x *AddExternalServiceParams) GetTlsSkipVerify() bool { - if x != nil { - return x.TlsSkipVerify - } - return false -} - -type ExternalServiceResult struct { - state protoimpl.MessageState `protogen:"open.v1"` - Service *v1.ExternalService `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"` - ExternalExporter *v1.ExternalExporter `protobuf:"bytes,2,opt,name=external_exporter,json=externalExporter,proto3" json:"external_exporter,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ExternalServiceResult) Reset() { - *x = ExternalServiceResult{} - mi := &file_management_v1_external_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ExternalServiceResult) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ExternalServiceResult) ProtoMessage() {} - -func (x *ExternalServiceResult) ProtoReflect() protoreflect.Message { - mi := &file_management_v1_external_proto_msgTypes[1] - 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 ExternalServiceResult.ProtoReflect.Descriptor instead. -func (*ExternalServiceResult) Descriptor() ([]byte, []int) { - return file_management_v1_external_proto_rawDescGZIP(), []int{1} -} - -func (x *ExternalServiceResult) GetService() *v1.ExternalService { - if x != nil { - return x.Service - } - return nil -} - -func (x *ExternalServiceResult) GetExternalExporter() *v1.ExternalExporter { - if x != nil { - return x.ExternalExporter - } - return nil -} - -var File_management_v1_external_proto protoreflect.FileDescriptor - -const file_management_v1_external_proto_rawDesc = "" + - "\n" + - "\x1cmanagement/v1/external.proto\x12\rmanagement.v1\x1a\x19inventory/v1/agents.proto\x1a\x1binventory/v1/services.proto\x1a\x1bmanagement/v1/metrics.proto\x1a\x18management/v1/node.proto\x1a\x17validate/validate.proto\"\xce\x06\n" + - "\x18AddExternalServiceParams\x12%\n" + - "\x0fruns_on_node_id\x18\x01 \x01(\tR\frunsOnNodeId\x12\x1b\n" + - "\tnode_name\x18\x02 \x01(\tR\bnodeName\x127\n" + - "\badd_node\x18\x03 \x01(\v2\x1c.management.v1.AddNodeParamsR\aaddNode\x12\x18\n" + - "\aaddress\x18\x04 \x01(\tR\aaddress\x12*\n" + - "\fservice_name\x18\x05 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\vserviceName\x12\x1a\n" + - "\busername\x18\x06 \x01(\tR\busername\x12\x1a\n" + - "\bpassword\x18\a \x01(\tR\bpassword\x12\x16\n" + - "\x06scheme\x18\b \x01(\tR\x06scheme\x12!\n" + - "\fmetrics_path\x18\t \x01(\tR\vmetricsPath\x12,\n" + - "\vlisten_port\x18\n" + - " \x01(\rB\v\xfaB\b*\x06\x10\x80\x80\x04 \x00R\n" + - "listenPort\x12\x17\n" + - "\anode_id\x18\v \x01(\tR\x06nodeId\x12 \n" + - "\venvironment\x18\f \x01(\tR\venvironment\x12\x18\n" + - "\acluster\x18\r \x01(\tR\acluster\x12'\n" + - "\x0freplication_set\x18\x0e \x01(\tR\x0ereplicationSet\x12^\n" + - "\rcustom_labels\x18\x0f \x03(\v29.management.v1.AddExternalServiceParams.CustomLabelsEntryR\fcustomLabels\x12\x14\n" + - "\x05group\x18\x10 \x01(\tR\x05group\x12=\n" + - "\fmetrics_mode\x18\x11 \x01(\x0e2\x1a.management.v1.MetricsModeR\vmetricsMode\x122\n" + - "\x15skip_connection_check\x18\x12 \x01(\bR\x13skipConnectionCheck\x12&\n" + - "\x0ftls_skip_verify\x18\x13 \x01(\bR\rtlsSkipVerify\x1a?\n" + - "\x11CustomLabelsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\x9d\x01\n" + - "\x15ExternalServiceResult\x127\n" + - "\aservice\x18\x01 \x01(\v2\x1d.inventory.v1.ExternalServiceR\aservice\x12K\n" + - "\x11external_exporter\x18\x02 \x01(\v2\x1e.inventory.v1.ExternalExporterR\x10externalExporterB\xae\x01\n" + - "\x11com.management.v1B\rExternalProtoP\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 ( - file_management_v1_external_proto_rawDescOnce sync.Once - file_management_v1_external_proto_rawDescData []byte -) - -func file_management_v1_external_proto_rawDescGZIP() []byte { - file_management_v1_external_proto_rawDescOnce.Do(func() { - file_management_v1_external_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_management_v1_external_proto_rawDesc), len(file_management_v1_external_proto_rawDesc))) - }) - 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_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 - 4, // 2: management.v1.AddExternalServiceParams.metrics_mode:type_name -> management.v1.MetricsMode - 5, // 3: management.v1.ExternalServiceResult.service:type_name -> inventory.v1.ExternalService - 6, // 4: management.v1.ExternalServiceResult.external_exporter:type_name -> inventory.v1.ExternalExporter - 5, // [5:5] is the sub-list for method output_type - 5, // [5:5] is the sub-list for method input_type - 5, // [5:5] is the sub-list for extension type_name - 5, // [5:5] is the sub-list for extension extendee - 0, // [0:5] is the sub-list for field type_name -} - -func init() { file_management_v1_external_proto_init() } -func file_management_v1_external_proto_init() { - if File_management_v1_external_proto != nil { - return - } - file_management_v1_metrics_proto_init() - file_management_v1_node_proto_init() - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_management_v1_external_proto_rawDesc), len(file_management_v1_external_proto_rawDesc)), - NumEnums: 0, - NumMessages: 3, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_management_v1_external_proto_goTypes, - DependencyIndexes: file_management_v1_external_proto_depIdxs, - MessageInfos: file_management_v1_external_proto_msgTypes, - }.Build() - File_management_v1_external_proto = out.File - file_management_v1_external_proto_goTypes = nil - file_management_v1_external_proto_depIdxs = nil -} diff --git a/api/management/v1/external.pb.validate.go b/api/management/v1/external.pb.validate.go deleted file mode 100644 index 232949e1810..00000000000 --- a/api/management/v1/external.pb.validate.go +++ /dev/null @@ -1,381 +0,0 @@ -// Code generated by protoc-gen-validate. DO NOT EDIT. -// source: management/v1/external.proto - -package managementv1 - -import ( - "bytes" - "errors" - "fmt" - "net" - "net/mail" - "net/url" - "regexp" - "sort" - "strings" - "time" - "unicode/utf8" - - "google.golang.org/protobuf/types/known/anypb" -) - -// ensure the imports are used -var ( - _ = bytes.MinRead - _ = errors.New("") - _ = fmt.Print - _ = utf8.UTFMax - _ = (*regexp.Regexp)(nil) - _ = (*strings.Reader)(nil) - _ = net.IPv4len - _ = time.Duration(0) - _ = (*url.URL)(nil) - _ = (*mail.Address)(nil) - _ = anypb.Any{} - _ = sort.Sort -) - -// Validate checks the field values on AddExternalServiceParams 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 *AddExternalServiceParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on AddExternalServiceParams 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 -// AddExternalServiceParamsMultiError, or nil if none found. -func (m *AddExternalServiceParams) ValidateAll() error { - return m.validate(true) -} - -func (m *AddExternalServiceParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for RunsOnNodeId - - // no validation rules for NodeName - - if all { - switch v := interface{}(m.GetAddNode()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AddExternalServiceParamsValidationError{ - field: "AddNode", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AddExternalServiceParamsValidationError{ - field: "AddNode", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetAddNode()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AddExternalServiceParamsValidationError{ - field: "AddNode", - reason: "embedded message failed validation", - cause: err, - } - } - } - - // no validation rules for Address - - if utf8.RuneCountInString(m.GetServiceName()) < 1 { - err := AddExternalServiceParamsValidationError{ - field: "ServiceName", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for Username - - // no validation rules for Password - - // no validation rules for Scheme - - // no validation rules for MetricsPath - - if val := m.GetListenPort(); val <= 0 || val >= 65536 { - err := AddExternalServiceParamsValidationError{ - field: "ListenPort", - reason: "value must be inside range (0, 65536)", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for NodeId - - // no validation rules for Environment - - // no validation rules for Cluster - - // no validation rules for ReplicationSet - - // no validation rules for CustomLabels - - // no validation rules for Group - - // no validation rules for MetricsMode - - // no validation rules for SkipConnectionCheck - - // no validation rules for TlsSkipVerify - - if len(errors) > 0 { - return AddExternalServiceParamsMultiError(errors) - } - - return nil -} - -// AddExternalServiceParamsMultiError is an error wrapping multiple validation -// errors returned by AddExternalServiceParams.ValidateAll() if the designated -// constraints aren't met. -type AddExternalServiceParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m AddExternalServiceParamsMultiError) 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 AddExternalServiceParamsMultiError) AllErrors() []error { return m } - -// AddExternalServiceParamsValidationError is the validation error returned by -// AddExternalServiceParams.Validate if the designated constraints aren't met. -type AddExternalServiceParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e AddExternalServiceParamsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e AddExternalServiceParamsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e AddExternalServiceParamsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e AddExternalServiceParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e AddExternalServiceParamsValidationError) ErrorName() string { - return "AddExternalServiceParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e AddExternalServiceParamsValidationError) 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 %sAddExternalServiceParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = AddExternalServiceParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = AddExternalServiceParamsValidationError{} - -// Validate checks the field values on ExternalServiceResult 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 *ExternalServiceResult) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ExternalServiceResult 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 -// ExternalServiceResultMultiError, or nil if none found. -func (m *ExternalServiceResult) ValidateAll() error { - return m.validate(true) -} - -func (m *ExternalServiceResult) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if all { - switch v := interface{}(m.GetService()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ExternalServiceResultValidationError{ - field: "Service", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ExternalServiceResultValidationError{ - field: "Service", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetService()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ExternalServiceResultValidationError{ - field: "Service", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetExternalExporter()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ExternalServiceResultValidationError{ - field: "ExternalExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ExternalServiceResultValidationError{ - field: "ExternalExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetExternalExporter()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ExternalServiceResultValidationError{ - field: "ExternalExporter", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if len(errors) > 0 { - return ExternalServiceResultMultiError(errors) - } - - return nil -} - -// ExternalServiceResultMultiError is an error wrapping multiple validation -// errors returned by ExternalServiceResult.ValidateAll() if the designated -// constraints aren't met. -type ExternalServiceResultMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ExternalServiceResultMultiError) 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 ExternalServiceResultMultiError) AllErrors() []error { return m } - -// ExternalServiceResultValidationError is the validation error returned by -// ExternalServiceResult.Validate if the designated constraints aren't met. -type ExternalServiceResultValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ExternalServiceResultValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ExternalServiceResultValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ExternalServiceResultValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ExternalServiceResultValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ExternalServiceResultValidationError) ErrorName() string { - return "ExternalServiceResultValidationError" -} - -// Error satisfies the builtin error interface -func (e ExternalServiceResultValidationError) 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 %sExternalServiceResult.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ExternalServiceResultValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ExternalServiceResultValidationError{} diff --git a/api/management/v1/haproxy.pb.go b/api/management/v1/haproxy.pb.go deleted file mode 100644 index 90a883690fd..00000000000 --- a/api/management/v1/haproxy.pb.go +++ /dev/null @@ -1,373 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.10 -// protoc (unknown) -// source: management/v1/haproxy.proto - -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" - - v1 "github.com/percona/pmm/api/inventory/v1" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type AddHAProxyServiceParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - // 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 `protobuf:"bytes,1,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` - // Node name on which a service and node is been running. - // Exactly one of these parameters should be present: node_id, node_name, add_node. - NodeName string `protobuf:"bytes,2,opt,name=node_name,json=nodeName,proto3" json:"node_name,omitempty"` - // Create a new Node with those parameters. - // add_node always should be passed with address. - // Exactly one of these parameters should be present: node_id, node_name, add_node. - AddNode *AddNodeParams `protobuf:"bytes,3,opt,name=add_node,json=addNode,proto3" json:"add_node,omitempty"` - // Node and Exporter access address (DNS name or IP). - // address always should be passed with add_node. - Address string `protobuf:"bytes,4,opt,name=address,proto3" json:"address,omitempty"` - // Unique across all Services user-defined name. Required. - ServiceName string `protobuf:"bytes,5,opt,name=service_name,json=serviceName,proto3" json:"service_name,omitempty"` - // HTTP basic auth username for collecting metrics. - Username string `protobuf:"bytes,6,opt,name=username,proto3" json:"username,omitempty"` - // HTTP basic auth password for collecting metrics. - Password string `protobuf:"bytes,7,opt,name=password,proto3" json:"password,omitempty"` - // Scheme to generate URI to exporter metrics endpoints. - Scheme string `protobuf:"bytes,8,opt,name=scheme,proto3" json:"scheme,omitempty"` - // Path under which metrics are exposed, used to generate URI. - MetricsPath string `protobuf:"bytes,9,opt,name=metrics_path,json=metricsPath,proto3" json:"metrics_path,omitempty"` - // Listen port for scraping metrics. - ListenPort uint32 `protobuf:"varint,10,opt,name=listen_port,json=listenPort,proto3" json:"listen_port,omitempty"` - // Environment name. - Environment string `protobuf:"bytes,11,opt,name=environment,proto3" json:"environment,omitempty"` - // Cluster name. - Cluster string `protobuf:"bytes,12,opt,name=cluster,proto3" json:"cluster,omitempty"` - // Replication set name. - ReplicationSet string `protobuf:"bytes,13,opt,name=replication_set,json=replicationSet,proto3" json:"replication_set,omitempty"` - // Custom user-assigned labels for Service. - CustomLabels map[string]string `protobuf:"bytes,14,rep,name=custom_labels,json=customLabels,proto3" json:"custom_labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - // Defines metrics flow model for this exporter. - // Metrics could be pushed to the server with vmagent, - // pulled by the server, or the server could choose behavior automatically. - // Node with registered pmm_agent_id must present at pmm-server - // in case of push metrics_mode. - MetricsMode MetricsMode `protobuf:"varint,15,opt,name=metrics_mode,json=metricsMode,proto3,enum=management.v1.MetricsMode" json:"metrics_mode,omitempty"` - // Skip connection check. - SkipConnectionCheck bool `protobuf:"varint,16,opt,name=skip_connection_check,json=skipConnectionCheck,proto3" json:"skip_connection_check,omitempty"` - // Skip TLS certificate and hostname validation. - TlsSkipVerify bool `protobuf:"varint,17,opt,name=tls_skip_verify,json=tlsSkipVerify,proto3" json:"tls_skip_verify,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AddHAProxyServiceParams) Reset() { - *x = AddHAProxyServiceParams{} - mi := &file_management_v1_haproxy_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AddHAProxyServiceParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddHAProxyServiceParams) ProtoMessage() {} - -func (x *AddHAProxyServiceParams) ProtoReflect() protoreflect.Message { - mi := &file_management_v1_haproxy_proto_msgTypes[0] - 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 AddHAProxyServiceParams.ProtoReflect.Descriptor instead. -func (*AddHAProxyServiceParams) Descriptor() ([]byte, []int) { - return file_management_v1_haproxy_proto_rawDescGZIP(), []int{0} -} - -func (x *AddHAProxyServiceParams) GetNodeId() string { - if x != nil { - return x.NodeId - } - return "" -} - -func (x *AddHAProxyServiceParams) GetNodeName() string { - if x != nil { - return x.NodeName - } - return "" -} - -func (x *AddHAProxyServiceParams) GetAddNode() *AddNodeParams { - if x != nil { - return x.AddNode - } - return nil -} - -func (x *AddHAProxyServiceParams) GetAddress() string { - if x != nil { - return x.Address - } - return "" -} - -func (x *AddHAProxyServiceParams) GetServiceName() string { - if x != nil { - return x.ServiceName - } - return "" -} - -func (x *AddHAProxyServiceParams) GetUsername() string { - if x != nil { - return x.Username - } - return "" -} - -func (x *AddHAProxyServiceParams) GetPassword() string { - if x != nil { - return x.Password - } - return "" -} - -func (x *AddHAProxyServiceParams) GetScheme() string { - if x != nil { - return x.Scheme - } - return "" -} - -func (x *AddHAProxyServiceParams) GetMetricsPath() string { - if x != nil { - return x.MetricsPath - } - return "" -} - -func (x *AddHAProxyServiceParams) GetListenPort() uint32 { - if x != nil { - return x.ListenPort - } - return 0 -} - -func (x *AddHAProxyServiceParams) GetEnvironment() string { - if x != nil { - return x.Environment - } - return "" -} - -func (x *AddHAProxyServiceParams) GetCluster() string { - if x != nil { - return x.Cluster - } - return "" -} - -func (x *AddHAProxyServiceParams) GetReplicationSet() string { - if x != nil { - return x.ReplicationSet - } - return "" -} - -func (x *AddHAProxyServiceParams) GetCustomLabels() map[string]string { - if x != nil { - return x.CustomLabels - } - return nil -} - -func (x *AddHAProxyServiceParams) GetMetricsMode() MetricsMode { - if x != nil { - return x.MetricsMode - } - return MetricsMode_METRICS_MODE_UNSPECIFIED -} - -func (x *AddHAProxyServiceParams) GetSkipConnectionCheck() bool { - if x != nil { - return x.SkipConnectionCheck - } - return false -} - -func (x *AddHAProxyServiceParams) GetTlsSkipVerify() bool { - if x != nil { - return x.TlsSkipVerify - } - return false -} - -type HAProxyServiceResult struct { - state protoimpl.MessageState `protogen:"open.v1"` - Service *v1.HAProxyService `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"` - ExternalExporter *v1.ExternalExporter `protobuf:"bytes,2,opt,name=external_exporter,json=externalExporter,proto3" json:"external_exporter,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *HAProxyServiceResult) Reset() { - *x = HAProxyServiceResult{} - mi := &file_management_v1_haproxy_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *HAProxyServiceResult) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*HAProxyServiceResult) ProtoMessage() {} - -func (x *HAProxyServiceResult) ProtoReflect() protoreflect.Message { - mi := &file_management_v1_haproxy_proto_msgTypes[1] - 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 HAProxyServiceResult.ProtoReflect.Descriptor instead. -func (*HAProxyServiceResult) Descriptor() ([]byte, []int) { - return file_management_v1_haproxy_proto_rawDescGZIP(), []int{1} -} - -func (x *HAProxyServiceResult) GetService() *v1.HAProxyService { - if x != nil { - return x.Service - } - return nil -} - -func (x *HAProxyServiceResult) GetExternalExporter() *v1.ExternalExporter { - if x != nil { - return x.ExternalExporter - } - return nil -} - -var File_management_v1_haproxy_proto protoreflect.FileDescriptor - -const file_management_v1_haproxy_proto_rawDesc = "" + - "\n" + - "\x1bmanagement/v1/haproxy.proto\x12\rmanagement.v1\x1a\x19inventory/v1/agents.proto\x1a\x1binventory/v1/services.proto\x1a\x1bmanagement/v1/metrics.proto\x1a\x18management/v1/node.proto\x1a\x17validate/validate.proto\"\x8f\x06\n" + - "\x17AddHAProxyServiceParams\x12\x17\n" + - "\anode_id\x18\x01 \x01(\tR\x06nodeId\x12\x1b\n" + - "\tnode_name\x18\x02 \x01(\tR\bnodeName\x127\n" + - "\badd_node\x18\x03 \x01(\v2\x1c.management.v1.AddNodeParamsR\aaddNode\x12\x18\n" + - "\aaddress\x18\x04 \x01(\tR\aaddress\x12*\n" + - "\fservice_name\x18\x05 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\vserviceName\x12\x1a\n" + - "\busername\x18\x06 \x01(\tR\busername\x12\x1a\n" + - "\bpassword\x18\a \x01(\tR\bpassword\x12\x16\n" + - "\x06scheme\x18\b \x01(\tR\x06scheme\x12!\n" + - "\fmetrics_path\x18\t \x01(\tR\vmetricsPath\x12,\n" + - "\vlisten_port\x18\n" + - " \x01(\rB\v\xfaB\b*\x06\x10\x80\x80\x04 \x00R\n" + - "listenPort\x12 \n" + - "\venvironment\x18\v \x01(\tR\venvironment\x12\x18\n" + - "\acluster\x18\f \x01(\tR\acluster\x12'\n" + - "\x0freplication_set\x18\r \x01(\tR\x0ereplicationSet\x12]\n" + - "\rcustom_labels\x18\x0e \x03(\v28.management.v1.AddHAProxyServiceParams.CustomLabelsEntryR\fcustomLabels\x12=\n" + - "\fmetrics_mode\x18\x0f \x01(\x0e2\x1a.management.v1.MetricsModeR\vmetricsMode\x122\n" + - "\x15skip_connection_check\x18\x10 \x01(\bR\x13skipConnectionCheck\x12&\n" + - "\x0ftls_skip_verify\x18\x11 \x01(\bR\rtlsSkipVerify\x1a?\n" + - "\x11CustomLabelsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\x9b\x01\n" + - "\x14HAProxyServiceResult\x126\n" + - "\aservice\x18\x01 \x01(\v2\x1c.inventory.v1.HAProxyServiceR\aservice\x12K\n" + - "\x11external_exporter\x18\x02 \x01(\v2\x1e.inventory.v1.ExternalExporterR\x10externalExporterB\xad\x01\n" + - "\x11com.management.v1B\fHaproxyProtoP\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 ( - file_management_v1_haproxy_proto_rawDescOnce sync.Once - file_management_v1_haproxy_proto_rawDescData []byte -) - -func file_management_v1_haproxy_proto_rawDescGZIP() []byte { - file_management_v1_haproxy_proto_rawDescOnce.Do(func() { - file_management_v1_haproxy_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_management_v1_haproxy_proto_rawDesc), len(file_management_v1_haproxy_proto_rawDesc))) - }) - 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_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 - 4, // 2: management.v1.AddHAProxyServiceParams.metrics_mode:type_name -> management.v1.MetricsMode - 5, // 3: management.v1.HAProxyServiceResult.service:type_name -> inventory.v1.HAProxyService - 6, // 4: management.v1.HAProxyServiceResult.external_exporter:type_name -> inventory.v1.ExternalExporter - 5, // [5:5] is the sub-list for method output_type - 5, // [5:5] is the sub-list for method input_type - 5, // [5:5] is the sub-list for extension type_name - 5, // [5:5] is the sub-list for extension extendee - 0, // [0:5] is the sub-list for field type_name -} - -func init() { file_management_v1_haproxy_proto_init() } -func file_management_v1_haproxy_proto_init() { - if File_management_v1_haproxy_proto != nil { - return - } - file_management_v1_metrics_proto_init() - file_management_v1_node_proto_init() - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_management_v1_haproxy_proto_rawDesc), len(file_management_v1_haproxy_proto_rawDesc)), - NumEnums: 0, - NumMessages: 3, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_management_v1_haproxy_proto_goTypes, - DependencyIndexes: file_management_v1_haproxy_proto_depIdxs, - MessageInfos: file_management_v1_haproxy_proto_msgTypes, - }.Build() - File_management_v1_haproxy_proto = out.File - file_management_v1_haproxy_proto_goTypes = nil - file_management_v1_haproxy_proto_depIdxs = nil -} diff --git a/api/management/v1/haproxy.pb.validate.go b/api/management/v1/haproxy.pb.validate.go deleted file mode 100644 index bf825aa36e8..00000000000 --- a/api/management/v1/haproxy.pb.validate.go +++ /dev/null @@ -1,377 +0,0 @@ -// Code generated by protoc-gen-validate. DO NOT EDIT. -// source: management/v1/haproxy.proto - -package managementv1 - -import ( - "bytes" - "errors" - "fmt" - "net" - "net/mail" - "net/url" - "regexp" - "sort" - "strings" - "time" - "unicode/utf8" - - "google.golang.org/protobuf/types/known/anypb" -) - -// ensure the imports are used -var ( - _ = bytes.MinRead - _ = errors.New("") - _ = fmt.Print - _ = utf8.UTFMax - _ = (*regexp.Regexp)(nil) - _ = (*strings.Reader)(nil) - _ = net.IPv4len - _ = time.Duration(0) - _ = (*url.URL)(nil) - _ = (*mail.Address)(nil) - _ = anypb.Any{} - _ = sort.Sort -) - -// Validate checks the field values on AddHAProxyServiceParams 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 *AddHAProxyServiceParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on AddHAProxyServiceParams 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 -// AddHAProxyServiceParamsMultiError, or nil if none found. -func (m *AddHAProxyServiceParams) ValidateAll() error { - return m.validate(true) -} - -func (m *AddHAProxyServiceParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for NodeId - - // no validation rules for NodeName - - if all { - switch v := interface{}(m.GetAddNode()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AddHAProxyServiceParamsValidationError{ - field: "AddNode", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AddHAProxyServiceParamsValidationError{ - field: "AddNode", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetAddNode()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AddHAProxyServiceParamsValidationError{ - field: "AddNode", - reason: "embedded message failed validation", - cause: err, - } - } - } - - // no validation rules for Address - - if utf8.RuneCountInString(m.GetServiceName()) < 1 { - err := AddHAProxyServiceParamsValidationError{ - field: "ServiceName", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for Username - - // no validation rules for Password - - // no validation rules for Scheme - - // no validation rules for MetricsPath - - if val := m.GetListenPort(); val <= 0 || val >= 65536 { - err := AddHAProxyServiceParamsValidationError{ - field: "ListenPort", - reason: "value must be inside range (0, 65536)", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for Environment - - // no validation rules for Cluster - - // no validation rules for ReplicationSet - - // no validation rules for CustomLabels - - // no validation rules for MetricsMode - - // no validation rules for SkipConnectionCheck - - // no validation rules for TlsSkipVerify - - if len(errors) > 0 { - return AddHAProxyServiceParamsMultiError(errors) - } - - return nil -} - -// AddHAProxyServiceParamsMultiError is an error wrapping multiple validation -// errors returned by AddHAProxyServiceParams.ValidateAll() if the designated -// constraints aren't met. -type AddHAProxyServiceParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m AddHAProxyServiceParamsMultiError) 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 AddHAProxyServiceParamsMultiError) AllErrors() []error { return m } - -// AddHAProxyServiceParamsValidationError is the validation error returned by -// AddHAProxyServiceParams.Validate if the designated constraints aren't met. -type AddHAProxyServiceParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e AddHAProxyServiceParamsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e AddHAProxyServiceParamsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e AddHAProxyServiceParamsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e AddHAProxyServiceParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e AddHAProxyServiceParamsValidationError) ErrorName() string { - return "AddHAProxyServiceParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e AddHAProxyServiceParamsValidationError) 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 %sAddHAProxyServiceParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = AddHAProxyServiceParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = AddHAProxyServiceParamsValidationError{} - -// Validate checks the field values on HAProxyServiceResult 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 *HAProxyServiceResult) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on HAProxyServiceResult 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 -// HAProxyServiceResultMultiError, or nil if none found. -func (m *HAProxyServiceResult) ValidateAll() error { - return m.validate(true) -} - -func (m *HAProxyServiceResult) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if all { - switch v := interface{}(m.GetService()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, HAProxyServiceResultValidationError{ - field: "Service", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, HAProxyServiceResultValidationError{ - field: "Service", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetService()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return HAProxyServiceResultValidationError{ - field: "Service", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetExternalExporter()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, HAProxyServiceResultValidationError{ - field: "ExternalExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, HAProxyServiceResultValidationError{ - field: "ExternalExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetExternalExporter()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return HAProxyServiceResultValidationError{ - field: "ExternalExporter", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if len(errors) > 0 { - return HAProxyServiceResultMultiError(errors) - } - - return nil -} - -// HAProxyServiceResultMultiError is an error wrapping multiple validation -// errors returned by HAProxyServiceResult.ValidateAll() if the designated -// constraints aren't met. -type HAProxyServiceResultMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m HAProxyServiceResultMultiError) 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 HAProxyServiceResultMultiError) AllErrors() []error { return m } - -// HAProxyServiceResultValidationError is the validation error returned by -// HAProxyServiceResult.Validate if the designated constraints aren't met. -type HAProxyServiceResultValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e HAProxyServiceResultValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e HAProxyServiceResultValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e HAProxyServiceResultValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e HAProxyServiceResultValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e HAProxyServiceResultValidationError) ErrorName() string { - return "HAProxyServiceResultValidationError" -} - -// Error satisfies the builtin error interface -func (e HAProxyServiceResultValidationError) 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 %sHAProxyServiceResult.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = HAProxyServiceResultValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = HAProxyServiceResultValidationError{} 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 deleted file mode 100644 index 0a6148e59af..00000000000 --- a/api/management/v1/json/client/management_service/add_annotation_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" -) - -// NewAddAnnotationParams creates a new AddAnnotationParams 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 NewAddAnnotationParams() *AddAnnotationParams { - return &AddAnnotationParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewAddAnnotationParamsWithTimeout creates a new AddAnnotationParams object -// with the ability to set a timeout on a request. -func NewAddAnnotationParamsWithTimeout(timeout time.Duration) *AddAnnotationParams { - return &AddAnnotationParams{ - timeout: timeout, - } -} - -// NewAddAnnotationParamsWithContext creates a new AddAnnotationParams object -// with the ability to set a context for a request. -func NewAddAnnotationParamsWithContext(ctx context.Context) *AddAnnotationParams { - return &AddAnnotationParams{ - Context: ctx, - } -} - -// NewAddAnnotationParamsWithHTTPClient creates a new AddAnnotationParams object -// with the ability to set a custom HTTPClient for a request. -func NewAddAnnotationParamsWithHTTPClient(client *http.Client) *AddAnnotationParams { - return &AddAnnotationParams{ - HTTPClient: client, - } -} - -/* -AddAnnotationParams contains all the parameters to send to the API endpoint - - for the add annotation operation. - - Typically these are written to a http.Request. -*/ -type AddAnnotationParams struct { - /* Body. - - AddAnnotationRequest is a params to add new annotation. - */ - Body AddAnnotationBody - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the add annotation params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *AddAnnotationParams) WithDefaults() *AddAnnotationParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the add annotation params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *AddAnnotationParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the add annotation params -func (o *AddAnnotationParams) WithTimeout(timeout time.Duration) *AddAnnotationParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the add annotation params -func (o *AddAnnotationParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the add annotation params -func (o *AddAnnotationParams) WithContext(ctx context.Context) *AddAnnotationParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the add annotation params -func (o *AddAnnotationParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the add annotation params -func (o *AddAnnotationParams) WithHTTPClient(client *http.Client) *AddAnnotationParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the add annotation params -func (o *AddAnnotationParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the add annotation params -func (o *AddAnnotationParams) WithBody(body AddAnnotationBody) *AddAnnotationParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the add annotation params -func (o *AddAnnotationParams) SetBody(body AddAnnotationBody) { - o.Body = body -} - -// 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 - } - 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/add_annotation_responses.go b/api/management/v1/json/client/management_service/add_annotation_responses.go deleted file mode 100644 index e0707e893c8..00000000000 --- a/api/management/v1/json/client/management_service/add_annotation_responses.go +++ /dev/null @@ -1,460 +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" -) - -// AddAnnotationReader is a Reader for the AddAnnotation structure. -type AddAnnotationReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *AddAnnotationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewAddAnnotationOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewAddAnnotationDefault(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 - } -} - -// NewAddAnnotationOK creates a AddAnnotationOK with default headers values -func NewAddAnnotationOK() *AddAnnotationOK { - return &AddAnnotationOK{} -} - -/* -AddAnnotationOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type AddAnnotationOK struct { - Payload any -} - -// IsSuccess returns true when this add annotation Ok response has a 2xx status code -func (o *AddAnnotationOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this add annotation Ok response has a 3xx status code -func (o *AddAnnotationOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this add annotation Ok response has a 4xx status code -func (o *AddAnnotationOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this add annotation Ok response has a 5xx status code -func (o *AddAnnotationOK) IsServerError() bool { - return false -} - -// IsCode returns true when this add annotation Ok response a status code equal to that given -func (o *AddAnnotationOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the add annotation Ok response -func (o *AddAnnotationOK) Code() int { - return 200 -} - -func (o *AddAnnotationOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/management/annotations][%d] addAnnotationOk %s", 200, payload) -} - -func (o *AddAnnotationOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/management/annotations][%d] addAnnotationOk %s", 200, payload) -} - -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 && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -// NewAddAnnotationDefault creates a AddAnnotationDefault with default headers values -func NewAddAnnotationDefault(code int) *AddAnnotationDefault { - return &AddAnnotationDefault{ - _statusCode: code, - } -} - -/* -AddAnnotationDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type AddAnnotationDefault struct { - _statusCode int - - Payload *AddAnnotationDefaultBody -} - -// IsSuccess returns true when this add annotation default response has a 2xx status code -func (o *AddAnnotationDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this add annotation default response has a 3xx status code -func (o *AddAnnotationDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this add annotation default response has a 4xx status code -func (o *AddAnnotationDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this add annotation default response has a 5xx status code -func (o *AddAnnotationDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this add annotation default response a status code equal to that given -func (o *AddAnnotationDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the add annotation default response -func (o *AddAnnotationDefault) Code() int { - return o._statusCode -} - -func (o *AddAnnotationDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/management/annotations][%d] AddAnnotation default %s", o._statusCode, payload) -} - -func (o *AddAnnotationDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/management/annotations][%d] AddAnnotation default %s", o._statusCode, payload) -} - -func (o *AddAnnotationDefault) GetPayload() *AddAnnotationDefaultBody { - return o.Payload -} - -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) { - return err - } - - return nil -} - -/* -AddAnnotationBody AddAnnotationRequest is a params to add new annotation. -swagger:model AddAnnotationBody -*/ -type AddAnnotationBody struct { - // An annotation description. Required. - Text string `json:"text,omitempty"` - - // Tags are used to filter annotations. - Tags []string `json:"tags"` - - // Used for annotating a node. - NodeName string `json:"node_name,omitempty"` - - // Used for annotating services. - ServiceNames []string `json:"service_names"` -} - -// Validate validates this add annotation body -func (o *AddAnnotationBody) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this add annotation body based on context it is used -func (o *AddAnnotationBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddAnnotationBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddAnnotationBody) UnmarshalBinary(b []byte) error { - var res AddAnnotationBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddAnnotationDefaultBody add annotation default body -swagger:model AddAnnotationDefaultBody -*/ -type AddAnnotationDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*AddAnnotationDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this add annotation default body -func (o *AddAnnotationDefaultBody) 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 *AddAnnotationDefaultBody) 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("AddAnnotation default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("AddAnnotation default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this add annotation default body based on the context it is used -func (o *AddAnnotationDefaultBody) 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 *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 - return nil - } - - if err := o.Details[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("AddAnnotation default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("AddAnnotation default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *AddAnnotationDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddAnnotationDefaultBody) UnmarshalBinary(b []byte) error { - var res AddAnnotationDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -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:"-"` -} - -// 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"` - } - if err := json.Unmarshal(data, &stage1); err != nil { - return err - } - var rcv AddAnnotationDefaultBodyDetailsItems0 - - 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.AddAnnotationDefaultBodyDetailsItems0 = result - } - - return nil -} - -// 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"` - } - - stage1.AtType = o.AtType - - // make JSON object for known properties - props, err := json.Marshal(stage1) - if err != nil { - return nil, err - } - - if len(o.AddAnnotationDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.AddAnnotationDefaultBodyDetailsItems0) - 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 add annotation default body details items0 -func (o *AddAnnotationDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this add annotation default body details items0 based on context it is used -func (o *AddAnnotationDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddAnnotationDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddAnnotationDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res AddAnnotationDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} 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 deleted file mode 100644 index b9e1d96ff02..00000000000 --- a/api/management/v1/json/client/management_service/add_azure_database_parameters.go +++ /dev/null @@ -1,144 +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" -) - -// NewAddAzureDatabaseParams creates a new AddAzureDatabaseParams 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 NewAddAzureDatabaseParams() *AddAzureDatabaseParams { - return &AddAzureDatabaseParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewAddAzureDatabaseParamsWithTimeout creates a new AddAzureDatabaseParams object -// with the ability to set a timeout on a request. -func NewAddAzureDatabaseParamsWithTimeout(timeout time.Duration) *AddAzureDatabaseParams { - return &AddAzureDatabaseParams{ - timeout: timeout, - } -} - -// NewAddAzureDatabaseParamsWithContext creates a new AddAzureDatabaseParams object -// with the ability to set a context for a request. -func NewAddAzureDatabaseParamsWithContext(ctx context.Context) *AddAzureDatabaseParams { - return &AddAzureDatabaseParams{ - Context: ctx, - } -} - -// NewAddAzureDatabaseParamsWithHTTPClient creates a new AddAzureDatabaseParams object -// with the ability to set a custom HTTPClient for a request. -func NewAddAzureDatabaseParamsWithHTTPClient(client *http.Client) *AddAzureDatabaseParams { - return &AddAzureDatabaseParams{ - HTTPClient: client, - } -} - -/* -AddAzureDatabaseParams contains all the parameters to send to the API endpoint - - for the add azure database operation. - - Typically these are written to a http.Request. -*/ -type AddAzureDatabaseParams struct { - // Body. - Body AddAzureDatabaseBody - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the add azure database params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *AddAzureDatabaseParams) WithDefaults() *AddAzureDatabaseParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the add azure database params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *AddAzureDatabaseParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the add azure database params -func (o *AddAzureDatabaseParams) WithTimeout(timeout time.Duration) *AddAzureDatabaseParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the add azure database params -func (o *AddAzureDatabaseParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the add azure database params -func (o *AddAzureDatabaseParams) WithContext(ctx context.Context) *AddAzureDatabaseParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the add azure database params -func (o *AddAzureDatabaseParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the add azure database params -func (o *AddAzureDatabaseParams) WithHTTPClient(client *http.Client) *AddAzureDatabaseParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the add azure database params -func (o *AddAzureDatabaseParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the add azure database params -func (o *AddAzureDatabaseParams) WithBody(body AddAzureDatabaseBody) *AddAzureDatabaseParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the add azure database params -func (o *AddAzureDatabaseParams) SetBody(body AddAzureDatabaseBody) { - o.Body = body -} - -// 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 - } - 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/add_azure_database_responses.go b/api/management/v1/json/client/management_service/add_azure_database_responses.go deleted file mode 100644 index 947f66d7e84..00000000000 --- a/api/management/v1/json/client/management_service/add_azure_database_responses.go +++ /dev/null @@ -1,585 +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" -) - -// AddAzureDatabaseReader is a Reader for the AddAzureDatabase structure. -type AddAzureDatabaseReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *AddAzureDatabaseReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewAddAzureDatabaseOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewAddAzureDatabaseDefault(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 - } -} - -// NewAddAzureDatabaseOK creates a AddAzureDatabaseOK with default headers values -func NewAddAzureDatabaseOK() *AddAzureDatabaseOK { - return &AddAzureDatabaseOK{} -} - -/* -AddAzureDatabaseOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type AddAzureDatabaseOK struct { - Payload any -} - -// IsSuccess returns true when this add azure database Ok response has a 2xx status code -func (o *AddAzureDatabaseOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this add azure database Ok response has a 3xx status code -func (o *AddAzureDatabaseOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this add azure database Ok response has a 4xx status code -func (o *AddAzureDatabaseOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this add azure database Ok response has a 5xx status code -func (o *AddAzureDatabaseOK) IsServerError() bool { - return false -} - -// IsCode returns true when this add azure database Ok response a status code equal to that given -func (o *AddAzureDatabaseOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the add azure database Ok response -func (o *AddAzureDatabaseOK) Code() int { - return 200 -} - -func (o *AddAzureDatabaseOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/management/services/azure][%d] addAzureDatabaseOk %s", 200, payload) -} - -func (o *AddAzureDatabaseOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/management/services/azure][%d] addAzureDatabaseOk %s", 200, payload) -} - -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 && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -// NewAddAzureDatabaseDefault creates a AddAzureDatabaseDefault with default headers values -func NewAddAzureDatabaseDefault(code int) *AddAzureDatabaseDefault { - return &AddAzureDatabaseDefault{ - _statusCode: code, - } -} - -/* -AddAzureDatabaseDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type AddAzureDatabaseDefault struct { - _statusCode int - - Payload *AddAzureDatabaseDefaultBody -} - -// IsSuccess returns true when this add azure database default response has a 2xx status code -func (o *AddAzureDatabaseDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this add azure database default response has a 3xx status code -func (o *AddAzureDatabaseDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this add azure database default response has a 4xx status code -func (o *AddAzureDatabaseDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this add azure database default response has a 5xx status code -func (o *AddAzureDatabaseDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this add azure database default response a status code equal to that given -func (o *AddAzureDatabaseDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the add azure database default response -func (o *AddAzureDatabaseDefault) Code() int { - return o._statusCode -} - -func (o *AddAzureDatabaseDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/management/services/azure][%d] AddAzureDatabase default %s", o._statusCode, payload) -} - -func (o *AddAzureDatabaseDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/management/services/azure][%d] AddAzureDatabase default %s", o._statusCode, payload) -} - -func (o *AddAzureDatabaseDefault) GetPayload() *AddAzureDatabaseDefaultBody { - return o.Payload -} - -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) { - return err - } - - return nil -} - -/* -AddAzureDatabaseBody add azure database body -swagger:model AddAzureDatabaseBody -*/ -type AddAzureDatabaseBody struct { - // Azure database location. - Region string `json:"region,omitempty"` - - // Azure database availability zone. - Az string `json:"az,omitempty"` - - // Azure database instance ID. - InstanceID string `json:"instance_id,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"` - - // Address used to connect to it. - Address string `json:"address,omitempty"` - - // Access port. - Port int64 `json:"port,omitempty"` - - // Unique across all Nodes user-defined name. Defaults to Azure Database instance ID. - NodeName string `json:"node_name,omitempty"` - - // Unique across all Services user-defined name. Defaults to Azure Database instance ID. - ServiceName string `json:"service_name,omitempty"` - - // Environment name. - Environment string `json:"environment,omitempty"` - - // Username for scraping metrics. - Username string `json:"username,omitempty"` - - // Password for scraping metrics. - Password string `json:"password,omitempty"` - - // Azure client ID. - AzureClientID string `json:"azure_client_id,omitempty"` - - // Azure client secret. - AzureClientSecret string `json:"azure_client_secret,omitempty"` - - // Azure tanant ID. - AzureTenantID string `json:"azure_tenant_id,omitempty"` - - // Azure subscription ID. - AzureSubscriptionID string `json:"azure_subscription_id,omitempty"` - - // Azure resource group. - AzureResourceGroup string `json:"azure_resource_group,omitempty"` - - // If true, adds azure_database_exporter. - AzureDatabaseExporter bool `json:"azure_database_exporter,omitempty"` - - // If true, adds qan-mysql-perfschema-agent or qan-postgresql-pgstatements-agent. - QAN bool `json:"qan,omitempty"` - - // Custom user-assigned labels for Node and Service. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // Skip connection check. - SkipConnectionCheck bool `json:"skip_connection_check,omitempty"` - - // Use TLS for database connections. - TLS bool `json:"tls,omitempty"` - - // Skip TLS certificate and hostname validation. - TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - - // Disable query examples. - DisableQueryExamples bool `json:"disable_query_examples,omitempty"` - - // Tablestats group collectors will be disabled if there are more than that number of tables. - // If zero, server's default value is used. - // Use negative value to disable them. - TablestatsGroupTableLimit int32 `json:"tablestats_group_table_limit,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 add azure database body -func (o *AddAzureDatabaseBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var addAzureDatabaseBodyTypeTypePropEnum []any - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["DISCOVER_AZURE_DATABASE_TYPE_UNSPECIFIED","DISCOVER_AZURE_DATABASE_TYPE_MYSQL","DISCOVER_AZURE_DATABASE_TYPE_POSTGRESQL"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - addAzureDatabaseBodyTypeTypePropEnum = append(addAzureDatabaseBodyTypeTypePropEnum, v) - } -} - -const ( - - // AddAzureDatabaseBodyTypeDISCOVERAZUREDATABASETYPEUNSPECIFIED captures enum value "DISCOVER_AZURE_DATABASE_TYPE_UNSPECIFIED" - AddAzureDatabaseBodyTypeDISCOVERAZUREDATABASETYPEUNSPECIFIED string = "DISCOVER_AZURE_DATABASE_TYPE_UNSPECIFIED" - - // AddAzureDatabaseBodyTypeDISCOVERAZUREDATABASETYPEMYSQL captures enum value "DISCOVER_AZURE_DATABASE_TYPE_MYSQL" - AddAzureDatabaseBodyTypeDISCOVERAZUREDATABASETYPEMYSQL string = "DISCOVER_AZURE_DATABASE_TYPE_MYSQL" - - // AddAzureDatabaseBodyTypeDISCOVERAZUREDATABASETYPEPOSTGRESQL captures enum value "DISCOVER_AZURE_DATABASE_TYPE_POSTGRESQL" - AddAzureDatabaseBodyTypeDISCOVERAZUREDATABASETYPEPOSTGRESQL string = "DISCOVER_AZURE_DATABASE_TYPE_POSTGRESQL" -) - -// prop value enum -func (o *AddAzureDatabaseBody) validateTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addAzureDatabaseBodyTypeTypePropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddAzureDatabaseBody) validateType(formats strfmt.Registry) error { - if swag.IsZero(o.Type) { // not required - return nil - } - - // value enum - if err := o.validateTypeEnum("body"+"."+"type", "body", *o.Type); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this add azure database body based on context it is used -func (o *AddAzureDatabaseBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddAzureDatabaseBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddAzureDatabaseBody) UnmarshalBinary(b []byte) error { - var res AddAzureDatabaseBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddAzureDatabaseDefaultBody add azure database default body -swagger:model AddAzureDatabaseDefaultBody -*/ -type AddAzureDatabaseDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*AddAzureDatabaseDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this add azure database default body -func (o *AddAzureDatabaseDefaultBody) 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 *AddAzureDatabaseDefaultBody) 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("AddAzureDatabase default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("AddAzureDatabase default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this add azure database default body based on the context it is used -func (o *AddAzureDatabaseDefaultBody) 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 *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 - return nil - } - - if err := o.Details[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("AddAzureDatabase default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("AddAzureDatabase default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *AddAzureDatabaseDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddAzureDatabaseDefaultBody) UnmarshalBinary(b []byte) error { - var res AddAzureDatabaseDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddAzureDatabaseDefaultBodyDetailsItems0 add azure database default body details items0 -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:"-"` -} - -// 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"` - } - if err := json.Unmarshal(data, &stage1); err != nil { - return err - } - var rcv AddAzureDatabaseDefaultBodyDetailsItems0 - - 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.AddAzureDatabaseDefaultBodyDetailsItems0 = result - } - - return nil -} - -// 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"` - } - - stage1.AtType = o.AtType - - // make JSON object for known properties - props, err := json.Marshal(stage1) - if err != nil { - return nil, err - } - - if len(o.AddAzureDatabaseDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.AddAzureDatabaseDefaultBodyDetailsItems0) - 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 add azure database default body details items0 -func (o *AddAzureDatabaseDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this add azure database default body details items0 based on context it is used -func (o *AddAzureDatabaseDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddAzureDatabaseDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddAzureDatabaseDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res AddAzureDatabaseDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} 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 deleted file mode 100644 index 64e2dd78b6b..00000000000 --- a/api/management/v1/json/client/management_service/add_service_parameters.go +++ /dev/null @@ -1,144 +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" -) - -// NewAddServiceParams creates a new AddServiceParams 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 NewAddServiceParams() *AddServiceParams { - return &AddServiceParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewAddServiceParamsWithTimeout creates a new AddServiceParams object -// with the ability to set a timeout on a request. -func NewAddServiceParamsWithTimeout(timeout time.Duration) *AddServiceParams { - return &AddServiceParams{ - timeout: timeout, - } -} - -// NewAddServiceParamsWithContext creates a new AddServiceParams object -// with the ability to set a context for a request. -func NewAddServiceParamsWithContext(ctx context.Context) *AddServiceParams { - return &AddServiceParams{ - Context: ctx, - } -} - -// NewAddServiceParamsWithHTTPClient creates a new AddServiceParams object -// with the ability to set a custom HTTPClient for a request. -func NewAddServiceParamsWithHTTPClient(client *http.Client) *AddServiceParams { - return &AddServiceParams{ - HTTPClient: client, - } -} - -/* -AddServiceParams contains all the parameters to send to the API endpoint - - for the add service operation. - - Typically these are written to a http.Request. -*/ -type AddServiceParams struct { - // Body. - Body AddServiceBody - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the add service params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *AddServiceParams) WithDefaults() *AddServiceParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the add service params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *AddServiceParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the add service params -func (o *AddServiceParams) WithTimeout(timeout time.Duration) *AddServiceParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the add service params -func (o *AddServiceParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the add service params -func (o *AddServiceParams) WithContext(ctx context.Context) *AddServiceParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the add service params -func (o *AddServiceParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the add service params -func (o *AddServiceParams) WithHTTPClient(client *http.Client) *AddServiceParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the add service params -func (o *AddServiceParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the add service params -func (o *AddServiceParams) WithBody(body AddServiceBody) *AddServiceParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the add service params -func (o *AddServiceParams) SetBody(body AddServiceBody) { - o.Body = body -} - -// 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 - } - 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/add_service_responses.go b/api/management/v1/json/client/management_service/add_service_responses.go deleted file mode 100644 index c65c2a2c071..00000000000 --- a/api/management/v1/json/client/management_service/add_service_responses.go +++ /dev/null @@ -1,11884 +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" -) - -// AddServiceReader is a Reader for the AddService structure. -type AddServiceReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *AddServiceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewAddServiceOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewAddServiceDefault(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 - } -} - -// NewAddServiceOK creates a AddServiceOK with default headers values -func NewAddServiceOK() *AddServiceOK { - return &AddServiceOK{} -} - -/* -AddServiceOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type AddServiceOK struct { - Payload *AddServiceOKBody -} - -// IsSuccess returns true when this add service Ok response has a 2xx status code -func (o *AddServiceOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this add service Ok response has a 3xx status code -func (o *AddServiceOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this add service Ok response has a 4xx status code -func (o *AddServiceOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this add service Ok response has a 5xx status code -func (o *AddServiceOK) IsServerError() bool { - return false -} - -// IsCode returns true when this add service Ok response a status code equal to that given -func (o *AddServiceOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the add service Ok response -func (o *AddServiceOK) Code() int { - return 200 -} - -func (o *AddServiceOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/management/services][%d] addServiceOk %s", 200, payload) -} - -func (o *AddServiceOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/management/services][%d] addServiceOk %s", 200, payload) -} - -func (o *AddServiceOK) GetPayload() *AddServiceOKBody { - return o.Payload -} - -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) { - return err - } - - return nil -} - -// NewAddServiceDefault creates a AddServiceDefault with default headers values -func NewAddServiceDefault(code int) *AddServiceDefault { - return &AddServiceDefault{ - _statusCode: code, - } -} - -/* -AddServiceDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type AddServiceDefault struct { - _statusCode int - - Payload *AddServiceDefaultBody -} - -// IsSuccess returns true when this add service default response has a 2xx status code -func (o *AddServiceDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this add service default response has a 3xx status code -func (o *AddServiceDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this add service default response has a 4xx status code -func (o *AddServiceDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this add service default response has a 5xx status code -func (o *AddServiceDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this add service default response a status code equal to that given -func (o *AddServiceDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the add service default response -func (o *AddServiceDefault) Code() int { - return o._statusCode -} - -func (o *AddServiceDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/management/services][%d] AddService default %s", o._statusCode, payload) -} - -func (o *AddServiceDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/management/services][%d] AddService default %s", o._statusCode, payload) -} - -func (o *AddServiceDefault) GetPayload() *AddServiceDefaultBody { - return o.Payload -} - -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) { - return err - } - - return nil -} - -/* -AddServiceBody add service body -swagger:model AddServiceBody -*/ -type AddServiceBody struct { - // external - External *AddServiceParamsBodyExternal `json:"external,omitempty"` - - // haproxy - Haproxy *AddServiceParamsBodyHaproxy `json:"haproxy,omitempty"` - - // mongodb - Mongodb *AddServiceParamsBodyMongodb `json:"mongodb,omitempty"` - - // mysql - Mysql *AddServiceParamsBodyMysql `json:"mysql,omitempty"` - - // postgresql - Postgresql *AddServiceParamsBodyPostgresql `json:"postgresql,omitempty"` - - // proxysql - Proxysql *AddServiceParamsBodyProxysql `json:"proxysql,omitempty"` - - // rds - RDS *AddServiceParamsBodyRDS `json:"rds,omitempty"` - - // valkey - Valkey *AddServiceParamsBodyValkey `json:"valkey,omitempty"` -} - -// Validate validates this add service body -func (o *AddServiceBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateExternal(formats); err != nil { - res = append(res, err) - } - - if err := o.validateHaproxy(formats); err != nil { - res = append(res, err) - } - - if err := o.validateMongodb(formats); err != nil { - res = append(res, err) - } - - if err := o.validateMysql(formats); err != nil { - res = append(res, err) - } - - if err := o.validatePostgresql(formats); err != nil { - res = append(res, err) - } - - if err := o.validateProxysql(formats); err != nil { - res = append(res, err) - } - - if err := o.validateRDS(formats); err != nil { - res = append(res, err) - } - - if err := o.validateValkey(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *AddServiceBody) validateExternal(formats strfmt.Registry) error { - if swag.IsZero(o.External) { // not required - return nil - } - - if o.External != nil { - if err := o.External.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "external") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "external") - } - - return err - } - } - - return nil -} - -func (o *AddServiceBody) validateHaproxy(formats strfmt.Registry) error { - if swag.IsZero(o.Haproxy) { // not required - return nil - } - - if o.Haproxy != nil { - if err := o.Haproxy.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "haproxy") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "haproxy") - } - - return err - } - } - - return nil -} - -func (o *AddServiceBody) validateMongodb(formats strfmt.Registry) error { - if swag.IsZero(o.Mongodb) { // not required - return nil - } - - if o.Mongodb != nil { - if err := o.Mongodb.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "mongodb") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "mongodb") - } - - return err - } - } - - return nil -} - -func (o *AddServiceBody) validateMysql(formats strfmt.Registry) error { - if swag.IsZero(o.Mysql) { // not required - return nil - } - - if o.Mysql != nil { - if err := o.Mysql.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "mysql") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "mysql") - } - - return err - } - } - - return nil -} - -func (o *AddServiceBody) validatePostgresql(formats strfmt.Registry) error { - if swag.IsZero(o.Postgresql) { // not required - return nil - } - - if o.Postgresql != nil { - if err := o.Postgresql.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "postgresql") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "postgresql") - } - - return err - } - } - - return nil -} - -func (o *AddServiceBody) validateProxysql(formats strfmt.Registry) error { - if swag.IsZero(o.Proxysql) { // not required - return nil - } - - if o.Proxysql != nil { - if err := o.Proxysql.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "proxysql") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "proxysql") - } - - return err - } - } - - return nil -} - -func (o *AddServiceBody) validateRDS(formats strfmt.Registry) error { - if swag.IsZero(o.RDS) { // not required - return nil - } - - if o.RDS != nil { - if err := o.RDS.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "rds") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "rds") - } - - return err - } - } - - return nil -} - -func (o *AddServiceBody) validateValkey(formats strfmt.Registry) error { - if swag.IsZero(o.Valkey) { // not required - return nil - } - - if o.Valkey != nil { - if err := o.Valkey.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "valkey") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "valkey") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this add service body based on the context it is used -func (o *AddServiceBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateExternal(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateHaproxy(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateMongodb(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateMysql(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidatePostgresql(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateProxysql(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateRDS(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateValkey(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *AddServiceBody) contextValidateExternal(ctx context.Context, formats strfmt.Registry) error { - if o.External != nil { - - if swag.IsZero(o.External) { // not required - return nil - } - - if err := o.External.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "external") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "external") - } - - return err - } - } - - return nil -} - -func (o *AddServiceBody) contextValidateHaproxy(ctx context.Context, formats strfmt.Registry) error { - if o.Haproxy != nil { - - if swag.IsZero(o.Haproxy) { // not required - return nil - } - - if err := o.Haproxy.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "haproxy") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "haproxy") - } - - return err - } - } - - return nil -} - -func (o *AddServiceBody) contextValidateMongodb(ctx context.Context, formats strfmt.Registry) error { - if o.Mongodb != nil { - - if swag.IsZero(o.Mongodb) { // not required - return nil - } - - if err := o.Mongodb.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "mongodb") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "mongodb") - } - - return err - } - } - - return nil -} - -func (o *AddServiceBody) contextValidateMysql(ctx context.Context, formats strfmt.Registry) error { - if o.Mysql != nil { - - if swag.IsZero(o.Mysql) { // not required - return nil - } - - if err := o.Mysql.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "mysql") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "mysql") - } - - return err - } - } - - return nil -} - -func (o *AddServiceBody) contextValidatePostgresql(ctx context.Context, formats strfmt.Registry) error { - if o.Postgresql != nil { - - if swag.IsZero(o.Postgresql) { // not required - return nil - } - - if err := o.Postgresql.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "postgresql") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "postgresql") - } - - return err - } - } - - return nil -} - -func (o *AddServiceBody) contextValidateProxysql(ctx context.Context, formats strfmt.Registry) error { - if o.Proxysql != nil { - - if swag.IsZero(o.Proxysql) { // not required - return nil - } - - if err := o.Proxysql.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "proxysql") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "proxysql") - } - - return err - } - } - - return nil -} - -func (o *AddServiceBody) contextValidateRDS(ctx context.Context, formats strfmt.Registry) error { - if o.RDS != nil { - - if swag.IsZero(o.RDS) { // not required - return nil - } - - if err := o.RDS.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "rds") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "rds") - } - - return err - } - } - - return nil -} - -func (o *AddServiceBody) contextValidateValkey(ctx context.Context, formats strfmt.Registry) error { - if o.Valkey != nil { - - if swag.IsZero(o.Valkey) { // not required - return nil - } - - if err := o.Valkey.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "valkey") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "valkey") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *AddServiceBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddServiceBody) UnmarshalBinary(b []byte) error { - var res AddServiceBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddServiceDefaultBody add service default body -swagger:model AddServiceDefaultBody -*/ -type AddServiceDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*AddServiceDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this add service default body -func (o *AddServiceDefaultBody) 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 *AddServiceDefaultBody) 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("AddService default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("AddService default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this add service default body based on the context it is used -func (o *AddServiceDefaultBody) 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 *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 - return nil - } - - if err := o.Details[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("AddService default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("AddService default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *AddServiceDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddServiceDefaultBody) UnmarshalBinary(b []byte) error { - var res AddServiceDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -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:"-"` -} - -// 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"` - } - if err := json.Unmarshal(data, &stage1); err != nil { - return err - } - var rcv AddServiceDefaultBodyDetailsItems0 - - 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.AddServiceDefaultBodyDetailsItems0 = result - } - - return nil -} - -// 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"` - } - - stage1.AtType = o.AtType - - // make JSON object for known properties - props, err := json.Marshal(stage1) - if err != nil { - return nil, err - } - - if len(o.AddServiceDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.AddServiceDefaultBodyDetailsItems0) - 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 add service default body details items0 -func (o *AddServiceDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this add service default body details items0 based on context it is used -func (o *AddServiceDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddServiceDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddServiceDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res AddServiceDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddServiceOKBody add service OK body -swagger:model AddServiceOKBody -*/ -type AddServiceOKBody struct { - // external - External *AddServiceOKBodyExternal `json:"external,omitempty"` - - // haproxy - Haproxy *AddServiceOKBodyHaproxy `json:"haproxy,omitempty"` - - // mongodb - Mongodb *AddServiceOKBodyMongodb `json:"mongodb,omitempty"` - - // mysql - Mysql *AddServiceOKBodyMysql `json:"mysql,omitempty"` - - // postgresql - Postgresql *AddServiceOKBodyPostgresql `json:"postgresql,omitempty"` - - // proxysql - Proxysql *AddServiceOKBodyProxysql `json:"proxysql,omitempty"` - - // rds - RDS *AddServiceOKBodyRDS `json:"rds,omitempty"` - - // valkey - Valkey *AddServiceOKBodyValkey `json:"valkey,omitempty"` -} - -// Validate validates this add service OK body -func (o *AddServiceOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateExternal(formats); err != nil { - res = append(res, err) - } - - if err := o.validateHaproxy(formats); err != nil { - res = append(res, err) - } - - if err := o.validateMongodb(formats); err != nil { - res = append(res, err) - } - - if err := o.validateMysql(formats); err != nil { - res = append(res, err) - } - - if err := o.validatePostgresql(formats); err != nil { - res = append(res, err) - } - - if err := o.validateProxysql(formats); err != nil { - res = append(res, err) - } - - if err := o.validateRDS(formats); err != nil { - res = append(res, err) - } - - if err := o.validateValkey(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *AddServiceOKBody) validateExternal(formats strfmt.Registry) error { - if swag.IsZero(o.External) { // not required - return nil - } - - if o.External != nil { - if err := o.External.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "external") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "external") - } - - return err - } - } - - return nil -} - -func (o *AddServiceOKBody) validateHaproxy(formats strfmt.Registry) error { - if swag.IsZero(o.Haproxy) { // not required - return nil - } - - if o.Haproxy != nil { - if err := o.Haproxy.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "haproxy") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "haproxy") - } - - return err - } - } - - return nil -} - -func (o *AddServiceOKBody) validateMongodb(formats strfmt.Registry) error { - if swag.IsZero(o.Mongodb) { // not required - return nil - } - - if o.Mongodb != nil { - if err := o.Mongodb.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "mongodb") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "mongodb") - } - - return err - } - } - - return nil -} - -func (o *AddServiceOKBody) validateMysql(formats strfmt.Registry) error { - if swag.IsZero(o.Mysql) { // not required - return nil - } - - if o.Mysql != nil { - if err := o.Mysql.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "mysql") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "mysql") - } - - return err - } - } - - return nil -} - -func (o *AddServiceOKBody) validatePostgresql(formats strfmt.Registry) error { - if swag.IsZero(o.Postgresql) { // not required - return nil - } - - if o.Postgresql != nil { - if err := o.Postgresql.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "postgresql") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "postgresql") - } - - return err - } - } - - return nil -} - -func (o *AddServiceOKBody) validateProxysql(formats strfmt.Registry) error { - if swag.IsZero(o.Proxysql) { // not required - return nil - } - - if o.Proxysql != nil { - if err := o.Proxysql.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "proxysql") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "proxysql") - } - - return err - } - } - - return nil -} - -func (o *AddServiceOKBody) validateRDS(formats strfmt.Registry) error { - if swag.IsZero(o.RDS) { // not required - return nil - } - - if o.RDS != nil { - if err := o.RDS.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "rds") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "rds") - } - - return err - } - } - - return nil -} - -func (o *AddServiceOKBody) validateValkey(formats strfmt.Registry) error { - if swag.IsZero(o.Valkey) { // not required - return nil - } - - if o.Valkey != nil { - if err := o.Valkey.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "valkey") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "valkey") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this add service OK body based on the context it is used -func (o *AddServiceOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateExternal(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateHaproxy(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateMongodb(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateMysql(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidatePostgresql(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateProxysql(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateRDS(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateValkey(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *AddServiceOKBody) contextValidateExternal(ctx context.Context, formats strfmt.Registry) error { - if o.External != nil { - - if swag.IsZero(o.External) { // not required - return nil - } - - if err := o.External.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "external") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "external") - } - - return err - } - } - - return nil -} - -func (o *AddServiceOKBody) contextValidateHaproxy(ctx context.Context, formats strfmt.Registry) error { - if o.Haproxy != nil { - - if swag.IsZero(o.Haproxy) { // not required - return nil - } - - if err := o.Haproxy.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "haproxy") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "haproxy") - } - - return err - } - } - - return nil -} - -func (o *AddServiceOKBody) contextValidateMongodb(ctx context.Context, formats strfmt.Registry) error { - if o.Mongodb != nil { - - if swag.IsZero(o.Mongodb) { // not required - return nil - } - - if err := o.Mongodb.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "mongodb") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "mongodb") - } - - return err - } - } - - return nil -} - -func (o *AddServiceOKBody) contextValidateMysql(ctx context.Context, formats strfmt.Registry) error { - if o.Mysql != nil { - - if swag.IsZero(o.Mysql) { // not required - return nil - } - - if err := o.Mysql.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "mysql") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "mysql") - } - - return err - } - } - - return nil -} - -func (o *AddServiceOKBody) contextValidatePostgresql(ctx context.Context, formats strfmt.Registry) error { - if o.Postgresql != nil { - - if swag.IsZero(o.Postgresql) { // not required - return nil - } - - if err := o.Postgresql.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "postgresql") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "postgresql") - } - - return err - } - } - - return nil -} - -func (o *AddServiceOKBody) contextValidateProxysql(ctx context.Context, formats strfmt.Registry) error { - if o.Proxysql != nil { - - if swag.IsZero(o.Proxysql) { // not required - return nil - } - - if err := o.Proxysql.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "proxysql") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "proxysql") - } - - return err - } - } - - return nil -} - -func (o *AddServiceOKBody) contextValidateRDS(ctx context.Context, formats strfmt.Registry) error { - if o.RDS != nil { - - if swag.IsZero(o.RDS) { // not required - return nil - } - - if err := o.RDS.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "rds") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "rds") - } - - return err - } - } - - return nil -} - -func (o *AddServiceOKBody) contextValidateValkey(ctx context.Context, formats strfmt.Registry) error { - if o.Valkey != nil { - - if swag.IsZero(o.Valkey) { // not required - return nil - } - - if err := o.Valkey.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "valkey") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "valkey") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *AddServiceOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddServiceOKBody) UnmarshalBinary(b []byte) error { - var res AddServiceOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddServiceOKBodyExternal add service OK body external -swagger:model AddServiceOKBodyExternal -*/ -type AddServiceOKBodyExternal struct { - // external exporter - ExternalExporter *AddServiceOKBodyExternalExternalExporter `json:"external_exporter,omitempty"` - - // service - Service *AddServiceOKBodyExternalService `json:"service,omitempty"` -} - -// Validate validates this add service OK body external -func (o *AddServiceOKBodyExternal) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateExternalExporter(formats); err != nil { - res = append(res, err) - } - - if err := o.validateService(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *AddServiceOKBodyExternal) validateExternalExporter(formats strfmt.Registry) error { - if swag.IsZero(o.ExternalExporter) { // not required - return nil - } - - if o.ExternalExporter != nil { - if err := o.ExternalExporter.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "external" + "." + "external_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "external" + "." + "external_exporter") - } - - return err - } - } - - return nil -} - -func (o *AddServiceOKBodyExternal) validateService(formats strfmt.Registry) error { - if swag.IsZero(o.Service) { // not required - return nil - } - - if o.Service != nil { - if err := o.Service.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "external" + "." + "service") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "external" + "." + "service") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this add service OK body external based on the context it is used -func (o *AddServiceOKBodyExternal) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateExternalExporter(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateService(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *AddServiceOKBodyExternal) contextValidateExternalExporter(ctx context.Context, formats strfmt.Registry) error { - if o.ExternalExporter != nil { - - if swag.IsZero(o.ExternalExporter) { // not required - return nil - } - - if err := o.ExternalExporter.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "external" + "." + "external_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "external" + "." + "external_exporter") - } - - return err - } - } - - return nil -} - -func (o *AddServiceOKBodyExternal) contextValidateService(ctx context.Context, formats strfmt.Registry) error { - if o.Service != nil { - - if swag.IsZero(o.Service) { // not required - return nil - } - - if err := o.Service.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "external" + "." + "service") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "external" + "." + "service") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *AddServiceOKBodyExternal) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddServiceOKBodyExternal) UnmarshalBinary(b []byte) error { - var res AddServiceOKBodyExternal - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddServiceOKBodyExternalExternalExporter ExternalExporter runs on any Node type, including Remote Node. -swagger:model AddServiceOKBodyExternalExternalExporter -*/ -type AddServiceOKBodyExternalExternalExporter struct { - // Unique randomly generated instance identifier. - AgentID string `json:"agent_id,omitempty"` - - // Node identifier where this instance runs. - RunsOnNodeID string `json:"runs_on_node_id,omitempty"` - - // If disabled, metrics from this exporter will not be collected. - Disabled bool `json:"disabled,omitempty"` - - // Service identifier. - ServiceID string `json:"service_id,omitempty"` - - // HTTP basic auth username for collecting metrics. - Username string `json:"username,omitempty"` - - // Scheme to generate URI to exporter metrics endpoints. - Scheme string `json:"scheme,omitempty"` - - // Path under which metrics are exposed, used to generate URI. - MetricsPath string `json:"metrics_path,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // Listen port for scraping metrics. - ListenPort int64 `json:"listen_port,omitempty"` - - // True if exporter uses push metrics mode. - PushMetricsEnabled bool `json:"push_metrics_enabled,omitempty"` - - // Path to exec process. - ProcessExecPath string `json:"process_exec_path,omitempty"` - - // Skip TLS certificate and hostname verification. - TLSSkipVerify bool `json:"tls_skip_verify,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 { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - 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 - - if err := o.contextValidateMetricsResolutions(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *AddServiceOKBodyExternalExternalExporter) 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 { - 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 -} - -// MarshalBinary interface implementation -func (o *AddServiceOKBodyExternalExternalExporter) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddServiceOKBodyExternalExternalExporter) UnmarshalBinary(b []byte) error { - var res AddServiceOKBodyExternalExternalExporter - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddServiceOKBodyExternalExternalExporterMetricsResolutions MetricsResolutions represents Prometheus exporters metrics resolutions. -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"` - - // Medium resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Mr string `json:"mr,omitempty"` - - // Low resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Lr string `json:"lr,omitempty"` -} - -// Validate validates this add service OK body external external exporter metrics resolutions -func (o *AddServiceOKBodyExternalExternalExporterMetricsResolutions) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this add service OK body external external exporter metrics resolutions based on context it is used -func (o *AddServiceOKBodyExternalExternalExporterMetricsResolutions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddServiceOKBodyExternalExternalExporterMetricsResolutions) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddServiceOKBodyExternalExternalExporterMetricsResolutions) UnmarshalBinary(b []byte) error { - var res AddServiceOKBodyExternalExternalExporterMetricsResolutions - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddServiceOKBodyExternalService ExternalService represents a generic External service instance. -swagger:model AddServiceOKBodyExternalService -*/ -type AddServiceOKBodyExternalService struct { - // Unique randomly generated instance identifier. - ServiceID string `json:"service_id,omitempty"` - - // Unique across all Services user-defined name. - ServiceName string `json:"service_name,omitempty"` - - // Node identifier where this service instance runs. - NodeID string `json:"node_id,omitempty"` - - // Environment name. - Environment string `json:"environment,omitempty"` - - // Cluster name. - Cluster string `json:"cluster,omitempty"` - - // Replication set name. - ReplicationSet string `json:"replication_set,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // Group name of external service. - Group string `json:"group,omitempty"` -} - -// Validate validates this add service OK body external service -func (o *AddServiceOKBodyExternalService) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this add service OK body external service based on context it is used -func (o *AddServiceOKBodyExternalService) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddServiceOKBodyExternalService) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddServiceOKBodyExternalService) UnmarshalBinary(b []byte) error { - var res AddServiceOKBodyExternalService - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddServiceOKBodyHaproxy add service OK body haproxy -swagger:model AddServiceOKBodyHaproxy -*/ -type AddServiceOKBodyHaproxy struct { - // external exporter - ExternalExporter *AddServiceOKBodyHaproxyExternalExporter `json:"external_exporter,omitempty"` - - // service - Service *AddServiceOKBodyHaproxyService `json:"service,omitempty"` -} - -// Validate validates this add service OK body haproxy -func (o *AddServiceOKBodyHaproxy) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateExternalExporter(formats); err != nil { - res = append(res, err) - } - - if err := o.validateService(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *AddServiceOKBodyHaproxy) validateExternalExporter(formats strfmt.Registry) error { - if swag.IsZero(o.ExternalExporter) { // not required - return nil - } - - if o.ExternalExporter != nil { - if err := o.ExternalExporter.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "haproxy" + "." + "external_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "haproxy" + "." + "external_exporter") - } - - return err - } - } - - return nil -} - -func (o *AddServiceOKBodyHaproxy) validateService(formats strfmt.Registry) error { - if swag.IsZero(o.Service) { // not required - return nil - } - - if o.Service != nil { - if err := o.Service.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "haproxy" + "." + "service") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "haproxy" + "." + "service") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this add service OK body haproxy based on the context it is used -func (o *AddServiceOKBodyHaproxy) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateExternalExporter(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateService(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *AddServiceOKBodyHaproxy) contextValidateExternalExporter(ctx context.Context, formats strfmt.Registry) error { - if o.ExternalExporter != nil { - - if swag.IsZero(o.ExternalExporter) { // not required - return nil - } - - if err := o.ExternalExporter.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "haproxy" + "." + "external_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "haproxy" + "." + "external_exporter") - } - - return err - } - } - - return nil -} - -func (o *AddServiceOKBodyHaproxy) contextValidateService(ctx context.Context, formats strfmt.Registry) error { - if o.Service != nil { - - if swag.IsZero(o.Service) { // not required - return nil - } - - if err := o.Service.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "haproxy" + "." + "service") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "haproxy" + "." + "service") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *AddServiceOKBodyHaproxy) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddServiceOKBodyHaproxy) UnmarshalBinary(b []byte) error { - var res AddServiceOKBodyHaproxy - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddServiceOKBodyHaproxyExternalExporter ExternalExporter runs on any Node type, including Remote Node. -swagger:model AddServiceOKBodyHaproxyExternalExporter -*/ -type AddServiceOKBodyHaproxyExternalExporter struct { - // Unique randomly generated instance identifier. - AgentID string `json:"agent_id,omitempty"` - - // Node identifier where this instance runs. - RunsOnNodeID string `json:"runs_on_node_id,omitempty"` - - // If disabled, metrics from this exporter will not be collected. - Disabled bool `json:"disabled,omitempty"` - - // Service identifier. - ServiceID string `json:"service_id,omitempty"` - - // HTTP basic auth username for collecting metrics. - Username string `json:"username,omitempty"` - - // Scheme to generate URI to exporter metrics endpoints. - Scheme string `json:"scheme,omitempty"` - - // Path under which metrics are exposed, used to generate URI. - MetricsPath string `json:"metrics_path,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // Listen port for scraping metrics. - ListenPort int64 `json:"listen_port,omitempty"` - - // True if exporter uses push metrics mode. - PushMetricsEnabled bool `json:"push_metrics_enabled,omitempty"` - - // Path to exec process. - ProcessExecPath string `json:"process_exec_path,omitempty"` - - // Skip TLS certificate and hostname verification. - TLSSkipVerify bool `json:"tls_skip_verify,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 { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - 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 - - if err := o.contextValidateMetricsResolutions(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *AddServiceOKBodyHaproxyExternalExporter) 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 { - 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 -} - -// MarshalBinary interface implementation -func (o *AddServiceOKBodyHaproxyExternalExporter) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddServiceOKBodyHaproxyExternalExporter) UnmarshalBinary(b []byte) error { - var res AddServiceOKBodyHaproxyExternalExporter - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddServiceOKBodyHaproxyExternalExporterMetricsResolutions MetricsResolutions represents Prometheus exporters metrics resolutions. -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"` - - // Medium resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Mr string `json:"mr,omitempty"` - - // Low resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Lr string `json:"lr,omitempty"` -} - -// Validate validates this add service OK body haproxy external exporter metrics resolutions -func (o *AddServiceOKBodyHaproxyExternalExporterMetricsResolutions) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this add service OK body haproxy external exporter metrics resolutions based on context it is used -func (o *AddServiceOKBodyHaproxyExternalExporterMetricsResolutions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddServiceOKBodyHaproxyExternalExporterMetricsResolutions) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddServiceOKBodyHaproxyExternalExporterMetricsResolutions) UnmarshalBinary(b []byte) error { - var res AddServiceOKBodyHaproxyExternalExporterMetricsResolutions - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddServiceOKBodyHaproxyService HAProxyService represents a generic HAProxy service instance. -swagger:model AddServiceOKBodyHaproxyService -*/ -type AddServiceOKBodyHaproxyService struct { - // Unique randomly generated instance identifier. - ServiceID string `json:"service_id,omitempty"` - - // Unique across all Services user-defined name. - ServiceName string `json:"service_name,omitempty"` - - // Node identifier where this service instance runs. - NodeID string `json:"node_id,omitempty"` - - // Environment name. - Environment string `json:"environment,omitempty"` - - // Cluster name. - Cluster string `json:"cluster,omitempty"` - - // Replication set name. - ReplicationSet string `json:"replication_set,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` -} - -// Validate validates this add service OK body haproxy service -func (o *AddServiceOKBodyHaproxyService) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this add service OK body haproxy service based on context it is used -func (o *AddServiceOKBodyHaproxyService) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddServiceOKBodyHaproxyService) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddServiceOKBodyHaproxyService) UnmarshalBinary(b []byte) error { - var res AddServiceOKBodyHaproxyService - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddServiceOKBodyMongodb add service OK body mongodb -swagger:model AddServiceOKBodyMongodb -*/ -type AddServiceOKBodyMongodb struct { - // mongodb exporter - MongodbExporter *AddServiceOKBodyMongodbMongodbExporter `json:"mongodb_exporter,omitempty"` - - // qan mongodb mongolog - QANMongodbMongolog *AddServiceOKBodyMongodbQANMongodbMongolog `json:"qan_mongodb_mongolog,omitempty"` - - // qan mongodb profiler - QANMongodbProfiler *AddServiceOKBodyMongodbQANMongodbProfiler `json:"qan_mongodb_profiler,omitempty"` - - // service - Service *AddServiceOKBodyMongodbService `json:"service,omitempty"` -} - -// Validate validates this add service OK body mongodb -func (o *AddServiceOKBodyMongodb) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateMongodbExporter(formats); err != nil { - res = append(res, err) - } - - if err := o.validateQANMongodbMongolog(formats); err != nil { - res = append(res, err) - } - - if err := o.validateQANMongodbProfiler(formats); err != nil { - res = append(res, err) - } - - if err := o.validateService(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *AddServiceOKBodyMongodb) validateMongodbExporter(formats strfmt.Registry) error { - if swag.IsZero(o.MongodbExporter) { // not required - return nil - } - - if o.MongodbExporter != nil { - if err := o.MongodbExporter.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "mongodb" + "." + "mongodb_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "mongodb" + "." + "mongodb_exporter") - } - - return err - } - } - - return nil -} - -func (o *AddServiceOKBodyMongodb) validateQANMongodbMongolog(formats strfmt.Registry) error { - if swag.IsZero(o.QANMongodbMongolog) { // not required - return nil - } - - if o.QANMongodbMongolog != nil { - if err := o.QANMongodbMongolog.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "mongodb" + "." + "qan_mongodb_mongolog") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "mongodb" + "." + "qan_mongodb_mongolog") - } - - return err - } - } - - return nil -} - -func (o *AddServiceOKBodyMongodb) validateQANMongodbProfiler(formats strfmt.Registry) error { - if swag.IsZero(o.QANMongodbProfiler) { // not required - return nil - } - - if o.QANMongodbProfiler != nil { - if err := o.QANMongodbProfiler.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "mongodb" + "." + "qan_mongodb_profiler") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "mongodb" + "." + "qan_mongodb_profiler") - } - - return err - } - } - - return nil -} - -func (o *AddServiceOKBodyMongodb) validateService(formats strfmt.Registry) error { - if swag.IsZero(o.Service) { // not required - return nil - } - - if o.Service != nil { - if err := o.Service.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "mongodb" + "." + "service") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "mongodb" + "." + "service") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this add service OK body mongodb based on the context it is used -func (o *AddServiceOKBodyMongodb) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateMongodbExporter(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateQANMongodbMongolog(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateQANMongodbProfiler(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateService(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *AddServiceOKBodyMongodb) contextValidateMongodbExporter(ctx context.Context, formats strfmt.Registry) error { - if o.MongodbExporter != nil { - - if swag.IsZero(o.MongodbExporter) { // not required - return nil - } - - if err := o.MongodbExporter.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "mongodb" + "." + "mongodb_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "mongodb" + "." + "mongodb_exporter") - } - - return err - } - } - - return nil -} - -func (o *AddServiceOKBodyMongodb) contextValidateQANMongodbMongolog(ctx context.Context, formats strfmt.Registry) error { - if o.QANMongodbMongolog != nil { - - if swag.IsZero(o.QANMongodbMongolog) { // not required - return nil - } - - if err := o.QANMongodbMongolog.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "mongodb" + "." + "qan_mongodb_mongolog") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "mongodb" + "." + "qan_mongodb_mongolog") - } - - return err - } - } - - return nil -} - -func (o *AddServiceOKBodyMongodb) contextValidateQANMongodbProfiler(ctx context.Context, formats strfmt.Registry) error { - if o.QANMongodbProfiler != nil { - - if swag.IsZero(o.QANMongodbProfiler) { // not required - return nil - } - - if err := o.QANMongodbProfiler.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "mongodb" + "." + "qan_mongodb_profiler") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "mongodb" + "." + "qan_mongodb_profiler") - } - - return err - } - } - - return nil -} - -func (o *AddServiceOKBodyMongodb) contextValidateService(ctx context.Context, formats strfmt.Registry) error { - if o.Service != nil { - - if swag.IsZero(o.Service) { // not required - return nil - } - - if err := o.Service.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "mongodb" + "." + "service") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "mongodb" + "." + "service") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *AddServiceOKBodyMongodb) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddServiceOKBodyMongodb) UnmarshalBinary(b []byte) error { - var res AddServiceOKBodyMongodb - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddServiceOKBodyMongodbMongodbExporter MongoDBExporter runs on Generic or Container Node and exposes MongoDB Service metrics. -swagger:model AddServiceOKBodyMongodbMongodbExporter -*/ -type AddServiceOKBodyMongodbMongodbExporter struct { - // Unique randomly generated instance identifier. - AgentID string `json:"agent_id,omitempty"` - - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `json:"disabled,omitempty"` - - // Service identifier. - ServiceID string `json:"service_id,omitempty"` - - // MongoDB username for scraping metrics. - Username string `json:"username,omitempty"` - - // Use TLS for database connections. - TLS bool `json:"tls,omitempty"` - - // Skip TLS certificate and hostname validation. - TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // True if exporter uses push metrics mode. - PushMetricsEnabled bool `json:"push_metrics_enabled,omitempty"` - - // 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"` - - // 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. - EnableAllCollectors bool `json:"enable_all_collectors,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"` - - // Optionally expose the exporter process on all public interfaces - ExposeExporter bool `json:"expose_exporter,omitempty"` - - // metrics resolutions - MetricsResolutions *AddServiceOKBodyMongodbMongodbExporterMetricsResolutions `json:"metrics_resolutions,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 { - 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 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 - 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 { - addServiceOkBodyMongodbMongodbExporterTypeLogLevelPropEnum = append(addServiceOkBodyMongodbMongodbExporterTypeLogLevelPropEnum, v) - } -} - -const ( - - // AddServiceOKBodyMongodbMongodbExporterLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - AddServiceOKBodyMongodbMongodbExporterLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // AddServiceOKBodyMongodbMongodbExporterLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - AddServiceOKBodyMongodbMongodbExporterLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // AddServiceOKBodyMongodbMongodbExporterLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - AddServiceOKBodyMongodbMongodbExporterLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // AddServiceOKBodyMongodbMongodbExporterLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - AddServiceOKBodyMongodbMongodbExporterLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // AddServiceOKBodyMongodbMongodbExporterLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - AddServiceOKBodyMongodbMongodbExporterLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // AddServiceOKBodyMongodbMongodbExporterLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - AddServiceOKBodyMongodbMongodbExporterLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -func (o *AddServiceOKBodyMongodbMongodbExporter) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addServiceOkBodyMongodbMongodbExporterTypeLogLevelPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddServiceOKBodyMongodbMongodbExporter) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("addServiceOk"+"."+"mongodb"+"."+"mongodb_exporter"+"."+"log_level", "body", *o.LogLevel); err != nil { - return err - } - - return nil -} - -func (o *AddServiceOKBodyMongodbMongodbExporter) 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" + "." + "mongodb" + "." + "mongodb_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "mongodb" + "." + "mongodb_exporter" + "." + "metrics_resolutions") - } - - 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 - - if err := o.contextValidateMetricsResolutions(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *AddServiceOKBodyMongodbMongodbExporter) 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 { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "mongodb" + "." + "mongodb_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "mongodb" + "." + "mongodb_exporter" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *AddServiceOKBodyMongodbMongodbExporter) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddServiceOKBodyMongodbMongodbExporter) UnmarshalBinary(b []byte) error { - var res AddServiceOKBodyMongodbMongodbExporter - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddServiceOKBodyMongodbMongodbExporterMetricsResolutions MetricsResolutions represents Prometheus exporters metrics resolutions. -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"` - - // Medium resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Mr string `json:"mr,omitempty"` - - // Low resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Lr string `json:"lr,omitempty"` -} - -// Validate validates this add service OK body mongodb mongodb exporter metrics resolutions -func (o *AddServiceOKBodyMongodbMongodbExporterMetricsResolutions) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this add service OK body mongodb mongodb exporter metrics resolutions based on context it is used -func (o *AddServiceOKBodyMongodbMongodbExporterMetricsResolutions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddServiceOKBodyMongodbMongodbExporterMetricsResolutions) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddServiceOKBodyMongodbMongodbExporterMetricsResolutions) UnmarshalBinary(b []byte) error { - var res AddServiceOKBodyMongodbMongodbExporterMetricsResolutions - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddServiceOKBodyMongodbQANMongodbMongolog QANMongoDBMongologAgent runs within pmm-agent and sends MongoDB Query Analytics data to the PMM Server. -swagger:model AddServiceOKBodyMongodbQANMongodbMongolog -*/ -type AddServiceOKBodyMongodbQANMongodbMongolog struct { - // Unique randomly generated instance identifier. - AgentID string `json:"agent_id,omitempty"` - - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `json:"disabled,omitempty"` - - // Service identifier. - ServiceID string `json:"service_id,omitempty"` - - // MongoDB username for getting profiler data. - Username string `json:"username,omitempty"` - - // Use TLS for database connections. - TLS bool `json:"tls,omitempty"` - - // Skip TLS certificate and hostname validation. - TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - - // Limit query length in QAN (default: server-defined; -1: no limit). - MaxQueryLength int32 `json:"max_query_length,omitempty"` - - // 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"` - - // 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 { - 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 addServiceOkBodyMongodbQanMongodbMongologTypeStatusPropEnum []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 { - addServiceOkBodyMongodbQanMongodbMongologTypeStatusPropEnum = append(addServiceOkBodyMongodbQanMongodbMongologTypeStatusPropEnum, v) - } -} - -const ( - - // AddServiceOKBodyMongodbQANMongodbMongologStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - AddServiceOKBodyMongodbQANMongodbMongologStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // AddServiceOKBodyMongodbQANMongodbMongologStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - AddServiceOKBodyMongodbQANMongodbMongologStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // AddServiceOKBodyMongodbQANMongodbMongologStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - AddServiceOKBodyMongodbQANMongodbMongologStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - - // AddServiceOKBodyMongodbQANMongodbMongologStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - AddServiceOKBodyMongodbQANMongodbMongologStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - - // AddServiceOKBodyMongodbQANMongodbMongologStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - AddServiceOKBodyMongodbQANMongodbMongologStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - - // AddServiceOKBodyMongodbQANMongodbMongologStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - AddServiceOKBodyMongodbQANMongodbMongologStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" - - // AddServiceOKBodyMongodbQANMongodbMongologStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - AddServiceOKBodyMongodbQANMongodbMongologStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" - - // AddServiceOKBodyMongodbQANMongodbMongologStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - AddServiceOKBodyMongodbQANMongodbMongologStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" -) - -// prop value enum -func (o *AddServiceOKBodyMongodbQANMongodbMongolog) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addServiceOkBodyMongodbQanMongodbMongologTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddServiceOKBodyMongodbQANMongodbMongolog) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required - return nil - } - - // value enum - if err := o.validateStatusEnum("addServiceOk"+"."+"mongodb"+"."+"qan_mongodb_mongolog"+"."+"status", "body", *o.Status); err != nil { - return err - } - - return nil -} - -var addServiceOkBodyMongodbQanMongodbMongologTypeLogLevelPropEnum []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 { - 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 - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddServiceOKBodyMongodbQANMongodbMongolog) UnmarshalBinary(b []byte) error { - var res AddServiceOKBodyMongodbQANMongodbMongolog - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddServiceOKBodyMongodbQANMongodbProfiler QANMongoDBProfilerAgent runs within pmm-agent and sends MongoDB Query Analytics data to the PMM Server. -swagger:model AddServiceOKBodyMongodbQANMongodbProfiler -*/ -type AddServiceOKBodyMongodbQANMongodbProfiler struct { - // Unique randomly generated instance identifier. - AgentID string `json:"agent_id,omitempty"` - - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `json:"disabled,omitempty"` - - // Service identifier. - ServiceID string `json:"service_id,omitempty"` - - // MongoDB username for getting profiler data. - Username string `json:"username,omitempty"` - - // Use TLS for database connections. - TLS bool `json:"tls,omitempty"` - - // Skip TLS certificate and hostname validation. - TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - - // Limit query length in QAN (default: server-defined; -1: no limit). - MaxQueryLength int32 `json:"max_query_length,omitempty"` - - // 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"` - - // 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 { - 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 addServiceOkBodyMongodbQanMongodbProfilerTypeStatusPropEnum []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 { - addServiceOkBodyMongodbQanMongodbProfilerTypeStatusPropEnum = append(addServiceOkBodyMongodbQanMongodbProfilerTypeStatusPropEnum, 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" - - // AddServiceOKBodyMongodbQANMongodbProfilerStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - AddServiceOKBodyMongodbQANMongodbProfilerStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - - // AddServiceOKBodyMongodbQANMongodbProfilerStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - AddServiceOKBodyMongodbQANMongodbProfilerStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - - // 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) 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) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required - return nil - } - - // value enum - if err := o.validateStatusEnum("addServiceOk"+"."+"mongodb"+"."+"qan_mongodb_profiler"+"."+"status", "body", *o.Status); err != nil { - return err - } - - return nil -} - -var addServiceOkBodyMongodbQanMongodbProfilerTypeLogLevelPropEnum []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 { - addServiceOkBodyMongodbQanMongodbProfilerTypeLogLevelPropEnum = append(addServiceOkBodyMongodbQanMongodbProfilerTypeLogLevelPropEnum, v) - } -} - -const ( - - // AddServiceOKBodyMongodbQANMongodbProfilerLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - AddServiceOKBodyMongodbQANMongodbProfilerLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // AddServiceOKBodyMongodbQANMongodbProfilerLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - AddServiceOKBodyMongodbQANMongodbProfilerLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // AddServiceOKBodyMongodbQANMongodbProfilerLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - AddServiceOKBodyMongodbQANMongodbProfilerLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // AddServiceOKBodyMongodbQANMongodbProfilerLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - AddServiceOKBodyMongodbQANMongodbProfilerLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // AddServiceOKBodyMongodbQANMongodbProfilerLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - AddServiceOKBodyMongodbQANMongodbProfilerLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // AddServiceOKBodyMongodbQANMongodbProfilerLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - AddServiceOKBodyMongodbQANMongodbProfilerLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -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) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("addServiceOk"+"."+"mongodb"+"."+"qan_mongodb_profiler"+"."+"log_level", "body", *o.LogLevel); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this add service OK body mongodb QAN mongodb profiler based on context it is used -func (o *AddServiceOKBodyMongodbQANMongodbProfiler) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddServiceOKBodyMongodbQANMongodbProfiler) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddServiceOKBodyMongodbQANMongodbProfiler) UnmarshalBinary(b []byte) error { - var res AddServiceOKBodyMongodbQANMongodbProfiler - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddServiceOKBodyMongodbService MongoDBService represents a generic MongoDB instance. -swagger:model AddServiceOKBodyMongodbService -*/ -type AddServiceOKBodyMongodbService struct { - // Unique randomly generated instance identifier. - ServiceID string `json:"service_id,omitempty"` - - // Unique across all Services user-defined name. - ServiceName string `json:"service_name,omitempty"` - - // Node identifier where this instance runs. - NodeID string `json:"node_id,omitempty"` - - // Access address (DNS name or IP). - // Address (and port) or socket is required. - Address string `json:"address,omitempty"` - - // Access port. - // Port is required when the address present. - Port int64 `json:"port,omitempty"` - - // Access unix socket. - // Address (and port) or socket is required. - Socket string `json:"socket,omitempty"` - - // Environment name. - Environment string `json:"environment,omitempty"` - - // Cluster name. - Cluster string `json:"cluster,omitempty"` - - // Replication set name. - ReplicationSet string `json:"replication_set,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // MongoDB version. - Version string `json:"version,omitempty"` -} - -// Validate validates this add service OK body mongodb service -func (o *AddServiceOKBodyMongodbService) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this add service OK body mongodb service based on context it is used -func (o *AddServiceOKBodyMongodbService) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddServiceOKBodyMongodbService) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddServiceOKBodyMongodbService) UnmarshalBinary(b []byte) error { - var res AddServiceOKBodyMongodbService - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -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"` - - // mysqld exporter - MysqldExporter *AddServiceOKBodyMysqlMysqldExporter `json:"mysqld_exporter,omitempty"` - - // qan mysql perfschema - QANMysqlPerfschema *AddServiceOKBodyMysqlQANMysqlPerfschema `json:"qan_mysql_perfschema,omitempty"` - - // qan mysql slowlog - QANMysqlSlowlog *AddServiceOKBodyMysqlQANMysqlSlowlog `json:"qan_mysql_slowlog,omitempty"` - - // service - Service *AddServiceOKBodyMysqlService `json:"service,omitempty"` -} - -// Validate validates this add service OK body mysql -func (o *AddServiceOKBodyMysql) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateMysqldExporter(formats); err != nil { - res = append(res, err) - } - - if err := o.validateQANMysqlPerfschema(formats); err != nil { - res = append(res, err) - } - - if err := o.validateQANMysqlSlowlog(formats); err != nil { - res = append(res, err) - } - - if err := o.validateService(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *AddServiceOKBodyMysql) validateMysqldExporter(formats strfmt.Registry) error { - if swag.IsZero(o.MysqldExporter) { // not required - return nil - } - - if o.MysqldExporter != nil { - if err := o.MysqldExporter.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "mysql" + "." + "mysqld_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "mysql" + "." + "mysqld_exporter") - } - - return err - } - } - - return nil -} - -func (o *AddServiceOKBodyMysql) validateQANMysqlPerfschema(formats strfmt.Registry) error { - if swag.IsZero(o.QANMysqlPerfschema) { // not required - return nil - } - - if o.QANMysqlPerfschema != nil { - if err := o.QANMysqlPerfschema.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "mysql" + "." + "qan_mysql_perfschema") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "mysql" + "." + "qan_mysql_perfschema") - } - - return err - } - } - - return nil -} - -func (o *AddServiceOKBodyMysql) validateQANMysqlSlowlog(formats strfmt.Registry) error { - if swag.IsZero(o.QANMysqlSlowlog) { // not required - return nil - } - - if o.QANMysqlSlowlog != nil { - if err := o.QANMysqlSlowlog.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "mysql" + "." + "qan_mysql_slowlog") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "mysql" + "." + "qan_mysql_slowlog") - } - - return err - } - } - - return nil -} - -func (o *AddServiceOKBodyMysql) validateService(formats strfmt.Registry) error { - if swag.IsZero(o.Service) { // not required - return nil - } - - if o.Service != nil { - if err := o.Service.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "mysql" + "." + "service") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "mysql" + "." + "service") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this add service OK body mysql based on the context it is used -func (o *AddServiceOKBodyMysql) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateMysqldExporter(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateQANMysqlPerfschema(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateQANMysqlSlowlog(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateService(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *AddServiceOKBodyMysql) contextValidateMysqldExporter(ctx context.Context, formats strfmt.Registry) error { - if o.MysqldExporter != nil { - - if swag.IsZero(o.MysqldExporter) { // not required - return nil - } - - if err := o.MysqldExporter.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "mysql" + "." + "mysqld_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "mysql" + "." + "mysqld_exporter") - } - - return err - } - } - - return nil -} - -func (o *AddServiceOKBodyMysql) contextValidateQANMysqlPerfschema(ctx context.Context, formats strfmt.Registry) error { - if o.QANMysqlPerfschema != nil { - - if swag.IsZero(o.QANMysqlPerfschema) { // not required - return nil - } - - if err := o.QANMysqlPerfschema.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "mysql" + "." + "qan_mysql_perfschema") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "mysql" + "." + "qan_mysql_perfschema") - } - - return err - } - } - - return nil -} - -func (o *AddServiceOKBodyMysql) contextValidateQANMysqlSlowlog(ctx context.Context, formats strfmt.Registry) error { - if o.QANMysqlSlowlog != nil { - - if swag.IsZero(o.QANMysqlSlowlog) { // not required - return nil - } - - if err := o.QANMysqlSlowlog.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "mysql" + "." + "qan_mysql_slowlog") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "mysql" + "." + "qan_mysql_slowlog") - } - - return err - } - } - - return nil -} - -func (o *AddServiceOKBodyMysql) contextValidateService(ctx context.Context, formats strfmt.Registry) error { - if o.Service != nil { - - if swag.IsZero(o.Service) { // not required - return nil - } - - if err := o.Service.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "mysql" + "." + "service") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "mysql" + "." + "service") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *AddServiceOKBodyMysql) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddServiceOKBodyMysql) UnmarshalBinary(b []byte) error { - var res AddServiceOKBodyMysql - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddServiceOKBodyMysqlMysqldExporter MySQLdExporter runs on Generic or Container Node and exposes MySQL Service metrics. -swagger:model AddServiceOKBodyMysqlMysqldExporter -*/ -type AddServiceOKBodyMysqlMysqldExporter struct { - // Unique randomly generated instance identifier. - AgentID string `json:"agent_id,omitempty"` - - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `json:"disabled,omitempty"` - - // Service identifier. - ServiceID string `json:"service_id,omitempty"` - - // MySQL username for scraping metrics. - Username string `json:"username,omitempty"` - - // Use TLS for database connections. - TLS bool `json:"tls,omitempty"` - - // Skip TLS certificate and hostname validation. - TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - - // Certificate Authority certificate chain. - TLSCa string `json:"tls_ca,omitempty"` - - // Client certificate. - TLSCert string `json:"tls_cert,omitempty"` - - // Password for decrypting tls_cert. - TLSKey string `json:"tls_key,omitempty"` - - // Tablestats group collectors are disabled if there are more than that number of tables. - // 0 means tablestats group collectors are always enabled (no limit). - // Negative value means tablestats group collectors are always disabled. - TablestatsGroupTableLimit int32 `json:"tablestats_group_table_limit,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // True if exporter uses push metrics mode. - PushMetricsEnabled bool `json:"push_metrics_enabled,omitempty"` - - // List of disabled collector names. - DisabledCollectors []string `json:"disabled_collectors"` - - // 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"` - - // True if tablestats group collectors are currently disabled. - TablestatsGroupDisabled bool `json:"tablestats_group_disabled,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"` - - // 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"` -} - -// 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 { - 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 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 - 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 { - addServiceOkBodyMysqlMysqldExporterTypeLogLevelPropEnum = append(addServiceOkBodyMysqlMysqldExporterTypeLogLevelPropEnum, v) - } -} - -const ( - - // AddServiceOKBodyMysqlMysqldExporterLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - AddServiceOKBodyMysqlMysqldExporterLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // AddServiceOKBodyMysqlMysqldExporterLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - AddServiceOKBodyMysqlMysqldExporterLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // AddServiceOKBodyMysqlMysqldExporterLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - AddServiceOKBodyMysqlMysqldExporterLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // AddServiceOKBodyMysqlMysqldExporterLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - AddServiceOKBodyMysqlMysqldExporterLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // AddServiceOKBodyMysqlMysqldExporterLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - AddServiceOKBodyMysqlMysqldExporterLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // AddServiceOKBodyMysqlMysqldExporterLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - AddServiceOKBodyMysqlMysqldExporterLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -func (o *AddServiceOKBodyMysqlMysqldExporter) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addServiceOkBodyMysqlMysqldExporterTypeLogLevelPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddServiceOKBodyMysqlMysqldExporter) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("addServiceOk"+"."+"mysql"+"."+"mysqld_exporter"+"."+"log_level", "body", *o.LogLevel); err != nil { - return err - } - - return nil -} - -func (o *AddServiceOKBodyMysqlMysqldExporter) 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" + "." + "mysql" + "." + "mysqld_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "mysql" + "." + "mysqld_exporter" + "." + "metrics_resolutions") - } - - 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 - - if err := o.contextValidateMetricsResolutions(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *AddServiceOKBodyMysqlMysqldExporter) 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 { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "mysql" + "." + "mysqld_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "mysql" + "." + "mysqld_exporter" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *AddServiceOKBodyMysqlMysqldExporter) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddServiceOKBodyMysqlMysqldExporter) UnmarshalBinary(b []byte) error { - var res AddServiceOKBodyMysqlMysqldExporter - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddServiceOKBodyMysqlMysqldExporterMetricsResolutions MetricsResolutions represents Prometheus exporters metrics resolutions. -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"` - - // Medium resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Mr string `json:"mr,omitempty"` - - // Low resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Lr string `json:"lr,omitempty"` -} - -// Validate validates this add service OK body mysql mysqld exporter metrics resolutions -func (o *AddServiceOKBodyMysqlMysqldExporterMetricsResolutions) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this add service OK body mysql mysqld exporter metrics resolutions based on context it is used -func (o *AddServiceOKBodyMysqlMysqldExporterMetricsResolutions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddServiceOKBodyMysqlMysqldExporterMetricsResolutions) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddServiceOKBodyMysqlMysqldExporterMetricsResolutions) UnmarshalBinary(b []byte) error { - var res AddServiceOKBodyMysqlMysqldExporterMetricsResolutions - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddServiceOKBodyMysqlQANMysqlPerfschema QANMySQLPerfSchemaAgent runs within pmm-agent and sends MySQL Query Analytics data to the PMM Server. -swagger:model AddServiceOKBodyMysqlQANMysqlPerfschema -*/ -type AddServiceOKBodyMysqlQANMysqlPerfschema struct { - // Unique randomly generated instance identifier. - AgentID string `json:"agent_id,omitempty"` - - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `json:"disabled,omitempty"` - - // Service identifier. - ServiceID string `json:"service_id,omitempty"` - - // MySQL username for getting performance data. - Username string `json:"username,omitempty"` - - // Use TLS for database connections. - TLS bool `json:"tls,omitempty"` - - // Skip TLS certificate and hostname validation. - TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - - // Certificate Authority certificate chain. - TLSCa string `json:"tls_ca,omitempty"` - - // Client certificate. - TLSCert string `json:"tls_cert,omitempty"` - - // Password for decrypting tls_cert. - TLSKey string `json:"tls_key,omitempty"` - - // Disable parsing comments from queries and showing them in QAN. - DisableCommentsParsing bool `json:"disable_comments_parsing,omitempty"` - - // Limit query length in QAN (default: server-defined; -1: no limit). - MaxQueryLength int32 `json:"max_query_length,omitempty"` - - // True if query examples are disabled. - QueryExamplesDisabled bool `json:"query_examples_disabled,omitempty"` - - // 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"` - - // 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 { - 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 addServiceOkBodyMysqlQanMysqlPerfschemaTypeStatusPropEnum []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 { - addServiceOkBodyMysqlQanMysqlPerfschemaTypeStatusPropEnum = append(addServiceOkBodyMysqlQanMysqlPerfschemaTypeStatusPropEnum, 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" - - // AddServiceOKBodyMysqlQANMysqlPerfschemaStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - AddServiceOKBodyMysqlQANMysqlPerfschemaStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - - // AddServiceOKBodyMysqlQANMysqlPerfschemaStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - AddServiceOKBodyMysqlQANMysqlPerfschemaStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - - // 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) 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) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required - return nil - } - - // value enum - if err := o.validateStatusEnum("addServiceOk"+"."+"mysql"+"."+"qan_mysql_perfschema"+"."+"status", "body", *o.Status); err != nil { - return err - } - - return nil -} - -var addServiceOkBodyMysqlQanMysqlPerfschemaTypeLogLevelPropEnum []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 { - addServiceOkBodyMysqlQanMysqlPerfschemaTypeLogLevelPropEnum = append(addServiceOkBodyMysqlQanMysqlPerfschemaTypeLogLevelPropEnum, v) - } -} - -const ( - - // AddServiceOKBodyMysqlQANMysqlPerfschemaLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - AddServiceOKBodyMysqlQANMysqlPerfschemaLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // AddServiceOKBodyMysqlQANMysqlPerfschemaLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - AddServiceOKBodyMysqlQANMysqlPerfschemaLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // AddServiceOKBodyMysqlQANMysqlPerfschemaLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - AddServiceOKBodyMysqlQANMysqlPerfschemaLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // AddServiceOKBodyMysqlQANMysqlPerfschemaLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - AddServiceOKBodyMysqlQANMysqlPerfschemaLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // AddServiceOKBodyMysqlQANMysqlPerfschemaLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - AddServiceOKBodyMysqlQANMysqlPerfschemaLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // AddServiceOKBodyMysqlQANMysqlPerfschemaLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - AddServiceOKBodyMysqlQANMysqlPerfschemaLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -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) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("addServiceOk"+"."+"mysql"+"."+"qan_mysql_perfschema"+"."+"log_level", "body", *o.LogLevel); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this add service OK body mysql QAN mysql perfschema based on context it is used -func (o *AddServiceOKBodyMysqlQANMysqlPerfschema) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddServiceOKBodyMysqlQANMysqlPerfschema) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddServiceOKBodyMysqlQANMysqlPerfschema) UnmarshalBinary(b []byte) error { - var res AddServiceOKBodyMysqlQANMysqlPerfschema - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddServiceOKBodyMysqlQANMysqlSlowlog QANMySQLSlowlogAgent runs within pmm-agent and sends MySQL Query Analytics data to the PMM Server. -swagger:model AddServiceOKBodyMysqlQANMysqlSlowlog -*/ -type AddServiceOKBodyMysqlQANMysqlSlowlog struct { - // Unique randomly generated instance identifier. - AgentID string `json:"agent_id,omitempty"` - - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `json:"disabled,omitempty"` - - // Service identifier. - ServiceID string `json:"service_id,omitempty"` - - // MySQL username for getting performance data. - Username string `json:"username,omitempty"` - - // Use TLS for database connections. - TLS bool `json:"tls,omitempty"` - - // Skip TLS certificate and hostname validation. - TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - - // Certificate Authority certificate chain. - TLSCa string `json:"tls_ca,omitempty"` - - // Client certificate. - TLSCert string `json:"tls_cert,omitempty"` - - // Password for decrypting tls_cert. - TLSKey string `json:"tls_key,omitempty"` - - // Disable parsing comments from queries and showing them in QAN. - DisableCommentsParsing bool `json:"disable_comments_parsing,omitempty"` - - // Limit query length in QAN (default: server-defined; -1: no limit) - MaxQueryLength int32 `json:"max_query_length,omitempty"` - - // True if query examples are disabled. - QueryExamplesDisabled bool `json:"query_examples_disabled,omitempty"` - - // Slowlog file is rotated at this size if > 0. - MaxSlowlogFileSize string `json:"max_slowlog_file_size,omitempty"` - - // 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"` - - // 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 { - 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 addServiceOkBodyMysqlQanMysqlSlowlogTypeStatusPropEnum []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 { - addServiceOkBodyMysqlQanMysqlSlowlogTypeStatusPropEnum = append(addServiceOkBodyMysqlQanMysqlSlowlogTypeStatusPropEnum, 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" - - // AddServiceOKBodyMysqlQANMysqlSlowlogStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - AddServiceOKBodyMysqlQANMysqlSlowlogStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - - // AddServiceOKBodyMysqlQANMysqlSlowlogStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - AddServiceOKBodyMysqlQANMysqlSlowlogStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - - // 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) 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) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required - return nil - } - - // value enum - if err := o.validateStatusEnum("addServiceOk"+"."+"mysql"+"."+"qan_mysql_slowlog"+"."+"status", "body", *o.Status); err != nil { - return err - } - - return nil -} - -var addServiceOkBodyMysqlQanMysqlSlowlogTypeLogLevelPropEnum []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 { - addServiceOkBodyMysqlQanMysqlSlowlogTypeLogLevelPropEnum = append(addServiceOkBodyMysqlQanMysqlSlowlogTypeLogLevelPropEnum, v) - } -} - -const ( - - // AddServiceOKBodyMysqlQANMysqlSlowlogLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - AddServiceOKBodyMysqlQANMysqlSlowlogLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // AddServiceOKBodyMysqlQANMysqlSlowlogLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - AddServiceOKBodyMysqlQANMysqlSlowlogLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // AddServiceOKBodyMysqlQANMysqlSlowlogLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - AddServiceOKBodyMysqlQANMysqlSlowlogLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // AddServiceOKBodyMysqlQANMysqlSlowlogLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - AddServiceOKBodyMysqlQANMysqlSlowlogLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // AddServiceOKBodyMysqlQANMysqlSlowlogLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - AddServiceOKBodyMysqlQANMysqlSlowlogLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // AddServiceOKBodyMysqlQANMysqlSlowlogLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - AddServiceOKBodyMysqlQANMysqlSlowlogLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -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) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("addServiceOk"+"."+"mysql"+"."+"qan_mysql_slowlog"+"."+"log_level", "body", *o.LogLevel); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this add service OK body mysql QAN mysql slowlog based on context it is used -func (o *AddServiceOKBodyMysqlQANMysqlSlowlog) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddServiceOKBodyMysqlQANMysqlSlowlog) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddServiceOKBodyMysqlQANMysqlSlowlog) UnmarshalBinary(b []byte) error { - var res AddServiceOKBodyMysqlQANMysqlSlowlog - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddServiceOKBodyMysqlService MySQLService represents a generic MySQL instance. -swagger:model AddServiceOKBodyMysqlService -*/ -type AddServiceOKBodyMysqlService struct { - // Unique randomly generated instance identifier. - ServiceID string `json:"service_id,omitempty"` - - // Unique across all Services user-defined name. - ServiceName string `json:"service_name,omitempty"` - - // Node identifier where this instance runs. - NodeID string `json:"node_id,omitempty"` - - // Access address (DNS name or IP). - // Address (and port) or socket is required. - Address string `json:"address,omitempty"` - - // Access port. - // Port is required when the address present. - Port int64 `json:"port,omitempty"` - - // Access unix socket. - // Address (and port) or socket is required. - Socket string `json:"socket,omitempty"` - - // Environment name. - Environment string `json:"environment,omitempty"` - - // Cluster name. - Cluster string `json:"cluster,omitempty"` - - // Replication set name. - ReplicationSet string `json:"replication_set,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // MySQL version. - Version string `json:"version,omitempty"` - - // Extra parameters to be added to the DSN. - ExtraDsnParams map[string]string `json:"extra_dsn_params,omitempty"` -} - -// Validate validates this add service OK body mysql service -func (o *AddServiceOKBodyMysqlService) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this add service OK body mysql service based on context it is used -func (o *AddServiceOKBodyMysqlService) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddServiceOKBodyMysqlService) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddServiceOKBodyMysqlService) UnmarshalBinary(b []byte) error { - var res AddServiceOKBodyMysqlService - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddServiceOKBodyPostgresql add service OK body postgresql -swagger:model AddServiceOKBodyPostgresql -*/ -type AddServiceOKBodyPostgresql struct { - // Warning message. - Warning string `json:"warning,omitempty"` - - // postgres exporter - PostgresExporter *AddServiceOKBodyPostgresqlPostgresExporter `json:"postgres_exporter,omitempty"` - - // qan postgresql pgstatements agent - QANPostgresqlPgstatementsAgent *AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgent `json:"qan_postgresql_pgstatements_agent,omitempty"` - - // qan postgresql pgstatmonitor agent - QANPostgresqlPgstatmonitorAgent *AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgent `json:"qan_postgresql_pgstatmonitor_agent,omitempty"` - - // service - Service *AddServiceOKBodyPostgresqlService `json:"service,omitempty"` -} - -// Validate validates this add service OK body postgresql -func (o *AddServiceOKBodyPostgresql) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validatePostgresExporter(formats); err != nil { - res = append(res, err) - } - - if err := o.validateQANPostgresqlPgstatementsAgent(formats); err != nil { - res = append(res, err) - } - - if err := o.validateQANPostgresqlPgstatmonitorAgent(formats); err != nil { - res = append(res, err) - } - - if err := o.validateService(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *AddServiceOKBodyPostgresql) validatePostgresExporter(formats strfmt.Registry) error { - if swag.IsZero(o.PostgresExporter) { // not required - return nil - } - - if o.PostgresExporter != nil { - if err := o.PostgresExporter.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "postgresql" + "." + "postgres_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "postgresql" + "." + "postgres_exporter") - } - - return err - } - } - - return nil -} - -func (o *AddServiceOKBodyPostgresql) validateQANPostgresqlPgstatementsAgent(formats strfmt.Registry) error { - if swag.IsZero(o.QANPostgresqlPgstatementsAgent) { // not required - return nil - } - - if o.QANPostgresqlPgstatementsAgent != nil { - if err := o.QANPostgresqlPgstatementsAgent.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "postgresql" + "." + "qan_postgresql_pgstatements_agent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "postgresql" + "." + "qan_postgresql_pgstatements_agent") - } - - return err - } - } - - return nil -} - -func (o *AddServiceOKBodyPostgresql) validateQANPostgresqlPgstatmonitorAgent(formats strfmt.Registry) error { - if swag.IsZero(o.QANPostgresqlPgstatmonitorAgent) { // not required - return nil - } - - if o.QANPostgresqlPgstatmonitorAgent != nil { - if err := o.QANPostgresqlPgstatmonitorAgent.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "postgresql" + "." + "qan_postgresql_pgstatmonitor_agent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "postgresql" + "." + "qan_postgresql_pgstatmonitor_agent") - } - - return err - } - } - - return nil -} - -func (o *AddServiceOKBodyPostgresql) validateService(formats strfmt.Registry) error { - if swag.IsZero(o.Service) { // not required - return nil - } - - if o.Service != nil { - if err := o.Service.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "postgresql" + "." + "service") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "postgresql" + "." + "service") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this add service OK body postgresql based on the context it is used -func (o *AddServiceOKBodyPostgresql) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidatePostgresExporter(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateQANPostgresqlPgstatementsAgent(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateQANPostgresqlPgstatmonitorAgent(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateService(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *AddServiceOKBodyPostgresql) contextValidatePostgresExporter(ctx context.Context, formats strfmt.Registry) error { - if o.PostgresExporter != nil { - - if swag.IsZero(o.PostgresExporter) { // not required - return nil - } - - if err := o.PostgresExporter.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "postgresql" + "." + "postgres_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "postgresql" + "." + "postgres_exporter") - } - - return err - } - } - - return nil -} - -func (o *AddServiceOKBodyPostgresql) contextValidateQANPostgresqlPgstatementsAgent(ctx context.Context, formats strfmt.Registry) error { - if o.QANPostgresqlPgstatementsAgent != nil { - - if swag.IsZero(o.QANPostgresqlPgstatementsAgent) { // not required - return nil - } - - if err := o.QANPostgresqlPgstatementsAgent.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "postgresql" + "." + "qan_postgresql_pgstatements_agent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "postgresql" + "." + "qan_postgresql_pgstatements_agent") - } - - return err - } - } - - return nil -} - -func (o *AddServiceOKBodyPostgresql) contextValidateQANPostgresqlPgstatmonitorAgent(ctx context.Context, formats strfmt.Registry) error { - if o.QANPostgresqlPgstatmonitorAgent != nil { - - if swag.IsZero(o.QANPostgresqlPgstatmonitorAgent) { // not required - return nil - } - - if err := o.QANPostgresqlPgstatmonitorAgent.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "postgresql" + "." + "qan_postgresql_pgstatmonitor_agent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "postgresql" + "." + "qan_postgresql_pgstatmonitor_agent") - } - - return err - } - } - - return nil -} - -func (o *AddServiceOKBodyPostgresql) contextValidateService(ctx context.Context, formats strfmt.Registry) error { - if o.Service != nil { - - if swag.IsZero(o.Service) { // not required - return nil - } - - if err := o.Service.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "postgresql" + "." + "service") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "postgresql" + "." + "service") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *AddServiceOKBodyPostgresql) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddServiceOKBodyPostgresql) UnmarshalBinary(b []byte) error { - var res AddServiceOKBodyPostgresql - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddServiceOKBodyPostgresqlPostgresExporter PostgresExporter runs on Generic or Container Node and exposes PostgreSQL Service metrics. -swagger:model AddServiceOKBodyPostgresqlPostgresExporter -*/ -type AddServiceOKBodyPostgresqlPostgresExporter struct { - // Unique randomly generated instance identifier. - AgentID string `json:"agent_id,omitempty"` - - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `json:"disabled,omitempty"` - - // Service identifier. - ServiceID string `json:"service_id,omitempty"` - - // PostgreSQL username for scraping metrics. - Username string `json:"username,omitempty"` - - // Use TLS for database connections. - TLS bool `json:"tls,omitempty"` - - // Skip TLS certificate and hostname validation. Uses sslmode=required instead of verify-full. - TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // True if exporter uses push metrics mode. - PushMetricsEnabled bool `json:"push_metrics_enabled,omitempty"` - - // 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"` - - // Optionally expose the exporter process on all public interfaces - ExposeExporter bool `json:"expose_exporter,omitempty"` - - // Maximum number of connections that exporter can open to the database instance. - MaxExporterConnections int32 `json:"max_exporter_connections,omitempty"` - - // metrics resolutions - MetricsResolutions *AddServiceOKBodyPostgresqlPostgresExporterMetricsResolutions `json:"metrics_resolutions,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 { - 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 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 - 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 { - addServiceOkBodyPostgresqlPostgresExporterTypeLogLevelPropEnum = append(addServiceOkBodyPostgresqlPostgresExporterTypeLogLevelPropEnum, v) - } -} - -const ( - - // AddServiceOKBodyPostgresqlPostgresExporterLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - AddServiceOKBodyPostgresqlPostgresExporterLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // AddServiceOKBodyPostgresqlPostgresExporterLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - AddServiceOKBodyPostgresqlPostgresExporterLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // AddServiceOKBodyPostgresqlPostgresExporterLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - AddServiceOKBodyPostgresqlPostgresExporterLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // AddServiceOKBodyPostgresqlPostgresExporterLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - AddServiceOKBodyPostgresqlPostgresExporterLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // AddServiceOKBodyPostgresqlPostgresExporterLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - AddServiceOKBodyPostgresqlPostgresExporterLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // AddServiceOKBodyPostgresqlPostgresExporterLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - AddServiceOKBodyPostgresqlPostgresExporterLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -func (o *AddServiceOKBodyPostgresqlPostgresExporter) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addServiceOkBodyPostgresqlPostgresExporterTypeLogLevelPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddServiceOKBodyPostgresqlPostgresExporter) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("addServiceOk"+"."+"postgresql"+"."+"postgres_exporter"+"."+"log_level", "body", *o.LogLevel); err != nil { - return err - } - - return nil -} - -func (o *AddServiceOKBodyPostgresqlPostgresExporter) 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" + "." + "postgresql" + "." + "postgres_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "postgresql" + "." + "postgres_exporter" + "." + "metrics_resolutions") - } - - 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 - - if err := o.contextValidateMetricsResolutions(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *AddServiceOKBodyPostgresqlPostgresExporter) 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 { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "postgresql" + "." + "postgres_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "postgresql" + "." + "postgres_exporter" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *AddServiceOKBodyPostgresqlPostgresExporter) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddServiceOKBodyPostgresqlPostgresExporter) UnmarshalBinary(b []byte) error { - var res AddServiceOKBodyPostgresqlPostgresExporter - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddServiceOKBodyPostgresqlPostgresExporterMetricsResolutions MetricsResolutions represents Prometheus exporters metrics resolutions. -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"` - - // Medium resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Mr string `json:"mr,omitempty"` - - // Low resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Lr string `json:"lr,omitempty"` -} - -// Validate validates this add service OK body postgresql postgres exporter metrics resolutions -func (o *AddServiceOKBodyPostgresqlPostgresExporterMetricsResolutions) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this add service OK body postgresql postgres exporter metrics resolutions based on context it is used -func (o *AddServiceOKBodyPostgresqlPostgresExporterMetricsResolutions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddServiceOKBodyPostgresqlPostgresExporterMetricsResolutions) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddServiceOKBodyPostgresqlPostgresExporterMetricsResolutions) UnmarshalBinary(b []byte) error { - var res AddServiceOKBodyPostgresqlPostgresExporterMetricsResolutions - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgent QANPostgreSQLPgStatementsAgent runs within pmm-agent and sends PostgreSQL Query Analytics data to the PMM Server. -swagger:model AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgent -*/ -type AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgent struct { - // Unique randomly generated instance identifier. - AgentID string `json:"agent_id,omitempty"` - - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `json:"disabled,omitempty"` - - // Service identifier. - ServiceID string `json:"service_id,omitempty"` - - // PostgreSQL username for getting pg stat statements data. - Username string `json:"username,omitempty"` - - // Disable parsing comments from queries and showing them in QAN. - DisableCommentsParsing bool `json:"disable_comments_parsing,omitempty"` - - // Limit query length in QAN (default: server-defined; -1: no limit). - MaxQueryLength int32 `json:"max_query_length,omitempty"` - - // Use TLS for database connections. - TLS bool `json:"tls,omitempty"` - - // Skip TLS certificate and hostname validation. - TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - - // 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"` - - // 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 { - 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 addServiceOkBodyPostgresqlQanPostgresqlPgstatementsAgentTypeStatusPropEnum []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 { - addServiceOkBodyPostgresqlQanPostgresqlPgstatementsAgentTypeStatusPropEnum = append(addServiceOkBodyPostgresqlQanPostgresqlPgstatementsAgentTypeStatusPropEnum, v) - } -} - -const ( - - // AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgentStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgentStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgentStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgentStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgentStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgentStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - - // AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgentStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgentStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - - // AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgentStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgentStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - - // AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgentStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgentStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" - - // AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgentStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgentStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" - - // AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgentStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgentStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" -) - -// prop value enum -func (o *AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgent) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addServiceOkBodyPostgresqlQanPostgresqlPgstatementsAgentTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgent) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required - return nil - } - - // value enum - if err := o.validateStatusEnum("addServiceOk"+"."+"postgresql"+"."+"qan_postgresql_pgstatements_agent"+"."+"status", "body", *o.Status); err != nil { - return err - } - - 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 -} - -// 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 { - var res AddServiceOKBodyPostgresqlQANPostgresqlPgstatementsAgent - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgent QANPostgreSQLPgStatMonitorAgent runs within pmm-agent and sends PostgreSQL Query Analytics data to the PMM Server. -swagger:model AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgent -*/ -type AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgent struct { - // Unique randomly generated instance identifier. - AgentID string `json:"agent_id,omitempty"` - - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `json:"disabled,omitempty"` - - // Service identifier. - ServiceID string `json:"service_id,omitempty"` - - // PostgreSQL username for getting pg stat monitor data. - Username string `json:"username,omitempty"` - - // Use TLS for database connections. - TLS bool `json:"tls,omitempty"` - - // Skip TLS certificate and hostname validation. - TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - - // Disable parsing comments from queries and showing them in QAN. - DisableCommentsParsing bool `json:"disable_comments_parsing,omitempty"` - - // Limit query length in QAN (default: server-defined; -1: no limit). - MaxQueryLength int32 `json:"max_query_length,omitempty"` - - // True if query examples are disabled. - QueryExamplesDisabled bool `json:"query_examples_disabled,omitempty"` - - // 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"` - - // 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 { - 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 addServiceOkBodyPostgresqlQanPostgresqlPgstatmonitorAgentTypeStatusPropEnum []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 { - addServiceOkBodyPostgresqlQanPostgresqlPgstatmonitorAgentTypeStatusPropEnum = append(addServiceOkBodyPostgresqlQanPostgresqlPgstatmonitorAgentTypeStatusPropEnum, 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" - - // AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - - // AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - - // 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) 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) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required - return nil - } - - // value enum - if err := o.validateStatusEnum("addServiceOk"+"."+"postgresql"+"."+"qan_postgresql_pgstatmonitor_agent"+"."+"status", "body", *o.Status); err != nil { - return err - } - - return nil -} - -var addServiceOkBodyPostgresqlQanPostgresqlPgstatmonitorAgentTypeLogLevelPropEnum []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 { - addServiceOkBodyPostgresqlQanPostgresqlPgstatmonitorAgentTypeLogLevelPropEnum = append(addServiceOkBodyPostgresqlQanPostgresqlPgstatmonitorAgentTypeLogLevelPropEnum, v) - } -} - -const ( - - // AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgentLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -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) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("addServiceOk"+"."+"postgresql"+"."+"qan_postgresql_pgstatmonitor_agent"+"."+"log_level", "body", *o.LogLevel); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this add service OK body postgresql QAN postgresql pgstatmonitor agent based on context it is used -func (o *AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgent) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgent) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgent) UnmarshalBinary(b []byte) error { - var res AddServiceOKBodyPostgresqlQANPostgresqlPgstatmonitorAgent - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddServiceOKBodyPostgresqlService PostgreSQLService represents a generic PostgreSQL instance. -swagger:model AddServiceOKBodyPostgresqlService -*/ -type AddServiceOKBodyPostgresqlService struct { - // Unique randomly generated instance identifier. - ServiceID string `json:"service_id,omitempty"` - - // Unique across all Services user-defined name. - ServiceName string `json:"service_name,omitempty"` - - // Database name. - DatabaseName string `json:"database_name,omitempty"` - - // Node identifier where this instance runs. - NodeID string `json:"node_id,omitempty"` - - // Access address (DNS name or IP). - // Address (and port) or socket is required. - Address string `json:"address,omitempty"` - - // Access port. - // Port is required when the address present. - Port int64 `json:"port,omitempty"` - - // Access unix socket. - // Address (and port) or socket is required. - Socket string `json:"socket,omitempty"` - - // Environment name. - Environment string `json:"environment,omitempty"` - - // Cluster name. - Cluster string `json:"cluster,omitempty"` - - // Replication set name. - ReplicationSet string `json:"replication_set,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // PostgreSQL version. - Version string `json:"version,omitempty"` - - // Limit of databases for auto-discovery. - AutoDiscoveryLimit int32 `json:"auto_discovery_limit,omitempty"` -} - -// Validate validates this add service OK body postgresql service -func (o *AddServiceOKBodyPostgresqlService) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this add service OK body postgresql service based on context it is used -func (o *AddServiceOKBodyPostgresqlService) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddServiceOKBodyPostgresqlService) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddServiceOKBodyPostgresqlService) UnmarshalBinary(b []byte) error { - var res AddServiceOKBodyPostgresqlService - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddServiceOKBodyProxysql add service OK body proxysql -swagger:model AddServiceOKBodyProxysql -*/ -type AddServiceOKBodyProxysql struct { - // proxysql exporter - ProxysqlExporter *AddServiceOKBodyProxysqlProxysqlExporter `json:"proxysql_exporter,omitempty"` - - // service - Service *AddServiceOKBodyProxysqlService `json:"service,omitempty"` -} - -// Validate validates this add service OK body proxysql -func (o *AddServiceOKBodyProxysql) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateProxysqlExporter(formats); err != nil { - res = append(res, err) - } - - if err := o.validateService(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *AddServiceOKBodyProxysql) validateProxysqlExporter(formats strfmt.Registry) error { - if swag.IsZero(o.ProxysqlExporter) { // not required - return nil - } - - if o.ProxysqlExporter != nil { - if err := o.ProxysqlExporter.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "proxysql" + "." + "proxysql_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "proxysql" + "." + "proxysql_exporter") - } - - return err - } - } - - return nil -} - -func (o *AddServiceOKBodyProxysql) validateService(formats strfmt.Registry) error { - if swag.IsZero(o.Service) { // not required - return nil - } - - if o.Service != nil { - if err := o.Service.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "proxysql" + "." + "service") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "proxysql" + "." + "service") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this add service OK body proxysql based on the context it is used -func (o *AddServiceOKBodyProxysql) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateProxysqlExporter(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateService(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *AddServiceOKBodyProxysql) contextValidateProxysqlExporter(ctx context.Context, formats strfmt.Registry) error { - if o.ProxysqlExporter != nil { - - if swag.IsZero(o.ProxysqlExporter) { // not required - return nil - } - - if err := o.ProxysqlExporter.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "proxysql" + "." + "proxysql_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "proxysql" + "." + "proxysql_exporter") - } - - return err - } - } - - return nil -} - -func (o *AddServiceOKBodyProxysql) contextValidateService(ctx context.Context, formats strfmt.Registry) error { - if o.Service != nil { - - if swag.IsZero(o.Service) { // not required - return nil - } - - if err := o.Service.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "proxysql" + "." + "service") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "proxysql" + "." + "service") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *AddServiceOKBodyProxysql) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddServiceOKBodyProxysql) UnmarshalBinary(b []byte) error { - var res AddServiceOKBodyProxysql - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddServiceOKBodyProxysqlProxysqlExporter ProxySQLExporter runs on Generic or Container Node and exposes ProxySQL Service metrics. -swagger:model AddServiceOKBodyProxysqlProxysqlExporter -*/ -type AddServiceOKBodyProxysqlProxysqlExporter struct { - // Unique randomly generated instance identifier. - AgentID string `json:"agent_id,omitempty"` - - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `json:"disabled,omitempty"` - - // Service identifier. - ServiceID string `json:"service_id,omitempty"` - - // ProxySQL username for scraping metrics. - Username string `json:"username,omitempty"` - - // Use TLS for database connections. - TLS bool `json:"tls,omitempty"` - - // Skip TLS certificate and hostname validation. - TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // True if exporter uses push metrics mode. - PushMetricsEnabled bool `json:"push_metrics_enabled,omitempty"` - - // 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"` - - // Optionally expose the exporter process on all public interfaces - ExposeExporter bool `json:"expose_exporter,omitempty"` - - // metrics resolutions - MetricsResolutions *AddServiceOKBodyProxysqlProxysqlExporterMetricsResolutions `json:"metrics_resolutions,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 { - 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 addServiceOkBodyProxysqlProxysqlExporterTypeStatusPropEnum []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 { - addServiceOkBodyProxysqlProxysqlExporterTypeStatusPropEnum = append(addServiceOkBodyProxysqlProxysqlExporterTypeStatusPropEnum, 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" - - // AddServiceOKBodyProxysqlProxysqlExporterStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - AddServiceOKBodyProxysqlProxysqlExporterStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - - // AddServiceOKBodyProxysqlProxysqlExporterStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - AddServiceOKBodyProxysqlProxysqlExporterStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - - // 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) 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) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required - return nil - } - - // value enum - if err := o.validateStatusEnum("addServiceOk"+"."+"proxysql"+"."+"proxysql_exporter"+"."+"status", "body", *o.Status); err != nil { - return err - } - - return nil -} - -var addServiceOkBodyProxysqlProxysqlExporterTypeLogLevelPropEnum []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 { - addServiceOkBodyProxysqlProxysqlExporterTypeLogLevelPropEnum = append(addServiceOkBodyProxysqlProxysqlExporterTypeLogLevelPropEnum, v) - } -} - -const ( - - // AddServiceOKBodyProxysqlProxysqlExporterLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - AddServiceOKBodyProxysqlProxysqlExporterLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // AddServiceOKBodyProxysqlProxysqlExporterLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - AddServiceOKBodyProxysqlProxysqlExporterLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // AddServiceOKBodyProxysqlProxysqlExporterLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - AddServiceOKBodyProxysqlProxysqlExporterLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // AddServiceOKBodyProxysqlProxysqlExporterLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - AddServiceOKBodyProxysqlProxysqlExporterLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // AddServiceOKBodyProxysqlProxysqlExporterLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - AddServiceOKBodyProxysqlProxysqlExporterLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // AddServiceOKBodyProxysqlProxysqlExporterLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - AddServiceOKBodyProxysqlProxysqlExporterLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// 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 -} - -func (o *AddServiceOKBodyProxysqlProxysqlExporter) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - 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 - - if err := o.contextValidateMetricsResolutions(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *AddServiceOKBodyProxysqlProxysqlExporter) 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 { - 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 -} - -// MarshalBinary interface implementation -func (o *AddServiceOKBodyProxysqlProxysqlExporter) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddServiceOKBodyProxysqlProxysqlExporter) UnmarshalBinary(b []byte) error { - var res AddServiceOKBodyProxysqlProxysqlExporter - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddServiceOKBodyProxysqlProxysqlExporterMetricsResolutions MetricsResolutions represents Prometheus exporters metrics resolutions. -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"` - - // Medium resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Mr string `json:"mr,omitempty"` - - // Low resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Lr string `json:"lr,omitempty"` -} - -// Validate validates this add service OK body proxysql proxysql exporter metrics resolutions -func (o *AddServiceOKBodyProxysqlProxysqlExporterMetricsResolutions) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this add service OK body proxysql proxysql exporter metrics resolutions based on context it is used -func (o *AddServiceOKBodyProxysqlProxysqlExporterMetricsResolutions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddServiceOKBodyProxysqlProxysqlExporterMetricsResolutions) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddServiceOKBodyProxysqlProxysqlExporterMetricsResolutions) UnmarshalBinary(b []byte) error { - var res AddServiceOKBodyProxysqlProxysqlExporterMetricsResolutions - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddServiceOKBodyProxysqlService ProxySQLService represents a generic ProxySQL instance. -swagger:model AddServiceOKBodyProxysqlService -*/ -type AddServiceOKBodyProxysqlService struct { - // Unique randomly generated instance identifier. - ServiceID string `json:"service_id,omitempty"` - - // Unique across all Services user-defined name. - ServiceName string `json:"service_name,omitempty"` - - // Node identifier where this instance runs. - NodeID string `json:"node_id,omitempty"` - - // Access address (DNS name or IP). - // Address (and port) or socket is required. - Address string `json:"address,omitempty"` - - // Access port. - // Port is required when the address present. - Port int64 `json:"port,omitempty"` - - // Access unix socket. - // Address (and port) or socket is required. - Socket string `json:"socket,omitempty"` - - // Environment name. - Environment string `json:"environment,omitempty"` - - // Cluster name. - Cluster string `json:"cluster,omitempty"` - - // Replication set name. - ReplicationSet string `json:"replication_set,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // ProxySQL version. - Version string `json:"version,omitempty"` -} - -// Validate validates this add service OK body proxysql service -func (o *AddServiceOKBodyProxysqlService) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this add service OK body proxysql service based on context it is used -func (o *AddServiceOKBodyProxysqlService) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddServiceOKBodyProxysqlService) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddServiceOKBodyProxysqlService) UnmarshalBinary(b []byte) error { - var res AddServiceOKBodyProxysqlService - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddServiceOKBodyRDS add service OK body RDS -swagger:model AddServiceOKBodyRDS -*/ -type AddServiceOKBodyRDS struct { - // mysql - Mysql *AddServiceOKBodyRDSMysql `json:"mysql,omitempty"` - - // mysqld exporter - MysqldExporter *AddServiceOKBodyRDSMysqldExporter `json:"mysqld_exporter,omitempty"` - - // node - Node *AddServiceOKBodyRDSNode `json:"node,omitempty"` - - // postgresql - Postgresql *AddServiceOKBodyRDSPostgresql `json:"postgresql,omitempty"` - - // postgresql exporter - PostgresqlExporter *AddServiceOKBodyRDSPostgresqlExporter `json:"postgresql_exporter,omitempty"` - - // qan mysql perfschema - QANMysqlPerfschema *AddServiceOKBodyRDSQANMysqlPerfschema `json:"qan_mysql_perfschema,omitempty"` - - // qan postgresql pgstatements - QANPostgresqlPgstatements *AddServiceOKBodyRDSQANPostgresqlPgstatements `json:"qan_postgresql_pgstatements,omitempty"` - - // rds exporter - RDSExporter *AddServiceOKBodyRDSRDSExporter `json:"rds_exporter,omitempty"` -} - -// Validate validates this add service OK body RDS -func (o *AddServiceOKBodyRDS) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateMysql(formats); err != nil { - res = append(res, err) - } - - if err := o.validateMysqldExporter(formats); err != nil { - res = append(res, err) - } - - if err := o.validateNode(formats); err != nil { - res = append(res, err) - } - - if err := o.validatePostgresql(formats); err != nil { - res = append(res, err) - } - - if err := o.validatePostgresqlExporter(formats); err != nil { - res = append(res, err) - } - - if err := o.validateQANMysqlPerfschema(formats); err != nil { - res = append(res, err) - } - - if err := o.validateQANPostgresqlPgstatements(formats); err != nil { - res = append(res, err) - } - - if err := o.validateRDSExporter(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *AddServiceOKBodyRDS) validateMysql(formats strfmt.Registry) error { - if swag.IsZero(o.Mysql) { // not required - return nil - } - - if o.Mysql != nil { - if err := o.Mysql.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "rds" + "." + "mysql") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "rds" + "." + "mysql") - } - - return err - } - } - - return nil -} - -func (o *AddServiceOKBodyRDS) validateMysqldExporter(formats strfmt.Registry) error { - if swag.IsZero(o.MysqldExporter) { // not required - return nil - } - - if o.MysqldExporter != nil { - if err := o.MysqldExporter.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "rds" + "." + "mysqld_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "rds" + "." + "mysqld_exporter") - } - - return err - } - } - - return nil -} - -func (o *AddServiceOKBodyRDS) validateNode(formats strfmt.Registry) error { - if swag.IsZero(o.Node) { // not required - return nil - } - - if o.Node != nil { - if err := o.Node.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "rds" + "." + "node") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "rds" + "." + "node") - } - - return err - } - } - - return nil -} - -func (o *AddServiceOKBodyRDS) validatePostgresql(formats strfmt.Registry) error { - if swag.IsZero(o.Postgresql) { // not required - return nil - } - - if o.Postgresql != nil { - if err := o.Postgresql.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "rds" + "." + "postgresql") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "rds" + "." + "postgresql") - } - - return err - } - } - - return nil -} - -func (o *AddServiceOKBodyRDS) validatePostgresqlExporter(formats strfmt.Registry) error { - if swag.IsZero(o.PostgresqlExporter) { // not required - return nil - } - - if o.PostgresqlExporter != nil { - if err := o.PostgresqlExporter.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "rds" + "." + "postgresql_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "rds" + "." + "postgresql_exporter") - } - - return err - } - } - - return nil -} - -func (o *AddServiceOKBodyRDS) validateQANMysqlPerfschema(formats strfmt.Registry) error { - if swag.IsZero(o.QANMysqlPerfschema) { // not required - return nil - } - - if o.QANMysqlPerfschema != nil { - if err := o.QANMysqlPerfschema.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "rds" + "." + "qan_mysql_perfschema") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "rds" + "." + "qan_mysql_perfschema") - } - - return err - } - } - - return nil -} - -func (o *AddServiceOKBodyRDS) validateQANPostgresqlPgstatements(formats strfmt.Registry) error { - if swag.IsZero(o.QANPostgresqlPgstatements) { // not required - return nil - } - - if o.QANPostgresqlPgstatements != nil { - if err := o.QANPostgresqlPgstatements.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "rds" + "." + "qan_postgresql_pgstatements") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "rds" + "." + "qan_postgresql_pgstatements") - } - - return err - } - } - - return nil -} - -func (o *AddServiceOKBodyRDS) validateRDSExporter(formats strfmt.Registry) error { - if swag.IsZero(o.RDSExporter) { // not required - return nil - } - - if o.RDSExporter != nil { - if err := o.RDSExporter.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "rds" + "." + "rds_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "rds" + "." + "rds_exporter") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this add service OK body RDS based on the context it is used -func (o *AddServiceOKBodyRDS) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateMysql(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateMysqldExporter(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateNode(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidatePostgresql(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidatePostgresqlExporter(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateQANMysqlPerfschema(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateQANPostgresqlPgstatements(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateRDSExporter(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *AddServiceOKBodyRDS) contextValidateMysql(ctx context.Context, formats strfmt.Registry) error { - if o.Mysql != nil { - - if swag.IsZero(o.Mysql) { // not required - return nil - } - - if err := o.Mysql.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "rds" + "." + "mysql") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "rds" + "." + "mysql") - } - - return err - } - } - - return nil -} - -func (o *AddServiceOKBodyRDS) contextValidateMysqldExporter(ctx context.Context, formats strfmt.Registry) error { - if o.MysqldExporter != nil { - - if swag.IsZero(o.MysqldExporter) { // not required - return nil - } - - if err := o.MysqldExporter.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "rds" + "." + "mysqld_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "rds" + "." + "mysqld_exporter") - } - - return err - } - } - - return nil -} - -func (o *AddServiceOKBodyRDS) contextValidateNode(ctx context.Context, formats strfmt.Registry) error { - if o.Node != nil { - - if swag.IsZero(o.Node) { // not required - return nil - } - - if err := o.Node.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "rds" + "." + "node") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "rds" + "." + "node") - } - - return err - } - } - - return nil -} - -func (o *AddServiceOKBodyRDS) contextValidatePostgresql(ctx context.Context, formats strfmt.Registry) error { - if o.Postgresql != nil { - - if swag.IsZero(o.Postgresql) { // not required - return nil - } - - if err := o.Postgresql.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "rds" + "." + "postgresql") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "rds" + "." + "postgresql") - } - - return err - } - } - - return nil -} - -func (o *AddServiceOKBodyRDS) contextValidatePostgresqlExporter(ctx context.Context, formats strfmt.Registry) error { - if o.PostgresqlExporter != nil { - - if swag.IsZero(o.PostgresqlExporter) { // not required - return nil - } - - if err := o.PostgresqlExporter.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "rds" + "." + "postgresql_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "rds" + "." + "postgresql_exporter") - } - - return err - } - } - - return nil -} - -func (o *AddServiceOKBodyRDS) contextValidateQANMysqlPerfschema(ctx context.Context, formats strfmt.Registry) error { - if o.QANMysqlPerfschema != nil { - - if swag.IsZero(o.QANMysqlPerfschema) { // not required - return nil - } - - if err := o.QANMysqlPerfschema.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "rds" + "." + "qan_mysql_perfschema") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "rds" + "." + "qan_mysql_perfschema") - } - - return err - } - } - - return nil -} - -func (o *AddServiceOKBodyRDS) contextValidateQANPostgresqlPgstatements(ctx context.Context, formats strfmt.Registry) error { - if o.QANPostgresqlPgstatements != nil { - - if swag.IsZero(o.QANPostgresqlPgstatements) { // not required - return nil - } - - if err := o.QANPostgresqlPgstatements.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "rds" + "." + "qan_postgresql_pgstatements") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "rds" + "." + "qan_postgresql_pgstatements") - } - - return err - } - } - - return nil -} - -func (o *AddServiceOKBodyRDS) contextValidateRDSExporter(ctx context.Context, formats strfmt.Registry) error { - if o.RDSExporter != nil { - - if swag.IsZero(o.RDSExporter) { // not required - return nil - } - - if err := o.RDSExporter.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "rds" + "." + "rds_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "rds" + "." + "rds_exporter") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *AddServiceOKBodyRDS) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddServiceOKBodyRDS) UnmarshalBinary(b []byte) error { - var res AddServiceOKBodyRDS - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddServiceOKBodyRDSMysql MySQLService represents a generic MySQL instance. -swagger:model AddServiceOKBodyRDSMysql -*/ -type AddServiceOKBodyRDSMysql struct { - // Unique randomly generated instance identifier. - ServiceID string `json:"service_id,omitempty"` - - // Unique across all Services user-defined name. - ServiceName string `json:"service_name,omitempty"` - - // Node identifier where this instance runs. - NodeID string `json:"node_id,omitempty"` - - // Access address (DNS name or IP). - // Address (and port) or socket is required. - Address string `json:"address,omitempty"` - - // Access port. - // Port is required when the address present. - Port int64 `json:"port,omitempty"` - - // Access unix socket. - // Address (and port) or socket is required. - Socket string `json:"socket,omitempty"` - - // Environment name. - Environment string `json:"environment,omitempty"` - - // Cluster name. - Cluster string `json:"cluster,omitempty"` - - // Replication set name. - ReplicationSet string `json:"replication_set,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // MySQL version. - Version string `json:"version,omitempty"` - - // Extra parameters to be added to the DSN. - ExtraDsnParams map[string]string `json:"extra_dsn_params,omitempty"` -} - -// Validate validates this add service OK body RDS mysql -func (o *AddServiceOKBodyRDSMysql) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this add service OK body RDS mysql based on context it is used -func (o *AddServiceOKBodyRDSMysql) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddServiceOKBodyRDSMysql) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddServiceOKBodyRDSMysql) UnmarshalBinary(b []byte) error { - var res AddServiceOKBodyRDSMysql - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddServiceOKBodyRDSMysqldExporter MySQLdExporter runs on Generic or Container Node and exposes MySQL Service metrics. -swagger:model AddServiceOKBodyRDSMysqldExporter -*/ -type AddServiceOKBodyRDSMysqldExporter struct { - // Unique randomly generated instance identifier. - AgentID string `json:"agent_id,omitempty"` - - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `json:"disabled,omitempty"` - - // Service identifier. - ServiceID string `json:"service_id,omitempty"` - - // MySQL username for scraping metrics. - Username string `json:"username,omitempty"` - - // Use TLS for database connections. - TLS bool `json:"tls,omitempty"` - - // Skip TLS certificate and hostname validation. - TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - - // Certificate Authority certificate chain. - TLSCa string `json:"tls_ca,omitempty"` - - // Client certificate. - TLSCert string `json:"tls_cert,omitempty"` - - // Password for decrypting tls_cert. - TLSKey string `json:"tls_key,omitempty"` - - // Tablestats group collectors are disabled if there are more than that number of tables. - // 0 means tablestats group collectors are always enabled (no limit). - // Negative value means tablestats group collectors are always disabled. - TablestatsGroupTableLimit int32 `json:"tablestats_group_table_limit,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // True if exporter uses push metrics mode. - PushMetricsEnabled bool `json:"push_metrics_enabled,omitempty"` - - // List of disabled collector names. - DisabledCollectors []string `json:"disabled_collectors"` - - // 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"` - - // True if tablestats group collectors are currently disabled. - TablestatsGroupDisabled bool `json:"tablestats_group_disabled,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"` - - // 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"` -} - -// 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 { - 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 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 - 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 { - addServiceOkBodyRdsMysqldExporterTypeLogLevelPropEnum = append(addServiceOkBodyRdsMysqldExporterTypeLogLevelPropEnum, v) - } -} - -const ( - - // AddServiceOKBodyRDSMysqldExporterLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - AddServiceOKBodyRDSMysqldExporterLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // AddServiceOKBodyRDSMysqldExporterLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - AddServiceOKBodyRDSMysqldExporterLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // AddServiceOKBodyRDSMysqldExporterLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - AddServiceOKBodyRDSMysqldExporterLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // AddServiceOKBodyRDSMysqldExporterLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - AddServiceOKBodyRDSMysqldExporterLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // AddServiceOKBodyRDSMysqldExporterLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - AddServiceOKBodyRDSMysqldExporterLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // AddServiceOKBodyRDSMysqldExporterLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - AddServiceOKBodyRDSMysqldExporterLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -func (o *AddServiceOKBodyRDSMysqldExporter) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addServiceOkBodyRdsMysqldExporterTypeLogLevelPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddServiceOKBodyRDSMysqldExporter) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("addServiceOk"+"."+"rds"+"."+"mysqld_exporter"+"."+"log_level", "body", *o.LogLevel); err != nil { - return err - } - - return nil -} - -func (o *AddServiceOKBodyRDSMysqldExporter) 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" + "." + "rds" + "." + "mysqld_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "rds" + "." + "mysqld_exporter" + "." + "metrics_resolutions") - } - - 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 { - 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") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *AddServiceOKBodyRDSMysqldExporter) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddServiceOKBodyRDSMysqldExporter) UnmarshalBinary(b []byte) error { - var res AddServiceOKBodyRDSMysqldExporter - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddServiceOKBodyRDSMysqldExporterMetricsResolutions MetricsResolutions represents Prometheus exporters metrics resolutions. -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"` - - // Medium resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Mr string `json:"mr,omitempty"` - - // Low resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Lr string `json:"lr,omitempty"` -} - -// Validate validates this add service OK body RDS mysqld exporter metrics resolutions -func (o *AddServiceOKBodyRDSMysqldExporterMetricsResolutions) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this add service OK body RDS mysqld exporter metrics resolutions based on context it is used -func (o *AddServiceOKBodyRDSMysqldExporterMetricsResolutions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddServiceOKBodyRDSMysqldExporterMetricsResolutions) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddServiceOKBodyRDSMysqldExporterMetricsResolutions) UnmarshalBinary(b []byte) error { - var res AddServiceOKBodyRDSMysqldExporterMetricsResolutions - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddServiceOKBodyRDSNode RemoteRDSNode represents remote RDS Node. Agents can't run on Remote RDS Nodes. -swagger:model AddServiceOKBodyRDSNode -*/ -type AddServiceOKBodyRDSNode struct { - // Unique randomly generated instance identifier. - NodeID string `json:"node_id,omitempty"` - - // Unique across all Nodes user-defined name. - NodeName string `json:"node_name,omitempty"` - - // DB instance identifier. - Address string `json:"address,omitempty"` - - // Node model. - NodeModel string `json:"node_model,omitempty"` - - // Node region. - Region string `json:"region,omitempty"` - - // Node availability zone. - Az string `json:"az,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // AWS instance ID. - InstanceID string `json:"instance_id,omitempty"` -} - -// Validate validates this add service OK body RDS node -func (o *AddServiceOKBodyRDSNode) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this add service OK body RDS node based on context it is used -func (o *AddServiceOKBodyRDSNode) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddServiceOKBodyRDSNode) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddServiceOKBodyRDSNode) UnmarshalBinary(b []byte) error { - var res AddServiceOKBodyRDSNode - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddServiceOKBodyRDSPostgresql PostgreSQLService represents a generic PostgreSQL instance. -swagger:model AddServiceOKBodyRDSPostgresql -*/ -type AddServiceOKBodyRDSPostgresql struct { - // Unique randomly generated instance identifier. - ServiceID string `json:"service_id,omitempty"` - - // Unique across all Services user-defined name. - ServiceName string `json:"service_name,omitempty"` - - // Database name. - DatabaseName string `json:"database_name,omitempty"` - - // Node identifier where this instance runs. - NodeID string `json:"node_id,omitempty"` - - // Access address (DNS name or IP). - // Address (and port) or socket is required. - Address string `json:"address,omitempty"` - - // Access port. - // Port is required when the address present. - Port int64 `json:"port,omitempty"` - - // Access unix socket. - // Address (and port) or socket is required. - Socket string `json:"socket,omitempty"` - - // Environment name. - Environment string `json:"environment,omitempty"` - - // Cluster name. - Cluster string `json:"cluster,omitempty"` - - // Replication set name. - ReplicationSet string `json:"replication_set,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // PostgreSQL version. - Version string `json:"version,omitempty"` - - // Limit of databases for auto-discovery. - AutoDiscoveryLimit int32 `json:"auto_discovery_limit,omitempty"` -} - -// Validate validates this add service OK body RDS postgresql -func (o *AddServiceOKBodyRDSPostgresql) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this add service OK body RDS postgresql based on context it is used -func (o *AddServiceOKBodyRDSPostgresql) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddServiceOKBodyRDSPostgresql) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddServiceOKBodyRDSPostgresql) UnmarshalBinary(b []byte) error { - var res AddServiceOKBodyRDSPostgresql - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddServiceOKBodyRDSPostgresqlExporter PostgresExporter runs on Generic or Container Node and exposes PostgreSQL Service metrics. -swagger:model AddServiceOKBodyRDSPostgresqlExporter -*/ -type AddServiceOKBodyRDSPostgresqlExporter struct { - // Unique randomly generated instance identifier. - AgentID string `json:"agent_id,omitempty"` - - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `json:"disabled,omitempty"` - - // Service identifier. - ServiceID string `json:"service_id,omitempty"` - - // PostgreSQL username for scraping metrics. - Username string `json:"username,omitempty"` - - // Use TLS for database connections. - TLS bool `json:"tls,omitempty"` - - // Skip TLS certificate and hostname validation. Uses sslmode=required instead of verify-full. - TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // True if exporter uses push metrics mode. - PushMetricsEnabled bool `json:"push_metrics_enabled,omitempty"` - - // 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"` - - // Optionally expose the exporter process on all public interfaces - ExposeExporter bool `json:"expose_exporter,omitempty"` - - // Maximum number of connections that exporter can open to the database instance. - MaxExporterConnections int32 `json:"max_exporter_connections,omitempty"` - - // metrics resolutions - MetricsResolutions *AddServiceOKBodyRDSPostgresqlExporterMetricsResolutions `json:"metrics_resolutions,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 { - 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 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 - 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 { - addServiceOkBodyRdsPostgresqlExporterTypeLogLevelPropEnum = append(addServiceOkBodyRdsPostgresqlExporterTypeLogLevelPropEnum, v) - } -} - -const ( - - // AddServiceOKBodyRDSPostgresqlExporterLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - AddServiceOKBodyRDSPostgresqlExporterLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // AddServiceOKBodyRDSPostgresqlExporterLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - AddServiceOKBodyRDSPostgresqlExporterLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // AddServiceOKBodyRDSPostgresqlExporterLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - AddServiceOKBodyRDSPostgresqlExporterLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // AddServiceOKBodyRDSPostgresqlExporterLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - AddServiceOKBodyRDSPostgresqlExporterLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // AddServiceOKBodyRDSPostgresqlExporterLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - AddServiceOKBodyRDSPostgresqlExporterLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // AddServiceOKBodyRDSPostgresqlExporterLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - AddServiceOKBodyRDSPostgresqlExporterLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -func (o *AddServiceOKBodyRDSPostgresqlExporter) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addServiceOkBodyRdsPostgresqlExporterTypeLogLevelPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddServiceOKBodyRDSPostgresqlExporter) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("addServiceOk"+"."+"rds"+"."+"postgresql_exporter"+"."+"log_level", "body", *o.LogLevel); err != nil { - return err - } - - return nil -} - -func (o *AddServiceOKBodyRDSPostgresqlExporter) 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" + "." + "rds" + "." + "postgresql_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "rds" + "." + "postgresql_exporter" + "." + "metrics_resolutions") - } - - 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 - - if err := o.contextValidateMetricsResolutions(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *AddServiceOKBodyRDSPostgresqlExporter) 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 { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "rds" + "." + "postgresql_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "rds" + "." + "postgresql_exporter" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *AddServiceOKBodyRDSPostgresqlExporter) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddServiceOKBodyRDSPostgresqlExporter) UnmarshalBinary(b []byte) error { - var res AddServiceOKBodyRDSPostgresqlExporter - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddServiceOKBodyRDSPostgresqlExporterMetricsResolutions MetricsResolutions represents Prometheus exporters metrics resolutions. -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"` - - // Medium resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Mr string `json:"mr,omitempty"` - - // Low resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Lr string `json:"lr,omitempty"` -} - -// Validate validates this add service OK body RDS postgresql exporter metrics resolutions -func (o *AddServiceOKBodyRDSPostgresqlExporterMetricsResolutions) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this add service OK body RDS postgresql exporter metrics resolutions based on context it is used -func (o *AddServiceOKBodyRDSPostgresqlExporterMetricsResolutions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddServiceOKBodyRDSPostgresqlExporterMetricsResolutions) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddServiceOKBodyRDSPostgresqlExporterMetricsResolutions) UnmarshalBinary(b []byte) error { - var res AddServiceOKBodyRDSPostgresqlExporterMetricsResolutions - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddServiceOKBodyRDSQANMysqlPerfschema QANMySQLPerfSchemaAgent runs within pmm-agent and sends MySQL Query Analytics data to the PMM Server. -swagger:model AddServiceOKBodyRDSQANMysqlPerfschema -*/ -type AddServiceOKBodyRDSQANMysqlPerfschema struct { - // Unique randomly generated instance identifier. - AgentID string `json:"agent_id,omitempty"` - - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `json:"disabled,omitempty"` - - // Service identifier. - ServiceID string `json:"service_id,omitempty"` - - // MySQL username for getting performance data. - Username string `json:"username,omitempty"` - - // Use TLS for database connections. - TLS bool `json:"tls,omitempty"` - - // Skip TLS certificate and hostname validation. - TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - - // Certificate Authority certificate chain. - TLSCa string `json:"tls_ca,omitempty"` - - // Client certificate. - TLSCert string `json:"tls_cert,omitempty"` - - // Password for decrypting tls_cert. - TLSKey string `json:"tls_key,omitempty"` - - // Disable parsing comments from queries and showing them in QAN. - DisableCommentsParsing bool `json:"disable_comments_parsing,omitempty"` - - // Limit query length in QAN (default: server-defined; -1: no limit). - MaxQueryLength int32 `json:"max_query_length,omitempty"` - - // True if query examples are disabled. - QueryExamplesDisabled bool `json:"query_examples_disabled,omitempty"` - - // 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"` - - // 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 addServiceOkBodyRdsQanMysqlPerfschemaTypeStatusPropEnum []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 { - addServiceOkBodyRdsQanMysqlPerfschemaTypeStatusPropEnum = append(addServiceOkBodyRdsQanMysqlPerfschemaTypeStatusPropEnum, 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" - - // AddServiceOKBodyRDSQANMysqlPerfschemaStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - AddServiceOKBodyRDSQANMysqlPerfschemaStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - - // AddServiceOKBodyRDSQANMysqlPerfschemaStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - AddServiceOKBodyRDSQANMysqlPerfschemaStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - - // 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) 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) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required - return nil - } - - // value enum - if err := o.validateStatusEnum("addServiceOk"+"."+"rds"+"."+"qan_mysql_perfschema"+"."+"status", "body", *o.Status); err != nil { - return err - } - - return nil -} - -var addServiceOkBodyRdsQanMysqlPerfschemaTypeLogLevelPropEnum []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 { - addServiceOkBodyRdsQanMysqlPerfschemaTypeLogLevelPropEnum = append(addServiceOkBodyRdsQanMysqlPerfschemaTypeLogLevelPropEnum, v) - } -} - -const ( - - // AddServiceOKBodyRDSQANMysqlPerfschemaLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - AddServiceOKBodyRDSQANMysqlPerfschemaLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // AddServiceOKBodyRDSQANMysqlPerfschemaLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - AddServiceOKBodyRDSQANMysqlPerfschemaLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // AddServiceOKBodyRDSQANMysqlPerfschemaLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - AddServiceOKBodyRDSQANMysqlPerfschemaLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // AddServiceOKBodyRDSQANMysqlPerfschemaLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - AddServiceOKBodyRDSQANMysqlPerfschemaLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // AddServiceOKBodyRDSQANMysqlPerfschemaLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - AddServiceOKBodyRDSQANMysqlPerfschemaLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // AddServiceOKBodyRDSQANMysqlPerfschemaLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - AddServiceOKBodyRDSQANMysqlPerfschemaLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -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) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("addServiceOk"+"."+"rds"+"."+"qan_mysql_perfschema"+"."+"log_level", "body", *o.LogLevel); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this add service OK body RDS QAN mysql perfschema based on context it is used -func (o *AddServiceOKBodyRDSQANMysqlPerfschema) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddServiceOKBodyRDSQANMysqlPerfschema) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddServiceOKBodyRDSQANMysqlPerfschema) UnmarshalBinary(b []byte) error { - var res AddServiceOKBodyRDSQANMysqlPerfschema - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddServiceOKBodyRDSQANPostgresqlPgstatements QANPostgreSQLPgStatementsAgent runs within pmm-agent and sends PostgreSQL Query Analytics data to the PMM Server. -swagger:model AddServiceOKBodyRDSQANPostgresqlPgstatements -*/ -type AddServiceOKBodyRDSQANPostgresqlPgstatements struct { - // Unique randomly generated instance identifier. - AgentID string `json:"agent_id,omitempty"` - - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `json:"disabled,omitempty"` - - // Service identifier. - ServiceID string `json:"service_id,omitempty"` - - // PostgreSQL username for getting pg stat statements data. - Username string `json:"username,omitempty"` - - // Disable parsing comments from queries and showing them in QAN. - DisableCommentsParsing bool `json:"disable_comments_parsing,omitempty"` - - // Limit query length in QAN (default: server-defined; -1: no limit). - MaxQueryLength int32 `json:"max_query_length,omitempty"` - - // Use TLS for database connections. - TLS bool `json:"tls,omitempty"` - - // Skip TLS certificate and hostname validation. - TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - - // 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"` - - // 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 { - 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 addServiceOkBodyRdsQanPostgresqlPgstatementsTypeStatusPropEnum []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 { - addServiceOkBodyRdsQanPostgresqlPgstatementsTypeStatusPropEnum = append(addServiceOkBodyRdsQanPostgresqlPgstatementsTypeStatusPropEnum, 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" - - // AddServiceOKBodyRDSQANPostgresqlPgstatementsStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - AddServiceOKBodyRDSQANPostgresqlPgstatementsStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - - // AddServiceOKBodyRDSQANPostgresqlPgstatementsStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - AddServiceOKBodyRDSQANPostgresqlPgstatementsStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - - // 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) 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) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required - return nil - } - - // value enum - if err := o.validateStatusEnum("addServiceOk"+"."+"rds"+"."+"qan_postgresql_pgstatements"+"."+"status", "body", *o.Status); err != nil { - return err - } - - return nil -} - -var addServiceOkBodyRdsQanPostgresqlPgstatementsTypeLogLevelPropEnum []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 { - addServiceOkBodyRdsQanPostgresqlPgstatementsTypeLogLevelPropEnum = append(addServiceOkBodyRdsQanPostgresqlPgstatementsTypeLogLevelPropEnum, v) - } -} - -const ( - - // AddServiceOKBodyRDSQANPostgresqlPgstatementsLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - AddServiceOKBodyRDSQANPostgresqlPgstatementsLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // AddServiceOKBodyRDSQANPostgresqlPgstatementsLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - AddServiceOKBodyRDSQANPostgresqlPgstatementsLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // AddServiceOKBodyRDSQANPostgresqlPgstatementsLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - AddServiceOKBodyRDSQANPostgresqlPgstatementsLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // AddServiceOKBodyRDSQANPostgresqlPgstatementsLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - AddServiceOKBodyRDSQANPostgresqlPgstatementsLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // AddServiceOKBodyRDSQANPostgresqlPgstatementsLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - AddServiceOKBodyRDSQANPostgresqlPgstatementsLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // AddServiceOKBodyRDSQANPostgresqlPgstatementsLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - AddServiceOKBodyRDSQANPostgresqlPgstatementsLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -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) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("addServiceOk"+"."+"rds"+"."+"qan_postgresql_pgstatements"+"."+"log_level", "body", *o.LogLevel); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this add service OK body RDS QAN postgresql pgstatements based on context it is used -func (o *AddServiceOKBodyRDSQANPostgresqlPgstatements) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddServiceOKBodyRDSQANPostgresqlPgstatements) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddServiceOKBodyRDSQANPostgresqlPgstatements) UnmarshalBinary(b []byte) error { - var res AddServiceOKBodyRDSQANPostgresqlPgstatements - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddServiceOKBodyRDSRDSExporter RDSExporter runs on Generic or Container Node and exposes RemoteRDS Node metrics. -swagger:model AddServiceOKBodyRDSRDSExporter -*/ -type AddServiceOKBodyRDSRDSExporter struct { - // Unique randomly generated instance identifier. - AgentID string `json:"agent_id,omitempty"` - - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `json:"disabled,omitempty"` - - // Node identifier. - NodeID string `json:"node_id,omitempty"` - - // AWS Access Key. - AWSAccessKey string `json:"aws_access_key,omitempty"` - - // 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"` - - // Basic metrics are disabled. - BasicMetricsDisabled bool `json:"basic_metrics_disabled,omitempty"` - - // Enhanced metrics are disabled. - EnhancedMetricsDisabled bool `json:"enhanced_metrics_disabled,omitempty"` - - // True if exporter uses push metrics mode. - PushMetricsEnabled bool `json:"push_metrics_enabled,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"` - - // 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" - - // 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 -} - -var addServiceOkBodyRdsRdsExporterTypeLogLevelPropEnum []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 { - addServiceOkBodyRdsRdsExporterTypeLogLevelPropEnum = append(addServiceOkBodyRdsRdsExporterTypeLogLevelPropEnum, v) - } -} - -const ( - - // AddServiceOKBodyRDSRDSExporterLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - AddServiceOKBodyRDSRDSExporterLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // AddServiceOKBodyRDSRDSExporterLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - AddServiceOKBodyRDSRDSExporterLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // AddServiceOKBodyRDSRDSExporterLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - AddServiceOKBodyRDSRDSExporterLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // AddServiceOKBodyRDSRDSExporterLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - AddServiceOKBodyRDSRDSExporterLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // AddServiceOKBodyRDSRDSExporterLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - AddServiceOKBodyRDSRDSExporterLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // AddServiceOKBodyRDSRDSExporterLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - AddServiceOKBodyRDSRDSExporterLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -func (o *AddServiceOKBodyRDSRDSExporter) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addServiceOkBodyRdsRdsExporterTypeLogLevelPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddServiceOKBodyRDSRDSExporter) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("addServiceOk"+"."+"rds"+"."+"rds_exporter"+"."+"log_level", "body", *o.LogLevel); err != nil { - return err - } - - return nil -} - -func (o *AddServiceOKBodyRDSRDSExporter) 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" + "." + "rds" + "." + "rds_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "rds" + "." + "rds_exporter" + "." + "metrics_resolutions") - } - - 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 - - if err := o.contextValidateMetricsResolutions(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *AddServiceOKBodyRDSRDSExporter) 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 { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "rds" + "." + "rds_exporter" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "rds" + "." + "rds_exporter" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *AddServiceOKBodyRDSRDSExporter) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddServiceOKBodyRDSRDSExporter) UnmarshalBinary(b []byte) error { - var res AddServiceOKBodyRDSRDSExporter - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddServiceOKBodyRDSRDSExporterMetricsResolutions MetricsResolutions represents Prometheus exporters metrics resolutions. -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"` - - // Medium resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Mr string `json:"mr,omitempty"` - - // Low resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Lr string `json:"lr,omitempty"` -} - -// Validate validates this add service OK body RDS RDS exporter metrics resolutions -func (o *AddServiceOKBodyRDSRDSExporterMetricsResolutions) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this add service OK body RDS RDS exporter metrics resolutions based on context it is used -func (o *AddServiceOKBodyRDSRDSExporterMetricsResolutions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddServiceOKBodyRDSRDSExporterMetricsResolutions) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddServiceOKBodyRDSRDSExporterMetricsResolutions) UnmarshalBinary(b []byte) error { - var res AddServiceOKBodyRDSRDSExporterMetricsResolutions - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddServiceOKBodyValkey add service OK body valkey -swagger:model AddServiceOKBodyValkey -*/ -type AddServiceOKBodyValkey struct { - // service - Service *AddServiceOKBodyValkeyService `json:"service,omitempty"` - - // valkey exporter - ValkeyExporter *AddServiceOKBodyValkeyValkeyExporter `json:"valkey_exporter,omitempty"` -} - -// Validate validates this add service OK body valkey -func (o *AddServiceOKBodyValkey) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateService(formats); err != nil { - res = append(res, err) - } - - if err := o.validateValkeyExporter(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *AddServiceOKBodyValkey) validateService(formats strfmt.Registry) error { - if swag.IsZero(o.Service) { // not required - return nil - } - - if o.Service != nil { - if err := o.Service.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "valkey" + "." + "service") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "valkey" + "." + "service") - } - - return err - } - } - - return nil -} - -func (o *AddServiceOKBodyValkey) validateValkeyExporter(formats strfmt.Registry) error { - if swag.IsZero(o.ValkeyExporter) { // not required - return nil - } - - if o.ValkeyExporter != nil { - if err := o.ValkeyExporter.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "valkey" + "." + "valkey_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "valkey" + "." + "valkey_exporter") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this add service OK body valkey based on the context it is used -func (o *AddServiceOKBodyValkey) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateService(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateValkeyExporter(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *AddServiceOKBodyValkey) contextValidateService(ctx context.Context, formats strfmt.Registry) error { - if o.Service != nil { - - if swag.IsZero(o.Service) { // not required - return nil - } - - if err := o.Service.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "valkey" + "." + "service") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "valkey" + "." + "service") - } - - return err - } - } - - return nil -} - -func (o *AddServiceOKBodyValkey) contextValidateValkeyExporter(ctx context.Context, formats strfmt.Registry) error { - if o.ValkeyExporter != nil { - - if swag.IsZero(o.ValkeyExporter) { // not required - return nil - } - - if err := o.ValkeyExporter.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("addServiceOk" + "." + "valkey" + "." + "valkey_exporter") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("addServiceOk" + "." + "valkey" + "." + "valkey_exporter") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *AddServiceOKBodyValkey) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddServiceOKBodyValkey) UnmarshalBinary(b []byte) error { - var res AddServiceOKBodyValkey - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddServiceOKBodyValkeyService ValkeyService represents a generic Valkey instance. -swagger:model AddServiceOKBodyValkeyService -*/ -type AddServiceOKBodyValkeyService struct { - // Unique randomly generated instance identifier. - ServiceID string `json:"service_id,omitempty"` - - // Unique across all Services user-defined name. - ServiceName string `json:"service_name,omitempty"` - - // Node identifier where this instance runs. - NodeID string `json:"node_id,omitempty"` - - // Access address (DNS name or IP). - // Address (and port) or socket is required. - Address string `json:"address,omitempty"` - - // Access port. - // Port is required when the address present. - Port int64 `json:"port,omitempty"` - - // Access unix socket. - // Address (and port) or socket is required. - Socket string `json:"socket,omitempty"` - - // Environment name. - Environment string `json:"environment,omitempty"` - - // Cluster name. - Cluster string `json:"cluster,omitempty"` - - // Replication set name. - ReplicationSet string `json:"replication_set,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // Valkey version. - Version string `json:"version,omitempty"` -} - -// Validate validates this add service OK body valkey service -func (o *AddServiceOKBodyValkeyService) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this add service OK body valkey service based on context it is used -func (o *AddServiceOKBodyValkeyService) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddServiceOKBodyValkeyService) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddServiceOKBodyValkeyService) UnmarshalBinary(b []byte) error { - var res AddServiceOKBodyValkeyService - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddServiceOKBodyValkeyValkeyExporter ValkeyExporter runs on Generic or Container Node and exposes Valkey Service metrics. -swagger:model AddServiceOKBodyValkeyValkeyExporter -*/ -type AddServiceOKBodyValkeyValkeyExporter struct { - // Unique randomly generated instance identifier. - AgentID string `json:"agent_id,omitempty"` - - // The pmm-agent identifier which runs this instance. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `json:"disabled,omitempty"` - - // Service identifier. - ServiceID string `json:"service_id,omitempty"` - - // Valkey username for scraping metrics. - Username string `json:"username,omitempty"` - - // Use TLS for database connections. - TLS bool `json:"tls,omitempty"` - - // Skip TLS certificate and hostname verification. - TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // True if exporter uses push metrics mode. - PushMetricsEnabled bool `json:"push_metrics_enabled,omitempty"` - - // 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"` - - // 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.validateStatus(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 addServiceOkBodyValkeyValkeyExporterTypeStatusPropEnum []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 { - addServiceOkBodyValkeyValkeyExporterTypeStatusPropEnum = append(addServiceOkBodyValkeyValkeyExporterTypeStatusPropEnum, v) - } -} - -const ( - - // AddServiceOKBodyValkeyValkeyExporterStatusAGENTSTATUSUNSPECIFIED captures enum value "AGENT_STATUS_UNSPECIFIED" - AddServiceOKBodyValkeyValkeyExporterStatusAGENTSTATUSUNSPECIFIED string = "AGENT_STATUS_UNSPECIFIED" - - // AddServiceOKBodyValkeyValkeyExporterStatusAGENTSTATUSSTARTING captures enum value "AGENT_STATUS_STARTING" - AddServiceOKBodyValkeyValkeyExporterStatusAGENTSTATUSSTARTING string = "AGENT_STATUS_STARTING" - - // AddServiceOKBodyValkeyValkeyExporterStatusAGENTSTATUSINITIALIZATIONERROR captures enum value "AGENT_STATUS_INITIALIZATION_ERROR" - AddServiceOKBodyValkeyValkeyExporterStatusAGENTSTATUSINITIALIZATIONERROR string = "AGENT_STATUS_INITIALIZATION_ERROR" - - // AddServiceOKBodyValkeyValkeyExporterStatusAGENTSTATUSRUNNING captures enum value "AGENT_STATUS_RUNNING" - AddServiceOKBodyValkeyValkeyExporterStatusAGENTSTATUSRUNNING string = "AGENT_STATUS_RUNNING" - - // AddServiceOKBodyValkeyValkeyExporterStatusAGENTSTATUSWAITING captures enum value "AGENT_STATUS_WAITING" - AddServiceOKBodyValkeyValkeyExporterStatusAGENTSTATUSWAITING string = "AGENT_STATUS_WAITING" - - // AddServiceOKBodyValkeyValkeyExporterStatusAGENTSTATUSSTOPPING captures enum value "AGENT_STATUS_STOPPING" - AddServiceOKBodyValkeyValkeyExporterStatusAGENTSTATUSSTOPPING string = "AGENT_STATUS_STOPPING" - - // AddServiceOKBodyValkeyValkeyExporterStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE" - AddServiceOKBodyValkeyValkeyExporterStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE" - - // AddServiceOKBodyValkeyValkeyExporterStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN" - AddServiceOKBodyValkeyValkeyExporterStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN" -) - -// prop value enum -func (o *AddServiceOKBodyValkeyValkeyExporter) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addServiceOkBodyValkeyValkeyExporterTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddServiceOKBodyValkeyValkeyExporter) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required - return nil - } - - // value enum - if err := o.validateStatusEnum("addServiceOk"+"."+"valkey"+"."+"valkey_exporter"+"."+"status", "body", *o.Status); err != nil { - return err - } - - 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 - - if err := o.contextValidateMetricsResolutions(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *AddServiceOKBodyValkeyValkeyExporter) 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 { - 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 -} - -// MarshalBinary interface implementation -func (o *AddServiceOKBodyValkeyValkeyExporter) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddServiceOKBodyValkeyValkeyExporter) UnmarshalBinary(b []byte) error { - var res AddServiceOKBodyValkeyValkeyExporter - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddServiceOKBodyValkeyValkeyExporterMetricsResolutions MetricsResolutions represents Prometheus exporters metrics resolutions. -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"` - - // Medium resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Mr string `json:"mr,omitempty"` - - // Low resolution. In JSON should be represented as a string with number of seconds with `s` suffix. - Lr string `json:"lr,omitempty"` -} - -// Validate validates this add service OK body valkey valkey exporter metrics resolutions -func (o *AddServiceOKBodyValkeyValkeyExporterMetricsResolutions) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this add service OK body valkey valkey exporter metrics resolutions based on context it is used -func (o *AddServiceOKBodyValkeyValkeyExporterMetricsResolutions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddServiceOKBodyValkeyValkeyExporterMetricsResolutions) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddServiceOKBodyValkeyValkeyExporterMetricsResolutions) UnmarshalBinary(b []byte) error { - var res AddServiceOKBodyValkeyValkeyExporterMetricsResolutions - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -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. - RunsOnNodeID string `json:"runs_on_node_id,omitempty"` - - // Node name on which a service and node is been running. - // Exactly one of these parameters should be present: node_id, node_name, add_node. - NodeName string `json:"node_name,omitempty"` - - // Node and Exporter access address (DNS name or IP). - // address should always be passed with add_node. - Address string `json:"address,omitempty"` - - // Unique across all Services user-defined name. Required. - ServiceName string `json:"service_name,omitempty"` - - // HTTP basic auth username for collecting metrics. - Username string `json:"username,omitempty"` - - // HTTP basic auth password for collecting metrics. - Password string `json:"password,omitempty"` - - // Scheme to generate URI to exporter metrics endpoints. - Scheme string `json:"scheme,omitempty"` - - // Path under which metrics are exposed, used to generate URI. - MetricsPath string `json:"metrics_path,omitempty"` - - // Listen port for scraping metrics. - ListenPort int64 `json:"listen_port,omitempty"` - - // Node identifier on which an external service is been running. - // node_id should always be passed with runs_on_node_id. - NodeID string `json:"node_id,omitempty"` - - // Environment name. - Environment string `json:"environment,omitempty"` - - // Cluster name. - Cluster string `json:"cluster,omitempty"` - - // Replication set name. - ReplicationSet string `json:"replication_set,omitempty"` - - // Custom user-assigned labels for Service. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // 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"` - - // Skip TLS certificate and hostname validation. - TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - - // add node - AddNode *AddServiceParamsBodyExternalAddNode `json:"add_node,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 { - 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 addServiceParamsBodyExternalTypeMetricsModePropEnum []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 { - addServiceParamsBodyExternalTypeMetricsModePropEnum = append(addServiceParamsBodyExternalTypeMetricsModePropEnum, v) - } -} - -const ( - - // AddServiceParamsBodyExternalMetricsModeMETRICSMODEUNSPECIFIED captures enum value "METRICS_MODE_UNSPECIFIED" - AddServiceParamsBodyExternalMetricsModeMETRICSMODEUNSPECIFIED string = "METRICS_MODE_UNSPECIFIED" - - // AddServiceParamsBodyExternalMetricsModeMETRICSMODEPULL captures enum value "METRICS_MODE_PULL" - AddServiceParamsBodyExternalMetricsModeMETRICSMODEPULL string = "METRICS_MODE_PULL" - - // AddServiceParamsBodyExternalMetricsModeMETRICSMODEPUSH captures enum value "METRICS_MODE_PUSH" - AddServiceParamsBodyExternalMetricsModeMETRICSMODEPUSH string = "METRICS_MODE_PUSH" -) - -// prop value enum -func (o *AddServiceParamsBodyExternal) validateMetricsModeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addServiceParamsBodyExternalTypeMetricsModePropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddServiceParamsBodyExternal) validateMetricsMode(formats strfmt.Registry) error { - if swag.IsZero(o.MetricsMode) { // not required - return nil - } - - // value enum - if err := o.validateMetricsModeEnum("body"+"."+"external"+"."+"metrics_mode", "body", *o.MetricsMode); err != nil { - return err - } - - 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 - - if err := o.contextValidateAddNode(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *AddServiceParamsBodyExternal) contextValidateAddNode(ctx context.Context, formats strfmt.Registry) error { - if o.AddNode != nil { - - if swag.IsZero(o.AddNode) { // not required - return nil - } - - if err := o.AddNode.ContextValidate(ctx, 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 -} - -// MarshalBinary interface implementation -func (o *AddServiceParamsBodyExternal) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddServiceParamsBodyExternal) UnmarshalBinary(b []byte) error { - var res AddServiceParamsBodyExternal - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddServiceParamsBodyExternalAddNode AddNodeParams holds node params and is used to add new node to inventory while adding new service. -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"` - - // Linux machine-id. - MachineID string `json:"machine_id,omitempty"` - - // Linux distribution name and version. - Distro string `json:"distro,omitempty"` - - // Container identifier. If specified, must be a unique Docker container identifier. - ContainerID string `json:"container_id,omitempty"` - - // Container name. - ContainerName string `json:"container_name,omitempty"` - - // Node model. - NodeModel string `json:"node_model,omitempty"` - - // Node region. - Region string `json:"region,omitempty"` - - // Node availability zone. - Az string `json:"az,omitempty"` - - // Custom user-assigned labels for Node. - CustomLabels map[string]string `json:"custom_labels,omitempty"` -} - -// Validate validates this add service params body external add node -func (o *AddServiceParamsBodyExternalAddNode) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateNodeType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var addServiceParamsBodyExternalAddNodeTypeNodeTypePropEnum []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 { - panic(err) - } - for _, v := range res { - addServiceParamsBodyExternalAddNodeTypeNodeTypePropEnum = append(addServiceParamsBodyExternalAddNodeTypeNodeTypePropEnum, v) - } -} - -const ( - - // AddServiceParamsBodyExternalAddNodeNodeTypeNODETYPEUNSPECIFIED captures enum value "NODE_TYPE_UNSPECIFIED" - AddServiceParamsBodyExternalAddNodeNodeTypeNODETYPEUNSPECIFIED string = "NODE_TYPE_UNSPECIFIED" - - // AddServiceParamsBodyExternalAddNodeNodeTypeNODETYPEGENERICNODE captures enum value "NODE_TYPE_GENERIC_NODE" - AddServiceParamsBodyExternalAddNodeNodeTypeNODETYPEGENERICNODE string = "NODE_TYPE_GENERIC_NODE" - - // AddServiceParamsBodyExternalAddNodeNodeTypeNODETYPECONTAINERNODE captures enum value "NODE_TYPE_CONTAINER_NODE" - AddServiceParamsBodyExternalAddNodeNodeTypeNODETYPECONTAINERNODE string = "NODE_TYPE_CONTAINER_NODE" - - // AddServiceParamsBodyExternalAddNodeNodeTypeNODETYPEREMOTENODE captures enum value "NODE_TYPE_REMOTE_NODE" - AddServiceParamsBodyExternalAddNodeNodeTypeNODETYPEREMOTENODE string = "NODE_TYPE_REMOTE_NODE" - - // AddServiceParamsBodyExternalAddNodeNodeTypeNODETYPEREMOTERDSNODE captures enum value "NODE_TYPE_REMOTE_RDS_NODE" - AddServiceParamsBodyExternalAddNodeNodeTypeNODETYPEREMOTERDSNODE string = "NODE_TYPE_REMOTE_RDS_NODE" - - // AddServiceParamsBodyExternalAddNodeNodeTypeNODETYPEREMOTEAZUREDATABASENODE captures enum value "NODE_TYPE_REMOTE_AZURE_DATABASE_NODE" - AddServiceParamsBodyExternalAddNodeNodeTypeNODETYPEREMOTEAZUREDATABASENODE string = "NODE_TYPE_REMOTE_AZURE_DATABASE_NODE" -) - -// prop value enum -func (o *AddServiceParamsBodyExternalAddNode) validateNodeTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addServiceParamsBodyExternalAddNodeTypeNodeTypePropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddServiceParamsBodyExternalAddNode) validateNodeType(formats strfmt.Registry) error { - if swag.IsZero(o.NodeType) { // not required - return nil - } - - // value enum - if err := o.validateNodeTypeEnum("body"+"."+"external"+"."+"add_node"+"."+"node_type", "body", *o.NodeType); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this add service params body external add node based on context it is used -func (o *AddServiceParamsBodyExternalAddNode) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddServiceParamsBodyExternalAddNode) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddServiceParamsBodyExternalAddNode) UnmarshalBinary(b []byte) error { - var res AddServiceParamsBodyExternalAddNode - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -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"` - - // Node name on which a service and node is been running. - // Exactly one of these parameters should be present: node_id, node_name, add_node. - NodeName string `json:"node_name,omitempty"` - - // Node and Exporter access address (DNS name or IP). - // address always should be passed with add_node. - Address string `json:"address,omitempty"` - - // Unique across all Services user-defined name. Required. - ServiceName string `json:"service_name,omitempty"` - - // HTTP basic auth username for collecting metrics. - Username string `json:"username,omitempty"` - - // HTTP basic auth password for collecting metrics. - Password string `json:"password,omitempty"` - - // Scheme to generate URI to exporter metrics endpoints. - Scheme string `json:"scheme,omitempty"` - - // Path under which metrics are exposed, used to generate URI. - MetricsPath string `json:"metrics_path,omitempty"` - - // Listen port for scraping metrics. - ListenPort int64 `json:"listen_port,omitempty"` - - // Environment name. - Environment string `json:"environment,omitempty"` - - // Cluster name. - Cluster string `json:"cluster,omitempty"` - - // Replication set name. - 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"` - - // Skip connection check. - SkipConnectionCheck bool `json:"skip_connection_check,omitempty"` - - // Skip TLS certificate and hostname validation. - TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - - // add node - AddNode *AddServiceParamsBodyHaproxyAddNode `json:"add_node,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 { - 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 addServiceParamsBodyHaproxyTypeMetricsModePropEnum []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 { - addServiceParamsBodyHaproxyTypeMetricsModePropEnum = append(addServiceParamsBodyHaproxyTypeMetricsModePropEnum, v) - } -} - -const ( - - // AddServiceParamsBodyHaproxyMetricsModeMETRICSMODEUNSPECIFIED captures enum value "METRICS_MODE_UNSPECIFIED" - AddServiceParamsBodyHaproxyMetricsModeMETRICSMODEUNSPECIFIED string = "METRICS_MODE_UNSPECIFIED" - - // AddServiceParamsBodyHaproxyMetricsModeMETRICSMODEPULL captures enum value "METRICS_MODE_PULL" - AddServiceParamsBodyHaproxyMetricsModeMETRICSMODEPULL string = "METRICS_MODE_PULL" - - // AddServiceParamsBodyHaproxyMetricsModeMETRICSMODEPUSH captures enum value "METRICS_MODE_PUSH" - AddServiceParamsBodyHaproxyMetricsModeMETRICSMODEPUSH string = "METRICS_MODE_PUSH" -) - -// prop value enum -func (o *AddServiceParamsBodyHaproxy) validateMetricsModeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addServiceParamsBodyHaproxyTypeMetricsModePropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddServiceParamsBodyHaproxy) validateMetricsMode(formats strfmt.Registry) error { - if swag.IsZero(o.MetricsMode) { // not required - return nil - } - - // value enum - if err := o.validateMetricsModeEnum("body"+"."+"haproxy"+"."+"metrics_mode", "body", *o.MetricsMode); err != nil { - return err - } - - 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 - - if err := o.contextValidateAddNode(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *AddServiceParamsBodyHaproxy) contextValidateAddNode(ctx context.Context, formats strfmt.Registry) error { - if o.AddNode != nil { - - if swag.IsZero(o.AddNode) { // not required - return nil - } - - if err := o.AddNode.ContextValidate(ctx, 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 -} - -// MarshalBinary interface implementation -func (o *AddServiceParamsBodyHaproxy) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddServiceParamsBodyHaproxy) UnmarshalBinary(b []byte) error { - var res AddServiceParamsBodyHaproxy - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddServiceParamsBodyHaproxyAddNode AddNodeParams holds node params and is used to add new node to inventory while adding new service. -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"` - - // Linux machine-id. - MachineID string `json:"machine_id,omitempty"` - - // Linux distribution name and version. - Distro string `json:"distro,omitempty"` - - // Container identifier. If specified, must be a unique Docker container identifier. - ContainerID string `json:"container_id,omitempty"` - - // Container name. - ContainerName string `json:"container_name,omitempty"` - - // Node model. - NodeModel string `json:"node_model,omitempty"` - - // Node region. - Region string `json:"region,omitempty"` - - // Node availability zone. - Az string `json:"az,omitempty"` - - // Custom user-assigned labels for Node. - CustomLabels map[string]string `json:"custom_labels,omitempty"` -} - -// Validate validates this add service params body haproxy add node -func (o *AddServiceParamsBodyHaproxyAddNode) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateNodeType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var addServiceParamsBodyHaproxyAddNodeTypeNodeTypePropEnum []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 { - panic(err) - } - for _, v := range res { - addServiceParamsBodyHaproxyAddNodeTypeNodeTypePropEnum = append(addServiceParamsBodyHaproxyAddNodeTypeNodeTypePropEnum, v) - } -} - -const ( - - // AddServiceParamsBodyHaproxyAddNodeNodeTypeNODETYPEUNSPECIFIED captures enum value "NODE_TYPE_UNSPECIFIED" - AddServiceParamsBodyHaproxyAddNodeNodeTypeNODETYPEUNSPECIFIED string = "NODE_TYPE_UNSPECIFIED" - - // AddServiceParamsBodyHaproxyAddNodeNodeTypeNODETYPEGENERICNODE captures enum value "NODE_TYPE_GENERIC_NODE" - AddServiceParamsBodyHaproxyAddNodeNodeTypeNODETYPEGENERICNODE string = "NODE_TYPE_GENERIC_NODE" - - // AddServiceParamsBodyHaproxyAddNodeNodeTypeNODETYPECONTAINERNODE captures enum value "NODE_TYPE_CONTAINER_NODE" - AddServiceParamsBodyHaproxyAddNodeNodeTypeNODETYPECONTAINERNODE string = "NODE_TYPE_CONTAINER_NODE" - - // AddServiceParamsBodyHaproxyAddNodeNodeTypeNODETYPEREMOTENODE captures enum value "NODE_TYPE_REMOTE_NODE" - AddServiceParamsBodyHaproxyAddNodeNodeTypeNODETYPEREMOTENODE string = "NODE_TYPE_REMOTE_NODE" - - // AddServiceParamsBodyHaproxyAddNodeNodeTypeNODETYPEREMOTERDSNODE captures enum value "NODE_TYPE_REMOTE_RDS_NODE" - AddServiceParamsBodyHaproxyAddNodeNodeTypeNODETYPEREMOTERDSNODE string = "NODE_TYPE_REMOTE_RDS_NODE" - - // AddServiceParamsBodyHaproxyAddNodeNodeTypeNODETYPEREMOTEAZUREDATABASENODE captures enum value "NODE_TYPE_REMOTE_AZURE_DATABASE_NODE" - AddServiceParamsBodyHaproxyAddNodeNodeTypeNODETYPEREMOTEAZUREDATABASENODE string = "NODE_TYPE_REMOTE_AZURE_DATABASE_NODE" -) - -// prop value enum -func (o *AddServiceParamsBodyHaproxyAddNode) validateNodeTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addServiceParamsBodyHaproxyAddNodeTypeNodeTypePropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddServiceParamsBodyHaproxyAddNode) validateNodeType(formats strfmt.Registry) error { - if swag.IsZero(o.NodeType) { // not required - return nil - } - - // value enum - if err := o.validateNodeTypeEnum("body"+"."+"haproxy"+"."+"add_node"+"."+"node_type", "body", *o.NodeType); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this add service params body haproxy add node based on context it is used -func (o *AddServiceParamsBodyHaproxyAddNode) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddServiceParamsBodyHaproxyAddNode) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddServiceParamsBodyHaproxyAddNode) UnmarshalBinary(b []byte) error { - var res AddServiceParamsBodyHaproxyAddNode - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -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"` - - // Node name on which a service is been running. - // Exactly one of these parameters should be present: node_id, node_name, add_node. - NodeName string `json:"node_name,omitempty"` - - // Unique across all Services user-defined name. Required. - ServiceName string `json:"service_name,omitempty"` - - // Node and Service access address (DNS name or IP). - // Address (and port) or socket is required. - Address string `json:"address,omitempty"` - - // Service Access port. - // Port is required when the address present. - Port int64 `json:"port,omitempty"` - - // Service Access socket. - // Address (and port) or socket is required. - Socket string `json:"socket,omitempty"` - - // The "pmm-agent" identifier which should run agents. Required. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Environment name. - Environment string `json:"environment,omitempty"` - - // Cluster name. - Cluster string `json:"cluster,omitempty"` - - // Replication set name. - ReplicationSet string `json:"replication_set,omitempty"` - - // MongoDB username for exporter and QAN agent access. - Username string `json:"username,omitempty"` - - // MongoDB password for exporter and QAN agent access. - Password string `json:"password,omitempty"` - - // If true, adds qan-mongodb-profiler-agent for provided service. - QANMongodbProfiler bool `json:"qan_mongodb_profiler,omitempty"` - - // If true, adds qan-mongodb-mongolog-agent for provided service. - QANMongodbMongolog bool `json:"qan_mongodb_mongolog,omitempty"` - - // Custom user-assigned labels for Service. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // Skip connection check. - SkipConnectionCheck bool `json:"skip_connection_check,omitempty"` - - // Use TLS for database connections. - TLS bool `json:"tls,omitempty"` - - // Skip TLS certificate and hostname validation. - TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - - // Client certificate and key. - TLSCertificateKey string `json:"tls_certificate_key,omitempty"` - - // Password for decrypting tls_certificate_key. - TLSCertificateKeyFilePassword string `json:"tls_certificate_key_file_password,omitempty"` - - // Certificate Authority certificate chain. - TLSCa string `json:"tls_ca,omitempty"` - - // 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"` - - // Authentication mechanism. - // See https://docs.mongodb.com/manual/reference/connection-string/#mongodb-urioption-urioption.authMechanism - // for details. - AuthenticationMechanism string `json:"authentication_mechanism,omitempty"` - - // Authentication database. - AuthenticationDatabase string `json:"authentication_database,omitempty"` - - // Custom password for exporter endpoint /metrics. - AgentPassword string `json:"agent_password,omitempty"` - - // List of collections 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 - 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"` - - // add node - AddNode *AddServiceParamsBodyMongodbAddNode `json:"add_node,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 { - 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 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 - } - - // value enum - if err := o.validateMetricsModeEnum("body"+"."+"mongodb"+"."+"metrics_mode", "body", *o.MetricsMode); err != nil { - return err - } - - return nil -} - -var addServiceParamsBodyMongodbTypeLogLevelPropEnum []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 { - addServiceParamsBodyMongodbTypeLogLevelPropEnum = append(addServiceParamsBodyMongodbTypeLogLevelPropEnum, v) - } -} - -const ( - - // AddServiceParamsBodyMongodbLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - AddServiceParamsBodyMongodbLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // AddServiceParamsBodyMongodbLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - AddServiceParamsBodyMongodbLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // AddServiceParamsBodyMongodbLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - AddServiceParamsBodyMongodbLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // AddServiceParamsBodyMongodbLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - AddServiceParamsBodyMongodbLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // AddServiceParamsBodyMongodbLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - AddServiceParamsBodyMongodbLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // AddServiceParamsBodyMongodbLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - AddServiceParamsBodyMongodbLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -func (o *AddServiceParamsBodyMongodb) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addServiceParamsBodyMongodbTypeLogLevelPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddServiceParamsBodyMongodb) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("body"+"."+"mongodb"+"."+"log_level", "body", *o.LogLevel); err != nil { - return err - } - - return nil -} - -func (o *AddServiceParamsBodyMongodb) 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" + "." + "mongodb" + "." + "add_node") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "mongodb" + "." + "add_node") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this add service params body mongodb based on the context it is used -func (o *AddServiceParamsBodyMongodb) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateAddNode(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *AddServiceParamsBodyMongodb) contextValidateAddNode(ctx context.Context, formats strfmt.Registry) error { - if o.AddNode != nil { - - if swag.IsZero(o.AddNode) { // not required - return nil - } - - if err := o.AddNode.ContextValidate(ctx, 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 -} - -// MarshalBinary interface implementation -func (o *AddServiceParamsBodyMongodb) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddServiceParamsBodyMongodb) UnmarshalBinary(b []byte) error { - var res AddServiceParamsBodyMongodb - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddServiceParamsBodyMongodbAddNode AddNodeParams holds node params and is used to add new node to inventory while adding new service. -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"` - - // Linux machine-id. - MachineID string `json:"machine_id,omitempty"` - - // Linux distribution name and version. - Distro string `json:"distro,omitempty"` - - // Container identifier. If specified, must be a unique Docker container identifier. - ContainerID string `json:"container_id,omitempty"` - - // Container name. - ContainerName string `json:"container_name,omitempty"` - - // Node model. - NodeModel string `json:"node_model,omitempty"` - - // Node region. - Region string `json:"region,omitempty"` - - // Node availability zone. - Az string `json:"az,omitempty"` - - // Custom user-assigned labels for Node. - CustomLabels map[string]string `json:"custom_labels,omitempty"` -} - -// Validate validates this add service params body mongodb add node -func (o *AddServiceParamsBodyMongodbAddNode) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateNodeType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var addServiceParamsBodyMongodbAddNodeTypeNodeTypePropEnum []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 { - panic(err) - } - for _, v := range res { - addServiceParamsBodyMongodbAddNodeTypeNodeTypePropEnum = append(addServiceParamsBodyMongodbAddNodeTypeNodeTypePropEnum, v) - } -} - -const ( - - // AddServiceParamsBodyMongodbAddNodeNodeTypeNODETYPEUNSPECIFIED captures enum value "NODE_TYPE_UNSPECIFIED" - AddServiceParamsBodyMongodbAddNodeNodeTypeNODETYPEUNSPECIFIED string = "NODE_TYPE_UNSPECIFIED" - - // AddServiceParamsBodyMongodbAddNodeNodeTypeNODETYPEGENERICNODE captures enum value "NODE_TYPE_GENERIC_NODE" - AddServiceParamsBodyMongodbAddNodeNodeTypeNODETYPEGENERICNODE string = "NODE_TYPE_GENERIC_NODE" - - // AddServiceParamsBodyMongodbAddNodeNodeTypeNODETYPECONTAINERNODE captures enum value "NODE_TYPE_CONTAINER_NODE" - AddServiceParamsBodyMongodbAddNodeNodeTypeNODETYPECONTAINERNODE string = "NODE_TYPE_CONTAINER_NODE" - - // AddServiceParamsBodyMongodbAddNodeNodeTypeNODETYPEREMOTENODE captures enum value "NODE_TYPE_REMOTE_NODE" - AddServiceParamsBodyMongodbAddNodeNodeTypeNODETYPEREMOTENODE string = "NODE_TYPE_REMOTE_NODE" - - // AddServiceParamsBodyMongodbAddNodeNodeTypeNODETYPEREMOTERDSNODE captures enum value "NODE_TYPE_REMOTE_RDS_NODE" - AddServiceParamsBodyMongodbAddNodeNodeTypeNODETYPEREMOTERDSNODE string = "NODE_TYPE_REMOTE_RDS_NODE" - - // AddServiceParamsBodyMongodbAddNodeNodeTypeNODETYPEREMOTEAZUREDATABASENODE captures enum value "NODE_TYPE_REMOTE_AZURE_DATABASE_NODE" - AddServiceParamsBodyMongodbAddNodeNodeTypeNODETYPEREMOTEAZUREDATABASENODE string = "NODE_TYPE_REMOTE_AZURE_DATABASE_NODE" -) - -// prop value enum -func (o *AddServiceParamsBodyMongodbAddNode) validateNodeTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addServiceParamsBodyMongodbAddNodeTypeNodeTypePropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddServiceParamsBodyMongodbAddNode) validateNodeType(formats strfmt.Registry) error { - if swag.IsZero(o.NodeType) { // not required - return nil - } - - // value enum - if err := o.validateNodeTypeEnum("body"+"."+"mongodb"+"."+"add_node"+"."+"node_type", "body", *o.NodeType); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this add service params body mongodb add node based on context it is used -func (o *AddServiceParamsBodyMongodbAddNode) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddServiceParamsBodyMongodbAddNode) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddServiceParamsBodyMongodbAddNode) UnmarshalBinary(b []byte) error { - var res AddServiceParamsBodyMongodbAddNode - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -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"` - - // Node name on which a service is been running. - // Exactly one of these parameters should be present: node_id, node_name, add_node. - NodeName string `json:"node_name,omitempty"` - - // Unique across all Services user-defined name. Required. - ServiceName string `json:"service_name,omitempty"` - - // Node and Service access address (DNS name or IP). - // Address (and port) or socket is required. - Address string `json:"address,omitempty"` - - // Service Access port. - // Port is required when the address present. - Port int64 `json:"port,omitempty"` - - // Service Access socket. - // Address (and port) or socket is required. - Socket string `json:"socket,omitempty"` - - // The "pmm-agent" identifier which should run agents. Required. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Environment name. - Environment string `json:"environment,omitempty"` - - // Cluster name. - Cluster string `json:"cluster,omitempty"` - - // Replication set name. - ReplicationSet string `json:"replication_set,omitempty"` - - // MySQL username for scraping metrics. - Username string `json:"username,omitempty"` - - // MySQL password for scraping metrics. - Password string `json:"password,omitempty"` - - // If true, adds qan-mysql-perfschema-agent for provided service. - QANMysqlPerfschema bool `json:"qan_mysql_perfschema,omitempty"` - - // If true, adds qan-mysql-slowlog-agent for provided service. - QANMysqlSlowlog bool `json:"qan_mysql_slowlog,omitempty"` - - // Custom user-assigned labels for Service. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // Skip connection check. - SkipConnectionCheck bool `json:"skip_connection_check,omitempty"` - - // Disable parsing comments from queries and showing them in QAN. - DisableCommentsParsing bool `json:"disable_comments_parsing,omitempty"` - - // Limit query length in QAN (default: server-defined; -1: no limit). - MaxQueryLength int32 `json:"max_query_length,omitempty"` - - // Disable query examples. - DisableQueryExamples bool `json:"disable_query_examples,omitempty"` - - // If qan-mysql-slowlog-agent is added, slowlog file is rotated at this size if > 0. - // If zero, server's default value is used. - // Use negative value to disable rotation. - MaxSlowlogFileSize string `json:"max_slowlog_file_size,omitempty"` - - // Use TLS for database connections. - TLS bool `json:"tls,omitempty"` - - // Skip TLS certificate and hostname validation. - TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - - // Certificate Authority certificate chain. - TLSCa string `json:"tls_ca,omitempty"` - - // Client certificate. - TLSCert string `json:"tls_cert,omitempty"` - - // Password for decrypting tls_cert. - TLSKey string `json:"tls_key,omitempty"` - - // Tablestats group collectors will be disabled if there are more than that number of tables. - // If zero, server's default value is used. - // 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"` - - // extra DSN parameters to be used for connecting to MySQL. - ExtraDsnParams map[string]string `json:"extra_dsn_params,omitempty"` - - // add node - AddNode *AddServiceParamsBodyMysqlAddNode `json:"add_node,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 { - 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 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 - } - - // value enum - if err := o.validateMetricsModeEnum("body"+"."+"mysql"+"."+"metrics_mode", "body", *o.MetricsMode); err != nil { - return err - } - - return nil -} - -var addServiceParamsBodyMysqlTypeLogLevelPropEnum []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 { - addServiceParamsBodyMysqlTypeLogLevelPropEnum = append(addServiceParamsBodyMysqlTypeLogLevelPropEnum, v) - } -} - -const ( - - // AddServiceParamsBodyMysqlLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - AddServiceParamsBodyMysqlLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // AddServiceParamsBodyMysqlLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - AddServiceParamsBodyMysqlLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // AddServiceParamsBodyMysqlLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - AddServiceParamsBodyMysqlLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // AddServiceParamsBodyMysqlLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - AddServiceParamsBodyMysqlLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // AddServiceParamsBodyMysqlLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - AddServiceParamsBodyMysqlLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // AddServiceParamsBodyMysqlLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - AddServiceParamsBodyMysqlLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -func (o *AddServiceParamsBodyMysql) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addServiceParamsBodyMysqlTypeLogLevelPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddServiceParamsBodyMysql) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("body"+"."+"mysql"+"."+"log_level", "body", *o.LogLevel); err != nil { - return err - } - - return nil -} - -func (o *AddServiceParamsBodyMysql) 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" + "." + "mysql" + "." + "add_node") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "mysql" + "." + "add_node") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this add service params body mysql based on the context it is used -func (o *AddServiceParamsBodyMysql) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateAddNode(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *AddServiceParamsBodyMysql) contextValidateAddNode(ctx context.Context, formats strfmt.Registry) error { - if o.AddNode != nil { - - if swag.IsZero(o.AddNode) { // not required - return nil - } - - if err := o.AddNode.ContextValidate(ctx, 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 -} - -// MarshalBinary interface implementation -func (o *AddServiceParamsBodyMysql) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddServiceParamsBodyMysql) UnmarshalBinary(b []byte) error { - var res AddServiceParamsBodyMysql - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddServiceParamsBodyMysqlAddNode AddNodeParams holds node params and is used to add new node to inventory while adding new service. -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"` - - // Linux machine-id. - MachineID string `json:"machine_id,omitempty"` - - // Linux distribution name and version. - Distro string `json:"distro,omitempty"` - - // Container identifier. If specified, must be a unique Docker container identifier. - ContainerID string `json:"container_id,omitempty"` - - // Container name. - ContainerName string `json:"container_name,omitempty"` - - // Node model. - NodeModel string `json:"node_model,omitempty"` - - // Node region. - Region string `json:"region,omitempty"` - - // Node availability zone. - Az string `json:"az,omitempty"` - - // Custom user-assigned labels for Node. - CustomLabels map[string]string `json:"custom_labels,omitempty"` -} - -// Validate validates this add service params body mysql add node -func (o *AddServiceParamsBodyMysqlAddNode) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateNodeType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var addServiceParamsBodyMysqlAddNodeTypeNodeTypePropEnum []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 { - panic(err) - } - for _, v := range res { - addServiceParamsBodyMysqlAddNodeTypeNodeTypePropEnum = append(addServiceParamsBodyMysqlAddNodeTypeNodeTypePropEnum, v) - } -} - -const ( - - // AddServiceParamsBodyMysqlAddNodeNodeTypeNODETYPEUNSPECIFIED captures enum value "NODE_TYPE_UNSPECIFIED" - AddServiceParamsBodyMysqlAddNodeNodeTypeNODETYPEUNSPECIFIED string = "NODE_TYPE_UNSPECIFIED" - - // AddServiceParamsBodyMysqlAddNodeNodeTypeNODETYPEGENERICNODE captures enum value "NODE_TYPE_GENERIC_NODE" - AddServiceParamsBodyMysqlAddNodeNodeTypeNODETYPEGENERICNODE string = "NODE_TYPE_GENERIC_NODE" - - // AddServiceParamsBodyMysqlAddNodeNodeTypeNODETYPECONTAINERNODE captures enum value "NODE_TYPE_CONTAINER_NODE" - AddServiceParamsBodyMysqlAddNodeNodeTypeNODETYPECONTAINERNODE string = "NODE_TYPE_CONTAINER_NODE" - - // AddServiceParamsBodyMysqlAddNodeNodeTypeNODETYPEREMOTENODE captures enum value "NODE_TYPE_REMOTE_NODE" - AddServiceParamsBodyMysqlAddNodeNodeTypeNODETYPEREMOTENODE string = "NODE_TYPE_REMOTE_NODE" - - // AddServiceParamsBodyMysqlAddNodeNodeTypeNODETYPEREMOTERDSNODE captures enum value "NODE_TYPE_REMOTE_RDS_NODE" - AddServiceParamsBodyMysqlAddNodeNodeTypeNODETYPEREMOTERDSNODE string = "NODE_TYPE_REMOTE_RDS_NODE" - - // AddServiceParamsBodyMysqlAddNodeNodeTypeNODETYPEREMOTEAZUREDATABASENODE captures enum value "NODE_TYPE_REMOTE_AZURE_DATABASE_NODE" - AddServiceParamsBodyMysqlAddNodeNodeTypeNODETYPEREMOTEAZUREDATABASENODE string = "NODE_TYPE_REMOTE_AZURE_DATABASE_NODE" -) - -// prop value enum -func (o *AddServiceParamsBodyMysqlAddNode) validateNodeTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addServiceParamsBodyMysqlAddNodeTypeNodeTypePropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddServiceParamsBodyMysqlAddNode) validateNodeType(formats strfmt.Registry) error { - if swag.IsZero(o.NodeType) { // not required - return nil - } - - // value enum - if err := o.validateNodeTypeEnum("body"+"."+"mysql"+"."+"add_node"+"."+"node_type", "body", *o.NodeType); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this add service params body mysql add node based on context it is used -func (o *AddServiceParamsBodyMysqlAddNode) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddServiceParamsBodyMysqlAddNode) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddServiceParamsBodyMysqlAddNode) UnmarshalBinary(b []byte) error { - var res AddServiceParamsBodyMysqlAddNode - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -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"` - - // Node name on which a service is been running. - // Exactly one of these parameters should be present: node_id, node_name, add_node. - NodeName string `json:"node_name,omitempty"` - - // Unique across all Services user-defined name. Required. - ServiceName string `json:"service_name,omitempty"` - - // Node and Service access address (DNS name or IP). - // Address (and port) or socket is required. - Address string `json:"address,omitempty"` - - // Service Access port. - // Port is required when the address present. - Port int64 `json:"port,omitempty"` - - // Database name. - Database string `json:"database,omitempty"` - - // Service Access socket. - // Address (and port) or socket is required. - Socket string `json:"socket,omitempty"` - - // The "pmm-agent" identifier which should run agents. Required. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Environment name. - Environment string `json:"environment,omitempty"` - - // Cluster name. - Cluster string `json:"cluster,omitempty"` - - // Replication set name. - ReplicationSet string `json:"replication_set,omitempty"` - - // PostgreSQL username for scraping metrics. - Username string `json:"username,omitempty"` - - // PostgreSQL password for scraping metrics. - Password string `json:"password,omitempty"` - - // If true, adds qan-postgresql-pgstatements-agent for provided service. - QANPostgresqlPgstatementsAgent bool `json:"qan_postgresql_pgstatements_agent,omitempty"` - - // If true, adds qan-postgresql-pgstatmonitor-agent for provided service. - QANPostgresqlPgstatmonitorAgent bool `json:"qan_postgresql_pgstatmonitor_agent,omitempty"` - - // Limit query length in QAN (default: server-defined; -1: no limit). - MaxQueryLength int32 `json:"max_query_length,omitempty"` - - // Disable query examples. - DisableQueryExamples bool `json:"disable_query_examples,omitempty"` - - // Custom user-assigned labels for Service. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // Skip connection check. - SkipConnectionCheck bool `json:"skip_connection_check,omitempty"` - - // Disable parsing comments from queries and showing them in QAN. - DisableCommentsParsing bool `json:"disable_comments_parsing,omitempty"` - - // Use TLS for database connections. - TLS bool `json:"tls,omitempty"` - - // 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"` - - // TLS CA certificate. - TLSCa string `json:"tls_ca,omitempty"` - - // TLS Certifcate. - TLSCert string `json:"tls_cert,omitempty"` - - // TLS Certificate Key. - TLSKey string `json:"tls_key,omitempty"` - - // 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"` - - // Optionally expose the exporter process on all public interfaces - ExposeExporter bool `json:"expose_exporter,omitempty"` - - // Maximum number of connections that exporter can open to the database instance. - MaxExporterConnections int32 `json:"max_exporter_connections,omitempty"` - - // add node - AddNode *AddServiceParamsBodyPostgresqlAddNode `json:"add_node,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 { - 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 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 - } - - // value enum - if err := o.validateMetricsModeEnum("body"+"."+"postgresql"+"."+"metrics_mode", "body", *o.MetricsMode); err != nil { - return err - } - - return nil -} - -var addServiceParamsBodyPostgresqlTypeLogLevelPropEnum []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 { - addServiceParamsBodyPostgresqlTypeLogLevelPropEnum = append(addServiceParamsBodyPostgresqlTypeLogLevelPropEnum, v) - } -} - -const ( - - // AddServiceParamsBodyPostgresqlLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - AddServiceParamsBodyPostgresqlLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // AddServiceParamsBodyPostgresqlLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - AddServiceParamsBodyPostgresqlLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // AddServiceParamsBodyPostgresqlLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - AddServiceParamsBodyPostgresqlLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // AddServiceParamsBodyPostgresqlLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - AddServiceParamsBodyPostgresqlLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // AddServiceParamsBodyPostgresqlLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - AddServiceParamsBodyPostgresqlLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // AddServiceParamsBodyPostgresqlLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - AddServiceParamsBodyPostgresqlLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -func (o *AddServiceParamsBodyPostgresql) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addServiceParamsBodyPostgresqlTypeLogLevelPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddServiceParamsBodyPostgresql) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("body"+"."+"postgresql"+"."+"log_level", "body", *o.LogLevel); err != nil { - return err - } - - return nil -} - -func (o *AddServiceParamsBodyPostgresql) 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" + "." + "postgresql" + "." + "add_node") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "postgresql" + "." + "add_node") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this add service params body postgresql based on the context it is used -func (o *AddServiceParamsBodyPostgresql) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateAddNode(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *AddServiceParamsBodyPostgresql) contextValidateAddNode(ctx context.Context, formats strfmt.Registry) error { - if o.AddNode != nil { - - if swag.IsZero(o.AddNode) { // not required - return nil - } - - if err := o.AddNode.ContextValidate(ctx, 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 -} - -// MarshalBinary interface implementation -func (o *AddServiceParamsBodyPostgresql) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddServiceParamsBodyPostgresql) UnmarshalBinary(b []byte) error { - var res AddServiceParamsBodyPostgresql - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddServiceParamsBodyPostgresqlAddNode AddNodeParams holds node params and is used to add new node to inventory while adding new service. -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"` - - // Linux machine-id. - MachineID string `json:"machine_id,omitempty"` - - // Linux distribution name and version. - Distro string `json:"distro,omitempty"` - - // Container identifier. If specified, must be a unique Docker container identifier. - ContainerID string `json:"container_id,omitempty"` - - // Container name. - ContainerName string `json:"container_name,omitempty"` - - // Node model. - NodeModel string `json:"node_model,omitempty"` - - // Node region. - Region string `json:"region,omitempty"` - - // Node availability zone. - Az string `json:"az,omitempty"` - - // Custom user-assigned labels for Node. - CustomLabels map[string]string `json:"custom_labels,omitempty"` -} - -// Validate validates this add service params body postgresql add node -func (o *AddServiceParamsBodyPostgresqlAddNode) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateNodeType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var addServiceParamsBodyPostgresqlAddNodeTypeNodeTypePropEnum []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 { - panic(err) - } - for _, v := range res { - addServiceParamsBodyPostgresqlAddNodeTypeNodeTypePropEnum = append(addServiceParamsBodyPostgresqlAddNodeTypeNodeTypePropEnum, v) - } -} - -const ( - - // AddServiceParamsBodyPostgresqlAddNodeNodeTypeNODETYPEUNSPECIFIED captures enum value "NODE_TYPE_UNSPECIFIED" - AddServiceParamsBodyPostgresqlAddNodeNodeTypeNODETYPEUNSPECIFIED string = "NODE_TYPE_UNSPECIFIED" - - // AddServiceParamsBodyPostgresqlAddNodeNodeTypeNODETYPEGENERICNODE captures enum value "NODE_TYPE_GENERIC_NODE" - AddServiceParamsBodyPostgresqlAddNodeNodeTypeNODETYPEGENERICNODE string = "NODE_TYPE_GENERIC_NODE" - - // AddServiceParamsBodyPostgresqlAddNodeNodeTypeNODETYPECONTAINERNODE captures enum value "NODE_TYPE_CONTAINER_NODE" - AddServiceParamsBodyPostgresqlAddNodeNodeTypeNODETYPECONTAINERNODE string = "NODE_TYPE_CONTAINER_NODE" - - // AddServiceParamsBodyPostgresqlAddNodeNodeTypeNODETYPEREMOTENODE captures enum value "NODE_TYPE_REMOTE_NODE" - AddServiceParamsBodyPostgresqlAddNodeNodeTypeNODETYPEREMOTENODE string = "NODE_TYPE_REMOTE_NODE" - - // AddServiceParamsBodyPostgresqlAddNodeNodeTypeNODETYPEREMOTERDSNODE captures enum value "NODE_TYPE_REMOTE_RDS_NODE" - AddServiceParamsBodyPostgresqlAddNodeNodeTypeNODETYPEREMOTERDSNODE string = "NODE_TYPE_REMOTE_RDS_NODE" - - // AddServiceParamsBodyPostgresqlAddNodeNodeTypeNODETYPEREMOTEAZUREDATABASENODE captures enum value "NODE_TYPE_REMOTE_AZURE_DATABASE_NODE" - AddServiceParamsBodyPostgresqlAddNodeNodeTypeNODETYPEREMOTEAZUREDATABASENODE string = "NODE_TYPE_REMOTE_AZURE_DATABASE_NODE" -) - -// prop value enum -func (o *AddServiceParamsBodyPostgresqlAddNode) validateNodeTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addServiceParamsBodyPostgresqlAddNodeTypeNodeTypePropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddServiceParamsBodyPostgresqlAddNode) validateNodeType(formats strfmt.Registry) error { - if swag.IsZero(o.NodeType) { // not required - return nil - } - - // value enum - if err := o.validateNodeTypeEnum("body"+"."+"postgresql"+"."+"add_node"+"."+"node_type", "body", *o.NodeType); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this add service params body postgresql add node based on context it is used -func (o *AddServiceParamsBodyPostgresqlAddNode) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddServiceParamsBodyPostgresqlAddNode) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddServiceParamsBodyPostgresqlAddNode) UnmarshalBinary(b []byte) error { - var res AddServiceParamsBodyPostgresqlAddNode - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -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"` - - // Node name on which a service is been running. - // Exactly one of these parameters should be present: node_id, node_name, add_node. - NodeName string `json:"node_name,omitempty"` - - // Unique across all Services user-defined name. Required. - ServiceName string `json:"service_name,omitempty"` - - // Node and Service access address (DNS name or IP). - // Address (and port) or socket is required. - Address string `json:"address,omitempty"` - - // Service Access port. - // Port is required when the address present. - Port int64 `json:"port,omitempty"` - - // Service Access socket. - // Address (and port) or socket is required. - Socket string `json:"socket,omitempty"` - - // The "pmm-agent" identifier which should run agents. Required. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Environment name. - Environment string `json:"environment,omitempty"` - - // Cluster name. - Cluster string `json:"cluster,omitempty"` - - // Replication set name. - ReplicationSet string `json:"replication_set,omitempty"` - - // ProxySQL username for scraping metrics. - Username string `json:"username,omitempty"` - - // ProxySQL password for scraping metrics. - Password string `json:"password,omitempty"` - - // Custom user-assigned labels for Service. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // Skip connection check. - SkipConnectionCheck bool `json:"skip_connection_check,omitempty"` - - // Use TLS for database connections. - TLS bool `json:"tls,omitempty"` - - // 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 - -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 - return nil - } - - // value enum - if err := o.validateMetricsModeEnum("body"+"."+"proxysql"+"."+"metrics_mode", "body", *o.MetricsMode); err != nil { - return err - } - - return nil -} - -var addServiceParamsBodyProxysqlTypeLogLevelPropEnum []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 { - addServiceParamsBodyProxysqlTypeLogLevelPropEnum = append(addServiceParamsBodyProxysqlTypeLogLevelPropEnum, v) - } -} - -const ( - - // AddServiceParamsBodyProxysqlLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - AddServiceParamsBodyProxysqlLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // AddServiceParamsBodyProxysqlLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - AddServiceParamsBodyProxysqlLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // AddServiceParamsBodyProxysqlLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - AddServiceParamsBodyProxysqlLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // AddServiceParamsBodyProxysqlLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - AddServiceParamsBodyProxysqlLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // AddServiceParamsBodyProxysqlLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - AddServiceParamsBodyProxysqlLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // AddServiceParamsBodyProxysqlLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - AddServiceParamsBodyProxysqlLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -func (o *AddServiceParamsBodyProxysql) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addServiceParamsBodyProxysqlTypeLogLevelPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddServiceParamsBodyProxysql) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("body"+"."+"proxysql"+"."+"log_level", "body", *o.LogLevel); err != nil { - return err - } - - return nil -} - -func (o *AddServiceParamsBodyProxysql) 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" + "." + "proxysql" + "." + "add_node") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "proxysql" + "." + "add_node") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this add service params body proxysql based on the context it is used -func (o *AddServiceParamsBodyProxysql) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateAddNode(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *AddServiceParamsBodyProxysql) contextValidateAddNode(ctx context.Context, formats strfmt.Registry) error { - if o.AddNode != nil { - - if swag.IsZero(o.AddNode) { // not required - return nil - } - - if err := o.AddNode.ContextValidate(ctx, 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 -} - -// MarshalBinary interface implementation -func (o *AddServiceParamsBodyProxysql) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddServiceParamsBodyProxysql) UnmarshalBinary(b []byte) error { - var res AddServiceParamsBodyProxysql - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddServiceParamsBodyProxysqlAddNode AddNodeParams holds node params and is used to add new node to inventory while adding new service. -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"` - - // Linux machine-id. - MachineID string `json:"machine_id,omitempty"` - - // Linux distribution name and version. - Distro string `json:"distro,omitempty"` - - // Container identifier. If specified, must be a unique Docker container identifier. - ContainerID string `json:"container_id,omitempty"` - - // Container name. - ContainerName string `json:"container_name,omitempty"` - - // Node model. - NodeModel string `json:"node_model,omitempty"` - - // Node region. - Region string `json:"region,omitempty"` - - // Node availability zone. - Az string `json:"az,omitempty"` - - // Custom user-assigned labels for Node. - CustomLabels map[string]string `json:"custom_labels,omitempty"` -} - -// Validate validates this add service params body proxysql add node -func (o *AddServiceParamsBodyProxysqlAddNode) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateNodeType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var addServiceParamsBodyProxysqlAddNodeTypeNodeTypePropEnum []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 { - panic(err) - } - for _, v := range res { - addServiceParamsBodyProxysqlAddNodeTypeNodeTypePropEnum = append(addServiceParamsBodyProxysqlAddNodeTypeNodeTypePropEnum, v) - } -} - -const ( - - // AddServiceParamsBodyProxysqlAddNodeNodeTypeNODETYPEUNSPECIFIED captures enum value "NODE_TYPE_UNSPECIFIED" - AddServiceParamsBodyProxysqlAddNodeNodeTypeNODETYPEUNSPECIFIED string = "NODE_TYPE_UNSPECIFIED" - - // AddServiceParamsBodyProxysqlAddNodeNodeTypeNODETYPEGENERICNODE captures enum value "NODE_TYPE_GENERIC_NODE" - AddServiceParamsBodyProxysqlAddNodeNodeTypeNODETYPEGENERICNODE string = "NODE_TYPE_GENERIC_NODE" - - // AddServiceParamsBodyProxysqlAddNodeNodeTypeNODETYPECONTAINERNODE captures enum value "NODE_TYPE_CONTAINER_NODE" - AddServiceParamsBodyProxysqlAddNodeNodeTypeNODETYPECONTAINERNODE string = "NODE_TYPE_CONTAINER_NODE" - - // AddServiceParamsBodyProxysqlAddNodeNodeTypeNODETYPEREMOTENODE captures enum value "NODE_TYPE_REMOTE_NODE" - AddServiceParamsBodyProxysqlAddNodeNodeTypeNODETYPEREMOTENODE string = "NODE_TYPE_REMOTE_NODE" - - // AddServiceParamsBodyProxysqlAddNodeNodeTypeNODETYPEREMOTERDSNODE captures enum value "NODE_TYPE_REMOTE_RDS_NODE" - AddServiceParamsBodyProxysqlAddNodeNodeTypeNODETYPEREMOTERDSNODE string = "NODE_TYPE_REMOTE_RDS_NODE" - - // AddServiceParamsBodyProxysqlAddNodeNodeTypeNODETYPEREMOTEAZUREDATABASENODE captures enum value "NODE_TYPE_REMOTE_AZURE_DATABASE_NODE" - AddServiceParamsBodyProxysqlAddNodeNodeTypeNODETYPEREMOTEAZUREDATABASENODE string = "NODE_TYPE_REMOTE_AZURE_DATABASE_NODE" -) - -// prop value enum -func (o *AddServiceParamsBodyProxysqlAddNode) validateNodeTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addServiceParamsBodyProxysqlAddNodeTypeNodeTypePropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddServiceParamsBodyProxysqlAddNode) validateNodeType(formats strfmt.Registry) error { - if swag.IsZero(o.NodeType) { // not required - return nil - } - - // value enum - if err := o.validateNodeTypeEnum("body"+"."+"proxysql"+"."+"add_node"+"."+"node_type", "body", *o.NodeType); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this add service params body proxysql add node based on context it is used -func (o *AddServiceParamsBodyProxysqlAddNode) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddServiceParamsBodyProxysqlAddNode) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddServiceParamsBodyProxysqlAddNode) UnmarshalBinary(b []byte) error { - var res AddServiceParamsBodyProxysqlAddNode - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddServiceParamsBodyRDS add service params body RDS -swagger:model AddServiceParamsBodyRDS -*/ -type AddServiceParamsBodyRDS struct { - // AWS region. - Region string `json:"region,omitempty"` - - // AWS availability zone. - Az string `json:"az,omitempty"` - - // AWS instance ID. - InstanceID string `json:"instance_id,omitempty"` - - // AWS instance class. - NodeModel string `json:"node_model,omitempty"` - - // Address used to connect to it. - Address string `json:"address,omitempty"` - - // 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"` - - // Unique across all Nodes user-defined name. Defaults to AWS instance ID. - NodeName string `json:"node_name,omitempty"` - - // Unique across all Services user-defined name. Defaults to AWS instance ID. - ServiceName string `json:"service_name,omitempty"` - - // Environment name. - Environment string `json:"environment,omitempty"` - - // Cluster name. - Cluster string `json:"cluster,omitempty"` - - // Replication set name. - ReplicationSet string `json:"replication_set,omitempty"` - - // Username for scraping metrics. - Username string `json:"username,omitempty"` - - // Password for scraping metrics. - Password string `json:"password,omitempty"` - - // AWS Access key. - AWSAccessKey string `json:"aws_access_key,omitempty"` - - // AWS Secret key. - AWSSecretKey string `json:"aws_secret_key,omitempty"` - - // If true, adds rds_exporter. - RDSExporter bool `json:"rds_exporter,omitempty"` - - // If true, adds qan-mysql-perfschema-agent. - QANMysqlPerfschema bool `json:"qan_mysql_perfschema,omitempty"` - - // Custom user-assigned labels for Node and Service. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // Skip connection check. - SkipConnectionCheck bool `json:"skip_connection_check,omitempty"` - - // Use TLS for database connections. - TLS bool `json:"tls,omitempty"` - - // Skip TLS certificate and hostname validation. - TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - - // Disable query examples. - DisableQueryExamples bool `json:"disable_query_examples,omitempty"` - - // Tablestats group collectors will be disabled if there are more than that number of tables. - // If zero, server's default value is used. - // Use negative value to disable them. - TablestatsGroupTableLimit int32 `json:"tablestats_group_table_limit,omitempty"` - - // Disable basic metrics. - DisableBasicMetrics bool `json:"disable_basic_metrics,omitempty"` - - // 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"` - - // Custom password for exporter endpoint /metrics. - AgentPassword string `json:"agent_password,omitempty"` - - // Database name. - Database string `json:"database,omitempty"` - - // Limit of databases for auto-discovery. - AutoDiscoveryLimit int32 `json:"auto_discovery_limit,omitempty"` - - // Disable parsing comments from queries and showing them in QAN. - DisableCommentsParsing bool `json:"disable_comments_parsing,omitempty"` - - // Maximum number of exporter connections to PostgreSQL instance. - MaxPostgresqlExporterConnections int32 `json:"max_postgresql_exporter_connections,omitempty"` -} - -// Validate validates this add service params body RDS -func (o *AddServiceParamsBodyRDS) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateEngine(formats); err != nil { - res = append(res, err) - } - - if err := o.validateMetricsMode(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var addServiceParamsBodyRdsTypeEnginePropEnum []any - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["DISCOVER_RDS_ENGINE_UNSPECIFIED","DISCOVER_RDS_ENGINE_MYSQL","DISCOVER_RDS_ENGINE_POSTGRESQL"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - addServiceParamsBodyRdsTypeEnginePropEnum = append(addServiceParamsBodyRdsTypeEnginePropEnum, v) - } -} - -const ( - - // AddServiceParamsBodyRDSEngineDISCOVERRDSENGINEUNSPECIFIED captures enum value "DISCOVER_RDS_ENGINE_UNSPECIFIED" - AddServiceParamsBodyRDSEngineDISCOVERRDSENGINEUNSPECIFIED string = "DISCOVER_RDS_ENGINE_UNSPECIFIED" - - // AddServiceParamsBodyRDSEngineDISCOVERRDSENGINEMYSQL captures enum value "DISCOVER_RDS_ENGINE_MYSQL" - AddServiceParamsBodyRDSEngineDISCOVERRDSENGINEMYSQL string = "DISCOVER_RDS_ENGINE_MYSQL" - - // AddServiceParamsBodyRDSEngineDISCOVERRDSENGINEPOSTGRESQL captures enum value "DISCOVER_RDS_ENGINE_POSTGRESQL" - AddServiceParamsBodyRDSEngineDISCOVERRDSENGINEPOSTGRESQL string = "DISCOVER_RDS_ENGINE_POSTGRESQL" -) - -// prop value enum -func (o *AddServiceParamsBodyRDS) validateEngineEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addServiceParamsBodyRdsTypeEnginePropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddServiceParamsBodyRDS) validateEngine(formats strfmt.Registry) error { - if swag.IsZero(o.Engine) { // not required - return nil - } - - // value enum - if err := o.validateEngineEnum("body"+"."+"rds"+"."+"engine", "body", *o.Engine); err != nil { - return err - } - - return nil -} - -var addServiceParamsBodyRdsTypeMetricsModePropEnum []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 { - addServiceParamsBodyRdsTypeMetricsModePropEnum = append(addServiceParamsBodyRdsTypeMetricsModePropEnum, v) - } -} - -const ( - - // AddServiceParamsBodyRDSMetricsModeMETRICSMODEUNSPECIFIED captures enum value "METRICS_MODE_UNSPECIFIED" - AddServiceParamsBodyRDSMetricsModeMETRICSMODEUNSPECIFIED string = "METRICS_MODE_UNSPECIFIED" - - // AddServiceParamsBodyRDSMetricsModeMETRICSMODEPULL captures enum value "METRICS_MODE_PULL" - AddServiceParamsBodyRDSMetricsModeMETRICSMODEPULL string = "METRICS_MODE_PULL" - - // AddServiceParamsBodyRDSMetricsModeMETRICSMODEPUSH captures enum value "METRICS_MODE_PUSH" - AddServiceParamsBodyRDSMetricsModeMETRICSMODEPUSH string = "METRICS_MODE_PUSH" -) - -// prop value enum -func (o *AddServiceParamsBodyRDS) validateMetricsModeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addServiceParamsBodyRdsTypeMetricsModePropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddServiceParamsBodyRDS) validateMetricsMode(formats strfmt.Registry) error { - if swag.IsZero(o.MetricsMode) { // not required - return nil - } - - // value enum - if err := o.validateMetricsModeEnum("body"+"."+"rds"+"."+"metrics_mode", "body", *o.MetricsMode); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this add service params body RDS based on context it is used -func (o *AddServiceParamsBodyRDS) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddServiceParamsBodyRDS) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddServiceParamsBodyRDS) UnmarshalBinary(b []byte) error { - var res AddServiceParamsBodyRDS - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -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"` - - // Node name on which a service is running. - // Only one of these parameters should be present: node_id, node_name, add_node. - NodeName string `json:"node_name,omitempty"` - - // User-defined name, it is required and should be unique across all services. - ServiceName string `json:"service_name,omitempty"` - - // Node and Service access address (DNS name or IP). - // Address (and port) or socket is required. - Address string `json:"address,omitempty"` - - // Service access port. - // Port is required when the address is present. - Port int64 `json:"port,omitempty"` - - // Service access socket. - // Address (and port) or socket is required. - Socket string `json:"socket,omitempty"` - - // The "pmm-agent" identifier which should run agents. Required. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Valkey username for scraping metrics. - Username string `json:"username,omitempty"` - - // Valkey password for scraping metrics. - Password string `json:"password,omitempty"` - - // Environment name. - Environment string `json:"environment,omitempty"` - - // Cluster name. - Cluster string `json:"cluster,omitempty"` - - // Replication set name. - ReplicationSet string `json:"replication_set,omitempty"` - - // Custom user-assigned labels for Service. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // Skip connection check. - SkipConnectionCheck bool `json:"skip_connection_check,omitempty"` - - // Use TLS for connection. - TLS bool `json:"tls,omitempty"` - - // 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"` - - // TLS CA certificate. - TLSCa string `json:"tls_ca,omitempty"` - - // TLS Certifcate. - TLSCert string `json:"tls_cert,omitempty"` - - // TLS Certificate Key. - TLSKey string `json:"tls_key,omitempty"` - - // Custom password for exporter endpoint /metrics. - AgentPassword string `json:"agent_password,omitempty"` - - // add node - AddNode *AddServiceParamsBodyValkeyAddNode `json:"add_node,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 { - 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 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 - } - - // value enum - if err := o.validateMetricsModeEnum("body"+"."+"valkey"+"."+"metrics_mode", "body", *o.MetricsMode); err != nil { - return err - } - - return nil -} - -var addServiceParamsBodyValkeyTypeLogLevelPropEnum []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 { - addServiceParamsBodyValkeyTypeLogLevelPropEnum = append(addServiceParamsBodyValkeyTypeLogLevelPropEnum, v) - } -} - -const ( - - // AddServiceParamsBodyValkeyLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - AddServiceParamsBodyValkeyLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // AddServiceParamsBodyValkeyLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - AddServiceParamsBodyValkeyLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // AddServiceParamsBodyValkeyLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - AddServiceParamsBodyValkeyLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // AddServiceParamsBodyValkeyLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - AddServiceParamsBodyValkeyLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // AddServiceParamsBodyValkeyLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - AddServiceParamsBodyValkeyLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // AddServiceParamsBodyValkeyLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - AddServiceParamsBodyValkeyLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -func (o *AddServiceParamsBodyValkey) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addServiceParamsBodyValkeyTypeLogLevelPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddServiceParamsBodyValkey) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("body"+"."+"valkey"+"."+"log_level", "body", *o.LogLevel); err != nil { - return err - } - - return nil -} - -func (o *AddServiceParamsBodyValkey) 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" + "." + "valkey" + "." + "add_node") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "valkey" + "." + "add_node") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this add service params body valkey based on the context it is used -func (o *AddServiceParamsBodyValkey) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateAddNode(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *AddServiceParamsBodyValkey) contextValidateAddNode(ctx context.Context, formats strfmt.Registry) error { - if o.AddNode != nil { - - if swag.IsZero(o.AddNode) { // not required - return nil - } - - if err := o.AddNode.ContextValidate(ctx, 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 -} - -// MarshalBinary interface implementation -func (o *AddServiceParamsBodyValkey) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddServiceParamsBodyValkey) UnmarshalBinary(b []byte) error { - var res AddServiceParamsBodyValkey - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddServiceParamsBodyValkeyAddNode AddNodeParams holds node params and is used to add new node to inventory while adding new service. -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"` - - // Linux machine-id. - MachineID string `json:"machine_id,omitempty"` - - // Linux distribution name and version. - Distro string `json:"distro,omitempty"` - - // Container identifier. If specified, must be a unique Docker container identifier. - ContainerID string `json:"container_id,omitempty"` - - // Container name. - ContainerName string `json:"container_name,omitempty"` - - // Node model. - NodeModel string `json:"node_model,omitempty"` - - // Node region. - Region string `json:"region,omitempty"` - - // Node availability zone. - Az string `json:"az,omitempty"` - - // Custom user-assigned labels for Node. - CustomLabels map[string]string `json:"custom_labels,omitempty"` -} - -// Validate validates this add service params body valkey add node -func (o *AddServiceParamsBodyValkeyAddNode) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateNodeType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var addServiceParamsBodyValkeyAddNodeTypeNodeTypePropEnum []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 { - panic(err) - } - for _, v := range res { - addServiceParamsBodyValkeyAddNodeTypeNodeTypePropEnum = append(addServiceParamsBodyValkeyAddNodeTypeNodeTypePropEnum, v) - } -} - -const ( - - // AddServiceParamsBodyValkeyAddNodeNodeTypeNODETYPEUNSPECIFIED captures enum value "NODE_TYPE_UNSPECIFIED" - AddServiceParamsBodyValkeyAddNodeNodeTypeNODETYPEUNSPECIFIED string = "NODE_TYPE_UNSPECIFIED" - - // AddServiceParamsBodyValkeyAddNodeNodeTypeNODETYPEGENERICNODE captures enum value "NODE_TYPE_GENERIC_NODE" - AddServiceParamsBodyValkeyAddNodeNodeTypeNODETYPEGENERICNODE string = "NODE_TYPE_GENERIC_NODE" - - // AddServiceParamsBodyValkeyAddNodeNodeTypeNODETYPECONTAINERNODE captures enum value "NODE_TYPE_CONTAINER_NODE" - AddServiceParamsBodyValkeyAddNodeNodeTypeNODETYPECONTAINERNODE string = "NODE_TYPE_CONTAINER_NODE" - - // AddServiceParamsBodyValkeyAddNodeNodeTypeNODETYPEREMOTENODE captures enum value "NODE_TYPE_REMOTE_NODE" - AddServiceParamsBodyValkeyAddNodeNodeTypeNODETYPEREMOTENODE string = "NODE_TYPE_REMOTE_NODE" - - // AddServiceParamsBodyValkeyAddNodeNodeTypeNODETYPEREMOTERDSNODE captures enum value "NODE_TYPE_REMOTE_RDS_NODE" - AddServiceParamsBodyValkeyAddNodeNodeTypeNODETYPEREMOTERDSNODE string = "NODE_TYPE_REMOTE_RDS_NODE" - - // AddServiceParamsBodyValkeyAddNodeNodeTypeNODETYPEREMOTEAZUREDATABASENODE captures enum value "NODE_TYPE_REMOTE_AZURE_DATABASE_NODE" - AddServiceParamsBodyValkeyAddNodeNodeTypeNODETYPEREMOTEAZUREDATABASENODE string = "NODE_TYPE_REMOTE_AZURE_DATABASE_NODE" -) - -// prop value enum -func (o *AddServiceParamsBodyValkeyAddNode) validateNodeTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, addServiceParamsBodyValkeyAddNodeTypeNodeTypePropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AddServiceParamsBodyValkeyAddNode) validateNodeType(formats strfmt.Registry) error { - if swag.IsZero(o.NodeType) { // not required - return nil - } - - // value enum - if err := o.validateNodeTypeEnum("body"+"."+"valkey"+"."+"add_node"+"."+"node_type", "body", *o.NodeType); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this add service params body valkey add node based on context it is used -func (o *AddServiceParamsBodyValkeyAddNode) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddServiceParamsBodyValkeyAddNode) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddServiceParamsBodyValkeyAddNode) UnmarshalBinary(b []byte) error { - var res AddServiceParamsBodyValkeyAddNode - 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 deleted file mode 100644 index f5f9f75a926..00000000000 --- a/api/management/v1/json/client/management_service/discover_azure_database_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" -) - -// NewDiscoverAzureDatabaseParams creates a new DiscoverAzureDatabaseParams 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 NewDiscoverAzureDatabaseParams() *DiscoverAzureDatabaseParams { - return &DiscoverAzureDatabaseParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDiscoverAzureDatabaseParamsWithTimeout creates a new DiscoverAzureDatabaseParams object -// with the ability to set a timeout on a request. -func NewDiscoverAzureDatabaseParamsWithTimeout(timeout time.Duration) *DiscoverAzureDatabaseParams { - return &DiscoverAzureDatabaseParams{ - timeout: timeout, - } -} - -// NewDiscoverAzureDatabaseParamsWithContext creates a new DiscoverAzureDatabaseParams object -// with the ability to set a context for a request. -func NewDiscoverAzureDatabaseParamsWithContext(ctx context.Context) *DiscoverAzureDatabaseParams { - return &DiscoverAzureDatabaseParams{ - Context: ctx, - } -} - -// NewDiscoverAzureDatabaseParamsWithHTTPClient creates a new DiscoverAzureDatabaseParams object -// with the ability to set a custom HTTPClient for a request. -func NewDiscoverAzureDatabaseParamsWithHTTPClient(client *http.Client) *DiscoverAzureDatabaseParams { - return &DiscoverAzureDatabaseParams{ - HTTPClient: client, - } -} - -/* -DiscoverAzureDatabaseParams contains all the parameters to send to the API endpoint - - for the discover azure database operation. - - Typically these are written to a http.Request. -*/ -type DiscoverAzureDatabaseParams struct { - /* Body. - - DiscoverAzureDatabaseRequest discover azure databases request. - */ - Body DiscoverAzureDatabaseBody - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the discover azure database params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DiscoverAzureDatabaseParams) WithDefaults() *DiscoverAzureDatabaseParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the discover azure database params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DiscoverAzureDatabaseParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the discover azure database params -func (o *DiscoverAzureDatabaseParams) WithTimeout(timeout time.Duration) *DiscoverAzureDatabaseParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the discover azure database params -func (o *DiscoverAzureDatabaseParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the discover azure database params -func (o *DiscoverAzureDatabaseParams) WithContext(ctx context.Context) *DiscoverAzureDatabaseParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the discover azure database params -func (o *DiscoverAzureDatabaseParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the discover azure database params -func (o *DiscoverAzureDatabaseParams) WithHTTPClient(client *http.Client) *DiscoverAzureDatabaseParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the discover azure database params -func (o *DiscoverAzureDatabaseParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the discover azure database params -func (o *DiscoverAzureDatabaseParams) WithBody(body DiscoverAzureDatabaseBody) *DiscoverAzureDatabaseParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the discover azure database params -func (o *DiscoverAzureDatabaseParams) SetBody(body DiscoverAzureDatabaseBody) { - o.Body = body -} - -// 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 - } - 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/discover_azure_database_responses.go b/api/management/v1/json/client/management_service/discover_azure_database_responses.go deleted file mode 100644 index ee99deb5004..00000000000 --- a/api/management/v1/json/client/management_service/discover_azure_database_responses.go +++ /dev/null @@ -1,697 +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" -) - -// DiscoverAzureDatabaseReader is a Reader for the DiscoverAzureDatabase structure. -type DiscoverAzureDatabaseReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DiscoverAzureDatabaseReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewDiscoverAzureDatabaseOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewDiscoverAzureDatabaseDefault(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 - } -} - -// NewDiscoverAzureDatabaseOK creates a DiscoverAzureDatabaseOK with default headers values -func NewDiscoverAzureDatabaseOK() *DiscoverAzureDatabaseOK { - return &DiscoverAzureDatabaseOK{} -} - -/* -DiscoverAzureDatabaseOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type DiscoverAzureDatabaseOK struct { - Payload *DiscoverAzureDatabaseOKBody -} - -// IsSuccess returns true when this discover azure database Ok response has a 2xx status code -func (o *DiscoverAzureDatabaseOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this discover azure database Ok response has a 3xx status code -func (o *DiscoverAzureDatabaseOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this discover azure database Ok response has a 4xx status code -func (o *DiscoverAzureDatabaseOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this discover azure database Ok response has a 5xx status code -func (o *DiscoverAzureDatabaseOK) IsServerError() bool { - return false -} - -// IsCode returns true when this discover azure database Ok response a status code equal to that given -func (o *DiscoverAzureDatabaseOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the discover azure database Ok response -func (o *DiscoverAzureDatabaseOK) Code() int { - return 200 -} - -func (o *DiscoverAzureDatabaseOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/management/services:discoverAzure][%d] discoverAzureDatabaseOk %s", 200, payload) -} - -func (o *DiscoverAzureDatabaseOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/management/services:discoverAzure][%d] discoverAzureDatabaseOk %s", 200, payload) -} - -func (o *DiscoverAzureDatabaseOK) GetPayload() *DiscoverAzureDatabaseOKBody { - return o.Payload -} - -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) { - return err - } - - return nil -} - -// NewDiscoverAzureDatabaseDefault creates a DiscoverAzureDatabaseDefault with default headers values -func NewDiscoverAzureDatabaseDefault(code int) *DiscoverAzureDatabaseDefault { - return &DiscoverAzureDatabaseDefault{ - _statusCode: code, - } -} - -/* -DiscoverAzureDatabaseDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type DiscoverAzureDatabaseDefault struct { - _statusCode int - - Payload *DiscoverAzureDatabaseDefaultBody -} - -// IsSuccess returns true when this discover azure database default response has a 2xx status code -func (o *DiscoverAzureDatabaseDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this discover azure database default response has a 3xx status code -func (o *DiscoverAzureDatabaseDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this discover azure database default response has a 4xx status code -func (o *DiscoverAzureDatabaseDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this discover azure database default response has a 5xx status code -func (o *DiscoverAzureDatabaseDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this discover azure database default response a status code equal to that given -func (o *DiscoverAzureDatabaseDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the discover azure database default response -func (o *DiscoverAzureDatabaseDefault) Code() int { - return o._statusCode -} - -func (o *DiscoverAzureDatabaseDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/management/services:discoverAzure][%d] DiscoverAzureDatabase default %s", o._statusCode, payload) -} - -func (o *DiscoverAzureDatabaseDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/management/services:discoverAzure][%d] DiscoverAzureDatabase default %s", o._statusCode, payload) -} - -func (o *DiscoverAzureDatabaseDefault) GetPayload() *DiscoverAzureDatabaseDefaultBody { - return o.Payload -} - -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) { - return err - } - - return nil -} - -/* -DiscoverAzureDatabaseBody DiscoverAzureDatabaseRequest discover azure databases request. -swagger:model DiscoverAzureDatabaseBody -*/ -type DiscoverAzureDatabaseBody struct { - // Azure client ID. - AzureClientID string `json:"azure_client_id,omitempty"` - - // Azure client secret. - AzureClientSecret string `json:"azure_client_secret,omitempty"` - - // Azure tanant ID. - AzureTenantID string `json:"azure_tenant_id,omitempty"` - - // Azure subscription ID. - AzureSubscriptionID string `json:"azure_subscription_id,omitempty"` -} - -// Validate validates this discover azure database body -func (o *DiscoverAzureDatabaseBody) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this discover azure database body based on context it is used -func (o *DiscoverAzureDatabaseBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *DiscoverAzureDatabaseBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *DiscoverAzureDatabaseBody) UnmarshalBinary(b []byte) error { - var res DiscoverAzureDatabaseBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -DiscoverAzureDatabaseDefaultBody discover azure database default body -swagger:model DiscoverAzureDatabaseDefaultBody -*/ -type DiscoverAzureDatabaseDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*DiscoverAzureDatabaseDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this discover azure database default body -func (o *DiscoverAzureDatabaseDefaultBody) 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 *DiscoverAzureDatabaseDefaultBody) 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("DiscoverAzureDatabase default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("DiscoverAzureDatabase default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this discover azure database default body based on the context it is used -func (o *DiscoverAzureDatabaseDefaultBody) 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 *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 - return nil - } - - if err := o.Details[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("DiscoverAzureDatabase default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("DiscoverAzureDatabase default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *DiscoverAzureDatabaseDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *DiscoverAzureDatabaseDefaultBody) UnmarshalBinary(b []byte) error { - var res DiscoverAzureDatabaseDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -DiscoverAzureDatabaseDefaultBodyDetailsItems0 discover azure database default body details items0 -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:"-"` -} - -// 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"` - } - if err := json.Unmarshal(data, &stage1); err != nil { - return err - } - var rcv DiscoverAzureDatabaseDefaultBodyDetailsItems0 - - 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.DiscoverAzureDatabaseDefaultBodyDetailsItems0 = result - } - - return nil -} - -// 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"` - } - - stage1.AtType = o.AtType - - // make JSON object for known properties - props, err := json.Marshal(stage1) - if err != nil { - return nil, err - } - - if len(o.DiscoverAzureDatabaseDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.DiscoverAzureDatabaseDefaultBodyDetailsItems0) - 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 discover azure database default body details items0 -func (o *DiscoverAzureDatabaseDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this discover azure database default body details items0 based on context it is used -func (o *DiscoverAzureDatabaseDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *DiscoverAzureDatabaseDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *DiscoverAzureDatabaseDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res DiscoverAzureDatabaseDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -DiscoverAzureDatabaseOKBody DiscoverAzureDatabaseResponse discover azure databases response. -swagger:model DiscoverAzureDatabaseOKBody -*/ -type DiscoverAzureDatabaseOKBody struct { - // azure database instance - AzureDatabaseInstance []*DiscoverAzureDatabaseOKBodyAzureDatabaseInstanceItems0 `json:"azure_database_instance"` -} - -// Validate validates this discover azure database OK body -func (o *DiscoverAzureDatabaseOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateAzureDatabaseInstance(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *DiscoverAzureDatabaseOKBody) validateAzureDatabaseInstance(formats strfmt.Registry) error { - if swag.IsZero(o.AzureDatabaseInstance) { // not required - return nil - } - - for i := 0; i < len(o.AzureDatabaseInstance); i++ { - if swag.IsZero(o.AzureDatabaseInstance[i]) { // not required - continue - } - - if o.AzureDatabaseInstance[i] != nil { - if err := o.AzureDatabaseInstance[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("discoverAzureDatabaseOk" + "." + "azure_database_instance" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("discoverAzureDatabaseOk" + "." + "azure_database_instance" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this discover azure database OK body based on the context it is used -func (o *DiscoverAzureDatabaseOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateAzureDatabaseInstance(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -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 - return nil - } - - if err := o.AzureDatabaseInstance[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("discoverAzureDatabaseOk" + "." + "azure_database_instance" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("discoverAzureDatabaseOk" + "." + "azure_database_instance" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *DiscoverAzureDatabaseOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *DiscoverAzureDatabaseOKBody) UnmarshalBinary(b []byte) error { - var res DiscoverAzureDatabaseOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -DiscoverAzureDatabaseOKBodyAzureDatabaseInstanceItems0 DiscoverAzureDatabaseInstance models an unique Azure Database instance for the list of instances returned by Discovery. -swagger:model DiscoverAzureDatabaseOKBodyAzureDatabaseInstanceItems0 -*/ -type DiscoverAzureDatabaseOKBodyAzureDatabaseInstanceItems0 struct { - // Azure database instance ID. - InstanceID string `json:"instance_id,omitempty"` - - // Azure database location. - Region string `json:"region,omitempty"` - - // Azure database server name. - ServiceName string `json:"service_name,omitempty"` - - // Database username. - Username string `json:"username,omitempty"` - - // Address used to connect to it. - Address string `json:"address,omitempty"` - - // Azure Resource group. - AzureResourceGroup string `json:"azure_resource_group,omitempty"` - - // 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"` -} - -// Validate validates this discover azure database OK body azure database instance items0 -func (o *DiscoverAzureDatabaseOKBodyAzureDatabaseInstanceItems0) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var discoverAzureDatabaseOkBodyAzureDatabaseInstanceItems0TypeTypePropEnum []any - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["DISCOVER_AZURE_DATABASE_TYPE_UNSPECIFIED","DISCOVER_AZURE_DATABASE_TYPE_MYSQL","DISCOVER_AZURE_DATABASE_TYPE_POSTGRESQL"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - discoverAzureDatabaseOkBodyAzureDatabaseInstanceItems0TypeTypePropEnum = append(discoverAzureDatabaseOkBodyAzureDatabaseInstanceItems0TypeTypePropEnum, v) - } -} - -const ( - - // DiscoverAzureDatabaseOKBodyAzureDatabaseInstanceItems0TypeDISCOVERAZUREDATABASETYPEUNSPECIFIED captures enum value "DISCOVER_AZURE_DATABASE_TYPE_UNSPECIFIED" - DiscoverAzureDatabaseOKBodyAzureDatabaseInstanceItems0TypeDISCOVERAZUREDATABASETYPEUNSPECIFIED string = "DISCOVER_AZURE_DATABASE_TYPE_UNSPECIFIED" - - // DiscoverAzureDatabaseOKBodyAzureDatabaseInstanceItems0TypeDISCOVERAZUREDATABASETYPEMYSQL captures enum value "DISCOVER_AZURE_DATABASE_TYPE_MYSQL" - DiscoverAzureDatabaseOKBodyAzureDatabaseInstanceItems0TypeDISCOVERAZUREDATABASETYPEMYSQL string = "DISCOVER_AZURE_DATABASE_TYPE_MYSQL" - - // DiscoverAzureDatabaseOKBodyAzureDatabaseInstanceItems0TypeDISCOVERAZUREDATABASETYPEPOSTGRESQL captures enum value "DISCOVER_AZURE_DATABASE_TYPE_POSTGRESQL" - DiscoverAzureDatabaseOKBodyAzureDatabaseInstanceItems0TypeDISCOVERAZUREDATABASETYPEPOSTGRESQL string = "DISCOVER_AZURE_DATABASE_TYPE_POSTGRESQL" -) - -// prop value enum -func (o *DiscoverAzureDatabaseOKBodyAzureDatabaseInstanceItems0) validateTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, discoverAzureDatabaseOkBodyAzureDatabaseInstanceItems0TypeTypePropEnum, true); err != nil { - return err - } - return nil -} - -func (o *DiscoverAzureDatabaseOKBodyAzureDatabaseInstanceItems0) validateType(formats strfmt.Registry) error { - if swag.IsZero(o.Type) { // not required - return nil - } - - // value enum - if err := o.validateTypeEnum("type", "body", *o.Type); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this discover azure database OK body azure database instance items0 based on context it is used -func (o *DiscoverAzureDatabaseOKBodyAzureDatabaseInstanceItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *DiscoverAzureDatabaseOKBodyAzureDatabaseInstanceItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *DiscoverAzureDatabaseOKBodyAzureDatabaseInstanceItems0) UnmarshalBinary(b []byte) error { - var res DiscoverAzureDatabaseOKBodyAzureDatabaseInstanceItems0 - 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_rds_parameters.go b/api/management/v1/json/client/management_service/discover_rds_parameters.go deleted file mode 100644 index ef5c0058c50..00000000000 --- a/api/management/v1/json/client/management_service/discover_rds_parameters.go +++ /dev/null @@ -1,144 +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" -) - -// NewDiscoverRDSParams creates a new DiscoverRDSParams 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 NewDiscoverRDSParams() *DiscoverRDSParams { - return &DiscoverRDSParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDiscoverRDSParamsWithTimeout creates a new DiscoverRDSParams object -// with the ability to set a timeout on a request. -func NewDiscoverRDSParamsWithTimeout(timeout time.Duration) *DiscoverRDSParams { - return &DiscoverRDSParams{ - timeout: timeout, - } -} - -// NewDiscoverRDSParamsWithContext creates a new DiscoverRDSParams object -// with the ability to set a context for a request. -func NewDiscoverRDSParamsWithContext(ctx context.Context) *DiscoverRDSParams { - return &DiscoverRDSParams{ - Context: ctx, - } -} - -// NewDiscoverRDSParamsWithHTTPClient creates a new DiscoverRDSParams object -// with the ability to set a custom HTTPClient for a request. -func NewDiscoverRDSParamsWithHTTPClient(client *http.Client) *DiscoverRDSParams { - return &DiscoverRDSParams{ - HTTPClient: client, - } -} - -/* -DiscoverRDSParams contains all the parameters to send to the API endpoint - - for the discover RDS operation. - - Typically these are written to a http.Request. -*/ -type DiscoverRDSParams struct { - // Body. - Body DiscoverRDSBody - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the discover RDS params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DiscoverRDSParams) WithDefaults() *DiscoverRDSParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the discover RDS params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DiscoverRDSParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the discover RDS params -func (o *DiscoverRDSParams) WithTimeout(timeout time.Duration) *DiscoverRDSParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the discover RDS params -func (o *DiscoverRDSParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the discover RDS params -func (o *DiscoverRDSParams) WithContext(ctx context.Context) *DiscoverRDSParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the discover RDS params -func (o *DiscoverRDSParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the discover RDS params -func (o *DiscoverRDSParams) WithHTTPClient(client *http.Client) *DiscoverRDSParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the discover RDS params -func (o *DiscoverRDSParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the discover RDS params -func (o *DiscoverRDSParams) WithBody(body DiscoverRDSBody) *DiscoverRDSParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the discover RDS params -func (o *DiscoverRDSParams) SetBody(body DiscoverRDSBody) { - o.Body = body -} - -// 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 - } - 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/discover_rds_responses.go b/api/management/v1/json/client/management_service/discover_rds_responses.go deleted file mode 100644 index b8743c96b40..00000000000 --- a/api/management/v1/json/client/management_service/discover_rds_responses.go +++ /dev/null @@ -1,681 +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" -) - -// DiscoverRDSReader is a Reader for the DiscoverRDS structure. -type DiscoverRDSReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DiscoverRDSReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewDiscoverRDSOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewDiscoverRDSDefault(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 - } -} - -// NewDiscoverRDSOK creates a DiscoverRDSOK with default headers values -func NewDiscoverRDSOK() *DiscoverRDSOK { - return &DiscoverRDSOK{} -} - -/* -DiscoverRDSOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type DiscoverRDSOK struct { - Payload *DiscoverRDSOKBody -} - -// IsSuccess returns true when this discover Rds Ok response has a 2xx status code -func (o *DiscoverRDSOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this discover Rds Ok response has a 3xx status code -func (o *DiscoverRDSOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this discover Rds Ok response has a 4xx status code -func (o *DiscoverRDSOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this discover Rds Ok response has a 5xx status code -func (o *DiscoverRDSOK) IsServerError() bool { - return false -} - -// IsCode returns true when this discover Rds Ok response a status code equal to that given -func (o *DiscoverRDSOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the discover Rds Ok response -func (o *DiscoverRDSOK) Code() int { - return 200 -} - -func (o *DiscoverRDSOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/management/services:discoverRDS][%d] discoverRdsOk %s", 200, payload) -} - -func (o *DiscoverRDSOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/management/services:discoverRDS][%d] discoverRdsOk %s", 200, payload) -} - -func (o *DiscoverRDSOK) GetPayload() *DiscoverRDSOKBody { - return o.Payload -} - -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) { - return err - } - - return nil -} - -// NewDiscoverRDSDefault creates a DiscoverRDSDefault with default headers values -func NewDiscoverRDSDefault(code int) *DiscoverRDSDefault { - return &DiscoverRDSDefault{ - _statusCode: code, - } -} - -/* -DiscoverRDSDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type DiscoverRDSDefault struct { - _statusCode int - - Payload *DiscoverRDSDefaultBody -} - -// IsSuccess returns true when this discover RDS default response has a 2xx status code -func (o *DiscoverRDSDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this discover RDS default response has a 3xx status code -func (o *DiscoverRDSDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this discover RDS default response has a 4xx status code -func (o *DiscoverRDSDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this discover RDS default response has a 5xx status code -func (o *DiscoverRDSDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this discover RDS default response a status code equal to that given -func (o *DiscoverRDSDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the discover RDS default response -func (o *DiscoverRDSDefault) Code() int { - return o._statusCode -} - -func (o *DiscoverRDSDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/management/services:discoverRDS][%d] DiscoverRDS default %s", o._statusCode, payload) -} - -func (o *DiscoverRDSDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/management/services:discoverRDS][%d] DiscoverRDS default %s", o._statusCode, payload) -} - -func (o *DiscoverRDSDefault) GetPayload() *DiscoverRDSDefaultBody { - return o.Payload -} - -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) { - return err - } - - return nil -} - -/* -DiscoverRDSBody discover RDS body -swagger:model DiscoverRDSBody -*/ -type DiscoverRDSBody struct { - // AWS Access key. Optional. - AWSAccessKey string `json:"aws_access_key,omitempty"` - - // AWS Secret key. Optional. - AWSSecretKey string `json:"aws_secret_key,omitempty"` -} - -// Validate validates this discover RDS body -func (o *DiscoverRDSBody) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this discover RDS body based on context it is used -func (o *DiscoverRDSBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *DiscoverRDSBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *DiscoverRDSBody) UnmarshalBinary(b []byte) error { - var res DiscoverRDSBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -DiscoverRDSDefaultBody discover RDS default body -swagger:model DiscoverRDSDefaultBody -*/ -type DiscoverRDSDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*DiscoverRDSDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this discover RDS default body -func (o *DiscoverRDSDefaultBody) 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 *DiscoverRDSDefaultBody) 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("DiscoverRDS default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("DiscoverRDS default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this discover RDS default body based on the context it is used -func (o *DiscoverRDSDefaultBody) 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 *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 - return nil - } - - if err := o.Details[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("DiscoverRDS default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("DiscoverRDS default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *DiscoverRDSDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *DiscoverRDSDefaultBody) UnmarshalBinary(b []byte) error { - var res DiscoverRDSDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -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:"-"` -} - -// 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"` - } - if err := json.Unmarshal(data, &stage1); err != nil { - return err - } - var rcv DiscoverRDSDefaultBodyDetailsItems0 - - 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.DiscoverRDSDefaultBodyDetailsItems0 = result - } - - return nil -} - -// 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"` - } - - stage1.AtType = o.AtType - - // make JSON object for known properties - props, err := json.Marshal(stage1) - if err != nil { - return nil, err - } - - if len(o.DiscoverRDSDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.DiscoverRDSDefaultBodyDetailsItems0) - 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 discover RDS default body details items0 -func (o *DiscoverRDSDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this discover RDS default body details items0 based on context it is used -func (o *DiscoverRDSDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *DiscoverRDSDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *DiscoverRDSDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res DiscoverRDSDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -DiscoverRDSOKBody discover RDS OK body -swagger:model DiscoverRDSOKBody -*/ -type DiscoverRDSOKBody struct { - // rds instances - RDSInstances []*DiscoverRDSOKBodyRDSInstancesItems0 `json:"rds_instances"` -} - -// Validate validates this discover RDS OK body -func (o *DiscoverRDSOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateRDSInstances(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *DiscoverRDSOKBody) validateRDSInstances(formats strfmt.Registry) error { - if swag.IsZero(o.RDSInstances) { // not required - return nil - } - - for i := 0; i < len(o.RDSInstances); i++ { - if swag.IsZero(o.RDSInstances[i]) { // not required - continue - } - - if o.RDSInstances[i] != nil { - if err := o.RDSInstances[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("discoverRdsOk" + "." + "rds_instances" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("discoverRdsOk" + "." + "rds_instances" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this discover RDS OK body based on the context it is used -func (o *DiscoverRDSOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateRDSInstances(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -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 - return nil - } - - if err := o.RDSInstances[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("discoverRdsOk" + "." + "rds_instances" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("discoverRdsOk" + "." + "rds_instances" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *DiscoverRDSOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *DiscoverRDSOKBody) UnmarshalBinary(b []byte) error { - var res DiscoverRDSOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -DiscoverRDSOKBodyRDSInstancesItems0 DiscoverRDSInstance models an unique RDS instance for the list of instances returned by Discovery. -swagger:model DiscoverRDSOKBodyRDSInstancesItems0 -*/ -type DiscoverRDSOKBodyRDSInstancesItems0 struct { - // AWS region. - Region string `json:"region,omitempty"` - - // AWS availability zone. - Az string `json:"az,omitempty"` - - // AWS instance ID. - InstanceID string `json:"instance_id,omitempty"` - - // AWS instance class. - NodeModel string `json:"node_model,omitempty"` - - // Address used to connect to it. - Address string `json:"address,omitempty"` - - // 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"` - - // Engine version. - EngineVersion string `json:"engine_version,omitempty"` -} - -// Validate validates this discover RDS OK body RDS instances items0 -func (o *DiscoverRDSOKBodyRDSInstancesItems0) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateEngine(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var discoverRdsOkBodyRdsInstancesItems0TypeEnginePropEnum []any - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["DISCOVER_RDS_ENGINE_UNSPECIFIED","DISCOVER_RDS_ENGINE_MYSQL","DISCOVER_RDS_ENGINE_POSTGRESQL"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - discoverRdsOkBodyRdsInstancesItems0TypeEnginePropEnum = append(discoverRdsOkBodyRdsInstancesItems0TypeEnginePropEnum, v) - } -} - -const ( - - // DiscoverRDSOKBodyRDSInstancesItems0EngineDISCOVERRDSENGINEUNSPECIFIED captures enum value "DISCOVER_RDS_ENGINE_UNSPECIFIED" - DiscoverRDSOKBodyRDSInstancesItems0EngineDISCOVERRDSENGINEUNSPECIFIED string = "DISCOVER_RDS_ENGINE_UNSPECIFIED" - - // DiscoverRDSOKBodyRDSInstancesItems0EngineDISCOVERRDSENGINEMYSQL captures enum value "DISCOVER_RDS_ENGINE_MYSQL" - DiscoverRDSOKBodyRDSInstancesItems0EngineDISCOVERRDSENGINEMYSQL string = "DISCOVER_RDS_ENGINE_MYSQL" - - // DiscoverRDSOKBodyRDSInstancesItems0EngineDISCOVERRDSENGINEPOSTGRESQL captures enum value "DISCOVER_RDS_ENGINE_POSTGRESQL" - DiscoverRDSOKBodyRDSInstancesItems0EngineDISCOVERRDSENGINEPOSTGRESQL string = "DISCOVER_RDS_ENGINE_POSTGRESQL" -) - -// prop value enum -func (o *DiscoverRDSOKBodyRDSInstancesItems0) validateEngineEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, discoverRdsOkBodyRdsInstancesItems0TypeEnginePropEnum, true); err != nil { - return err - } - return nil -} - -func (o *DiscoverRDSOKBodyRDSInstancesItems0) validateEngine(formats strfmt.Registry) error { - if swag.IsZero(o.Engine) { // not required - return nil - } - - // value enum - if err := o.validateEngineEnum("engine", "body", *o.Engine); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this discover RDS OK body RDS instances items0 based on context it is used -func (o *DiscoverRDSOKBodyRDSInstancesItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *DiscoverRDSOKBodyRDSInstancesItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *DiscoverRDSOKBodyRDSInstancesItems0) UnmarshalBinary(b []byte) error { - var res DiscoverRDSOKBodyRDSInstancesItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} 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 deleted file mode 100644 index 63aa4bdf7c6..00000000000 --- a/api/management/v1/json/client/management_service/get_node_parameters.go +++ /dev/null @@ -1,149 +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" -) - -// NewGetNodeParams creates a new GetNodeParams 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 NewGetNodeParams() *GetNodeParams { - return &GetNodeParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetNodeParamsWithTimeout creates a new GetNodeParams object -// with the ability to set a timeout on a request. -func NewGetNodeParamsWithTimeout(timeout time.Duration) *GetNodeParams { - return &GetNodeParams{ - timeout: timeout, - } -} - -// NewGetNodeParamsWithContext creates a new GetNodeParams object -// with the ability to set a context for a request. -func NewGetNodeParamsWithContext(ctx context.Context) *GetNodeParams { - return &GetNodeParams{ - Context: ctx, - } -} - -// NewGetNodeParamsWithHTTPClient creates a new GetNodeParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetNodeParamsWithHTTPClient(client *http.Client) *GetNodeParams { - return &GetNodeParams{ - HTTPClient: client, - } -} - -/* -GetNodeParams contains all the parameters to send to the API endpoint - - for the get node operation. - - Typically these are written to a http.Request. -*/ -type GetNodeParams struct { - /* NodeID. - - Unique Node identifier. - */ - NodeID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get node params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetNodeParams) WithDefaults() *GetNodeParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get node params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetNodeParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the get node params -func (o *GetNodeParams) WithTimeout(timeout time.Duration) *GetNodeParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get node params -func (o *GetNodeParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get node params -func (o *GetNodeParams) WithContext(ctx context.Context) *GetNodeParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get node params -func (o *GetNodeParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get node params -func (o *GetNodeParams) WithHTTPClient(client *http.Client) *GetNodeParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get node params -func (o *GetNodeParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithNodeID adds the nodeID to the get node params -func (o *GetNodeParams) WithNodeID(nodeID string) *GetNodeParams { - o.SetNodeID(nodeID) - return o -} - -// SetNodeID adds the nodeId to the get node params -func (o *GetNodeParams) SetNodeID(nodeID string) { - o.NodeID = nodeID -} - -// 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 - } - var res []error - - // path param node_id - if err := r.SetPathParam("node_id", o.NodeID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} 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 deleted file mode 100644 index 17e18f31b3d..00000000000 --- a/api/management/v1/json/client/management_service/get_node_responses.go +++ /dev/null @@ -1,926 +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" -) - -// GetNodeReader is a Reader for the GetNode structure. -type GetNodeReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetNodeReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewGetNodeOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewGetNodeDefault(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 - } -} - -// NewGetNodeOK creates a GetNodeOK with default headers values -func NewGetNodeOK() *GetNodeOK { - return &GetNodeOK{} -} - -/* -GetNodeOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type GetNodeOK struct { - Payload *GetNodeOKBody -} - -// IsSuccess returns true when this get node Ok response has a 2xx status code -func (o *GetNodeOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this get node Ok response has a 3xx status code -func (o *GetNodeOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this get node Ok response has a 4xx status code -func (o *GetNodeOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this get node Ok response has a 5xx status code -func (o *GetNodeOK) IsServerError() bool { - return false -} - -// IsCode returns true when this get node Ok response a status code equal to that given -func (o *GetNodeOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the get node Ok response -func (o *GetNodeOK) Code() int { - return 200 -} - -func (o *GetNodeOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/management/nodes/{node_id}][%d] getNodeOk %s", 200, payload) -} - -func (o *GetNodeOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/management/nodes/{node_id}][%d] getNodeOk %s", 200, payload) -} - -func (o *GetNodeOK) GetPayload() *GetNodeOKBody { - return o.Payload -} - -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) { - return err - } - - return nil -} - -// NewGetNodeDefault creates a GetNodeDefault with default headers values -func NewGetNodeDefault(code int) *GetNodeDefault { - return &GetNodeDefault{ - _statusCode: code, - } -} - -/* -GetNodeDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type GetNodeDefault struct { - _statusCode int - - Payload *GetNodeDefaultBody -} - -// IsSuccess returns true when this get node default response has a 2xx status code -func (o *GetNodeDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this get node default response has a 3xx status code -func (o *GetNodeDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this get node default response has a 4xx status code -func (o *GetNodeDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this get node default response has a 5xx status code -func (o *GetNodeDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this get node default response a status code equal to that given -func (o *GetNodeDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the get node default response -func (o *GetNodeDefault) Code() int { - return o._statusCode -} - -func (o *GetNodeDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/management/nodes/{node_id}][%d] GetNode default %s", o._statusCode, payload) -} - -func (o *GetNodeDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/management/nodes/{node_id}][%d] GetNode default %s", o._statusCode, payload) -} - -func (o *GetNodeDefault) GetPayload() *GetNodeDefaultBody { - return o.Payload -} - -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) { - return err - } - - return nil -} - -/* -GetNodeDefaultBody get node default body -swagger:model GetNodeDefaultBody -*/ -type GetNodeDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*GetNodeDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this get node default body -func (o *GetNodeDefaultBody) 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 *GetNodeDefaultBody) 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("GetNode default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("GetNode default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this get node default body based on the context it is used -func (o *GetNodeDefaultBody) 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 *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 - return nil - } - - if err := o.Details[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("GetNode default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("GetNode default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetNodeDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetNodeDefaultBody) UnmarshalBinary(b []byte) error { - var res GetNodeDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -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:"-"` -} - -// 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"` - } - if err := json.Unmarshal(data, &stage1); err != nil { - return err - } - var rcv GetNodeDefaultBodyDetailsItems0 - - 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.GetNodeDefaultBodyDetailsItems0 = result - } - - return nil -} - -// 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"` - } - - stage1.AtType = o.AtType - - // make JSON object for known properties - props, err := json.Marshal(stage1) - if err != nil { - return nil, err - } - - if len(o.GetNodeDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.GetNodeDefaultBodyDetailsItems0) - 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 get node default body details items0 -func (o *GetNodeDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get node default body details items0 based on context it is used -func (o *GetNodeDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetNodeDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetNodeDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res GetNodeDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetNodeOKBody get node OK body -swagger:model GetNodeOKBody -*/ -type GetNodeOKBody struct { - // node - Node *GetNodeOKBodyNode `json:"node,omitempty"` -} - -// Validate validates this get node OK body -func (o *GetNodeOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateNode(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetNodeOKBody) validateNode(formats strfmt.Registry) error { - if swag.IsZero(o.Node) { // not required - return nil - } - - if o.Node != nil { - if err := o.Node.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getNodeOk" + "." + "node") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getNodeOk" + "." + "node") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this get node OK body based on the context it is used -func (o *GetNodeOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateNode(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetNodeOKBody) contextValidateNode(ctx context.Context, formats strfmt.Registry) error { - if o.Node != nil { - - if swag.IsZero(o.Node) { // not required - return nil - } - - if err := o.Node.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getNodeOk" + "." + "node") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getNodeOk" + "." + "node") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetNodeOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetNodeOKBody) UnmarshalBinary(b []byte) error { - var res GetNodeOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetNodeOKBodyNode get node OK body node -swagger:model GetNodeOKBodyNode -*/ -type GetNodeOKBodyNode struct { - // Unique Node identifier. - NodeID string `json:"node_id,omitempty"` - - // Node type. - NodeType string `json:"node_type,omitempty"` - - // User-defined node name. - NodeName string `json:"node_name,omitempty"` - - // Linux machine-id. - MachineID string `json:"machine_id,omitempty"` - - // Linux distribution name and version. - Distro string `json:"distro,omitempty"` - - // Node model. - NodeModel string `json:"node_model,omitempty"` - - // A node's unique docker container identifier. - ContainerID string `json:"container_id,omitempty"` - - // Container name. - ContainerName string `json:"container_name,omitempty"` - - // Node address (DNS name or IP). - Address string `json:"address,omitempty"` - - // Node region. - Region string `json:"region,omitempty"` - - // Node availability zone. - Az string `json:"az,omitempty"` - - // Custom user-assigned labels for Node. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // Creation timestamp. - // Format: date-time - CreatedAt strfmt.DateTime `json:"created_at,omitempty"` - - // Last update timestamp. - // 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"` - - // List of services running on this node. - Services []*GetNodeOKBodyNodeServicesItems0 `json:"services"` - - // Instance ID for cloud providers (e.g. AWS RDS). - InstanceID string `json:"instance_id,omitempty"` -} - -// Validate validates this get node OK body node -func (o *GetNodeOKBodyNode) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := o.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if err := o.validateStatus(formats); err != nil { - res = append(res, err) - } - - if err := o.validateAgents(formats); err != nil { - res = append(res, err) - } - - if err := o.validateServices(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetNodeOKBodyNode) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(o.CreatedAt) { // not required - return nil - } - - if err := validate.FormatOf("getNodeOk"+"."+"node"+"."+"created_at", "body", "date-time", o.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (o *GetNodeOKBodyNode) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(o.UpdatedAt) { // not required - return nil - } - - if err := validate.FormatOf("getNodeOk"+"."+"node"+"."+"updated_at", "body", "date-time", o.UpdatedAt.String(), formats); err != nil { - return err - } - - 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 - } - - for i := 0; i < len(o.Agents); i++ { - if swag.IsZero(o.Agents[i]) { // not required - continue - } - - if o.Agents[i] != nil { - if err := o.Agents[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getNodeOk" + "." + "node" + "." + "agents" + "." + strconv.Itoa(i)) - } - 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) validateServices(formats strfmt.Registry) error { - if swag.IsZero(o.Services) { // not required - return nil - } - - for i := 0; i < len(o.Services); i++ { - if swag.IsZero(o.Services[i]) { // not required - continue - } - - if o.Services[i] != nil { - if err := o.Services[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getNodeOk" + "." + "node" + "." + "services" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getNodeOk" + "." + "node" + "." + "services" + "." + strconv.Itoa(i)) - } - - 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 - - if err := o.contextValidateAgents(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateServices(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -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 - return nil - } - - if err := o.Agents[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getNodeOk" + "." + "node" + "." + "agents" + "." + strconv.Itoa(i)) - } - 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 - return nil - } - - if err := o.Services[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getNodeOk" + "." + "node" + "." + "services" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getNodeOk" + "." + "node" + "." + "services" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetNodeOKBodyNode) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetNodeOKBodyNode) UnmarshalBinary(b []byte) error { - var res GetNodeOKBodyNode - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetNodeOKBodyNodeAgentsItems0 get node OK body node agents items0 -swagger:model GetNodeOKBodyNodeAgentsItems0 -*/ -type GetNodeOKBodyNodeAgentsItems0 struct { - // Unique Agent identifier. - AgentID string `json:"agent_id,omitempty"` - - // Agent type. - AgentType string `json:"agent_type,omitempty"` - - // Actual Agent status. - Status string `json:"status,omitempty"` - - // True if Agent is running and connected to pmm-managed. - IsConnected bool `json:"is_connected,omitempty"` -} - -// Validate validates this get node OK body node agents items0 -func (o *GetNodeOKBodyNodeAgentsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get node OK body node agents items0 based on context it is used -func (o *GetNodeOKBodyNodeAgentsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetNodeOKBodyNodeAgentsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetNodeOKBodyNodeAgentsItems0) UnmarshalBinary(b []byte) error { - var res GetNodeOKBodyNodeAgentsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetNodeOKBodyNodeServicesItems0 Service represents a service running on a node. -swagger:model GetNodeOKBodyNodeServicesItems0 -*/ -type GetNodeOKBodyNodeServicesItems0 struct { - // Unique Service identifier. - ServiceID string `json:"service_id,omitempty"` - - // Service type. - ServiceType string `json:"service_type,omitempty"` - - // Service name. - ServiceName string `json:"service_name,omitempty"` -} - -// Validate validates this get node OK body node services items0 -func (o *GetNodeOKBodyNodeServicesItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get node OK body node services items0 based on context it is used -func (o *GetNodeOKBodyNodeServicesItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetNodeOKBodyNodeServicesItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetNodeOKBodyNodeServicesItems0) UnmarshalBinary(b []byte) error { - var res GetNodeOKBodyNodeServicesItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} 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 deleted file mode 100644 index d7f16fa9b2d..00000000000 --- a/api/management/v1/json/client/management_service/list_agent_versions_parameters.go +++ /dev/null @@ -1,127 +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" -) - -// NewListAgentVersionsParams creates a new ListAgentVersionsParams 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 NewListAgentVersionsParams() *ListAgentVersionsParams { - return &ListAgentVersionsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListAgentVersionsParamsWithTimeout creates a new ListAgentVersionsParams object -// with the ability to set a timeout on a request. -func NewListAgentVersionsParamsWithTimeout(timeout time.Duration) *ListAgentVersionsParams { - return &ListAgentVersionsParams{ - timeout: timeout, - } -} - -// NewListAgentVersionsParamsWithContext creates a new ListAgentVersionsParams object -// with the ability to set a context for a request. -func NewListAgentVersionsParamsWithContext(ctx context.Context) *ListAgentVersionsParams { - return &ListAgentVersionsParams{ - Context: ctx, - } -} - -// NewListAgentVersionsParamsWithHTTPClient creates a new ListAgentVersionsParams object -// with the ability to set a custom HTTPClient for a request. -func NewListAgentVersionsParamsWithHTTPClient(client *http.Client) *ListAgentVersionsParams { - return &ListAgentVersionsParams{ - HTTPClient: client, - } -} - -/* -ListAgentVersionsParams contains all the parameters to send to the API endpoint - - for the list agent versions operation. - - Typically these are written to a http.Request. -*/ -type ListAgentVersionsParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list agent versions params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListAgentVersionsParams) WithDefaults() *ListAgentVersionsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list agent versions params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListAgentVersionsParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list agent versions params -func (o *ListAgentVersionsParams) WithTimeout(timeout time.Duration) *ListAgentVersionsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list agent versions params -func (o *ListAgentVersionsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list agent versions params -func (o *ListAgentVersionsParams) WithContext(ctx context.Context) *ListAgentVersionsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list agent versions params -func (o *ListAgentVersionsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list agent versions params -func (o *ListAgentVersionsParams) WithHTTPClient(client *http.Client) *ListAgentVersionsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list agent versions params -func (o *ListAgentVersionsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = 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 - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} 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 deleted file mode 100644 index a0a8858d962..00000000000 --- a/api/management/v1/json/client/management_service/list_agent_versions_responses.go +++ /dev/null @@ -1,638 +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" -) - -// ListAgentVersionsReader is a Reader for the ListAgentVersions structure. -type ListAgentVersionsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListAgentVersionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewListAgentVersionsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewListAgentVersionsDefault(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 - } -} - -// NewListAgentVersionsOK creates a ListAgentVersionsOK with default headers values -func NewListAgentVersionsOK() *ListAgentVersionsOK { - return &ListAgentVersionsOK{} -} - -/* -ListAgentVersionsOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type ListAgentVersionsOK struct { - Payload *ListAgentVersionsOKBody -} - -// IsSuccess returns true when this list agent versions Ok response has a 2xx status code -func (o *ListAgentVersionsOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this list agent versions Ok response has a 3xx status code -func (o *ListAgentVersionsOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this list agent versions Ok response has a 4xx status code -func (o *ListAgentVersionsOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this list agent versions Ok response has a 5xx status code -func (o *ListAgentVersionsOK) IsServerError() bool { - return false -} - -// IsCode returns true when this list agent versions Ok response a status code equal to that given -func (o *ListAgentVersionsOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the list agent versions Ok response -func (o *ListAgentVersionsOK) Code() int { - return 200 -} - -func (o *ListAgentVersionsOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/management/agents/versions][%d] listAgentVersionsOk %s", 200, payload) -} - -func (o *ListAgentVersionsOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/management/agents/versions][%d] listAgentVersionsOk %s", 200, payload) -} - -func (o *ListAgentVersionsOK) GetPayload() *ListAgentVersionsOKBody { - return o.Payload -} - -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) { - return err - } - - return nil -} - -// NewListAgentVersionsDefault creates a ListAgentVersionsDefault with default headers values -func NewListAgentVersionsDefault(code int) *ListAgentVersionsDefault { - return &ListAgentVersionsDefault{ - _statusCode: code, - } -} - -/* -ListAgentVersionsDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type ListAgentVersionsDefault struct { - _statusCode int - - Payload *ListAgentVersionsDefaultBody -} - -// IsSuccess returns true when this list agent versions default response has a 2xx status code -func (o *ListAgentVersionsDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this list agent versions default response has a 3xx status code -func (o *ListAgentVersionsDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this list agent versions default response has a 4xx status code -func (o *ListAgentVersionsDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this list agent versions default response has a 5xx status code -func (o *ListAgentVersionsDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this list agent versions default response a status code equal to that given -func (o *ListAgentVersionsDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the list agent versions default response -func (o *ListAgentVersionsDefault) Code() int { - return o._statusCode -} - -func (o *ListAgentVersionsDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/management/agents/versions][%d] ListAgentVersions default %s", o._statusCode, payload) -} - -func (o *ListAgentVersionsDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/management/agents/versions][%d] ListAgentVersions default %s", o._statusCode, payload) -} - -func (o *ListAgentVersionsDefault) GetPayload() *ListAgentVersionsDefaultBody { - return o.Payload -} - -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) { - return err - } - - return nil -} - -/* -ListAgentVersionsDefaultBody list agent versions default body -swagger:model ListAgentVersionsDefaultBody -*/ -type ListAgentVersionsDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*ListAgentVersionsDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this list agent versions default body -func (o *ListAgentVersionsDefaultBody) 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 *ListAgentVersionsDefaultBody) 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("ListAgentVersions default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("ListAgentVersions default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this list agent versions default body based on the context it is used -func (o *ListAgentVersionsDefaultBody) 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 *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 - return nil - } - - if err := o.Details[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("ListAgentVersions default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("ListAgentVersions default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListAgentVersionsDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAgentVersionsDefaultBody) UnmarshalBinary(b []byte) error { - var res ListAgentVersionsDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListAgentVersionsDefaultBodyDetailsItems0 list agent versions default body details items0 -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:"-"` -} - -// 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"` - } - if err := json.Unmarshal(data, &stage1); err != nil { - return err - } - var rcv ListAgentVersionsDefaultBodyDetailsItems0 - - 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.ListAgentVersionsDefaultBodyDetailsItems0 = result - } - - return nil -} - -// 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"` - } - - stage1.AtType = o.AtType - - // make JSON object for known properties - props, err := json.Marshal(stage1) - if err != nil { - return nil, err - } - - if len(o.ListAgentVersionsDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.ListAgentVersionsDefaultBodyDetailsItems0) - 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 list agent versions default body details items0 -func (o *ListAgentVersionsDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list agent versions default body details items0 based on context it is used -func (o *ListAgentVersionsDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListAgentVersionsDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAgentVersionsDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res ListAgentVersionsDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListAgentVersionsOKBody list agent versions OK body -swagger:model ListAgentVersionsOKBody -*/ -type ListAgentVersionsOKBody struct { - // List of Agent versions. - AgentVersions []*ListAgentVersionsOKBodyAgentVersionsItems0 `json:"agent_versions"` -} - -// Validate validates this list agent versions OK body -func (o *ListAgentVersionsOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateAgentVersions(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListAgentVersionsOKBody) validateAgentVersions(formats strfmt.Registry) error { - if swag.IsZero(o.AgentVersions) { // not required - return nil - } - - for i := 0; i < len(o.AgentVersions); i++ { - if swag.IsZero(o.AgentVersions[i]) { // not required - continue - } - - if o.AgentVersions[i] != nil { - if err := o.AgentVersions[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listAgentVersionsOk" + "." + "agent_versions" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listAgentVersionsOk" + "." + "agent_versions" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this list agent versions OK body based on the context it is used -func (o *ListAgentVersionsOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateAgentVersions(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -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 - return nil - } - - if err := o.AgentVersions[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listAgentVersionsOk" + "." + "agent_versions" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listAgentVersionsOk" + "." + "agent_versions" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListAgentVersionsOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAgentVersionsOKBody) UnmarshalBinary(b []byte) error { - var res ListAgentVersionsOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListAgentVersionsOKBodyAgentVersionsItems0 list agent versions OK body agent versions items0 -swagger:model ListAgentVersionsOKBodyAgentVersionsItems0 -*/ -type ListAgentVersionsOKBodyAgentVersionsItems0 struct { - // Agent ID. - AgentID string `json:"agent_id,omitempty"` - - // Agent version. - Version string `json:"version,omitempty"` - - // Node name where the agent runs. - NodeName string `json:"node_name,omitempty"` - - // - UPDATE_SEVERITY_UNSUPPORTED: The client version is newer than the server version. - // - UPDATE_SEVERITY_UP_TO_DATE: The client version matches the server version. - // - UPDATE_SEVERITY_REQUIRED: The client's minor or patch version is older. - // - UPDATE_SEVERITY_CRITICAL: The client's major version is older. - // Enum: ["UPDATE_SEVERITY_UNSPECIFIED","UPDATE_SEVERITY_UNSUPPORTED","UPDATE_SEVERITY_UP_TO_DATE","UPDATE_SEVERITY_REQUIRED","UPDATE_SEVERITY_CRITICAL"] - Severity *string `json:"severity,omitempty"` -} - -// Validate validates this list agent versions OK body agent versions items0 -func (o *ListAgentVersionsOKBodyAgentVersionsItems0) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateSeverity(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var listAgentVersionsOkBodyAgentVersionsItems0TypeSeverityPropEnum []any - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["UPDATE_SEVERITY_UNSPECIFIED","UPDATE_SEVERITY_UNSUPPORTED","UPDATE_SEVERITY_UP_TO_DATE","UPDATE_SEVERITY_REQUIRED","UPDATE_SEVERITY_CRITICAL"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - listAgentVersionsOkBodyAgentVersionsItems0TypeSeverityPropEnum = append(listAgentVersionsOkBodyAgentVersionsItems0TypeSeverityPropEnum, v) - } -} - -const ( - - // ListAgentVersionsOKBodyAgentVersionsItems0SeverityUPDATESEVERITYUNSPECIFIED captures enum value "UPDATE_SEVERITY_UNSPECIFIED" - ListAgentVersionsOKBodyAgentVersionsItems0SeverityUPDATESEVERITYUNSPECIFIED string = "UPDATE_SEVERITY_UNSPECIFIED" - - // ListAgentVersionsOKBodyAgentVersionsItems0SeverityUPDATESEVERITYUNSUPPORTED captures enum value "UPDATE_SEVERITY_UNSUPPORTED" - ListAgentVersionsOKBodyAgentVersionsItems0SeverityUPDATESEVERITYUNSUPPORTED string = "UPDATE_SEVERITY_UNSUPPORTED" - - // ListAgentVersionsOKBodyAgentVersionsItems0SeverityUPDATESEVERITYUPTODATE captures enum value "UPDATE_SEVERITY_UP_TO_DATE" - ListAgentVersionsOKBodyAgentVersionsItems0SeverityUPDATESEVERITYUPTODATE string = "UPDATE_SEVERITY_UP_TO_DATE" - - // ListAgentVersionsOKBodyAgentVersionsItems0SeverityUPDATESEVERITYREQUIRED captures enum value "UPDATE_SEVERITY_REQUIRED" - ListAgentVersionsOKBodyAgentVersionsItems0SeverityUPDATESEVERITYREQUIRED string = "UPDATE_SEVERITY_REQUIRED" - - // ListAgentVersionsOKBodyAgentVersionsItems0SeverityUPDATESEVERITYCRITICAL captures enum value "UPDATE_SEVERITY_CRITICAL" - ListAgentVersionsOKBodyAgentVersionsItems0SeverityUPDATESEVERITYCRITICAL string = "UPDATE_SEVERITY_CRITICAL" -) - -// prop value enum -func (o *ListAgentVersionsOKBodyAgentVersionsItems0) validateSeverityEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, listAgentVersionsOkBodyAgentVersionsItems0TypeSeverityPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ListAgentVersionsOKBodyAgentVersionsItems0) validateSeverity(formats strfmt.Registry) error { - if swag.IsZero(o.Severity) { // not required - return nil - } - - // value enum - if err := o.validateSeverityEnum("severity", "body", *o.Severity); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this list agent versions OK body agent versions items0 based on context it is used -func (o *ListAgentVersionsOKBodyAgentVersionsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListAgentVersionsOKBodyAgentVersionsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAgentVersionsOKBodyAgentVersionsItems0) UnmarshalBinary(b []byte) error { - var res ListAgentVersionsOKBodyAgentVersionsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} 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 deleted file mode 100644 index 5dd7b7b6a4f..00000000000 --- a/api/management/v1/json/client/management_service/list_agents_parameters.go +++ /dev/null @@ -1,193 +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" -) - -// NewListAgentsParams creates a new ListAgentsParams 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 NewListAgentsParams() *ListAgentsParams { - return &ListAgentsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListAgentsParamsWithTimeout creates a new ListAgentsParams object -// with the ability to set a timeout on a request. -func NewListAgentsParamsWithTimeout(timeout time.Duration) *ListAgentsParams { - return &ListAgentsParams{ - timeout: timeout, - } -} - -// NewListAgentsParamsWithContext creates a new ListAgentsParams object -// with the ability to set a context for a request. -func NewListAgentsParamsWithContext(ctx context.Context) *ListAgentsParams { - return &ListAgentsParams{ - Context: ctx, - } -} - -// NewListAgentsParamsWithHTTPClient creates a new ListAgentsParams object -// with the ability to set a custom HTTPClient for a request. -func NewListAgentsParamsWithHTTPClient(client *http.Client) *ListAgentsParams { - return &ListAgentsParams{ - HTTPClient: client, - } -} - -/* -ListAgentsParams contains all the parameters to send to the API endpoint - - for the list agents operation. - - Typically these are written to a http.Request. -*/ -type ListAgentsParams struct { - /* NodeID. - - Return only Agents that relate to a specific NodeID. - */ - NodeID *string - - /* ServiceID. - - Return only Agents that relate to a specific ServiceID. - */ - ServiceID *string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list agents params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListAgentsParams) WithDefaults() *ListAgentsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list agents params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListAgentsParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list agents params -func (o *ListAgentsParams) WithTimeout(timeout time.Duration) *ListAgentsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list agents params -func (o *ListAgentsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list agents params -func (o *ListAgentsParams) WithContext(ctx context.Context) *ListAgentsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list agents params -func (o *ListAgentsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list agents params -func (o *ListAgentsParams) WithHTTPClient(client *http.Client) *ListAgentsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list agents params -func (o *ListAgentsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithNodeID adds the nodeID to the list agents params -func (o *ListAgentsParams) WithNodeID(nodeID *string) *ListAgentsParams { - o.SetNodeID(nodeID) - return o -} - -// SetNodeID adds the nodeId to the list agents params -func (o *ListAgentsParams) SetNodeID(nodeID *string) { - o.NodeID = nodeID -} - -// WithServiceID adds the serviceID to the list agents params -func (o *ListAgentsParams) WithServiceID(serviceID *string) *ListAgentsParams { - o.SetServiceID(serviceID) - return o -} - -// SetServiceID adds the serviceId to the list agents params -func (o *ListAgentsParams) SetServiceID(serviceID *string) { - o.ServiceID = serviceID -} - -// 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 - } - var res []error - - if o.NodeID != nil { - - // query param node_id - var qrNodeID string - - if o.NodeID != nil { - qrNodeID = *o.NodeID - } - qNodeID := qrNodeID - if qNodeID != "" { - if err := r.SetQueryParam("node_id", qNodeID); err != nil { - return err - } - } - } - - if o.ServiceID != nil { - - // query param service_id - var qrServiceID string - - if o.ServiceID != nil { - qrServiceID = *o.ServiceID - } - qServiceID := qrServiceID - if qServiceID != "" { - if err := r.SetQueryParam("service_id", qServiceID); err != nil { - return err - } - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} 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 deleted file mode 100644 index 506ff583fc2..00000000000 --- a/api/management/v1/json/client/management_service/list_agents_responses.go +++ /dev/null @@ -1,1199 +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" -) - -// ListAgentsReader is a Reader for the ListAgents structure. -type ListAgentsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListAgentsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewListAgentsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewListAgentsDefault(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 - } -} - -// NewListAgentsOK creates a ListAgentsOK with default headers values -func NewListAgentsOK() *ListAgentsOK { - return &ListAgentsOK{} -} - -/* -ListAgentsOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type ListAgentsOK struct { - Payload *ListAgentsOKBody -} - -// IsSuccess returns true when this list agents Ok response has a 2xx status code -func (o *ListAgentsOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this list agents Ok response has a 3xx status code -func (o *ListAgentsOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this list agents Ok response has a 4xx status code -func (o *ListAgentsOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this list agents Ok response has a 5xx status code -func (o *ListAgentsOK) IsServerError() bool { - return false -} - -// IsCode returns true when this list agents Ok response a status code equal to that given -func (o *ListAgentsOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the list agents Ok response -func (o *ListAgentsOK) Code() int { - return 200 -} - -func (o *ListAgentsOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/management/agents][%d] listAgentsOk %s", 200, payload) -} - -func (o *ListAgentsOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/management/agents][%d] listAgentsOk %s", 200, payload) -} - -func (o *ListAgentsOK) GetPayload() *ListAgentsOKBody { - return o.Payload -} - -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) { - return err - } - - return nil -} - -// NewListAgentsDefault creates a ListAgentsDefault with default headers values -func NewListAgentsDefault(code int) *ListAgentsDefault { - return &ListAgentsDefault{ - _statusCode: code, - } -} - -/* -ListAgentsDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type ListAgentsDefault struct { - _statusCode int - - Payload *ListAgentsDefaultBody -} - -// IsSuccess returns true when this list agents default response has a 2xx status code -func (o *ListAgentsDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this list agents default response has a 3xx status code -func (o *ListAgentsDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this list agents default response has a 4xx status code -func (o *ListAgentsDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this list agents default response has a 5xx status code -func (o *ListAgentsDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this list agents default response a status code equal to that given -func (o *ListAgentsDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the list agents default response -func (o *ListAgentsDefault) Code() int { - return o._statusCode -} - -func (o *ListAgentsDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/management/agents][%d] ListAgents default %s", o._statusCode, payload) -} - -func (o *ListAgentsDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/management/agents][%d] ListAgents default %s", o._statusCode, payload) -} - -func (o *ListAgentsDefault) GetPayload() *ListAgentsDefaultBody { - return o.Payload -} - -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) { - return err - } - - return nil -} - -/* -ListAgentsDefaultBody list agents default body -swagger:model ListAgentsDefaultBody -*/ -type ListAgentsDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*ListAgentsDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this list agents default body -func (o *ListAgentsDefaultBody) 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 *ListAgentsDefaultBody) 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("ListAgents default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("ListAgents default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this list agents default body based on the context it is used -func (o *ListAgentsDefaultBody) 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 *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 - return nil - } - - if err := o.Details[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("ListAgents default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("ListAgents default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListAgentsDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAgentsDefaultBody) UnmarshalBinary(b []byte) error { - var res ListAgentsDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -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:"-"` -} - -// 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"` - } - if err := json.Unmarshal(data, &stage1); err != nil { - return err - } - var rcv ListAgentsDefaultBodyDetailsItems0 - - 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.ListAgentsDefaultBodyDetailsItems0 = result - } - - return nil -} - -// 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"` - } - - stage1.AtType = o.AtType - - // make JSON object for known properties - props, err := json.Marshal(stage1) - if err != nil { - return nil, err - } - - if len(o.ListAgentsDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.ListAgentsDefaultBodyDetailsItems0) - 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 list agents default body details items0 -func (o *ListAgentsDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list agents default body details items0 based on context it is used -func (o *ListAgentsDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListAgentsDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAgentsDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res ListAgentsDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListAgentsOKBody list agents OK body -swagger:model ListAgentsOKBody -*/ -type ListAgentsOKBody struct { - // List of Agents. - Agents []*ListAgentsOKBodyAgentsItems0 `json:"agents"` -} - -// Validate validates this list agents OK body -func (o *ListAgentsOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateAgents(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListAgentsOKBody) validateAgents(formats strfmt.Registry) error { - if swag.IsZero(o.Agents) { // not required - return nil - } - - for i := 0; i < len(o.Agents); i++ { - if swag.IsZero(o.Agents[i]) { // not required - continue - } - - if o.Agents[i] != nil { - if err := o.Agents[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listAgentsOk" + "." + "agents" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listAgentsOk" + "." + "agents" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this list agents OK body based on the context it is used -func (o *ListAgentsOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateAgents(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -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 - return nil - } - - if err := o.Agents[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listAgentsOk" + "." + "agents" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listAgentsOk" + "." + "agents" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListAgentsOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAgentsOKBody) UnmarshalBinary(b []byte) error { - var res ListAgentsOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListAgentsOKBodyAgentsItems0 list agents OK body agents items0 -swagger:model ListAgentsOKBodyAgentsItems0 -*/ -type ListAgentsOKBodyAgentsItems0 struct { - // Unique agent identifier. - AgentID string `json:"agent_id,omitempty"` - - // True if the agent password is set. - IsAgentPasswordSet bool `json:"is_agent_password_set,omitempty"` - - // Agent type. - AgentType string `json:"agent_type,omitempty"` - - // AWS Access Key. - AWSAccessKey string `json:"aws_access_key,omitempty"` - - // True if AWS Secret Key is set. - IsAWSSecretKeySet bool `json:"is_aws_secret_key_set,omitempty"` - - // Creation timestamp. - // Format: date-time - CreatedAt strfmt.DateTime `json:"created_at,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `json:"disabled,omitempty"` - - // List of disabled collector names. - DisabledCollectors []string `json:"disabled_collectors"` - - // 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"` - - // Limit query log size in QAN. - MaxQueryLogSize string `json:"max_query_log_size,omitempty"` - - // Path under which metrics are exposed, used to generate URI. - MetricsPath string `json:"metrics_path,omitempty"` - - // Scheme to generate URI to exporter metrics endpoints. - MetricsScheme string `json:"metrics_scheme,omitempty"` - - // A unique node identifier. - NodeID string `json:"node_id,omitempty"` - - // True if password for connecting the agent to the database is set. - IsPasswordSet bool `json:"is_password_set,omitempty"` - - // The pmm-agent identifier. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Path to exec process. - ProcessExecPath string `json:"process_exec_path,omitempty"` - - // True if exporter uses push metrics mode. - PushMetrics bool `json:"push_metrics,omitempty"` - - // True if query examples are disabled. - QueryExamplesDisabled bool `json:"query_examples_disabled,omitempty"` - - // True if query comments parsing is disabled. - CommentsParsingDisabled bool `json:"comments_parsing_disabled,omitempty"` - - // True if RDS basic metrics are disdabled. - RDSBasicMetricsDisabled bool `json:"rds_basic_metrics_disabled,omitempty"` - - // True if RDS enhanced metrics are disdabled. - RDSEnhancedMetricsDisabled bool `json:"rds_enhanced_metrics_disabled,omitempty"` - - // Node identifier where this instance runs. - RunsOnNodeID string `json:"runs_on_node_id,omitempty"` - - // Service identifier. - ServiceID string `json:"service_id,omitempty"` - - // Actual Agent status. - Status string `json:"status,omitempty"` - - // Last known table count. - TableCount int32 `json:"table_count,omitempty"` - - // Tablestats group collectors are disabled if there are more than that number of tables. - // 0 means tablestats group collectors are always enabled (no limit). - // Negative value means tablestats group collectors are always disabled. - TableCountTablestatsGroupLimit int32 `json:"table_count_tablestats_group_limit,omitempty"` - - // Use TLS for database connections. - TLS bool `json:"tls,omitempty"` - - // Skip TLS certificate and hostname validation. - TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - - // HTTP basic auth username for collecting metrics. - Username string `json:"username,omitempty"` - - // Last update timestamp. - // Format: date-time - UpdatedAt strfmt.DateTime `json:"updated_at,omitempty"` - - // Agent version. - Version string `json:"version,omitempty"` - - // True if Agent is running and connected to pmm-managed. - IsConnected bool `json:"is_connected,omitempty"` - - // 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"` - - // mongo db options - MongoDBOptions *ListAgentsOKBodyAgentsItems0MongoDBOptions `json:"mongo_db_options,omitempty"` - - // mysql options - MysqlOptions *ListAgentsOKBodyAgentsItems0MysqlOptions `json:"mysql_options,omitempty"` - - // postgresql options - PostgresqlOptions *ListAgentsOKBodyAgentsItems0PostgresqlOptions `json:"postgresql_options,omitempty"` -} - -// Validate validates this list agents OK body agents items0 -func (o *ListAgentsOKBodyAgentsItems0) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := o.validateLogLevel(formats); err != nil { - res = append(res, err) - } - - if err := o.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if err := o.validateAzureOptions(formats); err != nil { - res = append(res, err) - } - - if err := o.validateMongoDBOptions(formats); err != nil { - res = append(res, err) - } - - if err := o.validateMysqlOptions(formats); err != nil { - res = append(res, err) - } - - if err := o.validatePostgresqlOptions(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListAgentsOKBodyAgentsItems0) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(o.CreatedAt) { // not required - return nil - } - - if err := validate.FormatOf("created_at", "body", "date-time", o.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -var listAgentsOkBodyAgentsItems0TypeLogLevelPropEnum []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 { - listAgentsOkBodyAgentsItems0TypeLogLevelPropEnum = append(listAgentsOkBodyAgentsItems0TypeLogLevelPropEnum, v) - } -} - -const ( - - // ListAgentsOKBodyAgentsItems0LogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - ListAgentsOKBodyAgentsItems0LogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // ListAgentsOKBodyAgentsItems0LogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - ListAgentsOKBodyAgentsItems0LogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // ListAgentsOKBodyAgentsItems0LogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - ListAgentsOKBodyAgentsItems0LogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // ListAgentsOKBodyAgentsItems0LogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - ListAgentsOKBodyAgentsItems0LogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // ListAgentsOKBodyAgentsItems0LogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - ListAgentsOKBodyAgentsItems0LogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // ListAgentsOKBodyAgentsItems0LogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - ListAgentsOKBodyAgentsItems0LogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -func (o *ListAgentsOKBodyAgentsItems0) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, listAgentsOkBodyAgentsItems0TypeLogLevelPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ListAgentsOKBodyAgentsItems0) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("log_level", "body", *o.LogLevel); err != nil { - return err - } - - 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 - } - - if o.MongoDBOptions != nil { - if err := o.MongoDBOptions.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("mongo_db_options") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("mongo_db_options") - } - - return err - } - } - - return nil -} - -func (o *ListAgentsOKBodyAgentsItems0) validateMysqlOptions(formats strfmt.Registry) error { - if swag.IsZero(o.MysqlOptions) { // not required - return nil - } - - if o.MysqlOptions != nil { - if err := o.MysqlOptions.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("mysql_options") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("mysql_options") - } - - return err - } - } - - return nil -} - -func (o *ListAgentsOKBodyAgentsItems0) validatePostgresqlOptions(formats strfmt.Registry) error { - if swag.IsZero(o.PostgresqlOptions) { // not required - return nil - } - - if o.PostgresqlOptions != nil { - if err := o.PostgresqlOptions.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("postgresql_options") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("postgresql_options") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this list agents OK body agents items0 based on the context it is used -func (o *ListAgentsOKBodyAgentsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateAzureOptions(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateMongoDBOptions(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateMysqlOptions(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidatePostgresqlOptions(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListAgentsOKBodyAgentsItems0) contextValidateAzureOptions(ctx context.Context, formats strfmt.Registry) error { - if o.AzureOptions != nil { - - if swag.IsZero(o.AzureOptions) { // not required - return nil - } - - if err := o.AzureOptions.ContextValidate(ctx, 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) contextValidateMongoDBOptions(ctx context.Context, formats strfmt.Registry) error { - if o.MongoDBOptions != nil { - - if swag.IsZero(o.MongoDBOptions) { // not required - return nil - } - - if err := o.MongoDBOptions.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("mongo_db_options") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("mongo_db_options") - } - - return err - } - } - - return nil -} - -func (o *ListAgentsOKBodyAgentsItems0) contextValidateMysqlOptions(ctx context.Context, formats strfmt.Registry) error { - if o.MysqlOptions != nil { - - if swag.IsZero(o.MysqlOptions) { // not required - return nil - } - - if err := o.MysqlOptions.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("mysql_options") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("mysql_options") - } - - return err - } - } - - return nil -} - -func (o *ListAgentsOKBodyAgentsItems0) contextValidatePostgresqlOptions(ctx context.Context, formats strfmt.Registry) error { - if o.PostgresqlOptions != nil { - - if swag.IsZero(o.PostgresqlOptions) { // not required - return nil - } - - if err := o.PostgresqlOptions.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("postgresql_options") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("postgresql_options") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListAgentsOKBodyAgentsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAgentsOKBodyAgentsItems0) UnmarshalBinary(b []byte) error { - var res ListAgentsOKBodyAgentsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListAgentsOKBodyAgentsItems0AzureOptions list agents OK body agents items0 azure options -swagger:model ListAgentsOKBodyAgentsItems0AzureOptions -*/ -type ListAgentsOKBodyAgentsItems0AzureOptions struct { - // Azure client ID. - ClientID string `json:"client_id,omitempty"` - - // True if Azure client secret is set. - IsClientSecretSet bool `json:"is_client_secret_set,omitempty"` - - // Azure resource group. - ResourceGroup string `json:"resource_group,omitempty"` - - // Azure subscription ID. - SubscriptionID string `json:"subscription_id,omitempty"` - - // Azure tenant ID. - TenantID string `json:"tenant_id,omitempty"` -} - -// Validate validates this list agents OK body agents items0 azure options -func (o *ListAgentsOKBodyAgentsItems0AzureOptions) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list agents OK body agents items0 azure options based on context it is used -func (o *ListAgentsOKBodyAgentsItems0AzureOptions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListAgentsOKBodyAgentsItems0AzureOptions) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAgentsOKBodyAgentsItems0AzureOptions) UnmarshalBinary(b []byte) error { - var res ListAgentsOKBodyAgentsItems0AzureOptions - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListAgentsOKBodyAgentsItems0MongoDBOptions list agents OK body agents items0 mongo DB options -swagger:model ListAgentsOKBodyAgentsItems0MongoDBOptions -*/ -type ListAgentsOKBodyAgentsItems0MongoDBOptions struct { - // True if TLS certificate is set. - IsTLSCertificateKeySet bool `json:"is_tls_certificate_key_set,omitempty"` - - // True if TLS certificate file password is set. - IsTLSCertificateKeyFilePasswordSet bool `json:"is_tls_certificate_key_file_password_set,omitempty"` - - // MongoDB auth mechanism. - AuthenticationMechanism string `json:"authentication_mechanism,omitempty"` - - // MongoDB auth database. - AuthenticationDatabase string `json:"authentication_database,omitempty"` - - // MongoDB stats collections. - StatsCollections []string `json:"stats_collections"` - - // MongoDB collections limit. - CollectionsLimit int32 `json:"collections_limit,omitempty"` - - // True if all collectors are enabled. - EnableAllCollectors bool `json:"enable_all_collectors,omitempty"` -} - -// Validate validates this list agents OK body agents items0 mongo DB options -func (o *ListAgentsOKBodyAgentsItems0MongoDBOptions) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list agents OK body agents items0 mongo DB options based on context it is used -func (o *ListAgentsOKBodyAgentsItems0MongoDBOptions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListAgentsOKBodyAgentsItems0MongoDBOptions) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAgentsOKBodyAgentsItems0MongoDBOptions) UnmarshalBinary(b []byte) error { - var res ListAgentsOKBodyAgentsItems0MongoDBOptions - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListAgentsOKBodyAgentsItems0MysqlOptions list agents OK body agents items0 mysql options -swagger:model ListAgentsOKBodyAgentsItems0MysqlOptions -*/ -type ListAgentsOKBodyAgentsItems0MysqlOptions struct { - // True if TLS key is set. - IsTLSKeySet bool `json:"is_tls_key_set,omitempty"` - - // Extra DSN parameters for MySQL connection. - ExtraDsnParams map[string]string `json:"extra_dsn_params,omitempty"` -} - -// Validate validates this list agents OK body agents items0 mysql options -func (o *ListAgentsOKBodyAgentsItems0MysqlOptions) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list agents OK body agents items0 mysql options based on context it is used -func (o *ListAgentsOKBodyAgentsItems0MysqlOptions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListAgentsOKBodyAgentsItems0MysqlOptions) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAgentsOKBodyAgentsItems0MysqlOptions) UnmarshalBinary(b []byte) error { - var res ListAgentsOKBodyAgentsItems0MysqlOptions - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListAgentsOKBodyAgentsItems0PostgresqlOptions list agents OK body agents items0 postgresql options -swagger:model ListAgentsOKBodyAgentsItems0PostgresqlOptions -*/ -type ListAgentsOKBodyAgentsItems0PostgresqlOptions struct { - // True if TLS key is set. - IsSslKeySet bool `json:"is_ssl_key_set,omitempty"` - - // Limit of databases for auto-discovery. - AutoDiscoveryLimit int32 `json:"auto_discovery_limit,omitempty"` - - // Maximum number of connections from exporter to PostgreSQL instance. - MaxExporterConnections int32 `json:"max_exporter_connections,omitempty"` -} - -// Validate validates this list agents OK body agents items0 postgresql options -func (o *ListAgentsOKBodyAgentsItems0PostgresqlOptions) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list agents OK body agents items0 postgresql options based on context it is used -func (o *ListAgentsOKBodyAgentsItems0PostgresqlOptions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListAgentsOKBodyAgentsItems0PostgresqlOptions) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAgentsOKBodyAgentsItems0PostgresqlOptions) UnmarshalBinary(b []byte) error { - var res ListAgentsOKBodyAgentsItems0PostgresqlOptions - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} 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 deleted file mode 100644 index 441e42660e2..00000000000 --- a/api/management/v1/json/client/management_service/list_nodes_parameters.go +++ /dev/null @@ -1,171 +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" -) - -// NewListNodesParams creates a new ListNodesParams 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 NewListNodesParams() *ListNodesParams { - return &ListNodesParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListNodesParamsWithTimeout creates a new ListNodesParams object -// with the ability to set a timeout on a request. -func NewListNodesParamsWithTimeout(timeout time.Duration) *ListNodesParams { - return &ListNodesParams{ - timeout: timeout, - } -} - -// NewListNodesParamsWithContext creates a new ListNodesParams object -// with the ability to set a context for a request. -func NewListNodesParamsWithContext(ctx context.Context) *ListNodesParams { - return &ListNodesParams{ - Context: ctx, - } -} - -// NewListNodesParamsWithHTTPClient creates a new ListNodesParams object -// with the ability to set a custom HTTPClient for a request. -func NewListNodesParamsWithHTTPClient(client *http.Client) *ListNodesParams { - return &ListNodesParams{ - HTTPClient: client, - } -} - -/* -ListNodesParams contains all the parameters to send to the API endpoint - - for the list nodes operation. - - Typically these are written to a http.Request. -*/ -type ListNodesParams struct { - /* NodeType. - - Node type to be filtered out. - - Default: "NODE_TYPE_UNSPECIFIED" - */ - NodeType *string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list nodes params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListNodesParams) WithDefaults() *ListNodesParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list nodes params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListNodesParams) SetDefaults() { - nodeTypeDefault := string("NODE_TYPE_UNSPECIFIED") - - val := ListNodesParams{ - NodeType: &nodeTypeDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the list nodes params -func (o *ListNodesParams) WithTimeout(timeout time.Duration) *ListNodesParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list nodes params -func (o *ListNodesParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list nodes params -func (o *ListNodesParams) WithContext(ctx context.Context) *ListNodesParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list nodes params -func (o *ListNodesParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list nodes params -func (o *ListNodesParams) WithHTTPClient(client *http.Client) *ListNodesParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list nodes params -func (o *ListNodesParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithNodeType adds the nodeType to the list nodes params -func (o *ListNodesParams) WithNodeType(nodeType *string) *ListNodesParams { - o.SetNodeType(nodeType) - return o -} - -// SetNodeType adds the nodeType to the list nodes params -func (o *ListNodesParams) SetNodeType(nodeType *string) { - o.NodeType = nodeType -} - -// 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 - } - var res []error - - if o.NodeType != nil { - - // query param node_type - var qrNodeType string - - if o.NodeType != nil { - qrNodeType = *o.NodeType - } - qNodeType := qrNodeType - if qNodeType != "" { - if err := r.SetQueryParam("node_type", qNodeType); err != nil { - return err - } - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} 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 deleted file mode 100644 index 7e00c929b8a..00000000000 --- a/api/management/v1/json/client/management_service/list_nodes_responses.go +++ /dev/null @@ -1,935 +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" -) - -// ListNodesReader is a Reader for the ListNodes structure. -type ListNodesReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListNodesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewListNodesOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewListNodesDefault(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 - } -} - -// NewListNodesOK creates a ListNodesOK with default headers values -func NewListNodesOK() *ListNodesOK { - return &ListNodesOK{} -} - -/* -ListNodesOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type ListNodesOK struct { - Payload *ListNodesOKBody -} - -// IsSuccess returns true when this list nodes Ok response has a 2xx status code -func (o *ListNodesOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this list nodes Ok response has a 3xx status code -func (o *ListNodesOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this list nodes Ok response has a 4xx status code -func (o *ListNodesOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this list nodes Ok response has a 5xx status code -func (o *ListNodesOK) IsServerError() bool { - return false -} - -// IsCode returns true when this list nodes Ok response a status code equal to that given -func (o *ListNodesOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the list nodes Ok response -func (o *ListNodesOK) Code() int { - return 200 -} - -func (o *ListNodesOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/management/nodes][%d] listNodesOk %s", 200, payload) -} - -func (o *ListNodesOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/management/nodes][%d] listNodesOk %s", 200, payload) -} - -func (o *ListNodesOK) GetPayload() *ListNodesOKBody { - return o.Payload -} - -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) { - return err - } - - return nil -} - -// NewListNodesDefault creates a ListNodesDefault with default headers values -func NewListNodesDefault(code int) *ListNodesDefault { - return &ListNodesDefault{ - _statusCode: code, - } -} - -/* -ListNodesDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type ListNodesDefault struct { - _statusCode int - - Payload *ListNodesDefaultBody -} - -// IsSuccess returns true when this list nodes default response has a 2xx status code -func (o *ListNodesDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this list nodes default response has a 3xx status code -func (o *ListNodesDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this list nodes default response has a 4xx status code -func (o *ListNodesDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this list nodes default response has a 5xx status code -func (o *ListNodesDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this list nodes default response a status code equal to that given -func (o *ListNodesDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the list nodes default response -func (o *ListNodesDefault) Code() int { - return o._statusCode -} - -func (o *ListNodesDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/management/nodes][%d] ListNodes default %s", o._statusCode, payload) -} - -func (o *ListNodesDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/management/nodes][%d] ListNodes default %s", o._statusCode, payload) -} - -func (o *ListNodesDefault) GetPayload() *ListNodesDefaultBody { - return o.Payload -} - -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) { - return err - } - - return nil -} - -/* -ListNodesDefaultBody list nodes default body -swagger:model ListNodesDefaultBody -*/ -type ListNodesDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*ListNodesDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this list nodes default body -func (o *ListNodesDefaultBody) 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 *ListNodesDefaultBody) 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("ListNodes default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("ListNodes default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this list nodes default body based on the context it is used -func (o *ListNodesDefaultBody) 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 *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 - return nil - } - - if err := o.Details[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("ListNodes default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("ListNodes default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListNodesDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListNodesDefaultBody) UnmarshalBinary(b []byte) error { - var res ListNodesDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -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:"-"` -} - -// 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"` - } - if err := json.Unmarshal(data, &stage1); err != nil { - return err - } - var rcv ListNodesDefaultBodyDetailsItems0 - - 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.ListNodesDefaultBodyDetailsItems0 = result - } - - return nil -} - -// 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"` - } - - stage1.AtType = o.AtType - - // make JSON object for known properties - props, err := json.Marshal(stage1) - if err != nil { - return nil, err - } - - if len(o.ListNodesDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.ListNodesDefaultBodyDetailsItems0) - 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 list nodes default body details items0 -func (o *ListNodesDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list nodes default body details items0 based on context it is used -func (o *ListNodesDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListNodesDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListNodesDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res ListNodesDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListNodesOKBody list nodes OK body -swagger:model ListNodesOKBody -*/ -type ListNodesOKBody struct { - // nodes - Nodes []*ListNodesOKBodyNodesItems0 `json:"nodes"` -} - -// Validate validates this list nodes OK body -func (o *ListNodesOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateNodes(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListNodesOKBody) validateNodes(formats strfmt.Registry) error { - if swag.IsZero(o.Nodes) { // not required - return nil - } - - for i := 0; i < len(o.Nodes); i++ { - if swag.IsZero(o.Nodes[i]) { // not required - continue - } - - if o.Nodes[i] != nil { - if err := o.Nodes[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listNodesOk" + "." + "nodes" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listNodesOk" + "." + "nodes" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this list nodes OK body based on the context it is used -func (o *ListNodesOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateNodes(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -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 - return nil - } - - if err := o.Nodes[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listNodesOk" + "." + "nodes" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listNodesOk" + "." + "nodes" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListNodesOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListNodesOKBody) UnmarshalBinary(b []byte) error { - var res ListNodesOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListNodesOKBodyNodesItems0 list nodes OK body nodes items0 -swagger:model ListNodesOKBodyNodesItems0 -*/ -type ListNodesOKBodyNodesItems0 struct { - // Unique Node identifier. - NodeID string `json:"node_id,omitempty"` - - // Node type. - NodeType string `json:"node_type,omitempty"` - - // User-defined node name. - NodeName string `json:"node_name,omitempty"` - - // Linux machine-id. - MachineID string `json:"machine_id,omitempty"` - - // Linux distribution name and version. - Distro string `json:"distro,omitempty"` - - // Node model. - NodeModel string `json:"node_model,omitempty"` - - // A node's unique docker container identifier. - ContainerID string `json:"container_id,omitempty"` - - // Container name. - ContainerName string `json:"container_name,omitempty"` - - // Node address (DNS name or IP). - Address string `json:"address,omitempty"` - - // Node region. - Region string `json:"region,omitempty"` - - // Node availability zone. - Az string `json:"az,omitempty"` - - // Custom user-assigned labels for Node. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // Creation timestamp. - // Format: date-time - CreatedAt strfmt.DateTime `json:"created_at,omitempty"` - - // Last update timestamp. - // 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"` - - // List of services running on this node. - Services []*ListNodesOKBodyNodesItems0ServicesItems0 `json:"services"` - - // Instance ID for cloud providers (e.g. AWS RDS). - InstanceID string `json:"instance_id,omitempty"` -} - -// Validate validates this list nodes OK body nodes items0 -func (o *ListNodesOKBodyNodesItems0) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := o.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if err := o.validateStatus(formats); err != nil { - res = append(res, err) - } - - if err := o.validateAgents(formats); err != nil { - res = append(res, err) - } - - if err := o.validateServices(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListNodesOKBodyNodesItems0) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(o.CreatedAt) { // not required - return nil - } - - if err := validate.FormatOf("created_at", "body", "date-time", o.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (o *ListNodesOKBodyNodesItems0) 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 -} - -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 - } - - for i := 0; i < len(o.Agents); i++ { - if swag.IsZero(o.Agents[i]) { // not required - continue - } - - if o.Agents[i] != nil { - if err := o.Agents[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("agents" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("agents" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -func (o *ListNodesOKBodyNodesItems0) validateServices(formats strfmt.Registry) error { - if swag.IsZero(o.Services) { // not required - return nil - } - - for i := 0; i < len(o.Services); i++ { - if swag.IsZero(o.Services[i]) { // not required - continue - } - - if o.Services[i] != nil { - if err := o.Services[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("services" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("services" + "." + strconv.Itoa(i)) - } - - 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 - - if err := o.contextValidateAgents(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateServices(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -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 - return nil - } - - if err := o.Agents[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("agents" + "." + strconv.Itoa(i)) - } - 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 - return nil - } - - if err := o.Services[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("services" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("services" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListNodesOKBodyNodesItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListNodesOKBodyNodesItems0) UnmarshalBinary(b []byte) error { - var res ListNodesOKBodyNodesItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListNodesOKBodyNodesItems0AgentsItems0 list nodes OK body nodes items0 agents items0 -swagger:model ListNodesOKBodyNodesItems0AgentsItems0 -*/ -type ListNodesOKBodyNodesItems0AgentsItems0 struct { - // Unique Agent identifier. - AgentID string `json:"agent_id,omitempty"` - - // Agent type. - AgentType string `json:"agent_type,omitempty"` - - // Actual Agent status. - Status string `json:"status,omitempty"` - - // True if Agent is running and connected to pmm-managed. - IsConnected bool `json:"is_connected,omitempty"` -} - -// Validate validates this list nodes OK body nodes items0 agents items0 -func (o *ListNodesOKBodyNodesItems0AgentsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list nodes OK body nodes items0 agents items0 based on context it is used -func (o *ListNodesOKBodyNodesItems0AgentsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListNodesOKBodyNodesItems0AgentsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListNodesOKBodyNodesItems0AgentsItems0) UnmarshalBinary(b []byte) error { - var res ListNodesOKBodyNodesItems0AgentsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListNodesOKBodyNodesItems0ServicesItems0 Service represents a service running on a node. -swagger:model ListNodesOKBodyNodesItems0ServicesItems0 -*/ -type ListNodesOKBodyNodesItems0ServicesItems0 struct { - // Unique Service identifier. - ServiceID string `json:"service_id,omitempty"` - - // Service type. - ServiceType string `json:"service_type,omitempty"` - - // Service name. - ServiceName string `json:"service_name,omitempty"` -} - -// Validate validates this list nodes OK body nodes items0 services items0 -func (o *ListNodesOKBodyNodesItems0ServicesItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list nodes OK body nodes items0 services items0 based on context it is used -func (o *ListNodesOKBodyNodesItems0ServicesItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListNodesOKBodyNodesItems0ServicesItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListNodesOKBodyNodesItems0ServicesItems0) UnmarshalBinary(b []byte) error { - var res ListNodesOKBodyNodesItems0ServicesItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} 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 deleted file mode 100644 index 80363638efa..00000000000 --- a/api/management/v1/json/client/management_service/list_services_parameters.go +++ /dev/null @@ -1,237 +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" -) - -// NewListServicesParams creates a new ListServicesParams 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 NewListServicesParams() *ListServicesParams { - return &ListServicesParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListServicesParamsWithTimeout creates a new ListServicesParams object -// with the ability to set a timeout on a request. -func NewListServicesParamsWithTimeout(timeout time.Duration) *ListServicesParams { - return &ListServicesParams{ - timeout: timeout, - } -} - -// NewListServicesParamsWithContext creates a new ListServicesParams object -// with the ability to set a context for a request. -func NewListServicesParamsWithContext(ctx context.Context) *ListServicesParams { - return &ListServicesParams{ - Context: ctx, - } -} - -// NewListServicesParamsWithHTTPClient creates a new ListServicesParams object -// with the ability to set a custom HTTPClient for a request. -func NewListServicesParamsWithHTTPClient(client *http.Client) *ListServicesParams { - return &ListServicesParams{ - HTTPClient: client, - } -} - -/* -ListServicesParams contains all the parameters to send to the API endpoint - - for the list services operation. - - Typically these are written to a http.Request. -*/ -type ListServicesParams struct { - /* ExternalGroup. - - Return only services in this external group. - */ - ExternalGroup *string - - /* NodeID. - - Return only Services running on that Node. - */ - NodeID *string - - /* ServiceType. - - Return only services filtered by service type. - - Default: "SERVICE_TYPE_UNSPECIFIED" - */ - ServiceType *string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list services params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListServicesParams) WithDefaults() *ListServicesParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list services params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListServicesParams) SetDefaults() { - serviceTypeDefault := string("SERVICE_TYPE_UNSPECIFIED") - - val := ListServicesParams{ - ServiceType: &serviceTypeDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the list services params -func (o *ListServicesParams) WithTimeout(timeout time.Duration) *ListServicesParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list services params -func (o *ListServicesParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list services params -func (o *ListServicesParams) WithContext(ctx context.Context) *ListServicesParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list services params -func (o *ListServicesParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list services params -func (o *ListServicesParams) WithHTTPClient(client *http.Client) *ListServicesParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list services params -func (o *ListServicesParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithExternalGroup adds the externalGroup to the list services params -func (o *ListServicesParams) WithExternalGroup(externalGroup *string) *ListServicesParams { - o.SetExternalGroup(externalGroup) - return o -} - -// SetExternalGroup adds the externalGroup to the list services params -func (o *ListServicesParams) SetExternalGroup(externalGroup *string) { - o.ExternalGroup = externalGroup -} - -// WithNodeID adds the nodeID to the list services params -func (o *ListServicesParams) WithNodeID(nodeID *string) *ListServicesParams { - o.SetNodeID(nodeID) - return o -} - -// SetNodeID adds the nodeId to the list services params -func (o *ListServicesParams) SetNodeID(nodeID *string) { - o.NodeID = nodeID -} - -// WithServiceType adds the serviceType to the list services params -func (o *ListServicesParams) WithServiceType(serviceType *string) *ListServicesParams { - o.SetServiceType(serviceType) - return o -} - -// SetServiceType adds the serviceType to the list services params -func (o *ListServicesParams) SetServiceType(serviceType *string) { - o.ServiceType = serviceType -} - -// 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 - } - var res []error - - if o.ExternalGroup != nil { - - // query param external_group - var qrExternalGroup string - - if o.ExternalGroup != nil { - qrExternalGroup = *o.ExternalGroup - } - qExternalGroup := qrExternalGroup - if qExternalGroup != "" { - if err := r.SetQueryParam("external_group", qExternalGroup); err != nil { - return err - } - } - } - - if o.NodeID != nil { - - // query param node_id - var qrNodeID string - - if o.NodeID != nil { - qrNodeID = *o.NodeID - } - qNodeID := qrNodeID - if qNodeID != "" { - if err := r.SetQueryParam("node_id", qNodeID); err != nil { - return err - } - } - } - - if o.ServiceType != nil { - - // query param service_type - var qrServiceType string - - if o.ServiceType != nil { - qrServiceType = *o.ServiceType - } - qServiceType := qrServiceType - if qServiceType != "" { - if err := r.SetQueryParam("service_type", qServiceType); err != nil { - return err - } - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} 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 deleted file mode 100644 index 789cd54f392..00000000000 --- a/api/management/v1/json/client/management_service/list_services_responses.go +++ /dev/null @@ -1,1459 +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" -) - -// ListServicesReader is a Reader for the ListServices structure. -type ListServicesReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListServicesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewListServicesOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewListServicesDefault(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 - } -} - -// NewListServicesOK creates a ListServicesOK with default headers values -func NewListServicesOK() *ListServicesOK { - return &ListServicesOK{} -} - -/* -ListServicesOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type ListServicesOK struct { - Payload *ListServicesOKBody -} - -// IsSuccess returns true when this list services Ok response has a 2xx status code -func (o *ListServicesOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this list services Ok response has a 3xx status code -func (o *ListServicesOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this list services Ok response has a 4xx status code -func (o *ListServicesOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this list services Ok response has a 5xx status code -func (o *ListServicesOK) IsServerError() bool { - return false -} - -// IsCode returns true when this list services Ok response a status code equal to that given -func (o *ListServicesOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the list services Ok response -func (o *ListServicesOK) Code() int { - return 200 -} - -func (o *ListServicesOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/management/services][%d] listServicesOk %s", 200, payload) -} - -func (o *ListServicesOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/management/services][%d] listServicesOk %s", 200, payload) -} - -func (o *ListServicesOK) GetPayload() *ListServicesOKBody { - return o.Payload -} - -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) { - return err - } - - return nil -} - -// NewListServicesDefault creates a ListServicesDefault with default headers values -func NewListServicesDefault(code int) *ListServicesDefault { - return &ListServicesDefault{ - _statusCode: code, - } -} - -/* -ListServicesDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type ListServicesDefault struct { - _statusCode int - - Payload *ListServicesDefaultBody -} - -// IsSuccess returns true when this list services default response has a 2xx status code -func (o *ListServicesDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this list services default response has a 3xx status code -func (o *ListServicesDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this list services default response has a 4xx status code -func (o *ListServicesDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this list services default response has a 5xx status code -func (o *ListServicesDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this list services default response a status code equal to that given -func (o *ListServicesDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the list services default response -func (o *ListServicesDefault) Code() int { - return o._statusCode -} - -func (o *ListServicesDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/management/services][%d] ListServices default %s", o._statusCode, payload) -} - -func (o *ListServicesDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/management/services][%d] ListServices default %s", o._statusCode, payload) -} - -func (o *ListServicesDefault) GetPayload() *ListServicesDefaultBody { - return o.Payload -} - -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) { - return err - } - - return nil -} - -/* -ListServicesDefaultBody list services default body -swagger:model ListServicesDefaultBody -*/ -type ListServicesDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*ListServicesDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this list services default body -func (o *ListServicesDefaultBody) 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 *ListServicesDefaultBody) 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("ListServices default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("ListServices default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this list services default body based on the context it is used -func (o *ListServicesDefaultBody) 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 *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 - return nil - } - - if err := o.Details[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("ListServices default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("ListServices default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListServicesDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListServicesDefaultBody) UnmarshalBinary(b []byte) error { - var res ListServicesDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -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:"-"` -} - -// 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"` - } - if err := json.Unmarshal(data, &stage1); err != nil { - return err - } - var rcv ListServicesDefaultBodyDetailsItems0 - - 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.ListServicesDefaultBodyDetailsItems0 = result - } - - return nil -} - -// 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"` - } - - stage1.AtType = o.AtType - - // make JSON object for known properties - props, err := json.Marshal(stage1) - if err != nil { - return nil, err - } - - if len(o.ListServicesDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.ListServicesDefaultBodyDetailsItems0) - 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 list services default body details items0 -func (o *ListServicesDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list services default body details items0 based on context it is used -func (o *ListServicesDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListServicesDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListServicesDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res ListServicesDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListServicesOKBody list services OK body -swagger:model ListServicesOKBody -*/ -type ListServicesOKBody struct { - // List of Services. - Services []*ListServicesOKBodyServicesItems0 `json:"services"` -} - -// Validate validates this list services OK body -func (o *ListServicesOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateServices(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListServicesOKBody) validateServices(formats strfmt.Registry) error { - if swag.IsZero(o.Services) { // not required - return nil - } - - for i := 0; i < len(o.Services); i++ { - if swag.IsZero(o.Services[i]) { // not required - continue - } - - if o.Services[i] != nil { - if err := o.Services[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listServicesOk" + "." + "services" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listServicesOk" + "." + "services" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this list services OK body based on the context it is used -func (o *ListServicesOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateServices(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -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 - return nil - } - - if err := o.Services[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listServicesOk" + "." + "services" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listServicesOk" + "." + "services" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListServicesOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListServicesOKBody) UnmarshalBinary(b []byte) error { - var res ListServicesOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListServicesOKBodyServicesItems0 list services OK body services items0 -swagger:model ListServicesOKBodyServicesItems0 -*/ -type ListServicesOKBodyServicesItems0 struct { - // Unique service identifier. - ServiceID string `json:"service_id,omitempty"` - - // Service type. - ServiceType string `json:"service_type,omitempty"` - - // User-defined name unique across all Services. - ServiceName string `json:"service_name,omitempty"` - - // Database name. - DatabaseName string `json:"database_name,omitempty"` - - // Node identifier where this instance runs. - NodeID string `json:"node_id,omitempty"` - - // Node name where this instance runs. - NodeName string `json:"node_name,omitempty"` - - // Environment name. - Environment string `json:"environment,omitempty"` - - // Cluster name. - Cluster string `json:"cluster,omitempty"` - - // Replication set name. - ReplicationSet string `json:"replication_set,omitempty"` - - // Custom user-assigned labels for Service. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // External group name. - ExternalGroup string `json:"external_group,omitempty"` - - // Access address (DNS name or IP). - // Address (and port) or socket is required. - Address string `json:"address,omitempty"` - - // Access port. - // Port is required when the address present. - Port int64 `json:"port,omitempty"` - - // Access unix socket. - // Address (and port) or socket is required. - Socket string `json:"socket,omitempty"` - - // Creation timestamp. - // Format: date-time - CreatedAt strfmt.DateTime `json:"created_at,omitempty"` - - // Last update timestamp. - // Format: date-time - UpdatedAt strfmt.DateTime `json:"updated_at,omitempty"` - - // List of agents related to this service. - Agents []*ListServicesOKBodyServicesItems0AgentsItems0 `json:"agents"` - - // Service status. - // - // - STATUS_UNSPECIFIED: In case we don't support the db vendor yet. - // - STATUS_UP: The service is up. - // - STATUS_DOWN: The service is down. - // - 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 -func (o *ListServicesOKBodyServicesItems0) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := o.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if err := o.validateAgents(formats); err != nil { - res = append(res, err) - } - - if err := o.validateStatus(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListServicesOKBodyServicesItems0) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(o.CreatedAt) { // not required - return nil - } - - if err := validate.FormatOf("created_at", "body", "date-time", o.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (o *ListServicesOKBodyServicesItems0) 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 *ListServicesOKBodyServicesItems0) validateAgents(formats strfmt.Registry) error { - if swag.IsZero(o.Agents) { // not required - return nil - } - - for i := 0; i < len(o.Agents); i++ { - if swag.IsZero(o.Agents[i]) { // not required - continue - } - - if o.Agents[i] != nil { - if err := o.Agents[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("agents" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("agents" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -var listServicesOkBodyServicesItems0TypeStatusPropEnum []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 { - listServicesOkBodyServicesItems0TypeStatusPropEnum = append(listServicesOkBodyServicesItems0TypeStatusPropEnum, v) - } -} - -const ( - - // ListServicesOKBodyServicesItems0StatusSTATUSUNSPECIFIED captures enum value "STATUS_UNSPECIFIED" - ListServicesOKBodyServicesItems0StatusSTATUSUNSPECIFIED string = "STATUS_UNSPECIFIED" - - // ListServicesOKBodyServicesItems0StatusSTATUSUP captures enum value "STATUS_UP" - ListServicesOKBodyServicesItems0StatusSTATUSUP string = "STATUS_UP" - - // ListServicesOKBodyServicesItems0StatusSTATUSDOWN captures enum value "STATUS_DOWN" - ListServicesOKBodyServicesItems0StatusSTATUSDOWN string = "STATUS_DOWN" - - // ListServicesOKBodyServicesItems0StatusSTATUSUNKNOWN captures enum value "STATUS_UNKNOWN" - ListServicesOKBodyServicesItems0StatusSTATUSUNKNOWN string = "STATUS_UNKNOWN" -) - -// prop value enum -func (o *ListServicesOKBodyServicesItems0) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, listServicesOkBodyServicesItems0TypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ListServicesOKBodyServicesItems0) 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 services OK body services items0 based on the context it is used -func (o *ListServicesOKBodyServicesItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateAgents(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -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 - return nil - } - - if err := o.Agents[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("agents" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("agents" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListServicesOKBodyServicesItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListServicesOKBodyServicesItems0) UnmarshalBinary(b []byte) error { - var res ListServicesOKBodyServicesItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListServicesOKBodyServicesItems0AgentsItems0 list services OK body services items0 agents items0 -swagger:model ListServicesOKBodyServicesItems0AgentsItems0 -*/ -type ListServicesOKBodyServicesItems0AgentsItems0 struct { - // Unique agent identifier. - AgentID string `json:"agent_id,omitempty"` - - // True if the agent password is set. - IsAgentPasswordSet bool `json:"is_agent_password_set,omitempty"` - - // Agent type. - AgentType string `json:"agent_type,omitempty"` - - // AWS Access Key. - AWSAccessKey string `json:"aws_access_key,omitempty"` - - // True if AWS Secret Key is set. - IsAWSSecretKeySet bool `json:"is_aws_secret_key_set,omitempty"` - - // Creation timestamp. - // Format: date-time - CreatedAt strfmt.DateTime `json:"created_at,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // Desired Agent status: enabled (false) or disabled (true). - Disabled bool `json:"disabled,omitempty"` - - // List of disabled collector names. - DisabledCollectors []string `json:"disabled_collectors"` - - // 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"` - - // Limit query log size in QAN. - MaxQueryLogSize string `json:"max_query_log_size,omitempty"` - - // Path under which metrics are exposed, used to generate URI. - MetricsPath string `json:"metrics_path,omitempty"` - - // Scheme to generate URI to exporter metrics endpoints. - MetricsScheme string `json:"metrics_scheme,omitempty"` - - // A unique node identifier. - NodeID string `json:"node_id,omitempty"` - - // True if password for connecting the agent to the database is set. - IsPasswordSet bool `json:"is_password_set,omitempty"` - - // The pmm-agent identifier. - PMMAgentID string `json:"pmm_agent_id,omitempty"` - - // Path to exec process. - ProcessExecPath string `json:"process_exec_path,omitempty"` - - // True if exporter uses push metrics mode. - PushMetrics bool `json:"push_metrics,omitempty"` - - // True if query examples are disabled. - QueryExamplesDisabled bool `json:"query_examples_disabled,omitempty"` - - // True if query comments parsing is disabled. - CommentsParsingDisabled bool `json:"comments_parsing_disabled,omitempty"` - - // True if RDS basic metrics are disdabled. - RDSBasicMetricsDisabled bool `json:"rds_basic_metrics_disabled,omitempty"` - - // True if RDS enhanced metrics are disdabled. - RDSEnhancedMetricsDisabled bool `json:"rds_enhanced_metrics_disabled,omitempty"` - - // Node identifier where this instance runs. - RunsOnNodeID string `json:"runs_on_node_id,omitempty"` - - // Service identifier. - ServiceID string `json:"service_id,omitempty"` - - // Actual Agent status. - Status string `json:"status,omitempty"` - - // Last known table count. - TableCount int32 `json:"table_count,omitempty"` - - // Tablestats group collectors are disabled if there are more than that number of tables. - // 0 means tablestats group collectors are always enabled (no limit). - // Negative value means tablestats group collectors are always disabled. - TableCountTablestatsGroupLimit int32 `json:"table_count_tablestats_group_limit,omitempty"` - - // Use TLS for database connections. - TLS bool `json:"tls,omitempty"` - - // Skip TLS certificate and hostname validation. - TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - - // HTTP basic auth username for collecting metrics. - Username string `json:"username,omitempty"` - - // Last update timestamp. - // Format: date-time - UpdatedAt strfmt.DateTime `json:"updated_at,omitempty"` - - // Agent version. - Version string `json:"version,omitempty"` - - // True if Agent is running and connected to pmm-managed. - IsConnected bool `json:"is_connected,omitempty"` - - // 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"` - - // mongo db options - MongoDBOptions *ListServicesOKBodyServicesItems0AgentsItems0MongoDBOptions `json:"mongo_db_options,omitempty"` - - // mysql options - MysqlOptions *ListServicesOKBodyServicesItems0AgentsItems0MysqlOptions `json:"mysql_options,omitempty"` - - // postgresql options - PostgresqlOptions *ListServicesOKBodyServicesItems0AgentsItems0PostgresqlOptions `json:"postgresql_options,omitempty"` -} - -// Validate validates this list services OK body services items0 agents items0 -func (o *ListServicesOKBodyServicesItems0AgentsItems0) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := o.validateLogLevel(formats); err != nil { - res = append(res, err) - } - - if err := o.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if err := o.validateAzureOptions(formats); err != nil { - res = append(res, err) - } - - if err := o.validateMongoDBOptions(formats); err != nil { - res = append(res, err) - } - - if err := o.validateMysqlOptions(formats); err != nil { - res = append(res, err) - } - - if err := o.validatePostgresqlOptions(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListServicesOKBodyServicesItems0AgentsItems0) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(o.CreatedAt) { // not required - return nil - } - - if err := validate.FormatOf("created_at", "body", "date-time", o.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -var listServicesOkBodyServicesItems0AgentsItems0TypeLogLevelPropEnum []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 { - listServicesOkBodyServicesItems0AgentsItems0TypeLogLevelPropEnum = append(listServicesOkBodyServicesItems0AgentsItems0TypeLogLevelPropEnum, v) - } -} - -const ( - - // ListServicesOKBodyServicesItems0AgentsItems0LogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED" - ListServicesOKBodyServicesItems0AgentsItems0LogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED" - - // ListServicesOKBodyServicesItems0AgentsItems0LogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL" - ListServicesOKBodyServicesItems0AgentsItems0LogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL" - - // ListServicesOKBodyServicesItems0AgentsItems0LogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR" - ListServicesOKBodyServicesItems0AgentsItems0LogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR" - - // ListServicesOKBodyServicesItems0AgentsItems0LogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN" - ListServicesOKBodyServicesItems0AgentsItems0LogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN" - - // ListServicesOKBodyServicesItems0AgentsItems0LogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO" - ListServicesOKBodyServicesItems0AgentsItems0LogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO" - - // ListServicesOKBodyServicesItems0AgentsItems0LogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG" - ListServicesOKBodyServicesItems0AgentsItems0LogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG" -) - -// prop value enum -func (o *ListServicesOKBodyServicesItems0AgentsItems0) validateLogLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, listServicesOkBodyServicesItems0AgentsItems0TypeLogLevelPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ListServicesOKBodyServicesItems0AgentsItems0) validateLogLevel(formats strfmt.Registry) error { - if swag.IsZero(o.LogLevel) { // not required - return nil - } - - // value enum - if err := o.validateLogLevelEnum("log_level", "body", *o.LogLevel); err != nil { - return err - } - - 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 - } - - if o.MongoDBOptions != nil { - if err := o.MongoDBOptions.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("mongo_db_options") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("mongo_db_options") - } - - return err - } - } - - return nil -} - -func (o *ListServicesOKBodyServicesItems0AgentsItems0) validateMysqlOptions(formats strfmt.Registry) error { - if swag.IsZero(o.MysqlOptions) { // not required - return nil - } - - if o.MysqlOptions != nil { - if err := o.MysqlOptions.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("mysql_options") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("mysql_options") - } - - return err - } - } - - return nil -} - -func (o *ListServicesOKBodyServicesItems0AgentsItems0) validatePostgresqlOptions(formats strfmt.Registry) error { - if swag.IsZero(o.PostgresqlOptions) { // not required - return nil - } - - if o.PostgresqlOptions != nil { - if err := o.PostgresqlOptions.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("postgresql_options") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("postgresql_options") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this list services OK body services items0 agents items0 based on the context it is used -func (o *ListServicesOKBodyServicesItems0AgentsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateAzureOptions(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateMongoDBOptions(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateMysqlOptions(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidatePostgresqlOptions(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListServicesOKBodyServicesItems0AgentsItems0) contextValidateAzureOptions(ctx context.Context, formats strfmt.Registry) error { - if o.AzureOptions != nil { - - if swag.IsZero(o.AzureOptions) { // not required - return nil - } - - if err := o.AzureOptions.ContextValidate(ctx, 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) contextValidateMongoDBOptions(ctx context.Context, formats strfmt.Registry) error { - if o.MongoDBOptions != nil { - - if swag.IsZero(o.MongoDBOptions) { // not required - return nil - } - - if err := o.MongoDBOptions.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("mongo_db_options") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("mongo_db_options") - } - - return err - } - } - - return nil -} - -func (o *ListServicesOKBodyServicesItems0AgentsItems0) contextValidateMysqlOptions(ctx context.Context, formats strfmt.Registry) error { - if o.MysqlOptions != nil { - - if swag.IsZero(o.MysqlOptions) { // not required - return nil - } - - if err := o.MysqlOptions.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("mysql_options") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("mysql_options") - } - - return err - } - } - - return nil -} - -func (o *ListServicesOKBodyServicesItems0AgentsItems0) contextValidatePostgresqlOptions(ctx context.Context, formats strfmt.Registry) error { - if o.PostgresqlOptions != nil { - - if swag.IsZero(o.PostgresqlOptions) { // not required - return nil - } - - if err := o.PostgresqlOptions.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("postgresql_options") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("postgresql_options") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListServicesOKBodyServicesItems0AgentsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListServicesOKBodyServicesItems0AgentsItems0) UnmarshalBinary(b []byte) error { - var res ListServicesOKBodyServicesItems0AgentsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListServicesOKBodyServicesItems0AgentsItems0AzureOptions list services OK body services items0 agents items0 azure options -swagger:model ListServicesOKBodyServicesItems0AgentsItems0AzureOptions -*/ -type ListServicesOKBodyServicesItems0AgentsItems0AzureOptions struct { - // Azure client ID. - ClientID string `json:"client_id,omitempty"` - - // True if Azure client secret is set. - IsClientSecretSet bool `json:"is_client_secret_set,omitempty"` - - // Azure resource group. - ResourceGroup string `json:"resource_group,omitempty"` - - // Azure subscription ID. - SubscriptionID string `json:"subscription_id,omitempty"` - - // Azure tenant ID. - TenantID string `json:"tenant_id,omitempty"` -} - -// Validate validates this list services OK body services items0 agents items0 azure options -func (o *ListServicesOKBodyServicesItems0AgentsItems0AzureOptions) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list services OK body services items0 agents items0 azure options based on context it is used -func (o *ListServicesOKBodyServicesItems0AgentsItems0AzureOptions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListServicesOKBodyServicesItems0AgentsItems0AzureOptions) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListServicesOKBodyServicesItems0AgentsItems0AzureOptions) UnmarshalBinary(b []byte) error { - var res ListServicesOKBodyServicesItems0AgentsItems0AzureOptions - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListServicesOKBodyServicesItems0AgentsItems0MongoDBOptions list services OK body services items0 agents items0 mongo DB options -swagger:model ListServicesOKBodyServicesItems0AgentsItems0MongoDBOptions -*/ -type ListServicesOKBodyServicesItems0AgentsItems0MongoDBOptions struct { - // True if TLS certificate is set. - IsTLSCertificateKeySet bool `json:"is_tls_certificate_key_set,omitempty"` - - // True if TLS certificate file password is set. - IsTLSCertificateKeyFilePasswordSet bool `json:"is_tls_certificate_key_file_password_set,omitempty"` - - // MongoDB auth mechanism. - AuthenticationMechanism string `json:"authentication_mechanism,omitempty"` - - // MongoDB auth database. - AuthenticationDatabase string `json:"authentication_database,omitempty"` - - // MongoDB stats collections. - StatsCollections []string `json:"stats_collections"` - - // MongoDB collections limit. - CollectionsLimit int32 `json:"collections_limit,omitempty"` - - // True if all collectors are enabled. - EnableAllCollectors bool `json:"enable_all_collectors,omitempty"` -} - -// Validate validates this list services OK body services items0 agents items0 mongo DB options -func (o *ListServicesOKBodyServicesItems0AgentsItems0MongoDBOptions) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list services OK body services items0 agents items0 mongo DB options based on context it is used -func (o *ListServicesOKBodyServicesItems0AgentsItems0MongoDBOptions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListServicesOKBodyServicesItems0AgentsItems0MongoDBOptions) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListServicesOKBodyServicesItems0AgentsItems0MongoDBOptions) UnmarshalBinary(b []byte) error { - var res ListServicesOKBodyServicesItems0AgentsItems0MongoDBOptions - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListServicesOKBodyServicesItems0AgentsItems0MysqlOptions list services OK body services items0 agents items0 mysql options -swagger:model ListServicesOKBodyServicesItems0AgentsItems0MysqlOptions -*/ -type ListServicesOKBodyServicesItems0AgentsItems0MysqlOptions struct { - // True if TLS key is set. - IsTLSKeySet bool `json:"is_tls_key_set,omitempty"` - - // Extra DSN parameters for MySQL connection. - ExtraDsnParams map[string]string `json:"extra_dsn_params,omitempty"` -} - -// Validate validates this list services OK body services items0 agents items0 mysql options -func (o *ListServicesOKBodyServicesItems0AgentsItems0MysqlOptions) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list services OK body services items0 agents items0 mysql options based on context it is used -func (o *ListServicesOKBodyServicesItems0AgentsItems0MysqlOptions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListServicesOKBodyServicesItems0AgentsItems0MysqlOptions) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListServicesOKBodyServicesItems0AgentsItems0MysqlOptions) UnmarshalBinary(b []byte) error { - var res ListServicesOKBodyServicesItems0AgentsItems0MysqlOptions - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListServicesOKBodyServicesItems0AgentsItems0PostgresqlOptions list services OK body services items0 agents items0 postgresql options -swagger:model ListServicesOKBodyServicesItems0AgentsItems0PostgresqlOptions -*/ -type ListServicesOKBodyServicesItems0AgentsItems0PostgresqlOptions struct { - // True if TLS key is set. - IsSslKeySet bool `json:"is_ssl_key_set,omitempty"` - - // Limit of databases for auto-discovery. - AutoDiscoveryLimit int32 `json:"auto_discovery_limit,omitempty"` - - // Maximum number of connections from exporter to PostgreSQL instance. - MaxExporterConnections int32 `json:"max_exporter_connections,omitempty"` -} - -// Validate validates this list services OK body services items0 agents items0 postgresql options -func (o *ListServicesOKBodyServicesItems0AgentsItems0PostgresqlOptions) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list services OK body services items0 agents items0 postgresql options based on context it is used -func (o *ListServicesOKBodyServicesItems0AgentsItems0PostgresqlOptions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListServicesOKBodyServicesItems0AgentsItems0PostgresqlOptions) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListServicesOKBodyServicesItems0AgentsItems0PostgresqlOptions) UnmarshalBinary(b []byte) error { - var res ListServicesOKBodyServicesItems0AgentsItems0PostgresqlOptions - 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 deleted file mode 100644 index febfb2dbe2a..00000000000 --- a/api/management/v1/json/client/management_service/management_service_client.go +++ /dev/null @@ -1,661 +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 ( - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// New creates a new management service API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -// New creates a new management service API client with basic auth credentials. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - user: user for basic authentication header. -// - password: password for basic authentication header. -func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BasicAuth(user, password) - return &Client{transport: transport, formats: strfmt.Default} -} - -// New creates a new management service API client with a bearer token for authentication. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - bearerToken: bearer token for Bearer authentication header. -func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BearerToken(bearerToken) - return &Client{transport: transport, formats: strfmt.Default} -} - -/* -Client for management service API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption may be used to customize the behavior of Client methods. -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - AddAnnotation(params *AddAnnotationParams, opts ...ClientOption) (*AddAnnotationOK, error) - - AddAzureDatabase(params *AddAzureDatabaseParams, opts ...ClientOption) (*AddAzureDatabaseOK, error) - - AddService(params *AddServiceParams, opts ...ClientOption) (*AddServiceOK, error) - - DiscoverAzureDatabase(params *DiscoverAzureDatabaseParams, opts ...ClientOption) (*DiscoverAzureDatabaseOK, error) - - DiscoverRDS(params *DiscoverRDSParams, opts ...ClientOption) (*DiscoverRDSOK, error) - - GetNode(params *GetNodeParams, opts ...ClientOption) (*GetNodeOK, error) - - ListAgentVersions(params *ListAgentVersionsParams, opts ...ClientOption) (*ListAgentVersionsOK, error) - - ListAgents(params *ListAgentsParams, opts ...ClientOption) (*ListAgentsOK, error) - - ListNodes(params *ListNodesParams, opts ...ClientOption) (*ListNodesOK, error) - - ListServices(params *ListServicesParams, opts ...ClientOption) (*ListServicesOK, error) - - RegisterNode(params *RegisterNodeParams, opts ...ClientOption) (*RegisterNodeOK, error) - - RemoveService(params *RemoveServiceParams, opts ...ClientOption) (*RemoveServiceOK, error) - - UnregisterNode(params *UnregisterNodeParams, opts ...ClientOption) (*UnregisterNodeOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -AddAnnotation adds an annotation - -Adds an annotation. -*/ -func (a *Client) AddAnnotation(params *AddAnnotationParams, opts ...ClientOption) (*AddAnnotationOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewAddAnnotationParams() - } - op := &runtime.ClientOperation{ - ID: "AddAnnotation", - Method: "POST", - PathPattern: "/v1/management/annotations", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &AddAnnotationReader{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.(*AddAnnotationOK) - if ok { - return success, nil - } - - // 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()) -} - -/* -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 - if params == nil { - params = NewAddAzureDatabaseParams() - } - op := &runtime.ClientOperation{ - ID: "AddAzureDatabase", - Method: "POST", - PathPattern: "/v1/management/services/azure", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &AddAzureDatabaseReader{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.(*AddAzureDatabaseOK) - if ok { - return success, nil - } - - // 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()) -} - -/* -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 - if params == nil { - params = NewAddServiceParams() - } - op := &runtime.ClientOperation{ - ID: "AddService", - Method: "POST", - PathPattern: "/v1/management/services", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &AddServiceReader{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.(*AddServiceOK) - if ok { - return success, nil - } - - // 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()) -} - -/* -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 - if params == nil { - params = NewDiscoverAzureDatabaseParams() - } - op := &runtime.ClientOperation{ - ID: "DiscoverAzureDatabase", - Method: "POST", - PathPattern: "/v1/management/services:discoverAzure", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &DiscoverAzureDatabaseReader{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.(*DiscoverAzureDatabaseOK) - if ok { - return success, nil - } - - // 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()) -} - -/* -DiscoverRDS discovers RDS - -Discovers RDS instances. -*/ -func (a *Client) DiscoverRDS(params *DiscoverRDSParams, opts ...ClientOption) (*DiscoverRDSOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewDiscoverRDSParams() - } - op := &runtime.ClientOperation{ - ID: "DiscoverRDS", - Method: "POST", - PathPattern: "/v1/management/services:discoverRDS", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &DiscoverRDSReader{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.(*DiscoverRDSOK) - if ok { - return success, nil - } - - // 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()) -} - -/* -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 - if params == nil { - params = NewGetNodeParams() - } - op := &runtime.ClientOperation{ - ID: "GetNode", - Method: "GET", - PathPattern: "/v1/management/nodes/{node_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &GetNodeReader{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.(*GetNodeOK) - if ok { - return success, nil - } - - // 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()) -} - -/* -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 - if params == nil { - params = NewListAgentVersionsParams() - } - op := &runtime.ClientOperation{ - ID: "ListAgentVersions", - Method: "GET", - PathPattern: "/v1/management/agents/versions", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &ListAgentVersionsReader{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.(*ListAgentVersionsOK) - if ok { - return success, nil - } - - // 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()) -} - -/* -ListAgents lists agents - -Lists Agents with filter. -*/ -func (a *Client) ListAgents(params *ListAgentsParams, opts ...ClientOption) (*ListAgentsOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewListAgentsParams() - } - op := &runtime.ClientOperation{ - ID: "ListAgents", - Method: "GET", - PathPattern: "/v1/management/agents", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &ListAgentsReader{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.(*ListAgentsOK) - if ok { - return success, nil - } - - // 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()) -} - -/* -ListNodes lists nodes - -Lists Nodes with filter. -*/ -func (a *Client) ListNodes(params *ListNodesParams, opts ...ClientOption) (*ListNodesOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewListNodesParams() - } - op := &runtime.ClientOperation{ - ID: "ListNodes", - Method: "GET", - PathPattern: "/v1/management/nodes", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &ListNodesReader{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.(*ListNodesOK) - if ok { - return success, nil - } - - // 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()) -} - -/* -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 - if params == nil { - params = NewListServicesParams() - } - op := &runtime.ClientOperation{ - ID: "ListServices", - Method: "GET", - PathPattern: "/v1/management/services", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &ListServicesReader{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.(*ListServicesOK) - if ok { - return success, nil - } - - // 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()) -} - -/* -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 - if params == nil { - params = NewRegisterNodeParams() - } - op := &runtime.ClientOperation{ - ID: "RegisterNode", - Method: "POST", - PathPattern: "/v1/management/nodes", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &RegisterNodeReader{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.(*RegisterNodeOK) - if ok { - return success, nil - } - - // 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()) -} - -/* -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 - if params == nil { - params = NewRemoveServiceParams() - } - op := &runtime.ClientOperation{ - ID: "RemoveService", - Method: "DELETE", - PathPattern: "/v1/management/services/{service_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &RemoveServiceReader{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.(*RemoveServiceOK) - if ok { - return success, nil - } - - // 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()) -} - -/* -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 - if params == nil { - params = NewUnregisterNodeParams() - } - op := &runtime.ClientOperation{ - ID: "UnregisterNode", - Method: "DELETE", - PathPattern: "/v1/management/nodes/{node_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &UnregisterNodeReader{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.(*UnregisterNodeOK) - if ok { - return success, nil - } - - // 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()) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} 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 deleted file mode 100644 index a614118a70b..00000000000 --- a/api/management/v1/json/client/management_service/register_node_parameters.go +++ /dev/null @@ -1,144 +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" -) - -// NewRegisterNodeParams creates a new RegisterNodeParams 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 NewRegisterNodeParams() *RegisterNodeParams { - return &RegisterNodeParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewRegisterNodeParamsWithTimeout creates a new RegisterNodeParams object -// with the ability to set a timeout on a request. -func NewRegisterNodeParamsWithTimeout(timeout time.Duration) *RegisterNodeParams { - return &RegisterNodeParams{ - timeout: timeout, - } -} - -// NewRegisterNodeParamsWithContext creates a new RegisterNodeParams object -// with the ability to set a context for a request. -func NewRegisterNodeParamsWithContext(ctx context.Context) *RegisterNodeParams { - return &RegisterNodeParams{ - Context: ctx, - } -} - -// NewRegisterNodeParamsWithHTTPClient creates a new RegisterNodeParams object -// with the ability to set a custom HTTPClient for a request. -func NewRegisterNodeParamsWithHTTPClient(client *http.Client) *RegisterNodeParams { - return &RegisterNodeParams{ - HTTPClient: client, - } -} - -/* -RegisterNodeParams contains all the parameters to send to the API endpoint - - for the register node operation. - - Typically these are written to a http.Request. -*/ -type RegisterNodeParams struct { - // Body. - Body RegisterNodeBody - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the register node params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *RegisterNodeParams) WithDefaults() *RegisterNodeParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the register node params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *RegisterNodeParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the register node params -func (o *RegisterNodeParams) WithTimeout(timeout time.Duration) *RegisterNodeParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the register node params -func (o *RegisterNodeParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the register node params -func (o *RegisterNodeParams) WithContext(ctx context.Context) *RegisterNodeParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the register node params -func (o *RegisterNodeParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the register node params -func (o *RegisterNodeParams) WithHTTPClient(client *http.Client) *RegisterNodeParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the register node params -func (o *RegisterNodeParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the register node params -func (o *RegisterNodeParams) WithBody(body RegisterNodeBody) *RegisterNodeParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the register node params -func (o *RegisterNodeParams) SetBody(body RegisterNodeBody) { - o.Body = body -} - -// 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 - } - 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/register_node_responses.go b/api/management/v1/json/client/management_service/register_node_responses.go deleted file mode 100644 index ee28b422ff0..00000000000 --- a/api/management/v1/json/client/management_service/register_node_responses.go +++ /dev/null @@ -1,1017 +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" -) - -// RegisterNodeReader is a Reader for the RegisterNode structure. -type RegisterNodeReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *RegisterNodeReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewRegisterNodeOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewRegisterNodeDefault(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 - } -} - -// NewRegisterNodeOK creates a RegisterNodeOK with default headers values -func NewRegisterNodeOK() *RegisterNodeOK { - return &RegisterNodeOK{} -} - -/* -RegisterNodeOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type RegisterNodeOK struct { - Payload *RegisterNodeOKBody -} - -// IsSuccess returns true when this register node Ok response has a 2xx status code -func (o *RegisterNodeOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this register node Ok response has a 3xx status code -func (o *RegisterNodeOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this register node Ok response has a 4xx status code -func (o *RegisterNodeOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this register node Ok response has a 5xx status code -func (o *RegisterNodeOK) IsServerError() bool { - return false -} - -// IsCode returns true when this register node Ok response a status code equal to that given -func (o *RegisterNodeOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the register node Ok response -func (o *RegisterNodeOK) Code() int { - return 200 -} - -func (o *RegisterNodeOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/management/nodes][%d] registerNodeOk %s", 200, payload) -} - -func (o *RegisterNodeOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/management/nodes][%d] registerNodeOk %s", 200, payload) -} - -func (o *RegisterNodeOK) GetPayload() *RegisterNodeOKBody { - return o.Payload -} - -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) { - return err - } - - return nil -} - -// NewRegisterNodeDefault creates a RegisterNodeDefault with default headers values -func NewRegisterNodeDefault(code int) *RegisterNodeDefault { - return &RegisterNodeDefault{ - _statusCode: code, - } -} - -/* -RegisterNodeDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type RegisterNodeDefault struct { - _statusCode int - - Payload *RegisterNodeDefaultBody -} - -// IsSuccess returns true when this register node default response has a 2xx status code -func (o *RegisterNodeDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this register node default response has a 3xx status code -func (o *RegisterNodeDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this register node default response has a 4xx status code -func (o *RegisterNodeDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this register node default response has a 5xx status code -func (o *RegisterNodeDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this register node default response a status code equal to that given -func (o *RegisterNodeDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the register node default response -func (o *RegisterNodeDefault) Code() int { - return o._statusCode -} - -func (o *RegisterNodeDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/management/nodes][%d] RegisterNode default %s", o._statusCode, payload) -} - -func (o *RegisterNodeDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/management/nodes][%d] RegisterNode default %s", o._statusCode, payload) -} - -func (o *RegisterNodeDefault) GetPayload() *RegisterNodeDefaultBody { - return o.Payload -} - -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) { - return err - } - - return nil -} - -/* -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"` - - // Node address (DNS name or IP). - Address string `json:"address,omitempty"` - - // Linux machine-id. - MachineID string `json:"machine_id,omitempty"` - - // Linux distribution name and version. - Distro string `json:"distro,omitempty"` - - // Container identifier. If specified, must be a unique Docker container identifier. - ContainerID string `json:"container_id,omitempty"` - - // Container name. - ContainerName string `json:"container_name,omitempty"` - - // Node model. - NodeModel string `json:"node_model,omitempty"` - - // Node region. - Region string `json:"region,omitempty"` - - // Node availability zone. - Az string `json:"az,omitempty"` - - // Custom user-assigned labels for Node. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // 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"` - - // Custom password for exporter endpoint /metrics. - AgentPassword string `json:"agent_password,omitempty"` - - // Optionally expose the exporter process on all public interfaces - ExposeExporter bool `json:"expose_exporter,omitempty"` - - // AWS instance ID. - InstanceID string `json:"instance_id,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 { - res = append(res, err) - } - - if err := o.validateMetricsMode(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var registerNodeBodyTypeNodeTypePropEnum []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 { - panic(err) - } - for _, v := range res { - registerNodeBodyTypeNodeTypePropEnum = append(registerNodeBodyTypeNodeTypePropEnum, 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" - - // 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) 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) validateNodeType(formats strfmt.Registry) error { - if swag.IsZero(o.NodeType) { // not required - return nil - } - - // value enum - if err := o.validateNodeTypeEnum("body"+"."+"node_type", "body", *o.NodeType); err != nil { - return err - } - - return nil -} - -var registerNodeBodyTypeMetricsModePropEnum []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 { - registerNodeBodyTypeMetricsModePropEnum = append(registerNodeBodyTypeMetricsModePropEnum, v) - } -} - -const ( - - // RegisterNodeBodyMetricsModeMETRICSMODEUNSPECIFIED captures enum value "METRICS_MODE_UNSPECIFIED" - RegisterNodeBodyMetricsModeMETRICSMODEUNSPECIFIED string = "METRICS_MODE_UNSPECIFIED" - - // RegisterNodeBodyMetricsModeMETRICSMODEPULL captures enum value "METRICS_MODE_PULL" - RegisterNodeBodyMetricsModeMETRICSMODEPULL string = "METRICS_MODE_PULL" - - // RegisterNodeBodyMetricsModeMETRICSMODEPUSH captures enum value "METRICS_MODE_PUSH" - RegisterNodeBodyMetricsModeMETRICSMODEPUSH string = "METRICS_MODE_PUSH" -) - -// prop value enum -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) validateMetricsMode(formats strfmt.Registry) error { - if swag.IsZero(o.MetricsMode) { // not required - return nil - } - - // value enum - if err := o.validateMetricsModeEnum("body"+"."+"metrics_mode", "body", *o.MetricsMode); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this register node body based on context it is used -func (o *RegisterNodeBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *RegisterNodeBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *RegisterNodeBody) UnmarshalBinary(b []byte) error { - var res RegisterNodeBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -RegisterNodeDefaultBody register node default body -swagger:model RegisterNodeDefaultBody -*/ -type RegisterNodeDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*RegisterNodeDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this register node default body -func (o *RegisterNodeDefaultBody) 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 *RegisterNodeDefaultBody) 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("RegisterNode default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("RegisterNode default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this register node default body based on the context it is used -func (o *RegisterNodeDefaultBody) 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 *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 - return nil - } - - if err := o.Details[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("RegisterNode default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("RegisterNode default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *RegisterNodeDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *RegisterNodeDefaultBody) UnmarshalBinary(b []byte) error { - var res RegisterNodeDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -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:"-"` -} - -// 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"` - } - if err := json.Unmarshal(data, &stage1); err != nil { - return err - } - var rcv RegisterNodeDefaultBodyDetailsItems0 - - 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.RegisterNodeDefaultBodyDetailsItems0 = result - } - - return nil -} - -// 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"` - } - - stage1.AtType = o.AtType - - // make JSON object for known properties - props, err := json.Marshal(stage1) - if err != nil { - return nil, err - } - - if len(o.RegisterNodeDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.RegisterNodeDefaultBodyDetailsItems0) - 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 register node default body details items0 -func (o *RegisterNodeDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this register node default body details items0 based on context it is used -func (o *RegisterNodeDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *RegisterNodeDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *RegisterNodeDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res RegisterNodeDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -RegisterNodeOKBody register node OK body -swagger:model RegisterNodeOKBody -*/ -type RegisterNodeOKBody struct { - // Token represents token for vmagent auth config. - Token string `json:"token,omitempty"` - - // Warning message. - Warning string `json:"warning,omitempty"` - - // container node - ContainerNode *RegisterNodeOKBodyContainerNode `json:"container_node,omitempty"` - - // generic node - GenericNode *RegisterNodeOKBodyGenericNode `json:"generic_node,omitempty"` - - // pmm agent - PMMAgent *RegisterNodeOKBodyPMMAgent `json:"pmm_agent,omitempty"` -} - -// Validate validates this register node OK body -func (o *RegisterNodeOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateContainerNode(formats); err != nil { - res = append(res, err) - } - - if err := o.validateGenericNode(formats); err != nil { - res = append(res, err) - } - - if err := o.validatePMMAgent(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *RegisterNodeOKBody) validateContainerNode(formats strfmt.Registry) error { - if swag.IsZero(o.ContainerNode) { // not required - return nil - } - - if o.ContainerNode != nil { - if err := o.ContainerNode.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("registerNodeOk" + "." + "container_node") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("registerNodeOk" + "." + "container_node") - } - - return err - } - } - - return nil -} - -func (o *RegisterNodeOKBody) validateGenericNode(formats strfmt.Registry) error { - if swag.IsZero(o.GenericNode) { // not required - return nil - } - - if o.GenericNode != nil { - if err := o.GenericNode.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("registerNodeOk" + "." + "generic_node") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("registerNodeOk" + "." + "generic_node") - } - - return err - } - } - - return nil -} - -func (o *RegisterNodeOKBody) validatePMMAgent(formats strfmt.Registry) error { - if swag.IsZero(o.PMMAgent) { // not required - return nil - } - - if o.PMMAgent != nil { - if err := o.PMMAgent.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("registerNodeOk" + "." + "pmm_agent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("registerNodeOk" + "." + "pmm_agent") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this register node OK body based on the context it is used -func (o *RegisterNodeOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateContainerNode(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateGenericNode(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidatePMMAgent(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *RegisterNodeOKBody) contextValidateContainerNode(ctx context.Context, formats strfmt.Registry) error { - if o.ContainerNode != nil { - - if swag.IsZero(o.ContainerNode) { // not required - return nil - } - - if err := o.ContainerNode.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("registerNodeOk" + "." + "container_node") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("registerNodeOk" + "." + "container_node") - } - - return err - } - } - - return nil -} - -func (o *RegisterNodeOKBody) contextValidateGenericNode(ctx context.Context, formats strfmt.Registry) error { - if o.GenericNode != nil { - - if swag.IsZero(o.GenericNode) { // not required - return nil - } - - if err := o.GenericNode.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("registerNodeOk" + "." + "generic_node") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("registerNodeOk" + "." + "generic_node") - } - - return err - } - } - - return nil -} - -func (o *RegisterNodeOKBody) contextValidatePMMAgent(ctx context.Context, formats strfmt.Registry) error { - if o.PMMAgent != nil { - - if swag.IsZero(o.PMMAgent) { // not required - return nil - } - - if err := o.PMMAgent.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("registerNodeOk" + "." + "pmm_agent") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("registerNodeOk" + "." + "pmm_agent") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *RegisterNodeOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *RegisterNodeOKBody) UnmarshalBinary(b []byte) error { - var res RegisterNodeOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -RegisterNodeOKBodyContainerNode ContainerNode represents a Docker container. -swagger:model RegisterNodeOKBodyContainerNode -*/ -type RegisterNodeOKBodyContainerNode struct { - // Unique randomly generated instance identifier. - NodeID string `json:"node_id,omitempty"` - - // Unique across all Nodes user-defined name. - NodeName string `json:"node_name,omitempty"` - - // Node address (DNS name or IP). - Address string `json:"address,omitempty"` - - // Linux machine-id of the Generic Node where this Container Node runs. - MachineID string `json:"machine_id,omitempty"` - - // Container identifier. If specified, must be a unique Docker container identifier. - ContainerID string `json:"container_id,omitempty"` - - // Container name. - ContainerName string `json:"container_name,omitempty"` - - // Node model. - NodeModel string `json:"node_model,omitempty"` - - // Node region. - Region string `json:"region,omitempty"` - - // Node availability zone. - Az string `json:"az,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` -} - -// Validate validates this register node OK body container node -func (o *RegisterNodeOKBodyContainerNode) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this register node OK body container node based on context it is used -func (o *RegisterNodeOKBodyContainerNode) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *RegisterNodeOKBodyContainerNode) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *RegisterNodeOKBodyContainerNode) UnmarshalBinary(b []byte) error { - var res RegisterNodeOKBodyContainerNode - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -RegisterNodeOKBodyGenericNode GenericNode represents a bare metal server or virtual machine. -swagger:model RegisterNodeOKBodyGenericNode -*/ -type RegisterNodeOKBodyGenericNode struct { - // Unique randomly generated instance identifier. - NodeID string `json:"node_id,omitempty"` - - // Unique across all Nodes user-defined name. - NodeName string `json:"node_name,omitempty"` - - // Node address (DNS name or IP). - Address string `json:"address,omitempty"` - - // Linux machine-id. - MachineID string `json:"machine_id,omitempty"` - - // Linux distribution name and version. - Distro string `json:"distro,omitempty"` - - // Node model. - NodeModel string `json:"node_model,omitempty"` - - // Node region. - Region string `json:"region,omitempty"` - - // Node availability zone. - Az string `json:"az,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` -} - -// Validate validates this register node OK body generic node -func (o *RegisterNodeOKBodyGenericNode) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this register node OK body generic node based on context it is used -func (o *RegisterNodeOKBodyGenericNode) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *RegisterNodeOKBodyGenericNode) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *RegisterNodeOKBodyGenericNode) UnmarshalBinary(b []byte) error { - var res RegisterNodeOKBodyGenericNode - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -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"` - - // Node identifier where this instance runs. - RunsOnNodeID string `json:"runs_on_node_id,omitempty"` - - // Custom user-assigned labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // True if Agent is running and connected to pmm-managed. - Connected bool `json:"connected,omitempty"` - - // Path to exec process. - ProcessExecPath string `json:"process_exec_path,omitempty"` -} - -// Validate validates this register node OK body PMM agent -func (o *RegisterNodeOKBodyPMMAgent) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this register node OK body PMM agent based on context it is used -func (o *RegisterNodeOKBodyPMMAgent) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *RegisterNodeOKBodyPMMAgent) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *RegisterNodeOKBodyPMMAgent) UnmarshalBinary(b []byte) error { - var res RegisterNodeOKBodyPMMAgent - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} 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 deleted file mode 100644 index 16511c1b2e4..00000000000 --- a/api/management/v1/json/client/management_service/remove_service_parameters.go +++ /dev/null @@ -1,193 +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" -) - -// NewRemoveServiceParams creates a new RemoveServiceParams 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 NewRemoveServiceParams() *RemoveServiceParams { - return &RemoveServiceParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewRemoveServiceParamsWithTimeout creates a new RemoveServiceParams object -// with the ability to set a timeout on a request. -func NewRemoveServiceParamsWithTimeout(timeout time.Duration) *RemoveServiceParams { - return &RemoveServiceParams{ - timeout: timeout, - } -} - -// NewRemoveServiceParamsWithContext creates a new RemoveServiceParams object -// with the ability to set a context for a request. -func NewRemoveServiceParamsWithContext(ctx context.Context) *RemoveServiceParams { - return &RemoveServiceParams{ - Context: ctx, - } -} - -// NewRemoveServiceParamsWithHTTPClient creates a new RemoveServiceParams object -// with the ability to set a custom HTTPClient for a request. -func NewRemoveServiceParamsWithHTTPClient(client *http.Client) *RemoveServiceParams { - return &RemoveServiceParams{ - HTTPClient: client, - } -} - -/* -RemoveServiceParams contains all the parameters to send to the API endpoint - - for the remove service operation. - - Typically these are written to a http.Request. -*/ -type RemoveServiceParams struct { - /* ServiceID. - - Either a Service ID or a Service Name. - */ - ServiceID string - - /* ServiceType. - - Service type. - - Default: "SERVICE_TYPE_UNSPECIFIED" - */ - ServiceType *string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the remove service params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *RemoveServiceParams) WithDefaults() *RemoveServiceParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the remove service params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *RemoveServiceParams) SetDefaults() { - serviceTypeDefault := string("SERVICE_TYPE_UNSPECIFIED") - - val := RemoveServiceParams{ - ServiceType: &serviceTypeDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the remove service params -func (o *RemoveServiceParams) WithTimeout(timeout time.Duration) *RemoveServiceParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the remove service params -func (o *RemoveServiceParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the remove service params -func (o *RemoveServiceParams) WithContext(ctx context.Context) *RemoveServiceParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the remove service params -func (o *RemoveServiceParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the remove service params -func (o *RemoveServiceParams) WithHTTPClient(client *http.Client) *RemoveServiceParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the remove service params -func (o *RemoveServiceParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithServiceID adds the serviceID to the remove service params -func (o *RemoveServiceParams) WithServiceID(serviceID string) *RemoveServiceParams { - o.SetServiceID(serviceID) - return o -} - -// SetServiceID adds the serviceId to the remove service params -func (o *RemoveServiceParams) SetServiceID(serviceID string) { - o.ServiceID = serviceID -} - -// WithServiceType adds the serviceType to the remove service params -func (o *RemoveServiceParams) WithServiceType(serviceType *string) *RemoveServiceParams { - o.SetServiceType(serviceType) - return o -} - -// SetServiceType adds the serviceType to the remove service params -func (o *RemoveServiceParams) SetServiceType(serviceType *string) { - o.ServiceType = serviceType -} - -// 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 - } - var res []error - - // path param service_id - if err := r.SetPathParam("service_id", o.ServiceID); err != nil { - return err - } - - if o.ServiceType != nil { - - // query param service_type - var qrServiceType string - - if o.ServiceType != nil { - qrServiceType = *o.ServiceType - } - qServiceType := qrServiceType - if qServiceType != "" { - if err := r.SetQueryParam("service_type", qServiceType); err != nil { - return err - } - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} 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 deleted file mode 100644 index b9b54fc46ba..00000000000 --- a/api/management/v1/json/client/management_service/remove_service_responses.go +++ /dev/null @@ -1,414 +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" -) - -// RemoveServiceReader is a Reader for the RemoveService structure. -type RemoveServiceReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *RemoveServiceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewRemoveServiceOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewRemoveServiceDefault(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 - } -} - -// NewRemoveServiceOK creates a RemoveServiceOK with default headers values -func NewRemoveServiceOK() *RemoveServiceOK { - return &RemoveServiceOK{} -} - -/* -RemoveServiceOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type RemoveServiceOK struct { - Payload any -} - -// IsSuccess returns true when this remove service Ok response has a 2xx status code -func (o *RemoveServiceOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this remove service Ok response has a 3xx status code -func (o *RemoveServiceOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this remove service Ok response has a 4xx status code -func (o *RemoveServiceOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this remove service Ok response has a 5xx status code -func (o *RemoveServiceOK) IsServerError() bool { - return false -} - -// IsCode returns true when this remove service Ok response a status code equal to that given -func (o *RemoveServiceOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the remove service Ok response -func (o *RemoveServiceOK) Code() int { - return 200 -} - -func (o *RemoveServiceOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/management/services/{service_id}][%d] removeServiceOk %s", 200, payload) -} - -func (o *RemoveServiceOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/management/services/{service_id}][%d] removeServiceOk %s", 200, payload) -} - -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 && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -// NewRemoveServiceDefault creates a RemoveServiceDefault with default headers values -func NewRemoveServiceDefault(code int) *RemoveServiceDefault { - return &RemoveServiceDefault{ - _statusCode: code, - } -} - -/* -RemoveServiceDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type RemoveServiceDefault struct { - _statusCode int - - Payload *RemoveServiceDefaultBody -} - -// IsSuccess returns true when this remove service default response has a 2xx status code -func (o *RemoveServiceDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this remove service default response has a 3xx status code -func (o *RemoveServiceDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this remove service default response has a 4xx status code -func (o *RemoveServiceDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this remove service default response has a 5xx status code -func (o *RemoveServiceDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this remove service default response a status code equal to that given -func (o *RemoveServiceDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the remove service default response -func (o *RemoveServiceDefault) Code() int { - return o._statusCode -} - -func (o *RemoveServiceDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/management/services/{service_id}][%d] RemoveService default %s", o._statusCode, payload) -} - -func (o *RemoveServiceDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/management/services/{service_id}][%d] RemoveService default %s", o._statusCode, payload) -} - -func (o *RemoveServiceDefault) GetPayload() *RemoveServiceDefaultBody { - return o.Payload -} - -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) { - return err - } - - return nil -} - -/* -RemoveServiceDefaultBody remove service default body -swagger:model RemoveServiceDefaultBody -*/ -type RemoveServiceDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*RemoveServiceDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this remove service default body -func (o *RemoveServiceDefaultBody) 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 *RemoveServiceDefaultBody) 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("RemoveService default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("RemoveService default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this remove service default body based on the context it is used -func (o *RemoveServiceDefaultBody) 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 *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 - return nil - } - - if err := o.Details[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("RemoveService default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("RemoveService default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *RemoveServiceDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *RemoveServiceDefaultBody) UnmarshalBinary(b []byte) error { - var res RemoveServiceDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -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:"-"` -} - -// 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"` - } - if err := json.Unmarshal(data, &stage1); err != nil { - return err - } - var rcv RemoveServiceDefaultBodyDetailsItems0 - - 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.RemoveServiceDefaultBodyDetailsItems0 = result - } - - return nil -} - -// 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"` - } - - stage1.AtType = o.AtType - - // make JSON object for known properties - props, err := json.Marshal(stage1) - if err != nil { - return nil, err - } - - if len(o.RemoveServiceDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.RemoveServiceDefaultBodyDetailsItems0) - 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 remove service default body details items0 -func (o *RemoveServiceDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this remove service default body details items0 based on context it is used -func (o *RemoveServiceDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *RemoveServiceDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *RemoveServiceDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res RemoveServiceDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} 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 deleted file mode 100644 index 069530e44b2..00000000000 --- a/api/management/v1/json/client/management_service/unregister_node_parameters.go +++ /dev/null @@ -1,183 +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" - "github.com/go-openapi/swag" -) - -// NewUnregisterNodeParams creates a new UnregisterNodeParams 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 NewUnregisterNodeParams() *UnregisterNodeParams { - return &UnregisterNodeParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewUnregisterNodeParamsWithTimeout creates a new UnregisterNodeParams object -// with the ability to set a timeout on a request. -func NewUnregisterNodeParamsWithTimeout(timeout time.Duration) *UnregisterNodeParams { - return &UnregisterNodeParams{ - timeout: timeout, - } -} - -// NewUnregisterNodeParamsWithContext creates a new UnregisterNodeParams object -// with the ability to set a context for a request. -func NewUnregisterNodeParamsWithContext(ctx context.Context) *UnregisterNodeParams { - return &UnregisterNodeParams{ - Context: ctx, - } -} - -// NewUnregisterNodeParamsWithHTTPClient creates a new UnregisterNodeParams object -// with the ability to set a custom HTTPClient for a request. -func NewUnregisterNodeParamsWithHTTPClient(client *http.Client) *UnregisterNodeParams { - return &UnregisterNodeParams{ - HTTPClient: client, - } -} - -/* -UnregisterNodeParams contains all the parameters to send to the API endpoint - - for the unregister node operation. - - 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. - */ - Force *bool - - /* NodeID. - - Node_id to be unregistered. - */ - NodeID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the unregister node params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UnregisterNodeParams) WithDefaults() *UnregisterNodeParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the unregister node params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UnregisterNodeParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the unregister node params -func (o *UnregisterNodeParams) WithTimeout(timeout time.Duration) *UnregisterNodeParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the unregister node params -func (o *UnregisterNodeParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the unregister node params -func (o *UnregisterNodeParams) WithContext(ctx context.Context) *UnregisterNodeParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the unregister node params -func (o *UnregisterNodeParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the unregister node params -func (o *UnregisterNodeParams) WithHTTPClient(client *http.Client) *UnregisterNodeParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the unregister node params -func (o *UnregisterNodeParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithForce adds the force to the unregister node params -func (o *UnregisterNodeParams) WithForce(force *bool) *UnregisterNodeParams { - o.SetForce(force) - return o -} - -// SetForce adds the force to the unregister node params -func (o *UnregisterNodeParams) SetForce(force *bool) { - o.Force = force -} - -// WithNodeID adds the nodeID to the unregister node params -func (o *UnregisterNodeParams) WithNodeID(nodeID string) *UnregisterNodeParams { - o.SetNodeID(nodeID) - return o -} - -// SetNodeID adds the nodeId to the unregister node params -func (o *UnregisterNodeParams) SetNodeID(nodeID string) { - o.NodeID = nodeID -} - -// 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 - } - var res []error - - if o.Force != nil { - - // query param force - var qrForce bool - - if o.Force != nil { - qrForce = *o.Force - } - qForce := swag.FormatBool(qrForce) - if qForce != "" { - if err := r.SetQueryParam("force", qForce); err != nil { - return err - } - } - } - - // path param node_id - if err := r.SetPathParam("node_id", o.NodeID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} 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 deleted file mode 100644 index a935e26136f..00000000000 --- a/api/management/v1/json/client/management_service/unregister_node_responses.go +++ /dev/null @@ -1,453 +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" -) - -// UnregisterNodeReader is a Reader for the UnregisterNode structure. -type UnregisterNodeReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *UnregisterNodeReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewUnregisterNodeOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewUnregisterNodeDefault(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 - } -} - -// NewUnregisterNodeOK creates a UnregisterNodeOK with default headers values -func NewUnregisterNodeOK() *UnregisterNodeOK { - return &UnregisterNodeOK{} -} - -/* -UnregisterNodeOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type UnregisterNodeOK struct { - Payload *UnregisterNodeOKBody -} - -// IsSuccess returns true when this unregister node Ok response has a 2xx status code -func (o *UnregisterNodeOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this unregister node Ok response has a 3xx status code -func (o *UnregisterNodeOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this unregister node Ok response has a 4xx status code -func (o *UnregisterNodeOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this unregister node Ok response has a 5xx status code -func (o *UnregisterNodeOK) IsServerError() bool { - return false -} - -// IsCode returns true when this unregister node Ok response a status code equal to that given -func (o *UnregisterNodeOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the unregister node Ok response -func (o *UnregisterNodeOK) Code() int { - return 200 -} - -func (o *UnregisterNodeOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/management/nodes/{node_id}][%d] unregisterNodeOk %s", 200, payload) -} - -func (o *UnregisterNodeOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/management/nodes/{node_id}][%d] unregisterNodeOk %s", 200, payload) -} - -func (o *UnregisterNodeOK) GetPayload() *UnregisterNodeOKBody { - return o.Payload -} - -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) { - return err - } - - return nil -} - -// NewUnregisterNodeDefault creates a UnregisterNodeDefault with default headers values -func NewUnregisterNodeDefault(code int) *UnregisterNodeDefault { - return &UnregisterNodeDefault{ - _statusCode: code, - } -} - -/* -UnregisterNodeDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type UnregisterNodeDefault struct { - _statusCode int - - Payload *UnregisterNodeDefaultBody -} - -// IsSuccess returns true when this unregister node default response has a 2xx status code -func (o *UnregisterNodeDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this unregister node default response has a 3xx status code -func (o *UnregisterNodeDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this unregister node default response has a 4xx status code -func (o *UnregisterNodeDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this unregister node default response has a 5xx status code -func (o *UnregisterNodeDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this unregister node default response a status code equal to that given -func (o *UnregisterNodeDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the unregister node default response -func (o *UnregisterNodeDefault) Code() int { - return o._statusCode -} - -func (o *UnregisterNodeDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/management/nodes/{node_id}][%d] UnregisterNode default %s", o._statusCode, payload) -} - -func (o *UnregisterNodeDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/management/nodes/{node_id}][%d] UnregisterNode default %s", o._statusCode, payload) -} - -func (o *UnregisterNodeDefault) GetPayload() *UnregisterNodeDefaultBody { - return o.Payload -} - -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) { - return err - } - - return nil -} - -/* -UnregisterNodeDefaultBody unregister node default body -swagger:model UnregisterNodeDefaultBody -*/ -type UnregisterNodeDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*UnregisterNodeDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this unregister node default body -func (o *UnregisterNodeDefaultBody) 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 *UnregisterNodeDefaultBody) 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("UnregisterNode default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("UnregisterNode default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this unregister node default body based on the context it is used -func (o *UnregisterNodeDefaultBody) 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 *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 - return nil - } - - if err := o.Details[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("UnregisterNode default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("UnregisterNode default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *UnregisterNodeDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *UnregisterNodeDefaultBody) UnmarshalBinary(b []byte) error { - var res UnregisterNodeDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -UnregisterNodeDefaultBodyDetailsItems0 unregister node default body details items0 -swagger:model UnregisterNodeDefaultBodyDetailsItems0 -*/ -type UnregisterNodeDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` - - // unregister node default body details items0 - 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"` - } - if err := json.Unmarshal(data, &stage1); err != nil { - return err - } - var rcv UnregisterNodeDefaultBodyDetailsItems0 - - 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.UnregisterNodeDefaultBodyDetailsItems0 = result - } - - return nil -} - -// 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"` - } - - stage1.AtType = o.AtType - - // make JSON object for known properties - props, err := json.Marshal(stage1) - if err != nil { - return nil, err - } - - if len(o.UnregisterNodeDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.UnregisterNodeDefaultBodyDetailsItems0) - 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 unregister node default body details items0 -func (o *UnregisterNodeDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this unregister node default body details items0 based on context it is used -func (o *UnregisterNodeDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *UnregisterNodeDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *UnregisterNodeDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res UnregisterNodeDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -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"` -} - -// Validate validates this unregister node OK body -func (o *UnregisterNodeOKBody) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this unregister node OK body based on context it is used -func (o *UnregisterNodeOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *UnregisterNodeOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *UnregisterNodeOKBody) UnmarshalBinary(b []byte) error { - var res UnregisterNodeOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/management/v1/json/client/pmm_management_api_client.go b/api/management/v1/json/client/pmm_management_api_client.go deleted file mode 100644 index 285a1891928..00000000000 --- a/api/management/v1/json/client/pmm_management_api_client.go +++ /dev/null @@ -1,112 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package client - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/percona/pmm/api/management/v1/json/client/management_service" -) - -// Default PMM management API HTTP client. -var Default = NewHTTPClient(nil) - -const ( - // DefaultHost is the default Host - // found in Meta (info) section of spec file - DefaultHost string = "localhost" - // DefaultBasePath is the default BasePath - // found in Meta (info) section of spec file - DefaultBasePath string = "/" -) - -// DefaultSchemes are the default schemes found in Meta (info) section of spec file -var DefaultSchemes = []string{"http", "https"} - -// NewHTTPClient creates a new PMM management API HTTP client. -func NewHTTPClient(formats strfmt.Registry) *PMMManagementAPI { - return NewHTTPClientWithConfig(formats, nil) -} - -// NewHTTPClientWithConfig creates a new PMM management API HTTP client, -// using a customizable transport config. -func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *PMMManagementAPI { - // ensure nullable parameters have default - if cfg == nil { - cfg = DefaultTransportConfig() - } - - // create transport and client - transport := httptransport.New(cfg.Host, cfg.BasePath, cfg.Schemes) - return New(transport, formats) -} - -// New creates a new PMM management API client -func New(transport runtime.ClientTransport, formats strfmt.Registry) *PMMManagementAPI { - // ensure nullable parameters have default - if formats == nil { - formats = strfmt.Default - } - - cli := new(PMMManagementAPI) - cli.Transport = transport - cli.ManagementService = management_service.New(transport, formats) - return cli -} - -// DefaultTransportConfig creates a TransportConfig with the -// default settings taken from the meta section of the spec file. -func DefaultTransportConfig() *TransportConfig { - return &TransportConfig{ - Host: DefaultHost, - BasePath: DefaultBasePath, - Schemes: DefaultSchemes, - } -} - -// TransportConfig contains the transport related info, -// found in the meta section of the spec file. -type TransportConfig struct { - Host string - BasePath string - Schemes []string -} - -// WithHost overrides the default host, -// provided by the meta section of the spec file. -func (cfg *TransportConfig) WithHost(host string) *TransportConfig { - cfg.Host = host - return cfg -} - -// WithBasePath overrides the default basePath, -// provided by the meta section of the spec file. -func (cfg *TransportConfig) WithBasePath(basePath string) *TransportConfig { - cfg.BasePath = basePath - return cfg -} - -// WithSchemes overrides the default schemes, -// provided by the meta section of the spec file. -func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig { - cfg.Schemes = schemes - return cfg -} - -// PMMManagementAPI is a client for PMM management API -type PMMManagementAPI struct { - ManagementService management_service.ClientService - - Transport runtime.ClientTransport -} - -// SetTransport changes the transport on the client and all its subresources -func (c *PMMManagementAPI) SetTransport(transport runtime.ClientTransport) { - c.Transport = transport - c.ManagementService.SetTransport(transport) -} diff --git a/api/management/v1/json/v1.json b/api/management/v1/json/v1.json deleted file mode 100644 index a8a3b6f60c4..00000000000 --- a/api/management/v1/json/v1.json +++ /dev/null @@ -1,7226 +0,0 @@ -{ - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "schemes": [ - "https", - "http" - ], - "swagger": "2.0", - "info": { - "title": "PMM Management API", - "version": "v1" - }, - "paths": { - "/v1/management/agents": { - "get": { - "description": "Lists Agents with filter.", - "tags": [ - "ManagementService" - ], - "summary": "List Agents", - "operationId": "ListAgents", - "parameters": [ - { - "type": "string", - "description": "Return only Agents that relate to a specific ServiceID.", - "name": "service_id", - "in": "query" - }, - { - "type": "string", - "description": "Return only Agents that relate to a specific NodeID.", - "name": "node_id", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "agents": { - "description": "List of Agents.", - "type": "array", - "items": { - "type": "object", - "properties": { - "agent_id": { - "description": "Unique agent identifier.", - "type": "string", - "x-order": 0 - }, - "is_agent_password_set": { - "description": "True if the agent password is set.", - "type": "boolean", - "x-order": 1 - }, - "agent_type": { - "description": "Agent type.", - "type": "string", - "x-order": 2 - }, - "aws_access_key": { - "description": "AWS Access Key.", - "type": "string", - "x-order": 3 - }, - "is_aws_secret_key_set": { - "description": "True if AWS Secret Key is set.", - "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", - "format": "date-time", - "x-order": 6 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 7 - }, - "disabled": { - "description": "Desired Agent status: enabled (false) or disabled (true).", - "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": 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", - "format": "int32", - "x-order": 12 - }, - "max_query_log_size": { - "description": "Limit query log size in QAN.", - "type": "string", - "format": "int64", - "x-order": 13 - }, - "metrics_path": { - "description": "Path under which metrics are exposed, used to generate URI.", - "type": "string", - "x-order": 14 - }, - "metrics_scheme": { - "description": "Scheme to generate URI to exporter metrics endpoints.", - "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", - "x-order": 18 - }, - "is_password_set": { - "description": "True if password for connecting the agent to the database is set.", - "type": "boolean", - "x-order": 19 - }, - "pmm_agent_id": { - "description": "The pmm-agent identifier.", - "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", - "x-order": 22 - }, - "push_metrics": { - "description": "True if exporter uses push metrics mode.", - "type": "boolean", - "x-order": 23 - }, - "query_examples_disabled": { - "description": "True if query examples are disabled.", - "type": "boolean", - "x-order": 24 - }, - "comments_parsing_disabled": { - "description": "True if query comments parsing is disabled.", - "type": "boolean", - "x-order": 25 - }, - "rds_basic_metrics_disabled": { - "description": "True if RDS basic metrics are disdabled.", - "type": "boolean", - "x-order": 26 - }, - "rds_enhanced_metrics_disabled": { - "description": "True if RDS enhanced metrics are disdabled.", - "type": "boolean", - "x-order": 27 - }, - "runs_on_node_id": { - "description": "Node identifier where this instance runs.", - "type": "string", - "x-order": 28 - }, - "service_id": { - "description": "Service identifier.", - "type": "string", - "x-order": 29 - }, - "status": { - "description": "Actual Agent status.", - "type": "string", - "x-order": 30 - }, - "table_count": { - "description": "Last known table count.", - "type": "integer", - "format": "int32", - "x-order": 31 - }, - "table_count_tablestats_group_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": 32 - }, - "tls": { - "description": "Use TLS for database connections.", - "type": "boolean", - "x-order": 33 - }, - "tls_skip_verify": { - "description": "Skip TLS certificate and hostname validation.", - "type": "boolean", - "x-order": 34 - }, - "username": { - "description": "HTTP basic auth username for collecting metrics.", - "type": "string", - "x-order": 35 - }, - "updated_at": { - "description": "Last update timestamp.", - "type": "string", - "format": "date-time", - "x-order": 36 - }, - "version": { - "description": "Agent version.", - "type": "string", - "x-order": 37 - }, - "is_connected": { - "description": "True if Agent is running and connected to pmm-managed.", - "type": "boolean", - "x-order": 38 - }, - "expose_exporter": { - "description": "True if an exporter agent is exposed on all host addresses.", - "type": "boolean", - "x-order": 39 - }, - "valkey_options": { - "type": "object", - "x-order": 40 - } - } - }, - "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": 3 - } - } - }, - "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/annotations": { - "post": { - "description": "Adds an annotation.", - "tags": [ - "ManagementService" - ], - "summary": "Add an Annotation", - "operationId": "AddAnnotation", - "parameters": [ - { - "description": "AddAnnotationRequest is a params to add new annotation.", - "name": "body", - "in": "body", - "required": true, - "schema": { - "description": "AddAnnotationRequest is a params to add new annotation.", - "type": "object", - "properties": { - "text": { - "description": "An annotation description. Required.", - "type": "string", - "x-order": 0 - }, - "tags": { - "description": "Tags are used to filter annotations.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 1 - }, - "node_name": { - "description": "Used for annotating a node.", - "type": "string", - "x-order": 2 - }, - "service_names": { - "description": "Used for annotating services.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 3 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/management/nodes": { - "get": { - "description": "Lists Nodes with filter.", - "tags": [ - "ManagementService" - ], - "summary": "List Nodes", - "operationId": "ListNodes", - "parameters": [ - { - "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" - ], - "type": "string", - "default": "NODE_TYPE_UNSPECIFIED", - "description": "Node type to be filtered out.", - "name": "node_type", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "nodes": { - "type": "array", - "items": { - "type": "object", - "properties": { - "node_id": { - "description": "Unique Node identifier.", - "type": "string", - "x-order": 0 - }, - "node_type": { - "description": "Node type.", - "type": "string", - "x-order": 1 - }, - "node_name": { - "description": "User-defined node name.", - "type": "string", - "x-order": 2 - }, - "machine_id": { - "description": "Linux machine-id.", - "type": "string", - "x-order": 3 - }, - "distro": { - "description": "Linux distribution name and version.", - "type": "string", - "x-order": 4 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 5 - }, - "container_id": { - "description": "A node's unique docker container identifier.", - "type": "string", - "x-order": 6 - }, - "container_name": { - "description": "Container name.", - "type": "string", - "x-order": 7 - }, - "address": { - "description": "Node address (DNS name or IP).", - "type": "string", - "x-order": 8 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 9 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 10 - }, - "custom_labels": { - "description": "Custom user-assigned labels for Node.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 11 - }, - "created_at": { - "description": "Creation timestamp.", - "type": "string", - "format": "date-time", - "x-order": 12 - }, - "updated_at": { - "description": "Last update timestamp.", - "type": "string", - "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", - "items": { - "type": "object", - "properties": { - "agent_id": { - "description": "Unique Agent identifier.", - "type": "string", - "x-order": 0 - }, - "agent_type": { - "description": "Agent type.", - "type": "string", - "x-order": 1 - }, - "status": { - "description": "Actual Agent status.", - "type": "string", - "x-order": 2 - }, - "is_connected": { - "description": "True if Agent is running and connected to pmm-managed.", - "type": "boolean", - "x-order": 3 - } - } - }, - "x-order": 15 - }, - "services": { - "description": "List of services running on this node.", - "type": "array", - "items": { - "description": "Service represents a service running on a node.", - "type": "object", - "properties": { - "service_id": { - "description": "Unique Service identifier.", - "type": "string", - "x-order": 0 - }, - "service_type": { - "description": "Service type.", - "type": "string", - "x-order": 1 - }, - "service_name": { - "description": "Service name.", - "type": "string", - "x-order": 2 - } - } - }, - "x-order": 16 - }, - "instance_id": { - "description": "Instance ID for cloud providers (e.g. AWS RDS).", - "type": "string", - "x-order": 17 - } - } - }, - "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 - } - } - } - } - } - }, - "post": { - "description": "Registers a new Node and a pmm-agent.", - "tags": [ - "ManagementService" - ], - "summary": "Register a Node", - "operationId": "RegisterNode", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "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", - "x-order": 1 - }, - "address": { - "description": "Node address (DNS name or IP).", - "type": "string", - "x-order": 2 - }, - "machine_id": { - "description": "Linux machine-id.", - "type": "string", - "x-order": 3 - }, - "distro": { - "description": "Linux distribution name and version.", - "type": "string", - "x-order": 4 - }, - "container_id": { - "description": "Container identifier. If specified, must be a unique Docker container identifier.", - "type": "string", - "x-order": 5 - }, - "container_name": { - "description": "Container name.", - "type": "string", - "x-order": 6 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 7 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 8 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 9 - }, - "custom_labels": { - "description": "Custom user-assigned labels for Node.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 10 - }, - "reregister": { - "description": "If true, and Node with that name already exist, it will be removed with all dependent Services and Agents.", - "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", - "items": { - "type": "string" - }, - "x-order": 13 - }, - "agent_password": { - "description": "Custom password for exporter endpoint /metrics.", - "type": "string", - "x-order": 14 - }, - "expose_exporter": { - "type": "boolean", - "title": "Optionally expose the exporter process on all public interfaces", - "x-order": 15 - }, - "instance_id": { - "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", - "x-order": 0 - }, - "node_name": { - "description": "Unique across all Nodes user-defined name.", - "type": "string", - "x-order": 1 - }, - "address": { - "description": "Node address (DNS name or IP).", - "type": "string", - "x-order": 2 - }, - "machine_id": { - "description": "Linux machine-id.", - "type": "string", - "x-order": 3 - }, - "distro": { - "description": "Linux distribution name and version.", - "type": "string", - "x-order": 4 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 5 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 6 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 7 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 8 - } - }, - "x-order": 0 - }, - "container_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": { - "description": "Unique across all Nodes user-defined name.", - "type": "string", - "x-order": 1 - }, - "address": { - "description": "Node address (DNS name or IP).", - "type": "string", - "x-order": 2 - }, - "machine_id": { - "description": "Linux machine-id of the Generic Node where this Container Node runs.", - "type": "string", - "x-order": 3 - }, - "container_id": { - "description": "Container identifier. If specified, must be a unique Docker container identifier.", - "type": "string", - "x-order": 4 - }, - "container_name": { - "description": "Container name.", - "type": "string", - "x-order": 5 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 6 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 7 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 8 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 9 - } - }, - "x-order": 1 - }, - "pmm_agent": { - "description": "PMMAgent runs on Generic or Container Node.", - "type": "object", - "properties": { - "agent_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "runs_on_node_id": { - "description": "Node identifier where this instance runs.", - "type": "string", - "x-order": 1 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 2 - }, - "connected": { - "description": "True if Agent is running and connected to pmm-managed.", - "type": "boolean", - "x-order": 3 - }, - "process_exec_path": { - "description": "Path to exec process.", - "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 - } - } - } - }, - "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/nodes/{node_id}": { - "get": { - "description": "Gets a single Node by ID.", - "tags": [ - "ManagementService" - ], - "summary": "Get Node", - "operationId": "GetNode", - "parameters": [ - { - "type": "string", - "description": "Unique Node identifier.", - "name": "node_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "node": { - "type": "object", - "properties": { - "node_id": { - "description": "Unique Node identifier.", - "type": "string", - "x-order": 0 - }, - "node_type": { - "description": "Node type.", - "type": "string", - "x-order": 1 - }, - "node_name": { - "description": "User-defined node name.", - "type": "string", - "x-order": 2 - }, - "machine_id": { - "description": "Linux machine-id.", - "type": "string", - "x-order": 3 - }, - "distro": { - "description": "Linux distribution name and version.", - "type": "string", - "x-order": 4 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 5 - }, - "container_id": { - "description": "A node's unique docker container identifier.", - "type": "string", - "x-order": 6 - }, - "container_name": { - "description": "Container name.", - "type": "string", - "x-order": 7 - }, - "address": { - "description": "Node address (DNS name or IP).", - "type": "string", - "x-order": 8 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 9 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 10 - }, - "custom_labels": { - "description": "Custom user-assigned labels for Node.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 11 - }, - "created_at": { - "description": "Creation timestamp.", - "type": "string", - "format": "date-time", - "x-order": 12 - }, - "updated_at": { - "description": "Last update timestamp.", - "type": "string", - "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", - "items": { - "type": "object", - "properties": { - "agent_id": { - "description": "Unique Agent identifier.", - "type": "string", - "x-order": 0 - }, - "agent_type": { - "description": "Agent type.", - "type": "string", - "x-order": 1 - }, - "status": { - "description": "Actual Agent status.", - "type": "string", - "x-order": 2 - }, - "is_connected": { - "description": "True if Agent is running and connected to pmm-managed.", - "type": "boolean", - "x-order": 3 - } - } - }, - "x-order": 15 - }, - "services": { - "description": "List of services running on this node.", - "type": "array", - "items": { - "description": "Service represents a service running on a node.", - "type": "object", - "properties": { - "service_id": { - "description": "Unique Service identifier.", - "type": "string", - "x-order": 0 - }, - "service_type": { - "description": "Service type.", - "type": "string", - "x-order": 1 - }, - "service_name": { - "description": "Service name.", - "type": "string", - "x-order": 2 - } - } - }, - "x-order": 16 - }, - "instance_id": { - "description": "Instance ID for cloud providers (e.g. AWS RDS).", - "type": "string", - "x-order": 17 - } - }, - "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 - } - } - } - } - } - }, - "delete": { - "description": "Unregisters a Node and pmm-agent", - "tags": [ - "ManagementService" - ], - "summary": "Unregister a Node", - "operationId": "UnregisterNode", - "parameters": [ - { - "type": "string", - "description": "Node_id to be unregistered.", - "name": "node_id", - "in": "path", - "required": true - }, - { - "type": "boolean", - "description": "Force delete node, related service account, even if it has more service tokens attached.", - "name": "force", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "warning": { - "description": "Warning message if there are more service tokens attached to service account.", - "type": "string", - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/management/services": { - "get": { - "description": "Returns a filtered list of Services.", - "tags": [ - "ManagementService" - ], - "summary": "List Services", - "operationId": "ListServices", - "parameters": [ - { - "type": "string", - "description": "Return only Services running on that Node.", - "name": "node_id", - "in": "query" - }, - { - "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" - ], - "type": "string", - "default": "SERVICE_TYPE_UNSPECIFIED", - "description": "Return only services filtered by service type.", - "name": "service_type", - "in": "query" - }, - { - "type": "string", - "description": "Return only services in this external group.", - "name": "external_group", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "services": { - "description": "List of Services.", - "type": "array", - "items": { - "type": "object", - "properties": { - "service_id": { - "description": "Unique service identifier.", - "type": "string", - "x-order": 0 - }, - "service_type": { - "description": "Service type.", - "type": "string", - "x-order": 1 - }, - "service_name": { - "description": "User-defined name unique across all Services.", - "type": "string", - "x-order": 2 - }, - "database_name": { - "description": "Database name.", - "type": "string", - "x-order": 3 - }, - "node_id": { - "description": "Node identifier where this instance runs.", - "type": "string", - "x-order": 4 - }, - "node_name": { - "description": "Node name where this instance runs.", - "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 for Service.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 9 - }, - "external_group": { - "description": "External group name.", - "type": "string", - "x-order": 10 - }, - "address": { - "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required.", - "type": "string", - "x-order": 11 - }, - "port": { - "description": "Access port.\nPort is required when the address present.", - "type": "integer", - "format": "int64", - "x-order": 12 - }, - "socket": { - "description": "Access unix socket.\nAddress (and port) or socket is required.", - "type": "string", - "x-order": 13 - }, - "created_at": { - "description": "Creation timestamp.", - "type": "string", - "format": "date-time", - "x-order": 14 - }, - "updated_at": { - "description": "Last update timestamp.", - "type": "string", - "format": "date-time", - "x-order": 15 - }, - "agents": { - "description": "List of agents related to this service.", - "type": "array", - "items": { - "type": "object", - "properties": { - "agent_id": { - "description": "Unique agent identifier.", - "type": "string", - "x-order": 0 - }, - "is_agent_password_set": { - "description": "True if the agent password is set.", - "type": "boolean", - "x-order": 1 - }, - "agent_type": { - "description": "Agent type.", - "type": "string", - "x-order": 2 - }, - "aws_access_key": { - "description": "AWS Access Key.", - "type": "string", - "x-order": 3 - }, - "is_aws_secret_key_set": { - "description": "True if AWS Secret Key is set.", - "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", - "format": "date-time", - "x-order": 6 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 7 - }, - "disabled": { - "description": "Desired Agent status: enabled (false) or disabled (true).", - "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": 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", - "format": "int32", - "x-order": 12 - }, - "max_query_log_size": { - "description": "Limit query log size in QAN.", - "type": "string", - "format": "int64", - "x-order": 13 - }, - "metrics_path": { - "description": "Path under which metrics are exposed, used to generate URI.", - "type": "string", - "x-order": 14 - }, - "metrics_scheme": { - "description": "Scheme to generate URI to exporter metrics endpoints.", - "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", - "x-order": 18 - }, - "is_password_set": { - "description": "True if password for connecting the agent to the database is set.", - "type": "boolean", - "x-order": 19 - }, - "pmm_agent_id": { - "description": "The pmm-agent identifier.", - "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", - "x-order": 22 - }, - "push_metrics": { - "description": "True if exporter uses push metrics mode.", - "type": "boolean", - "x-order": 23 - }, - "query_examples_disabled": { - "description": "True if query examples are disabled.", - "type": "boolean", - "x-order": 24 - }, - "comments_parsing_disabled": { - "description": "True if query comments parsing is disabled.", - "type": "boolean", - "x-order": 25 - }, - "rds_basic_metrics_disabled": { - "description": "True if RDS basic metrics are disdabled.", - "type": "boolean", - "x-order": 26 - }, - "rds_enhanced_metrics_disabled": { - "description": "True if RDS enhanced metrics are disdabled.", - "type": "boolean", - "x-order": 27 - }, - "runs_on_node_id": { - "description": "Node identifier where this instance runs.", - "type": "string", - "x-order": 28 - }, - "service_id": { - "description": "Service identifier.", - "type": "string", - "x-order": 29 - }, - "status": { - "description": "Actual Agent status.", - "type": "string", - "x-order": 30 - }, - "table_count": { - "description": "Last known table count.", - "type": "integer", - "format": "int32", - "x-order": 31 - }, - "table_count_tablestats_group_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": 32 - }, - "tls": { - "description": "Use TLS for database connections.", - "type": "boolean", - "x-order": 33 - }, - "tls_skip_verify": { - "description": "Skip TLS certificate and hostname validation.", - "type": "boolean", - "x-order": 34 - }, - "username": { - "description": "HTTP basic auth username for collecting metrics.", - "type": "string", - "x-order": 35 - }, - "updated_at": { - "description": "Last update timestamp.", - "type": "string", - "format": "date-time", - "x-order": 36 - }, - "version": { - "description": "Agent version.", - "type": "string", - "x-order": 37 - }, - "is_connected": { - "description": "True if Agent is running and connected to pmm-managed.", - "type": "boolean", - "x-order": 38 - }, - "expose_exporter": { - "description": "True if an exporter agent is exposed on all host addresses.", - "type": "boolean", - "x-order": 39 - }, - "valkey_options": { - "type": "object", - "x-order": 40 - } - } - }, - "x-order": 16 - }, - "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", - "default": "STATUS_UNSPECIFIED", - "enum": [ - "STATUS_UNSPECIFIED", - "STATUS_UP", - "STATUS_DOWN", - "STATUS_UNKNOWN" - ], - "x-order": 17 - }, - "version": { - "description": "The service/database version.", - "type": "string", - "x-order": 18 - } - } - }, - "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 - } - } - } - } - } - }, - "post": { - "description": "Adds a service and starts several agents.", - "tags": [ - "ManagementService" - ], - "summary": "Add a Service", - "operationId": "AddService", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "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 - }, - "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.", - "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", - "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 - }, - "environment": { - "description": "Environment name.", - "type": "string", - "x-order": 8 - }, - "cluster": { - "description": "Cluster name.", - "type": "string", - "x-order": 9 - }, - "replication_set": { - "description": "Replication set name.", - "type": "string", - "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.", - "type": "object", - "additionalProperties": { - "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 - }, - "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.", - "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", - "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 - }, - "environment": { - "description": "Environment name.", - "type": "string", - "x-order": 8 - }, - "cluster": { - "description": "Cluster name.", - "type": "string", - "x-order": 9 - }, - "replication_set": { - "description": "Replication set name.", - "type": "string", - "x-order": 10 - }, - "username": { - "description": "MongoDB username for exporter and QAN agent access.", - "type": "string", - "x-order": 11 - }, - "password": { - "description": "MongoDB password for exporter and QAN agent access.", - "type": "string", - "x-order": 12 - }, - "qan_mongodb_profiler": { - "description": "If true, adds qan-mongodb-profiler-agent for provided service.", - "type": "boolean", - "x-order": 13 - }, - "qan_mongodb_mongolog": { - "description": "If true, adds qan-mongodb-mongolog-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": 15 - }, - "skip_connection_check": { - "description": "Skip connection check.", - "type": "boolean", - "x-order": 16 - }, - "tls": { - "description": "Use TLS for database connections.", - "type": "boolean", - "x-order": 17 - }, - "tls_skip_verify": { - "description": "Skip TLS certificate and hostname validation.", - "type": "boolean", - "x-order": 18 - }, - "tls_certificate_key": { - "description": "Client certificate and key.", - "type": "string", - "x-order": 19 - }, - "tls_certificate_key_file_password": { - "description": "Password for decrypting tls_certificate_key.", - "type": "string", - "x-order": 20 - }, - "tls_ca": { - "description": "Certificate Authority certificate chain.", - "type": "string", - "x-order": 21 - }, - "max_query_length": { - "description": "Limit query length in QAN (default: server-defined; -1: no limit).", - "type": "integer", - "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", - "items": { - "type": "string" - }, - "x-order": 24 - }, - "authentication_mechanism": { - "description": "Authentication mechanism.\nSee https://docs.mongodb.com/manual/reference/connection-string/#mongodb-urioption-urioption.authMechanism\nfor details.", - "type": "string", - "x-order": 25 - }, - "authentication_database": { - "description": "Authentication database.", - "type": "string", - "x-order": 26 - }, - "agent_password": { - "description": "Custom password for exporter endpoint /metrics.", - "type": "string", - "x-order": 27 - }, - "stats_collections": { - "description": "List of collections to get stats from. Can use * .", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 28 - }, - "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", - "x-order": 29 - }, - "enable_all_collectors": { - "type": "boolean", - "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", - "x-order": 32 - } - }, - "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", - "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.", - "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", - "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 - }, - "pmm_agent_id": { - "description": "The \"pmm-agent\" identifier which should run agents. Required.", - "type": "string", - "x-order": 8 - }, - "environment": { - "description": "Environment name.", - "type": "string", - "x-order": 9 - }, - "cluster": { - "description": "Cluster name.", - "type": "string", - "x-order": 10 - }, - "replication_set": { - "description": "Replication set name.", - "type": "string", - "x-order": 11 - }, - "username": { - "description": "PostgreSQL username for scraping metrics.", - "type": "string", - "x-order": 12 - }, - "password": { - "description": "PostgreSQL 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 - }, - "custom_labels": { - "description": "Custom user-assigned labels for Service.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 18 - }, - "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 - }, - "tls": { - "description": "Use TLS for database connections.", - "type": "boolean", - "x-order": 21 - }, - "tls_skip_verify": { - "description": "Skip TLS certificate and hostname validation. Uses sslmode=required instead of verify-full.", - "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", - "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" - }, - "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": 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", - "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", - "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.", - "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", - "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 - }, - "environment": { - "description": "Environment name.", - "type": "string", - "x-order": 8 - }, - "cluster": { - "description": "Cluster name.", - "type": "string", - "x-order": 9 - }, - "replication_set": { - "description": "Replication set name.", - "type": "string", - "x-order": 10 - }, - "username": { - "description": "ProxySQL username for scraping metrics.", - "type": "string", - "x-order": 11 - }, - "password": { - "description": "ProxySQL password for scraping metrics.", - "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 database connections.", - "type": "boolean", - "x-order": 15 - }, - "tls_skip_verify": { - "description": "Skip TLS certificate and hostname validation.", - "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 - }, - "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": 19 - }, - "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": 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 - }, - "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", - "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 - }, - "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 - }, - "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 - }, - "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.", - "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 - }, - "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 - }, - "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": 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", - "properties": { - "region": { - "description": "AWS region.", - "type": "string", - "x-order": 0 - }, - "az": { - "description": "AWS availability zone.", - "type": "string", - "x-order": 1 - }, - "instance_id": { - "description": "AWS instance ID.", - "type": "string", - "x-order": 2 - }, - "node_model": { - "description": "AWS instance class.", - "type": "string", - "x-order": 3 - }, - "address": { - "description": "Address used to connect to it.", - "type": "string", - "x-order": 4 - }, - "port": { - "description": "Access port.", - "type": "integer", - "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", - "x-order": 7 - }, - "node_name": { - "description": "Unique across all Nodes user-defined name. Defaults to AWS instance ID.", - "type": "string", - "x-order": 8 - }, - "service_name": { - "description": "Unique across all Services user-defined name. Defaults to AWS instance ID.", - "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 - }, - "username": { - "description": "Username for scraping metrics.", - "type": "string", - "x-order": 13 - }, - "password": { - "description": "Password for scraping metrics.", - "type": "string", - "x-order": 14 - }, - "aws_access_key": { - "description": "AWS Access key.", - "type": "string", - "x-order": 15 - }, - "aws_secret_key": { - "description": "AWS Secret key.", - "type": "string", - "x-order": 16 - }, - "rds_exporter": { - "description": "If true, adds rds_exporter.", - "type": "boolean", - "x-order": 17 - }, - "qan_mysql_perfschema": { - "description": "If true, adds qan-mysql-perfschema-agent.", - "type": "boolean", - "x-order": 18 - }, - "custom_labels": { - "description": "Custom user-assigned labels for Node and Service.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 19 - }, - "skip_connection_check": { - "description": "Skip connection check.", - "type": "boolean", - "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 - }, - "disable_query_examples": { - "description": "Disable query examples.", - "type": "boolean", - "x-order": 23 - }, - "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": 24 - }, - "disable_basic_metrics": { - "description": "Disable basic metrics.", - "type": "boolean", - "x-order": 25 - }, - "disable_enhanced_metrics": { - "description": "Disable enhanced metrics.", - "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", - "x-order": 28 - }, - "agent_password": { - "description": "Custom password for exporter endpoint /metrics.", - "type": "string", - "x-order": 29 - }, - "database": { - "description": "Database name.", - "type": "string", - "x-order": 30 - }, - "auto_discovery_limit": { - "description": "Limit of databases for auto-discovery.", - "type": "integer", - "format": "int32", - "x-order": 31 - }, - "disable_comments_parsing": { - "description": "Disable parsing comments from queries and showing them in QAN.", - "type": "boolean", - "x-order": 32 - }, - "max_postgresql_exporter_connections": { - "description": "Maximum number of exporter connections to PostgreSQL instance.", - "type": "integer", - "format": "int32", - "x-order": 33 - } - }, - "x-order": 6 - }, - "valkey": { - "type": "object", - "properties": { - "node_id": { - "description": "Node identifier on which the service is running.\nOnly 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 running.\nOnly 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": "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", - "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", - "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 - } - }, - "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.", - "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": "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 - }, - "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", - "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": 1 - }, - "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.", - "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", - "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 - } - }, - "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": { - "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": { - "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 - }, - "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 - }, - "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.", - "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": "MongoDB version.", - "type": "string", - "x-order": 10 - } - }, - "x-order": 0 - }, - "mongodb_exporter": { - "description": "MongoDBExporter runs on Generic or Container Node and exposes MongoDB 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": "MongoDB 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": 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 - }, - "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": 11 - }, - "stats_collections": { - "type": "array", - "title": "List of colletions to get stats from. Can use *", - "items": { - "type": "string" - }, - "x-order": 12 - }, - "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", - "x-order": 13 - }, - "enable_all_collectors": { - "description": "Enable All collectors.", - "type": "boolean", - "x-order": 14 - }, - "process_exec_path": { - "description": "Path to exec process.", - "type": "string", - "x-order": 15 - }, - "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 - }, - "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.", - "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": 18 - } - }, - "x-order": 1 - }, - "qan_mongodb_profiler": { - "description": "QANMongoDBProfilerAgent runs within pmm-agent and sends MongoDB 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": "MongoDB username for getting profiler 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 - }, - "max_query_length": { - "description": "Limit query length in QAN (default: server-defined; -1: no limit).", - "type": "integer", - "format": "int32", - "x-order": 7 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "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", - "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": 2 - }, - "qan_mongodb_mongolog": { - "description": "QANMongoDBMongologAgent runs within pmm-agent and sends MongoDB 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": "MongoDB username for getting profiler 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 - }, - "max_query_length": { - "description": "Limit query length in QAN (default: server-defined; -1: no limit).", - "type": "integer", - "format": "int32", - "x-order": 7 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "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", - "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 - } - }, - "x-order": 1 - }, - "postgresql": { - "type": "object", - "properties": { - "service": { - "description": "PostgreSQLService represents a generic PostgreSQL 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 - }, - "database_name": { - "description": "Database name.", - "type": "string", - "x-order": 2 - }, - "node_id": { - "description": "Node identifier where this instance runs.", - "type": "string", - "x-order": 3 - }, - "address": { - "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required.", - "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.", - "type": "string", - "x-order": 9 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 10 - }, - "version": { - "description": "PostgreSQL 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": 0 - }, - "postgres_exporter": { - "description": "PostgresExporter runs on Generic or Container Node and exposes PostgreSQL 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": "PostgreSQL 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. Uses sslmode=required instead of verify-full.", - "type": "boolean", - "x-order": 6 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "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 - }, - "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": 11 - }, - "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" - ], - "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 - } - }, - "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.", - "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 - }, - "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_postgresql_pgstatmonitor_agent": { - "description": "QANPostgreSQLPgStatMonitorAgent 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 monitor 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 - }, - "disable_comments_parsing": { - "description": "Disable parsing comments from queries and showing them in QAN.", - "type": "boolean", - "x-order": 7 - }, - "max_query_length": { - "description": "Limit query length in QAN (default: server-defined; -1: no limit).", - "type": "integer", - "format": "int32", - "x-order": 8 - }, - "query_examples_disabled": { - "description": "True if query examples are disabled.", - "type": "boolean", - "x-order": 9 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "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 - }, - "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" - ], - "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 - }, - "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": 0 - }, - "proxysql_exporter": { - "description": "ProxySQLExporter runs on Generic or Container Node and exposes ProxySQL 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": "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": 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 - }, - "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": 11 - }, - "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" - ], - "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.", - "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": "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.", - "type": "string", - "x-order": 5 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 6 - } - }, - "x-order": 0 - }, - "external_exporter": { - "description": "ExternalExporter runs on any Node type, including Remote Node.", - "type": "object", - "properties": { - "agent_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "runs_on_node_id": { - "description": "Node identifier where this instance runs.", - "type": "string", - "x-order": 1 - }, - "disabled": { - "description": "If disabled, metrics from this exporter will not be collected.", - "type": "boolean", - "x-order": 2 - }, - "service_id": { - "description": "Service identifier.", - "type": "string", - "x-order": 3 - }, - "username": { - "description": "HTTP basic auth username for collecting metrics.", - "type": "string", - "x-order": 4 - }, - "scheme": { - "description": "Scheme to generate URI to exporter metrics endpoints.", - "type": "string", - "x-order": 5 - }, - "metrics_path": { - "description": "Path under which metrics are exposed, used to generate URI.", - "type": "string", - "x-order": 6 - }, - "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 - } - }, - "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.", - "type": "string", - "x-order": 7 - } - }, - "x-order": 0 - }, - "external_exporter": { - "description": "ExternalExporter runs on any Node type, including Remote Node.", - "type": "object", - "properties": { - "agent_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "runs_on_node_id": { - "description": "Node identifier where this instance runs.", - "type": "string", - "x-order": 1 - }, - "disabled": { - "description": "If disabled, metrics from this exporter will not be collected.", - "type": "boolean", - "x-order": 2 - }, - "service_id": { - "description": "Service identifier.", - "type": "string", - "x-order": 3 - }, - "username": { - "description": "HTTP basic auth username for collecting metrics.", - "type": "string", - "x-order": 4 - }, - "scheme": { - "description": "Scheme to generate URI to exporter metrics endpoints.", - "type": "string", - "x-order": 5 - }, - "metrics_path": { - "description": "Path under which metrics are exposed, used to generate URI.", - "type": "string", - "x-order": 6 - }, - "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 - } - }, - "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": { - "node_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "node_name": { - "description": "Unique across all Nodes user-defined name.", - "type": "string", - "x-order": 1 - }, - "address": { - "description": "DB instance identifier.", - "type": "string", - "x-order": 2 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 3 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 4 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 5 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 6 - }, - "instance_id": { - "description": "AWS instance ID.", - "type": "string", - "x-order": 7 - } - }, - "x-order": 0 - }, - "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 - }, - "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.", - "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": { - "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 - }, - "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.", - "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 - } - }, - "x-order": 1 - }, - "mysql": { - "description": "MySQLService represents a generic MySQL 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": "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": 2 - }, - "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", - "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 - }, - "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", - "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 - } - }, - "x-order": 4 - }, - "postgresql": { - "description": "PostgreSQLService represents a generic PostgreSQL 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 - }, - "database_name": { - "description": "Database name.", - "type": "string", - "x-order": 2 - }, - "node_id": { - "description": "Node identifier where this instance runs.", - "type": "string", - "x-order": 3 - }, - "address": { - "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required.", - "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.", - "type": "string", - "x-order": 9 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 10 - }, - "version": { - "description": "PostgreSQL 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": 5 - }, - "postgresql_exporter": { - "description": "PostgresExporter runs on Generic or Container Node and exposes PostgreSQL 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": "PostgreSQL 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. Uses sslmode=required instead of verify-full.", - "type": "boolean", - "x-order": 6 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "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 - }, - "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": 11 - }, - "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" - ], - "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 - } - }, - "x-order": 6 - }, - "qan_postgresql_pgstatements": { - "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.", - "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 - }, - "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": 7 - } - }, - "x-order": 6 - }, - "valkey": { - "type": "object", - "properties": { - "service": { - "description": "ValkeyService represents a generic Valkey 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": "Valkey version.", - "type": "string", - "x-order": 10 - } - }, - "x-order": 0 - }, - "valkey_exporter": { - "description": "ValkeyExporter runs on Generic or Container Node and exposes Valkey 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": "Valkey 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 verification.", - "type": "boolean", - "x-order": 6 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "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 - }, - "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": 11 - }, - "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": 13 - }, - "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 - } - }, - "x-order": 1 - } - }, - "x-order": 7 - } - } - } - }, - "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/azure": { - "post": { - "description": "Adds an Azure Database instance.", - "tags": [ - "ManagementService" - ], - "summary": "Add Azure Database", - "operationId": "AddAzureDatabase", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "region": { - "description": "Azure database location.", - "type": "string", - "x-order": 0 - }, - "az": { - "description": "Azure database availability zone.", - "type": "string", - "x-order": 1 - }, - "instance_id": { - "description": "Azure database instance ID.", - "type": "string", - "x-order": 2 - }, - "node_model": { - "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": 3 - }, - "address": { - "description": "Address used to connect to it.", - "type": "string", - "x-order": 4 - }, - "port": { - "description": "Access port.", - "type": "integer", - "format": "int64", - "x-order": 5 - }, - "node_name": { - "description": "Unique across all Nodes user-defined name. Defaults to Azure Database instance ID.", - "type": "string", - "x-order": 6 - }, - "service_name": { - "description": "Unique across all Services user-defined name. Defaults to Azure Database instance ID.", - "type": "string", - "x-order": 7 - }, - "environment": { - "description": "Environment name.", - "type": "string", - "x-order": 8 - }, - "username": { - "description": "Username for scraping metrics.", - "type": "string", - "x-order": 9 - }, - "password": { - "description": "Password for scraping metrics.", - "type": "string", - "x-order": 10 - }, - "azure_client_id": { - "description": "Azure client ID.", - "type": "string", - "x-order": 11 - }, - "azure_client_secret": { - "description": "Azure client secret.", - "type": "string", - "x-order": 12 - }, - "azure_tenant_id": { - "description": "Azure tanant ID.", - "type": "string", - "x-order": 13 - }, - "azure_subscription_id": { - "description": "Azure subscription ID.", - "type": "string", - "x-order": 14 - }, - "azure_resource_group": { - "description": "Azure resource group.", - "type": "string", - "x-order": 15 - }, - "azure_database_exporter": { - "description": "If true, adds azure_database_exporter.", - "type": "boolean", - "x-order": 16 - }, - "qan": { - "description": "If true, adds qan-mysql-perfschema-agent or qan-postgresql-pgstatements-agent.", - "type": "boolean", - "x-order": 17 - }, - "custom_labels": { - "description": "Custom user-assigned labels for Node and Service.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 18 - }, - "skip_connection_check": { - "description": "Skip connection check.", - "type": "boolean", - "x-order": 19 - }, - "tls": { - "description": "Use TLS for database connections.", - "type": "boolean", - "x-order": 20 - }, - "tls_skip_verify": { - "description": "Skip TLS certificate and hostname validation.", - "type": "boolean", - "x-order": 21 - }, - "disable_query_examples": { - "description": "Disable query examples.", - "type": "boolean", - "x-order": 22 - }, - "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": 23 - }, - "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": 24 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/management/services/{service_id}": { - "delete": { - "description": "Removes a Service along with its Agents.", - "tags": [ - "ManagementService" - ], - "summary": "Remove a Service", - "operationId": "RemoveService", - "parameters": [ - { - "type": "string", - "description": "Either a Service ID or a Service Name.", - "name": "service_id", - "in": "path", - "required": true - }, - { - "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" - ], - "type": "string", - "default": "SERVICE_TYPE_UNSPECIFIED", - "description": "Service type.", - "name": "service_type", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/management/services:discoverAzure": { - "post": { - "description": "Discovers Azure Database for MySQL, MariaDB and PostgreSQL Server instances.", - "tags": [ - "ManagementService" - ], - "summary": "Discover Azure Database", - "operationId": "DiscoverAzureDatabase", - "parameters": [ - { - "description": "DiscoverAzureDatabaseRequest discover azure databases request.", - "name": "body", - "in": "body", - "required": true, - "schema": { - "description": "DiscoverAzureDatabaseRequest discover azure databases request.", - "type": "object", - "properties": { - "azure_client_id": { - "description": "Azure client ID.", - "type": "string", - "x-order": 0 - }, - "azure_client_secret": { - "description": "Azure client secret.", - "type": "string", - "x-order": 1 - }, - "azure_tenant_id": { - "description": "Azure tanant ID.", - "type": "string", - "x-order": 2 - }, - "azure_subscription_id": { - "description": "Azure subscription ID.", - "type": "string", - "x-order": 3 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "description": "DiscoverAzureDatabaseResponse discover azure databases response.", - "type": "object", - "properties": { - "azure_database_instance": { - "type": "array", - "items": { - "description": "DiscoverAzureDatabaseInstance models an unique Azure Database instance for the list of instances returned by Discovery.", - "type": "object", - "properties": { - "instance_id": { - "description": "Azure database instance ID.", - "type": "string", - "x-order": 0 - }, - "region": { - "description": "Azure database location.", - "type": "string", - "x-order": 1 - }, - "service_name": { - "description": "Azure database server name.", - "type": "string", - "x-order": 2 - }, - "username": { - "description": "Database username.", - "type": "string", - "x-order": 3 - }, - "address": { - "description": "Address used to connect to it.", - "type": "string", - "x-order": 4 - }, - "azure_resource_group": { - "description": "Azure Resource group.", - "type": "string", - "x-order": 5 - }, - "environment": { - "description": "Environment tag.", - "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", - "x-order": 8 - }, - "node_model": { - "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 - } - } - }, - "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/services:discoverRDS": { - "post": { - "description": "Discovers RDS instances.", - "tags": [ - "ManagementService" - ], - "summary": "Discover RDS", - "operationId": "DiscoverRDS", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "aws_access_key": { - "description": "AWS Access key. Optional.", - "type": "string", - "x-order": 0 - }, - "aws_secret_key": { - "description": "AWS Secret key. Optional.", - "type": "string", - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "rds_instances": { - "type": "array", - "items": { - "description": "DiscoverRDSInstance models an unique RDS instance for the list of instances returned by Discovery.", - "type": "object", - "properties": { - "region": { - "description": "AWS region.", - "type": "string", - "x-order": 0 - }, - "az": { - "description": "AWS availability zone.", - "type": "string", - "x-order": 1 - }, - "instance_id": { - "description": "AWS instance ID.", - "type": "string", - "x-order": 2 - }, - "node_model": { - "description": "AWS instance class.", - "type": "string", - "x-order": 3 - }, - "address": { - "description": "Address used to connect to it.", - "type": "string", - "x-order": 4 - }, - "port": { - "description": "Access port.", - "type": "integer", - "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 - }, - "engine_version": { - "description": "Engine version.", - "type": "string", - "x-order": 7 - } - } - }, - "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 - } - } - } - } - } - } - } - }, - "tags": [ - { - "name": "ManagementService" - } - ] -} \ No newline at end of file diff --git a/api/management/v1/metrics.pb.go b/api/management/v1/metrics.pb.go deleted file mode 100644 index fdb996e0ad3..00000000000 --- a/api/management/v1/metrics.pb.go +++ /dev/null @@ -1,137 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.10 -// protoc (unknown) -// source: management/v1/metrics.proto - -package managementv1 - -import ( - reflect "reflect" - sync "sync" - unsafe "unsafe" - - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// MetricsMode defines desired metrics mode for agent, -// it can be pull, push or auto mode chosen by server. -type MetricsMode int32 - -const ( - // Auto - MetricsMode_METRICS_MODE_UNSPECIFIED MetricsMode = 0 - MetricsMode_METRICS_MODE_PULL MetricsMode = 1 - MetricsMode_METRICS_MODE_PUSH MetricsMode = 2 -) - -// Enum value maps for MetricsMode. -var ( - MetricsMode_name = map[int32]string{ - 0: "METRICS_MODE_UNSPECIFIED", - 1: "METRICS_MODE_PULL", - 2: "METRICS_MODE_PUSH", - } - MetricsMode_value = map[string]int32{ - "METRICS_MODE_UNSPECIFIED": 0, - "METRICS_MODE_PULL": 1, - "METRICS_MODE_PUSH": 2, - } -) - -func (x MetricsMode) Enum() *MetricsMode { - p := new(MetricsMode) - *p = x - return p -} - -func (x MetricsMode) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (MetricsMode) Descriptor() protoreflect.EnumDescriptor { - return file_management_v1_metrics_proto_enumTypes[0].Descriptor() -} - -func (MetricsMode) Type() protoreflect.EnumType { - return &file_management_v1_metrics_proto_enumTypes[0] -} - -func (x MetricsMode) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use MetricsMode.Descriptor instead. -func (MetricsMode) EnumDescriptor() ([]byte, []int) { - return file_management_v1_metrics_proto_rawDescGZIP(), []int{0} -} - -var File_management_v1_metrics_proto protoreflect.FileDescriptor - -const file_management_v1_metrics_proto_rawDesc = "" + - "\n" + - "\x1bmanagement/v1/metrics.proto\x12\rmanagement.v1*Y\n" + - "\vMetricsMode\x12\x1c\n" + - "\x18METRICS_MODE_UNSPECIFIED\x10\x00\x12\x15\n" + - "\x11METRICS_MODE_PULL\x10\x01\x12\x15\n" + - "\x11METRICS_MODE_PUSH\x10\x02B\xad\x01\n" + - "\x11com.management.v1B\fMetricsProtoP\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 ( - file_management_v1_metrics_proto_rawDescOnce sync.Once - file_management_v1_metrics_proto_rawDescData []byte -) - -func file_management_v1_metrics_proto_rawDescGZIP() []byte { - file_management_v1_metrics_proto_rawDescOnce.Do(func() { - file_management_v1_metrics_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_management_v1_metrics_proto_rawDesc), len(file_management_v1_metrics_proto_rawDesc))) - }) - 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_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_management_v1_metrics_proto_init() } -func file_management_v1_metrics_proto_init() { - if File_management_v1_metrics_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_management_v1_metrics_proto_rawDesc), len(file_management_v1_metrics_proto_rawDesc)), - NumEnums: 1, - NumMessages: 0, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_management_v1_metrics_proto_goTypes, - DependencyIndexes: file_management_v1_metrics_proto_depIdxs, - EnumInfos: file_management_v1_metrics_proto_enumTypes, - }.Build() - File_management_v1_metrics_proto = out.File - file_management_v1_metrics_proto_goTypes = nil - file_management_v1_metrics_proto_depIdxs = nil -} diff --git a/api/management/v1/metrics.pb.validate.go b/api/management/v1/metrics.pb.validate.go deleted file mode 100644 index 6854727ddbb..00000000000 --- a/api/management/v1/metrics.pb.validate.go +++ /dev/null @@ -1,36 +0,0 @@ -// Code generated by protoc-gen-validate. DO NOT EDIT. -// source: management/v1/metrics.proto - -package managementv1 - -import ( - "bytes" - "errors" - "fmt" - "net" - "net/mail" - "net/url" - "regexp" - "sort" - "strings" - "time" - "unicode/utf8" - - "google.golang.org/protobuf/types/known/anypb" -) - -// ensure the imports are used -var ( - _ = bytes.MinRead - _ = errors.New("") - _ = fmt.Print - _ = utf8.UTFMax - _ = (*regexp.Regexp)(nil) - _ = (*strings.Reader)(nil) - _ = net.IPv4len - _ = time.Duration(0) - _ = (*url.URL)(nil) - _ = (*mail.Address)(nil) - _ = anypb.Any{} - _ = sort.Sort -) diff --git a/api/management/v1/mongodb.pb.go b/api/management/v1/mongodb.pb.go deleted file mode 100644 index d29b9caf6c2..00000000000 --- a/api/management/v1/mongodb.pb.go +++ /dev/null @@ -1,559 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.10 -// protoc (unknown) -// source: management/v1/mongodb.proto - -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" - - v1 "github.com/percona/pmm/api/inventory/v1" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type AddMongoDBServiceParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - // 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 `protobuf:"bytes,1,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` - // Node name on which a service is been running. - // Exactly one of these parameters should be present: node_id, node_name, add_node. - NodeName string `protobuf:"bytes,2,opt,name=node_name,json=nodeName,proto3" json:"node_name,omitempty"` - // Create a new Node with those parameters. - // Exactly one of these parameters should be present: node_id, node_name, add_node. - AddNode *AddNodeParams `protobuf:"bytes,3,opt,name=add_node,json=addNode,proto3" json:"add_node,omitempty"` - // Unique across all Services user-defined name. Required. - ServiceName string `protobuf:"bytes,4,opt,name=service_name,json=serviceName,proto3" json:"service_name,omitempty"` - // Node and Service access address (DNS name or IP). - // Address (and port) or socket is required. - Address string `protobuf:"bytes,5,opt,name=address,proto3" json:"address,omitempty"` - // Service Access port. - // Port is required when the address present. - Port uint32 `protobuf:"varint,6,opt,name=port,proto3" json:"port,omitempty"` - // Service Access socket. - // Address (and port) or socket is required. - Socket string `protobuf:"bytes,7,opt,name=socket,proto3" json:"socket,omitempty"` - // The "pmm-agent" identifier which should run agents. Required. - PmmAgentId string `protobuf:"bytes,9,opt,name=pmm_agent_id,json=pmmAgentId,proto3" json:"pmm_agent_id,omitempty"` - // Environment name. - Environment string `protobuf:"bytes,10,opt,name=environment,proto3" json:"environment,omitempty"` - // Cluster name. - Cluster string `protobuf:"bytes,11,opt,name=cluster,proto3" json:"cluster,omitempty"` - // Replication set name. - ReplicationSet string `protobuf:"bytes,12,opt,name=replication_set,json=replicationSet,proto3" json:"replication_set,omitempty"` - // MongoDB username for exporter and QAN agent access. - Username string `protobuf:"bytes,13,opt,name=username,proto3" json:"username,omitempty"` - // MongoDB password for exporter and QAN agent access. - Password string `protobuf:"bytes,14,opt,name=password,proto3" json:"password,omitempty"` - // If true, adds qan-mongodb-profiler-agent for provided service. - QanMongodbProfiler bool `protobuf:"varint,15,opt,name=qan_mongodb_profiler,json=qanMongodbProfiler,proto3" json:"qan_mongodb_profiler,omitempty"` - // If true, adds qan-mongodb-mongolog-agent for provided service. - QanMongodbMongolog bool `protobuf:"varint,35,opt,name=qan_mongodb_mongolog,json=qanMongodbMongolog,proto3" json:"qan_mongodb_mongolog,omitempty"` - // Custom user-assigned labels for Service. - CustomLabels map[string]string `protobuf:"bytes,16,rep,name=custom_labels,json=customLabels,proto3" json:"custom_labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - // Skip connection check. - SkipConnectionCheck bool `protobuf:"varint,17,opt,name=skip_connection_check,json=skipConnectionCheck,proto3" json:"skip_connection_check,omitempty"` - // Use TLS for database connections. - Tls bool `protobuf:"varint,19,opt,name=tls,proto3" json:"tls,omitempty"` - // Skip TLS certificate and hostname validation. - TlsSkipVerify bool `protobuf:"varint,20,opt,name=tls_skip_verify,json=tlsSkipVerify,proto3" json:"tls_skip_verify,omitempty"` - // Client certificate and key. - TlsCertificateKey string `protobuf:"bytes,21,opt,name=tls_certificate_key,json=tlsCertificateKey,proto3" json:"tls_certificate_key,omitempty"` - // Password for decrypting tls_certificate_key. - TlsCertificateKeyFilePassword string `protobuf:"bytes,22,opt,name=tls_certificate_key_file_password,json=tlsCertificateKeyFilePassword,proto3" json:"tls_certificate_key_file_password,omitempty"` - // Certificate Authority certificate chain. - TlsCa string `protobuf:"bytes,23,opt,name=tls_ca,json=tlsCa,proto3" json:"tls_ca,omitempty"` - // Limit query length in QAN (default: server-defined; -1: no limit). - MaxQueryLength int32 `protobuf:"varint,24,opt,name=max_query_length,json=maxQueryLength,proto3" json:"max_query_length,omitempty"` - // Defines metrics flow model for this exporter. - // Metrics could be pushed to the server with vmagent, - // pulled by the server, or the server could choose behavior automatically. - MetricsMode MetricsMode `protobuf:"varint,25,opt,name=metrics_mode,json=metricsMode,proto3,enum=management.v1.MetricsMode" json:"metrics_mode,omitempty"` - // List of collector names to disable in this exporter. - DisableCollectors []string `protobuf:"bytes,26,rep,name=disable_collectors,json=disableCollectors,proto3" json:"disable_collectors,omitempty"` - // Authentication mechanism. - // See https://docs.mongodb.com/manual/reference/connection-string/#mongodb-urioption-urioption.authMechanism - // for details. - AuthenticationMechanism string `protobuf:"bytes,27,opt,name=authentication_mechanism,json=authenticationMechanism,proto3" json:"authentication_mechanism,omitempty"` - // Authentication database. - AuthenticationDatabase string `protobuf:"bytes,28,opt,name=authentication_database,json=authenticationDatabase,proto3" json:"authentication_database,omitempty"` - // Custom password for exporter endpoint /metrics. - AgentPassword string `protobuf:"bytes,29,opt,name=agent_password,json=agentPassword,proto3" json:"agent_password,omitempty"` - // List of collections to get stats from. Can use * . - StatsCollections []string `protobuf:"bytes,30,rep,name=stats_collections,json=statsCollections,proto3" json:"stats_collections,omitempty"` - // 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 `protobuf:"varint,31,opt,name=collections_limit,json=collectionsLimit,proto3" json:"collections_limit,omitempty"` - // Enable all collectors - EnableAllCollectors bool `protobuf:"varint,32,opt,name=enable_all_collectors,json=enableAllCollectors,proto3" json:"enable_all_collectors,omitempty"` - // Exporter log level - LogLevel v1.LogLevel `protobuf:"varint,33,opt,name=log_level,json=logLevel,proto3,enum=inventory.v1.LogLevel" json:"log_level,omitempty"` - // Optionally expose the exporter process on all public interfaces - ExposeExporter bool `protobuf:"varint,34,opt,name=expose_exporter,json=exposeExporter,proto3" json:"expose_exporter,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AddMongoDBServiceParams) Reset() { - *x = AddMongoDBServiceParams{} - mi := &file_management_v1_mongodb_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AddMongoDBServiceParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddMongoDBServiceParams) ProtoMessage() {} - -func (x *AddMongoDBServiceParams) ProtoReflect() protoreflect.Message { - mi := &file_management_v1_mongodb_proto_msgTypes[0] - 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 AddMongoDBServiceParams.ProtoReflect.Descriptor instead. -func (*AddMongoDBServiceParams) Descriptor() ([]byte, []int) { - return file_management_v1_mongodb_proto_rawDescGZIP(), []int{0} -} - -func (x *AddMongoDBServiceParams) GetNodeId() string { - if x != nil { - return x.NodeId - } - return "" -} - -func (x *AddMongoDBServiceParams) GetNodeName() string { - if x != nil { - return x.NodeName - } - return "" -} - -func (x *AddMongoDBServiceParams) GetAddNode() *AddNodeParams { - if x != nil { - return x.AddNode - } - return nil -} - -func (x *AddMongoDBServiceParams) GetServiceName() string { - if x != nil { - return x.ServiceName - } - return "" -} - -func (x *AddMongoDBServiceParams) GetAddress() string { - if x != nil { - return x.Address - } - return "" -} - -func (x *AddMongoDBServiceParams) GetPort() uint32 { - if x != nil { - return x.Port - } - return 0 -} - -func (x *AddMongoDBServiceParams) GetSocket() string { - if x != nil { - return x.Socket - } - return "" -} - -func (x *AddMongoDBServiceParams) GetPmmAgentId() string { - if x != nil { - return x.PmmAgentId - } - return "" -} - -func (x *AddMongoDBServiceParams) GetEnvironment() string { - if x != nil { - return x.Environment - } - return "" -} - -func (x *AddMongoDBServiceParams) GetCluster() string { - if x != nil { - return x.Cluster - } - return "" -} - -func (x *AddMongoDBServiceParams) GetReplicationSet() string { - if x != nil { - return x.ReplicationSet - } - return "" -} - -func (x *AddMongoDBServiceParams) GetUsername() string { - if x != nil { - return x.Username - } - return "" -} - -func (x *AddMongoDBServiceParams) GetPassword() string { - if x != nil { - return x.Password - } - return "" -} - -func (x *AddMongoDBServiceParams) GetQanMongodbProfiler() bool { - if x != nil { - return x.QanMongodbProfiler - } - return false -} - -func (x *AddMongoDBServiceParams) GetQanMongodbMongolog() bool { - if x != nil { - return x.QanMongodbMongolog - } - return false -} - -func (x *AddMongoDBServiceParams) GetCustomLabels() map[string]string { - if x != nil { - return x.CustomLabels - } - return nil -} - -func (x *AddMongoDBServiceParams) GetSkipConnectionCheck() bool { - if x != nil { - return x.SkipConnectionCheck - } - return false -} - -func (x *AddMongoDBServiceParams) GetTls() bool { - if x != nil { - return x.Tls - } - return false -} - -func (x *AddMongoDBServiceParams) GetTlsSkipVerify() bool { - if x != nil { - return x.TlsSkipVerify - } - return false -} - -func (x *AddMongoDBServiceParams) GetTlsCertificateKey() string { - if x != nil { - return x.TlsCertificateKey - } - return "" -} - -func (x *AddMongoDBServiceParams) GetTlsCertificateKeyFilePassword() string { - if x != nil { - return x.TlsCertificateKeyFilePassword - } - return "" -} - -func (x *AddMongoDBServiceParams) GetTlsCa() string { - if x != nil { - return x.TlsCa - } - return "" -} - -func (x *AddMongoDBServiceParams) GetMaxQueryLength() int32 { - if x != nil { - return x.MaxQueryLength - } - return 0 -} - -func (x *AddMongoDBServiceParams) GetMetricsMode() MetricsMode { - if x != nil { - return x.MetricsMode - } - return MetricsMode_METRICS_MODE_UNSPECIFIED -} - -func (x *AddMongoDBServiceParams) GetDisableCollectors() []string { - if x != nil { - return x.DisableCollectors - } - return nil -} - -func (x *AddMongoDBServiceParams) GetAuthenticationMechanism() string { - if x != nil { - return x.AuthenticationMechanism - } - return "" -} - -func (x *AddMongoDBServiceParams) GetAuthenticationDatabase() string { - if x != nil { - return x.AuthenticationDatabase - } - return "" -} - -func (x *AddMongoDBServiceParams) GetAgentPassword() string { - if x != nil { - return x.AgentPassword - } - return "" -} - -func (x *AddMongoDBServiceParams) GetStatsCollections() []string { - if x != nil { - return x.StatsCollections - } - return nil -} - -func (x *AddMongoDBServiceParams) GetCollectionsLimit() int32 { - if x != nil { - return x.CollectionsLimit - } - return 0 -} - -func (x *AddMongoDBServiceParams) GetEnableAllCollectors() bool { - if x != nil { - return x.EnableAllCollectors - } - return false -} - -func (x *AddMongoDBServiceParams) GetLogLevel() v1.LogLevel { - if x != nil { - return x.LogLevel - } - return v1.LogLevel(0) -} - -func (x *AddMongoDBServiceParams) GetExposeExporter() bool { - if x != nil { - return x.ExposeExporter - } - return false -} - -type MongoDBServiceResult struct { - state protoimpl.MessageState `protogen:"open.v1"` - Service *v1.MongoDBService `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"` - MongodbExporter *v1.MongoDBExporter `protobuf:"bytes,2,opt,name=mongodb_exporter,json=mongodbExporter,proto3" json:"mongodb_exporter,omitempty"` - QanMongodbProfiler *v1.QANMongoDBProfilerAgent `protobuf:"bytes,3,opt,name=qan_mongodb_profiler,json=qanMongodbProfiler,proto3" json:"qan_mongodb_profiler,omitempty"` - QanMongodbMongolog *v1.QANMongoDBMongologAgent `protobuf:"bytes,4,opt,name=qan_mongodb_mongolog,json=qanMongodbMongolog,proto3" json:"qan_mongodb_mongolog,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *MongoDBServiceResult) Reset() { - *x = MongoDBServiceResult{} - mi := &file_management_v1_mongodb_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *MongoDBServiceResult) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MongoDBServiceResult) ProtoMessage() {} - -func (x *MongoDBServiceResult) ProtoReflect() protoreflect.Message { - mi := &file_management_v1_mongodb_proto_msgTypes[1] - 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 MongoDBServiceResult.ProtoReflect.Descriptor instead. -func (*MongoDBServiceResult) Descriptor() ([]byte, []int) { - return file_management_v1_mongodb_proto_rawDescGZIP(), []int{1} -} - -func (x *MongoDBServiceResult) GetService() *v1.MongoDBService { - if x != nil { - return x.Service - } - return nil -} - -func (x *MongoDBServiceResult) GetMongodbExporter() *v1.MongoDBExporter { - if x != nil { - return x.MongodbExporter - } - return nil -} - -func (x *MongoDBServiceResult) GetQanMongodbProfiler() *v1.QANMongoDBProfilerAgent { - if x != nil { - return x.QanMongodbProfiler - } - return nil -} - -func (x *MongoDBServiceResult) GetQanMongodbMongolog() *v1.QANMongoDBMongologAgent { - if x != nil { - return x.QanMongodbMongolog - } - return nil -} - -var File_management_v1_mongodb_proto protoreflect.FileDescriptor - -const file_management_v1_mongodb_proto_rawDesc = "" + - "\n" + - "\x1bmanagement/v1/mongodb.proto\x12\rmanagement.v1\x1a\x19inventory/v1/agents.proto\x1a\x1cinventory/v1/log_level.proto\x1a\x1binventory/v1/services.proto\x1a\x1bmanagement/v1/metrics.proto\x1a\x18management/v1/node.proto\x1a\x17validate/validate.proto\"\x83\f\n" + - "\x17AddMongoDBServiceParams\x12\x17\n" + - "\anode_id\x18\x01 \x01(\tR\x06nodeId\x12\x1b\n" + - "\tnode_name\x18\x02 \x01(\tR\bnodeName\x127\n" + - "\badd_node\x18\x03 \x01(\v2\x1c.management.v1.AddNodeParamsR\aaddNode\x12*\n" + - "\fservice_name\x18\x04 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\vserviceName\x12\x18\n" + - "\aaddress\x18\x05 \x01(\tR\aaddress\x12\x12\n" + - "\x04port\x18\x06 \x01(\rR\x04port\x12\x16\n" + - "\x06socket\x18\a \x01(\tR\x06socket\x12)\n" + - "\fpmm_agent_id\x18\t \x01(\tB\a\xfaB\x04r\x02\x10\x01R\n" + - "pmmAgentId\x12 \n" + - "\venvironment\x18\n" + - " \x01(\tR\venvironment\x12\x18\n" + - "\acluster\x18\v \x01(\tR\acluster\x12'\n" + - "\x0freplication_set\x18\f \x01(\tR\x0ereplicationSet\x12\x1a\n" + - "\busername\x18\r \x01(\tR\busername\x12\x1a\n" + - "\bpassword\x18\x0e \x01(\tR\bpassword\x120\n" + - "\x14qan_mongodb_profiler\x18\x0f \x01(\bR\x12qanMongodbProfiler\x120\n" + - "\x14qan_mongodb_mongolog\x18# \x01(\bR\x12qanMongodbMongolog\x12]\n" + - "\rcustom_labels\x18\x10 \x03(\v28.management.v1.AddMongoDBServiceParams.CustomLabelsEntryR\fcustomLabels\x122\n" + - "\x15skip_connection_check\x18\x11 \x01(\bR\x13skipConnectionCheck\x12\x10\n" + - "\x03tls\x18\x13 \x01(\bR\x03tls\x12&\n" + - "\x0ftls_skip_verify\x18\x14 \x01(\bR\rtlsSkipVerify\x12.\n" + - "\x13tls_certificate_key\x18\x15 \x01(\tR\x11tlsCertificateKey\x12H\n" + - "!tls_certificate_key_file_password\x18\x16 \x01(\tR\x1dtlsCertificateKeyFilePassword\x12\x15\n" + - "\x06tls_ca\x18\x17 \x01(\tR\x05tlsCa\x12(\n" + - "\x10max_query_length\x18\x18 \x01(\x05R\x0emaxQueryLength\x12=\n" + - "\fmetrics_mode\x18\x19 \x01(\x0e2\x1a.management.v1.MetricsModeR\vmetricsMode\x12-\n" + - "\x12disable_collectors\x18\x1a \x03(\tR\x11disableCollectors\x129\n" + - "\x18authentication_mechanism\x18\x1b \x01(\tR\x17authenticationMechanism\x127\n" + - "\x17authentication_database\x18\x1c \x01(\tR\x16authenticationDatabase\x12%\n" + - "\x0eagent_password\x18\x1d \x01(\tR\ragentPassword\x12+\n" + - "\x11stats_collections\x18\x1e \x03(\tR\x10statsCollections\x12+\n" + - "\x11collections_limit\x18\x1f \x01(\x05R\x10collectionsLimit\x122\n" + - "\x15enable_all_collectors\x18 \x01(\bR\x13enableAllCollectors\x123\n" + - "\tlog_level\x18! \x01(\x0e2\x16.inventory.v1.LogLevelR\blogLevel\x12'\n" + - "\x0fexpose_exporter\x18\" \x01(\bR\x0eexposeExporter\x1a?\n" + - "\x11CustomLabelsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01J\x04\b\b\x10\tR\x17query_examples_disabled\"\xca\x02\n" + - "\x14MongoDBServiceResult\x126\n" + - "\aservice\x18\x01 \x01(\v2\x1c.inventory.v1.MongoDBServiceR\aservice\x12H\n" + - "\x10mongodb_exporter\x18\x02 \x01(\v2\x1d.inventory.v1.MongoDBExporterR\x0fmongodbExporter\x12W\n" + - "\x14qan_mongodb_profiler\x18\x03 \x01(\v2%.inventory.v1.QANMongoDBProfilerAgentR\x12qanMongodbProfiler\x12W\n" + - "\x14qan_mongodb_mongolog\x18\x04 \x01(\v2%.inventory.v1.QANMongoDBMongologAgentR\x12qanMongodbMongologB\xad\x01\n" + - "\x11com.management.v1B\fMongodbProtoP\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 ( - file_management_v1_mongodb_proto_rawDescOnce sync.Once - file_management_v1_mongodb_proto_rawDescData []byte -) - -func file_management_v1_mongodb_proto_rawDescGZIP() []byte { - file_management_v1_mongodb_proto_rawDescOnce.Do(func() { - file_management_v1_mongodb_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_management_v1_mongodb_proto_rawDesc), len(file_management_v1_mongodb_proto_rawDesc))) - }) - 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 - } -) - -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 - 4, // 2: management.v1.AddMongoDBServiceParams.metrics_mode:type_name -> management.v1.MetricsMode - 5, // 3: management.v1.AddMongoDBServiceParams.log_level:type_name -> inventory.v1.LogLevel - 6, // 4: management.v1.MongoDBServiceResult.service:type_name -> inventory.v1.MongoDBService - 7, // 5: management.v1.MongoDBServiceResult.mongodb_exporter:type_name -> inventory.v1.MongoDBExporter - 8, // 6: management.v1.MongoDBServiceResult.qan_mongodb_profiler:type_name -> inventory.v1.QANMongoDBProfilerAgent - 9, // 7: management.v1.MongoDBServiceResult.qan_mongodb_mongolog:type_name -> inventory.v1.QANMongoDBMongologAgent - 8, // [8:8] is the sub-list for method output_type - 8, // [8:8] is the sub-list for method input_type - 8, // [8:8] is the sub-list for extension type_name - 8, // [8:8] is the sub-list for extension extendee - 0, // [0:8] is the sub-list for field type_name -} - -func init() { file_management_v1_mongodb_proto_init() } -func file_management_v1_mongodb_proto_init() { - if File_management_v1_mongodb_proto != nil { - return - } - file_management_v1_metrics_proto_init() - file_management_v1_node_proto_init() - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_management_v1_mongodb_proto_rawDesc), len(file_management_v1_mongodb_proto_rawDesc)), - NumEnums: 0, - NumMessages: 3, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_management_v1_mongodb_proto_goTypes, - DependencyIndexes: file_management_v1_mongodb_proto_depIdxs, - MessageInfos: file_management_v1_mongodb_proto_msgTypes, - }.Build() - File_management_v1_mongodb_proto = out.File - file_management_v1_mongodb_proto_goTypes = nil - file_management_v1_mongodb_proto_depIdxs = nil -} diff --git a/api/management/v1/mongodb.pb.validate.go b/api/management/v1/mongodb.pb.validate.go deleted file mode 100644 index cf5a5df9b7d..00000000000 --- a/api/management/v1/mongodb.pb.validate.go +++ /dev/null @@ -1,467 +0,0 @@ -// Code generated by protoc-gen-validate. DO NOT EDIT. -// source: management/v1/mongodb.proto - -package managementv1 - -import ( - "bytes" - "errors" - "fmt" - "net" - "net/mail" - "net/url" - "regexp" - "sort" - "strings" - "time" - "unicode/utf8" - - "google.golang.org/protobuf/types/known/anypb" - - inventoryv1 "github.com/percona/pmm/api/inventory/v1" -) - -// ensure the imports are used -var ( - _ = bytes.MinRead - _ = errors.New("") - _ = fmt.Print - _ = utf8.UTFMax - _ = (*regexp.Regexp)(nil) - _ = (*strings.Reader)(nil) - _ = net.IPv4len - _ = time.Duration(0) - _ = (*url.URL)(nil) - _ = (*mail.Address)(nil) - _ = anypb.Any{} - _ = sort.Sort - - _ = inventoryv1.LogLevel(0) -) - -// Validate checks the field values on AddMongoDBServiceParams 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 *AddMongoDBServiceParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on AddMongoDBServiceParams 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 -// AddMongoDBServiceParamsMultiError, or nil if none found. -func (m *AddMongoDBServiceParams) ValidateAll() error { - return m.validate(true) -} - -func (m *AddMongoDBServiceParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for NodeId - - // no validation rules for NodeName - - if all { - switch v := interface{}(m.GetAddNode()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AddMongoDBServiceParamsValidationError{ - field: "AddNode", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AddMongoDBServiceParamsValidationError{ - field: "AddNode", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetAddNode()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AddMongoDBServiceParamsValidationError{ - field: "AddNode", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if utf8.RuneCountInString(m.GetServiceName()) < 1 { - err := AddMongoDBServiceParamsValidationError{ - field: "ServiceName", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for Address - - // no validation rules for Port - - // no validation rules for Socket - - if utf8.RuneCountInString(m.GetPmmAgentId()) < 1 { - err := AddMongoDBServiceParamsValidationError{ - field: "PmmAgentId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for Environment - - // no validation rules for Cluster - - // no validation rules for ReplicationSet - - // no validation rules for Username - - // no validation rules for Password - - // no validation rules for QanMongodbProfiler - - // no validation rules for QanMongodbMongolog - - // no validation rules for CustomLabels - - // no validation rules for SkipConnectionCheck - - // no validation rules for Tls - - // no validation rules for TlsSkipVerify - - // no validation rules for TlsCertificateKey - - // no validation rules for TlsCertificateKeyFilePassword - - // no validation rules for TlsCa - - // no validation rules for MaxQueryLength - - // no validation rules for MetricsMode - - // no validation rules for AuthenticationMechanism - - // no validation rules for AuthenticationDatabase - - // no validation rules for AgentPassword - - // no validation rules for CollectionsLimit - - // no validation rules for EnableAllCollectors - - // no validation rules for LogLevel - - // no validation rules for ExposeExporter - - if len(errors) > 0 { - return AddMongoDBServiceParamsMultiError(errors) - } - - return nil -} - -// AddMongoDBServiceParamsMultiError is an error wrapping multiple validation -// errors returned by AddMongoDBServiceParams.ValidateAll() if the designated -// constraints aren't met. -type AddMongoDBServiceParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m AddMongoDBServiceParamsMultiError) 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 AddMongoDBServiceParamsMultiError) AllErrors() []error { return m } - -// AddMongoDBServiceParamsValidationError is the validation error returned by -// AddMongoDBServiceParams.Validate if the designated constraints aren't met. -type AddMongoDBServiceParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e AddMongoDBServiceParamsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e AddMongoDBServiceParamsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e AddMongoDBServiceParamsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e AddMongoDBServiceParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e AddMongoDBServiceParamsValidationError) ErrorName() string { - return "AddMongoDBServiceParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e AddMongoDBServiceParamsValidationError) 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 %sAddMongoDBServiceParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = AddMongoDBServiceParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = AddMongoDBServiceParamsValidationError{} - -// Validate checks the field values on MongoDBServiceResult 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 *MongoDBServiceResult) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on MongoDBServiceResult 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 -// MongoDBServiceResultMultiError, or nil if none found. -func (m *MongoDBServiceResult) ValidateAll() error { - return m.validate(true) -} - -func (m *MongoDBServiceResult) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if all { - switch v := interface{}(m.GetService()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, MongoDBServiceResultValidationError{ - field: "Service", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, MongoDBServiceResultValidationError{ - field: "Service", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetService()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return MongoDBServiceResultValidationError{ - field: "Service", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetMongodbExporter()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, MongoDBServiceResultValidationError{ - field: "MongodbExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, MongoDBServiceResultValidationError{ - field: "MongodbExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMongodbExporter()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return MongoDBServiceResultValidationError{ - field: "MongodbExporter", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetQanMongodbProfiler()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, MongoDBServiceResultValidationError{ - field: "QanMongodbProfiler", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, MongoDBServiceResultValidationError{ - field: "QanMongodbProfiler", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetQanMongodbProfiler()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return MongoDBServiceResultValidationError{ - field: "QanMongodbProfiler", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetQanMongodbMongolog()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, MongoDBServiceResultValidationError{ - field: "QanMongodbMongolog", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, MongoDBServiceResultValidationError{ - field: "QanMongodbMongolog", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetQanMongodbMongolog()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return MongoDBServiceResultValidationError{ - field: "QanMongodbMongolog", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if len(errors) > 0 { - return MongoDBServiceResultMultiError(errors) - } - - return nil -} - -// MongoDBServiceResultMultiError is an error wrapping multiple validation -// errors returned by MongoDBServiceResult.ValidateAll() if the designated -// constraints aren't met. -type MongoDBServiceResultMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m MongoDBServiceResultMultiError) 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 MongoDBServiceResultMultiError) AllErrors() []error { return m } - -// MongoDBServiceResultValidationError is the validation error returned by -// MongoDBServiceResult.Validate if the designated constraints aren't met. -type MongoDBServiceResultValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e MongoDBServiceResultValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e MongoDBServiceResultValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e MongoDBServiceResultValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e MongoDBServiceResultValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e MongoDBServiceResultValidationError) ErrorName() string { - return "MongoDBServiceResultValidationError" -} - -// Error satisfies the builtin error interface -func (e MongoDBServiceResultValidationError) 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 %sMongoDBServiceResult.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = MongoDBServiceResultValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = MongoDBServiceResultValidationError{} diff --git a/api/management/v1/mysql.pb.go b/api/management/v1/mysql.pb.go deleted file mode 100644 index 8dd539ad2af..00000000000 --- a/api/management/v1/mysql.pb.go +++ /dev/null @@ -1,577 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.10 -// protoc (unknown) -// source: management/v1/mysql.proto - -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" - - v1 "github.com/percona/pmm/api/inventory/v1" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type AddMySQLServiceParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - // 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 `protobuf:"bytes,1,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` - // Node name on which a service is been running. - // Exactly one of these parameters should be present: node_id, node_name, add_node. - NodeName string `protobuf:"bytes,2,opt,name=node_name,json=nodeName,proto3" json:"node_name,omitempty"` - // Create a new Node with those parameters. - // Exactly one of these parameters should be present: node_id, node_name, add_node. - AddNode *AddNodeParams `protobuf:"bytes,3,opt,name=add_node,json=addNode,proto3" json:"add_node,omitempty"` - // Unique across all Services user-defined name. Required. - ServiceName string `protobuf:"bytes,4,opt,name=service_name,json=serviceName,proto3" json:"service_name,omitempty"` - // Node and Service access address (DNS name or IP). - // Address (and port) or socket is required. - Address string `protobuf:"bytes,5,opt,name=address,proto3" json:"address,omitempty"` - // Service Access port. - // Port is required when the address present. - Port uint32 `protobuf:"varint,6,opt,name=port,proto3" json:"port,omitempty"` - // Service Access socket. - // Address (and port) or socket is required. - Socket string `protobuf:"bytes,7,opt,name=socket,proto3" json:"socket,omitempty"` - // The "pmm-agent" identifier which should run agents. Required. - PmmAgentId string `protobuf:"bytes,8,opt,name=pmm_agent_id,json=pmmAgentId,proto3" json:"pmm_agent_id,omitempty"` - // Environment name. - Environment string `protobuf:"bytes,9,opt,name=environment,proto3" json:"environment,omitempty"` - // Cluster name. - Cluster string `protobuf:"bytes,10,opt,name=cluster,proto3" json:"cluster,omitempty"` - // Replication set name. - ReplicationSet string `protobuf:"bytes,11,opt,name=replication_set,json=replicationSet,proto3" json:"replication_set,omitempty"` - // MySQL username for scraping metrics. - Username string `protobuf:"bytes,12,opt,name=username,proto3" json:"username,omitempty"` - // MySQL password for scraping metrics. - Password string `protobuf:"bytes,13,opt,name=password,proto3" json:"password,omitempty"` - // If true, adds qan-mysql-perfschema-agent for provided service. - QanMysqlPerfschema bool `protobuf:"varint,14,opt,name=qan_mysql_perfschema,json=qanMysqlPerfschema,proto3" json:"qan_mysql_perfschema,omitempty"` - // If true, adds qan-mysql-slowlog-agent for provided service. - QanMysqlSlowlog bool `protobuf:"varint,15,opt,name=qan_mysql_slowlog,json=qanMysqlSlowlog,proto3" json:"qan_mysql_slowlog,omitempty"` - // Custom user-assigned labels for Service. - CustomLabels map[string]string `protobuf:"bytes,16,rep,name=custom_labels,json=customLabels,proto3" json:"custom_labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - // Skip connection check. - SkipConnectionCheck bool `protobuf:"varint,17,opt,name=skip_connection_check,json=skipConnectionCheck,proto3" json:"skip_connection_check,omitempty"` - // Disable parsing comments from queries and showing them in QAN. - DisableCommentsParsing bool `protobuf:"varint,18,opt,name=disable_comments_parsing,json=disableCommentsParsing,proto3" json:"disable_comments_parsing,omitempty"` - // Limit query length in QAN (default: server-defined; -1: no limit). - MaxQueryLength int32 `protobuf:"varint,19,opt,name=max_query_length,json=maxQueryLength,proto3" json:"max_query_length,omitempty"` - // Disable query examples. - DisableQueryExamples bool `protobuf:"varint,20,opt,name=disable_query_examples,json=disableQueryExamples,proto3" json:"disable_query_examples,omitempty"` - // If qan-mysql-slowlog-agent is added, slowlog file is rotated at this size if > 0. - // If zero, server's default value is used. - // Use negative value to disable rotation. - MaxSlowlogFileSize int64 `protobuf:"varint,21,opt,name=max_slowlog_file_size,json=maxSlowlogFileSize,proto3" json:"max_slowlog_file_size,omitempty"` - // Use TLS for database connections. - Tls bool `protobuf:"varint,22,opt,name=tls,proto3" json:"tls,omitempty"` - // Skip TLS certificate and hostname validation. - TlsSkipVerify bool `protobuf:"varint,23,opt,name=tls_skip_verify,json=tlsSkipVerify,proto3" json:"tls_skip_verify,omitempty"` - // Certificate Authority certificate chain. - TlsCa string `protobuf:"bytes,24,opt,name=tls_ca,json=tlsCa,proto3" json:"tls_ca,omitempty"` - // Client certificate. - TlsCert string `protobuf:"bytes,25,opt,name=tls_cert,json=tlsCert,proto3" json:"tls_cert,omitempty"` - // Password for decrypting tls_cert. - TlsKey string `protobuf:"bytes,26,opt,name=tls_key,json=tlsKey,proto3" json:"tls_key,omitempty"` - // Tablestats group collectors will be disabled if there are more than that number of tables. - // If zero, server's default value is used. - // Use negative value to disable them. - TablestatsGroupTableLimit int32 `protobuf:"varint,27,opt,name=tablestats_group_table_limit,json=tablestatsGroupTableLimit,proto3" json:"tablestats_group_table_limit,omitempty"` - // Defines metrics flow model for this exporter. - // Metrics could be pushed to the server with vmagent, - // pulled by the server, or the server could choose behavior automatically. - MetricsMode MetricsMode `protobuf:"varint,28,opt,name=metrics_mode,json=metricsMode,proto3,enum=management.v1.MetricsMode" json:"metrics_mode,omitempty"` - // List of collector names to disable in this exporter. - DisableCollectors []string `protobuf:"bytes,29,rep,name=disable_collectors,json=disableCollectors,proto3" json:"disable_collectors,omitempty"` - // Custom password for exporter endpoint /metrics. - AgentPassword string `protobuf:"bytes,30,opt,name=agent_password,json=agentPassword,proto3" json:"agent_password,omitempty"` - // Exporter log level - LogLevel v1.LogLevel `protobuf:"varint,31,opt,name=log_level,json=logLevel,proto3,enum=inventory.v1.LogLevel" json:"log_level,omitempty"` - // Optionally expose the exporter process on all public interfaces - ExposeExporter bool `protobuf:"varint,32,opt,name=expose_exporter,json=exposeExporter,proto3" json:"expose_exporter,omitempty"` - // extra DSN parameters to be used for connecting to MySQL. - ExtraDsnParams map[string]string `protobuf:"bytes,33,rep,name=extra_dsn_params,json=extraDsnParams,proto3" json:"extra_dsn_params,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AddMySQLServiceParams) Reset() { - *x = AddMySQLServiceParams{} - mi := &file_management_v1_mysql_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AddMySQLServiceParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddMySQLServiceParams) ProtoMessage() {} - -func (x *AddMySQLServiceParams) ProtoReflect() protoreflect.Message { - mi := &file_management_v1_mysql_proto_msgTypes[0] - 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 AddMySQLServiceParams.ProtoReflect.Descriptor instead. -func (*AddMySQLServiceParams) Descriptor() ([]byte, []int) { - return file_management_v1_mysql_proto_rawDescGZIP(), []int{0} -} - -func (x *AddMySQLServiceParams) GetNodeId() string { - if x != nil { - return x.NodeId - } - return "" -} - -func (x *AddMySQLServiceParams) GetNodeName() string { - if x != nil { - return x.NodeName - } - return "" -} - -func (x *AddMySQLServiceParams) GetAddNode() *AddNodeParams { - if x != nil { - return x.AddNode - } - return nil -} - -func (x *AddMySQLServiceParams) GetServiceName() string { - if x != nil { - return x.ServiceName - } - return "" -} - -func (x *AddMySQLServiceParams) GetAddress() string { - if x != nil { - return x.Address - } - return "" -} - -func (x *AddMySQLServiceParams) GetPort() uint32 { - if x != nil { - return x.Port - } - return 0 -} - -func (x *AddMySQLServiceParams) GetSocket() string { - if x != nil { - return x.Socket - } - return "" -} - -func (x *AddMySQLServiceParams) GetPmmAgentId() string { - if x != nil { - return x.PmmAgentId - } - return "" -} - -func (x *AddMySQLServiceParams) GetEnvironment() string { - if x != nil { - return x.Environment - } - return "" -} - -func (x *AddMySQLServiceParams) GetCluster() string { - if x != nil { - return x.Cluster - } - return "" -} - -func (x *AddMySQLServiceParams) GetReplicationSet() string { - if x != nil { - return x.ReplicationSet - } - return "" -} - -func (x *AddMySQLServiceParams) GetUsername() string { - if x != nil { - return x.Username - } - return "" -} - -func (x *AddMySQLServiceParams) GetPassword() string { - if x != nil { - return x.Password - } - return "" -} - -func (x *AddMySQLServiceParams) GetQanMysqlPerfschema() bool { - if x != nil { - return x.QanMysqlPerfschema - } - return false -} - -func (x *AddMySQLServiceParams) GetQanMysqlSlowlog() bool { - if x != nil { - return x.QanMysqlSlowlog - } - return false -} - -func (x *AddMySQLServiceParams) GetCustomLabels() map[string]string { - if x != nil { - return x.CustomLabels - } - return nil -} - -func (x *AddMySQLServiceParams) GetSkipConnectionCheck() bool { - if x != nil { - return x.SkipConnectionCheck - } - return false -} - -func (x *AddMySQLServiceParams) GetDisableCommentsParsing() bool { - if x != nil { - return x.DisableCommentsParsing - } - return false -} - -func (x *AddMySQLServiceParams) GetMaxQueryLength() int32 { - if x != nil { - return x.MaxQueryLength - } - return 0 -} - -func (x *AddMySQLServiceParams) GetDisableQueryExamples() bool { - if x != nil { - return x.DisableQueryExamples - } - return false -} - -func (x *AddMySQLServiceParams) GetMaxSlowlogFileSize() int64 { - if x != nil { - return x.MaxSlowlogFileSize - } - return 0 -} - -func (x *AddMySQLServiceParams) GetTls() bool { - if x != nil { - return x.Tls - } - return false -} - -func (x *AddMySQLServiceParams) GetTlsSkipVerify() bool { - if x != nil { - return x.TlsSkipVerify - } - return false -} - -func (x *AddMySQLServiceParams) GetTlsCa() string { - if x != nil { - return x.TlsCa - } - return "" -} - -func (x *AddMySQLServiceParams) GetTlsCert() string { - if x != nil { - return x.TlsCert - } - return "" -} - -func (x *AddMySQLServiceParams) GetTlsKey() string { - if x != nil { - return x.TlsKey - } - return "" -} - -func (x *AddMySQLServiceParams) GetTablestatsGroupTableLimit() int32 { - if x != nil { - return x.TablestatsGroupTableLimit - } - return 0 -} - -func (x *AddMySQLServiceParams) GetMetricsMode() MetricsMode { - if x != nil { - return x.MetricsMode - } - return MetricsMode_METRICS_MODE_UNSPECIFIED -} - -func (x *AddMySQLServiceParams) GetDisableCollectors() []string { - if x != nil { - return x.DisableCollectors - } - return nil -} - -func (x *AddMySQLServiceParams) GetAgentPassword() string { - if x != nil { - return x.AgentPassword - } - return "" -} - -func (x *AddMySQLServiceParams) GetLogLevel() v1.LogLevel { - if x != nil { - return x.LogLevel - } - return v1.LogLevel(0) -} - -func (x *AddMySQLServiceParams) GetExposeExporter() bool { - if x != nil { - return x.ExposeExporter - } - return false -} - -func (x *AddMySQLServiceParams) GetExtraDsnParams() map[string]string { - if x != nil { - return x.ExtraDsnParams - } - return nil -} - -type MySQLServiceResult struct { - state protoimpl.MessageState `protogen:"open.v1"` - Service *v1.MySQLService `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"` - MysqldExporter *v1.MySQLdExporter `protobuf:"bytes,2,opt,name=mysqld_exporter,json=mysqldExporter,proto3" json:"mysqld_exporter,omitempty"` - QanMysqlPerfschema *v1.QANMySQLPerfSchemaAgent `protobuf:"bytes,3,opt,name=qan_mysql_perfschema,json=qanMysqlPerfschema,proto3" json:"qan_mysql_perfschema,omitempty"` - QanMysqlSlowlog *v1.QANMySQLSlowlogAgent `protobuf:"bytes,4,opt,name=qan_mysql_slowlog,json=qanMysqlSlowlog,proto3" json:"qan_mysql_slowlog,omitempty"` - // Actual table count at the moment of adding. - TableCount int32 `protobuf:"varint,5,opt,name=table_count,json=tableCount,proto3" json:"table_count,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *MySQLServiceResult) Reset() { - *x = MySQLServiceResult{} - mi := &file_management_v1_mysql_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *MySQLServiceResult) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MySQLServiceResult) ProtoMessage() {} - -func (x *MySQLServiceResult) ProtoReflect() protoreflect.Message { - mi := &file_management_v1_mysql_proto_msgTypes[1] - 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 MySQLServiceResult.ProtoReflect.Descriptor instead. -func (*MySQLServiceResult) Descriptor() ([]byte, []int) { - return file_management_v1_mysql_proto_rawDescGZIP(), []int{1} -} - -func (x *MySQLServiceResult) GetService() *v1.MySQLService { - if x != nil { - return x.Service - } - return nil -} - -func (x *MySQLServiceResult) GetMysqldExporter() *v1.MySQLdExporter { - if x != nil { - return x.MysqldExporter - } - return nil -} - -func (x *MySQLServiceResult) GetQanMysqlPerfschema() *v1.QANMySQLPerfSchemaAgent { - if x != nil { - return x.QanMysqlPerfschema - } - return nil -} - -func (x *MySQLServiceResult) GetQanMysqlSlowlog() *v1.QANMySQLSlowlogAgent { - if x != nil { - return x.QanMysqlSlowlog - } - return nil -} - -func (x *MySQLServiceResult) GetTableCount() int32 { - if x != nil { - return x.TableCount - } - return 0 -} - -var File_management_v1_mysql_proto protoreflect.FileDescriptor - -const file_management_v1_mysql_proto_rawDesc = "" + - "\n" + - "\x19management/v1/mysql.proto\x12\rmanagement.v1\x1a\x19inventory/v1/agents.proto\x1a\x1cinventory/v1/log_level.proto\x1a\x1binventory/v1/services.proto\x1a\x1bmanagement/v1/metrics.proto\x1a\x18management/v1/node.proto\x1a\x17validate/validate.proto\"\xa6\f\n" + - "\x15AddMySQLServiceParams\x12\x17\n" + - "\anode_id\x18\x01 \x01(\tR\x06nodeId\x12\x1b\n" + - "\tnode_name\x18\x02 \x01(\tR\bnodeName\x127\n" + - "\badd_node\x18\x03 \x01(\v2\x1c.management.v1.AddNodeParamsR\aaddNode\x12*\n" + - "\fservice_name\x18\x04 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\vserviceName\x12\x18\n" + - "\aaddress\x18\x05 \x01(\tR\aaddress\x12\x12\n" + - "\x04port\x18\x06 \x01(\rR\x04port\x12\x16\n" + - "\x06socket\x18\a \x01(\tR\x06socket\x12)\n" + - "\fpmm_agent_id\x18\b \x01(\tB\a\xfaB\x04r\x02\x10\x01R\n" + - "pmmAgentId\x12 \n" + - "\venvironment\x18\t \x01(\tR\venvironment\x12\x18\n" + - "\acluster\x18\n" + - " \x01(\tR\acluster\x12'\n" + - "\x0freplication_set\x18\v \x01(\tR\x0ereplicationSet\x12#\n" + - "\busername\x18\f \x01(\tB\a\xfaB\x04r\x02\x10\x01R\busername\x12\x1a\n" + - "\bpassword\x18\r \x01(\tR\bpassword\x120\n" + - "\x14qan_mysql_perfschema\x18\x0e \x01(\bR\x12qanMysqlPerfschema\x12*\n" + - "\x11qan_mysql_slowlog\x18\x0f \x01(\bR\x0fqanMysqlSlowlog\x12[\n" + - "\rcustom_labels\x18\x10 \x03(\v26.management.v1.AddMySQLServiceParams.CustomLabelsEntryR\fcustomLabels\x122\n" + - "\x15skip_connection_check\x18\x11 \x01(\bR\x13skipConnectionCheck\x128\n" + - "\x18disable_comments_parsing\x18\x12 \x01(\bR\x16disableCommentsParsing\x12(\n" + - "\x10max_query_length\x18\x13 \x01(\x05R\x0emaxQueryLength\x124\n" + - "\x16disable_query_examples\x18\x14 \x01(\bR\x14disableQueryExamples\x121\n" + - "\x15max_slowlog_file_size\x18\x15 \x01(\x03R\x12maxSlowlogFileSize\x12\x10\n" + - "\x03tls\x18\x16 \x01(\bR\x03tls\x12&\n" + - "\x0ftls_skip_verify\x18\x17 \x01(\bR\rtlsSkipVerify\x12\x15\n" + - "\x06tls_ca\x18\x18 \x01(\tR\x05tlsCa\x12\x19\n" + - "\btls_cert\x18\x19 \x01(\tR\atlsCert\x12\x17\n" + - "\atls_key\x18\x1a \x01(\tR\x06tlsKey\x12?\n" + - "\x1ctablestats_group_table_limit\x18\x1b \x01(\x05R\x19tablestatsGroupTableLimit\x12=\n" + - "\fmetrics_mode\x18\x1c \x01(\x0e2\x1a.management.v1.MetricsModeR\vmetricsMode\x12-\n" + - "\x12disable_collectors\x18\x1d \x03(\tR\x11disableCollectors\x12%\n" + - "\x0eagent_password\x18\x1e \x01(\tR\ragentPassword\x123\n" + - "\tlog_level\x18\x1f \x01(\x0e2\x16.inventory.v1.LogLevelR\blogLevel\x12'\n" + - "\x0fexpose_exporter\x18 \x01(\bR\x0eexposeExporter\x12b\n" + - "\x10extra_dsn_params\x18! \x03(\v28.management.v1.AddMySQLServiceParams.ExtraDsnParamsEntryR\x0eextraDsnParams\x1a?\n" + - "\x11CustomLabelsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\x1aA\n" + - "\x13ExtraDsnParamsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\xdb\x02\n" + - "\x12MySQLServiceResult\x124\n" + - "\aservice\x18\x01 \x01(\v2\x1a.inventory.v1.MySQLServiceR\aservice\x12E\n" + - "\x0fmysqld_exporter\x18\x02 \x01(\v2\x1c.inventory.v1.MySQLdExporterR\x0emysqldExporter\x12W\n" + - "\x14qan_mysql_perfschema\x18\x03 \x01(\v2%.inventory.v1.QANMySQLPerfSchemaAgentR\x12qanMysqlPerfschema\x12N\n" + - "\x11qan_mysql_slowlog\x18\x04 \x01(\v2\".inventory.v1.QANMySQLSlowlogAgentR\x0fqanMysqlSlowlog\x12\x1f\n" + - "\vtable_count\x18\x05 \x01(\x05R\n" + - "tableCountB\xab\x01\n" + - "\x11com.management.v1B\n" + - "MysqlProtoP\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 ( - file_management_v1_mysql_proto_rawDescOnce sync.Once - file_management_v1_mysql_proto_rawDescData []byte -) - -func file_management_v1_mysql_proto_rawDescGZIP() []byte { - file_management_v1_mysql_proto_rawDescOnce.Do(func() { - file_management_v1_mysql_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_management_v1_mysql_proto_rawDesc), len(file_management_v1_mysql_proto_rawDesc))) - }) - 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_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 - 5, // 2: management.v1.AddMySQLServiceParams.metrics_mode:type_name -> management.v1.MetricsMode - 6, // 3: management.v1.AddMySQLServiceParams.log_level:type_name -> inventory.v1.LogLevel - 3, // 4: management.v1.AddMySQLServiceParams.extra_dsn_params:type_name -> management.v1.AddMySQLServiceParams.ExtraDsnParamsEntry - 7, // 5: management.v1.MySQLServiceResult.service:type_name -> inventory.v1.MySQLService - 8, // 6: management.v1.MySQLServiceResult.mysqld_exporter:type_name -> inventory.v1.MySQLdExporter - 9, // 7: management.v1.MySQLServiceResult.qan_mysql_perfschema:type_name -> inventory.v1.QANMySQLPerfSchemaAgent - 10, // 8: management.v1.MySQLServiceResult.qan_mysql_slowlog:type_name -> inventory.v1.QANMySQLSlowlogAgent - 9, // [9:9] is the sub-list for method output_type - 9, // [9:9] is the sub-list for method input_type - 9, // [9:9] is the sub-list for extension type_name - 9, // [9:9] is the sub-list for extension extendee - 0, // [0:9] is the sub-list for field type_name -} - -func init() { file_management_v1_mysql_proto_init() } -func file_management_v1_mysql_proto_init() { - if File_management_v1_mysql_proto != nil { - return - } - file_management_v1_metrics_proto_init() - file_management_v1_node_proto_init() - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_management_v1_mysql_proto_rawDesc), len(file_management_v1_mysql_proto_rawDesc)), - NumEnums: 0, - NumMessages: 4, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_management_v1_mysql_proto_goTypes, - DependencyIndexes: file_management_v1_mysql_proto_depIdxs, - MessageInfos: file_management_v1_mysql_proto_msgTypes, - }.Build() - File_management_v1_mysql_proto = out.File - file_management_v1_mysql_proto_goTypes = nil - file_management_v1_mysql_proto_depIdxs = nil -} diff --git a/api/management/v1/mysql.pb.validate.go b/api/management/v1/mysql.pb.validate.go deleted file mode 100644 index da50d9a1db8..00000000000 --- a/api/management/v1/mysql.pb.validate.go +++ /dev/null @@ -1,480 +0,0 @@ -// Code generated by protoc-gen-validate. DO NOT EDIT. -// source: management/v1/mysql.proto - -package managementv1 - -import ( - "bytes" - "errors" - "fmt" - "net" - "net/mail" - "net/url" - "regexp" - "sort" - "strings" - "time" - "unicode/utf8" - - "google.golang.org/protobuf/types/known/anypb" - - inventoryv1 "github.com/percona/pmm/api/inventory/v1" -) - -// ensure the imports are used -var ( - _ = bytes.MinRead - _ = errors.New("") - _ = fmt.Print - _ = utf8.UTFMax - _ = (*regexp.Regexp)(nil) - _ = (*strings.Reader)(nil) - _ = net.IPv4len - _ = time.Duration(0) - _ = (*url.URL)(nil) - _ = (*mail.Address)(nil) - _ = anypb.Any{} - _ = sort.Sort - - _ = inventoryv1.LogLevel(0) -) - -// Validate checks the field values on AddMySQLServiceParams 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 *AddMySQLServiceParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on AddMySQLServiceParams 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 -// AddMySQLServiceParamsMultiError, or nil if none found. -func (m *AddMySQLServiceParams) ValidateAll() error { - return m.validate(true) -} - -func (m *AddMySQLServiceParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for NodeId - - // no validation rules for NodeName - - if all { - switch v := interface{}(m.GetAddNode()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AddMySQLServiceParamsValidationError{ - field: "AddNode", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AddMySQLServiceParamsValidationError{ - field: "AddNode", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetAddNode()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AddMySQLServiceParamsValidationError{ - field: "AddNode", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if utf8.RuneCountInString(m.GetServiceName()) < 1 { - err := AddMySQLServiceParamsValidationError{ - field: "ServiceName", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for Address - - // no validation rules for Port - - // no validation rules for Socket - - if utf8.RuneCountInString(m.GetPmmAgentId()) < 1 { - err := AddMySQLServiceParamsValidationError{ - field: "PmmAgentId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for Environment - - // no validation rules for Cluster - - // no validation rules for ReplicationSet - - if utf8.RuneCountInString(m.GetUsername()) < 1 { - err := AddMySQLServiceParamsValidationError{ - field: "Username", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for Password - - // no validation rules for QanMysqlPerfschema - - // no validation rules for QanMysqlSlowlog - - // no validation rules for CustomLabels - - // no validation rules for SkipConnectionCheck - - // no validation rules for DisableCommentsParsing - - // no validation rules for MaxQueryLength - - // no validation rules for DisableQueryExamples - - // no validation rules for MaxSlowlogFileSize - - // no validation rules for Tls - - // no validation rules for TlsSkipVerify - - // no validation rules for TlsCa - - // no validation rules for TlsCert - - // no validation rules for TlsKey - - // no validation rules for TablestatsGroupTableLimit - - // no validation rules for MetricsMode - - // no validation rules for AgentPassword - - // no validation rules for LogLevel - - // no validation rules for ExposeExporter - - // no validation rules for ExtraDsnParams - - if len(errors) > 0 { - return AddMySQLServiceParamsMultiError(errors) - } - - return nil -} - -// AddMySQLServiceParamsMultiError is an error wrapping multiple validation -// errors returned by AddMySQLServiceParams.ValidateAll() if the designated -// constraints aren't met. -type AddMySQLServiceParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m AddMySQLServiceParamsMultiError) 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 AddMySQLServiceParamsMultiError) AllErrors() []error { return m } - -// AddMySQLServiceParamsValidationError is the validation error returned by -// AddMySQLServiceParams.Validate if the designated constraints aren't met. -type AddMySQLServiceParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e AddMySQLServiceParamsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e AddMySQLServiceParamsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e AddMySQLServiceParamsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e AddMySQLServiceParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e AddMySQLServiceParamsValidationError) ErrorName() string { - return "AddMySQLServiceParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e AddMySQLServiceParamsValidationError) 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 %sAddMySQLServiceParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = AddMySQLServiceParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = AddMySQLServiceParamsValidationError{} - -// Validate checks the field values on MySQLServiceResult 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 *MySQLServiceResult) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on MySQLServiceResult 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 -// MySQLServiceResultMultiError, or nil if none found. -func (m *MySQLServiceResult) ValidateAll() error { - return m.validate(true) -} - -func (m *MySQLServiceResult) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if all { - switch v := interface{}(m.GetService()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, MySQLServiceResultValidationError{ - field: "Service", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, MySQLServiceResultValidationError{ - field: "Service", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetService()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return MySQLServiceResultValidationError{ - field: "Service", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetMysqldExporter()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, MySQLServiceResultValidationError{ - field: "MysqldExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, MySQLServiceResultValidationError{ - field: "MysqldExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMysqldExporter()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return MySQLServiceResultValidationError{ - field: "MysqldExporter", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetQanMysqlPerfschema()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, MySQLServiceResultValidationError{ - field: "QanMysqlPerfschema", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, MySQLServiceResultValidationError{ - field: "QanMysqlPerfschema", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetQanMysqlPerfschema()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return MySQLServiceResultValidationError{ - field: "QanMysqlPerfschema", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetQanMysqlSlowlog()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, MySQLServiceResultValidationError{ - field: "QanMysqlSlowlog", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, MySQLServiceResultValidationError{ - field: "QanMysqlSlowlog", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetQanMysqlSlowlog()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return MySQLServiceResultValidationError{ - field: "QanMysqlSlowlog", - reason: "embedded message failed validation", - cause: err, - } - } - } - - // no validation rules for TableCount - - if len(errors) > 0 { - return MySQLServiceResultMultiError(errors) - } - - return nil -} - -// MySQLServiceResultMultiError is an error wrapping multiple validation errors -// returned by MySQLServiceResult.ValidateAll() if the designated constraints -// aren't met. -type MySQLServiceResultMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m MySQLServiceResultMultiError) 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 MySQLServiceResultMultiError) AllErrors() []error { return m } - -// MySQLServiceResultValidationError is the validation error returned by -// MySQLServiceResult.Validate if the designated constraints aren't met. -type MySQLServiceResultValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e MySQLServiceResultValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e MySQLServiceResultValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e MySQLServiceResultValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e MySQLServiceResultValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e MySQLServiceResultValidationError) ErrorName() string { - return "MySQLServiceResultValidationError" -} - -// Error satisfies the builtin error interface -func (e MySQLServiceResultValidationError) 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 %sMySQLServiceResult.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = MySQLServiceResultValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = MySQLServiceResultValidationError{} diff --git a/api/management/v1/node.pb.go b/api/management/v1/node.pb.go deleted file mode 100644 index a30b8dc7f64..00000000000 --- a/api/management/v1/node.pb.go +++ /dev/null @@ -1,1297 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.10 -// protoc (unknown) -// source: management/v1/node.proto - -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" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" - - v1 "github.com/percona/pmm/api/inventory/v1" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// Node status. -type UniversalNode_Status int32 - -const ( - // Invalid status. - UniversalNode_STATUS_UNSPECIFIED UniversalNode_Status = 0 - // The node is up. - UniversalNode_STATUS_UP UniversalNode_Status = 1 - // The node is down. - UniversalNode_STATUS_DOWN UniversalNode_Status = 2 - // The node's status cannot be known (e.g. there are no metrics yet). - UniversalNode_STATUS_UNKNOWN UniversalNode_Status = 3 -) - -// Enum value maps for UniversalNode_Status. -var ( - UniversalNode_Status_name = map[int32]string{ - 0: "STATUS_UNSPECIFIED", - 1: "STATUS_UP", - 2: "STATUS_DOWN", - 3: "STATUS_UNKNOWN", - } - UniversalNode_Status_value = map[string]int32{ - "STATUS_UNSPECIFIED": 0, - "STATUS_UP": 1, - "STATUS_DOWN": 2, - "STATUS_UNKNOWN": 3, - } -) - -func (x UniversalNode_Status) Enum() *UniversalNode_Status { - p := new(UniversalNode_Status) - *p = x - return p -} - -func (x UniversalNode_Status) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (UniversalNode_Status) Descriptor() protoreflect.EnumDescriptor { - return file_management_v1_node_proto_enumTypes[0].Descriptor() -} - -func (UniversalNode_Status) Type() protoreflect.EnumType { - return &file_management_v1_node_proto_enumTypes[0] -} - -func (x UniversalNode_Status) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use UniversalNode_Status.Descriptor instead. -func (UniversalNode_Status) EnumDescriptor() ([]byte, []int) { - return file_management_v1_node_proto_rawDescGZIP(), []int{5, 0} -} - -// AddNodeParams holds node params and is used to add new node to inventory while adding new service. -type AddNodeParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Node type to be registered. - NodeType v1.NodeType `protobuf:"varint,1,opt,name=node_type,json=nodeType,proto3,enum=inventory.v1.NodeType" json:"node_type,omitempty"` - // Unique across all Nodes user-defined name. - NodeName string `protobuf:"bytes,2,opt,name=node_name,json=nodeName,proto3" json:"node_name,omitempty"` - // Linux machine-id. - MachineId string `protobuf:"bytes,3,opt,name=machine_id,json=machineId,proto3" json:"machine_id,omitempty"` - // Linux distribution name and version. - Distro string `protobuf:"bytes,4,opt,name=distro,proto3" json:"distro,omitempty"` - // Container identifier. If specified, must be a unique Docker container identifier. - ContainerId string `protobuf:"bytes,5,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` - // Container name. - ContainerName string `protobuf:"bytes,6,opt,name=container_name,json=containerName,proto3" json:"container_name,omitempty"` - // Node model. - NodeModel string `protobuf:"bytes,7,opt,name=node_model,json=nodeModel,proto3" json:"node_model,omitempty"` - // Node region. - Region string `protobuf:"bytes,8,opt,name=region,proto3" json:"region,omitempty"` - // Node availability zone. - Az string `protobuf:"bytes,9,opt,name=az,proto3" json:"az,omitempty"` - // Custom user-assigned labels for Node. - CustomLabels map[string]string `protobuf:"bytes,10,rep,name=custom_labels,json=customLabels,proto3" json:"custom_labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AddNodeParams) Reset() { - *x = AddNodeParams{} - mi := &file_management_v1_node_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AddNodeParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddNodeParams) ProtoMessage() {} - -func (x *AddNodeParams) ProtoReflect() protoreflect.Message { - mi := &file_management_v1_node_proto_msgTypes[0] - 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 AddNodeParams.ProtoReflect.Descriptor instead. -func (*AddNodeParams) Descriptor() ([]byte, []int) { - return file_management_v1_node_proto_rawDescGZIP(), []int{0} -} - -func (x *AddNodeParams) GetNodeType() v1.NodeType { - if x != nil { - return x.NodeType - } - return v1.NodeType(0) -} - -func (x *AddNodeParams) GetNodeName() string { - if x != nil { - return x.NodeName - } - return "" -} - -func (x *AddNodeParams) GetMachineId() string { - if x != nil { - return x.MachineId - } - return "" -} - -func (x *AddNodeParams) GetDistro() string { - if x != nil { - return x.Distro - } - return "" -} - -func (x *AddNodeParams) GetContainerId() string { - if x != nil { - return x.ContainerId - } - return "" -} - -func (x *AddNodeParams) GetContainerName() string { - if x != nil { - return x.ContainerName - } - return "" -} - -func (x *AddNodeParams) GetNodeModel() string { - if x != nil { - return x.NodeModel - } - return "" -} - -func (x *AddNodeParams) GetRegion() string { - if x != nil { - return x.Region - } - return "" -} - -func (x *AddNodeParams) GetAz() string { - if x != nil { - return x.Az - } - return "" -} - -func (x *AddNodeParams) GetCustomLabels() map[string]string { - if x != nil { - return x.CustomLabels - } - return nil -} - -type RegisterNodeRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Node type to be registered. - NodeType v1.NodeType `protobuf:"varint,1,opt,name=node_type,json=nodeType,proto3,enum=inventory.v1.NodeType" json:"node_type,omitempty"` - // A user-defined name unique across all Nodes. - NodeName string `protobuf:"bytes,2,opt,name=node_name,json=nodeName,proto3" json:"node_name,omitempty"` - // Node address (DNS name or IP). - Address string `protobuf:"bytes,3,opt,name=address,proto3" json:"address,omitempty"` - // Linux machine-id. - MachineId string `protobuf:"bytes,4,opt,name=machine_id,json=machineId,proto3" json:"machine_id,omitempty"` - // Linux distribution name and version. - Distro string `protobuf:"bytes,5,opt,name=distro,proto3" json:"distro,omitempty"` - // Container identifier. If specified, must be a unique Docker container identifier. - ContainerId string `protobuf:"bytes,6,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` - // Container name. - ContainerName string `protobuf:"bytes,7,opt,name=container_name,json=containerName,proto3" json:"container_name,omitempty"` - // Node model. - NodeModel string `protobuf:"bytes,8,opt,name=node_model,json=nodeModel,proto3" json:"node_model,omitempty"` - // Node region. - Region string `protobuf:"bytes,9,opt,name=region,proto3" json:"region,omitempty"` - // Node availability zone. - Az string `protobuf:"bytes,10,opt,name=az,proto3" json:"az,omitempty"` - // Custom user-assigned labels for Node. - CustomLabels map[string]string `protobuf:"bytes,11,rep,name=custom_labels,json=customLabels,proto3" json:"custom_labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - // If true, and Node with that name already exist, it will be removed with all dependent Services and Agents. - Reregister bool `protobuf:"varint,12,opt,name=reregister,proto3" json:"reregister,omitempty"` - // Defines metrics flow model for node_exporter being added by this request. - // Metrics could be pushed to the server with vmagent, - // pulled by the server, or the server could choose behavior automatically. - MetricsMode MetricsMode `protobuf:"varint,13,opt,name=metrics_mode,json=metricsMode,proto3,enum=management.v1.MetricsMode" json:"metrics_mode,omitempty"` - // List of collector names to disable in this exporter. - DisableCollectors []string `protobuf:"bytes,14,rep,name=disable_collectors,json=disableCollectors,proto3" json:"disable_collectors,omitempty"` - // Custom password for exporter endpoint /metrics. - AgentPassword string `protobuf:"bytes,15,opt,name=agent_password,json=agentPassword,proto3" json:"agent_password,omitempty"` - // Optionally expose the exporter process on all public interfaces - ExposeExporter bool `protobuf:"varint,16,opt,name=expose_exporter,json=exposeExporter,proto3" json:"expose_exporter,omitempty"` - // AWS instance ID. - InstanceId string `protobuf:"bytes,17,opt,name=instance_id,json=instanceId,proto3" json:"instance_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *RegisterNodeRequest) Reset() { - *x = RegisterNodeRequest{} - mi := &file_management_v1_node_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *RegisterNodeRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RegisterNodeRequest) ProtoMessage() {} - -func (x *RegisterNodeRequest) ProtoReflect() protoreflect.Message { - mi := &file_management_v1_node_proto_msgTypes[1] - 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 RegisterNodeRequest.ProtoReflect.Descriptor instead. -func (*RegisterNodeRequest) Descriptor() ([]byte, []int) { - return file_management_v1_node_proto_rawDescGZIP(), []int{1} -} - -func (x *RegisterNodeRequest) GetNodeType() v1.NodeType { - if x != nil { - return x.NodeType - } - return v1.NodeType(0) -} - -func (x *RegisterNodeRequest) GetNodeName() string { - if x != nil { - return x.NodeName - } - return "" -} - -func (x *RegisterNodeRequest) GetAddress() string { - if x != nil { - return x.Address - } - return "" -} - -func (x *RegisterNodeRequest) GetMachineId() string { - if x != nil { - return x.MachineId - } - return "" -} - -func (x *RegisterNodeRequest) GetDistro() string { - if x != nil { - return x.Distro - } - return "" -} - -func (x *RegisterNodeRequest) GetContainerId() string { - if x != nil { - return x.ContainerId - } - return "" -} - -func (x *RegisterNodeRequest) GetContainerName() string { - if x != nil { - return x.ContainerName - } - return "" -} - -func (x *RegisterNodeRequest) GetNodeModel() string { - if x != nil { - return x.NodeModel - } - return "" -} - -func (x *RegisterNodeRequest) GetRegion() string { - if x != nil { - return x.Region - } - return "" -} - -func (x *RegisterNodeRequest) GetAz() string { - if x != nil { - return x.Az - } - return "" -} - -func (x *RegisterNodeRequest) GetCustomLabels() map[string]string { - if x != nil { - return x.CustomLabels - } - return nil -} - -func (x *RegisterNodeRequest) GetReregister() bool { - if x != nil { - return x.Reregister - } - return false -} - -func (x *RegisterNodeRequest) GetMetricsMode() MetricsMode { - if x != nil { - return x.MetricsMode - } - return MetricsMode_METRICS_MODE_UNSPECIFIED -} - -func (x *RegisterNodeRequest) GetDisableCollectors() []string { - if x != nil { - return x.DisableCollectors - } - return nil -} - -func (x *RegisterNodeRequest) GetAgentPassword() string { - if x != nil { - return x.AgentPassword - } - return "" -} - -func (x *RegisterNodeRequest) GetExposeExporter() bool { - if x != nil { - return x.ExposeExporter - } - return false -} - -func (x *RegisterNodeRequest) GetInstanceId() string { - if x != nil { - return x.InstanceId - } - return "" -} - -type RegisterNodeResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - GenericNode *v1.GenericNode `protobuf:"bytes,1,opt,name=generic_node,json=genericNode,proto3" json:"generic_node,omitempty"` - ContainerNode *v1.ContainerNode `protobuf:"bytes,2,opt,name=container_node,json=containerNode,proto3" json:"container_node,omitempty"` - PmmAgent *v1.PMMAgent `protobuf:"bytes,3,opt,name=pmm_agent,json=pmmAgent,proto3" json:"pmm_agent,omitempty"` - // Token represents token for vmagent auth config. - Token string `protobuf:"bytes,4,opt,name=token,proto3" json:"token,omitempty"` - // Warning message. - Warning string `protobuf:"bytes,5,opt,name=warning,proto3" json:"warning,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *RegisterNodeResponse) Reset() { - *x = RegisterNodeResponse{} - mi := &file_management_v1_node_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *RegisterNodeResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RegisterNodeResponse) ProtoMessage() {} - -func (x *RegisterNodeResponse) ProtoReflect() protoreflect.Message { - mi := &file_management_v1_node_proto_msgTypes[2] - 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 RegisterNodeResponse.ProtoReflect.Descriptor instead. -func (*RegisterNodeResponse) Descriptor() ([]byte, []int) { - return file_management_v1_node_proto_rawDescGZIP(), []int{2} -} - -func (x *RegisterNodeResponse) GetGenericNode() *v1.GenericNode { - if x != nil { - return x.GenericNode - } - return nil -} - -func (x *RegisterNodeResponse) GetContainerNode() *v1.ContainerNode { - if x != nil { - return x.ContainerNode - } - return nil -} - -func (x *RegisterNodeResponse) GetPmmAgent() *v1.PMMAgent { - if x != nil { - return x.PmmAgent - } - return nil -} - -func (x *RegisterNodeResponse) GetToken() string { - if x != nil { - return x.Token - } - return "" -} - -func (x *RegisterNodeResponse) GetWarning() string { - if x != nil { - return x.Warning - } - return "" -} - -type UnregisterNodeRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Node_id to be unregistered. - NodeId string `protobuf:"bytes,1,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` - // Force delete node, related service account, even if it has more service tokens attached. - Force bool `protobuf:"varint,2,opt,name=force,proto3" json:"force,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *UnregisterNodeRequest) Reset() { - *x = UnregisterNodeRequest{} - mi := &file_management_v1_node_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *UnregisterNodeRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UnregisterNodeRequest) ProtoMessage() {} - -func (x *UnregisterNodeRequest) ProtoReflect() protoreflect.Message { - mi := &file_management_v1_node_proto_msgTypes[3] - 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 UnregisterNodeRequest.ProtoReflect.Descriptor instead. -func (*UnregisterNodeRequest) Descriptor() ([]byte, []int) { - return file_management_v1_node_proto_rawDescGZIP(), []int{3} -} - -func (x *UnregisterNodeRequest) GetNodeId() string { - if x != nil { - return x.NodeId - } - return "" -} - -func (x *UnregisterNodeRequest) GetForce() bool { - if x != nil { - return x.Force - } - return false -} - -type UnregisterNodeResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Warning message if there are more service tokens attached to service account. - Warning string `protobuf:"bytes,1,opt,name=warning,proto3" json:"warning,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *UnregisterNodeResponse) Reset() { - *x = UnregisterNodeResponse{} - mi := &file_management_v1_node_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *UnregisterNodeResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UnregisterNodeResponse) ProtoMessage() {} - -func (x *UnregisterNodeResponse) ProtoReflect() protoreflect.Message { - mi := &file_management_v1_node_proto_msgTypes[4] - 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 UnregisterNodeResponse.ProtoReflect.Descriptor instead. -func (*UnregisterNodeResponse) Descriptor() ([]byte, []int) { - return file_management_v1_node_proto_rawDescGZIP(), []int{4} -} - -func (x *UnregisterNodeResponse) GetWarning() string { - if x != nil { - return x.Warning - } - return "" -} - -type UniversalNode struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Unique Node identifier. - NodeId string `protobuf:"bytes,1,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` - // Node type. - NodeType string `protobuf:"bytes,2,opt,name=node_type,json=nodeType,proto3" json:"node_type,omitempty"` - // User-defined node name. - NodeName string `protobuf:"bytes,3,opt,name=node_name,json=nodeName,proto3" json:"node_name,omitempty"` - // Linux machine-id. - MachineId string `protobuf:"bytes,4,opt,name=machine_id,json=machineId,proto3" json:"machine_id,omitempty"` - // Linux distribution name and version. - Distro string `protobuf:"bytes,5,opt,name=distro,proto3" json:"distro,omitempty"` - // Node model. - NodeModel string `protobuf:"bytes,6,opt,name=node_model,json=nodeModel,proto3" json:"node_model,omitempty"` - // A node's unique docker container identifier. - ContainerId string `protobuf:"bytes,7,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` - // Container name. - ContainerName string `protobuf:"bytes,8,opt,name=container_name,json=containerName,proto3" json:"container_name,omitempty"` - // Node address (DNS name or IP). - Address string `protobuf:"bytes,9,opt,name=address,proto3" json:"address,omitempty"` - // Node region. - Region string `protobuf:"bytes,10,opt,name=region,proto3" json:"region,omitempty"` - // Node availability zone. - Az string `protobuf:"bytes,11,opt,name=az,proto3" json:"az,omitempty"` - // Custom user-assigned labels for Node. - CustomLabels map[string]string `protobuf:"bytes,12,rep,name=custom_labels,json=customLabels,proto3" json:"custom_labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - // Creation timestamp. - CreatedAt *timestamppb.Timestamp `protobuf:"bytes,13,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` - // Last update timestamp. - UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,14,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` - // The health status of the node. - Status UniversalNode_Status `protobuf:"varint,15,opt,name=status,proto3,enum=management.v1.UniversalNode_Status" json:"status,omitempty"` - // List of agents related to this node. - Agents []*UniversalNode_Agent `protobuf:"bytes,16,rep,name=agents,proto3" json:"agents,omitempty"` - // List of services running on this node. - Services []*UniversalNode_Service `protobuf:"bytes,17,rep,name=services,proto3" json:"services,omitempty"` - // Instance ID for cloud providers (e.g. AWS RDS). - InstanceId string `protobuf:"bytes,18,opt,name=instance_id,json=instanceId,proto3" json:"instance_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *UniversalNode) Reset() { - *x = UniversalNode{} - mi := &file_management_v1_node_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *UniversalNode) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UniversalNode) ProtoMessage() {} - -func (x *UniversalNode) ProtoReflect() protoreflect.Message { - mi := &file_management_v1_node_proto_msgTypes[5] - 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 UniversalNode.ProtoReflect.Descriptor instead. -func (*UniversalNode) Descriptor() ([]byte, []int) { - return file_management_v1_node_proto_rawDescGZIP(), []int{5} -} - -func (x *UniversalNode) GetNodeId() string { - if x != nil { - return x.NodeId - } - return "" -} - -func (x *UniversalNode) GetNodeType() string { - if x != nil { - return x.NodeType - } - return "" -} - -func (x *UniversalNode) GetNodeName() string { - if x != nil { - return x.NodeName - } - return "" -} - -func (x *UniversalNode) GetMachineId() string { - if x != nil { - return x.MachineId - } - return "" -} - -func (x *UniversalNode) GetDistro() string { - if x != nil { - return x.Distro - } - return "" -} - -func (x *UniversalNode) GetNodeModel() string { - if x != nil { - return x.NodeModel - } - return "" -} - -func (x *UniversalNode) GetContainerId() string { - if x != nil { - return x.ContainerId - } - return "" -} - -func (x *UniversalNode) GetContainerName() string { - if x != nil { - return x.ContainerName - } - return "" -} - -func (x *UniversalNode) GetAddress() string { - if x != nil { - return x.Address - } - return "" -} - -func (x *UniversalNode) GetRegion() string { - if x != nil { - return x.Region - } - return "" -} - -func (x *UniversalNode) GetAz() string { - if x != nil { - return x.Az - } - return "" -} - -func (x *UniversalNode) GetCustomLabels() map[string]string { - if x != nil { - return x.CustomLabels - } - return nil -} - -func (x *UniversalNode) GetCreatedAt() *timestamppb.Timestamp { - if x != nil { - return x.CreatedAt - } - return nil -} - -func (x *UniversalNode) GetUpdatedAt() *timestamppb.Timestamp { - if x != nil { - return x.UpdatedAt - } - return nil -} - -func (x *UniversalNode) GetStatus() UniversalNode_Status { - if x != nil { - return x.Status - } - return UniversalNode_STATUS_UNSPECIFIED -} - -func (x *UniversalNode) GetAgents() []*UniversalNode_Agent { - if x != nil { - return x.Agents - } - return nil -} - -func (x *UniversalNode) GetServices() []*UniversalNode_Service { - if x != nil { - return x.Services - } - return nil -} - -func (x *UniversalNode) GetInstanceId() string { - if x != nil { - return x.InstanceId - } - return "" -} - -type ListNodesRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Node type to be filtered out. - NodeType v1.NodeType `protobuf:"varint,1,opt,name=node_type,json=nodeType,proto3,enum=inventory.v1.NodeType" json:"node_type,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ListNodesRequest) Reset() { - *x = ListNodesRequest{} - mi := &file_management_v1_node_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ListNodesRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListNodesRequest) ProtoMessage() {} - -func (x *ListNodesRequest) ProtoReflect() protoreflect.Message { - mi := &file_management_v1_node_proto_msgTypes[6] - 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 ListNodesRequest.ProtoReflect.Descriptor instead. -func (*ListNodesRequest) Descriptor() ([]byte, []int) { - return file_management_v1_node_proto_rawDescGZIP(), []int{6} -} - -func (x *ListNodesRequest) GetNodeType() v1.NodeType { - if x != nil { - return x.NodeType - } - return v1.NodeType(0) -} - -type ListNodesResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Nodes []*UniversalNode `protobuf:"bytes,1,rep,name=nodes,proto3" json:"nodes,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ListNodesResponse) Reset() { - *x = ListNodesResponse{} - mi := &file_management_v1_node_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ListNodesResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListNodesResponse) ProtoMessage() {} - -func (x *ListNodesResponse) ProtoReflect() protoreflect.Message { - mi := &file_management_v1_node_proto_msgTypes[7] - 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 ListNodesResponse.ProtoReflect.Descriptor instead. -func (*ListNodesResponse) Descriptor() ([]byte, []int) { - return file_management_v1_node_proto_rawDescGZIP(), []int{7} -} - -func (x *ListNodesResponse) GetNodes() []*UniversalNode { - if x != nil { - return x.Nodes - } - return nil -} - -type GetNodeRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Unique Node identifier. - NodeId string `protobuf:"bytes,1,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetNodeRequest) Reset() { - *x = GetNodeRequest{} - mi := &file_management_v1_node_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetNodeRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetNodeRequest) ProtoMessage() {} - -func (x *GetNodeRequest) ProtoReflect() protoreflect.Message { - mi := &file_management_v1_node_proto_msgTypes[8] - 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 GetNodeRequest.ProtoReflect.Descriptor instead. -func (*GetNodeRequest) Descriptor() ([]byte, []int) { - return file_management_v1_node_proto_rawDescGZIP(), []int{8} -} - -func (x *GetNodeRequest) GetNodeId() string { - if x != nil { - return x.NodeId - } - return "" -} - -type GetNodeResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Node *UniversalNode `protobuf:"bytes,1,opt,name=node,proto3" json:"node,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetNodeResponse) Reset() { - *x = GetNodeResponse{} - mi := &file_management_v1_node_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetNodeResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetNodeResponse) ProtoMessage() {} - -func (x *GetNodeResponse) ProtoReflect() protoreflect.Message { - mi := &file_management_v1_node_proto_msgTypes[9] - 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 GetNodeResponse.ProtoReflect.Descriptor instead. -func (*GetNodeResponse) Descriptor() ([]byte, []int) { - return file_management_v1_node_proto_rawDescGZIP(), []int{9} -} - -func (x *GetNodeResponse) GetNode() *UniversalNode { - if x != nil { - return x.Node - } - return nil -} - -// Service represents a service running on a node. -type UniversalNode_Service struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Unique Service identifier. - ServiceId string `protobuf:"bytes,1,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` - // Service type. - ServiceType string `protobuf:"bytes,2,opt,name=service_type,json=serviceType,proto3" json:"service_type,omitempty"` - // Service name. - ServiceName string `protobuf:"bytes,3,opt,name=service_name,json=serviceName,proto3" json:"service_name,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *UniversalNode_Service) Reset() { - *x = UniversalNode_Service{} - mi := &file_management_v1_node_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *UniversalNode_Service) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UniversalNode_Service) ProtoMessage() {} - -func (x *UniversalNode_Service) ProtoReflect() protoreflect.Message { - mi := &file_management_v1_node_proto_msgTypes[12] - 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 UniversalNode_Service.ProtoReflect.Descriptor instead. -func (*UniversalNode_Service) Descriptor() ([]byte, []int) { - return file_management_v1_node_proto_rawDescGZIP(), []int{5, 0} -} - -func (x *UniversalNode_Service) GetServiceId() string { - if x != nil { - return x.ServiceId - } - return "" -} - -func (x *UniversalNode_Service) GetServiceType() string { - if x != nil { - return x.ServiceType - } - return "" -} - -func (x *UniversalNode_Service) GetServiceName() string { - if x != nil { - return x.ServiceName - } - return "" -} - -type UniversalNode_Agent struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Unique Agent identifier. - AgentId string `protobuf:"bytes,1,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"` - // Agent type. - AgentType string `protobuf:"bytes,2,opt,name=agent_type,json=agentType,proto3" json:"agent_type,omitempty"` - // Actual Agent status. - Status string `protobuf:"bytes,3,opt,name=status,proto3" json:"status,omitempty"` - // True if Agent is running and connected to pmm-managed. - IsConnected bool `protobuf:"varint,4,opt,name=is_connected,json=isConnected,proto3" json:"is_connected,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *UniversalNode_Agent) Reset() { - *x = UniversalNode_Agent{} - mi := &file_management_v1_node_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *UniversalNode_Agent) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UniversalNode_Agent) ProtoMessage() {} - -func (x *UniversalNode_Agent) ProtoReflect() protoreflect.Message { - mi := &file_management_v1_node_proto_msgTypes[13] - 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 UniversalNode_Agent.ProtoReflect.Descriptor instead. -func (*UniversalNode_Agent) Descriptor() ([]byte, []int) { - return file_management_v1_node_proto_rawDescGZIP(), []int{5, 1} -} - -func (x *UniversalNode_Agent) GetAgentId() string { - if x != nil { - return x.AgentId - } - return "" -} - -func (x *UniversalNode_Agent) GetAgentType() string { - if x != nil { - return x.AgentType - } - return "" -} - -func (x *UniversalNode_Agent) GetStatus() string { - if x != nil { - return x.Status - } - return "" -} - -func (x *UniversalNode_Agent) GetIsConnected() bool { - if x != nil { - return x.IsConnected - } - return false -} - -var File_management_v1_node_proto protoreflect.FileDescriptor - -const file_management_v1_node_proto_rawDesc = "" + - "\n" + - "\x18management/v1/node.proto\x12\rmanagement.v1\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x19inventory/v1/agents.proto\x1a\x18inventory/v1/nodes.proto\x1a\x1bmanagement/v1/metrics.proto\x1a\x17validate/validate.proto\"\xc8\x03\n" + - "\rAddNodeParams\x123\n" + - "\tnode_type\x18\x01 \x01(\x0e2\x16.inventory.v1.NodeTypeR\bnodeType\x12$\n" + - "\tnode_name\x18\x02 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\bnodeName\x12\x1d\n" + - "\n" + - "machine_id\x18\x03 \x01(\tR\tmachineId\x12\x16\n" + - "\x06distro\x18\x04 \x01(\tR\x06distro\x12!\n" + - "\fcontainer_id\x18\x05 \x01(\tR\vcontainerId\x12%\n" + - "\x0econtainer_name\x18\x06 \x01(\tR\rcontainerName\x12\x1d\n" + - "\n" + - "node_model\x18\a \x01(\tR\tnodeModel\x12\x16\n" + - "\x06region\x18\b \x01(\tR\x06region\x12\x0e\n" + - "\x02az\x18\t \x01(\tR\x02az\x12S\n" + - "\rcustom_labels\x18\n" + - " \x03(\v2..management.v1.AddNodeParams.CustomLabelsEntryR\fcustomLabels\x1a?\n" + - "\x11CustomLabelsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\xed\x05\n" + - "\x13RegisterNodeRequest\x123\n" + - "\tnode_type\x18\x01 \x01(\x0e2\x16.inventory.v1.NodeTypeR\bnodeType\x12$\n" + - "\tnode_name\x18\x02 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\bnodeName\x12\x18\n" + - "\aaddress\x18\x03 \x01(\tR\aaddress\x12\x1d\n" + - "\n" + - "machine_id\x18\x04 \x01(\tR\tmachineId\x12\x16\n" + - "\x06distro\x18\x05 \x01(\tR\x06distro\x12!\n" + - "\fcontainer_id\x18\x06 \x01(\tR\vcontainerId\x12%\n" + - "\x0econtainer_name\x18\a \x01(\tR\rcontainerName\x12\x1d\n" + - "\n" + - "node_model\x18\b \x01(\tR\tnodeModel\x12\x16\n" + - "\x06region\x18\t \x01(\tR\x06region\x12\x0e\n" + - "\x02az\x18\n" + - " \x01(\tR\x02az\x12Y\n" + - "\rcustom_labels\x18\v \x03(\v24.management.v1.RegisterNodeRequest.CustomLabelsEntryR\fcustomLabels\x12\x1e\n" + - "\n" + - "reregister\x18\f \x01(\bR\n" + - "reregister\x12=\n" + - "\fmetrics_mode\x18\r \x01(\x0e2\x1a.management.v1.MetricsModeR\vmetricsMode\x12-\n" + - "\x12disable_collectors\x18\x0e \x03(\tR\x11disableCollectors\x12%\n" + - "\x0eagent_password\x18\x0f \x01(\tR\ragentPassword\x12'\n" + - "\x0fexpose_exporter\x18\x10 \x01(\bR\x0eexposeExporter\x12\x1f\n" + - "\vinstance_id\x18\x11 \x01(\tR\n" + - "instanceId\x1a?\n" + - "\x11CustomLabelsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\xfd\x01\n" + - "\x14RegisterNodeResponse\x12<\n" + - "\fgeneric_node\x18\x01 \x01(\v2\x19.inventory.v1.GenericNodeR\vgenericNode\x12B\n" + - "\x0econtainer_node\x18\x02 \x01(\v2\x1b.inventory.v1.ContainerNodeR\rcontainerNode\x123\n" + - "\tpmm_agent\x18\x03 \x01(\v2\x16.inventory.v1.PMMAgentR\bpmmAgent\x12\x14\n" + - "\x05token\x18\x04 \x01(\tR\x05token\x12\x18\n" + - "\awarning\x18\x05 \x01(\tR\awarning\"O\n" + - "\x15UnregisterNodeRequest\x12 \n" + - "\anode_id\x18\x01 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\x06nodeId\x12\x14\n" + - "\x05force\x18\x02 \x01(\bR\x05force\"2\n" + - "\x16UnregisterNodeResponse\x12\x18\n" + - "\awarning\x18\x01 \x01(\tR\awarning\"\xf0\b\n" + - "\rUniversalNode\x12\x17\n" + - "\anode_id\x18\x01 \x01(\tR\x06nodeId\x12\x1b\n" + - "\tnode_type\x18\x02 \x01(\tR\bnodeType\x12\x1b\n" + - "\tnode_name\x18\x03 \x01(\tR\bnodeName\x12\x1d\n" + - "\n" + - "machine_id\x18\x04 \x01(\tR\tmachineId\x12\x16\n" + - "\x06distro\x18\x05 \x01(\tR\x06distro\x12\x1d\n" + - "\n" + - "node_model\x18\x06 \x01(\tR\tnodeModel\x12!\n" + - "\fcontainer_id\x18\a \x01(\tR\vcontainerId\x12%\n" + - "\x0econtainer_name\x18\b \x01(\tR\rcontainerName\x12\x18\n" + - "\aaddress\x18\t \x01(\tR\aaddress\x12\x16\n" + - "\x06region\x18\n" + - " \x01(\tR\x06region\x12\x0e\n" + - "\x02az\x18\v \x01(\tR\x02az\x12S\n" + - "\rcustom_labels\x18\f \x03(\v2..management.v1.UniversalNode.CustomLabelsEntryR\fcustomLabels\x129\n" + - "\n" + - "created_at\x18\r \x01(\v2\x1a.google.protobuf.TimestampR\tcreatedAt\x129\n" + - "\n" + - "updated_at\x18\x0e \x01(\v2\x1a.google.protobuf.TimestampR\tupdatedAt\x12;\n" + - "\x06status\x18\x0f \x01(\x0e2#.management.v1.UniversalNode.StatusR\x06status\x12:\n" + - "\x06agents\x18\x10 \x03(\v2\".management.v1.UniversalNode.AgentR\x06agents\x12@\n" + - "\bservices\x18\x11 \x03(\v2$.management.v1.UniversalNode.ServiceR\bservices\x12\x1f\n" + - "\vinstance_id\x18\x12 \x01(\tR\n" + - "instanceId\x1an\n" + - "\aService\x12\x1d\n" + - "\n" + - "service_id\x18\x01 \x01(\tR\tserviceId\x12!\n" + - "\fservice_type\x18\x02 \x01(\tR\vserviceType\x12!\n" + - "\fservice_name\x18\x03 \x01(\tR\vserviceName\x1a|\n" + - "\x05Agent\x12\x19\n" + - "\bagent_id\x18\x01 \x01(\tR\aagentId\x12\x1d\n" + - "\n" + - "agent_type\x18\x02 \x01(\tR\tagentType\x12\x16\n" + - "\x06status\x18\x03 \x01(\tR\x06status\x12!\n" + - "\fis_connected\x18\x04 \x01(\bR\visConnected\x1a?\n" + - "\x11CustomLabelsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"T\n" + - "\x06Status\x12\x16\n" + - "\x12STATUS_UNSPECIFIED\x10\x00\x12\r\n" + - "\tSTATUS_UP\x10\x01\x12\x0f\n" + - "\vSTATUS_DOWN\x10\x02\x12\x12\n" + - "\x0eSTATUS_UNKNOWN\x10\x03\"G\n" + - "\x10ListNodesRequest\x123\n" + - "\tnode_type\x18\x01 \x01(\x0e2\x16.inventory.v1.NodeTypeR\bnodeType\"G\n" + - "\x11ListNodesResponse\x122\n" + - "\x05nodes\x18\x01 \x03(\v2\x1c.management.v1.UniversalNodeR\x05nodes\"2\n" + - "\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" + - "\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 ( - file_management_v1_node_proto_rawDescOnce sync.Once - file_management_v1_node_proto_rawDescData []byte -) - -func file_management_v1_node_proto_rawDescGZIP() []byte { - file_management_v1_node_proto_rawDescOnce.Do(func() { - file_management_v1_node_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_management_v1_node_proto_rawDesc), len(file_management_v1_node_proto_rawDesc))) - }) - 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_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 - 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 - 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 -} - -func init() { file_management_v1_node_proto_init() } -func file_management_v1_node_proto_init() { - if File_management_v1_node_proto != nil { - return - } - file_management_v1_metrics_proto_init() - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - 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, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_management_v1_node_proto_goTypes, - DependencyIndexes: file_management_v1_node_proto_depIdxs, - EnumInfos: file_management_v1_node_proto_enumTypes, - MessageInfos: file_management_v1_node_proto_msgTypes, - }.Build() - File_management_v1_node_proto = out.File - file_management_v1_node_proto_goTypes = nil - file_management_v1_node_proto_depIdxs = nil -} diff --git a/api/management/v1/node.pb.validate.go b/api/management/v1/node.pb.validate.go deleted file mode 100644 index 64eaf8133ec..00000000000 --- a/api/management/v1/node.pb.validate.go +++ /dev/null @@ -1,1674 +0,0 @@ -// Code generated by protoc-gen-validate. DO NOT EDIT. -// source: management/v1/node.proto - -package managementv1 - -import ( - "bytes" - "errors" - "fmt" - "net" - "net/mail" - "net/url" - "regexp" - "sort" - "strings" - "time" - "unicode/utf8" - - "google.golang.org/protobuf/types/known/anypb" - - inventoryv1 "github.com/percona/pmm/api/inventory/v1" -) - -// ensure the imports are used -var ( - _ = bytes.MinRead - _ = errors.New("") - _ = fmt.Print - _ = utf8.UTFMax - _ = (*regexp.Regexp)(nil) - _ = (*strings.Reader)(nil) - _ = net.IPv4len - _ = time.Duration(0) - _ = (*url.URL)(nil) - _ = (*mail.Address)(nil) - _ = anypb.Any{} - _ = sort.Sort - - _ = inventoryv1.NodeType(0) -) - -// Validate checks the field values on AddNodeParams 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 *AddNodeParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on AddNodeParams 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 AddNodeParamsMultiError, or -// nil if none found. -func (m *AddNodeParams) ValidateAll() error { - return m.validate(true) -} - -func (m *AddNodeParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for NodeType - - if utf8.RuneCountInString(m.GetNodeName()) < 1 { - err := AddNodeParamsValidationError{ - field: "NodeName", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for MachineId - - // no validation rules for Distro - - // no validation rules for ContainerId - - // no validation rules for ContainerName - - // no validation rules for NodeModel - - // no validation rules for Region - - // no validation rules for Az - - // no validation rules for CustomLabels - - if len(errors) > 0 { - return AddNodeParamsMultiError(errors) - } - - return nil -} - -// AddNodeParamsMultiError is an error wrapping multiple validation errors -// returned by AddNodeParams.ValidateAll() if the designated constraints -// aren't met. -type AddNodeParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m AddNodeParamsMultiError) 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 AddNodeParamsMultiError) AllErrors() []error { return m } - -// AddNodeParamsValidationError is the validation error returned by -// AddNodeParams.Validate if the designated constraints aren't met. -type AddNodeParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e AddNodeParamsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e AddNodeParamsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e AddNodeParamsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e AddNodeParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e AddNodeParamsValidationError) ErrorName() string { return "AddNodeParamsValidationError" } - -// Error satisfies the builtin error interface -func (e AddNodeParamsValidationError) 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 %sAddNodeParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = AddNodeParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = AddNodeParamsValidationError{} - -// Validate checks the field values on RegisterNodeRequest 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 *RegisterNodeRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on RegisterNodeRequest 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 -// RegisterNodeRequestMultiError, or nil if none found. -func (m *RegisterNodeRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *RegisterNodeRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for NodeType - - if utf8.RuneCountInString(m.GetNodeName()) < 1 { - err := RegisterNodeRequestValidationError{ - field: "NodeName", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for Address - - // no validation rules for MachineId - - // no validation rules for Distro - - // no validation rules for ContainerId - - // no validation rules for ContainerName - - // no validation rules for NodeModel - - // no validation rules for Region - - // no validation rules for Az - - // no validation rules for CustomLabels - - // no validation rules for Reregister - - // no validation rules for MetricsMode - - // no validation rules for AgentPassword - - // no validation rules for ExposeExporter - - // no validation rules for InstanceId - - if len(errors) > 0 { - return RegisterNodeRequestMultiError(errors) - } - - return nil -} - -// RegisterNodeRequestMultiError is an error wrapping multiple validation -// errors returned by RegisterNodeRequest.ValidateAll() if the designated -// constraints aren't met. -type RegisterNodeRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m RegisterNodeRequestMultiError) 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 RegisterNodeRequestMultiError) AllErrors() []error { return m } - -// RegisterNodeRequestValidationError is the validation error returned by -// RegisterNodeRequest.Validate if the designated constraints aren't met. -type RegisterNodeRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e RegisterNodeRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e RegisterNodeRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e RegisterNodeRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e RegisterNodeRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e RegisterNodeRequestValidationError) ErrorName() string { - return "RegisterNodeRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e RegisterNodeRequestValidationError) 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 %sRegisterNodeRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = RegisterNodeRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = RegisterNodeRequestValidationError{} - -// Validate checks the field values on RegisterNodeResponse 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 *RegisterNodeResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on RegisterNodeResponse 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 -// RegisterNodeResponseMultiError, or nil if none found. -func (m *RegisterNodeResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *RegisterNodeResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if all { - switch v := interface{}(m.GetGenericNode()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, RegisterNodeResponseValidationError{ - field: "GenericNode", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, RegisterNodeResponseValidationError{ - field: "GenericNode", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetGenericNode()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return RegisterNodeResponseValidationError{ - field: "GenericNode", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetContainerNode()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, RegisterNodeResponseValidationError{ - field: "ContainerNode", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, RegisterNodeResponseValidationError{ - field: "ContainerNode", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetContainerNode()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return RegisterNodeResponseValidationError{ - field: "ContainerNode", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetPmmAgent()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, RegisterNodeResponseValidationError{ - field: "PmmAgent", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, RegisterNodeResponseValidationError{ - field: "PmmAgent", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetPmmAgent()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return RegisterNodeResponseValidationError{ - field: "PmmAgent", - reason: "embedded message failed validation", - cause: err, - } - } - } - - // no validation rules for Token - - // no validation rules for Warning - - if len(errors) > 0 { - return RegisterNodeResponseMultiError(errors) - } - - return nil -} - -// RegisterNodeResponseMultiError is an error wrapping multiple validation -// errors returned by RegisterNodeResponse.ValidateAll() if the designated -// constraints aren't met. -type RegisterNodeResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m RegisterNodeResponseMultiError) 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 RegisterNodeResponseMultiError) AllErrors() []error { return m } - -// RegisterNodeResponseValidationError is the validation error returned by -// RegisterNodeResponse.Validate if the designated constraints aren't met. -type RegisterNodeResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e RegisterNodeResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e RegisterNodeResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e RegisterNodeResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e RegisterNodeResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e RegisterNodeResponseValidationError) ErrorName() string { - return "RegisterNodeResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e RegisterNodeResponseValidationError) 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 %sRegisterNodeResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = RegisterNodeResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = RegisterNodeResponseValidationError{} - -// Validate checks the field values on UnregisterNodeRequest 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 *UnregisterNodeRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on UnregisterNodeRequest 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 -// UnregisterNodeRequestMultiError, or nil if none found. -func (m *UnregisterNodeRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *UnregisterNodeRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetNodeId()) < 1 { - err := UnregisterNodeRequestValidationError{ - field: "NodeId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for Force - - if len(errors) > 0 { - return UnregisterNodeRequestMultiError(errors) - } - - return nil -} - -// UnregisterNodeRequestMultiError is an error wrapping multiple validation -// errors returned by UnregisterNodeRequest.ValidateAll() if the designated -// constraints aren't met. -type UnregisterNodeRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m UnregisterNodeRequestMultiError) 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 UnregisterNodeRequestMultiError) AllErrors() []error { return m } - -// UnregisterNodeRequestValidationError is the validation error returned by -// UnregisterNodeRequest.Validate if the designated constraints aren't met. -type UnregisterNodeRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e UnregisterNodeRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e UnregisterNodeRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e UnregisterNodeRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e UnregisterNodeRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e UnregisterNodeRequestValidationError) ErrorName() string { - return "UnregisterNodeRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e UnregisterNodeRequestValidationError) 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 %sUnregisterNodeRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = UnregisterNodeRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = UnregisterNodeRequestValidationError{} - -// Validate checks the field values on UnregisterNodeResponse 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 *UnregisterNodeResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on UnregisterNodeResponse 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 -// UnregisterNodeResponseMultiError, or nil if none found. -func (m *UnregisterNodeResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *UnregisterNodeResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Warning - - if len(errors) > 0 { - return UnregisterNodeResponseMultiError(errors) - } - - return nil -} - -// UnregisterNodeResponseMultiError is an error wrapping multiple validation -// errors returned by UnregisterNodeResponse.ValidateAll() if the designated -// constraints aren't met. -type UnregisterNodeResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m UnregisterNodeResponseMultiError) 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 UnregisterNodeResponseMultiError) AllErrors() []error { return m } - -// UnregisterNodeResponseValidationError is the validation error returned by -// UnregisterNodeResponse.Validate if the designated constraints aren't met. -type UnregisterNodeResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e UnregisterNodeResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e UnregisterNodeResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e UnregisterNodeResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e UnregisterNodeResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e UnregisterNodeResponseValidationError) ErrorName() string { - return "UnregisterNodeResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e UnregisterNodeResponseValidationError) 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 %sUnregisterNodeResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = UnregisterNodeResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = UnregisterNodeResponseValidationError{} - -// Validate checks the field values on UniversalNode 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 *UniversalNode) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on UniversalNode 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 UniversalNodeMultiError, or -// nil if none found. -func (m *UniversalNode) ValidateAll() error { - return m.validate(true) -} - -func (m *UniversalNode) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for NodeId - - // no validation rules for NodeType - - // no validation rules for NodeName - - // no validation rules for MachineId - - // no validation rules for Distro - - // no validation rules for NodeModel - - // no validation rules for ContainerId - - // no validation rules for ContainerName - - // no validation rules for Address - - // no validation rules for Region - - // no validation rules for Az - - // no validation rules for CustomLabels - - if all { - switch v := interface{}(m.GetCreatedAt()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, UniversalNodeValidationError{ - field: "CreatedAt", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, UniversalNodeValidationError{ - field: "CreatedAt", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetCreatedAt()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return UniversalNodeValidationError{ - field: "CreatedAt", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetUpdatedAt()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, UniversalNodeValidationError{ - field: "UpdatedAt", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, UniversalNodeValidationError{ - field: "UpdatedAt", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetUpdatedAt()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return UniversalNodeValidationError{ - field: "UpdatedAt", - reason: "embedded message failed validation", - cause: err, - } - } - } - - // no validation rules for Status - - for idx, item := range m.GetAgents() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, UniversalNodeValidationError{ - field: fmt.Sprintf("Agents[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, UniversalNodeValidationError{ - field: fmt.Sprintf("Agents[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return UniversalNodeValidationError{ - field: fmt.Sprintf("Agents[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - for idx, item := range m.GetServices() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, UniversalNodeValidationError{ - field: fmt.Sprintf("Services[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, UniversalNodeValidationError{ - field: fmt.Sprintf("Services[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return UniversalNodeValidationError{ - field: fmt.Sprintf("Services[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - // no validation rules for InstanceId - - if len(errors) > 0 { - return UniversalNodeMultiError(errors) - } - - return nil -} - -// UniversalNodeMultiError is an error wrapping multiple validation errors -// returned by UniversalNode.ValidateAll() if the designated constraints -// aren't met. -type UniversalNodeMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m UniversalNodeMultiError) 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 UniversalNodeMultiError) AllErrors() []error { return m } - -// UniversalNodeValidationError is the validation error returned by -// UniversalNode.Validate if the designated constraints aren't met. -type UniversalNodeValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e UniversalNodeValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e UniversalNodeValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e UniversalNodeValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e UniversalNodeValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e UniversalNodeValidationError) ErrorName() string { return "UniversalNodeValidationError" } - -// Error satisfies the builtin error interface -func (e UniversalNodeValidationError) 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 %sUniversalNode.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = UniversalNodeValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = UniversalNodeValidationError{} - -// Validate checks the field values on ListNodesRequest 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 *ListNodesRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ListNodesRequest 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 -// ListNodesRequestMultiError, or nil if none found. -func (m *ListNodesRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *ListNodesRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for NodeType - - if len(errors) > 0 { - return ListNodesRequestMultiError(errors) - } - - return nil -} - -// ListNodesRequestMultiError is an error wrapping multiple validation errors -// returned by ListNodesRequest.ValidateAll() if the designated constraints -// aren't met. -type ListNodesRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ListNodesRequestMultiError) 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 ListNodesRequestMultiError) AllErrors() []error { return m } - -// ListNodesRequestValidationError is the validation error returned by -// ListNodesRequest.Validate if the designated constraints aren't met. -type ListNodesRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ListNodesRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ListNodesRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ListNodesRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ListNodesRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ListNodesRequestValidationError) ErrorName() string { return "ListNodesRequestValidationError" } - -// Error satisfies the builtin error interface -func (e ListNodesRequestValidationError) 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 %sListNodesRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ListNodesRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ListNodesRequestValidationError{} - -// Validate checks the field values on ListNodesResponse 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 *ListNodesResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ListNodesResponse 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 -// ListNodesResponseMultiError, or nil if none found. -func (m *ListNodesResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *ListNodesResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - for idx, item := range m.GetNodes() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ListNodesResponseValidationError{ - field: fmt.Sprintf("Nodes[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ListNodesResponseValidationError{ - field: fmt.Sprintf("Nodes[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ListNodesResponseValidationError{ - field: fmt.Sprintf("Nodes[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - if len(errors) > 0 { - return ListNodesResponseMultiError(errors) - } - - return nil -} - -// ListNodesResponseMultiError is an error wrapping multiple validation errors -// returned by ListNodesResponse.ValidateAll() if the designated constraints -// aren't met. -type ListNodesResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ListNodesResponseMultiError) 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 ListNodesResponseMultiError) AllErrors() []error { return m } - -// ListNodesResponseValidationError is the validation error returned by -// ListNodesResponse.Validate if the designated constraints aren't met. -type ListNodesResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ListNodesResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ListNodesResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ListNodesResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ListNodesResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ListNodesResponseValidationError) ErrorName() string { - return "ListNodesResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e ListNodesResponseValidationError) 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 %sListNodesResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ListNodesResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ListNodesResponseValidationError{} - -// Validate checks the field values on GetNodeRequest 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 *GetNodeRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on GetNodeRequest 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 GetNodeRequestMultiError, -// or nil if none found. -func (m *GetNodeRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *GetNodeRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetNodeId()) < 1 { - err := GetNodeRequestValidationError{ - field: "NodeId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if len(errors) > 0 { - return GetNodeRequestMultiError(errors) - } - - return nil -} - -// GetNodeRequestMultiError is an error wrapping multiple validation errors -// returned by GetNodeRequest.ValidateAll() if the designated constraints -// aren't met. -type GetNodeRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m GetNodeRequestMultiError) 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 GetNodeRequestMultiError) AllErrors() []error { return m } - -// GetNodeRequestValidationError is the validation error returned by -// GetNodeRequest.Validate if the designated constraints aren't met. -type GetNodeRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e GetNodeRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e GetNodeRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e GetNodeRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e GetNodeRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e GetNodeRequestValidationError) ErrorName() string { return "GetNodeRequestValidationError" } - -// Error satisfies the builtin error interface -func (e GetNodeRequestValidationError) 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 %sGetNodeRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = GetNodeRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = GetNodeRequestValidationError{} - -// Validate checks the field values on GetNodeResponse 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 *GetNodeResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on GetNodeResponse 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 -// GetNodeResponseMultiError, or nil if none found. -func (m *GetNodeResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *GetNodeResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if all { - switch v := interface{}(m.GetNode()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GetNodeResponseValidationError{ - field: "Node", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GetNodeResponseValidationError{ - field: "Node", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetNode()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GetNodeResponseValidationError{ - field: "Node", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if len(errors) > 0 { - return GetNodeResponseMultiError(errors) - } - - return nil -} - -// GetNodeResponseMultiError is an error wrapping multiple validation errors -// returned by GetNodeResponse.ValidateAll() if the designated constraints -// aren't met. -type GetNodeResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m GetNodeResponseMultiError) 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 GetNodeResponseMultiError) AllErrors() []error { return m } - -// GetNodeResponseValidationError is the validation error returned by -// GetNodeResponse.Validate if the designated constraints aren't met. -type GetNodeResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e GetNodeResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e GetNodeResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e GetNodeResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e GetNodeResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e GetNodeResponseValidationError) ErrorName() string { return "GetNodeResponseValidationError" } - -// Error satisfies the builtin error interface -func (e GetNodeResponseValidationError) 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 %sGetNodeResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = GetNodeResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = GetNodeResponseValidationError{} - -// 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. -func (m *UniversalNode_Service) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on UniversalNode_Service 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 -// UniversalNode_ServiceMultiError, or nil if none found. -func (m *UniversalNode_Service) ValidateAll() error { - return m.validate(true) -} - -func (m *UniversalNode_Service) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for ServiceId - - // no validation rules for ServiceType - - // no validation rules for ServiceName - - if len(errors) > 0 { - return UniversalNode_ServiceMultiError(errors) - } - - return nil -} - -// UniversalNode_ServiceMultiError is an error wrapping multiple validation -// errors returned by UniversalNode_Service.ValidateAll() if the designated -// constraints aren't met. -type UniversalNode_ServiceMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m UniversalNode_ServiceMultiError) 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 UniversalNode_ServiceMultiError) AllErrors() []error { return m } - -// UniversalNode_ServiceValidationError is the validation error returned by -// UniversalNode_Service.Validate if the designated constraints aren't met. -type UniversalNode_ServiceValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e UniversalNode_ServiceValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e UniversalNode_ServiceValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e UniversalNode_ServiceValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e UniversalNode_ServiceValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e UniversalNode_ServiceValidationError) ErrorName() string { - return "UniversalNode_ServiceValidationError" -} - -// Error satisfies the builtin error interface -func (e UniversalNode_ServiceValidationError) 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 %sUniversalNode_Service.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = UniversalNode_ServiceValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = UniversalNode_ServiceValidationError{} - -// Validate checks the field values on UniversalNode_Agent 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 *UniversalNode_Agent) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on UniversalNode_Agent 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 -// UniversalNode_AgentMultiError, or nil if none found. -func (m *UniversalNode_Agent) ValidateAll() error { - return m.validate(true) -} - -func (m *UniversalNode_Agent) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for AgentId - - // no validation rules for AgentType - - // no validation rules for Status - - // no validation rules for IsConnected - - if len(errors) > 0 { - return UniversalNode_AgentMultiError(errors) - } - - return nil -} - -// UniversalNode_AgentMultiError is an error wrapping multiple validation -// errors returned by UniversalNode_Agent.ValidateAll() if the designated -// constraints aren't met. -type UniversalNode_AgentMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m UniversalNode_AgentMultiError) 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 UniversalNode_AgentMultiError) AllErrors() []error { return m } - -// UniversalNode_AgentValidationError is the validation error returned by -// UniversalNode_Agent.Validate if the designated constraints aren't met. -type UniversalNode_AgentValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e UniversalNode_AgentValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e UniversalNode_AgentValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e UniversalNode_AgentValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e UniversalNode_AgentValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e UniversalNode_AgentValidationError) ErrorName() string { - return "UniversalNode_AgentValidationError" -} - -// Error satisfies the builtin error interface -func (e UniversalNode_AgentValidationError) 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 %sUniversalNode_Agent.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = UniversalNode_AgentValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = UniversalNode_AgentValidationError{} diff --git a/api/management/v1/postgresql.pb.go b/api/management/v1/postgresql.pb.go deleted file mode 100644 index ceacfd5c130..00000000000 --- a/api/management/v1/postgresql.pb.go +++ /dev/null @@ -1,566 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.10 -// protoc (unknown) -// source: management/v1/postgresql.proto - -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" - - v1 "github.com/percona/pmm/api/inventory/v1" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type AddPostgreSQLServiceParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - // 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 `protobuf:"bytes,1,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` - // Node name on which a service is been running. - // Exactly one of these parameters should be present: node_id, node_name, add_node. - NodeName string `protobuf:"bytes,2,opt,name=node_name,json=nodeName,proto3" json:"node_name,omitempty"` - // Create a new Node with those parameters. - // Exactly one of these parameters should be present: node_id, node_name, add_node. - AddNode *AddNodeParams `protobuf:"bytes,3,opt,name=add_node,json=addNode,proto3" json:"add_node,omitempty"` - // Unique across all Services user-defined name. Required. - ServiceName string `protobuf:"bytes,4,opt,name=service_name,json=serviceName,proto3" json:"service_name,omitempty"` - // Node and Service access address (DNS name or IP). - // Address (and port) or socket is required. - Address string `protobuf:"bytes,5,opt,name=address,proto3" json:"address,omitempty"` - // Service Access port. - // Port is required when the address present. - Port uint32 `protobuf:"varint,6,opt,name=port,proto3" json:"port,omitempty"` - // Database name. - Database string `protobuf:"bytes,7,opt,name=database,proto3" json:"database,omitempty"` - // Service Access socket. - // Address (and port) or socket is required. - Socket string `protobuf:"bytes,8,opt,name=socket,proto3" json:"socket,omitempty"` - // The "pmm-agent" identifier which should run agents. Required. - PmmAgentId string `protobuf:"bytes,9,opt,name=pmm_agent_id,json=pmmAgentId,proto3" json:"pmm_agent_id,omitempty"` - // Environment name. - Environment string `protobuf:"bytes,10,opt,name=environment,proto3" json:"environment,omitempty"` - // Cluster name. - Cluster string `protobuf:"bytes,11,opt,name=cluster,proto3" json:"cluster,omitempty"` - // Replication set name. - ReplicationSet string `protobuf:"bytes,12,opt,name=replication_set,json=replicationSet,proto3" json:"replication_set,omitempty"` - // PostgreSQL username for scraping metrics. - Username string `protobuf:"bytes,13,opt,name=username,proto3" json:"username,omitempty"` - // PostgreSQL password for scraping metrics. - Password string `protobuf:"bytes,14,opt,name=password,proto3" json:"password,omitempty"` - // If true, adds qan-postgresql-pgstatements-agent for provided service. - QanPostgresqlPgstatementsAgent bool `protobuf:"varint,15,opt,name=qan_postgresql_pgstatements_agent,json=qanPostgresqlPgstatementsAgent,proto3" json:"qan_postgresql_pgstatements_agent,omitempty"` - // If true, adds qan-postgresql-pgstatmonitor-agent for provided service. - QanPostgresqlPgstatmonitorAgent bool `protobuf:"varint,16,opt,name=qan_postgresql_pgstatmonitor_agent,json=qanPostgresqlPgstatmonitorAgent,proto3" json:"qan_postgresql_pgstatmonitor_agent,omitempty"` - // Limit query length in QAN (default: server-defined; -1: no limit). - MaxQueryLength int32 `protobuf:"varint,17,opt,name=max_query_length,json=maxQueryLength,proto3" json:"max_query_length,omitempty"` - // Disable query examples. - DisableQueryExamples bool `protobuf:"varint,18,opt,name=disable_query_examples,json=disableQueryExamples,proto3" json:"disable_query_examples,omitempty"` - // Custom user-assigned labels for Service. - CustomLabels map[string]string `protobuf:"bytes,19,rep,name=custom_labels,json=customLabels,proto3" json:"custom_labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - // Skip connection check. - SkipConnectionCheck bool `protobuf:"varint,20,opt,name=skip_connection_check,json=skipConnectionCheck,proto3" json:"skip_connection_check,omitempty"` - // Disable parsing comments from queries and showing them in QAN. - DisableCommentsParsing bool `protobuf:"varint,21,opt,name=disable_comments_parsing,json=disableCommentsParsing,proto3" json:"disable_comments_parsing,omitempty"` - // Use TLS for database connections. - Tls bool `protobuf:"varint,22,opt,name=tls,proto3" json:"tls,omitempty"` - // Skip TLS certificate and hostname validation. Uses sslmode=required instead of verify-full. - TlsSkipVerify bool `protobuf:"varint,23,opt,name=tls_skip_verify,json=tlsSkipVerify,proto3" json:"tls_skip_verify,omitempty"` - // Defines metrics flow model for this exporter. - // Metrics could be pushed to the server with vmagent, - // pulled by the server, or the server could choose behavior automatically. - MetricsMode MetricsMode `protobuf:"varint,24,opt,name=metrics_mode,json=metricsMode,proto3,enum=management.v1.MetricsMode" json:"metrics_mode,omitempty"` - // List of collector names to disable in this exporter. - DisableCollectors []string `protobuf:"bytes,25,rep,name=disable_collectors,json=disableCollectors,proto3" json:"disable_collectors,omitempty"` - // TLS CA certificate. - TlsCa string `protobuf:"bytes,26,opt,name=tls_ca,json=tlsCa,proto3" json:"tls_ca,omitempty"` - // TLS Certifcate. - TlsCert string `protobuf:"bytes,27,opt,name=tls_cert,json=tlsCert,proto3" json:"tls_cert,omitempty"` - // TLS Certificate Key. - TlsKey string `protobuf:"bytes,28,opt,name=tls_key,json=tlsKey,proto3" json:"tls_key,omitempty"` - // Custom password for exporter endpoint /metrics. - AgentPassword string `protobuf:"bytes,29,opt,name=agent_password,json=agentPassword,proto3" json:"agent_password,omitempty"` - // Exporter log level - LogLevel v1.LogLevel `protobuf:"varint,30,opt,name=log_level,json=logLevel,proto3,enum=inventory.v1.LogLevel" json:"log_level,omitempty"` - // Limit for auto discovery. - AutoDiscoveryLimit int32 `protobuf:"varint,31,opt,name=auto_discovery_limit,json=autoDiscoveryLimit,proto3" json:"auto_discovery_limit,omitempty"` - // Optionally expose the exporter process on all public interfaces - ExposeExporter bool `protobuf:"varint,32,opt,name=expose_exporter,json=exposeExporter,proto3" json:"expose_exporter,omitempty"` - // Maximum number of connections that exporter can open to the database instance. - MaxExporterConnections int32 `protobuf:"varint,33,opt,name=max_exporter_connections,json=maxExporterConnections,proto3" json:"max_exporter_connections,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AddPostgreSQLServiceParams) Reset() { - *x = AddPostgreSQLServiceParams{} - mi := &file_management_v1_postgresql_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AddPostgreSQLServiceParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddPostgreSQLServiceParams) ProtoMessage() {} - -func (x *AddPostgreSQLServiceParams) ProtoReflect() protoreflect.Message { - mi := &file_management_v1_postgresql_proto_msgTypes[0] - 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 AddPostgreSQLServiceParams.ProtoReflect.Descriptor instead. -func (*AddPostgreSQLServiceParams) Descriptor() ([]byte, []int) { - return file_management_v1_postgresql_proto_rawDescGZIP(), []int{0} -} - -func (x *AddPostgreSQLServiceParams) GetNodeId() string { - if x != nil { - return x.NodeId - } - return "" -} - -func (x *AddPostgreSQLServiceParams) GetNodeName() string { - if x != nil { - return x.NodeName - } - return "" -} - -func (x *AddPostgreSQLServiceParams) GetAddNode() *AddNodeParams { - if x != nil { - return x.AddNode - } - return nil -} - -func (x *AddPostgreSQLServiceParams) GetServiceName() string { - if x != nil { - return x.ServiceName - } - return "" -} - -func (x *AddPostgreSQLServiceParams) GetAddress() string { - if x != nil { - return x.Address - } - return "" -} - -func (x *AddPostgreSQLServiceParams) GetPort() uint32 { - if x != nil { - return x.Port - } - return 0 -} - -func (x *AddPostgreSQLServiceParams) GetDatabase() string { - if x != nil { - return x.Database - } - return "" -} - -func (x *AddPostgreSQLServiceParams) GetSocket() string { - if x != nil { - return x.Socket - } - return "" -} - -func (x *AddPostgreSQLServiceParams) GetPmmAgentId() string { - if x != nil { - return x.PmmAgentId - } - return "" -} - -func (x *AddPostgreSQLServiceParams) GetEnvironment() string { - if x != nil { - return x.Environment - } - return "" -} - -func (x *AddPostgreSQLServiceParams) GetCluster() string { - if x != nil { - return x.Cluster - } - return "" -} - -func (x *AddPostgreSQLServiceParams) GetReplicationSet() string { - if x != nil { - return x.ReplicationSet - } - return "" -} - -func (x *AddPostgreSQLServiceParams) GetUsername() string { - if x != nil { - return x.Username - } - return "" -} - -func (x *AddPostgreSQLServiceParams) GetPassword() string { - if x != nil { - return x.Password - } - return "" -} - -func (x *AddPostgreSQLServiceParams) GetQanPostgresqlPgstatementsAgent() bool { - if x != nil { - return x.QanPostgresqlPgstatementsAgent - } - return false -} - -func (x *AddPostgreSQLServiceParams) GetQanPostgresqlPgstatmonitorAgent() bool { - if x != nil { - return x.QanPostgresqlPgstatmonitorAgent - } - return false -} - -func (x *AddPostgreSQLServiceParams) GetMaxQueryLength() int32 { - if x != nil { - return x.MaxQueryLength - } - return 0 -} - -func (x *AddPostgreSQLServiceParams) GetDisableQueryExamples() bool { - if x != nil { - return x.DisableQueryExamples - } - return false -} - -func (x *AddPostgreSQLServiceParams) GetCustomLabels() map[string]string { - if x != nil { - return x.CustomLabels - } - return nil -} - -func (x *AddPostgreSQLServiceParams) GetSkipConnectionCheck() bool { - if x != nil { - return x.SkipConnectionCheck - } - return false -} - -func (x *AddPostgreSQLServiceParams) GetDisableCommentsParsing() bool { - if x != nil { - return x.DisableCommentsParsing - } - return false -} - -func (x *AddPostgreSQLServiceParams) GetTls() bool { - if x != nil { - return x.Tls - } - return false -} - -func (x *AddPostgreSQLServiceParams) GetTlsSkipVerify() bool { - if x != nil { - return x.TlsSkipVerify - } - return false -} - -func (x *AddPostgreSQLServiceParams) GetMetricsMode() MetricsMode { - if x != nil { - return x.MetricsMode - } - return MetricsMode_METRICS_MODE_UNSPECIFIED -} - -func (x *AddPostgreSQLServiceParams) GetDisableCollectors() []string { - if x != nil { - return x.DisableCollectors - } - return nil -} - -func (x *AddPostgreSQLServiceParams) GetTlsCa() string { - if x != nil { - return x.TlsCa - } - return "" -} - -func (x *AddPostgreSQLServiceParams) GetTlsCert() string { - if x != nil { - return x.TlsCert - } - return "" -} - -func (x *AddPostgreSQLServiceParams) GetTlsKey() string { - if x != nil { - return x.TlsKey - } - return "" -} - -func (x *AddPostgreSQLServiceParams) GetAgentPassword() string { - if x != nil { - return x.AgentPassword - } - return "" -} - -func (x *AddPostgreSQLServiceParams) GetLogLevel() v1.LogLevel { - if x != nil { - return x.LogLevel - } - return v1.LogLevel(0) -} - -func (x *AddPostgreSQLServiceParams) GetAutoDiscoveryLimit() int32 { - if x != nil { - return x.AutoDiscoveryLimit - } - return 0 -} - -func (x *AddPostgreSQLServiceParams) GetExposeExporter() bool { - if x != nil { - return x.ExposeExporter - } - return false -} - -func (x *AddPostgreSQLServiceParams) GetMaxExporterConnections() int32 { - if x != nil { - return x.MaxExporterConnections - } - return 0 -} - -type PostgreSQLServiceResult struct { - state protoimpl.MessageState `protogen:"open.v1"` - Service *v1.PostgreSQLService `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"` - PostgresExporter *v1.PostgresExporter `protobuf:"bytes,2,opt,name=postgres_exporter,json=postgresExporter,proto3" json:"postgres_exporter,omitempty"` - QanPostgresqlPgstatementsAgent *v1.QANPostgreSQLPgStatementsAgent `protobuf:"bytes,3,opt,name=qan_postgresql_pgstatements_agent,json=qanPostgresqlPgstatementsAgent,proto3" json:"qan_postgresql_pgstatements_agent,omitempty"` - QanPostgresqlPgstatmonitorAgent *v1.QANPostgreSQLPgStatMonitorAgent `protobuf:"bytes,4,opt,name=qan_postgresql_pgstatmonitor_agent,json=qanPostgresqlPgstatmonitorAgent,proto3" json:"qan_postgresql_pgstatmonitor_agent,omitempty"` - // Warning message. - Warning string `protobuf:"bytes,5,opt,name=warning,proto3" json:"warning,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *PostgreSQLServiceResult) Reset() { - *x = PostgreSQLServiceResult{} - mi := &file_management_v1_postgresql_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *PostgreSQLServiceResult) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PostgreSQLServiceResult) ProtoMessage() {} - -func (x *PostgreSQLServiceResult) ProtoReflect() protoreflect.Message { - mi := &file_management_v1_postgresql_proto_msgTypes[1] - 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 PostgreSQLServiceResult.ProtoReflect.Descriptor instead. -func (*PostgreSQLServiceResult) Descriptor() ([]byte, []int) { - return file_management_v1_postgresql_proto_rawDescGZIP(), []int{1} -} - -func (x *PostgreSQLServiceResult) GetService() *v1.PostgreSQLService { - if x != nil { - return x.Service - } - return nil -} - -func (x *PostgreSQLServiceResult) GetPostgresExporter() *v1.PostgresExporter { - if x != nil { - return x.PostgresExporter - } - return nil -} - -func (x *PostgreSQLServiceResult) GetQanPostgresqlPgstatementsAgent() *v1.QANPostgreSQLPgStatementsAgent { - if x != nil { - return x.QanPostgresqlPgstatementsAgent - } - return nil -} - -func (x *PostgreSQLServiceResult) GetQanPostgresqlPgstatmonitorAgent() *v1.QANPostgreSQLPgStatMonitorAgent { - if x != nil { - return x.QanPostgresqlPgstatmonitorAgent - } - return nil -} - -func (x *PostgreSQLServiceResult) GetWarning() string { - if x != nil { - return x.Warning - } - return "" -} - -var File_management_v1_postgresql_proto protoreflect.FileDescriptor - -const file_management_v1_postgresql_proto_rawDesc = "" + - "\n" + - "\x1emanagement/v1/postgresql.proto\x12\rmanagement.v1\x1a\x19inventory/v1/agents.proto\x1a\x1cinventory/v1/log_level.proto\x1a\x1binventory/v1/services.proto\x1a\x1bmanagement/v1/metrics.proto\x1a\x18management/v1/node.proto\x1a\x17validate/validate.proto\"\xd7\v\n" + - "\x1aAddPostgreSQLServiceParams\x12\x17\n" + - "\anode_id\x18\x01 \x01(\tR\x06nodeId\x12\x1b\n" + - "\tnode_name\x18\x02 \x01(\tR\bnodeName\x127\n" + - "\badd_node\x18\x03 \x01(\v2\x1c.management.v1.AddNodeParamsR\aaddNode\x12*\n" + - "\fservice_name\x18\x04 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\vserviceName\x12\x18\n" + - "\aaddress\x18\x05 \x01(\tR\aaddress\x12\x12\n" + - "\x04port\x18\x06 \x01(\rR\x04port\x12\x1a\n" + - "\bdatabase\x18\a \x01(\tR\bdatabase\x12\x16\n" + - "\x06socket\x18\b \x01(\tR\x06socket\x12)\n" + - "\fpmm_agent_id\x18\t \x01(\tB\a\xfaB\x04r\x02\x10\x01R\n" + - "pmmAgentId\x12 \n" + - "\venvironment\x18\n" + - " \x01(\tR\venvironment\x12\x18\n" + - "\acluster\x18\v \x01(\tR\acluster\x12'\n" + - "\x0freplication_set\x18\f \x01(\tR\x0ereplicationSet\x12#\n" + - "\busername\x18\r \x01(\tB\a\xfaB\x04r\x02\x10\x01R\busername\x12\x1a\n" + - "\bpassword\x18\x0e \x01(\tR\bpassword\x12I\n" + - "!qan_postgresql_pgstatements_agent\x18\x0f \x01(\bR\x1eqanPostgresqlPgstatementsAgent\x12K\n" + - "\"qan_postgresql_pgstatmonitor_agent\x18\x10 \x01(\bR\x1fqanPostgresqlPgstatmonitorAgent\x12(\n" + - "\x10max_query_length\x18\x11 \x01(\x05R\x0emaxQueryLength\x124\n" + - "\x16disable_query_examples\x18\x12 \x01(\bR\x14disableQueryExamples\x12`\n" + - "\rcustom_labels\x18\x13 \x03(\v2;.management.v1.AddPostgreSQLServiceParams.CustomLabelsEntryR\fcustomLabels\x122\n" + - "\x15skip_connection_check\x18\x14 \x01(\bR\x13skipConnectionCheck\x128\n" + - "\x18disable_comments_parsing\x18\x15 \x01(\bR\x16disableCommentsParsing\x12\x10\n" + - "\x03tls\x18\x16 \x01(\bR\x03tls\x12&\n" + - "\x0ftls_skip_verify\x18\x17 \x01(\bR\rtlsSkipVerify\x12=\n" + - "\fmetrics_mode\x18\x18 \x01(\x0e2\x1a.management.v1.MetricsModeR\vmetricsMode\x12-\n" + - "\x12disable_collectors\x18\x19 \x03(\tR\x11disableCollectors\x12\x15\n" + - "\x06tls_ca\x18\x1a \x01(\tR\x05tlsCa\x12\x19\n" + - "\btls_cert\x18\x1b \x01(\tR\atlsCert\x12\x17\n" + - "\atls_key\x18\x1c \x01(\tR\x06tlsKey\x12%\n" + - "\x0eagent_password\x18\x1d \x01(\tR\ragentPassword\x123\n" + - "\tlog_level\x18\x1e \x01(\x0e2\x16.inventory.v1.LogLevelR\blogLevel\x120\n" + - "\x14auto_discovery_limit\x18\x1f \x01(\x05R\x12autoDiscoveryLimit\x12'\n" + - "\x0fexpose_exporter\x18 \x01(\bR\x0eexposeExporter\x128\n" + - "\x18max_exporter_connections\x18! \x01(\x05R\x16maxExporterConnections\x1a?\n" + - "\x11CustomLabelsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\xb0\x03\n" + - "\x17PostgreSQLServiceResult\x129\n" + - "\aservice\x18\x01 \x01(\v2\x1f.inventory.v1.PostgreSQLServiceR\aservice\x12K\n" + - "\x11postgres_exporter\x18\x02 \x01(\v2\x1e.inventory.v1.PostgresExporterR\x10postgresExporter\x12w\n" + - "!qan_postgresql_pgstatements_agent\x18\x03 \x01(\v2,.inventory.v1.QANPostgreSQLPgStatementsAgentR\x1eqanPostgresqlPgstatementsAgent\x12z\n" + - "\"qan_postgresql_pgstatmonitor_agent\x18\x04 \x01(\v2-.inventory.v1.QANPostgreSQLPgStatMonitorAgentR\x1fqanPostgresqlPgstatmonitorAgent\x12\x18\n" + - "\awarning\x18\x05 \x01(\tR\awarningB\xb0\x01\n" + - "\x11com.management.v1B\x0fPostgresqlProtoP\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 ( - file_management_v1_postgresql_proto_rawDescOnce sync.Once - file_management_v1_postgresql_proto_rawDescData []byte -) - -func file_management_v1_postgresql_proto_rawDescGZIP() []byte { - file_management_v1_postgresql_proto_rawDescOnce.Do(func() { - file_management_v1_postgresql_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_management_v1_postgresql_proto_rawDesc), len(file_management_v1_postgresql_proto_rawDesc))) - }) - 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_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 - 4, // 2: management.v1.AddPostgreSQLServiceParams.metrics_mode:type_name -> management.v1.MetricsMode - 5, // 3: management.v1.AddPostgreSQLServiceParams.log_level:type_name -> inventory.v1.LogLevel - 6, // 4: management.v1.PostgreSQLServiceResult.service:type_name -> inventory.v1.PostgreSQLService - 7, // 5: management.v1.PostgreSQLServiceResult.postgres_exporter:type_name -> inventory.v1.PostgresExporter - 8, // 6: management.v1.PostgreSQLServiceResult.qan_postgresql_pgstatements_agent:type_name -> inventory.v1.QANPostgreSQLPgStatementsAgent - 9, // 7: management.v1.PostgreSQLServiceResult.qan_postgresql_pgstatmonitor_agent:type_name -> inventory.v1.QANPostgreSQLPgStatMonitorAgent - 8, // [8:8] is the sub-list for method output_type - 8, // [8:8] is the sub-list for method input_type - 8, // [8:8] is the sub-list for extension type_name - 8, // [8:8] is the sub-list for extension extendee - 0, // [0:8] is the sub-list for field type_name -} - -func init() { file_management_v1_postgresql_proto_init() } -func file_management_v1_postgresql_proto_init() { - if File_management_v1_postgresql_proto != nil { - return - } - file_management_v1_metrics_proto_init() - file_management_v1_node_proto_init() - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_management_v1_postgresql_proto_rawDesc), len(file_management_v1_postgresql_proto_rawDesc)), - NumEnums: 0, - NumMessages: 3, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_management_v1_postgresql_proto_goTypes, - DependencyIndexes: file_management_v1_postgresql_proto_depIdxs, - MessageInfos: file_management_v1_postgresql_proto_msgTypes, - }.Build() - File_management_v1_postgresql_proto = out.File - file_management_v1_postgresql_proto_goTypes = nil - file_management_v1_postgresql_proto_depIdxs = nil -} diff --git a/api/management/v1/postgresql.pb.validate.go b/api/management/v1/postgresql.pb.validate.go deleted file mode 100644 index bb9a930bb42..00000000000 --- a/api/management/v1/postgresql.pb.validate.go +++ /dev/null @@ -1,480 +0,0 @@ -// Code generated by protoc-gen-validate. DO NOT EDIT. -// source: management/v1/postgresql.proto - -package managementv1 - -import ( - "bytes" - "errors" - "fmt" - "net" - "net/mail" - "net/url" - "regexp" - "sort" - "strings" - "time" - "unicode/utf8" - - "google.golang.org/protobuf/types/known/anypb" - - inventoryv1 "github.com/percona/pmm/api/inventory/v1" -) - -// ensure the imports are used -var ( - _ = bytes.MinRead - _ = errors.New("") - _ = fmt.Print - _ = utf8.UTFMax - _ = (*regexp.Regexp)(nil) - _ = (*strings.Reader)(nil) - _ = net.IPv4len - _ = time.Duration(0) - _ = (*url.URL)(nil) - _ = (*mail.Address)(nil) - _ = anypb.Any{} - _ = sort.Sort - - _ = inventoryv1.LogLevel(0) -) - -// Validate checks the field values on AddPostgreSQLServiceParams 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 *AddPostgreSQLServiceParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on AddPostgreSQLServiceParams 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 -// AddPostgreSQLServiceParamsMultiError, or nil if none found. -func (m *AddPostgreSQLServiceParams) ValidateAll() error { - return m.validate(true) -} - -func (m *AddPostgreSQLServiceParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for NodeId - - // no validation rules for NodeName - - if all { - switch v := interface{}(m.GetAddNode()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AddPostgreSQLServiceParamsValidationError{ - field: "AddNode", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AddPostgreSQLServiceParamsValidationError{ - field: "AddNode", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetAddNode()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AddPostgreSQLServiceParamsValidationError{ - field: "AddNode", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if utf8.RuneCountInString(m.GetServiceName()) < 1 { - err := AddPostgreSQLServiceParamsValidationError{ - field: "ServiceName", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for Address - - // no validation rules for Port - - // no validation rules for Database - - // no validation rules for Socket - - if utf8.RuneCountInString(m.GetPmmAgentId()) < 1 { - err := AddPostgreSQLServiceParamsValidationError{ - field: "PmmAgentId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for Environment - - // no validation rules for Cluster - - // no validation rules for ReplicationSet - - if utf8.RuneCountInString(m.GetUsername()) < 1 { - err := AddPostgreSQLServiceParamsValidationError{ - field: "Username", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for Password - - // no validation rules for QanPostgresqlPgstatementsAgent - - // no validation rules for QanPostgresqlPgstatmonitorAgent - - // no validation rules for MaxQueryLength - - // no validation rules for DisableQueryExamples - - // no validation rules for CustomLabels - - // no validation rules for SkipConnectionCheck - - // no validation rules for DisableCommentsParsing - - // no validation rules for Tls - - // no validation rules for TlsSkipVerify - - // no validation rules for MetricsMode - - // no validation rules for TlsCa - - // no validation rules for TlsCert - - // no validation rules for TlsKey - - // no validation rules for AgentPassword - - // no validation rules for LogLevel - - // no validation rules for AutoDiscoveryLimit - - // no validation rules for ExposeExporter - - // no validation rules for MaxExporterConnections - - if len(errors) > 0 { - return AddPostgreSQLServiceParamsMultiError(errors) - } - - return nil -} - -// AddPostgreSQLServiceParamsMultiError is an error wrapping multiple -// validation errors returned by AddPostgreSQLServiceParams.ValidateAll() if -// the designated constraints aren't met. -type AddPostgreSQLServiceParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m AddPostgreSQLServiceParamsMultiError) 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 AddPostgreSQLServiceParamsMultiError) AllErrors() []error { return m } - -// AddPostgreSQLServiceParamsValidationError is the validation error returned -// by AddPostgreSQLServiceParams.Validate if the designated constraints aren't met. -type AddPostgreSQLServiceParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e AddPostgreSQLServiceParamsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e AddPostgreSQLServiceParamsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e AddPostgreSQLServiceParamsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e AddPostgreSQLServiceParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e AddPostgreSQLServiceParamsValidationError) ErrorName() string { - return "AddPostgreSQLServiceParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e AddPostgreSQLServiceParamsValidationError) 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 %sAddPostgreSQLServiceParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = AddPostgreSQLServiceParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = AddPostgreSQLServiceParamsValidationError{} - -// Validate checks the field values on PostgreSQLServiceResult 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 *PostgreSQLServiceResult) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on PostgreSQLServiceResult 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 -// PostgreSQLServiceResultMultiError, or nil if none found. -func (m *PostgreSQLServiceResult) ValidateAll() error { - return m.validate(true) -} - -func (m *PostgreSQLServiceResult) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if all { - switch v := interface{}(m.GetService()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, PostgreSQLServiceResultValidationError{ - field: "Service", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, PostgreSQLServiceResultValidationError{ - field: "Service", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetService()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return PostgreSQLServiceResultValidationError{ - field: "Service", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetPostgresExporter()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, PostgreSQLServiceResultValidationError{ - field: "PostgresExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, PostgreSQLServiceResultValidationError{ - field: "PostgresExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetPostgresExporter()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return PostgreSQLServiceResultValidationError{ - field: "PostgresExporter", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetQanPostgresqlPgstatementsAgent()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, PostgreSQLServiceResultValidationError{ - field: "QanPostgresqlPgstatementsAgent", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, PostgreSQLServiceResultValidationError{ - field: "QanPostgresqlPgstatementsAgent", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetQanPostgresqlPgstatementsAgent()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return PostgreSQLServiceResultValidationError{ - field: "QanPostgresqlPgstatementsAgent", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetQanPostgresqlPgstatmonitorAgent()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, PostgreSQLServiceResultValidationError{ - field: "QanPostgresqlPgstatmonitorAgent", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, PostgreSQLServiceResultValidationError{ - field: "QanPostgresqlPgstatmonitorAgent", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetQanPostgresqlPgstatmonitorAgent()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return PostgreSQLServiceResultValidationError{ - field: "QanPostgresqlPgstatmonitorAgent", - reason: "embedded message failed validation", - cause: err, - } - } - } - - // no validation rules for Warning - - if len(errors) > 0 { - return PostgreSQLServiceResultMultiError(errors) - } - - return nil -} - -// PostgreSQLServiceResultMultiError is an error wrapping multiple validation -// errors returned by PostgreSQLServiceResult.ValidateAll() if the designated -// constraints aren't met. -type PostgreSQLServiceResultMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m PostgreSQLServiceResultMultiError) 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 PostgreSQLServiceResultMultiError) AllErrors() []error { return m } - -// PostgreSQLServiceResultValidationError is the validation error returned by -// PostgreSQLServiceResult.Validate if the designated constraints aren't met. -type PostgreSQLServiceResultValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e PostgreSQLServiceResultValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e PostgreSQLServiceResultValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e PostgreSQLServiceResultValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e PostgreSQLServiceResultValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e PostgreSQLServiceResultValidationError) ErrorName() string { - return "PostgreSQLServiceResultValidationError" -} - -// Error satisfies the builtin error interface -func (e PostgreSQLServiceResultValidationError) 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 %sPostgreSQLServiceResult.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = PostgreSQLServiceResultValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = PostgreSQLServiceResultValidationError{} diff --git a/api/management/v1/proxysql.pb.go b/api/management/v1/proxysql.pb.go deleted file mode 100644 index 5f4066aa5f9..00000000000 --- a/api/management/v1/proxysql.pb.go +++ /dev/null @@ -1,424 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.10 -// protoc (unknown) -// source: management/v1/proxysql.proto - -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" - - v1 "github.com/percona/pmm/api/inventory/v1" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type AddProxySQLServiceParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - // 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 `protobuf:"bytes,1,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` - // Node name on which a service is been running. - // Exactly one of these parameters should be present: node_id, node_name, add_node. - NodeName string `protobuf:"bytes,2,opt,name=node_name,json=nodeName,proto3" json:"node_name,omitempty"` - // Create a new Node with those parameters. - // Exactly one of these parameters should be present: node_id, node_name, add_node. - AddNode *AddNodeParams `protobuf:"bytes,3,opt,name=add_node,json=addNode,proto3" json:"add_node,omitempty"` - // Unique across all Services user-defined name. Required. - ServiceName string `protobuf:"bytes,4,opt,name=service_name,json=serviceName,proto3" json:"service_name,omitempty"` - // Node and Service access address (DNS name or IP). - // Address (and port) or socket is required. - Address string `protobuf:"bytes,5,opt,name=address,proto3" json:"address,omitempty"` - // Service Access port. - // Port is required when the address present. - Port uint32 `protobuf:"varint,6,opt,name=port,proto3" json:"port,omitempty"` - // Service Access socket. - // Address (and port) or socket is required. - Socket string `protobuf:"bytes,7,opt,name=socket,proto3" json:"socket,omitempty"` - // The "pmm-agent" identifier which should run agents. Required. - PmmAgentId string `protobuf:"bytes,8,opt,name=pmm_agent_id,json=pmmAgentId,proto3" json:"pmm_agent_id,omitempty"` - // Environment name. - Environment string `protobuf:"bytes,9,opt,name=environment,proto3" json:"environment,omitempty"` - // Cluster name. - Cluster string `protobuf:"bytes,10,opt,name=cluster,proto3" json:"cluster,omitempty"` - // Replication set name. - ReplicationSet string `protobuf:"bytes,11,opt,name=replication_set,json=replicationSet,proto3" json:"replication_set,omitempty"` - // ProxySQL username for scraping metrics. - Username string `protobuf:"bytes,12,opt,name=username,proto3" json:"username,omitempty"` - // ProxySQL password for scraping metrics. - Password string `protobuf:"bytes,13,opt,name=password,proto3" json:"password,omitempty"` - // Custom user-assigned labels for Service. - CustomLabels map[string]string `protobuf:"bytes,14,rep,name=custom_labels,json=customLabels,proto3" json:"custom_labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - // Skip connection check. - SkipConnectionCheck bool `protobuf:"varint,15,opt,name=skip_connection_check,json=skipConnectionCheck,proto3" json:"skip_connection_check,omitempty"` - // Use TLS for database connections. - Tls bool `protobuf:"varint,16,opt,name=tls,proto3" json:"tls,omitempty"` - // Skip TLS certificate and hostname validation. - TlsSkipVerify bool `protobuf:"varint,17,opt,name=tls_skip_verify,json=tlsSkipVerify,proto3" json:"tls_skip_verify,omitempty"` - // Defines metrics flow model for this exporter. - // Metrics could be pushed to the server with vmagent, - // pulled by the server, or the server could choose behavior automatically. - MetricsMode MetricsMode `protobuf:"varint,19,opt,name=metrics_mode,json=metricsMode,proto3,enum=management.v1.MetricsMode" json:"metrics_mode,omitempty"` - // List of collector names to disable in this exporter. - DisableCollectors []string `protobuf:"bytes,20,rep,name=disable_collectors,json=disableCollectors,proto3" json:"disable_collectors,omitempty"` - // Custom password for exporter endpoint /metrics. - AgentPassword string `protobuf:"bytes,21,opt,name=agent_password,json=agentPassword,proto3" json:"agent_password,omitempty"` - // Exporter log level - LogLevel v1.LogLevel `protobuf:"varint,22,opt,name=log_level,json=logLevel,proto3,enum=inventory.v1.LogLevel" json:"log_level,omitempty"` - // Optionally expose the exporter process on all public interfaces - ExposeExporter bool `protobuf:"varint,23,opt,name=expose_exporter,json=exposeExporter,proto3" json:"expose_exporter,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AddProxySQLServiceParams) Reset() { - *x = AddProxySQLServiceParams{} - mi := &file_management_v1_proxysql_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AddProxySQLServiceParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddProxySQLServiceParams) ProtoMessage() {} - -func (x *AddProxySQLServiceParams) ProtoReflect() protoreflect.Message { - mi := &file_management_v1_proxysql_proto_msgTypes[0] - 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 AddProxySQLServiceParams.ProtoReflect.Descriptor instead. -func (*AddProxySQLServiceParams) Descriptor() ([]byte, []int) { - return file_management_v1_proxysql_proto_rawDescGZIP(), []int{0} -} - -func (x *AddProxySQLServiceParams) GetNodeId() string { - if x != nil { - return x.NodeId - } - return "" -} - -func (x *AddProxySQLServiceParams) GetNodeName() string { - if x != nil { - return x.NodeName - } - return "" -} - -func (x *AddProxySQLServiceParams) GetAddNode() *AddNodeParams { - if x != nil { - return x.AddNode - } - return nil -} - -func (x *AddProxySQLServiceParams) GetServiceName() string { - if x != nil { - return x.ServiceName - } - return "" -} - -func (x *AddProxySQLServiceParams) GetAddress() string { - if x != nil { - return x.Address - } - return "" -} - -func (x *AddProxySQLServiceParams) GetPort() uint32 { - if x != nil { - return x.Port - } - return 0 -} - -func (x *AddProxySQLServiceParams) GetSocket() string { - if x != nil { - return x.Socket - } - return "" -} - -func (x *AddProxySQLServiceParams) GetPmmAgentId() string { - if x != nil { - return x.PmmAgentId - } - return "" -} - -func (x *AddProxySQLServiceParams) GetEnvironment() string { - if x != nil { - return x.Environment - } - return "" -} - -func (x *AddProxySQLServiceParams) GetCluster() string { - if x != nil { - return x.Cluster - } - return "" -} - -func (x *AddProxySQLServiceParams) GetReplicationSet() string { - if x != nil { - return x.ReplicationSet - } - return "" -} - -func (x *AddProxySQLServiceParams) GetUsername() string { - if x != nil { - return x.Username - } - return "" -} - -func (x *AddProxySQLServiceParams) GetPassword() string { - if x != nil { - return x.Password - } - return "" -} - -func (x *AddProxySQLServiceParams) GetCustomLabels() map[string]string { - if x != nil { - return x.CustomLabels - } - return nil -} - -func (x *AddProxySQLServiceParams) GetSkipConnectionCheck() bool { - if x != nil { - return x.SkipConnectionCheck - } - return false -} - -func (x *AddProxySQLServiceParams) GetTls() bool { - if x != nil { - return x.Tls - } - return false -} - -func (x *AddProxySQLServiceParams) GetTlsSkipVerify() bool { - if x != nil { - return x.TlsSkipVerify - } - return false -} - -func (x *AddProxySQLServiceParams) GetMetricsMode() MetricsMode { - if x != nil { - return x.MetricsMode - } - return MetricsMode_METRICS_MODE_UNSPECIFIED -} - -func (x *AddProxySQLServiceParams) GetDisableCollectors() []string { - if x != nil { - return x.DisableCollectors - } - return nil -} - -func (x *AddProxySQLServiceParams) GetAgentPassword() string { - if x != nil { - return x.AgentPassword - } - return "" -} - -func (x *AddProxySQLServiceParams) GetLogLevel() v1.LogLevel { - if x != nil { - return x.LogLevel - } - return v1.LogLevel(0) -} - -func (x *AddProxySQLServiceParams) GetExposeExporter() bool { - if x != nil { - return x.ExposeExporter - } - return false -} - -type ProxySQLServiceResult struct { - state protoimpl.MessageState `protogen:"open.v1"` - Service *v1.ProxySQLService `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"` - ProxysqlExporter *v1.ProxySQLExporter `protobuf:"bytes,2,opt,name=proxysql_exporter,json=proxysqlExporter,proto3" json:"proxysql_exporter,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ProxySQLServiceResult) Reset() { - *x = ProxySQLServiceResult{} - mi := &file_management_v1_proxysql_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ProxySQLServiceResult) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ProxySQLServiceResult) ProtoMessage() {} - -func (x *ProxySQLServiceResult) ProtoReflect() protoreflect.Message { - mi := &file_management_v1_proxysql_proto_msgTypes[1] - 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 ProxySQLServiceResult.ProtoReflect.Descriptor instead. -func (*ProxySQLServiceResult) Descriptor() ([]byte, []int) { - return file_management_v1_proxysql_proto_rawDescGZIP(), []int{1} -} - -func (x *ProxySQLServiceResult) GetService() *v1.ProxySQLService { - if x != nil { - return x.Service - } - return nil -} - -func (x *ProxySQLServiceResult) GetProxysqlExporter() *v1.ProxySQLExporter { - if x != nil { - return x.ProxysqlExporter - } - return nil -} - -var File_management_v1_proxysql_proto protoreflect.FileDescriptor - -const file_management_v1_proxysql_proto_rawDesc = "" + - "\n" + - "\x1cmanagement/v1/proxysql.proto\x12\rmanagement.v1\x1a\x19inventory/v1/agents.proto\x1a\x1cinventory/v1/log_level.proto\x1a\x1binventory/v1/services.proto\x1a\x1bmanagement/v1/metrics.proto\x1a\x18management/v1/node.proto\x1a\x17validate/validate.proto\"\xce\a\n" + - "\x18AddProxySQLServiceParams\x12\x17\n" + - "\anode_id\x18\x01 \x01(\tR\x06nodeId\x12\x1b\n" + - "\tnode_name\x18\x02 \x01(\tR\bnodeName\x127\n" + - "\badd_node\x18\x03 \x01(\v2\x1c.management.v1.AddNodeParamsR\aaddNode\x12*\n" + - "\fservice_name\x18\x04 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\vserviceName\x12\x18\n" + - "\aaddress\x18\x05 \x01(\tR\aaddress\x12\x12\n" + - "\x04port\x18\x06 \x01(\rR\x04port\x12\x16\n" + - "\x06socket\x18\a \x01(\tR\x06socket\x12)\n" + - "\fpmm_agent_id\x18\b \x01(\tB\a\xfaB\x04r\x02\x10\x01R\n" + - "pmmAgentId\x12 \n" + - "\venvironment\x18\t \x01(\tR\venvironment\x12\x18\n" + - "\acluster\x18\n" + - " \x01(\tR\acluster\x12'\n" + - "\x0freplication_set\x18\v \x01(\tR\x0ereplicationSet\x12#\n" + - "\busername\x18\f \x01(\tB\a\xfaB\x04r\x02\x10\x01R\busername\x12\x1a\n" + - "\bpassword\x18\r \x01(\tR\bpassword\x12^\n" + - "\rcustom_labels\x18\x0e \x03(\v29.management.v1.AddProxySQLServiceParams.CustomLabelsEntryR\fcustomLabels\x122\n" + - "\x15skip_connection_check\x18\x0f \x01(\bR\x13skipConnectionCheck\x12\x10\n" + - "\x03tls\x18\x10 \x01(\bR\x03tls\x12&\n" + - "\x0ftls_skip_verify\x18\x11 \x01(\bR\rtlsSkipVerify\x12=\n" + - "\fmetrics_mode\x18\x13 \x01(\x0e2\x1a.management.v1.MetricsModeR\vmetricsMode\x12-\n" + - "\x12disable_collectors\x18\x14 \x03(\tR\x11disableCollectors\x12%\n" + - "\x0eagent_password\x18\x15 \x01(\tR\ragentPassword\x123\n" + - "\tlog_level\x18\x16 \x01(\x0e2\x16.inventory.v1.LogLevelR\blogLevel\x12'\n" + - "\x0fexpose_exporter\x18\x17 \x01(\bR\x0eexposeExporter\x1a?\n" + - "\x11CustomLabelsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\x9d\x01\n" + - "\x15ProxySQLServiceResult\x127\n" + - "\aservice\x18\x01 \x01(\v2\x1d.inventory.v1.ProxySQLServiceR\aservice\x12K\n" + - "\x11proxysql_exporter\x18\x02 \x01(\v2\x1e.inventory.v1.ProxySQLExporterR\x10proxysqlExporterB\xae\x01\n" + - "\x11com.management.v1B\rProxysqlProtoP\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 ( - file_management_v1_proxysql_proto_rawDescOnce sync.Once - file_management_v1_proxysql_proto_rawDescData []byte -) - -func file_management_v1_proxysql_proto_rawDescGZIP() []byte { - file_management_v1_proxysql_proto_rawDescOnce.Do(func() { - file_management_v1_proxysql_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_management_v1_proxysql_proto_rawDesc), len(file_management_v1_proxysql_proto_rawDesc))) - }) - 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_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 - 4, // 2: management.v1.AddProxySQLServiceParams.metrics_mode:type_name -> management.v1.MetricsMode - 5, // 3: management.v1.AddProxySQLServiceParams.log_level:type_name -> inventory.v1.LogLevel - 6, // 4: management.v1.ProxySQLServiceResult.service:type_name -> inventory.v1.ProxySQLService - 7, // 5: management.v1.ProxySQLServiceResult.proxysql_exporter:type_name -> inventory.v1.ProxySQLExporter - 6, // [6:6] is the sub-list for method output_type - 6, // [6:6] is the sub-list for method input_type - 6, // [6:6] is the sub-list for extension type_name - 6, // [6:6] is the sub-list for extension extendee - 0, // [0:6] is the sub-list for field type_name -} - -func init() { file_management_v1_proxysql_proto_init() } -func file_management_v1_proxysql_proto_init() { - if File_management_v1_proxysql_proto != nil { - return - } - file_management_v1_metrics_proto_init() - file_management_v1_node_proto_init() - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_management_v1_proxysql_proto_rawDesc), len(file_management_v1_proxysql_proto_rawDesc)), - NumEnums: 0, - NumMessages: 3, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_management_v1_proxysql_proto_goTypes, - DependencyIndexes: file_management_v1_proxysql_proto_depIdxs, - MessageInfos: file_management_v1_proxysql_proto_msgTypes, - }.Build() - File_management_v1_proxysql_proto = out.File - file_management_v1_proxysql_proto_goTypes = nil - file_management_v1_proxysql_proto_depIdxs = nil -} diff --git a/api/management/v1/proxysql.pb.validate.go b/api/management/v1/proxysql.pb.validate.go deleted file mode 100644 index d9fea3aff85..00000000000 --- a/api/management/v1/proxysql.pb.validate.go +++ /dev/null @@ -1,398 +0,0 @@ -// Code generated by protoc-gen-validate. DO NOT EDIT. -// source: management/v1/proxysql.proto - -package managementv1 - -import ( - "bytes" - "errors" - "fmt" - "net" - "net/mail" - "net/url" - "regexp" - "sort" - "strings" - "time" - "unicode/utf8" - - "google.golang.org/protobuf/types/known/anypb" - - inventoryv1 "github.com/percona/pmm/api/inventory/v1" -) - -// ensure the imports are used -var ( - _ = bytes.MinRead - _ = errors.New("") - _ = fmt.Print - _ = utf8.UTFMax - _ = (*regexp.Regexp)(nil) - _ = (*strings.Reader)(nil) - _ = net.IPv4len - _ = time.Duration(0) - _ = (*url.URL)(nil) - _ = (*mail.Address)(nil) - _ = anypb.Any{} - _ = sort.Sort - - _ = inventoryv1.LogLevel(0) -) - -// Validate checks the field values on AddProxySQLServiceParams 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 *AddProxySQLServiceParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on AddProxySQLServiceParams 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 -// AddProxySQLServiceParamsMultiError, or nil if none found. -func (m *AddProxySQLServiceParams) ValidateAll() error { - return m.validate(true) -} - -func (m *AddProxySQLServiceParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for NodeId - - // no validation rules for NodeName - - if all { - switch v := interface{}(m.GetAddNode()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AddProxySQLServiceParamsValidationError{ - field: "AddNode", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AddProxySQLServiceParamsValidationError{ - field: "AddNode", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetAddNode()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AddProxySQLServiceParamsValidationError{ - field: "AddNode", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if utf8.RuneCountInString(m.GetServiceName()) < 1 { - err := AddProxySQLServiceParamsValidationError{ - field: "ServiceName", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for Address - - // no validation rules for Port - - // no validation rules for Socket - - if utf8.RuneCountInString(m.GetPmmAgentId()) < 1 { - err := AddProxySQLServiceParamsValidationError{ - field: "PmmAgentId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for Environment - - // no validation rules for Cluster - - // no validation rules for ReplicationSet - - if utf8.RuneCountInString(m.GetUsername()) < 1 { - err := AddProxySQLServiceParamsValidationError{ - field: "Username", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for Password - - // no validation rules for CustomLabels - - // no validation rules for SkipConnectionCheck - - // no validation rules for Tls - - // no validation rules for TlsSkipVerify - - // no validation rules for MetricsMode - - // no validation rules for AgentPassword - - // no validation rules for LogLevel - - // no validation rules for ExposeExporter - - if len(errors) > 0 { - return AddProxySQLServiceParamsMultiError(errors) - } - - return nil -} - -// AddProxySQLServiceParamsMultiError is an error wrapping multiple validation -// errors returned by AddProxySQLServiceParams.ValidateAll() if the designated -// constraints aren't met. -type AddProxySQLServiceParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m AddProxySQLServiceParamsMultiError) 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 AddProxySQLServiceParamsMultiError) AllErrors() []error { return m } - -// AddProxySQLServiceParamsValidationError is the validation error returned by -// AddProxySQLServiceParams.Validate if the designated constraints aren't met. -type AddProxySQLServiceParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e AddProxySQLServiceParamsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e AddProxySQLServiceParamsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e AddProxySQLServiceParamsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e AddProxySQLServiceParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e AddProxySQLServiceParamsValidationError) ErrorName() string { - return "AddProxySQLServiceParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e AddProxySQLServiceParamsValidationError) 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 %sAddProxySQLServiceParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = AddProxySQLServiceParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = AddProxySQLServiceParamsValidationError{} - -// Validate checks the field values on ProxySQLServiceResult 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 *ProxySQLServiceResult) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ProxySQLServiceResult 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 -// ProxySQLServiceResultMultiError, or nil if none found. -func (m *ProxySQLServiceResult) ValidateAll() error { - return m.validate(true) -} - -func (m *ProxySQLServiceResult) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if all { - switch v := interface{}(m.GetService()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ProxySQLServiceResultValidationError{ - field: "Service", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ProxySQLServiceResultValidationError{ - field: "Service", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetService()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ProxySQLServiceResultValidationError{ - field: "Service", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetProxysqlExporter()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ProxySQLServiceResultValidationError{ - field: "ProxysqlExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ProxySQLServiceResultValidationError{ - field: "ProxysqlExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetProxysqlExporter()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ProxySQLServiceResultValidationError{ - field: "ProxysqlExporter", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if len(errors) > 0 { - return ProxySQLServiceResultMultiError(errors) - } - - return nil -} - -// ProxySQLServiceResultMultiError is an error wrapping multiple validation -// errors returned by ProxySQLServiceResult.ValidateAll() if the designated -// constraints aren't met. -type ProxySQLServiceResultMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ProxySQLServiceResultMultiError) 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 ProxySQLServiceResultMultiError) AllErrors() []error { return m } - -// ProxySQLServiceResultValidationError is the validation error returned by -// ProxySQLServiceResult.Validate if the designated constraints aren't met. -type ProxySQLServiceResultValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ProxySQLServiceResultValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ProxySQLServiceResultValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ProxySQLServiceResultValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ProxySQLServiceResultValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ProxySQLServiceResultValidationError) ErrorName() string { - return "ProxySQLServiceResultValidationError" -} - -// Error satisfies the builtin error interface -func (e ProxySQLServiceResultValidationError) 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 %sProxySQLServiceResult.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ProxySQLServiceResultValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ProxySQLServiceResultValidationError{} diff --git a/api/management/v1/rds.pb.go b/api/management/v1/rds.pb.go deleted file mode 100644 index effd9233a63..00000000000 --- a/api/management/v1/rds.pb.go +++ /dev/null @@ -1,890 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.10 -// protoc (unknown) -// source: management/v1/rds.proto - -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" - - v1 "github.com/percona/pmm/api/inventory/v1" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// DiscoverRDSEngine describes supported RDS instance engines. -type DiscoverRDSEngine int32 - -const ( - DiscoverRDSEngine_DISCOVER_RDS_ENGINE_UNSPECIFIED DiscoverRDSEngine = 0 - DiscoverRDSEngine_DISCOVER_RDS_ENGINE_MYSQL DiscoverRDSEngine = 1 - DiscoverRDSEngine_DISCOVER_RDS_ENGINE_POSTGRESQL DiscoverRDSEngine = 2 -) - -// Enum value maps for DiscoverRDSEngine. -var ( - DiscoverRDSEngine_name = map[int32]string{ - 0: "DISCOVER_RDS_ENGINE_UNSPECIFIED", - 1: "DISCOVER_RDS_ENGINE_MYSQL", - 2: "DISCOVER_RDS_ENGINE_POSTGRESQL", - } - DiscoverRDSEngine_value = map[string]int32{ - "DISCOVER_RDS_ENGINE_UNSPECIFIED": 0, - "DISCOVER_RDS_ENGINE_MYSQL": 1, - "DISCOVER_RDS_ENGINE_POSTGRESQL": 2, - } -) - -func (x DiscoverRDSEngine) Enum() *DiscoverRDSEngine { - p := new(DiscoverRDSEngine) - *p = x - return p -} - -func (x DiscoverRDSEngine) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (DiscoverRDSEngine) Descriptor() protoreflect.EnumDescriptor { - return file_management_v1_rds_proto_enumTypes[0].Descriptor() -} - -func (DiscoverRDSEngine) Type() protoreflect.EnumType { - return &file_management_v1_rds_proto_enumTypes[0] -} - -func (x DiscoverRDSEngine) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use DiscoverRDSEngine.Descriptor instead. -func (DiscoverRDSEngine) EnumDescriptor() ([]byte, []int) { - return file_management_v1_rds_proto_rawDescGZIP(), []int{0} -} - -// DiscoverRDSInstance models an unique RDS instance for the list of instances returned by Discovery. -type DiscoverRDSInstance struct { - state protoimpl.MessageState `protogen:"open.v1"` - // AWS region. - Region string `protobuf:"bytes,1,opt,name=region,proto3" json:"region,omitempty"` - // AWS availability zone. - Az string `protobuf:"bytes,2,opt,name=az,proto3" json:"az,omitempty"` - // AWS instance ID. - InstanceId string `protobuf:"bytes,3,opt,name=instance_id,json=instanceId,proto3" json:"instance_id,omitempty"` - // AWS instance class. - NodeModel string `protobuf:"bytes,4,opt,name=node_model,json=nodeModel,proto3" json:"node_model,omitempty"` - // Address used to connect to it. - Address string `protobuf:"bytes,5,opt,name=address,proto3" json:"address,omitempty"` - // Access port. - Port uint32 `protobuf:"varint,6,opt,name=port,proto3" json:"port,omitempty"` - // Instance engine. - Engine DiscoverRDSEngine `protobuf:"varint,7,opt,name=engine,proto3,enum=management.v1.DiscoverRDSEngine" json:"engine,omitempty"` - // Engine version. - EngineVersion string `protobuf:"bytes,8,opt,name=engine_version,json=engineVersion,proto3" json:"engine_version,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DiscoverRDSInstance) Reset() { - *x = DiscoverRDSInstance{} - mi := &file_management_v1_rds_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DiscoverRDSInstance) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DiscoverRDSInstance) ProtoMessage() {} - -func (x *DiscoverRDSInstance) ProtoReflect() protoreflect.Message { - mi := &file_management_v1_rds_proto_msgTypes[0] - 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 DiscoverRDSInstance.ProtoReflect.Descriptor instead. -func (*DiscoverRDSInstance) Descriptor() ([]byte, []int) { - return file_management_v1_rds_proto_rawDescGZIP(), []int{0} -} - -func (x *DiscoverRDSInstance) GetRegion() string { - if x != nil { - return x.Region - } - return "" -} - -func (x *DiscoverRDSInstance) GetAz() string { - if x != nil { - return x.Az - } - return "" -} - -func (x *DiscoverRDSInstance) GetInstanceId() string { - if x != nil { - return x.InstanceId - } - return "" -} - -func (x *DiscoverRDSInstance) GetNodeModel() string { - if x != nil { - return x.NodeModel - } - return "" -} - -func (x *DiscoverRDSInstance) GetAddress() string { - if x != nil { - return x.Address - } - return "" -} - -func (x *DiscoverRDSInstance) GetPort() uint32 { - if x != nil { - return x.Port - } - return 0 -} - -func (x *DiscoverRDSInstance) GetEngine() DiscoverRDSEngine { - if x != nil { - return x.Engine - } - return DiscoverRDSEngine_DISCOVER_RDS_ENGINE_UNSPECIFIED -} - -func (x *DiscoverRDSInstance) GetEngineVersion() string { - if x != nil { - return x.EngineVersion - } - return "" -} - -type DiscoverRDSRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // AWS Access key. Optional. - AwsAccessKey string `protobuf:"bytes,1,opt,name=aws_access_key,json=awsAccessKey,proto3" json:"aws_access_key,omitempty"` - // AWS Secret key. Optional. - AwsSecretKey string `protobuf:"bytes,2,opt,name=aws_secret_key,json=awsSecretKey,proto3" json:"aws_secret_key,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DiscoverRDSRequest) Reset() { - *x = DiscoverRDSRequest{} - mi := &file_management_v1_rds_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DiscoverRDSRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DiscoverRDSRequest) ProtoMessage() {} - -func (x *DiscoverRDSRequest) ProtoReflect() protoreflect.Message { - mi := &file_management_v1_rds_proto_msgTypes[1] - 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 DiscoverRDSRequest.ProtoReflect.Descriptor instead. -func (*DiscoverRDSRequest) Descriptor() ([]byte, []int) { - return file_management_v1_rds_proto_rawDescGZIP(), []int{1} -} - -func (x *DiscoverRDSRequest) GetAwsAccessKey() string { - if x != nil { - return x.AwsAccessKey - } - return "" -} - -func (x *DiscoverRDSRequest) GetAwsSecretKey() string { - if x != nil { - return x.AwsSecretKey - } - return "" -} - -type DiscoverRDSResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - RdsInstances []*DiscoverRDSInstance `protobuf:"bytes,1,rep,name=rds_instances,json=rdsInstances,proto3" json:"rds_instances,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DiscoverRDSResponse) Reset() { - *x = DiscoverRDSResponse{} - mi := &file_management_v1_rds_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DiscoverRDSResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DiscoverRDSResponse) ProtoMessage() {} - -func (x *DiscoverRDSResponse) ProtoReflect() protoreflect.Message { - mi := &file_management_v1_rds_proto_msgTypes[2] - 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 DiscoverRDSResponse.ProtoReflect.Descriptor instead. -func (*DiscoverRDSResponse) Descriptor() ([]byte, []int) { - return file_management_v1_rds_proto_rawDescGZIP(), []int{2} -} - -func (x *DiscoverRDSResponse) GetRdsInstances() []*DiscoverRDSInstance { - if x != nil { - return x.RdsInstances - } - return nil -} - -type AddRDSServiceParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - // AWS region. - Region string `protobuf:"bytes,1,opt,name=region,proto3" json:"region,omitempty"` - // AWS availability zone. - Az string `protobuf:"bytes,2,opt,name=az,proto3" json:"az,omitempty"` - // AWS instance ID. - InstanceId string `protobuf:"bytes,3,opt,name=instance_id,json=instanceId,proto3" json:"instance_id,omitempty"` - // AWS instance class. - NodeModel string `protobuf:"bytes,4,opt,name=node_model,json=nodeModel,proto3" json:"node_model,omitempty"` - // Address used to connect to it. - Address string `protobuf:"bytes,5,opt,name=address,proto3" json:"address,omitempty"` - // Access port. - Port uint32 `protobuf:"varint,6,opt,name=port,proto3" json:"port,omitempty"` - // Instance engine. - Engine DiscoverRDSEngine `protobuf:"varint,7,opt,name=engine,proto3,enum=management.v1.DiscoverRDSEngine" json:"engine,omitempty"` - // PMM Agent ID. - PmmAgentId string `protobuf:"bytes,34,opt,name=pmm_agent_id,json=pmmAgentId,proto3" json:"pmm_agent_id,omitempty"` - // Unique across all Nodes user-defined name. Defaults to AWS instance ID. - NodeName string `protobuf:"bytes,8,opt,name=node_name,json=nodeName,proto3" json:"node_name,omitempty"` - // Unique across all Services user-defined name. Defaults to AWS instance ID. - ServiceName string `protobuf:"bytes,9,opt,name=service_name,json=serviceName,proto3" json:"service_name,omitempty"` - // Environment name. - Environment string `protobuf:"bytes,10,opt,name=environment,proto3" json:"environment,omitempty"` - // Cluster name. - Cluster string `protobuf:"bytes,11,opt,name=cluster,proto3" json:"cluster,omitempty"` - // Replication set name. - ReplicationSet string `protobuf:"bytes,12,opt,name=replication_set,json=replicationSet,proto3" json:"replication_set,omitempty"` - // Username for scraping metrics. - Username string `protobuf:"bytes,13,opt,name=username,proto3" json:"username,omitempty"` - // Password for scraping metrics. - Password string `protobuf:"bytes,14,opt,name=password,proto3" json:"password,omitempty"` - // AWS Access key. - AwsAccessKey string `protobuf:"bytes,15,opt,name=aws_access_key,json=awsAccessKey,proto3" json:"aws_access_key,omitempty"` - // AWS Secret key. - AwsSecretKey string `protobuf:"bytes,16,opt,name=aws_secret_key,json=awsSecretKey,proto3" json:"aws_secret_key,omitempty"` - // If true, adds rds_exporter. - RdsExporter bool `protobuf:"varint,17,opt,name=rds_exporter,json=rdsExporter,proto3" json:"rds_exporter,omitempty"` - // If true, adds qan-mysql-perfschema-agent. - QanMysqlPerfschema bool `protobuf:"varint,18,opt,name=qan_mysql_perfschema,json=qanMysqlPerfschema,proto3" json:"qan_mysql_perfschema,omitempty"` - // Custom user-assigned labels for Node and Service. - CustomLabels map[string]string `protobuf:"bytes,19,rep,name=custom_labels,json=customLabels,proto3" json:"custom_labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - // Skip connection check. - SkipConnectionCheck bool `protobuf:"varint,20,opt,name=skip_connection_check,json=skipConnectionCheck,proto3" json:"skip_connection_check,omitempty"` - // Use TLS for database connections. - Tls bool `protobuf:"varint,21,opt,name=tls,proto3" json:"tls,omitempty"` - // Skip TLS certificate and hostname validation. - TlsSkipVerify bool `protobuf:"varint,22,opt,name=tls_skip_verify,json=tlsSkipVerify,proto3" json:"tls_skip_verify,omitempty"` - // Disable query examples. - DisableQueryExamples bool `protobuf:"varint,23,opt,name=disable_query_examples,json=disableQueryExamples,proto3" json:"disable_query_examples,omitempty"` - // Tablestats group collectors will be disabled if there are more than that number of tables. - // If zero, server's default value is used. - // Use negative value to disable them. - TablestatsGroupTableLimit int32 `protobuf:"varint,24,opt,name=tablestats_group_table_limit,json=tablestatsGroupTableLimit,proto3" json:"tablestats_group_table_limit,omitempty"` - // Disable basic metrics. - DisableBasicMetrics bool `protobuf:"varint,25,opt,name=disable_basic_metrics,json=disableBasicMetrics,proto3" json:"disable_basic_metrics,omitempty"` - // Disable enhanced metrics. - DisableEnhancedMetrics bool `protobuf:"varint,26,opt,name=disable_enhanced_metrics,json=disableEnhancedMetrics,proto3" json:"disable_enhanced_metrics,omitempty"` - // Defines metrics flow model for this exporter. - // Push metrics mode is not allowed. - MetricsMode MetricsMode `protobuf:"varint,27,opt,name=metrics_mode,json=metricsMode,proto3,enum=management.v1.MetricsMode" json:"metrics_mode,omitempty"` - // If true, add qan-pgstatements - QanPostgresqlPgstatements bool `protobuf:"varint,28,opt,name=qan_postgresql_pgstatements,json=qanPostgresqlPgstatements,proto3" json:"qan_postgresql_pgstatements,omitempty"` - // Custom password for exporter endpoint /metrics. - AgentPassword string `protobuf:"bytes,29,opt,name=agent_password,json=agentPassword,proto3" json:"agent_password,omitempty"` - // Database name. - Database string `protobuf:"bytes,30,opt,name=database,proto3" json:"database,omitempty"` - // Limit of databases for auto-discovery. - AutoDiscoveryLimit int32 `protobuf:"varint,31,opt,name=auto_discovery_limit,json=autoDiscoveryLimit,proto3" json:"auto_discovery_limit,omitempty"` - // Disable parsing comments from queries and showing them in QAN. - DisableCommentsParsing bool `protobuf:"varint,32,opt,name=disable_comments_parsing,json=disableCommentsParsing,proto3" json:"disable_comments_parsing,omitempty"` - // Maximum number of exporter connections to PostgreSQL instance. - MaxPostgresqlExporterConnections int32 `protobuf:"varint,33,opt,name=max_postgresql_exporter_connections,json=maxPostgresqlExporterConnections,proto3" json:"max_postgresql_exporter_connections,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AddRDSServiceParams) Reset() { - *x = AddRDSServiceParams{} - mi := &file_management_v1_rds_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AddRDSServiceParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddRDSServiceParams) ProtoMessage() {} - -func (x *AddRDSServiceParams) ProtoReflect() protoreflect.Message { - mi := &file_management_v1_rds_proto_msgTypes[3] - 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 AddRDSServiceParams.ProtoReflect.Descriptor instead. -func (*AddRDSServiceParams) Descriptor() ([]byte, []int) { - return file_management_v1_rds_proto_rawDescGZIP(), []int{3} -} - -func (x *AddRDSServiceParams) GetRegion() string { - if x != nil { - return x.Region - } - return "" -} - -func (x *AddRDSServiceParams) GetAz() string { - if x != nil { - return x.Az - } - return "" -} - -func (x *AddRDSServiceParams) GetInstanceId() string { - if x != nil { - return x.InstanceId - } - return "" -} - -func (x *AddRDSServiceParams) GetNodeModel() string { - if x != nil { - return x.NodeModel - } - return "" -} - -func (x *AddRDSServiceParams) GetAddress() string { - if x != nil { - return x.Address - } - return "" -} - -func (x *AddRDSServiceParams) GetPort() uint32 { - if x != nil { - return x.Port - } - return 0 -} - -func (x *AddRDSServiceParams) GetEngine() DiscoverRDSEngine { - if x != nil { - return x.Engine - } - return DiscoverRDSEngine_DISCOVER_RDS_ENGINE_UNSPECIFIED -} - -func (x *AddRDSServiceParams) GetPmmAgentId() string { - if x != nil { - return x.PmmAgentId - } - return "" -} - -func (x *AddRDSServiceParams) GetNodeName() string { - if x != nil { - return x.NodeName - } - return "" -} - -func (x *AddRDSServiceParams) GetServiceName() string { - if x != nil { - return x.ServiceName - } - return "" -} - -func (x *AddRDSServiceParams) GetEnvironment() string { - if x != nil { - return x.Environment - } - return "" -} - -func (x *AddRDSServiceParams) GetCluster() string { - if x != nil { - return x.Cluster - } - return "" -} - -func (x *AddRDSServiceParams) GetReplicationSet() string { - if x != nil { - return x.ReplicationSet - } - return "" -} - -func (x *AddRDSServiceParams) GetUsername() string { - if x != nil { - return x.Username - } - return "" -} - -func (x *AddRDSServiceParams) GetPassword() string { - if x != nil { - return x.Password - } - return "" -} - -func (x *AddRDSServiceParams) GetAwsAccessKey() string { - if x != nil { - return x.AwsAccessKey - } - return "" -} - -func (x *AddRDSServiceParams) GetAwsSecretKey() string { - if x != nil { - return x.AwsSecretKey - } - return "" -} - -func (x *AddRDSServiceParams) GetRdsExporter() bool { - if x != nil { - return x.RdsExporter - } - return false -} - -func (x *AddRDSServiceParams) GetQanMysqlPerfschema() bool { - if x != nil { - return x.QanMysqlPerfschema - } - return false -} - -func (x *AddRDSServiceParams) GetCustomLabels() map[string]string { - if x != nil { - return x.CustomLabels - } - return nil -} - -func (x *AddRDSServiceParams) GetSkipConnectionCheck() bool { - if x != nil { - return x.SkipConnectionCheck - } - return false -} - -func (x *AddRDSServiceParams) GetTls() bool { - if x != nil { - return x.Tls - } - return false -} - -func (x *AddRDSServiceParams) GetTlsSkipVerify() bool { - if x != nil { - return x.TlsSkipVerify - } - return false -} - -func (x *AddRDSServiceParams) GetDisableQueryExamples() bool { - if x != nil { - return x.DisableQueryExamples - } - return false -} - -func (x *AddRDSServiceParams) GetTablestatsGroupTableLimit() int32 { - if x != nil { - return x.TablestatsGroupTableLimit - } - return 0 -} - -func (x *AddRDSServiceParams) GetDisableBasicMetrics() bool { - if x != nil { - return x.DisableBasicMetrics - } - return false -} - -func (x *AddRDSServiceParams) GetDisableEnhancedMetrics() bool { - if x != nil { - return x.DisableEnhancedMetrics - } - return false -} - -func (x *AddRDSServiceParams) GetMetricsMode() MetricsMode { - if x != nil { - return x.MetricsMode - } - return MetricsMode_METRICS_MODE_UNSPECIFIED -} - -func (x *AddRDSServiceParams) GetQanPostgresqlPgstatements() bool { - if x != nil { - return x.QanPostgresqlPgstatements - } - return false -} - -func (x *AddRDSServiceParams) GetAgentPassword() string { - if x != nil { - return x.AgentPassword - } - return "" -} - -func (x *AddRDSServiceParams) GetDatabase() string { - if x != nil { - return x.Database - } - return "" -} - -func (x *AddRDSServiceParams) GetAutoDiscoveryLimit() int32 { - if x != nil { - return x.AutoDiscoveryLimit - } - return 0 -} - -func (x *AddRDSServiceParams) GetDisableCommentsParsing() bool { - if x != nil { - return x.DisableCommentsParsing - } - return false -} - -func (x *AddRDSServiceParams) GetMaxPostgresqlExporterConnections() int32 { - if x != nil { - return x.MaxPostgresqlExporterConnections - } - return 0 -} - -type RDSServiceResult struct { - state protoimpl.MessageState `protogen:"open.v1"` - Node *v1.RemoteRDSNode `protobuf:"bytes,1,opt,name=node,proto3" json:"node,omitempty"` - RdsExporter *v1.RDSExporter `protobuf:"bytes,2,opt,name=rds_exporter,json=rdsExporter,proto3" json:"rds_exporter,omitempty"` - Mysql *v1.MySQLService `protobuf:"bytes,3,opt,name=mysql,proto3" json:"mysql,omitempty"` - MysqldExporter *v1.MySQLdExporter `protobuf:"bytes,4,opt,name=mysqld_exporter,json=mysqldExporter,proto3" json:"mysqld_exporter,omitempty"` - QanMysqlPerfschema *v1.QANMySQLPerfSchemaAgent `protobuf:"bytes,5,opt,name=qan_mysql_perfschema,json=qanMysqlPerfschema,proto3" json:"qan_mysql_perfschema,omitempty"` - Postgresql *v1.PostgreSQLService `protobuf:"bytes,6,opt,name=postgresql,proto3" json:"postgresql,omitempty"` - PostgresqlExporter *v1.PostgresExporter `protobuf:"bytes,7,opt,name=postgresql_exporter,json=postgresqlExporter,proto3" json:"postgresql_exporter,omitempty"` - QanPostgresqlPgstatements *v1.QANPostgreSQLPgStatementsAgent `protobuf:"bytes,8,opt,name=qan_postgresql_pgstatements,json=qanPostgresqlPgstatements,proto3" json:"qan_postgresql_pgstatements,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *RDSServiceResult) Reset() { - *x = RDSServiceResult{} - mi := &file_management_v1_rds_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *RDSServiceResult) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RDSServiceResult) ProtoMessage() {} - -func (x *RDSServiceResult) ProtoReflect() protoreflect.Message { - mi := &file_management_v1_rds_proto_msgTypes[4] - 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 RDSServiceResult.ProtoReflect.Descriptor instead. -func (*RDSServiceResult) Descriptor() ([]byte, []int) { - return file_management_v1_rds_proto_rawDescGZIP(), []int{4} -} - -func (x *RDSServiceResult) GetNode() *v1.RemoteRDSNode { - if x != nil { - return x.Node - } - return nil -} - -func (x *RDSServiceResult) GetRdsExporter() *v1.RDSExporter { - if x != nil { - return x.RdsExporter - } - return nil -} - -func (x *RDSServiceResult) GetMysql() *v1.MySQLService { - if x != nil { - return x.Mysql - } - return nil -} - -func (x *RDSServiceResult) GetMysqldExporter() *v1.MySQLdExporter { - if x != nil { - return x.MysqldExporter - } - return nil -} - -func (x *RDSServiceResult) GetQanMysqlPerfschema() *v1.QANMySQLPerfSchemaAgent { - if x != nil { - return x.QanMysqlPerfschema - } - return nil -} - -func (x *RDSServiceResult) GetPostgresql() *v1.PostgreSQLService { - if x != nil { - return x.Postgresql - } - return nil -} - -func (x *RDSServiceResult) GetPostgresqlExporter() *v1.PostgresExporter { - if x != nil { - return x.PostgresqlExporter - } - return nil -} - -func (x *RDSServiceResult) GetQanPostgresqlPgstatements() *v1.QANPostgreSQLPgStatementsAgent { - if x != nil { - return x.QanPostgresqlPgstatements - } - return nil -} - -var File_management_v1_rds_proto protoreflect.FileDescriptor - -const file_management_v1_rds_proto_rawDesc = "" + - "\n" + - "\x17management/v1/rds.proto\x12\rmanagement.v1\x1a\x19inventory/v1/agents.proto\x1a\x18inventory/v1/nodes.proto\x1a\x1binventory/v1/services.proto\x1a\x1bmanagement/v1/metrics.proto\x1a\x17validate/validate.proto\"\x8c\x02\n" + - "\x13DiscoverRDSInstance\x12\x16\n" + - "\x06region\x18\x01 \x01(\tR\x06region\x12\x0e\n" + - "\x02az\x18\x02 \x01(\tR\x02az\x12\x1f\n" + - "\vinstance_id\x18\x03 \x01(\tR\n" + - "instanceId\x12\x1d\n" + - "\n" + - "node_model\x18\x04 \x01(\tR\tnodeModel\x12\x18\n" + - "\aaddress\x18\x05 \x01(\tR\aaddress\x12\x12\n" + - "\x04port\x18\x06 \x01(\rR\x04port\x128\n" + - "\x06engine\x18\a \x01(\x0e2 .management.v1.DiscoverRDSEngineR\x06engine\x12%\n" + - "\x0eengine_version\x18\b \x01(\tR\rengineVersion\"`\n" + - "\x12DiscoverRDSRequest\x12$\n" + - "\x0eaws_access_key\x18\x01 \x01(\tR\fawsAccessKey\x12$\n" + - "\x0eaws_secret_key\x18\x02 \x01(\tR\fawsSecretKey\"^\n" + - "\x13DiscoverRDSResponse\x12G\n" + - "\rrds_instances\x18\x01 \x03(\v2\".management.v1.DiscoverRDSInstanceR\frdsInstances\"\x9e\f\n" + - "\x13AddRDSServiceParams\x12\x1f\n" + - "\x06region\x18\x01 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\x06region\x12\x0e\n" + - "\x02az\x18\x02 \x01(\tR\x02az\x12(\n" + - "\vinstance_id\x18\x03 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\n" + - "instanceId\x12\x1d\n" + - "\n" + - "node_model\x18\x04 \x01(\tR\tnodeModel\x12!\n" + - "\aaddress\x18\x05 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\aaddress\x12\x1b\n" + - "\x04port\x18\x06 \x01(\rB\a\xfaB\x04*\x02 \x00R\x04port\x128\n" + - "\x06engine\x18\a \x01(\x0e2 .management.v1.DiscoverRDSEngineR\x06engine\x12 \n" + - "\fpmm_agent_id\x18\" \x01(\tR\n" + - "pmmAgentId\x12\x1b\n" + - "\tnode_name\x18\b \x01(\tR\bnodeName\x12!\n" + - "\fservice_name\x18\t \x01(\tR\vserviceName\x12 \n" + - "\venvironment\x18\n" + - " \x01(\tR\venvironment\x12\x18\n" + - "\acluster\x18\v \x01(\tR\acluster\x12'\n" + - "\x0freplication_set\x18\f \x01(\tR\x0ereplicationSet\x12#\n" + - "\busername\x18\r \x01(\tB\a\xfaB\x04r\x02\x10\x01R\busername\x12\x1a\n" + - "\bpassword\x18\x0e \x01(\tR\bpassword\x12$\n" + - "\x0eaws_access_key\x18\x0f \x01(\tR\fawsAccessKey\x12$\n" + - "\x0eaws_secret_key\x18\x10 \x01(\tR\fawsSecretKey\x12!\n" + - "\frds_exporter\x18\x11 \x01(\bR\vrdsExporter\x120\n" + - "\x14qan_mysql_perfschema\x18\x12 \x01(\bR\x12qanMysqlPerfschema\x12Y\n" + - "\rcustom_labels\x18\x13 \x03(\v24.management.v1.AddRDSServiceParams.CustomLabelsEntryR\fcustomLabels\x122\n" + - "\x15skip_connection_check\x18\x14 \x01(\bR\x13skipConnectionCheck\x12\x10\n" + - "\x03tls\x18\x15 \x01(\bR\x03tls\x12&\n" + - "\x0ftls_skip_verify\x18\x16 \x01(\bR\rtlsSkipVerify\x124\n" + - "\x16disable_query_examples\x18\x17 \x01(\bR\x14disableQueryExamples\x12?\n" + - "\x1ctablestats_group_table_limit\x18\x18 \x01(\x05R\x19tablestatsGroupTableLimit\x122\n" + - "\x15disable_basic_metrics\x18\x19 \x01(\bR\x13disableBasicMetrics\x128\n" + - "\x18disable_enhanced_metrics\x18\x1a \x01(\bR\x16disableEnhancedMetrics\x12=\n" + - "\fmetrics_mode\x18\x1b \x01(\x0e2\x1a.management.v1.MetricsModeR\vmetricsMode\x12>\n" + - "\x1bqan_postgresql_pgstatements\x18\x1c \x01(\bR\x19qanPostgresqlPgstatements\x12%\n" + - "\x0eagent_password\x18\x1d \x01(\tR\ragentPassword\x12\x1a\n" + - "\bdatabase\x18\x1e \x01(\tR\bdatabase\x120\n" + - "\x14auto_discovery_limit\x18\x1f \x01(\x05R\x12autoDiscoveryLimit\x128\n" + - "\x18disable_comments_parsing\x18 \x01(\bR\x16disableCommentsParsing\x12M\n" + - "#max_postgresql_exporter_connections\x18! \x01(\x05R maxPostgresqlExporterConnections\x1a?\n" + - "\x11CustomLabelsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\xd3\x04\n" + - "\x10RDSServiceResult\x12/\n" + - "\x04node\x18\x01 \x01(\v2\x1b.inventory.v1.RemoteRDSNodeR\x04node\x12<\n" + - "\frds_exporter\x18\x02 \x01(\v2\x19.inventory.v1.RDSExporterR\vrdsExporter\x120\n" + - "\x05mysql\x18\x03 \x01(\v2\x1a.inventory.v1.MySQLServiceR\x05mysql\x12E\n" + - "\x0fmysqld_exporter\x18\x04 \x01(\v2\x1c.inventory.v1.MySQLdExporterR\x0emysqldExporter\x12W\n" + - "\x14qan_mysql_perfschema\x18\x05 \x01(\v2%.inventory.v1.QANMySQLPerfSchemaAgentR\x12qanMysqlPerfschema\x12?\n" + - "\n" + - "postgresql\x18\x06 \x01(\v2\x1f.inventory.v1.PostgreSQLServiceR\n" + - "postgresql\x12O\n" + - "\x13postgresql_exporter\x18\a \x01(\v2\x1e.inventory.v1.PostgresExporterR\x12postgresqlExporter\x12l\n" + - "\x1bqan_postgresql_pgstatements\x18\b \x01(\v2,.inventory.v1.QANPostgreSQLPgStatementsAgentR\x19qanPostgresqlPgstatements*{\n" + - "\x11DiscoverRDSEngine\x12#\n" + - "\x1fDISCOVER_RDS_ENGINE_UNSPECIFIED\x10\x00\x12\x1d\n" + - "\x19DISCOVER_RDS_ENGINE_MYSQL\x10\x01\x12\"\n" + - "\x1eDISCOVER_RDS_ENGINE_POSTGRESQL\x10\x02B\xa9\x01\n" + - "\x11com.management.v1B\bRdsProtoP\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 ( - file_management_v1_rds_proto_rawDescOnce sync.Once - file_management_v1_rds_proto_rawDescData []byte -) - -func file_management_v1_rds_proto_rawDescGZIP() []byte { - file_management_v1_rds_proto_rawDescOnce.Do(func() { - file_management_v1_rds_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_management_v1_rds_proto_rawDesc), len(file_management_v1_rds_proto_rawDesc))) - }) - 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_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 - 0, // 2: management.v1.AddRDSServiceParams.engine:type_name -> management.v1.DiscoverRDSEngine - 6, // 3: management.v1.AddRDSServiceParams.custom_labels:type_name -> management.v1.AddRDSServiceParams.CustomLabelsEntry - 7, // 4: management.v1.AddRDSServiceParams.metrics_mode:type_name -> management.v1.MetricsMode - 8, // 5: management.v1.RDSServiceResult.node:type_name -> inventory.v1.RemoteRDSNode - 9, // 6: management.v1.RDSServiceResult.rds_exporter:type_name -> inventory.v1.RDSExporter - 10, // 7: management.v1.RDSServiceResult.mysql:type_name -> inventory.v1.MySQLService - 11, // 8: management.v1.RDSServiceResult.mysqld_exporter:type_name -> inventory.v1.MySQLdExporter - 12, // 9: management.v1.RDSServiceResult.qan_mysql_perfschema:type_name -> inventory.v1.QANMySQLPerfSchemaAgent - 13, // 10: management.v1.RDSServiceResult.postgresql:type_name -> inventory.v1.PostgreSQLService - 14, // 11: management.v1.RDSServiceResult.postgresql_exporter:type_name -> inventory.v1.PostgresExporter - 15, // 12: management.v1.RDSServiceResult.qan_postgresql_pgstatements:type_name -> inventory.v1.QANPostgreSQLPgStatementsAgent - 13, // [13:13] is the sub-list for method output_type - 13, // [13:13] is the sub-list for method input_type - 13, // [13:13] is the sub-list for extension type_name - 13, // [13:13] is the sub-list for extension extendee - 0, // [0:13] is the sub-list for field type_name -} - -func init() { file_management_v1_rds_proto_init() } -func file_management_v1_rds_proto_init() { - if File_management_v1_rds_proto != nil { - return - } - file_management_v1_metrics_proto_init() - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_management_v1_rds_proto_rawDesc), len(file_management_v1_rds_proto_rawDesc)), - NumEnums: 1, - NumMessages: 6, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_management_v1_rds_proto_goTypes, - DependencyIndexes: file_management_v1_rds_proto_depIdxs, - EnumInfos: file_management_v1_rds_proto_enumTypes, - MessageInfos: file_management_v1_rds_proto_msgTypes, - }.Build() - File_management_v1_rds_proto = out.File - file_management_v1_rds_proto_goTypes = nil - file_management_v1_rds_proto_depIdxs = nil -} diff --git a/api/management/v1/rds.pb.validate.go b/api/management/v1/rds.pb.validate.go deleted file mode 100644 index 920bb97dbf1..00000000000 --- a/api/management/v1/rds.pb.validate.go +++ /dev/null @@ -1,943 +0,0 @@ -// Code generated by protoc-gen-validate. DO NOT EDIT. -// source: management/v1/rds.proto - -package managementv1 - -import ( - "bytes" - "errors" - "fmt" - "net" - "net/mail" - "net/url" - "regexp" - "sort" - "strings" - "time" - "unicode/utf8" - - "google.golang.org/protobuf/types/known/anypb" -) - -// ensure the imports are used -var ( - _ = bytes.MinRead - _ = errors.New("") - _ = fmt.Print - _ = utf8.UTFMax - _ = (*regexp.Regexp)(nil) - _ = (*strings.Reader)(nil) - _ = net.IPv4len - _ = time.Duration(0) - _ = (*url.URL)(nil) - _ = (*mail.Address)(nil) - _ = anypb.Any{} - _ = sort.Sort -) - -// Validate checks the field values on DiscoverRDSInstance 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 *DiscoverRDSInstance) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on DiscoverRDSInstance 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 -// DiscoverRDSInstanceMultiError, or nil if none found. -func (m *DiscoverRDSInstance) ValidateAll() error { - return m.validate(true) -} - -func (m *DiscoverRDSInstance) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Region - - // no validation rules for Az - - // no validation rules for InstanceId - - // no validation rules for NodeModel - - // no validation rules for Address - - // no validation rules for Port - - // no validation rules for Engine - - // no validation rules for EngineVersion - - if len(errors) > 0 { - return DiscoverRDSInstanceMultiError(errors) - } - - return nil -} - -// DiscoverRDSInstanceMultiError is an error wrapping multiple validation -// errors returned by DiscoverRDSInstance.ValidateAll() if the designated -// constraints aren't met. -type DiscoverRDSInstanceMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m DiscoverRDSInstanceMultiError) 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 DiscoverRDSInstanceMultiError) AllErrors() []error { return m } - -// DiscoverRDSInstanceValidationError is the validation error returned by -// DiscoverRDSInstance.Validate if the designated constraints aren't met. -type DiscoverRDSInstanceValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e DiscoverRDSInstanceValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e DiscoverRDSInstanceValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e DiscoverRDSInstanceValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e DiscoverRDSInstanceValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e DiscoverRDSInstanceValidationError) ErrorName() string { - return "DiscoverRDSInstanceValidationError" -} - -// Error satisfies the builtin error interface -func (e DiscoverRDSInstanceValidationError) 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 %sDiscoverRDSInstance.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = DiscoverRDSInstanceValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = DiscoverRDSInstanceValidationError{} - -// Validate checks the field values on DiscoverRDSRequest 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 *DiscoverRDSRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on DiscoverRDSRequest 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 -// DiscoverRDSRequestMultiError, or nil if none found. -func (m *DiscoverRDSRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *DiscoverRDSRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for AwsAccessKey - - // no validation rules for AwsSecretKey - - if len(errors) > 0 { - return DiscoverRDSRequestMultiError(errors) - } - - return nil -} - -// DiscoverRDSRequestMultiError is an error wrapping multiple validation errors -// returned by DiscoverRDSRequest.ValidateAll() if the designated constraints -// aren't met. -type DiscoverRDSRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m DiscoverRDSRequestMultiError) 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 DiscoverRDSRequestMultiError) AllErrors() []error { return m } - -// DiscoverRDSRequestValidationError is the validation error returned by -// DiscoverRDSRequest.Validate if the designated constraints aren't met. -type DiscoverRDSRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e DiscoverRDSRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e DiscoverRDSRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e DiscoverRDSRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e DiscoverRDSRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e DiscoverRDSRequestValidationError) ErrorName() string { - return "DiscoverRDSRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e DiscoverRDSRequestValidationError) 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 %sDiscoverRDSRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = DiscoverRDSRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = DiscoverRDSRequestValidationError{} - -// Validate checks the field values on DiscoverRDSResponse 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 *DiscoverRDSResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on DiscoverRDSResponse 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 -// DiscoverRDSResponseMultiError, or nil if none found. -func (m *DiscoverRDSResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *DiscoverRDSResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - for idx, item := range m.GetRdsInstances() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, DiscoverRDSResponseValidationError{ - field: fmt.Sprintf("RdsInstances[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, DiscoverRDSResponseValidationError{ - field: fmt.Sprintf("RdsInstances[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return DiscoverRDSResponseValidationError{ - field: fmt.Sprintf("RdsInstances[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - if len(errors) > 0 { - return DiscoverRDSResponseMultiError(errors) - } - - return nil -} - -// DiscoverRDSResponseMultiError is an error wrapping multiple validation -// errors returned by DiscoverRDSResponse.ValidateAll() if the designated -// constraints aren't met. -type DiscoverRDSResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m DiscoverRDSResponseMultiError) 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 DiscoverRDSResponseMultiError) AllErrors() []error { return m } - -// DiscoverRDSResponseValidationError is the validation error returned by -// DiscoverRDSResponse.Validate if the designated constraints aren't met. -type DiscoverRDSResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e DiscoverRDSResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e DiscoverRDSResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e DiscoverRDSResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e DiscoverRDSResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e DiscoverRDSResponseValidationError) ErrorName() string { - return "DiscoverRDSResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e DiscoverRDSResponseValidationError) 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 %sDiscoverRDSResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = DiscoverRDSResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = DiscoverRDSResponseValidationError{} - -// Validate checks the field values on AddRDSServiceParams 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 *AddRDSServiceParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on AddRDSServiceParams 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 -// AddRDSServiceParamsMultiError, or nil if none found. -func (m *AddRDSServiceParams) ValidateAll() error { - return m.validate(true) -} - -func (m *AddRDSServiceParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetRegion()) < 1 { - err := AddRDSServiceParamsValidationError{ - field: "Region", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for Az - - if utf8.RuneCountInString(m.GetInstanceId()) < 1 { - err := AddRDSServiceParamsValidationError{ - field: "InstanceId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for NodeModel - - if utf8.RuneCountInString(m.GetAddress()) < 1 { - err := AddRDSServiceParamsValidationError{ - field: "Address", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if m.GetPort() <= 0 { - err := AddRDSServiceParamsValidationError{ - field: "Port", - reason: "value must be greater than 0", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for Engine - - // no validation rules for PmmAgentId - - // no validation rules for NodeName - - // no validation rules for ServiceName - - // no validation rules for Environment - - // no validation rules for Cluster - - // no validation rules for ReplicationSet - - if utf8.RuneCountInString(m.GetUsername()) < 1 { - err := AddRDSServiceParamsValidationError{ - field: "Username", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for Password - - // no validation rules for AwsAccessKey - - // no validation rules for AwsSecretKey - - // no validation rules for RdsExporter - - // no validation rules for QanMysqlPerfschema - - // no validation rules for CustomLabels - - // no validation rules for SkipConnectionCheck - - // no validation rules for Tls - - // no validation rules for TlsSkipVerify - - // no validation rules for DisableQueryExamples - - // no validation rules for TablestatsGroupTableLimit - - // no validation rules for DisableBasicMetrics - - // no validation rules for DisableEnhancedMetrics - - // no validation rules for MetricsMode - - // no validation rules for QanPostgresqlPgstatements - - // no validation rules for AgentPassword - - // no validation rules for Database - - // no validation rules for AutoDiscoveryLimit - - // no validation rules for DisableCommentsParsing - - // no validation rules for MaxPostgresqlExporterConnections - - if len(errors) > 0 { - return AddRDSServiceParamsMultiError(errors) - } - - return nil -} - -// AddRDSServiceParamsMultiError is an error wrapping multiple validation -// errors returned by AddRDSServiceParams.ValidateAll() if the designated -// constraints aren't met. -type AddRDSServiceParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m AddRDSServiceParamsMultiError) 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 AddRDSServiceParamsMultiError) AllErrors() []error { return m } - -// AddRDSServiceParamsValidationError is the validation error returned by -// AddRDSServiceParams.Validate if the designated constraints aren't met. -type AddRDSServiceParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e AddRDSServiceParamsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e AddRDSServiceParamsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e AddRDSServiceParamsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e AddRDSServiceParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e AddRDSServiceParamsValidationError) ErrorName() string { - return "AddRDSServiceParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e AddRDSServiceParamsValidationError) 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 %sAddRDSServiceParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = AddRDSServiceParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = AddRDSServiceParamsValidationError{} - -// Validate checks the field values on RDSServiceResult 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 *RDSServiceResult) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on RDSServiceResult 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 -// RDSServiceResultMultiError, or nil if none found. -func (m *RDSServiceResult) ValidateAll() error { - return m.validate(true) -} - -func (m *RDSServiceResult) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if all { - switch v := interface{}(m.GetNode()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, RDSServiceResultValidationError{ - field: "Node", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, RDSServiceResultValidationError{ - field: "Node", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetNode()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return RDSServiceResultValidationError{ - field: "Node", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetRdsExporter()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, RDSServiceResultValidationError{ - field: "RdsExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, RDSServiceResultValidationError{ - field: "RdsExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetRdsExporter()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return RDSServiceResultValidationError{ - field: "RdsExporter", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetMysql()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, RDSServiceResultValidationError{ - field: "Mysql", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, RDSServiceResultValidationError{ - field: "Mysql", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMysql()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return RDSServiceResultValidationError{ - field: "Mysql", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetMysqldExporter()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, RDSServiceResultValidationError{ - field: "MysqldExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, RDSServiceResultValidationError{ - field: "MysqldExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMysqldExporter()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return RDSServiceResultValidationError{ - field: "MysqldExporter", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetQanMysqlPerfschema()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, RDSServiceResultValidationError{ - field: "QanMysqlPerfschema", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, RDSServiceResultValidationError{ - field: "QanMysqlPerfschema", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetQanMysqlPerfschema()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return RDSServiceResultValidationError{ - field: "QanMysqlPerfschema", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetPostgresql()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, RDSServiceResultValidationError{ - field: "Postgresql", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, RDSServiceResultValidationError{ - field: "Postgresql", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetPostgresql()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return RDSServiceResultValidationError{ - field: "Postgresql", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetPostgresqlExporter()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, RDSServiceResultValidationError{ - field: "PostgresqlExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, RDSServiceResultValidationError{ - field: "PostgresqlExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetPostgresqlExporter()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return RDSServiceResultValidationError{ - field: "PostgresqlExporter", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetQanPostgresqlPgstatements()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, RDSServiceResultValidationError{ - field: "QanPostgresqlPgstatements", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, RDSServiceResultValidationError{ - field: "QanPostgresqlPgstatements", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetQanPostgresqlPgstatements()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return RDSServiceResultValidationError{ - field: "QanPostgresqlPgstatements", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if len(errors) > 0 { - return RDSServiceResultMultiError(errors) - } - - return nil -} - -// RDSServiceResultMultiError is an error wrapping multiple validation errors -// returned by RDSServiceResult.ValidateAll() if the designated constraints -// aren't met. -type RDSServiceResultMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m RDSServiceResultMultiError) 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 RDSServiceResultMultiError) AllErrors() []error { return m } - -// RDSServiceResultValidationError is the validation error returned by -// RDSServiceResult.Validate if the designated constraints aren't met. -type RDSServiceResultValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e RDSServiceResultValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e RDSServiceResultValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e RDSServiceResultValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e RDSServiceResultValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e RDSServiceResultValidationError) ErrorName() string { return "RDSServiceResultValidationError" } - -// Error satisfies the builtin error interface -func (e RDSServiceResultValidationError) 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 %sRDSServiceResult.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = RDSServiceResultValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = RDSServiceResultValidationError{} diff --git a/api/management/v1/service.pb.go b/api/management/v1/service.pb.go deleted file mode 100644 index f5c68ced0ac..00000000000 --- a/api/management/v1/service.pb.go +++ /dev/null @@ -1,1122 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.10 -// protoc (unknown) -// source: management/v1/service.proto - -package managementv1 - -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" - - v1 "github.com/percona/pmm/api/inventory/v1" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// Service status. -type UniversalService_Status int32 - -const ( - // In case we don't support the db vendor yet. - UniversalService_STATUS_UNSPECIFIED UniversalService_Status = 0 - // The service is up. - UniversalService_STATUS_UP UniversalService_Status = 1 - // The service is down. - UniversalService_STATUS_DOWN UniversalService_Status = 2 - // The service's status cannot be known (e.g. there are no metrics yet). - UniversalService_STATUS_UNKNOWN UniversalService_Status = 3 -) - -// Enum value maps for UniversalService_Status. -var ( - UniversalService_Status_name = map[int32]string{ - 0: "STATUS_UNSPECIFIED", - 1: "STATUS_UP", - 2: "STATUS_DOWN", - 3: "STATUS_UNKNOWN", - } - UniversalService_Status_value = map[string]int32{ - "STATUS_UNSPECIFIED": 0, - "STATUS_UP": 1, - "STATUS_DOWN": 2, - "STATUS_UNKNOWN": 3, - } -) - -func (x UniversalService_Status) Enum() *UniversalService_Status { - p := new(UniversalService_Status) - *p = x - return p -} - -func (x UniversalService_Status) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (UniversalService_Status) Descriptor() protoreflect.EnumDescriptor { - return file_management_v1_service_proto_enumTypes[0].Descriptor() -} - -func (UniversalService_Status) Type() protoreflect.EnumType { - return &file_management_v1_service_proto_enumTypes[0] -} - -func (x UniversalService_Status) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use UniversalService_Status.Descriptor instead. -func (UniversalService_Status) EnumDescriptor() ([]byte, []int) { - return file_management_v1_service_proto_rawDescGZIP(), []int{4, 0} -} - -type AddServiceRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Service: - // - // *AddServiceRequest_Mysql - // *AddServiceRequest_Mongodb - // *AddServiceRequest_Postgresql - // *AddServiceRequest_Proxysql - // *AddServiceRequest_Haproxy - // *AddServiceRequest_External - // *AddServiceRequest_Rds - // *AddServiceRequest_Valkey - Service isAddServiceRequest_Service `protobuf_oneof:"service"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AddServiceRequest) Reset() { - *x = AddServiceRequest{} - mi := &file_management_v1_service_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AddServiceRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddServiceRequest) ProtoMessage() {} - -func (x *AddServiceRequest) ProtoReflect() protoreflect.Message { - mi := &file_management_v1_service_proto_msgTypes[0] - 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 AddServiceRequest.ProtoReflect.Descriptor instead. -func (*AddServiceRequest) Descriptor() ([]byte, []int) { - return file_management_v1_service_proto_rawDescGZIP(), []int{0} -} - -func (x *AddServiceRequest) GetService() isAddServiceRequest_Service { - if x != nil { - return x.Service - } - return nil -} - -func (x *AddServiceRequest) GetMysql() *AddMySQLServiceParams { - if x != nil { - if x, ok := x.Service.(*AddServiceRequest_Mysql); ok { - return x.Mysql - } - } - return nil -} - -func (x *AddServiceRequest) GetMongodb() *AddMongoDBServiceParams { - if x != nil { - if x, ok := x.Service.(*AddServiceRequest_Mongodb); ok { - return x.Mongodb - } - } - return nil -} - -func (x *AddServiceRequest) GetPostgresql() *AddPostgreSQLServiceParams { - if x != nil { - if x, ok := x.Service.(*AddServiceRequest_Postgresql); ok { - return x.Postgresql - } - } - return nil -} - -func (x *AddServiceRequest) GetProxysql() *AddProxySQLServiceParams { - if x != nil { - if x, ok := x.Service.(*AddServiceRequest_Proxysql); ok { - return x.Proxysql - } - } - return nil -} - -func (x *AddServiceRequest) GetHaproxy() *AddHAProxyServiceParams { - if x != nil { - if x, ok := x.Service.(*AddServiceRequest_Haproxy); ok { - return x.Haproxy - } - } - return nil -} - -func (x *AddServiceRequest) GetExternal() *AddExternalServiceParams { - if x != nil { - if x, ok := x.Service.(*AddServiceRequest_External); ok { - return x.External - } - } - return nil -} - -func (x *AddServiceRequest) GetRds() *AddRDSServiceParams { - if x != nil { - if x, ok := x.Service.(*AddServiceRequest_Rds); ok { - return x.Rds - } - } - return nil -} - -func (x *AddServiceRequest) GetValkey() *AddValkeyServiceParams { - if x != nil { - if x, ok := x.Service.(*AddServiceRequest_Valkey); ok { - return x.Valkey - } - } - return nil -} - -type isAddServiceRequest_Service interface { - isAddServiceRequest_Service() -} - -type AddServiceRequest_Mysql struct { - Mysql *AddMySQLServiceParams `protobuf:"bytes,1,opt,name=mysql,proto3,oneof"` -} - -type AddServiceRequest_Mongodb struct { - Mongodb *AddMongoDBServiceParams `protobuf:"bytes,2,opt,name=mongodb,proto3,oneof"` -} - -type AddServiceRequest_Postgresql struct { - Postgresql *AddPostgreSQLServiceParams `protobuf:"bytes,3,opt,name=postgresql,proto3,oneof"` -} - -type AddServiceRequest_Proxysql struct { - Proxysql *AddProxySQLServiceParams `protobuf:"bytes,4,opt,name=proxysql,proto3,oneof"` -} - -type AddServiceRequest_Haproxy struct { - Haproxy *AddHAProxyServiceParams `protobuf:"bytes,5,opt,name=haproxy,proto3,oneof"` -} - -type AddServiceRequest_External struct { - External *AddExternalServiceParams `protobuf:"bytes,6,opt,name=external,proto3,oneof"` -} - -type AddServiceRequest_Rds struct { - Rds *AddRDSServiceParams `protobuf:"bytes,7,opt,name=rds,proto3,oneof"` -} - -type AddServiceRequest_Valkey struct { - Valkey *AddValkeyServiceParams `protobuf:"bytes,8,opt,name=valkey,proto3,oneof"` -} - -func (*AddServiceRequest_Mysql) isAddServiceRequest_Service() {} - -func (*AddServiceRequest_Mongodb) isAddServiceRequest_Service() {} - -func (*AddServiceRequest_Postgresql) isAddServiceRequest_Service() {} - -func (*AddServiceRequest_Proxysql) isAddServiceRequest_Service() {} - -func (*AddServiceRequest_Haproxy) isAddServiceRequest_Service() {} - -func (*AddServiceRequest_External) isAddServiceRequest_Service() {} - -func (*AddServiceRequest_Rds) isAddServiceRequest_Service() {} - -func (*AddServiceRequest_Valkey) isAddServiceRequest_Service() {} - -type AddServiceResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Service: - // - // *AddServiceResponse_Mysql - // *AddServiceResponse_Mongodb - // *AddServiceResponse_Postgresql - // *AddServiceResponse_Proxysql - // *AddServiceResponse_Haproxy - // *AddServiceResponse_External - // *AddServiceResponse_Rds - // *AddServiceResponse_Valkey - Service isAddServiceResponse_Service `protobuf_oneof:"service"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AddServiceResponse) Reset() { - *x = AddServiceResponse{} - mi := &file_management_v1_service_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AddServiceResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddServiceResponse) ProtoMessage() {} - -func (x *AddServiceResponse) ProtoReflect() protoreflect.Message { - mi := &file_management_v1_service_proto_msgTypes[1] - 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 AddServiceResponse.ProtoReflect.Descriptor instead. -func (*AddServiceResponse) Descriptor() ([]byte, []int) { - return file_management_v1_service_proto_rawDescGZIP(), []int{1} -} - -func (x *AddServiceResponse) GetService() isAddServiceResponse_Service { - if x != nil { - return x.Service - } - return nil -} - -func (x *AddServiceResponse) GetMysql() *MySQLServiceResult { - if x != nil { - if x, ok := x.Service.(*AddServiceResponse_Mysql); ok { - return x.Mysql - } - } - return nil -} - -func (x *AddServiceResponse) GetMongodb() *MongoDBServiceResult { - if x != nil { - if x, ok := x.Service.(*AddServiceResponse_Mongodb); ok { - return x.Mongodb - } - } - return nil -} - -func (x *AddServiceResponse) GetPostgresql() *PostgreSQLServiceResult { - if x != nil { - if x, ok := x.Service.(*AddServiceResponse_Postgresql); ok { - return x.Postgresql - } - } - return nil -} - -func (x *AddServiceResponse) GetProxysql() *ProxySQLServiceResult { - if x != nil { - if x, ok := x.Service.(*AddServiceResponse_Proxysql); ok { - return x.Proxysql - } - } - return nil -} - -func (x *AddServiceResponse) GetHaproxy() *HAProxyServiceResult { - if x != nil { - if x, ok := x.Service.(*AddServiceResponse_Haproxy); ok { - return x.Haproxy - } - } - return nil -} - -func (x *AddServiceResponse) GetExternal() *ExternalServiceResult { - if x != nil { - if x, ok := x.Service.(*AddServiceResponse_External); ok { - return x.External - } - } - return nil -} - -func (x *AddServiceResponse) GetRds() *RDSServiceResult { - if x != nil { - if x, ok := x.Service.(*AddServiceResponse_Rds); ok { - return x.Rds - } - } - return nil -} - -func (x *AddServiceResponse) GetValkey() *ValkeyServiceResult { - if x != nil { - if x, ok := x.Service.(*AddServiceResponse_Valkey); ok { - return x.Valkey - } - } - return nil -} - -type isAddServiceResponse_Service interface { - isAddServiceResponse_Service() -} - -type AddServiceResponse_Mysql struct { - Mysql *MySQLServiceResult `protobuf:"bytes,1,opt,name=mysql,proto3,oneof"` -} - -type AddServiceResponse_Mongodb struct { - Mongodb *MongoDBServiceResult `protobuf:"bytes,2,opt,name=mongodb,proto3,oneof"` -} - -type AddServiceResponse_Postgresql struct { - Postgresql *PostgreSQLServiceResult `protobuf:"bytes,3,opt,name=postgresql,proto3,oneof"` -} - -type AddServiceResponse_Proxysql struct { - Proxysql *ProxySQLServiceResult `protobuf:"bytes,4,opt,name=proxysql,proto3,oneof"` -} - -type AddServiceResponse_Haproxy struct { - Haproxy *HAProxyServiceResult `protobuf:"bytes,5,opt,name=haproxy,proto3,oneof"` -} - -type AddServiceResponse_External struct { - External *ExternalServiceResult `protobuf:"bytes,6,opt,name=external,proto3,oneof"` -} - -type AddServiceResponse_Rds struct { - Rds *RDSServiceResult `protobuf:"bytes,7,opt,name=rds,proto3,oneof"` -} - -type AddServiceResponse_Valkey struct { - Valkey *ValkeyServiceResult `protobuf:"bytes,8,opt,name=valkey,proto3,oneof"` -} - -func (*AddServiceResponse_Mysql) isAddServiceResponse_Service() {} - -func (*AddServiceResponse_Mongodb) isAddServiceResponse_Service() {} - -func (*AddServiceResponse_Postgresql) isAddServiceResponse_Service() {} - -func (*AddServiceResponse_Proxysql) isAddServiceResponse_Service() {} - -func (*AddServiceResponse_Haproxy) isAddServiceResponse_Service() {} - -func (*AddServiceResponse_External) isAddServiceResponse_Service() {} - -func (*AddServiceResponse_Rds) isAddServiceResponse_Service() {} - -func (*AddServiceResponse_Valkey) isAddServiceResponse_Service() {} - -type RemoveServiceRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Either a Service ID or a Service Name. - ServiceId string `protobuf:"bytes,1,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` - // Service type. - ServiceType v1.ServiceType `protobuf:"varint,2,opt,name=service_type,json=serviceType,proto3,enum=inventory.v1.ServiceType" json:"service_type,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *RemoveServiceRequest) Reset() { - *x = RemoveServiceRequest{} - mi := &file_management_v1_service_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *RemoveServiceRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RemoveServiceRequest) ProtoMessage() {} - -func (x *RemoveServiceRequest) ProtoReflect() protoreflect.Message { - mi := &file_management_v1_service_proto_msgTypes[2] - 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 RemoveServiceRequest.ProtoReflect.Descriptor instead. -func (*RemoveServiceRequest) Descriptor() ([]byte, []int) { - return file_management_v1_service_proto_rawDescGZIP(), []int{2} -} - -func (x *RemoveServiceRequest) GetServiceId() string { - if x != nil { - return x.ServiceId - } - return "" -} - -func (x *RemoveServiceRequest) GetServiceType() v1.ServiceType { - if x != nil { - return x.ServiceType - } - return v1.ServiceType(0) -} - -type RemoveServiceResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *RemoveServiceResponse) Reset() { - *x = RemoveServiceResponse{} - mi := &file_management_v1_service_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *RemoveServiceResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RemoveServiceResponse) ProtoMessage() {} - -func (x *RemoveServiceResponse) ProtoReflect() protoreflect.Message { - mi := &file_management_v1_service_proto_msgTypes[3] - 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 RemoveServiceResponse.ProtoReflect.Descriptor instead. -func (*RemoveServiceResponse) Descriptor() ([]byte, []int) { - return file_management_v1_service_proto_rawDescGZIP(), []int{3} -} - -type UniversalService struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Unique service identifier. - ServiceId string `protobuf:"bytes,1,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` - // Service type. - ServiceType string `protobuf:"bytes,2,opt,name=service_type,json=serviceType,proto3" json:"service_type,omitempty"` - // User-defined name unique across all Services. - ServiceName string `protobuf:"bytes,3,opt,name=service_name,json=serviceName,proto3" json:"service_name,omitempty"` - // Database name. - DatabaseName string `protobuf:"bytes,4,opt,name=database_name,json=databaseName,proto3" json:"database_name,omitempty"` - // Node identifier where this instance runs. - NodeId string `protobuf:"bytes,5,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` - // Node name where this instance runs. - NodeName string `protobuf:"bytes,6,opt,name=node_name,json=nodeName,proto3" json:"node_name,omitempty"` - // Environment name. - Environment string `protobuf:"bytes,7,opt,name=environment,proto3" json:"environment,omitempty"` - // Cluster name. - Cluster string `protobuf:"bytes,8,opt,name=cluster,proto3" json:"cluster,omitempty"` - // Replication set name. - ReplicationSet string `protobuf:"bytes,9,opt,name=replication_set,json=replicationSet,proto3" json:"replication_set,omitempty"` - // Custom user-assigned labels for Service. - CustomLabels map[string]string `protobuf:"bytes,10,rep,name=custom_labels,json=customLabels,proto3" json:"custom_labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - // External group name. - ExternalGroup string `protobuf:"bytes,11,opt,name=external_group,json=externalGroup,proto3" json:"external_group,omitempty"` - // Access address (DNS name or IP). - // Address (and port) or socket is required. - Address string `protobuf:"bytes,12,opt,name=address,proto3" json:"address,omitempty"` - // Access port. - // Port is required when the address present. - Port uint32 `protobuf:"varint,13,opt,name=port,proto3" json:"port,omitempty"` - // Access unix socket. - // Address (and port) or socket is required. - Socket string `protobuf:"bytes,14,opt,name=socket,proto3" json:"socket,omitempty"` - // Creation timestamp. - CreatedAt *timestamppb.Timestamp `protobuf:"bytes,15,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` - // Last update timestamp. - UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,16,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` - // List of agents related to this service. - Agents []*UniversalAgent `protobuf:"bytes,17,rep,name=agents,proto3" json:"agents,omitempty"` - // The health status of the service. - Status UniversalService_Status `protobuf:"varint,18,opt,name=status,proto3,enum=management.v1.UniversalService_Status" json:"status,omitempty"` - // The service/database version. - Version string `protobuf:"bytes,19,opt,name=version,proto3" json:"version,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *UniversalService) Reset() { - *x = UniversalService{} - mi := &file_management_v1_service_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *UniversalService) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UniversalService) ProtoMessage() {} - -func (x *UniversalService) ProtoReflect() protoreflect.Message { - mi := &file_management_v1_service_proto_msgTypes[4] - 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 UniversalService.ProtoReflect.Descriptor instead. -func (*UniversalService) Descriptor() ([]byte, []int) { - return file_management_v1_service_proto_rawDescGZIP(), []int{4} -} - -func (x *UniversalService) GetServiceId() string { - if x != nil { - return x.ServiceId - } - return "" -} - -func (x *UniversalService) GetServiceType() string { - if x != nil { - return x.ServiceType - } - return "" -} - -func (x *UniversalService) GetServiceName() string { - if x != nil { - return x.ServiceName - } - return "" -} - -func (x *UniversalService) GetDatabaseName() string { - if x != nil { - return x.DatabaseName - } - return "" -} - -func (x *UniversalService) GetNodeId() string { - if x != nil { - return x.NodeId - } - return "" -} - -func (x *UniversalService) GetNodeName() string { - if x != nil { - return x.NodeName - } - return "" -} - -func (x *UniversalService) GetEnvironment() string { - if x != nil { - return x.Environment - } - return "" -} - -func (x *UniversalService) GetCluster() string { - if x != nil { - return x.Cluster - } - return "" -} - -func (x *UniversalService) GetReplicationSet() string { - if x != nil { - return x.ReplicationSet - } - return "" -} - -func (x *UniversalService) GetCustomLabels() map[string]string { - if x != nil { - return x.CustomLabels - } - return nil -} - -func (x *UniversalService) GetExternalGroup() string { - if x != nil { - return x.ExternalGroup - } - return "" -} - -func (x *UniversalService) GetAddress() string { - if x != nil { - return x.Address - } - return "" -} - -func (x *UniversalService) GetPort() uint32 { - if x != nil { - return x.Port - } - return 0 -} - -func (x *UniversalService) GetSocket() string { - if x != nil { - return x.Socket - } - return "" -} - -func (x *UniversalService) GetCreatedAt() *timestamppb.Timestamp { - if x != nil { - return x.CreatedAt - } - return nil -} - -func (x *UniversalService) GetUpdatedAt() *timestamppb.Timestamp { - if x != nil { - return x.UpdatedAt - } - return nil -} - -func (x *UniversalService) GetAgents() []*UniversalAgent { - if x != nil { - return x.Agents - } - return nil -} - -func (x *UniversalService) GetStatus() UniversalService_Status { - if x != nil { - return x.Status - } - return UniversalService_STATUS_UNSPECIFIED -} - -func (x *UniversalService) GetVersion() string { - if x != nil { - return x.Version - } - return "" -} - -type ListServicesRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Return only Services running on that Node. - NodeId string `protobuf:"bytes,1,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` - // Return only services filtered by service type. - ServiceType v1.ServiceType `protobuf:"varint,2,opt,name=service_type,json=serviceType,proto3,enum=inventory.v1.ServiceType" json:"service_type,omitempty"` - // Return only services in this external group. - ExternalGroup string `protobuf:"bytes,3,opt,name=external_group,json=externalGroup,proto3" json:"external_group,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ListServicesRequest) Reset() { - *x = ListServicesRequest{} - mi := &file_management_v1_service_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ListServicesRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListServicesRequest) ProtoMessage() {} - -func (x *ListServicesRequest) ProtoReflect() protoreflect.Message { - mi := &file_management_v1_service_proto_msgTypes[5] - 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 ListServicesRequest.ProtoReflect.Descriptor instead. -func (*ListServicesRequest) Descriptor() ([]byte, []int) { - return file_management_v1_service_proto_rawDescGZIP(), []int{5} -} - -func (x *ListServicesRequest) GetNodeId() string { - if x != nil { - return x.NodeId - } - return "" -} - -func (x *ListServicesRequest) GetServiceType() v1.ServiceType { - if x != nil { - return x.ServiceType - } - return v1.ServiceType(0) -} - -func (x *ListServicesRequest) GetExternalGroup() string { - if x != nil { - return x.ExternalGroup - } - return "" -} - -type ListServicesResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // List of Services. - Services []*UniversalService `protobuf:"bytes,1,rep,name=services,proto3" json:"services,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ListServicesResponse) Reset() { - *x = ListServicesResponse{} - mi := &file_management_v1_service_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ListServicesResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListServicesResponse) ProtoMessage() {} - -func (x *ListServicesResponse) ProtoReflect() protoreflect.Message { - mi := &file_management_v1_service_proto_msgTypes[6] - 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 ListServicesResponse.ProtoReflect.Descriptor instead. -func (*ListServicesResponse) Descriptor() ([]byte, []int) { - return file_management_v1_service_proto_rawDescGZIP(), []int{6} -} - -func (x *ListServicesResponse) GetServices() []*UniversalService { - if x != nil { - return x.Services - } - return nil -} - -var File_management_v1_service_proto protoreflect.FileDescriptor - -const file_management_v1_service_proto_rawDesc = "" + - "\n" + - "\x1bmanagement/v1/service.proto\x12\rmanagement.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1binventory/v1/services.proto\x1a\x19management/v1/agent.proto\x1a\x1emanagement/v1/annotation.proto\x1a\x19management/v1/azure.proto\x1a\x1cmanagement/v1/external.proto\x1a\x1bmanagement/v1/haproxy.proto\x1a\x1bmanagement/v1/mongodb.proto\x1a\x19management/v1/mysql.proto\x1a\x18management/v1/node.proto\x1a\x1emanagement/v1/postgresql.proto\x1a\x1cmanagement/v1/proxysql.proto\x1a\x17management/v1/rds.proto\x1a\x1amanagement/v1/valkey.proto\x1a.protoc-gen-openapiv2/options/annotations.proto\"\xb8\x04\n" + - "\x11AddServiceRequest\x12<\n" + - "\x05mysql\x18\x01 \x01(\v2$.management.v1.AddMySQLServiceParamsH\x00R\x05mysql\x12B\n" + - "\amongodb\x18\x02 \x01(\v2&.management.v1.AddMongoDBServiceParamsH\x00R\amongodb\x12K\n" + - "\n" + - "postgresql\x18\x03 \x01(\v2).management.v1.AddPostgreSQLServiceParamsH\x00R\n" + - "postgresql\x12E\n" + - "\bproxysql\x18\x04 \x01(\v2'.management.v1.AddProxySQLServiceParamsH\x00R\bproxysql\x12B\n" + - "\ahaproxy\x18\x05 \x01(\v2&.management.v1.AddHAProxyServiceParamsH\x00R\ahaproxy\x12E\n" + - "\bexternal\x18\x06 \x01(\v2'.management.v1.AddExternalServiceParamsH\x00R\bexternal\x126\n" + - "\x03rds\x18\a \x01(\v2\".management.v1.AddRDSServiceParamsH\x00R\x03rds\x12?\n" + - "\x06valkey\x18\b \x01(\v2%.management.v1.AddValkeyServiceParamsH\x00R\x06valkeyB\t\n" + - "\aservice\"\xa1\x04\n" + - "\x12AddServiceResponse\x129\n" + - "\x05mysql\x18\x01 \x01(\v2!.management.v1.MySQLServiceResultH\x00R\x05mysql\x12?\n" + - "\amongodb\x18\x02 \x01(\v2#.management.v1.MongoDBServiceResultH\x00R\amongodb\x12H\n" + - "\n" + - "postgresql\x18\x03 \x01(\v2&.management.v1.PostgreSQLServiceResultH\x00R\n" + - "postgresql\x12B\n" + - "\bproxysql\x18\x04 \x01(\v2$.management.v1.ProxySQLServiceResultH\x00R\bproxysql\x12?\n" + - "\ahaproxy\x18\x05 \x01(\v2#.management.v1.HAProxyServiceResultH\x00R\ahaproxy\x12B\n" + - "\bexternal\x18\x06 \x01(\v2$.management.v1.ExternalServiceResultH\x00R\bexternal\x123\n" + - "\x03rds\x18\a \x01(\v2\x1f.management.v1.RDSServiceResultH\x00R\x03rds\x12<\n" + - "\x06valkey\x18\b \x01(\v2\".management.v1.ValkeyServiceResultH\x00R\x06valkeyB\t\n" + - "\aservice\"s\n" + - "\x14RemoveServiceRequest\x12\x1d\n" + - "\n" + - "service_id\x18\x01 \x01(\tR\tserviceId\x12<\n" + - "\fservice_type\x18\x02 \x01(\x0e2\x19.inventory.v1.ServiceTypeR\vserviceType\"\x17\n" + - "\x15RemoveServiceResponse\"\x9a\a\n" + - "\x10UniversalService\x12\x1d\n" + - "\n" + - "service_id\x18\x01 \x01(\tR\tserviceId\x12!\n" + - "\fservice_type\x18\x02 \x01(\tR\vserviceType\x12!\n" + - "\fservice_name\x18\x03 \x01(\tR\vserviceName\x12#\n" + - "\rdatabase_name\x18\x04 \x01(\tR\fdatabaseName\x12\x17\n" + - "\anode_id\x18\x05 \x01(\tR\x06nodeId\x12\x1b\n" + - "\tnode_name\x18\x06 \x01(\tR\bnodeName\x12 \n" + - "\venvironment\x18\a \x01(\tR\venvironment\x12\x18\n" + - "\acluster\x18\b \x01(\tR\acluster\x12'\n" + - "\x0freplication_set\x18\t \x01(\tR\x0ereplicationSet\x12V\n" + - "\rcustom_labels\x18\n" + - " \x03(\v21.management.v1.UniversalService.CustomLabelsEntryR\fcustomLabels\x12%\n" + - "\x0eexternal_group\x18\v \x01(\tR\rexternalGroup\x12\x18\n" + - "\aaddress\x18\f \x01(\tR\aaddress\x12\x12\n" + - "\x04port\x18\r \x01(\rR\x04port\x12\x16\n" + - "\x06socket\x18\x0e \x01(\tR\x06socket\x129\n" + - "\n" + - "created_at\x18\x0f \x01(\v2\x1a.google.protobuf.TimestampR\tcreatedAt\x129\n" + - "\n" + - "updated_at\x18\x10 \x01(\v2\x1a.google.protobuf.TimestampR\tupdatedAt\x125\n" + - "\x06agents\x18\x11 \x03(\v2\x1d.management.v1.UniversalAgentR\x06agents\x12>\n" + - "\x06status\x18\x12 \x01(\x0e2&.management.v1.UniversalService.StatusR\x06status\x12\x18\n" + - "\aversion\x18\x13 \x01(\tR\aversion\x1a?\n" + - "\x11CustomLabelsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"T\n" + - "\x06Status\x12\x16\n" + - "\x12STATUS_UNSPECIFIED\x10\x00\x12\r\n" + - "\tSTATUS_UP\x10\x01\x12\x0f\n" + - "\vSTATUS_DOWN\x10\x02\x12\x12\n" + - "\x0eSTATUS_UNKNOWN\x10\x03\"\x93\x01\n" + - "\x13ListServicesRequest\x12\x17\n" + - "\anode_id\x18\x01 \x01(\tR\x06nodeId\x12<\n" + - "\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" + - "\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" + - "ListAgents\x12 .management.v1.ListAgentsRequest\x1a!.management.v1.ListAgentsResponse\"H\x92A(\x12\vList Agents\x1a\x19Lists Agents with filter.\x82\xd3\xe4\x93\x02\x17\x12\x15/v1/management/agents\x12\xd7\x01\n" + - "\x11ListAgentVersions\x12'.management.v1.ListAgentVersionsRequest\x1a(.management.v1.ListAgentVersionsResponse\"o\x92AF\x12\x13List Agent Versions\x1a/Lists Agent versions and their update severity.\x82\xd3\xe4\x93\x02 \x12\x1e/v1/management/agents/versions\x12\xb3\x01\n" + - "\fRegisterNode\x12\".management.v1.RegisterNodeRequest\x1a#.management.v1.RegisterNodeResponse\"Z\x92A8\x12\x0fRegister a Node\x1a%Registers a new Node and a pmm-agent.\x82\xd3\xe4\x93\x02\x19:\x01*\"\x14/v1/management/nodes\x12\xbd\x01\n" + - "\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" + - "\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" + - "\vDiscoverRDS\x12!.management.v1.DiscoverRDSRequest\x1a\".management.v1.DiscoverRDSResponse\"Y\x92A(\x12\fDiscover RDS\x1a\x18Discovers RDS instances.\x82\xd3\xe4\x93\x02(:\x01*\"#/v1/management/services:discoverRDS\x12\x8f\x02\n" + - "\x15DiscoverAzureDatabase\x12+.management.v1.DiscoverAzureDatabaseRequest\x1a,.management.v1.DiscoverAzureDatabaseResponse\"\x9a\x01\x92Ag\x12\x17Discover Azure Database\x1aLDiscovers Azure Database for MySQL, MariaDB and PostgreSQL Server instances.\x82\xd3\xe4\x93\x02*:\x01*\"%/v1/management/services:discoverAzure\x12\xc6\x01\n" + - "\x10AddAzureDatabase\x12&.management.v1.AddAzureDatabaseRequest\x1a'.management.v1.AddAzureDatabaseResponse\"a\x92A6\x12\x12Add Azure Database\x1a Adds an Azure Database instance.\x82\xd3\xe4\x93\x02\":\x01*\"\x1d/v1/management/services/azure\x12\xc7\x01\n" + - "\rRemoveService\x12#.management.v1.RemoveServiceRequest\x1a$.management.v1.RemoveServiceResponse\"k\x92A<\x12\x10Remove a Service\x1a(Removes a Service along with its Agents.\x82\xd3\xe4\x93\x02&*$/v1/management/services/{service_id}B\xad\x01\n" + - "\x11com.management.v1B\fServiceProtoP\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 ( - file_management_v1_service_proto_rawDescOnce sync.Once - file_management_v1_service_proto_rawDescData []byte -) - -func file_management_v1_service_proto_rawDescGZIP() []byte { - file_management_v1_service_proto_rawDescOnce.Do(func() { - file_management_v1_service_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_management_v1_service_proto_rawDesc), len(file_management_v1_service_proto_rawDesc))) - }) - 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_depIdxs = []int32{ - 9, // 0: management.v1.AddServiceRequest.mysql:type_name -> management.v1.AddMySQLServiceParams - 10, // 1: management.v1.AddServiceRequest.mongodb:type_name -> management.v1.AddMongoDBServiceParams - 11, // 2: management.v1.AddServiceRequest.postgresql:type_name -> management.v1.AddPostgreSQLServiceParams - 12, // 3: management.v1.AddServiceRequest.proxysql:type_name -> management.v1.AddProxySQLServiceParams - 13, // 4: management.v1.AddServiceRequest.haproxy:type_name -> management.v1.AddHAProxyServiceParams - 14, // 5: management.v1.AddServiceRequest.external:type_name -> management.v1.AddExternalServiceParams - 15, // 6: management.v1.AddServiceRequest.rds:type_name -> management.v1.AddRDSServiceParams - 16, // 7: management.v1.AddServiceRequest.valkey:type_name -> management.v1.AddValkeyServiceParams - 17, // 8: management.v1.AddServiceResponse.mysql:type_name -> management.v1.MySQLServiceResult - 18, // 9: management.v1.AddServiceResponse.mongodb:type_name -> management.v1.MongoDBServiceResult - 19, // 10: management.v1.AddServiceResponse.postgresql:type_name -> management.v1.PostgreSQLServiceResult - 20, // 11: management.v1.AddServiceResponse.proxysql:type_name -> management.v1.ProxySQLServiceResult - 21, // 12: management.v1.AddServiceResponse.haproxy:type_name -> management.v1.HAProxyServiceResult - 22, // 13: management.v1.AddServiceResponse.external:type_name -> management.v1.ExternalServiceResult - 23, // 14: management.v1.AddServiceResponse.rds:type_name -> management.v1.RDSServiceResult - 24, // 15: management.v1.AddServiceResponse.valkey:type_name -> management.v1.ValkeyServiceResult - 25, // 16: management.v1.RemoveServiceRequest.service_type:type_name -> inventory.v1.ServiceType - 8, // 17: management.v1.UniversalService.custom_labels:type_name -> management.v1.UniversalService.CustomLabelsEntry - 26, // 18: management.v1.UniversalService.created_at:type_name -> google.protobuf.Timestamp - 26, // 19: management.v1.UniversalService.updated_at:type_name -> google.protobuf.Timestamp - 27, // 20: management.v1.UniversalService.agents:type_name -> management.v1.UniversalAgent - 0, // 21: management.v1.UniversalService.status:type_name -> management.v1.UniversalService.Status - 25, // 22: management.v1.ListServicesRequest.service_type:type_name -> inventory.v1.ServiceType - 5, // 23: management.v1.ListServicesResponse.services:type_name -> management.v1.UniversalService - 28, // 24: management.v1.ManagementService.AddAnnotation:input_type -> management.v1.AddAnnotationRequest - 29, // 25: management.v1.ManagementService.ListAgents:input_type -> management.v1.ListAgentsRequest - 30, // 26: management.v1.ManagementService.ListAgentVersions:input_type -> management.v1.ListAgentVersionsRequest - 31, // 27: management.v1.ManagementService.RegisterNode:input_type -> management.v1.RegisterNodeRequest - 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 - 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 -} - -func init() { file_management_v1_service_proto_init() } -func file_management_v1_service_proto_init() { - if File_management_v1_service_proto != nil { - return - } - file_management_v1_agent_proto_init() - file_management_v1_annotation_proto_init() - file_management_v1_azure_proto_init() - file_management_v1_external_proto_init() - file_management_v1_haproxy_proto_init() - file_management_v1_mongodb_proto_init() - file_management_v1_mysql_proto_init() - file_management_v1_node_proto_init() - file_management_v1_postgresql_proto_init() - file_management_v1_proxysql_proto_init() - file_management_v1_rds_proto_init() - file_management_v1_valkey_proto_init() - file_management_v1_service_proto_msgTypes[0].OneofWrappers = []any{ - (*AddServiceRequest_Mysql)(nil), - (*AddServiceRequest_Mongodb)(nil), - (*AddServiceRequest_Postgresql)(nil), - (*AddServiceRequest_Proxysql)(nil), - (*AddServiceRequest_Haproxy)(nil), - (*AddServiceRequest_External)(nil), - (*AddServiceRequest_Rds)(nil), - (*AddServiceRequest_Valkey)(nil), - } - file_management_v1_service_proto_msgTypes[1].OneofWrappers = []any{ - (*AddServiceResponse_Mysql)(nil), - (*AddServiceResponse_Mongodb)(nil), - (*AddServiceResponse_Postgresql)(nil), - (*AddServiceResponse_Proxysql)(nil), - (*AddServiceResponse_Haproxy)(nil), - (*AddServiceResponse_External)(nil), - (*AddServiceResponse_Rds)(nil), - (*AddServiceResponse_Valkey)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_management_v1_service_proto_rawDesc), len(file_management_v1_service_proto_rawDesc)), - NumEnums: 1, - NumMessages: 8, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_management_v1_service_proto_goTypes, - DependencyIndexes: file_management_v1_service_proto_depIdxs, - EnumInfos: file_management_v1_service_proto_enumTypes, - MessageInfos: file_management_v1_service_proto_msgTypes, - }.Build() - File_management_v1_service_proto = out.File - file_management_v1_service_proto_goTypes = nil - file_management_v1_service_proto_depIdxs = nil -} diff --git a/api/management/v1/service.pb.gw.go b/api/management/v1/service.pb.gw.go deleted file mode 100644 index 18c78ee4db1..00000000000 --- a/api/management/v1/service.pb.gw.go +++ /dev/null @@ -1,1031 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: management/v1/service.proto - -/* -Package managementv1 is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package managementv1 - -import ( - "context" - "errors" - "io" - "net/http" - - "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" - "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" - "google.golang.org/protobuf/proto" -) - -// Suppress "imported and not used" errors -var ( - _ codes.Code - _ io.Reader - _ status.Status - _ = errors.New - _ = runtime.String - _ = utilities.NewDoubleArray - _ = metadata.Join -) - -func request_ManagementService_AddAnnotation_0(ctx context.Context, marshaler runtime.Marshaler, client ManagementServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq AddAnnotationRequest - 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.AddAnnotation(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_ManagementService_AddAnnotation_0(ctx context.Context, marshaler runtime.Marshaler, server ManagementServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq AddAnnotationRequest - 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.AddAnnotation(ctx, &protoReq) - return msg, metadata, err -} - -var filter_ManagementService_ListAgents_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} - -func request_ManagementService_ListAgents_0(ctx context.Context, marshaler runtime.Marshaler, client ManagementServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq ListAgentsRequest - metadata runtime.ServerMetadata - ) - if req.Body != nil { - _, _ = io.Copy(io.Discard, req.Body) - } - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_ManagementService_ListAgents_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - msg, err := client.ListAgents(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_ManagementService_ListAgents_0(ctx context.Context, marshaler runtime.Marshaler, server ManagementServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq ListAgentsRequest - metadata runtime.ServerMetadata - ) - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_ManagementService_ListAgents_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - msg, err := server.ListAgents(ctx, &protoReq) - return msg, metadata, err -} - -func request_ManagementService_ListAgentVersions_0(ctx context.Context, marshaler runtime.Marshaler, client ManagementServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq ListAgentVersionsRequest - metadata runtime.ServerMetadata - ) - if req.Body != nil { - _, _ = io.Copy(io.Discard, req.Body) - } - msg, err := client.ListAgentVersions(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_ManagementService_ListAgentVersions_0(ctx context.Context, marshaler runtime.Marshaler, server ManagementServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq ListAgentVersionsRequest - metadata runtime.ServerMetadata - ) - msg, err := server.ListAgentVersions(ctx, &protoReq) - return msg, metadata, err -} - -func request_ManagementService_RegisterNode_0(ctx context.Context, marshaler runtime.Marshaler, client ManagementServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq RegisterNodeRequest - 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.RegisterNode(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_ManagementService_RegisterNode_0(ctx context.Context, marshaler runtime.Marshaler, server ManagementServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq RegisterNodeRequest - 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.RegisterNode(ctx, &protoReq) - return msg, metadata, err -} - -var filter_ManagementService_UnregisterNode_0 = &utilities.DoubleArray{Encoding: map[string]int{"node_id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} - -func request_ManagementService_UnregisterNode_0(ctx context.Context, marshaler runtime.Marshaler, client ManagementServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq UnregisterNodeRequest - metadata runtime.ServerMetadata - err error - ) - if req.Body != nil { - _, _ = io.Copy(io.Discard, req.Body) - } - val, ok := pathParams["node_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "node_id") - } - protoReq.NodeId, err = runtime.String(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "node_id", err) - } - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_ManagementService_UnregisterNode_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - msg, err := client.UnregisterNode(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_ManagementService_UnregisterNode_0(ctx context.Context, marshaler runtime.Marshaler, server ManagementServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq UnregisterNodeRequest - metadata runtime.ServerMetadata - err error - ) - val, ok := pathParams["node_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "node_id") - } - protoReq.NodeId, err = runtime.String(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "node_id", err) - } - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_ManagementService_UnregisterNode_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - msg, err := server.UnregisterNode(ctx, &protoReq) - return msg, metadata, err -} - -var filter_ManagementService_ListNodes_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} - -func request_ManagementService_ListNodes_0(ctx context.Context, marshaler runtime.Marshaler, client ManagementServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq ListNodesRequest - metadata runtime.ServerMetadata - ) - if req.Body != nil { - _, _ = io.Copy(io.Discard, req.Body) - } - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_ManagementService_ListNodes_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - msg, err := client.ListNodes(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_ManagementService_ListNodes_0(ctx context.Context, marshaler runtime.Marshaler, server ManagementServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq ListNodesRequest - metadata runtime.ServerMetadata - ) - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_ManagementService_ListNodes_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - msg, err := server.ListNodes(ctx, &protoReq) - return msg, metadata, err -} - -func request_ManagementService_GetNode_0(ctx context.Context, marshaler runtime.Marshaler, client ManagementServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq GetNodeRequest - metadata runtime.ServerMetadata - err error - ) - if req.Body != nil { - _, _ = io.Copy(io.Discard, req.Body) - } - val, ok := pathParams["node_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "node_id") - } - protoReq.NodeId, err = runtime.String(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "node_id", err) - } - msg, err := client.GetNode(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_ManagementService_GetNode_0(ctx context.Context, marshaler runtime.Marshaler, server ManagementServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq GetNodeRequest - metadata runtime.ServerMetadata - err error - ) - val, ok := pathParams["node_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "node_id") - } - protoReq.NodeId, err = runtime.String(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "node_id", err) - } - msg, err := server.GetNode(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 - 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.AddService(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_ManagementService_AddService_0(ctx context.Context, marshaler runtime.Marshaler, server ManagementServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq AddServiceRequest - 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.AddService(ctx, &protoReq) - return msg, metadata, err -} - -var filter_ManagementService_ListServices_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} - -func request_ManagementService_ListServices_0(ctx context.Context, marshaler runtime.Marshaler, client ManagementServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq ListServicesRequest - metadata runtime.ServerMetadata - ) - if req.Body != nil { - _, _ = io.Copy(io.Discard, req.Body) - } - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_ManagementService_ListServices_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - msg, err := client.ListServices(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_ManagementService_ListServices_0(ctx context.Context, marshaler runtime.Marshaler, server ManagementServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq ListServicesRequest - metadata runtime.ServerMetadata - ) - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_ManagementService_ListServices_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - msg, err := server.ListServices(ctx, &protoReq) - return msg, metadata, err -} - -func request_ManagementService_DiscoverRDS_0(ctx context.Context, marshaler runtime.Marshaler, client ManagementServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq DiscoverRDSRequest - 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.DiscoverRDS(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_ManagementService_DiscoverRDS_0(ctx context.Context, marshaler runtime.Marshaler, server ManagementServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq DiscoverRDSRequest - 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.DiscoverRDS(ctx, &protoReq) - return msg, metadata, err -} - -func request_ManagementService_DiscoverAzureDatabase_0(ctx context.Context, marshaler runtime.Marshaler, client ManagementServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq DiscoverAzureDatabaseRequest - 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.DiscoverAzureDatabase(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_ManagementService_DiscoverAzureDatabase_0(ctx context.Context, marshaler runtime.Marshaler, server ManagementServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq DiscoverAzureDatabaseRequest - 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.DiscoverAzureDatabase(ctx, &protoReq) - return msg, metadata, err -} - -func request_ManagementService_AddAzureDatabase_0(ctx context.Context, marshaler runtime.Marshaler, client ManagementServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq AddAzureDatabaseRequest - 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.AddAzureDatabase(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_ManagementService_AddAzureDatabase_0(ctx context.Context, marshaler runtime.Marshaler, server ManagementServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq AddAzureDatabaseRequest - 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.AddAzureDatabase(ctx, &protoReq) - return msg, metadata, err -} - -var filter_ManagementService_RemoveService_0 = &utilities.DoubleArray{Encoding: map[string]int{"service_id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} - -func request_ManagementService_RemoveService_0(ctx context.Context, marshaler runtime.Marshaler, client ManagementServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq RemoveServiceRequest - metadata runtime.ServerMetadata - err error - ) - if req.Body != nil { - _, _ = io.Copy(io.Discard, req.Body) - } - val, ok := pathParams["service_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "service_id") - } - protoReq.ServiceId, err = runtime.String(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "service_id", err) - } - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_ManagementService_RemoveService_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - msg, err := client.RemoveService(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_ManagementService_RemoveService_0(ctx context.Context, marshaler runtime.Marshaler, server ManagementServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq RemoveServiceRequest - metadata runtime.ServerMetadata - err error - ) - val, ok := pathParams["service_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "service_id") - } - protoReq.ServiceId, err = runtime.String(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "service_id", err) - } - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_ManagementService_RemoveService_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - msg, err := server.RemoveService(ctx, &protoReq) - return msg, metadata, err -} - -// RegisterManagementServiceHandlerServer registers the http handlers for service ManagementService to "mux". -// UnaryRPC :call ManagementServiceServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterManagementServiceHandlerFromEndpoint instead. -// GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call. -func RegisterManagementServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ManagementServiceServer) error { - mux.Handle(http.MethodPost, pattern_ManagementService_AddAnnotation_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/AddAnnotation", runtime.WithHTTPPathPattern("/v1/management/annotations")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_ManagementService_AddAnnotation_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_AddAnnotation_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodGet, pattern_ManagementService_ListAgents_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/ListAgents", runtime.WithHTTPPathPattern("/v1/management/agents")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_ManagementService_ListAgents_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_ListAgents_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodGet, pattern_ManagementService_ListAgentVersions_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/ListAgentVersions", runtime.WithHTTPPathPattern("/v1/management/agents/versions")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_ManagementService_ListAgentVersions_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_ListAgentVersions_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPost, pattern_ManagementService_RegisterNode_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/RegisterNode", runtime.WithHTTPPathPattern("/v1/management/nodes")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_ManagementService_RegisterNode_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_RegisterNode_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodDelete, pattern_ManagementService_UnregisterNode_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/UnregisterNode", runtime.WithHTTPPathPattern("/v1/management/nodes/{node_id}")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_ManagementService_UnregisterNode_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_UnregisterNode_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodGet, pattern_ManagementService_ListNodes_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/ListNodes", runtime.WithHTTPPathPattern("/v1/management/nodes")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_ManagementService_ListNodes_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_ListNodes_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodGet, pattern_ManagementService_GetNode_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/GetNode", runtime.WithHTTPPathPattern("/v1/management/nodes/{node_id}")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_ManagementService_GetNode_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_GetNode_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() - 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/AddService", runtime.WithHTTPPathPattern("/v1/management/services")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_ManagementService_AddService_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_AddService_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodGet, pattern_ManagementService_ListServices_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/ListServices", runtime.WithHTTPPathPattern("/v1/management/services")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_ManagementService_ListServices_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_ListServices_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPost, pattern_ManagementService_DiscoverRDS_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/DiscoverRDS", runtime.WithHTTPPathPattern("/v1/management/services:discoverRDS")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_ManagementService_DiscoverRDS_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_DiscoverRDS_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPost, pattern_ManagementService_DiscoverAzureDatabase_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/DiscoverAzureDatabase", runtime.WithHTTPPathPattern("/v1/management/services:discoverAzure")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_ManagementService_DiscoverAzureDatabase_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_DiscoverAzureDatabase_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPost, pattern_ManagementService_AddAzureDatabase_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/AddAzureDatabase", runtime.WithHTTPPathPattern("/v1/management/services/azure")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_ManagementService_AddAzureDatabase_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_AddAzureDatabase_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodDelete, pattern_ManagementService_RemoveService_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/RemoveService", runtime.WithHTTPPathPattern("/v1/management/services/{service_id}")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_ManagementService_RemoveService_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_RemoveService_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - return nil -} - -// RegisterManagementServiceHandlerFromEndpoint is same as RegisterManagementServiceHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterManagementServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.NewClient(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - return RegisterManagementServiceHandler(ctx, mux, conn) -} - -// RegisterManagementServiceHandler registers the http handlers for service ManagementService to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterManagementServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterManagementServiceHandlerClient(ctx, mux, NewManagementServiceClient(conn)) -} - -// RegisterManagementServiceHandlerClient registers the http handlers for service ManagementService -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ManagementServiceClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ManagementServiceClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "ManagementServiceClient" to call the correct interceptors. This client ignores the HTTP middlewares. -func RegisterManagementServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ManagementServiceClient) error { - mux.Handle(http.MethodPost, pattern_ManagementService_AddAnnotation_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/AddAnnotation", runtime.WithHTTPPathPattern("/v1/management/annotations")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_ManagementService_AddAnnotation_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_AddAnnotation_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodGet, pattern_ManagementService_ListAgents_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/ListAgents", runtime.WithHTTPPathPattern("/v1/management/agents")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_ManagementService_ListAgents_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_ListAgents_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodGet, pattern_ManagementService_ListAgentVersions_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/ListAgentVersions", runtime.WithHTTPPathPattern("/v1/management/agents/versions")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_ManagementService_ListAgentVersions_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_ListAgentVersions_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPost, pattern_ManagementService_RegisterNode_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/RegisterNode", runtime.WithHTTPPathPattern("/v1/management/nodes")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_ManagementService_RegisterNode_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_RegisterNode_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodDelete, pattern_ManagementService_UnregisterNode_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/UnregisterNode", runtime.WithHTTPPathPattern("/v1/management/nodes/{node_id}")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_ManagementService_UnregisterNode_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_UnregisterNode_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodGet, pattern_ManagementService_ListNodes_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/ListNodes", runtime.WithHTTPPathPattern("/v1/management/nodes")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_ManagementService_ListNodes_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_ListNodes_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodGet, pattern_ManagementService_GetNode_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/GetNode", runtime.WithHTTPPathPattern("/v1/management/nodes/{node_id}")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_ManagementService_GetNode_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_GetNode_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() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/management.v1.ManagementService/AddService", runtime.WithHTTPPathPattern("/v1/management/services")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_ManagementService_AddService_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_AddService_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodGet, pattern_ManagementService_ListServices_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/ListServices", runtime.WithHTTPPathPattern("/v1/management/services")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_ManagementService_ListServices_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_ListServices_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPost, pattern_ManagementService_DiscoverRDS_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/DiscoverRDS", runtime.WithHTTPPathPattern("/v1/management/services:discoverRDS")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_ManagementService_DiscoverRDS_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_DiscoverRDS_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPost, pattern_ManagementService_DiscoverAzureDatabase_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/DiscoverAzureDatabase", runtime.WithHTTPPathPattern("/v1/management/services:discoverAzure")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_ManagementService_DiscoverAzureDatabase_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_DiscoverAzureDatabase_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPost, pattern_ManagementService_AddAzureDatabase_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/AddAzureDatabase", runtime.WithHTTPPathPattern("/v1/management/services/azure")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_ManagementService_AddAzureDatabase_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_AddAzureDatabase_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodDelete, pattern_ManagementService_RemoveService_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/RemoveService", runtime.WithHTTPPathPattern("/v1/management/services/{service_id}")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_ManagementService_RemoveService_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_RemoveService_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - return nil -} - -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"}, "")) -) - -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 -) diff --git a/api/management/v1/service.pb.validate.go b/api/management/v1/service.pb.validate.go deleted file mode 100644 index 514862bc94e..00000000000 --- a/api/management/v1/service.pb.validate.go +++ /dev/null @@ -1,1586 +0,0 @@ -// Code generated by protoc-gen-validate. DO NOT EDIT. -// source: management/v1/service.proto - -package managementv1 - -import ( - "bytes" - "errors" - "fmt" - "net" - "net/mail" - "net/url" - "regexp" - "sort" - "strings" - "time" - "unicode/utf8" - - "google.golang.org/protobuf/types/known/anypb" - - inventoryv1 "github.com/percona/pmm/api/inventory/v1" -) - -// ensure the imports are used -var ( - _ = bytes.MinRead - _ = errors.New("") - _ = fmt.Print - _ = utf8.UTFMax - _ = (*regexp.Regexp)(nil) - _ = (*strings.Reader)(nil) - _ = net.IPv4len - _ = time.Duration(0) - _ = (*url.URL)(nil) - _ = (*mail.Address)(nil) - _ = anypb.Any{} - _ = sort.Sort - - _ = inventoryv1.ServiceType(0) -) - -// Validate checks the field values on AddServiceRequest 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 *AddServiceRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on AddServiceRequest 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 -// AddServiceRequestMultiError, or nil if none found. -func (m *AddServiceRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *AddServiceRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - switch v := m.Service.(type) { - case *AddServiceRequest_Mysql: - if v == nil { - err := AddServiceRequestValidationError{ - field: "Service", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetMysql()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AddServiceRequestValidationError{ - field: "Mysql", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AddServiceRequestValidationError{ - field: "Mysql", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMysql()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AddServiceRequestValidationError{ - field: "Mysql", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *AddServiceRequest_Mongodb: - if v == nil { - err := AddServiceRequestValidationError{ - field: "Service", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetMongodb()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AddServiceRequestValidationError{ - field: "Mongodb", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AddServiceRequestValidationError{ - field: "Mongodb", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMongodb()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AddServiceRequestValidationError{ - field: "Mongodb", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *AddServiceRequest_Postgresql: - if v == nil { - err := AddServiceRequestValidationError{ - field: "Service", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetPostgresql()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AddServiceRequestValidationError{ - field: "Postgresql", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AddServiceRequestValidationError{ - field: "Postgresql", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetPostgresql()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AddServiceRequestValidationError{ - field: "Postgresql", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *AddServiceRequest_Proxysql: - if v == nil { - err := AddServiceRequestValidationError{ - field: "Service", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetProxysql()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AddServiceRequestValidationError{ - field: "Proxysql", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AddServiceRequestValidationError{ - field: "Proxysql", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetProxysql()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AddServiceRequestValidationError{ - field: "Proxysql", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *AddServiceRequest_Haproxy: - if v == nil { - err := AddServiceRequestValidationError{ - field: "Service", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetHaproxy()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AddServiceRequestValidationError{ - field: "Haproxy", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AddServiceRequestValidationError{ - field: "Haproxy", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetHaproxy()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AddServiceRequestValidationError{ - field: "Haproxy", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *AddServiceRequest_External: - if v == nil { - err := AddServiceRequestValidationError{ - field: "Service", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetExternal()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AddServiceRequestValidationError{ - field: "External", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AddServiceRequestValidationError{ - field: "External", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetExternal()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AddServiceRequestValidationError{ - field: "External", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *AddServiceRequest_Rds: - if v == nil { - err := AddServiceRequestValidationError{ - field: "Service", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetRds()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AddServiceRequestValidationError{ - field: "Rds", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AddServiceRequestValidationError{ - field: "Rds", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetRds()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AddServiceRequestValidationError{ - field: "Rds", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *AddServiceRequest_Valkey: - if v == nil { - err := AddServiceRequestValidationError{ - field: "Service", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetValkey()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AddServiceRequestValidationError{ - field: "Valkey", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AddServiceRequestValidationError{ - field: "Valkey", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetValkey()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AddServiceRequestValidationError{ - field: "Valkey", - reason: "embedded message failed validation", - cause: err, - } - } - } - - default: - _ = v // ensures v is used - } - - if len(errors) > 0 { - return AddServiceRequestMultiError(errors) - } - - return nil -} - -// AddServiceRequestMultiError is an error wrapping multiple validation errors -// returned by AddServiceRequest.ValidateAll() if the designated constraints -// aren't met. -type AddServiceRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m AddServiceRequestMultiError) 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 AddServiceRequestMultiError) AllErrors() []error { return m } - -// AddServiceRequestValidationError is the validation error returned by -// AddServiceRequest.Validate if the designated constraints aren't met. -type AddServiceRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e AddServiceRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e AddServiceRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e AddServiceRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e AddServiceRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e AddServiceRequestValidationError) ErrorName() string { - return "AddServiceRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e AddServiceRequestValidationError) 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 %sAddServiceRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = AddServiceRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = AddServiceRequestValidationError{} - -// Validate checks the field values on AddServiceResponse 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 *AddServiceResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on AddServiceResponse 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 -// AddServiceResponseMultiError, or nil if none found. -func (m *AddServiceResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *AddServiceResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - switch v := m.Service.(type) { - case *AddServiceResponse_Mysql: - if v == nil { - err := AddServiceResponseValidationError{ - field: "Service", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetMysql()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AddServiceResponseValidationError{ - field: "Mysql", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AddServiceResponseValidationError{ - field: "Mysql", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMysql()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AddServiceResponseValidationError{ - field: "Mysql", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *AddServiceResponse_Mongodb: - if v == nil { - err := AddServiceResponseValidationError{ - field: "Service", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetMongodb()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AddServiceResponseValidationError{ - field: "Mongodb", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AddServiceResponseValidationError{ - field: "Mongodb", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMongodb()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AddServiceResponseValidationError{ - field: "Mongodb", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *AddServiceResponse_Postgresql: - if v == nil { - err := AddServiceResponseValidationError{ - field: "Service", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetPostgresql()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AddServiceResponseValidationError{ - field: "Postgresql", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AddServiceResponseValidationError{ - field: "Postgresql", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetPostgresql()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AddServiceResponseValidationError{ - field: "Postgresql", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *AddServiceResponse_Proxysql: - if v == nil { - err := AddServiceResponseValidationError{ - field: "Service", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetProxysql()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AddServiceResponseValidationError{ - field: "Proxysql", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AddServiceResponseValidationError{ - field: "Proxysql", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetProxysql()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AddServiceResponseValidationError{ - field: "Proxysql", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *AddServiceResponse_Haproxy: - if v == nil { - err := AddServiceResponseValidationError{ - field: "Service", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetHaproxy()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AddServiceResponseValidationError{ - field: "Haproxy", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AddServiceResponseValidationError{ - field: "Haproxy", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetHaproxy()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AddServiceResponseValidationError{ - field: "Haproxy", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *AddServiceResponse_External: - if v == nil { - err := AddServiceResponseValidationError{ - field: "Service", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetExternal()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AddServiceResponseValidationError{ - field: "External", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AddServiceResponseValidationError{ - field: "External", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetExternal()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AddServiceResponseValidationError{ - field: "External", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *AddServiceResponse_Rds: - if v == nil { - err := AddServiceResponseValidationError{ - field: "Service", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetRds()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AddServiceResponseValidationError{ - field: "Rds", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AddServiceResponseValidationError{ - field: "Rds", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetRds()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AddServiceResponseValidationError{ - field: "Rds", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *AddServiceResponse_Valkey: - if v == nil { - err := AddServiceResponseValidationError{ - field: "Service", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetValkey()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AddServiceResponseValidationError{ - field: "Valkey", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AddServiceResponseValidationError{ - field: "Valkey", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetValkey()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AddServiceResponseValidationError{ - field: "Valkey", - reason: "embedded message failed validation", - cause: err, - } - } - } - - default: - _ = v // ensures v is used - } - - if len(errors) > 0 { - return AddServiceResponseMultiError(errors) - } - - return nil -} - -// AddServiceResponseMultiError is an error wrapping multiple validation errors -// returned by AddServiceResponse.ValidateAll() if the designated constraints -// aren't met. -type AddServiceResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m AddServiceResponseMultiError) 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 AddServiceResponseMultiError) AllErrors() []error { return m } - -// AddServiceResponseValidationError is the validation error returned by -// AddServiceResponse.Validate if the designated constraints aren't met. -type AddServiceResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e AddServiceResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e AddServiceResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e AddServiceResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e AddServiceResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e AddServiceResponseValidationError) ErrorName() string { - return "AddServiceResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e AddServiceResponseValidationError) 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 %sAddServiceResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = AddServiceResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = AddServiceResponseValidationError{} - -// Validate checks the field values on RemoveServiceRequest 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 *RemoveServiceRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on RemoveServiceRequest 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 -// RemoveServiceRequestMultiError, or nil if none found. -func (m *RemoveServiceRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *RemoveServiceRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for ServiceId - - // no validation rules for ServiceType - - if len(errors) > 0 { - return RemoveServiceRequestMultiError(errors) - } - - return nil -} - -// RemoveServiceRequestMultiError is an error wrapping multiple validation -// errors returned by RemoveServiceRequest.ValidateAll() if the designated -// constraints aren't met. -type RemoveServiceRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m RemoveServiceRequestMultiError) 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 RemoveServiceRequestMultiError) AllErrors() []error { return m } - -// RemoveServiceRequestValidationError is the validation error returned by -// RemoveServiceRequest.Validate if the designated constraints aren't met. -type RemoveServiceRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e RemoveServiceRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e RemoveServiceRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e RemoveServiceRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e RemoveServiceRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e RemoveServiceRequestValidationError) ErrorName() string { - return "RemoveServiceRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e RemoveServiceRequestValidationError) 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 %sRemoveServiceRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = RemoveServiceRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = RemoveServiceRequestValidationError{} - -// Validate checks the field values on RemoveServiceResponse 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 *RemoveServiceResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on RemoveServiceResponse 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 -// RemoveServiceResponseMultiError, or nil if none found. -func (m *RemoveServiceResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *RemoveServiceResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return RemoveServiceResponseMultiError(errors) - } - - return nil -} - -// RemoveServiceResponseMultiError is an error wrapping multiple validation -// errors returned by RemoveServiceResponse.ValidateAll() if the designated -// constraints aren't met. -type RemoveServiceResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m RemoveServiceResponseMultiError) 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 RemoveServiceResponseMultiError) AllErrors() []error { return m } - -// RemoveServiceResponseValidationError is the validation error returned by -// RemoveServiceResponse.Validate if the designated constraints aren't met. -type RemoveServiceResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e RemoveServiceResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e RemoveServiceResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e RemoveServiceResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e RemoveServiceResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e RemoveServiceResponseValidationError) ErrorName() string { - return "RemoveServiceResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e RemoveServiceResponseValidationError) 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 %sRemoveServiceResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = RemoveServiceResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = RemoveServiceResponseValidationError{} - -// Validate checks the field values on UniversalService 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 *UniversalService) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on UniversalService 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 -// UniversalServiceMultiError, or nil if none found. -func (m *UniversalService) ValidateAll() error { - return m.validate(true) -} - -func (m *UniversalService) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for ServiceId - - // no validation rules for ServiceType - - // no validation rules for ServiceName - - // no validation rules for DatabaseName - - // no validation rules for NodeId - - // no validation rules for NodeName - - // no validation rules for Environment - - // no validation rules for Cluster - - // no validation rules for ReplicationSet - - // no validation rules for CustomLabels - - // no validation rules for ExternalGroup - - // no validation rules for Address - - // no validation rules for Port - - // no validation rules for Socket - - if all { - switch v := interface{}(m.GetCreatedAt()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, UniversalServiceValidationError{ - field: "CreatedAt", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, UniversalServiceValidationError{ - field: "CreatedAt", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetCreatedAt()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return UniversalServiceValidationError{ - field: "CreatedAt", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetUpdatedAt()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, UniversalServiceValidationError{ - field: "UpdatedAt", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, UniversalServiceValidationError{ - field: "UpdatedAt", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetUpdatedAt()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return UniversalServiceValidationError{ - field: "UpdatedAt", - reason: "embedded message failed validation", - cause: err, - } - } - } - - for idx, item := range m.GetAgents() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, UniversalServiceValidationError{ - field: fmt.Sprintf("Agents[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, UniversalServiceValidationError{ - field: fmt.Sprintf("Agents[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return UniversalServiceValidationError{ - field: fmt.Sprintf("Agents[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - // no validation rules for Status - - // no validation rules for Version - - if len(errors) > 0 { - return UniversalServiceMultiError(errors) - } - - return nil -} - -// UniversalServiceMultiError is an error wrapping multiple validation errors -// returned by UniversalService.ValidateAll() if the designated constraints -// aren't met. -type UniversalServiceMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m UniversalServiceMultiError) 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 UniversalServiceMultiError) AllErrors() []error { return m } - -// UniversalServiceValidationError is the validation error returned by -// UniversalService.Validate if the designated constraints aren't met. -type UniversalServiceValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e UniversalServiceValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e UniversalServiceValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e UniversalServiceValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e UniversalServiceValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e UniversalServiceValidationError) ErrorName() string { return "UniversalServiceValidationError" } - -// Error satisfies the builtin error interface -func (e UniversalServiceValidationError) 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 %sUniversalService.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = UniversalServiceValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = UniversalServiceValidationError{} - -// Validate checks the field values on ListServicesRequest 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 *ListServicesRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ListServicesRequest 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 -// ListServicesRequestMultiError, or nil if none found. -func (m *ListServicesRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *ListServicesRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for NodeId - - // no validation rules for ServiceType - - // no validation rules for ExternalGroup - - if len(errors) > 0 { - return ListServicesRequestMultiError(errors) - } - - return nil -} - -// ListServicesRequestMultiError is an error wrapping multiple validation -// errors returned by ListServicesRequest.ValidateAll() if the designated -// constraints aren't met. -type ListServicesRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ListServicesRequestMultiError) 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 ListServicesRequestMultiError) AllErrors() []error { return m } - -// ListServicesRequestValidationError is the validation error returned by -// ListServicesRequest.Validate if the designated constraints aren't met. -type ListServicesRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ListServicesRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ListServicesRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ListServicesRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ListServicesRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ListServicesRequestValidationError) ErrorName() string { - return "ListServicesRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e ListServicesRequestValidationError) 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 %sListServicesRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ListServicesRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ListServicesRequestValidationError{} - -// Validate checks the field values on ListServicesResponse 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 *ListServicesResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ListServicesResponse 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 -// ListServicesResponseMultiError, or nil if none found. -func (m *ListServicesResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *ListServicesResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - for idx, item := range m.GetServices() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ListServicesResponseValidationError{ - field: fmt.Sprintf("Services[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ListServicesResponseValidationError{ - field: fmt.Sprintf("Services[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ListServicesResponseValidationError{ - field: fmt.Sprintf("Services[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - if len(errors) > 0 { - return ListServicesResponseMultiError(errors) - } - - return nil -} - -// ListServicesResponseMultiError is an error wrapping multiple validation -// errors returned by ListServicesResponse.ValidateAll() if the designated -// constraints aren't met. -type ListServicesResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ListServicesResponseMultiError) 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 ListServicesResponseMultiError) AllErrors() []error { return m } - -// ListServicesResponseValidationError is the validation error returned by -// ListServicesResponse.Validate if the designated constraints aren't met. -type ListServicesResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ListServicesResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ListServicesResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ListServicesResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ListServicesResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ListServicesResponseValidationError) ErrorName() string { - return "ListServicesResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e ListServicesResponseValidationError) 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 %sListServicesResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ListServicesResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ListServicesResponseValidationError{} diff --git a/api/management/v1/service_grpc.pb.go b/api/management/v1/service_grpc.pb.go deleted file mode 100644 index b50380dc4b5..00000000000 --- a/api/management/v1/service_grpc.pb.go +++ /dev/null @@ -1,620 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.6.0 -// - protoc (unknown) -// source: management/v1/service.proto - -package managementv1 - -import ( - context "context" - - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.64.0 or later. -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" -) - -// ManagementServiceClient is the client API for ManagementService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -// -// ManagementService provides public methods for managing and querying Services. -type ManagementServiceClient interface { - // AddAnnotation adds an annotation. - AddAnnotation(ctx context.Context, in *AddAnnotationRequest, opts ...grpc.CallOption) (*AddAnnotationResponse, error) - // ListAgents returns a list of Agents filtered by service_id or node_id. - ListAgents(ctx context.Context, in *ListAgentsRequest, opts ...grpc.CallOption) (*ListAgentsResponse, error) - // ListAgentVersions returns a list of PMM Agent versions and their update severity. - ListAgentVersions(ctx context.Context, in *ListAgentVersionsRequest, opts ...grpc.CallOption) (*ListAgentVersionsResponse, error) - // RegisterNode registers a new Node and a pmm-agent. - RegisterNode(ctx context.Context, in *RegisterNodeRequest, opts ...grpc.CallOption) (*RegisterNodeResponse, error) - // UnregisterNode unregisters a Node, pmm-agent and removes the service account and its token. - UnregisterNode(ctx context.Context, in *UnregisterNodeRequest, opts ...grpc.CallOption) (*UnregisterNodeResponse, error) - // ListNode returns a list of nodes. - 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) - // 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. - ListServices(ctx context.Context, in *ListServicesRequest, opts ...grpc.CallOption) (*ListServicesResponse, error) - // DiscoverRDS discovers RDS instances. - DiscoverRDS(ctx context.Context, in *DiscoverRDSRequest, opts ...grpc.CallOption) (*DiscoverRDSResponse, error) - // DiscoverAzureDatabase discovers Azure Database for MySQL, MariaDB and PostgreSQL Server instances. - DiscoverAzureDatabase(ctx context.Context, in *DiscoverAzureDatabaseRequest, opts ...grpc.CallOption) (*DiscoverAzureDatabaseResponse, error) - // AddAzureDatabase adds Azure Database instance. - AddAzureDatabase(ctx context.Context, in *AddAzureDatabaseRequest, opts ...grpc.CallOption) (*AddAzureDatabaseResponse, error) - // RemoveService removes a Service along with its Agents. - RemoveService(ctx context.Context, in *RemoveServiceRequest, opts ...grpc.CallOption) (*RemoveServiceResponse, error) -} - -type managementServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewManagementServiceClient(cc grpc.ClientConnInterface) ManagementServiceClient { - return &managementServiceClient{cc} -} - -func (c *managementServiceClient) AddAnnotation(ctx context.Context, in *AddAnnotationRequest, opts ...grpc.CallOption) (*AddAnnotationResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(AddAnnotationResponse) - err := c.cc.Invoke(ctx, ManagementService_AddAnnotation_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *managementServiceClient) ListAgents(ctx context.Context, in *ListAgentsRequest, opts ...grpc.CallOption) (*ListAgentsResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(ListAgentsResponse) - err := c.cc.Invoke(ctx, ManagementService_ListAgents_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *managementServiceClient) ListAgentVersions(ctx context.Context, in *ListAgentVersionsRequest, opts ...grpc.CallOption) (*ListAgentVersionsResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(ListAgentVersionsResponse) - err := c.cc.Invoke(ctx, ManagementService_ListAgentVersions_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *managementServiceClient) RegisterNode(ctx context.Context, in *RegisterNodeRequest, opts ...grpc.CallOption) (*RegisterNodeResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(RegisterNodeResponse) - err := c.cc.Invoke(ctx, ManagementService_RegisterNode_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *managementServiceClient) UnregisterNode(ctx context.Context, in *UnregisterNodeRequest, opts ...grpc.CallOption) (*UnregisterNodeResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(UnregisterNodeResponse) - err := c.cc.Invoke(ctx, ManagementService_UnregisterNode_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *managementServiceClient) ListNodes(ctx context.Context, in *ListNodesRequest, opts ...grpc.CallOption) (*ListNodesResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(ListNodesResponse) - err := c.cc.Invoke(ctx, ManagementService_ListNodes_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *managementServiceClient) GetNode(ctx context.Context, in *GetNodeRequest, opts ...grpc.CallOption) (*GetNodeResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetNodeResponse) - err := c.cc.Invoke(ctx, ManagementService_GetNode_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) - err := c.cc.Invoke(ctx, ManagementService_AddService_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *managementServiceClient) ListServices(ctx context.Context, in *ListServicesRequest, opts ...grpc.CallOption) (*ListServicesResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(ListServicesResponse) - err := c.cc.Invoke(ctx, ManagementService_ListServices_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *managementServiceClient) DiscoverRDS(ctx context.Context, in *DiscoverRDSRequest, opts ...grpc.CallOption) (*DiscoverRDSResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(DiscoverRDSResponse) - err := c.cc.Invoke(ctx, ManagementService_DiscoverRDS_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *managementServiceClient) DiscoverAzureDatabase(ctx context.Context, in *DiscoverAzureDatabaseRequest, opts ...grpc.CallOption) (*DiscoverAzureDatabaseResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(DiscoverAzureDatabaseResponse) - err := c.cc.Invoke(ctx, ManagementService_DiscoverAzureDatabase_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *managementServiceClient) AddAzureDatabase(ctx context.Context, in *AddAzureDatabaseRequest, opts ...grpc.CallOption) (*AddAzureDatabaseResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(AddAzureDatabaseResponse) - err := c.cc.Invoke(ctx, ManagementService_AddAzureDatabase_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *managementServiceClient) RemoveService(ctx context.Context, in *RemoveServiceRequest, opts ...grpc.CallOption) (*RemoveServiceResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(RemoveServiceResponse) - err := c.cc.Invoke(ctx, ManagementService_RemoveService_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -// ManagementServiceServer is the server API for ManagementService service. -// All implementations must embed UnimplementedManagementServiceServer -// for forward compatibility. -// -// ManagementService provides public methods for managing and querying Services. -type ManagementServiceServer interface { - // AddAnnotation adds an annotation. - AddAnnotation(context.Context, *AddAnnotationRequest) (*AddAnnotationResponse, error) - // ListAgents returns a list of Agents filtered by service_id or node_id. - ListAgents(context.Context, *ListAgentsRequest) (*ListAgentsResponse, error) - // ListAgentVersions returns a list of PMM Agent versions and their update severity. - ListAgentVersions(context.Context, *ListAgentVersionsRequest) (*ListAgentVersionsResponse, error) - // RegisterNode registers a new Node and a pmm-agent. - RegisterNode(context.Context, *RegisterNodeRequest) (*RegisterNodeResponse, error) - // UnregisterNode unregisters a Node, pmm-agent and removes the service account and its token. - UnregisterNode(context.Context, *UnregisterNodeRequest) (*UnregisterNodeResponse, error) - // ListNode returns a list of nodes. - ListNodes(context.Context, *ListNodesRequest) (*ListNodesResponse, error) - // GetNode returns a single Node by ID. - GetNode(context.Context, *GetNodeRequest) (*GetNodeResponse, 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. - ListServices(context.Context, *ListServicesRequest) (*ListServicesResponse, error) - // DiscoverRDS discovers RDS instances. - DiscoverRDS(context.Context, *DiscoverRDSRequest) (*DiscoverRDSResponse, error) - // DiscoverAzureDatabase discovers Azure Database for MySQL, MariaDB and PostgreSQL Server instances. - DiscoverAzureDatabase(context.Context, *DiscoverAzureDatabaseRequest) (*DiscoverAzureDatabaseResponse, error) - // AddAzureDatabase adds Azure Database instance. - AddAzureDatabase(context.Context, *AddAzureDatabaseRequest) (*AddAzureDatabaseResponse, error) - // RemoveService removes a Service along with its Agents. - RemoveService(context.Context, *RemoveServiceRequest) (*RemoveServiceResponse, error) - mustEmbedUnimplementedManagementServiceServer() -} - -// UnimplementedManagementServiceServer must be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -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") -} -func (UnimplementedManagementServiceServer) mustEmbedUnimplementedManagementServiceServer() {} -func (UnimplementedManagementServiceServer) testEmbeddedByValue() {} - -// UnsafeManagementServiceServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to ManagementServiceServer will -// result in compilation errors. -type UnsafeManagementServiceServer interface { - mustEmbedUnimplementedManagementServiceServer() -} - -func RegisterManagementServiceServer(s grpc.ServiceRegistrar, srv ManagementServiceServer) { - // If the following call panics, it indicates UnimplementedManagementServiceServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } - s.RegisterService(&ManagementService_ServiceDesc, srv) -} - -func _ManagementService_AddAnnotation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AddAnnotationRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ManagementServiceServer).AddAnnotation(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: ManagementService_AddAnnotation_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ManagementServiceServer).AddAnnotation(ctx, req.(*AddAnnotationRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ManagementService_ListAgents_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListAgentsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ManagementServiceServer).ListAgents(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: ManagementService_ListAgents_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ManagementServiceServer).ListAgents(ctx, req.(*ListAgentsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ManagementService_ListAgentVersions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListAgentVersionsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ManagementServiceServer).ListAgentVersions(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: ManagementService_ListAgentVersions_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ManagementServiceServer).ListAgentVersions(ctx, req.(*ListAgentVersionsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ManagementService_RegisterNode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RegisterNodeRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ManagementServiceServer).RegisterNode(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: ManagementService_RegisterNode_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ManagementServiceServer).RegisterNode(ctx, req.(*RegisterNodeRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ManagementService_UnregisterNode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UnregisterNodeRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ManagementServiceServer).UnregisterNode(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: ManagementService_UnregisterNode_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ManagementServiceServer).UnregisterNode(ctx, req.(*UnregisterNodeRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ManagementService_ListNodes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListNodesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ManagementServiceServer).ListNodes(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: ManagementService_ListNodes_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ManagementServiceServer).ListNodes(ctx, req.(*ListNodesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ManagementService_GetNode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetNodeRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ManagementServiceServer).GetNode(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: ManagementService_GetNode_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ManagementServiceServer).GetNode(ctx, req.(*GetNodeRequest)) - } - 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 { - return nil, err - } - if interceptor == nil { - return srv.(ManagementServiceServer).AddService(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: ManagementService_AddService_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ManagementServiceServer).AddService(ctx, req.(*AddServiceRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ManagementService_ListServices_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListServicesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ManagementServiceServer).ListServices(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: ManagementService_ListServices_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ManagementServiceServer).ListServices(ctx, req.(*ListServicesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ManagementService_DiscoverRDS_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DiscoverRDSRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ManagementServiceServer).DiscoverRDS(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: ManagementService_DiscoverRDS_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ManagementServiceServer).DiscoverRDS(ctx, req.(*DiscoverRDSRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ManagementService_DiscoverAzureDatabase_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DiscoverAzureDatabaseRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ManagementServiceServer).DiscoverAzureDatabase(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: ManagementService_DiscoverAzureDatabase_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ManagementServiceServer).DiscoverAzureDatabase(ctx, req.(*DiscoverAzureDatabaseRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ManagementService_AddAzureDatabase_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AddAzureDatabaseRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ManagementServiceServer).AddAzureDatabase(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: ManagementService_AddAzureDatabase_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ManagementServiceServer).AddAzureDatabase(ctx, req.(*AddAzureDatabaseRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ManagementService_RemoveService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RemoveServiceRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ManagementServiceServer).RemoveService(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: ManagementService_RemoveService_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ManagementServiceServer).RemoveService(ctx, req.(*RemoveServiceRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// ManagementService_ServiceDesc is the grpc.ServiceDesc for ManagementService service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var ManagementService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "management.v1.ManagementService", - HandlerType: (*ManagementServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "AddAnnotation", - Handler: _ManagementService_AddAnnotation_Handler, - }, - { - MethodName: "ListAgents", - Handler: _ManagementService_ListAgents_Handler, - }, - { - MethodName: "ListAgentVersions", - Handler: _ManagementService_ListAgentVersions_Handler, - }, - { - MethodName: "RegisterNode", - Handler: _ManagementService_RegisterNode_Handler, - }, - { - MethodName: "UnregisterNode", - Handler: _ManagementService_UnregisterNode_Handler, - }, - { - MethodName: "ListNodes", - Handler: _ManagementService_ListNodes_Handler, - }, - { - MethodName: "GetNode", - Handler: _ManagementService_GetNode_Handler, - }, - { - MethodName: "AddService", - Handler: _ManagementService_AddService_Handler, - }, - { - MethodName: "ListServices", - Handler: _ManagementService_ListServices_Handler, - }, - { - MethodName: "DiscoverRDS", - Handler: _ManagementService_DiscoverRDS_Handler, - }, - { - MethodName: "DiscoverAzureDatabase", - Handler: _ManagementService_DiscoverAzureDatabase_Handler, - }, - { - MethodName: "AddAzureDatabase", - Handler: _ManagementService_AddAzureDatabase_Handler, - }, - { - MethodName: "RemoveService", - Handler: _ManagementService_RemoveService_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "management/v1/service.proto", -} diff --git a/api/management/v1/severity.pb.go b/api/management/v1/severity.pb.go deleted file mode 100644 index 6433bb3b095..00000000000 --- a/api/management/v1/severity.pb.go +++ /dev/null @@ -1,159 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.10 -// protoc (unknown) -// source: management/v1/severity.proto - -package managementv1 - -import ( - reflect "reflect" - sync "sync" - unsafe "unsafe" - - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// Severity represents severity level of the check result or alert. -type Severity int32 - -const ( - Severity_SEVERITY_UNSPECIFIED Severity = 0 - Severity_SEVERITY_EMERGENCY Severity = 1 - Severity_SEVERITY_ALERT Severity = 2 - Severity_SEVERITY_CRITICAL Severity = 3 - Severity_SEVERITY_ERROR Severity = 4 - Severity_SEVERITY_WARNING Severity = 5 - Severity_SEVERITY_NOTICE Severity = 6 - Severity_SEVERITY_INFO Severity = 7 - Severity_SEVERITY_DEBUG Severity = 8 -) - -// Enum value maps for Severity. -var ( - Severity_name = map[int32]string{ - 0: "SEVERITY_UNSPECIFIED", - 1: "SEVERITY_EMERGENCY", - 2: "SEVERITY_ALERT", - 3: "SEVERITY_CRITICAL", - 4: "SEVERITY_ERROR", - 5: "SEVERITY_WARNING", - 6: "SEVERITY_NOTICE", - 7: "SEVERITY_INFO", - 8: "SEVERITY_DEBUG", - } - Severity_value = map[string]int32{ - "SEVERITY_UNSPECIFIED": 0, - "SEVERITY_EMERGENCY": 1, - "SEVERITY_ALERT": 2, - "SEVERITY_CRITICAL": 3, - "SEVERITY_ERROR": 4, - "SEVERITY_WARNING": 5, - "SEVERITY_NOTICE": 6, - "SEVERITY_INFO": 7, - "SEVERITY_DEBUG": 8, - } -) - -func (x Severity) Enum() *Severity { - p := new(Severity) - *p = x - return p -} - -func (x Severity) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (Severity) Descriptor() protoreflect.EnumDescriptor { - return file_management_v1_severity_proto_enumTypes[0].Descriptor() -} - -func (Severity) Type() protoreflect.EnumType { - return &file_management_v1_severity_proto_enumTypes[0] -} - -func (x Severity) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use Severity.Descriptor instead. -func (Severity) EnumDescriptor() ([]byte, []int) { - return file_management_v1_severity_proto_rawDescGZIP(), []int{0} -} - -var File_management_v1_severity_proto protoreflect.FileDescriptor - -const file_management_v1_severity_proto_rawDesc = "" + - "\n" + - "\x1cmanagement/v1/severity.proto\x12\rmanagement.v1*\xcd\x01\n" + - "\bSeverity\x12\x18\n" + - "\x14SEVERITY_UNSPECIFIED\x10\x00\x12\x16\n" + - "\x12SEVERITY_EMERGENCY\x10\x01\x12\x12\n" + - "\x0eSEVERITY_ALERT\x10\x02\x12\x15\n" + - "\x11SEVERITY_CRITICAL\x10\x03\x12\x12\n" + - "\x0eSEVERITY_ERROR\x10\x04\x12\x14\n" + - "\x10SEVERITY_WARNING\x10\x05\x12\x13\n" + - "\x0fSEVERITY_NOTICE\x10\x06\x12\x11\n" + - "\rSEVERITY_INFO\x10\a\x12\x12\n" + - "\x0eSEVERITY_DEBUG\x10\bB\xae\x01\n" + - "\x11com.management.v1B\rSeverityProtoP\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 ( - file_management_v1_severity_proto_rawDescOnce sync.Once - file_management_v1_severity_proto_rawDescData []byte -) - -func file_management_v1_severity_proto_rawDescGZIP() []byte { - file_management_v1_severity_proto_rawDescOnce.Do(func() { - file_management_v1_severity_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_management_v1_severity_proto_rawDesc), len(file_management_v1_severity_proto_rawDesc))) - }) - 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_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_management_v1_severity_proto_init() } -func file_management_v1_severity_proto_init() { - if File_management_v1_severity_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_management_v1_severity_proto_rawDesc), len(file_management_v1_severity_proto_rawDesc)), - NumEnums: 1, - NumMessages: 0, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_management_v1_severity_proto_goTypes, - DependencyIndexes: file_management_v1_severity_proto_depIdxs, - EnumInfos: file_management_v1_severity_proto_enumTypes, - }.Build() - File_management_v1_severity_proto = out.File - file_management_v1_severity_proto_goTypes = nil - file_management_v1_severity_proto_depIdxs = nil -} diff --git a/api/management/v1/severity.pb.validate.go b/api/management/v1/severity.pb.validate.go deleted file mode 100644 index d7fdf00c2e2..00000000000 --- a/api/management/v1/severity.pb.validate.go +++ /dev/null @@ -1,36 +0,0 @@ -// Code generated by protoc-gen-validate. DO NOT EDIT. -// source: management/v1/severity.proto - -package managementv1 - -import ( - "bytes" - "errors" - "fmt" - "net" - "net/mail" - "net/url" - "regexp" - "sort" - "strings" - "time" - "unicode/utf8" - - "google.golang.org/protobuf/types/known/anypb" -) - -// ensure the imports are used -var ( - _ = bytes.MinRead - _ = errors.New("") - _ = fmt.Print - _ = utf8.UTFMax - _ = (*regexp.Regexp)(nil) - _ = (*strings.Reader)(nil) - _ = net.IPv4len - _ = time.Duration(0) - _ = (*url.URL)(nil) - _ = (*mail.Address)(nil) - _ = anypb.Any{} - _ = sort.Sort -) diff --git a/api/management/v1/valkey.pb.go b/api/management/v1/valkey.pb.go deleted file mode 100644 index d859bfdb175..00000000000 --- a/api/management/v1/valkey.pb.go +++ /dev/null @@ -1,446 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.10 -// protoc (unknown) -// source: management/v1/valkey.proto - -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" - - v1 "github.com/percona/pmm/api/inventory/v1" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type AddValkeyServiceParams struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Node identifier on which the service is running. - // Only one of these parameters should be present: node_id, node_name, add_node. - NodeId string `protobuf:"bytes,1,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` - // Node name on which a service is running. - // Only one of these parameters should be present: node_id, node_name, add_node. - NodeName string `protobuf:"bytes,2,opt,name=node_name,json=nodeName,proto3" json:"node_name,omitempty"` - // Create a new Node with those parameters. - // Only one of these parameters should be present: node_id, node_name, add_node. - AddNode *AddNodeParams `protobuf:"bytes,3,opt,name=add_node,json=addNode,proto3" json:"add_node,omitempty"` - // User-defined name, it is required and should be unique across all services. - ServiceName string `protobuf:"bytes,4,opt,name=service_name,json=serviceName,proto3" json:"service_name,omitempty"` - // Node and Service access address (DNS name or IP). - // Address (and port) or socket is required. - Address string `protobuf:"bytes,5,opt,name=address,proto3" json:"address,omitempty"` - // Service access port. - // Port is required when the address is present. - Port uint32 `protobuf:"varint,6,opt,name=port,proto3" json:"port,omitempty"` - // Service access socket. - // Address (and port) or socket is required. - Socket string `protobuf:"bytes,7,opt,name=socket,proto3" json:"socket,omitempty"` - // The "pmm-agent" identifier which should run agents. Required. - PmmAgentId string `protobuf:"bytes,8,opt,name=pmm_agent_id,json=pmmAgentId,proto3" json:"pmm_agent_id,omitempty"` - // Valkey username for scraping metrics. - Username string `protobuf:"bytes,9,opt,name=username,proto3" json:"username,omitempty"` - // Valkey password for scraping metrics. - Password string `protobuf:"bytes,10,opt,name=password,proto3" json:"password,omitempty"` - // Environment name. - Environment string `protobuf:"bytes,11,opt,name=environment,proto3" json:"environment,omitempty"` - // Cluster name. - Cluster string `protobuf:"bytes,12,opt,name=cluster,proto3" json:"cluster,omitempty"` - // Replication set name. - ReplicationSet string `protobuf:"bytes,13,opt,name=replication_set,json=replicationSet,proto3" json:"replication_set,omitempty"` - // Custom user-assigned labels for Service. - CustomLabels map[string]string `protobuf:"bytes,14,rep,name=custom_labels,json=customLabels,proto3" json:"custom_labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - // Skip connection check. - SkipConnectionCheck bool `protobuf:"varint,15,opt,name=skip_connection_check,json=skipConnectionCheck,proto3" json:"skip_connection_check,omitempty"` - // Use TLS for connection. - Tls bool `protobuf:"varint,16,opt,name=tls,proto3" json:"tls,omitempty"` - // Skip TLS verification. - TlsSkipVerify bool `protobuf:"varint,17,opt,name=tls_skip_verify,json=tlsSkipVerify,proto3" json:"tls_skip_verify,omitempty"` - // Defines metrics flow model for the Valkey exporter. - // Metrics could be pushed to the server with vmagent, - // pulled by the server, or the server could choose behavior automatically. - MetricsMode MetricsMode `protobuf:"varint,18,opt,name=metrics_mode,json=metricsMode,proto3,enum=management.v1.MetricsMode" json:"metrics_mode,omitempty"` - // Exporter log level - LogLevel v1.LogLevel `protobuf:"varint,19,opt,name=log_level,json=logLevel,proto3,enum=inventory.v1.LogLevel" json:"log_level,omitempty"` - // Optionally expose the exporter process on all public interfaces - ExposeExporter bool `protobuf:"varint,20,opt,name=expose_exporter,json=exposeExporter,proto3" json:"expose_exporter,omitempty"` - // TLS CA certificate. - TlsCa string `protobuf:"bytes,21,opt,name=tls_ca,json=tlsCa,proto3" json:"tls_ca,omitempty"` - // TLS Certifcate. - TlsCert string `protobuf:"bytes,22,opt,name=tls_cert,json=tlsCert,proto3" json:"tls_cert,omitempty"` - // TLS Certificate Key. - TlsKey string `protobuf:"bytes,23,opt,name=tls_key,json=tlsKey,proto3" json:"tls_key,omitempty"` - // Custom password for exporter endpoint /metrics. - AgentPassword string `protobuf:"bytes,24,opt,name=agent_password,json=agentPassword,proto3" json:"agent_password,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AddValkeyServiceParams) Reset() { - *x = AddValkeyServiceParams{} - mi := &file_management_v1_valkey_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AddValkeyServiceParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddValkeyServiceParams) ProtoMessage() {} - -func (x *AddValkeyServiceParams) ProtoReflect() protoreflect.Message { - mi := &file_management_v1_valkey_proto_msgTypes[0] - 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 AddValkeyServiceParams.ProtoReflect.Descriptor instead. -func (*AddValkeyServiceParams) Descriptor() ([]byte, []int) { - return file_management_v1_valkey_proto_rawDescGZIP(), []int{0} -} - -func (x *AddValkeyServiceParams) GetNodeId() string { - if x != nil { - return x.NodeId - } - return "" -} - -func (x *AddValkeyServiceParams) GetNodeName() string { - if x != nil { - return x.NodeName - } - return "" -} - -func (x *AddValkeyServiceParams) GetAddNode() *AddNodeParams { - if x != nil { - return x.AddNode - } - return nil -} - -func (x *AddValkeyServiceParams) GetServiceName() string { - if x != nil { - return x.ServiceName - } - return "" -} - -func (x *AddValkeyServiceParams) GetAddress() string { - if x != nil { - return x.Address - } - return "" -} - -func (x *AddValkeyServiceParams) GetPort() uint32 { - if x != nil { - return x.Port - } - return 0 -} - -func (x *AddValkeyServiceParams) GetSocket() string { - if x != nil { - return x.Socket - } - return "" -} - -func (x *AddValkeyServiceParams) GetPmmAgentId() string { - if x != nil { - return x.PmmAgentId - } - return "" -} - -func (x *AddValkeyServiceParams) GetUsername() string { - if x != nil { - return x.Username - } - return "" -} - -func (x *AddValkeyServiceParams) GetPassword() string { - if x != nil { - return x.Password - } - return "" -} - -func (x *AddValkeyServiceParams) GetEnvironment() string { - if x != nil { - return x.Environment - } - return "" -} - -func (x *AddValkeyServiceParams) GetCluster() string { - if x != nil { - return x.Cluster - } - return "" -} - -func (x *AddValkeyServiceParams) GetReplicationSet() string { - if x != nil { - return x.ReplicationSet - } - return "" -} - -func (x *AddValkeyServiceParams) GetCustomLabels() map[string]string { - if x != nil { - return x.CustomLabels - } - return nil -} - -func (x *AddValkeyServiceParams) GetSkipConnectionCheck() bool { - if x != nil { - return x.SkipConnectionCheck - } - return false -} - -func (x *AddValkeyServiceParams) GetTls() bool { - if x != nil { - return x.Tls - } - return false -} - -func (x *AddValkeyServiceParams) GetTlsSkipVerify() bool { - if x != nil { - return x.TlsSkipVerify - } - return false -} - -func (x *AddValkeyServiceParams) GetMetricsMode() MetricsMode { - if x != nil { - return x.MetricsMode - } - return MetricsMode_METRICS_MODE_UNSPECIFIED -} - -func (x *AddValkeyServiceParams) GetLogLevel() v1.LogLevel { - if x != nil { - return x.LogLevel - } - return v1.LogLevel(0) -} - -func (x *AddValkeyServiceParams) GetExposeExporter() bool { - if x != nil { - return x.ExposeExporter - } - return false -} - -func (x *AddValkeyServiceParams) GetTlsCa() string { - if x != nil { - return x.TlsCa - } - return "" -} - -func (x *AddValkeyServiceParams) GetTlsCert() string { - if x != nil { - return x.TlsCert - } - return "" -} - -func (x *AddValkeyServiceParams) GetTlsKey() string { - if x != nil { - return x.TlsKey - } - return "" -} - -func (x *AddValkeyServiceParams) GetAgentPassword() string { - if x != nil { - return x.AgentPassword - } - return "" -} - -type ValkeyServiceResult struct { - state protoimpl.MessageState `protogen:"open.v1"` - Service *v1.ValkeyService `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"` - ValkeyExporter *v1.ValkeyExporter `protobuf:"bytes,2,opt,name=valkey_exporter,json=valkeyExporter,proto3" json:"valkey_exporter,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ValkeyServiceResult) Reset() { - *x = ValkeyServiceResult{} - mi := &file_management_v1_valkey_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ValkeyServiceResult) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ValkeyServiceResult) ProtoMessage() {} - -func (x *ValkeyServiceResult) ProtoReflect() protoreflect.Message { - mi := &file_management_v1_valkey_proto_msgTypes[1] - 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 ValkeyServiceResult.ProtoReflect.Descriptor instead. -func (*ValkeyServiceResult) Descriptor() ([]byte, []int) { - return file_management_v1_valkey_proto_rawDescGZIP(), []int{1} -} - -func (x *ValkeyServiceResult) GetService() *v1.ValkeyService { - if x != nil { - return x.Service - } - return nil -} - -func (x *ValkeyServiceResult) GetValkeyExporter() *v1.ValkeyExporter { - if x != nil { - return x.ValkeyExporter - } - return nil -} - -var File_management_v1_valkey_proto protoreflect.FileDescriptor - -const file_management_v1_valkey_proto_rawDesc = "" + - "\n" + - "\x1amanagement/v1/valkey.proto\x12\rmanagement.v1\x1a\x19inventory/v1/agents.proto\x1a\x1cinventory/v1/log_level.proto\x1a\x1binventory/v1/services.proto\x1a\x1bmanagement/v1/metrics.proto\x1a\x18management/v1/node.proto\x1a\x17validate/validate.proto\"\xf5\a\n" + - "\x16AddValkeyServiceParams\x12#\n" + - "\anode_id\x18\x01 \x01(\tB\n" + - "\xfaB\ar\x05\x10\x01\xd0\x01\x01R\x06nodeId\x12'\n" + - "\tnode_name\x18\x02 \x01(\tB\n" + - "\xfaB\ar\x05\x10\x01\xd0\x01\x01R\bnodeName\x127\n" + - "\badd_node\x18\x03 \x01(\v2\x1c.management.v1.AddNodeParamsR\aaddNode\x12*\n" + - "\fservice_name\x18\x04 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\vserviceName\x12\x18\n" + - "\aaddress\x18\x05 \x01(\tR\aaddress\x12\x12\n" + - "\x04port\x18\x06 \x01(\rR\x04port\x12\x16\n" + - "\x06socket\x18\a \x01(\tR\x06socket\x12)\n" + - "\fpmm_agent_id\x18\b \x01(\tB\a\xfaB\x04r\x02\x10\x01R\n" + - "pmmAgentId\x12\x1a\n" + - "\busername\x18\t \x01(\tR\busername\x12\x1a\n" + - "\bpassword\x18\n" + - " \x01(\tR\bpassword\x12 \n" + - "\venvironment\x18\v \x01(\tR\venvironment\x12\x18\n" + - "\acluster\x18\f \x01(\tR\acluster\x12'\n" + - "\x0freplication_set\x18\r \x01(\tR\x0ereplicationSet\x12\\\n" + - "\rcustom_labels\x18\x0e \x03(\v27.management.v1.AddValkeyServiceParams.CustomLabelsEntryR\fcustomLabels\x122\n" + - "\x15skip_connection_check\x18\x0f \x01(\bR\x13skipConnectionCheck\x12\x10\n" + - "\x03tls\x18\x10 \x01(\bR\x03tls\x12&\n" + - "\x0ftls_skip_verify\x18\x11 \x01(\bR\rtlsSkipVerify\x12=\n" + - "\fmetrics_mode\x18\x12 \x01(\x0e2\x1a.management.v1.MetricsModeR\vmetricsMode\x123\n" + - "\tlog_level\x18\x13 \x01(\x0e2\x16.inventory.v1.LogLevelR\blogLevel\x12'\n" + - "\x0fexpose_exporter\x18\x14 \x01(\bR\x0eexposeExporter\x12\x15\n" + - "\x06tls_ca\x18\x15 \x01(\tR\x05tlsCa\x12\x19\n" + - "\btls_cert\x18\x16 \x01(\tR\atlsCert\x12\x17\n" + - "\atls_key\x18\x17 \x01(\tR\x06tlsKey\x12%\n" + - "\x0eagent_password\x18\x18 \x01(\tR\ragentPassword\x1a?\n" + - "\x11CustomLabelsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\x93\x01\n" + - "\x13ValkeyServiceResult\x125\n" + - "\aservice\x18\x01 \x01(\v2\x1b.inventory.v1.ValkeyServiceR\aservice\x12E\n" + - "\x0fvalkey_exporter\x18\x02 \x01(\v2\x1c.inventory.v1.ValkeyExporterR\x0evalkeyExporterB\xac\x01\n" + - "\x11com.management.v1B\vValkeyProtoP\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 ( - file_management_v1_valkey_proto_rawDescOnce sync.Once - file_management_v1_valkey_proto_rawDescData []byte -) - -func file_management_v1_valkey_proto_rawDescGZIP() []byte { - file_management_v1_valkey_proto_rawDescOnce.Do(func() { - file_management_v1_valkey_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_management_v1_valkey_proto_rawDesc), len(file_management_v1_valkey_proto_rawDesc))) - }) - 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_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 - 4, // 2: management.v1.AddValkeyServiceParams.metrics_mode:type_name -> management.v1.MetricsMode - 5, // 3: management.v1.AddValkeyServiceParams.log_level:type_name -> inventory.v1.LogLevel - 6, // 4: management.v1.ValkeyServiceResult.service:type_name -> inventory.v1.ValkeyService - 7, // 5: management.v1.ValkeyServiceResult.valkey_exporter:type_name -> inventory.v1.ValkeyExporter - 6, // [6:6] is the sub-list for method output_type - 6, // [6:6] is the sub-list for method input_type - 6, // [6:6] is the sub-list for extension type_name - 6, // [6:6] is the sub-list for extension extendee - 0, // [0:6] is the sub-list for field type_name -} - -func init() { file_management_v1_valkey_proto_init() } -func file_management_v1_valkey_proto_init() { - if File_management_v1_valkey_proto != nil { - return - } - file_management_v1_metrics_proto_init() - file_management_v1_node_proto_init() - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_management_v1_valkey_proto_rawDesc), len(file_management_v1_valkey_proto_rawDesc)), - NumEnums: 0, - NumMessages: 3, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_management_v1_valkey_proto_goTypes, - DependencyIndexes: file_management_v1_valkey_proto_depIdxs, - MessageInfos: file_management_v1_valkey_proto_msgTypes, - }.Build() - File_management_v1_valkey_proto = out.File - file_management_v1_valkey_proto_goTypes = nil - file_management_v1_valkey_proto_depIdxs = nil -} diff --git a/api/management/v1/valkey.pb.validate.go b/api/management/v1/valkey.pb.validate.go deleted file mode 100644 index 55268da8d34..00000000000 --- a/api/management/v1/valkey.pb.validate.go +++ /dev/null @@ -1,417 +0,0 @@ -// Code generated by protoc-gen-validate. DO NOT EDIT. -// source: management/v1/valkey.proto - -package managementv1 - -import ( - "bytes" - "errors" - "fmt" - "net" - "net/mail" - "net/url" - "regexp" - "sort" - "strings" - "time" - "unicode/utf8" - - "google.golang.org/protobuf/types/known/anypb" - - inventoryv1 "github.com/percona/pmm/api/inventory/v1" -) - -// ensure the imports are used -var ( - _ = bytes.MinRead - _ = errors.New("") - _ = fmt.Print - _ = utf8.UTFMax - _ = (*regexp.Regexp)(nil) - _ = (*strings.Reader)(nil) - _ = net.IPv4len - _ = time.Duration(0) - _ = (*url.URL)(nil) - _ = (*mail.Address)(nil) - _ = anypb.Any{} - _ = sort.Sort - - _ = inventoryv1.LogLevel(0) -) - -// Validate checks the field values on AddValkeyServiceParams 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 *AddValkeyServiceParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on AddValkeyServiceParams 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 -// AddValkeyServiceParamsMultiError, or nil if none found. -func (m *AddValkeyServiceParams) ValidateAll() error { - return m.validate(true) -} - -func (m *AddValkeyServiceParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if m.GetNodeId() != "" { - if utf8.RuneCountInString(m.GetNodeId()) < 1 { - err := AddValkeyServiceParamsValidationError{ - field: "NodeId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - } - - if m.GetNodeName() != "" { - if utf8.RuneCountInString(m.GetNodeName()) < 1 { - err := AddValkeyServiceParamsValidationError{ - field: "NodeName", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - } - - if all { - switch v := interface{}(m.GetAddNode()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AddValkeyServiceParamsValidationError{ - field: "AddNode", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AddValkeyServiceParamsValidationError{ - field: "AddNode", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetAddNode()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AddValkeyServiceParamsValidationError{ - field: "AddNode", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if utf8.RuneCountInString(m.GetServiceName()) < 1 { - err := AddValkeyServiceParamsValidationError{ - field: "ServiceName", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for Address - - // no validation rules for Port - - // no validation rules for Socket - - if utf8.RuneCountInString(m.GetPmmAgentId()) < 1 { - err := AddValkeyServiceParamsValidationError{ - field: "PmmAgentId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for Username - - // no validation rules for Password - - // no validation rules for Environment - - // no validation rules for Cluster - - // no validation rules for ReplicationSet - - // no validation rules for CustomLabels - - // no validation rules for SkipConnectionCheck - - // no validation rules for Tls - - // no validation rules for TlsSkipVerify - - // no validation rules for MetricsMode - - // no validation rules for LogLevel - - // no validation rules for ExposeExporter - - // no validation rules for TlsCa - - // no validation rules for TlsCert - - // no validation rules for TlsKey - - // no validation rules for AgentPassword - - if len(errors) > 0 { - return AddValkeyServiceParamsMultiError(errors) - } - - return nil -} - -// AddValkeyServiceParamsMultiError is an error wrapping multiple validation -// errors returned by AddValkeyServiceParams.ValidateAll() if the designated -// constraints aren't met. -type AddValkeyServiceParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m AddValkeyServiceParamsMultiError) 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 AddValkeyServiceParamsMultiError) AllErrors() []error { return m } - -// AddValkeyServiceParamsValidationError is the validation error returned by -// AddValkeyServiceParams.Validate if the designated constraints aren't met. -type AddValkeyServiceParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e AddValkeyServiceParamsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e AddValkeyServiceParamsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e AddValkeyServiceParamsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e AddValkeyServiceParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e AddValkeyServiceParamsValidationError) ErrorName() string { - return "AddValkeyServiceParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e AddValkeyServiceParamsValidationError) 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 %sAddValkeyServiceParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = AddValkeyServiceParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = AddValkeyServiceParamsValidationError{} - -// Validate checks the field values on ValkeyServiceResult 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 *ValkeyServiceResult) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ValkeyServiceResult 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 -// ValkeyServiceResultMultiError, or nil if none found. -func (m *ValkeyServiceResult) ValidateAll() error { - return m.validate(true) -} - -func (m *ValkeyServiceResult) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if all { - switch v := interface{}(m.GetService()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ValkeyServiceResultValidationError{ - field: "Service", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ValkeyServiceResultValidationError{ - field: "Service", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetService()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ValkeyServiceResultValidationError{ - field: "Service", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetValkeyExporter()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ValkeyServiceResultValidationError{ - field: "ValkeyExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ValkeyServiceResultValidationError{ - field: "ValkeyExporter", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetValkeyExporter()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ValkeyServiceResultValidationError{ - field: "ValkeyExporter", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if len(errors) > 0 { - return ValkeyServiceResultMultiError(errors) - } - - return nil -} - -// ValkeyServiceResultMultiError is an error wrapping multiple validation -// errors returned by ValkeyServiceResult.ValidateAll() if the designated -// constraints aren't met. -type ValkeyServiceResultMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ValkeyServiceResultMultiError) 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 ValkeyServiceResultMultiError) AllErrors() []error { return m } - -// ValkeyServiceResultValidationError is the validation error returned by -// ValkeyServiceResult.Validate if the designated constraints aren't met. -type ValkeyServiceResultValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ValkeyServiceResultValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ValkeyServiceResultValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ValkeyServiceResultValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ValkeyServiceResultValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ValkeyServiceResultValidationError) ErrorName() string { - return "ValkeyServiceResultValidationError" -} - -// Error satisfies the builtin error interface -func (e ValkeyServiceResultValidationError) 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 %sValkeyServiceResult.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ValkeyServiceResultValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ValkeyServiceResultValidationError{} diff --git a/api/platform/v1/json/client/platform_service/connect_parameters.go b/api/platform/v1/json/client/platform_service/connect_parameters.go deleted file mode 100644 index 9c19eb64d1a..00000000000 --- a/api/platform/v1/json/client/platform_service/connect_parameters.go +++ /dev/null @@ -1,144 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package platform_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" -) - -// NewConnectParams creates a new ConnectParams 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 NewConnectParams() *ConnectParams { - return &ConnectParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewConnectParamsWithTimeout creates a new ConnectParams object -// with the ability to set a timeout on a request. -func NewConnectParamsWithTimeout(timeout time.Duration) *ConnectParams { - return &ConnectParams{ - timeout: timeout, - } -} - -// NewConnectParamsWithContext creates a new ConnectParams object -// with the ability to set a context for a request. -func NewConnectParamsWithContext(ctx context.Context) *ConnectParams { - return &ConnectParams{ - Context: ctx, - } -} - -// NewConnectParamsWithHTTPClient creates a new ConnectParams object -// with the ability to set a custom HTTPClient for a request. -func NewConnectParamsWithHTTPClient(client *http.Client) *ConnectParams { - return &ConnectParams{ - HTTPClient: client, - } -} - -/* -ConnectParams contains all the parameters to send to the API endpoint - - for the connect operation. - - Typically these are written to a http.Request. -*/ -type ConnectParams struct { - // Body. - Body ConnectBody - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the connect params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ConnectParams) WithDefaults() *ConnectParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the connect params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ConnectParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the connect params -func (o *ConnectParams) WithTimeout(timeout time.Duration) *ConnectParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the connect params -func (o *ConnectParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the connect params -func (o *ConnectParams) WithContext(ctx context.Context) *ConnectParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the connect params -func (o *ConnectParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the connect params -func (o *ConnectParams) WithHTTPClient(client *http.Client) *ConnectParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the connect params -func (o *ConnectParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the connect params -func (o *ConnectParams) WithBody(body ConnectBody) *ConnectParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the connect params -func (o *ConnectParams) SetBody(body ConnectBody) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *ConnectParams) 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/platform/v1/json/client/platform_service/connect_responses.go b/api/platform/v1/json/client/platform_service/connect_responses.go deleted file mode 100644 index 5e06ba2da43..00000000000 --- a/api/platform/v1/json/client/platform_service/connect_responses.go +++ /dev/null @@ -1,454 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package platform_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" -) - -// ConnectReader is a Reader for the Connect structure. -type ConnectReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ConnectReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewConnectOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewConnectDefault(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 - } -} - -// NewConnectOK creates a ConnectOK with default headers values -func NewConnectOK() *ConnectOK { - return &ConnectOK{} -} - -/* -ConnectOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type ConnectOK struct { - Payload any -} - -// IsSuccess returns true when this connect Ok response has a 2xx status code -func (o *ConnectOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this connect Ok response has a 3xx status code -func (o *ConnectOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this connect Ok response has a 4xx status code -func (o *ConnectOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this connect Ok response has a 5xx status code -func (o *ConnectOK) IsServerError() bool { - return false -} - -// IsCode returns true when this connect Ok response a status code equal to that given -func (o *ConnectOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the connect Ok response -func (o *ConnectOK) Code() int { - return 200 -} - -func (o *ConnectOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/platform:connect][%d] connectOk %s", 200, payload) -} - -func (o *ConnectOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/platform:connect][%d] connectOk %s", 200, payload) -} - -func (o *ConnectOK) GetPayload() any { - return o.Payload -} - -func (o *ConnectOK) 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) { - return err - } - - return nil -} - -// NewConnectDefault creates a ConnectDefault with default headers values -func NewConnectDefault(code int) *ConnectDefault { - return &ConnectDefault{ - _statusCode: code, - } -} - -/* -ConnectDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type ConnectDefault struct { - _statusCode int - - Payload *ConnectDefaultBody -} - -// IsSuccess returns true when this connect default response has a 2xx status code -func (o *ConnectDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this connect default response has a 3xx status code -func (o *ConnectDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this connect default response has a 4xx status code -func (o *ConnectDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this connect default response has a 5xx status code -func (o *ConnectDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this connect default response a status code equal to that given -func (o *ConnectDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the connect default response -func (o *ConnectDefault) Code() int { - return o._statusCode -} - -func (o *ConnectDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/platform:connect][%d] Connect default %s", o._statusCode, payload) -} - -func (o *ConnectDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/platform:connect][%d] Connect default %s", o._statusCode, payload) -} - -func (o *ConnectDefault) GetPayload() *ConnectDefaultBody { - return o.Payload -} - -func (o *ConnectDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(ConnectDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -ConnectBody connect body -swagger:model ConnectBody -*/ -type ConnectBody struct { - // User defined human readable PMM Server Name. - ServerName string `json:"server_name,omitempty"` - - // Personal Access Token that the user obtains from Percona Portal. - PersonalAccessToken string `json:"personal_access_token,omitempty"` -} - -// Validate validates this connect body -func (o *ConnectBody) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this connect body based on context it is used -func (o *ConnectBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ConnectBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ConnectBody) UnmarshalBinary(b []byte) error { - var res ConnectBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ConnectDefaultBody connect default body -swagger:model ConnectDefaultBody -*/ -type ConnectDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*ConnectDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this connect default body -func (o *ConnectDefaultBody) 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 *ConnectDefaultBody) 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("Connect default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("Connect default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this connect default body based on the context it is used -func (o *ConnectDefaultBody) 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 *ConnectDefaultBody) 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("Connect default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("Connect default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ConnectDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ConnectDefaultBody) UnmarshalBinary(b []byte) error { - var res ConnectDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ConnectDefaultBodyDetailsItems0 connect default body details items0 -swagger:model ConnectDefaultBodyDetailsItems0 -*/ -type ConnectDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` - - // connect default body details items0 - ConnectDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *ConnectDefaultBodyDetailsItems0) 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 ConnectDefaultBodyDetailsItems0 - - 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.ConnectDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o ConnectDefaultBodyDetailsItems0) 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.ConnectDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.ConnectDefaultBodyDetailsItems0) - 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 connect default body details items0 -func (o *ConnectDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this connect default body details items0 based on context it is used -func (o *ConnectDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ConnectDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ConnectDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res ConnectDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/platform/v1/json/client/platform_service/disconnect_parameters.go b/api/platform/v1/json/client/platform_service/disconnect_parameters.go deleted file mode 100644 index b8a19f59725..00000000000 --- a/api/platform/v1/json/client/platform_service/disconnect_parameters.go +++ /dev/null @@ -1,144 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package platform_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" -) - -// NewDisconnectParams creates a new DisconnectParams 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 NewDisconnectParams() *DisconnectParams { - return &DisconnectParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDisconnectParamsWithTimeout creates a new DisconnectParams object -// with the ability to set a timeout on a request. -func NewDisconnectParamsWithTimeout(timeout time.Duration) *DisconnectParams { - return &DisconnectParams{ - timeout: timeout, - } -} - -// NewDisconnectParamsWithContext creates a new DisconnectParams object -// with the ability to set a context for a request. -func NewDisconnectParamsWithContext(ctx context.Context) *DisconnectParams { - return &DisconnectParams{ - Context: ctx, - } -} - -// NewDisconnectParamsWithHTTPClient creates a new DisconnectParams object -// with the ability to set a custom HTTPClient for a request. -func NewDisconnectParamsWithHTTPClient(client *http.Client) *DisconnectParams { - return &DisconnectParams{ - HTTPClient: client, - } -} - -/* -DisconnectParams contains all the parameters to send to the API endpoint - - for the disconnect operation. - - Typically these are written to a http.Request. -*/ -type DisconnectParams struct { - // Body. - Body DisconnectBody - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the disconnect params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DisconnectParams) WithDefaults() *DisconnectParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the disconnect params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DisconnectParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the disconnect params -func (o *DisconnectParams) WithTimeout(timeout time.Duration) *DisconnectParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the disconnect params -func (o *DisconnectParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the disconnect params -func (o *DisconnectParams) WithContext(ctx context.Context) *DisconnectParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the disconnect params -func (o *DisconnectParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the disconnect params -func (o *DisconnectParams) WithHTTPClient(client *http.Client) *DisconnectParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the disconnect params -func (o *DisconnectParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the disconnect params -func (o *DisconnectParams) WithBody(body DisconnectBody) *DisconnectParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the disconnect params -func (o *DisconnectParams) SetBody(body DisconnectBody) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *DisconnectParams) 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/platform/v1/json/client/platform_service/disconnect_responses.go b/api/platform/v1/json/client/platform_service/disconnect_responses.go deleted file mode 100644 index 22db011f06b..00000000000 --- a/api/platform/v1/json/client/platform_service/disconnect_responses.go +++ /dev/null @@ -1,451 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package platform_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" -) - -// DisconnectReader is a Reader for the Disconnect structure. -type DisconnectReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DisconnectReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewDisconnectOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewDisconnectDefault(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 - } -} - -// NewDisconnectOK creates a DisconnectOK with default headers values -func NewDisconnectOK() *DisconnectOK { - return &DisconnectOK{} -} - -/* -DisconnectOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type DisconnectOK struct { - Payload any -} - -// IsSuccess returns true when this disconnect Ok response has a 2xx status code -func (o *DisconnectOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this disconnect Ok response has a 3xx status code -func (o *DisconnectOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this disconnect Ok response has a 4xx status code -func (o *DisconnectOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this disconnect Ok response has a 5xx status code -func (o *DisconnectOK) IsServerError() bool { - return false -} - -// IsCode returns true when this disconnect Ok response a status code equal to that given -func (o *DisconnectOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the disconnect Ok response -func (o *DisconnectOK) Code() int { - return 200 -} - -func (o *DisconnectOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/platform:disconnect][%d] disconnectOk %s", 200, payload) -} - -func (o *DisconnectOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/platform:disconnect][%d] disconnectOk %s", 200, payload) -} - -func (o *DisconnectOK) GetPayload() any { - return o.Payload -} - -func (o *DisconnectOK) 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) { - return err - } - - return nil -} - -// NewDisconnectDefault creates a DisconnectDefault with default headers values -func NewDisconnectDefault(code int) *DisconnectDefault { - return &DisconnectDefault{ - _statusCode: code, - } -} - -/* -DisconnectDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type DisconnectDefault struct { - _statusCode int - - Payload *DisconnectDefaultBody -} - -// IsSuccess returns true when this disconnect default response has a 2xx status code -func (o *DisconnectDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this disconnect default response has a 3xx status code -func (o *DisconnectDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this disconnect default response has a 4xx status code -func (o *DisconnectDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this disconnect default response has a 5xx status code -func (o *DisconnectDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this disconnect default response a status code equal to that given -func (o *DisconnectDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the disconnect default response -func (o *DisconnectDefault) Code() int { - return o._statusCode -} - -func (o *DisconnectDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/platform:disconnect][%d] Disconnect default %s", o._statusCode, payload) -} - -func (o *DisconnectDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/platform:disconnect][%d] Disconnect default %s", o._statusCode, payload) -} - -func (o *DisconnectDefault) GetPayload() *DisconnectDefaultBody { - return o.Payload -} - -func (o *DisconnectDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(DisconnectDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -DisconnectBody disconnect body -swagger:model DisconnectBody -*/ -type DisconnectBody struct { - // Forces the cleanup process for connected PMM instances regardless of the Portal API response - Force bool `json:"force,omitempty"` -} - -// Validate validates this disconnect body -func (o *DisconnectBody) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this disconnect body based on context it is used -func (o *DisconnectBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *DisconnectBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *DisconnectBody) UnmarshalBinary(b []byte) error { - var res DisconnectBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -DisconnectDefaultBody disconnect default body -swagger:model DisconnectDefaultBody -*/ -type DisconnectDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*DisconnectDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this disconnect default body -func (o *DisconnectDefaultBody) 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 *DisconnectDefaultBody) 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("Disconnect default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("Disconnect default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this disconnect default body based on the context it is used -func (o *DisconnectDefaultBody) 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 *DisconnectDefaultBody) 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("Disconnect default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("Disconnect default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *DisconnectDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *DisconnectDefaultBody) UnmarshalBinary(b []byte) error { - var res DisconnectDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -DisconnectDefaultBodyDetailsItems0 disconnect default body details items0 -swagger:model DisconnectDefaultBodyDetailsItems0 -*/ -type DisconnectDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` - - // disconnect default body details items0 - DisconnectDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *DisconnectDefaultBodyDetailsItems0) 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 DisconnectDefaultBodyDetailsItems0 - - 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.DisconnectDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o DisconnectDefaultBodyDetailsItems0) 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.DisconnectDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.DisconnectDefaultBodyDetailsItems0) - 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 disconnect default body details items0 -func (o *DisconnectDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this disconnect default body details items0 based on context it is used -func (o *DisconnectDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *DisconnectDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *DisconnectDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res DisconnectDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/platform/v1/json/client/platform_service/get_contact_information_parameters.go b/api/platform/v1/json/client/platform_service/get_contact_information_parameters.go deleted file mode 100644 index 5f1da0f3292..00000000000 --- a/api/platform/v1/json/client/platform_service/get_contact_information_parameters.go +++ /dev/null @@ -1,127 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package platform_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" -) - -// NewGetContactInformationParams creates a new GetContactInformationParams 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 NewGetContactInformationParams() *GetContactInformationParams { - return &GetContactInformationParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetContactInformationParamsWithTimeout creates a new GetContactInformationParams object -// with the ability to set a timeout on a request. -func NewGetContactInformationParamsWithTimeout(timeout time.Duration) *GetContactInformationParams { - return &GetContactInformationParams{ - timeout: timeout, - } -} - -// NewGetContactInformationParamsWithContext creates a new GetContactInformationParams object -// with the ability to set a context for a request. -func NewGetContactInformationParamsWithContext(ctx context.Context) *GetContactInformationParams { - return &GetContactInformationParams{ - Context: ctx, - } -} - -// NewGetContactInformationParamsWithHTTPClient creates a new GetContactInformationParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetContactInformationParamsWithHTTPClient(client *http.Client) *GetContactInformationParams { - return &GetContactInformationParams{ - HTTPClient: client, - } -} - -/* -GetContactInformationParams contains all the parameters to send to the API endpoint - - for the get contact information operation. - - Typically these are written to a http.Request. -*/ -type GetContactInformationParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get contact information params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetContactInformationParams) WithDefaults() *GetContactInformationParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get contact information params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetContactInformationParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the get contact information params -func (o *GetContactInformationParams) WithTimeout(timeout time.Duration) *GetContactInformationParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get contact information params -func (o *GetContactInformationParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get contact information params -func (o *GetContactInformationParams) WithContext(ctx context.Context) *GetContactInformationParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get contact information params -func (o *GetContactInformationParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get contact information params -func (o *GetContactInformationParams) WithHTTPClient(client *http.Client) *GetContactInformationParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get contact information params -func (o *GetContactInformationParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *GetContactInformationParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/api/platform/v1/json/client/platform_service/get_contact_information_responses.go b/api/platform/v1/json/client/platform_service/get_contact_information_responses.go deleted file mode 100644 index d37c2d5a67d..00000000000 --- a/api/platform/v1/json/client/platform_service/get_contact_information_responses.go +++ /dev/null @@ -1,561 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package platform_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" -) - -// GetContactInformationReader is a Reader for the GetContactInformation structure. -type GetContactInformationReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetContactInformationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewGetContactInformationOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewGetContactInformationDefault(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 - } -} - -// NewGetContactInformationOK creates a GetContactInformationOK with default headers values -func NewGetContactInformationOK() *GetContactInformationOK { - return &GetContactInformationOK{} -} - -/* -GetContactInformationOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type GetContactInformationOK struct { - Payload *GetContactInformationOKBody -} - -// IsSuccess returns true when this get contact information Ok response has a 2xx status code -func (o *GetContactInformationOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this get contact information Ok response has a 3xx status code -func (o *GetContactInformationOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this get contact information Ok response has a 4xx status code -func (o *GetContactInformationOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this get contact information Ok response has a 5xx status code -func (o *GetContactInformationOK) IsServerError() bool { - return false -} - -// IsCode returns true when this get contact information Ok response a status code equal to that given -func (o *GetContactInformationOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the get contact information Ok response -func (o *GetContactInformationOK) Code() int { - return 200 -} - -func (o *GetContactInformationOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/platform/contact][%d] getContactInformationOk %s", 200, payload) -} - -func (o *GetContactInformationOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/platform/contact][%d] getContactInformationOk %s", 200, payload) -} - -func (o *GetContactInformationOK) GetPayload() *GetContactInformationOKBody { - return o.Payload -} - -func (o *GetContactInformationOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(GetContactInformationOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -// NewGetContactInformationDefault creates a GetContactInformationDefault with default headers values -func NewGetContactInformationDefault(code int) *GetContactInformationDefault { - return &GetContactInformationDefault{ - _statusCode: code, - } -} - -/* -GetContactInformationDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type GetContactInformationDefault struct { - _statusCode int - - Payload *GetContactInformationDefaultBody -} - -// IsSuccess returns true when this get contact information default response has a 2xx status code -func (o *GetContactInformationDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this get contact information default response has a 3xx status code -func (o *GetContactInformationDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this get contact information default response has a 4xx status code -func (o *GetContactInformationDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this get contact information default response has a 5xx status code -func (o *GetContactInformationDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this get contact information default response a status code equal to that given -func (o *GetContactInformationDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the get contact information default response -func (o *GetContactInformationDefault) Code() int { - return o._statusCode -} - -func (o *GetContactInformationDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/platform/contact][%d] GetContactInformation default %s", o._statusCode, payload) -} - -func (o *GetContactInformationDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/platform/contact][%d] GetContactInformation default %s", o._statusCode, payload) -} - -func (o *GetContactInformationDefault) GetPayload() *GetContactInformationDefaultBody { - return o.Payload -} - -func (o *GetContactInformationDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(GetContactInformationDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -GetContactInformationDefaultBody get contact information default body -swagger:model GetContactInformationDefaultBody -*/ -type GetContactInformationDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*GetContactInformationDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this get contact information default body -func (o *GetContactInformationDefaultBody) 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 *GetContactInformationDefaultBody) 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("GetContactInformation default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("GetContactInformation default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this get contact information default body based on the context it is used -func (o *GetContactInformationDefaultBody) 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 *GetContactInformationDefaultBody) 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("GetContactInformation default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("GetContactInformation default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetContactInformationDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetContactInformationDefaultBody) UnmarshalBinary(b []byte) error { - var res GetContactInformationDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetContactInformationDefaultBodyDetailsItems0 get contact information default body details items0 -swagger:model GetContactInformationDefaultBodyDetailsItems0 -*/ -type GetContactInformationDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` - - // get contact information default body details items0 - GetContactInformationDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *GetContactInformationDefaultBodyDetailsItems0) 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 GetContactInformationDefaultBodyDetailsItems0 - - 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.GetContactInformationDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o GetContactInformationDefaultBodyDetailsItems0) 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.GetContactInformationDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.GetContactInformationDefaultBodyDetailsItems0) - 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 get contact information default body details items0 -func (o *GetContactInformationDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get contact information default body details items0 based on context it is used -func (o *GetContactInformationDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetContactInformationDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetContactInformationDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res GetContactInformationDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetContactInformationOKBody get contact information OK body -swagger:model GetContactInformationOKBody -*/ -type GetContactInformationOKBody struct { - // URL to open a new support ticket. - NewTicketURL string `json:"new_ticket_url,omitempty"` - - // customer success - CustomerSuccess *GetContactInformationOKBodyCustomerSuccess `json:"customer_success,omitempty"` -} - -// Validate validates this get contact information OK body -func (o *GetContactInformationOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateCustomerSuccess(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetContactInformationOKBody) validateCustomerSuccess(formats strfmt.Registry) error { - if swag.IsZero(o.CustomerSuccess) { // not required - return nil - } - - if o.CustomerSuccess != nil { - if err := o.CustomerSuccess.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getContactInformationOk" + "." + "customer_success") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getContactInformationOk" + "." + "customer_success") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this get contact information OK body based on the context it is used -func (o *GetContactInformationOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateCustomerSuccess(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetContactInformationOKBody) contextValidateCustomerSuccess(ctx context.Context, formats strfmt.Registry) error { - if o.CustomerSuccess != nil { - - if swag.IsZero(o.CustomerSuccess) { // not required - return nil - } - - if err := o.CustomerSuccess.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getContactInformationOk" + "." + "customer_success") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getContactInformationOk" + "." + "customer_success") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetContactInformationOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetContactInformationOKBody) UnmarshalBinary(b []byte) error { - var res GetContactInformationOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetContactInformationOKBodyCustomerSuccess CustomerSuccess contains the contanct details of the customer success employee assigned to a customer's account. -swagger:model GetContactInformationOKBodyCustomerSuccess -*/ -type GetContactInformationOKBodyCustomerSuccess struct { - // name - Name string `json:"name,omitempty"` - - // email - Email string `json:"email,omitempty"` -} - -// Validate validates this get contact information OK body customer success -func (o *GetContactInformationOKBodyCustomerSuccess) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get contact information OK body customer success based on context it is used -func (o *GetContactInformationOKBodyCustomerSuccess) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetContactInformationOKBodyCustomerSuccess) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetContactInformationOKBodyCustomerSuccess) UnmarshalBinary(b []byte) error { - var res GetContactInformationOKBodyCustomerSuccess - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/platform/v1/json/client/platform_service/platform_service_client.go b/api/platform/v1/json/client/platform_service/platform_service_client.go deleted file mode 100644 index a11721b6e4e..00000000000 --- a/api/platform/v1/json/client/platform_service/platform_service_client.go +++ /dev/null @@ -1,385 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package platform_service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// New creates a new platform service API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -// New creates a new platform service API client with basic auth credentials. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - user: user for basic authentication header. -// - password: password for basic authentication header. -func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BasicAuth(user, password) - return &Client{transport: transport, formats: strfmt.Default} -} - -// New creates a new platform service API client with a bearer token for authentication. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - bearerToken: bearer token for Bearer authentication header. -func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BearerToken(bearerToken) - return &Client{transport: transport, formats: strfmt.Default} -} - -/* -Client for platform service API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption may be used to customize the behavior of Client methods. -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - Connect(params *ConnectParams, opts ...ClientOption) (*ConnectOK, error) - - Disconnect(params *DisconnectParams, opts ...ClientOption) (*DisconnectOK, error) - - GetContactInformation(params *GetContactInformationParams, opts ...ClientOption) (*GetContactInformationOK, error) - - SearchOrganizationEntitlements(params *SearchOrganizationEntitlementsParams, opts ...ClientOption) (*SearchOrganizationEntitlementsOK, error) - - SearchOrganizationTickets(params *SearchOrganizationTicketsParams, opts ...ClientOption) (*SearchOrganizationTicketsOK, error) - - ServerInfo(params *ServerInfoParams, opts ...ClientOption) (*ServerInfoOK, error) - - UserStatus(params *UserStatusParams, opts ...ClientOption) (*UserStatusOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -Connect connects PMM server - -Connect a PMM server to the organization created on Percona Portal. That allows the user to sign in to the PMM server with their Percona Account. -*/ -func (a *Client) Connect(params *ConnectParams, opts ...ClientOption) (*ConnectOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewConnectParams() - } - op := &runtime.ClientOperation{ - ID: "Connect", - Method: "POST", - PathPattern: "/v1/platform:connect", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &ConnectReader{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.(*ConnectOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*ConnectDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -Disconnect disconnects PMM server - -Disconnect a PMM server from the organization created on Percona Portal. -*/ -func (a *Client) Disconnect(params *DisconnectParams, opts ...ClientOption) (*DisconnectOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewDisconnectParams() - } - op := &runtime.ClientOperation{ - ID: "Disconnect", - Method: "POST", - PathPattern: "/v1/platform:disconnect", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &DisconnectReader{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.(*DisconnectOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*DisconnectDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -GetContactInformation gets contact information - -Fetch the contact details of the customer success employee handling the Percona customer account. -*/ -func (a *Client) GetContactInformation(params *GetContactInformationParams, opts ...ClientOption) (*GetContactInformationOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewGetContactInformationParams() - } - op := &runtime.ClientOperation{ - ID: "GetContactInformation", - Method: "GET", - PathPattern: "/v1/platform/contact", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &GetContactInformationReader{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.(*GetContactInformationOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*GetContactInformationDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -SearchOrganizationEntitlements searches organization entitlements - -Fetch entitlements available to the Portal organization that the PMM server is connected to. -*/ -func (a *Client) SearchOrganizationEntitlements(params *SearchOrganizationEntitlementsParams, opts ...ClientOption) (*SearchOrganizationEntitlementsOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewSearchOrganizationEntitlementsParams() - } - op := &runtime.ClientOperation{ - ID: "SearchOrganizationEntitlements", - Method: "GET", - PathPattern: "/v1/platform/organization/entitlements", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &SearchOrganizationEntitlementsReader{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.(*SearchOrganizationEntitlementsOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*SearchOrganizationEntitlementsDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -SearchOrganizationTickets searches organization tickets - -Fetch support tickets belonging to the Percona Portal Organization that the PMM server is connected to. -*/ -func (a *Client) SearchOrganizationTickets(params *SearchOrganizationTicketsParams, opts ...ClientOption) (*SearchOrganizationTicketsOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewSearchOrganizationTicketsParams() - } - op := &runtime.ClientOperation{ - ID: "SearchOrganizationTickets", - Method: "GET", - PathPattern: "/v1/platform/organization/tickets", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &SearchOrganizationTicketsReader{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.(*SearchOrganizationTicketsOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*SearchOrganizationTicketsDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -ServerInfo gets server info - -Return PMM server ID and name. -*/ -func (a *Client) ServerInfo(params *ServerInfoParams, opts ...ClientOption) (*ServerInfoOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewServerInfoParams() - } - op := &runtime.ClientOperation{ - ID: "ServerInfo", - Method: "GET", - PathPattern: "/v1/platform/server", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &ServerInfoReader{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.(*ServerInfoOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*ServerInfoDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -UserStatus gets user status - -Check if the current user is logged in with their Percona Account. -*/ -func (a *Client) UserStatus(params *UserStatusParams, opts ...ClientOption) (*UserStatusOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewUserStatusParams() - } - op := &runtime.ClientOperation{ - ID: "UserStatus", - Method: "GET", - PathPattern: "/v1/platform/user", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &UserStatusReader{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.(*UserStatusOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*UserStatusDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/api/platform/v1/json/client/platform_service/search_organization_entitlements_parameters.go b/api/platform/v1/json/client/platform_service/search_organization_entitlements_parameters.go deleted file mode 100644 index a63841d6740..00000000000 --- a/api/platform/v1/json/client/platform_service/search_organization_entitlements_parameters.go +++ /dev/null @@ -1,127 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package platform_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" -) - -// NewSearchOrganizationEntitlementsParams creates a new SearchOrganizationEntitlementsParams 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 NewSearchOrganizationEntitlementsParams() *SearchOrganizationEntitlementsParams { - return &SearchOrganizationEntitlementsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewSearchOrganizationEntitlementsParamsWithTimeout creates a new SearchOrganizationEntitlementsParams object -// with the ability to set a timeout on a request. -func NewSearchOrganizationEntitlementsParamsWithTimeout(timeout time.Duration) *SearchOrganizationEntitlementsParams { - return &SearchOrganizationEntitlementsParams{ - timeout: timeout, - } -} - -// NewSearchOrganizationEntitlementsParamsWithContext creates a new SearchOrganizationEntitlementsParams object -// with the ability to set a context for a request. -func NewSearchOrganizationEntitlementsParamsWithContext(ctx context.Context) *SearchOrganizationEntitlementsParams { - return &SearchOrganizationEntitlementsParams{ - Context: ctx, - } -} - -// NewSearchOrganizationEntitlementsParamsWithHTTPClient creates a new SearchOrganizationEntitlementsParams object -// with the ability to set a custom HTTPClient for a request. -func NewSearchOrganizationEntitlementsParamsWithHTTPClient(client *http.Client) *SearchOrganizationEntitlementsParams { - return &SearchOrganizationEntitlementsParams{ - HTTPClient: client, - } -} - -/* -SearchOrganizationEntitlementsParams contains all the parameters to send to the API endpoint - - for the search organization entitlements operation. - - Typically these are written to a http.Request. -*/ -type SearchOrganizationEntitlementsParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the search organization entitlements params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *SearchOrganizationEntitlementsParams) WithDefaults() *SearchOrganizationEntitlementsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the search organization entitlements params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *SearchOrganizationEntitlementsParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the search organization entitlements params -func (o *SearchOrganizationEntitlementsParams) WithTimeout(timeout time.Duration) *SearchOrganizationEntitlementsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the search organization entitlements params -func (o *SearchOrganizationEntitlementsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the search organization entitlements params -func (o *SearchOrganizationEntitlementsParams) WithContext(ctx context.Context) *SearchOrganizationEntitlementsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the search organization entitlements params -func (o *SearchOrganizationEntitlementsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the search organization entitlements params -func (o *SearchOrganizationEntitlementsParams) WithHTTPClient(client *http.Client) *SearchOrganizationEntitlementsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the search organization entitlements params -func (o *SearchOrganizationEntitlementsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *SearchOrganizationEntitlementsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/api/platform/v1/json/client/platform_service/search_organization_entitlements_responses.go b/api/platform/v1/json/client/platform_service/search_organization_entitlements_responses.go deleted file mode 100644 index 37aa0c9c799..00000000000 --- a/api/platform/v1/json/client/platform_service/search_organization_entitlements_responses.go +++ /dev/null @@ -1,736 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package platform_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" -) - -// SearchOrganizationEntitlementsReader is a Reader for the SearchOrganizationEntitlements structure. -type SearchOrganizationEntitlementsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *SearchOrganizationEntitlementsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewSearchOrganizationEntitlementsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewSearchOrganizationEntitlementsDefault(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 - } -} - -// NewSearchOrganizationEntitlementsOK creates a SearchOrganizationEntitlementsOK with default headers values -func NewSearchOrganizationEntitlementsOK() *SearchOrganizationEntitlementsOK { - return &SearchOrganizationEntitlementsOK{} -} - -/* -SearchOrganizationEntitlementsOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type SearchOrganizationEntitlementsOK struct { - Payload *SearchOrganizationEntitlementsOKBody -} - -// IsSuccess returns true when this search organization entitlements Ok response has a 2xx status code -func (o *SearchOrganizationEntitlementsOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this search organization entitlements Ok response has a 3xx status code -func (o *SearchOrganizationEntitlementsOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this search organization entitlements Ok response has a 4xx status code -func (o *SearchOrganizationEntitlementsOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this search organization entitlements Ok response has a 5xx status code -func (o *SearchOrganizationEntitlementsOK) IsServerError() bool { - return false -} - -// IsCode returns true when this search organization entitlements Ok response a status code equal to that given -func (o *SearchOrganizationEntitlementsOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the search organization entitlements Ok response -func (o *SearchOrganizationEntitlementsOK) Code() int { - return 200 -} - -func (o *SearchOrganizationEntitlementsOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/platform/organization/entitlements][%d] searchOrganizationEntitlementsOk %s", 200, payload) -} - -func (o *SearchOrganizationEntitlementsOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/platform/organization/entitlements][%d] searchOrganizationEntitlementsOk %s", 200, payload) -} - -func (o *SearchOrganizationEntitlementsOK) GetPayload() *SearchOrganizationEntitlementsOKBody { - return o.Payload -} - -func (o *SearchOrganizationEntitlementsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(SearchOrganizationEntitlementsOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -// NewSearchOrganizationEntitlementsDefault creates a SearchOrganizationEntitlementsDefault with default headers values -func NewSearchOrganizationEntitlementsDefault(code int) *SearchOrganizationEntitlementsDefault { - return &SearchOrganizationEntitlementsDefault{ - _statusCode: code, - } -} - -/* -SearchOrganizationEntitlementsDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type SearchOrganizationEntitlementsDefault struct { - _statusCode int - - Payload *SearchOrganizationEntitlementsDefaultBody -} - -// IsSuccess returns true when this search organization entitlements default response has a 2xx status code -func (o *SearchOrganizationEntitlementsDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this search organization entitlements default response has a 3xx status code -func (o *SearchOrganizationEntitlementsDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this search organization entitlements default response has a 4xx status code -func (o *SearchOrganizationEntitlementsDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this search organization entitlements default response has a 5xx status code -func (o *SearchOrganizationEntitlementsDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this search organization entitlements default response a status code equal to that given -func (o *SearchOrganizationEntitlementsDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the search organization entitlements default response -func (o *SearchOrganizationEntitlementsDefault) Code() int { - return o._statusCode -} - -func (o *SearchOrganizationEntitlementsDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/platform/organization/entitlements][%d] SearchOrganizationEntitlements default %s", o._statusCode, payload) -} - -func (o *SearchOrganizationEntitlementsDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/platform/organization/entitlements][%d] SearchOrganizationEntitlements default %s", o._statusCode, payload) -} - -func (o *SearchOrganizationEntitlementsDefault) GetPayload() *SearchOrganizationEntitlementsDefaultBody { - return o.Payload -} - -func (o *SearchOrganizationEntitlementsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(SearchOrganizationEntitlementsDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -SearchOrganizationEntitlementsDefaultBody search organization entitlements default body -swagger:model SearchOrganizationEntitlementsDefaultBody -*/ -type SearchOrganizationEntitlementsDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*SearchOrganizationEntitlementsDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this search organization entitlements default body -func (o *SearchOrganizationEntitlementsDefaultBody) 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 *SearchOrganizationEntitlementsDefaultBody) 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("SearchOrganizationEntitlements default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("SearchOrganizationEntitlements default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this search organization entitlements default body based on the context it is used -func (o *SearchOrganizationEntitlementsDefaultBody) 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 *SearchOrganizationEntitlementsDefaultBody) 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("SearchOrganizationEntitlements default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("SearchOrganizationEntitlements default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *SearchOrganizationEntitlementsDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *SearchOrganizationEntitlementsDefaultBody) UnmarshalBinary(b []byte) error { - var res SearchOrganizationEntitlementsDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -SearchOrganizationEntitlementsDefaultBodyDetailsItems0 search organization entitlements default body details items0 -swagger:model SearchOrganizationEntitlementsDefaultBodyDetailsItems0 -*/ -type SearchOrganizationEntitlementsDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` - - // search organization entitlements default body details items0 - SearchOrganizationEntitlementsDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *SearchOrganizationEntitlementsDefaultBodyDetailsItems0) 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 SearchOrganizationEntitlementsDefaultBodyDetailsItems0 - - 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.SearchOrganizationEntitlementsDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o SearchOrganizationEntitlementsDefaultBodyDetailsItems0) 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.SearchOrganizationEntitlementsDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.SearchOrganizationEntitlementsDefaultBodyDetailsItems0) - 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 search organization entitlements default body details items0 -func (o *SearchOrganizationEntitlementsDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this search organization entitlements default body details items0 based on context it is used -func (o *SearchOrganizationEntitlementsDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *SearchOrganizationEntitlementsDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *SearchOrganizationEntitlementsDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res SearchOrganizationEntitlementsDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -SearchOrganizationEntitlementsOKBody search organization entitlements OK body -swagger:model SearchOrganizationEntitlementsOKBody -*/ -type SearchOrganizationEntitlementsOKBody struct { - // entitlements - Entitlements []*SearchOrganizationEntitlementsOKBodyEntitlementsItems0 `json:"entitlements"` -} - -// Validate validates this search organization entitlements OK body -func (o *SearchOrganizationEntitlementsOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateEntitlements(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *SearchOrganizationEntitlementsOKBody) validateEntitlements(formats strfmt.Registry) error { - if swag.IsZero(o.Entitlements) { // not required - return nil - } - - for i := 0; i < len(o.Entitlements); i++ { - if swag.IsZero(o.Entitlements[i]) { // not required - continue - } - - if o.Entitlements[i] != nil { - if err := o.Entitlements[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("searchOrganizationEntitlementsOk" + "." + "entitlements" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("searchOrganizationEntitlementsOk" + "." + "entitlements" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this search organization entitlements OK body based on the context it is used -func (o *SearchOrganizationEntitlementsOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateEntitlements(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *SearchOrganizationEntitlementsOKBody) contextValidateEntitlements(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Entitlements); i++ { - if o.Entitlements[i] != nil { - - if swag.IsZero(o.Entitlements[i]) { // not required - return nil - } - - if err := o.Entitlements[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("searchOrganizationEntitlementsOk" + "." + "entitlements" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("searchOrganizationEntitlementsOk" + "." + "entitlements" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *SearchOrganizationEntitlementsOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *SearchOrganizationEntitlementsOKBody) UnmarshalBinary(b []byte) error { - var res SearchOrganizationEntitlementsOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -SearchOrganizationEntitlementsOKBodyEntitlementsItems0 OrganizationEntitlement contains information about Organization entitlement. -swagger:model SearchOrganizationEntitlementsOKBodyEntitlementsItems0 -*/ -type SearchOrganizationEntitlementsOKBodyEntitlementsItems0 struct { - // Entitlement number. - Number string `json:"number,omitempty"` - - // Entitlement name. - Name string `json:"name,omitempty"` - - // Entitlement short summary. - Summary string `json:"summary,omitempty"` - - // Entitlement tier. - Tier *string `json:"tier,omitempty"` - - // Total units covered by this entitlement. - TotalUnits *string `json:"total_units,omitempty"` - - // Flag indicates that unlimited units are covered. - UnlimitedUnits *bool `json:"unlimited_units,omitempty"` - - // Support level covered by this entitlement. - SupportLevel *string `json:"support_level,omitempty"` - - // Percona product families covered by this entitlement. - SoftwareFamilies []string `json:"software_families"` - - // Entitlement start data. - // Note: only date is used here but not time. - // Format: date-time - StartDate strfmt.DateTime `json:"start_date,omitempty"` - - // Entitlement end date. - // Note: only date is used here but not time. - // Format: date-time - EndDate strfmt.DateTime `json:"end_date,omitempty"` - - // platform - Platform *SearchOrganizationEntitlementsOKBodyEntitlementsItems0Platform `json:"platform,omitempty"` -} - -// Validate validates this search organization entitlements OK body entitlements items0 -func (o *SearchOrganizationEntitlementsOKBodyEntitlementsItems0) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateStartDate(formats); err != nil { - res = append(res, err) - } - - if err := o.validateEndDate(formats); err != nil { - res = append(res, err) - } - - if err := o.validatePlatform(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *SearchOrganizationEntitlementsOKBodyEntitlementsItems0) validateStartDate(formats strfmt.Registry) error { - if swag.IsZero(o.StartDate) { // not required - return nil - } - - if err := validate.FormatOf("start_date", "body", "date-time", o.StartDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (o *SearchOrganizationEntitlementsOKBodyEntitlementsItems0) validateEndDate(formats strfmt.Registry) error { - if swag.IsZero(o.EndDate) { // not required - return nil - } - - if err := validate.FormatOf("end_date", "body", "date-time", o.EndDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (o *SearchOrganizationEntitlementsOKBodyEntitlementsItems0) validatePlatform(formats strfmt.Registry) error { - if swag.IsZero(o.Platform) { // not required - return nil - } - - if o.Platform != nil { - if err := o.Platform.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("platform") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("platform") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this search organization entitlements OK body entitlements items0 based on the context it is used -func (o *SearchOrganizationEntitlementsOKBodyEntitlementsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidatePlatform(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *SearchOrganizationEntitlementsOKBodyEntitlementsItems0) contextValidatePlatform(ctx context.Context, formats strfmt.Registry) error { - if o.Platform != nil { - - if swag.IsZero(o.Platform) { // not required - return nil - } - - if err := o.Platform.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("platform") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("platform") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *SearchOrganizationEntitlementsOKBodyEntitlementsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *SearchOrganizationEntitlementsOKBodyEntitlementsItems0) UnmarshalBinary(b []byte) error { - var res SearchOrganizationEntitlementsOKBodyEntitlementsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -SearchOrganizationEntitlementsOKBodyEntitlementsItems0Platform Platform indicates platform specific entitlements. -swagger:model SearchOrganizationEntitlementsOKBodyEntitlementsItems0Platform -*/ -type SearchOrganizationEntitlementsOKBodyEntitlementsItems0Platform struct { - // Flag indicates that security advisors are covered by this entitlement. - SecurityAdvisor *string `json:"security_advisor,omitempty"` - - // Flag indicates that config advisors are covered by this entitlement. - ConfigAdvisor *string `json:"config_advisor,omitempty"` -} - -// Validate validates this search organization entitlements OK body entitlements items0 platform -func (o *SearchOrganizationEntitlementsOKBodyEntitlementsItems0Platform) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this search organization entitlements OK body entitlements items0 platform based on context it is used -func (o *SearchOrganizationEntitlementsOKBodyEntitlementsItems0Platform) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *SearchOrganizationEntitlementsOKBodyEntitlementsItems0Platform) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *SearchOrganizationEntitlementsOKBodyEntitlementsItems0Platform) UnmarshalBinary(b []byte) error { - var res SearchOrganizationEntitlementsOKBodyEntitlementsItems0Platform - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/platform/v1/json/client/platform_service/search_organization_tickets_parameters.go b/api/platform/v1/json/client/platform_service/search_organization_tickets_parameters.go deleted file mode 100644 index b86868b75fe..00000000000 --- a/api/platform/v1/json/client/platform_service/search_organization_tickets_parameters.go +++ /dev/null @@ -1,127 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package platform_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" -) - -// NewSearchOrganizationTicketsParams creates a new SearchOrganizationTicketsParams 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 NewSearchOrganizationTicketsParams() *SearchOrganizationTicketsParams { - return &SearchOrganizationTicketsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewSearchOrganizationTicketsParamsWithTimeout creates a new SearchOrganizationTicketsParams object -// with the ability to set a timeout on a request. -func NewSearchOrganizationTicketsParamsWithTimeout(timeout time.Duration) *SearchOrganizationTicketsParams { - return &SearchOrganizationTicketsParams{ - timeout: timeout, - } -} - -// NewSearchOrganizationTicketsParamsWithContext creates a new SearchOrganizationTicketsParams object -// with the ability to set a context for a request. -func NewSearchOrganizationTicketsParamsWithContext(ctx context.Context) *SearchOrganizationTicketsParams { - return &SearchOrganizationTicketsParams{ - Context: ctx, - } -} - -// NewSearchOrganizationTicketsParamsWithHTTPClient creates a new SearchOrganizationTicketsParams object -// with the ability to set a custom HTTPClient for a request. -func NewSearchOrganizationTicketsParamsWithHTTPClient(client *http.Client) *SearchOrganizationTicketsParams { - return &SearchOrganizationTicketsParams{ - HTTPClient: client, - } -} - -/* -SearchOrganizationTicketsParams contains all the parameters to send to the API endpoint - - for the search organization tickets operation. - - Typically these are written to a http.Request. -*/ -type SearchOrganizationTicketsParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the search organization tickets params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *SearchOrganizationTicketsParams) WithDefaults() *SearchOrganizationTicketsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the search organization tickets params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *SearchOrganizationTicketsParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the search organization tickets params -func (o *SearchOrganizationTicketsParams) WithTimeout(timeout time.Duration) *SearchOrganizationTicketsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the search organization tickets params -func (o *SearchOrganizationTicketsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the search organization tickets params -func (o *SearchOrganizationTicketsParams) WithContext(ctx context.Context) *SearchOrganizationTicketsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the search organization tickets params -func (o *SearchOrganizationTicketsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the search organization tickets params -func (o *SearchOrganizationTicketsParams) WithHTTPClient(client *http.Client) *SearchOrganizationTicketsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the search organization tickets params -func (o *SearchOrganizationTicketsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *SearchOrganizationTicketsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/api/platform/v1/json/client/platform_service/search_organization_tickets_responses.go b/api/platform/v1/json/client/platform_service/search_organization_tickets_responses.go deleted file mode 100644 index 87b174ccfec..00000000000 --- a/api/platform/v1/json/client/platform_service/search_organization_tickets_responses.go +++ /dev/null @@ -1,611 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package platform_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" -) - -// SearchOrganizationTicketsReader is a Reader for the SearchOrganizationTickets structure. -type SearchOrganizationTicketsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *SearchOrganizationTicketsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewSearchOrganizationTicketsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewSearchOrganizationTicketsDefault(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 - } -} - -// NewSearchOrganizationTicketsOK creates a SearchOrganizationTicketsOK with default headers values -func NewSearchOrganizationTicketsOK() *SearchOrganizationTicketsOK { - return &SearchOrganizationTicketsOK{} -} - -/* -SearchOrganizationTicketsOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type SearchOrganizationTicketsOK struct { - Payload *SearchOrganizationTicketsOKBody -} - -// IsSuccess returns true when this search organization tickets Ok response has a 2xx status code -func (o *SearchOrganizationTicketsOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this search organization tickets Ok response has a 3xx status code -func (o *SearchOrganizationTicketsOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this search organization tickets Ok response has a 4xx status code -func (o *SearchOrganizationTicketsOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this search organization tickets Ok response has a 5xx status code -func (o *SearchOrganizationTicketsOK) IsServerError() bool { - return false -} - -// IsCode returns true when this search organization tickets Ok response a status code equal to that given -func (o *SearchOrganizationTicketsOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the search organization tickets Ok response -func (o *SearchOrganizationTicketsOK) Code() int { - return 200 -} - -func (o *SearchOrganizationTicketsOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/platform/organization/tickets][%d] searchOrganizationTicketsOk %s", 200, payload) -} - -func (o *SearchOrganizationTicketsOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/platform/organization/tickets][%d] searchOrganizationTicketsOk %s", 200, payload) -} - -func (o *SearchOrganizationTicketsOK) GetPayload() *SearchOrganizationTicketsOKBody { - return o.Payload -} - -func (o *SearchOrganizationTicketsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(SearchOrganizationTicketsOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -// NewSearchOrganizationTicketsDefault creates a SearchOrganizationTicketsDefault with default headers values -func NewSearchOrganizationTicketsDefault(code int) *SearchOrganizationTicketsDefault { - return &SearchOrganizationTicketsDefault{ - _statusCode: code, - } -} - -/* -SearchOrganizationTicketsDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type SearchOrganizationTicketsDefault struct { - _statusCode int - - Payload *SearchOrganizationTicketsDefaultBody -} - -// IsSuccess returns true when this search organization tickets default response has a 2xx status code -func (o *SearchOrganizationTicketsDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this search organization tickets default response has a 3xx status code -func (o *SearchOrganizationTicketsDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this search organization tickets default response has a 4xx status code -func (o *SearchOrganizationTicketsDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this search organization tickets default response has a 5xx status code -func (o *SearchOrganizationTicketsDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this search organization tickets default response a status code equal to that given -func (o *SearchOrganizationTicketsDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the search organization tickets default response -func (o *SearchOrganizationTicketsDefault) Code() int { - return o._statusCode -} - -func (o *SearchOrganizationTicketsDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/platform/organization/tickets][%d] SearchOrganizationTickets default %s", o._statusCode, payload) -} - -func (o *SearchOrganizationTicketsDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/platform/organization/tickets][%d] SearchOrganizationTickets default %s", o._statusCode, payload) -} - -func (o *SearchOrganizationTicketsDefault) GetPayload() *SearchOrganizationTicketsDefaultBody { - return o.Payload -} - -func (o *SearchOrganizationTicketsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(SearchOrganizationTicketsDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -SearchOrganizationTicketsDefaultBody search organization tickets default body -swagger:model SearchOrganizationTicketsDefaultBody -*/ -type SearchOrganizationTicketsDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*SearchOrganizationTicketsDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this search organization tickets default body -func (o *SearchOrganizationTicketsDefaultBody) 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 *SearchOrganizationTicketsDefaultBody) 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("SearchOrganizationTickets default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("SearchOrganizationTickets default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this search organization tickets default body based on the context it is used -func (o *SearchOrganizationTicketsDefaultBody) 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 *SearchOrganizationTicketsDefaultBody) 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("SearchOrganizationTickets default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("SearchOrganizationTickets default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *SearchOrganizationTicketsDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *SearchOrganizationTicketsDefaultBody) UnmarshalBinary(b []byte) error { - var res SearchOrganizationTicketsDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -SearchOrganizationTicketsDefaultBodyDetailsItems0 search organization tickets default body details items0 -swagger:model SearchOrganizationTicketsDefaultBodyDetailsItems0 -*/ -type SearchOrganizationTicketsDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` - - // search organization tickets default body details items0 - SearchOrganizationTicketsDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *SearchOrganizationTicketsDefaultBodyDetailsItems0) 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 SearchOrganizationTicketsDefaultBodyDetailsItems0 - - 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.SearchOrganizationTicketsDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o SearchOrganizationTicketsDefaultBodyDetailsItems0) 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.SearchOrganizationTicketsDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.SearchOrganizationTicketsDefaultBodyDetailsItems0) - 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 search organization tickets default body details items0 -func (o *SearchOrganizationTicketsDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this search organization tickets default body details items0 based on context it is used -func (o *SearchOrganizationTicketsDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *SearchOrganizationTicketsDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *SearchOrganizationTicketsDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res SearchOrganizationTicketsDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -SearchOrganizationTicketsOKBody search organization tickets OK body -swagger:model SearchOrganizationTicketsOKBody -*/ -type SearchOrganizationTicketsOKBody struct { - // Support tickets belonging to the Percona Portal Organization. - Tickets []*SearchOrganizationTicketsOKBodyTicketsItems0 `json:"tickets"` -} - -// Validate validates this search organization tickets OK body -func (o *SearchOrganizationTicketsOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateTickets(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *SearchOrganizationTicketsOKBody) validateTickets(formats strfmt.Registry) error { - if swag.IsZero(o.Tickets) { // not required - return nil - } - - for i := 0; i < len(o.Tickets); i++ { - if swag.IsZero(o.Tickets[i]) { // not required - continue - } - - if o.Tickets[i] != nil { - if err := o.Tickets[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("searchOrganizationTicketsOk" + "." + "tickets" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("searchOrganizationTicketsOk" + "." + "tickets" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this search organization tickets OK body based on the context it is used -func (o *SearchOrganizationTicketsOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateTickets(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *SearchOrganizationTicketsOKBody) contextValidateTickets(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Tickets); i++ { - if o.Tickets[i] != nil { - - if swag.IsZero(o.Tickets[i]) { // not required - return nil - } - - if err := o.Tickets[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("searchOrganizationTicketsOk" + "." + "tickets" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("searchOrganizationTicketsOk" + "." + "tickets" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *SearchOrganizationTicketsOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *SearchOrganizationTicketsOKBody) UnmarshalBinary(b []byte) error { - var res SearchOrganizationTicketsOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -SearchOrganizationTicketsOKBodyTicketsItems0 OrganizationTicket contains information about the support ticket. -swagger:model SearchOrganizationTicketsOKBodyTicketsItems0 -*/ -type SearchOrganizationTicketsOKBodyTicketsItems0 struct { - // Ticket number. - Number string `json:"number,omitempty"` - - // Ticket short description. - ShortDescription string `json:"short_description,omitempty"` - - // Ticket priority. - Priority string `json:"priority,omitempty"` - - // Ticket state. - State string `json:"state,omitempty"` - - // Ticket creation time. - // Format: date-time - CreateTime strfmt.DateTime `json:"create_time,omitempty"` - - // Department. - Department string `json:"department,omitempty"` - - // Ticket requester. - Requester string `json:"requester,omitempty"` - - // Task type. - TaskType string `json:"task_type,omitempty"` - - // Ticket url. - URL string `json:"url,omitempty"` -} - -// Validate validates this search organization tickets OK body tickets items0 -func (o *SearchOrganizationTicketsOKBodyTicketsItems0) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateCreateTime(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *SearchOrganizationTicketsOKBodyTicketsItems0) validateCreateTime(formats strfmt.Registry) error { - if swag.IsZero(o.CreateTime) { // not required - return nil - } - - if err := validate.FormatOf("create_time", "body", "date-time", o.CreateTime.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this search organization tickets OK body tickets items0 based on context it is used -func (o *SearchOrganizationTicketsOKBodyTicketsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *SearchOrganizationTicketsOKBodyTicketsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *SearchOrganizationTicketsOKBodyTicketsItems0) UnmarshalBinary(b []byte) error { - var res SearchOrganizationTicketsOKBodyTicketsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/platform/v1/json/client/platform_service/server_info_parameters.go b/api/platform/v1/json/client/platform_service/server_info_parameters.go deleted file mode 100644 index 3dbeb113711..00000000000 --- a/api/platform/v1/json/client/platform_service/server_info_parameters.go +++ /dev/null @@ -1,127 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package platform_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" -) - -// NewServerInfoParams creates a new ServerInfoParams 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 NewServerInfoParams() *ServerInfoParams { - return &ServerInfoParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewServerInfoParamsWithTimeout creates a new ServerInfoParams object -// with the ability to set a timeout on a request. -func NewServerInfoParamsWithTimeout(timeout time.Duration) *ServerInfoParams { - return &ServerInfoParams{ - timeout: timeout, - } -} - -// NewServerInfoParamsWithContext creates a new ServerInfoParams object -// with the ability to set a context for a request. -func NewServerInfoParamsWithContext(ctx context.Context) *ServerInfoParams { - return &ServerInfoParams{ - Context: ctx, - } -} - -// NewServerInfoParamsWithHTTPClient creates a new ServerInfoParams object -// with the ability to set a custom HTTPClient for a request. -func NewServerInfoParamsWithHTTPClient(client *http.Client) *ServerInfoParams { - return &ServerInfoParams{ - HTTPClient: client, - } -} - -/* -ServerInfoParams contains all the parameters to send to the API endpoint - - for the server info operation. - - Typically these are written to a http.Request. -*/ -type ServerInfoParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the server info params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ServerInfoParams) WithDefaults() *ServerInfoParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the server info params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ServerInfoParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the server info params -func (o *ServerInfoParams) WithTimeout(timeout time.Duration) *ServerInfoParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the server info params -func (o *ServerInfoParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the server info params -func (o *ServerInfoParams) WithContext(ctx context.Context) *ServerInfoParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the server info params -func (o *ServerInfoParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the server info params -func (o *ServerInfoParams) WithHTTPClient(client *http.Client) *ServerInfoParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the server info params -func (o *ServerInfoParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *ServerInfoParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/api/platform/v1/json/client/platform_service/server_info_responses.go b/api/platform/v1/json/client/platform_service/server_info_responses.go deleted file mode 100644 index af007c8dfeb..00000000000 --- a/api/platform/v1/json/client/platform_service/server_info_responses.go +++ /dev/null @@ -1,462 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package platform_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" -) - -// ServerInfoReader is a Reader for the ServerInfo structure. -type ServerInfoReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ServerInfoReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewServerInfoOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewServerInfoDefault(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 - } -} - -// NewServerInfoOK creates a ServerInfoOK with default headers values -func NewServerInfoOK() *ServerInfoOK { - return &ServerInfoOK{} -} - -/* -ServerInfoOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type ServerInfoOK struct { - Payload *ServerInfoOKBody -} - -// IsSuccess returns true when this server info Ok response has a 2xx status code -func (o *ServerInfoOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this server info Ok response has a 3xx status code -func (o *ServerInfoOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this server info Ok response has a 4xx status code -func (o *ServerInfoOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this server info Ok response has a 5xx status code -func (o *ServerInfoOK) IsServerError() bool { - return false -} - -// IsCode returns true when this server info Ok response a status code equal to that given -func (o *ServerInfoOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the server info Ok response -func (o *ServerInfoOK) Code() int { - return 200 -} - -func (o *ServerInfoOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/platform/server][%d] serverInfoOk %s", 200, payload) -} - -func (o *ServerInfoOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/platform/server][%d] serverInfoOk %s", 200, payload) -} - -func (o *ServerInfoOK) GetPayload() *ServerInfoOKBody { - return o.Payload -} - -func (o *ServerInfoOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(ServerInfoOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -// NewServerInfoDefault creates a ServerInfoDefault with default headers values -func NewServerInfoDefault(code int) *ServerInfoDefault { - return &ServerInfoDefault{ - _statusCode: code, - } -} - -/* -ServerInfoDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type ServerInfoDefault struct { - _statusCode int - - Payload *ServerInfoDefaultBody -} - -// IsSuccess returns true when this server info default response has a 2xx status code -func (o *ServerInfoDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this server info default response has a 3xx status code -func (o *ServerInfoDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this server info default response has a 4xx status code -func (o *ServerInfoDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this server info default response has a 5xx status code -func (o *ServerInfoDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this server info default response a status code equal to that given -func (o *ServerInfoDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the server info default response -func (o *ServerInfoDefault) Code() int { - return o._statusCode -} - -func (o *ServerInfoDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/platform/server][%d] ServerInfo default %s", o._statusCode, payload) -} - -func (o *ServerInfoDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/platform/server][%d] ServerInfo default %s", o._statusCode, payload) -} - -func (o *ServerInfoDefault) GetPayload() *ServerInfoDefaultBody { - return o.Payload -} - -func (o *ServerInfoDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(ServerInfoDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -ServerInfoDefaultBody server info default body -swagger:model ServerInfoDefaultBody -*/ -type ServerInfoDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*ServerInfoDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this server info default body -func (o *ServerInfoDefaultBody) 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 *ServerInfoDefaultBody) 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("ServerInfo default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("ServerInfo default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this server info default body based on the context it is used -func (o *ServerInfoDefaultBody) 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 *ServerInfoDefaultBody) 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("ServerInfo default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("ServerInfo default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ServerInfoDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ServerInfoDefaultBody) UnmarshalBinary(b []byte) error { - var res ServerInfoDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ServerInfoDefaultBodyDetailsItems0 server info default body details items0 -swagger:model ServerInfoDefaultBodyDetailsItems0 -*/ -type ServerInfoDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` - - // server info default body details items0 - ServerInfoDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *ServerInfoDefaultBodyDetailsItems0) 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 ServerInfoDefaultBodyDetailsItems0 - - 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.ServerInfoDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o ServerInfoDefaultBodyDetailsItems0) 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.ServerInfoDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.ServerInfoDefaultBodyDetailsItems0) - 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 server info default body details items0 -func (o *ServerInfoDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this server info default body details items0 based on context it is used -func (o *ServerInfoDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ServerInfoDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ServerInfoDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res ServerInfoDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ServerInfoOKBody server info OK body -swagger:model ServerInfoOKBody -*/ -type ServerInfoOKBody struct { - // pmm server name - PMMServerName string `json:"pmm_server_name,omitempty"` - - // pmm server id - PMMServerID string `json:"pmm_server_id,omitempty"` - - // pmm server telemetry id - PMMServerTelemetryID string `json:"pmm_server_telemetry_id,omitempty"` - - // connected to portal - ConnectedToPortal bool `json:"connected_to_portal,omitempty"` -} - -// Validate validates this server info OK body -func (o *ServerInfoOKBody) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this server info OK body based on context it is used -func (o *ServerInfoOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ServerInfoOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ServerInfoOKBody) UnmarshalBinary(b []byte) error { - var res ServerInfoOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/platform/v1/json/client/platform_service/user_status_parameters.go b/api/platform/v1/json/client/platform_service/user_status_parameters.go deleted file mode 100644 index ea2a62482d7..00000000000 --- a/api/platform/v1/json/client/platform_service/user_status_parameters.go +++ /dev/null @@ -1,127 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package platform_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" -) - -// NewUserStatusParams creates a new UserStatusParams 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 NewUserStatusParams() *UserStatusParams { - return &UserStatusParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewUserStatusParamsWithTimeout creates a new UserStatusParams object -// with the ability to set a timeout on a request. -func NewUserStatusParamsWithTimeout(timeout time.Duration) *UserStatusParams { - return &UserStatusParams{ - timeout: timeout, - } -} - -// NewUserStatusParamsWithContext creates a new UserStatusParams object -// with the ability to set a context for a request. -func NewUserStatusParamsWithContext(ctx context.Context) *UserStatusParams { - return &UserStatusParams{ - Context: ctx, - } -} - -// NewUserStatusParamsWithHTTPClient creates a new UserStatusParams object -// with the ability to set a custom HTTPClient for a request. -func NewUserStatusParamsWithHTTPClient(client *http.Client) *UserStatusParams { - return &UserStatusParams{ - HTTPClient: client, - } -} - -/* -UserStatusParams contains all the parameters to send to the API endpoint - - for the user status operation. - - Typically these are written to a http.Request. -*/ -type UserStatusParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the user status params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UserStatusParams) WithDefaults() *UserStatusParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the user status params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UserStatusParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the user status params -func (o *UserStatusParams) WithTimeout(timeout time.Duration) *UserStatusParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the user status params -func (o *UserStatusParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the user status params -func (o *UserStatusParams) WithContext(ctx context.Context) *UserStatusParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the user status params -func (o *UserStatusParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the user status params -func (o *UserStatusParams) WithHTTPClient(client *http.Client) *UserStatusParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the user status params -func (o *UserStatusParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *UserStatusParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/api/platform/v1/json/client/platform_service/user_status_responses.go b/api/platform/v1/json/client/platform_service/user_status_responses.go deleted file mode 100644 index 5693d9f5a17..00000000000 --- a/api/platform/v1/json/client/platform_service/user_status_responses.go +++ /dev/null @@ -1,453 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package platform_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" -) - -// UserStatusReader is a Reader for the UserStatus structure. -type UserStatusReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *UserStatusReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewUserStatusOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewUserStatusDefault(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 - } -} - -// NewUserStatusOK creates a UserStatusOK with default headers values -func NewUserStatusOK() *UserStatusOK { - return &UserStatusOK{} -} - -/* -UserStatusOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type UserStatusOK struct { - Payload *UserStatusOKBody -} - -// IsSuccess returns true when this user status Ok response has a 2xx status code -func (o *UserStatusOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this user status Ok response has a 3xx status code -func (o *UserStatusOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this user status Ok response has a 4xx status code -func (o *UserStatusOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this user status Ok response has a 5xx status code -func (o *UserStatusOK) IsServerError() bool { - return false -} - -// IsCode returns true when this user status Ok response a status code equal to that given -func (o *UserStatusOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the user status Ok response -func (o *UserStatusOK) Code() int { - return 200 -} - -func (o *UserStatusOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/platform/user][%d] userStatusOk %s", 200, payload) -} - -func (o *UserStatusOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/platform/user][%d] userStatusOk %s", 200, payload) -} - -func (o *UserStatusOK) GetPayload() *UserStatusOKBody { - return o.Payload -} - -func (o *UserStatusOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(UserStatusOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -// NewUserStatusDefault creates a UserStatusDefault with default headers values -func NewUserStatusDefault(code int) *UserStatusDefault { - return &UserStatusDefault{ - _statusCode: code, - } -} - -/* -UserStatusDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type UserStatusDefault struct { - _statusCode int - - Payload *UserStatusDefaultBody -} - -// IsSuccess returns true when this user status default response has a 2xx status code -func (o *UserStatusDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this user status default response has a 3xx status code -func (o *UserStatusDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this user status default response has a 4xx status code -func (o *UserStatusDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this user status default response has a 5xx status code -func (o *UserStatusDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this user status default response a status code equal to that given -func (o *UserStatusDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the user status default response -func (o *UserStatusDefault) Code() int { - return o._statusCode -} - -func (o *UserStatusDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/platform/user][%d] UserStatus default %s", o._statusCode, payload) -} - -func (o *UserStatusDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/platform/user][%d] UserStatus default %s", o._statusCode, payload) -} - -func (o *UserStatusDefault) GetPayload() *UserStatusDefaultBody { - return o.Payload -} - -func (o *UserStatusDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(UserStatusDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -UserStatusDefaultBody user status default body -swagger:model UserStatusDefaultBody -*/ -type UserStatusDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*UserStatusDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this user status default body -func (o *UserStatusDefaultBody) 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 *UserStatusDefaultBody) 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("UserStatus default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("UserStatus default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this user status default body based on the context it is used -func (o *UserStatusDefaultBody) 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 *UserStatusDefaultBody) 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("UserStatus default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("UserStatus default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *UserStatusDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *UserStatusDefaultBody) UnmarshalBinary(b []byte) error { - var res UserStatusDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -UserStatusDefaultBodyDetailsItems0 user status default body details items0 -swagger:model UserStatusDefaultBodyDetailsItems0 -*/ -type UserStatusDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` - - // user status default body details items0 - UserStatusDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *UserStatusDefaultBodyDetailsItems0) 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 UserStatusDefaultBodyDetailsItems0 - - 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.UserStatusDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o UserStatusDefaultBodyDetailsItems0) 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.UserStatusDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.UserStatusDefaultBodyDetailsItems0) - 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 user status default body details items0 -func (o *UserStatusDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this user status default body details items0 based on context it is used -func (o *UserStatusDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *UserStatusDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *UserStatusDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res UserStatusDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -UserStatusOKBody user status OK body -swagger:model UserStatusOKBody -*/ -type UserStatusOKBody struct { - // is platform user - IsPlatformUser bool `json:"is_platform_user,omitempty"` -} - -// Validate validates this user status OK body -func (o *UserStatusOKBody) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this user status OK body based on context it is used -func (o *UserStatusOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *UserStatusOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *UserStatusOKBody) UnmarshalBinary(b []byte) error { - var res UserStatusOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/platform/v1/json/client/pmm_platform_api_client.go b/api/platform/v1/json/client/pmm_platform_api_client.go deleted file mode 100644 index 982e8039781..00000000000 --- a/api/platform/v1/json/client/pmm_platform_api_client.go +++ /dev/null @@ -1,112 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package client - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/percona/pmm/api/platform/v1/json/client/platform_service" -) - -// Default PMM platform API HTTP client. -var Default = NewHTTPClient(nil) - -const ( - // DefaultHost is the default Host - // found in Meta (info) section of spec file - DefaultHost string = "localhost" - // DefaultBasePath is the default BasePath - // found in Meta (info) section of spec file - DefaultBasePath string = "/" -) - -// DefaultSchemes are the default schemes found in Meta (info) section of spec file -var DefaultSchemes = []string{"http", "https"} - -// NewHTTPClient creates a new PMM platform API HTTP client. -func NewHTTPClient(formats strfmt.Registry) *PMMPlatformAPI { - return NewHTTPClientWithConfig(formats, nil) -} - -// NewHTTPClientWithConfig creates a new PMM platform API HTTP client, -// using a customizable transport config. -func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *PMMPlatformAPI { - // ensure nullable parameters have default - if cfg == nil { - cfg = DefaultTransportConfig() - } - - // create transport and client - transport := httptransport.New(cfg.Host, cfg.BasePath, cfg.Schemes) - return New(transport, formats) -} - -// New creates a new PMM platform API client -func New(transport runtime.ClientTransport, formats strfmt.Registry) *PMMPlatformAPI { - // ensure nullable parameters have default - if formats == nil { - formats = strfmt.Default - } - - cli := new(PMMPlatformAPI) - cli.Transport = transport - cli.PlatformService = platform_service.New(transport, formats) - return cli -} - -// DefaultTransportConfig creates a TransportConfig with the -// default settings taken from the meta section of the spec file. -func DefaultTransportConfig() *TransportConfig { - return &TransportConfig{ - Host: DefaultHost, - BasePath: DefaultBasePath, - Schemes: DefaultSchemes, - } -} - -// TransportConfig contains the transport related info, -// found in the meta section of the spec file. -type TransportConfig struct { - Host string - BasePath string - Schemes []string -} - -// WithHost overrides the default host, -// provided by the meta section of the spec file. -func (cfg *TransportConfig) WithHost(host string) *TransportConfig { - cfg.Host = host - return cfg -} - -// WithBasePath overrides the default basePath, -// provided by the meta section of the spec file. -func (cfg *TransportConfig) WithBasePath(basePath string) *TransportConfig { - cfg.BasePath = basePath - return cfg -} - -// WithSchemes overrides the default schemes, -// provided by the meta section of the spec file. -func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig { - cfg.Schemes = schemes - return cfg -} - -// PMMPlatformAPI is a client for PMM platform API -type PMMPlatformAPI struct { - PlatformService platform_service.ClientService - - Transport runtime.ClientTransport -} - -// SetTransport changes the transport on the client and all its subresources -func (c *PMMPlatformAPI) SetTransport(transport runtime.ClientTransport) { - c.Transport = transport - c.PlatformService.SetTransport(transport) -} diff --git a/api/platform/v1/json/v1.json b/api/platform/v1/json/v1.json deleted file mode 100644 index 560ccdd6393..00000000000 --- a/api/platform/v1/json/v1.json +++ /dev/null @@ -1,601 +0,0 @@ -{ - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "schemes": [ - "https", - "http" - ], - "swagger": "2.0", - "info": { - "title": "PMM Platform API", - "version": "v0" - }, - "paths": { - "/v1/platform/contact": { - "get": { - "description": "Fetch the contact details of the customer success employee handling the Percona customer account.", - "tags": [ - "PlatformService" - ], - "summary": "Get Contact Information", - "operationId": "GetContactInformation", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "customer_success": { - "description": "CustomerSuccess contains the contanct details of the customer success employee assigned to a customer's account.", - "type": "object", - "properties": { - "name": { - "type": "string", - "x-order": 0 - }, - "email": { - "type": "string", - "x-order": 1 - } - }, - "x-order": 0 - }, - "new_ticket_url": { - "description": "URL to open a new support ticket.", - "type": "string", - "x-order": 1 - } - } - } - }, - "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/platform/organization/entitlements": { - "get": { - "description": "Fetch entitlements available to the Portal organization that the PMM server is connected to.", - "tags": [ - "PlatformService" - ], - "summary": "Search Organization Entitlements", - "operationId": "SearchOrganizationEntitlements", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "entitlements": { - "type": "array", - "items": { - "description": "OrganizationEntitlement contains information about Organization entitlement.", - "type": "object", - "properties": { - "number": { - "description": "Entitlement number.", - "type": "string", - "x-order": 0 - }, - "name": { - "description": "Entitlement name.", - "type": "string", - "x-order": 1 - }, - "summary": { - "description": "Entitlement short summary.", - "type": "string", - "x-order": 2 - }, - "tier": { - "description": "Entitlement tier.", - "type": "string", - "x-nullable": true, - "x-order": 3 - }, - "total_units": { - "description": "Total units covered by this entitlement.", - "type": "string", - "x-nullable": true, - "x-order": 4 - }, - "unlimited_units": { - "description": "Flag indicates that unlimited units are covered.", - "type": "boolean", - "x-nullable": true, - "x-order": 5 - }, - "support_level": { - "description": "Support level covered by this entitlement.", - "type": "string", - "x-nullable": true, - "x-order": 6 - }, - "software_families": { - "description": "Percona product families covered by this entitlement.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 7 - }, - "start_date": { - "description": "Entitlement start data.\nNote: only date is used here but not time.", - "type": "string", - "format": "date-time", - "x-order": 8 - }, - "end_date": { - "description": "Entitlement end date.\nNote: only date is used here but not time.", - "type": "string", - "format": "date-time", - "x-order": 9 - }, - "platform": { - "description": "Platform indicates platform specific entitlements.", - "type": "object", - "properties": { - "security_advisor": { - "description": "Flag indicates that security advisors are covered by this entitlement.", - "type": "string", - "x-nullable": true, - "x-order": 0 - }, - "config_advisor": { - "description": "Flag indicates that config advisors are covered by this entitlement.", - "type": "string", - "x-nullable": true, - "x-order": 1 - } - }, - "x-order": 10 - } - } - }, - "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/platform/organization/tickets": { - "get": { - "description": "Fetch support tickets belonging to the Percona Portal Organization that the PMM server is connected to.", - "tags": [ - "PlatformService" - ], - "summary": "Search Organization Tickets", - "operationId": "SearchOrganizationTickets", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "tickets": { - "description": "Support tickets belonging to the Percona Portal Organization.", - "type": "array", - "items": { - "description": "OrganizationTicket contains information about the support ticket.", - "type": "object", - "properties": { - "number": { - "description": "Ticket number.", - "type": "string", - "x-order": 0 - }, - "short_description": { - "description": "Ticket short description.", - "type": "string", - "x-order": 1 - }, - "priority": { - "description": "Ticket priority.", - "type": "string", - "x-order": 2 - }, - "state": { - "description": "Ticket state.", - "type": "string", - "x-order": 3 - }, - "create_time": { - "description": "Ticket creation time.", - "type": "string", - "format": "date-time", - "x-order": 4 - }, - "department": { - "description": "Department.", - "type": "string", - "x-order": 5 - }, - "requester": { - "description": "Ticket requester.", - "type": "string", - "x-order": 6 - }, - "task_type": { - "description": "Task type.", - "type": "string", - "x-order": 7 - }, - "url": { - "description": "Ticket url.", - "type": "string", - "x-order": 8 - } - } - }, - "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/platform/server": { - "get": { - "description": "Return PMM server ID and name.", - "tags": [ - "PlatformService" - ], - "summary": "Get Server Info", - "operationId": "ServerInfo", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "pmm_server_name": { - "type": "string", - "x-order": 0 - }, - "pmm_server_id": { - "type": "string", - "x-order": 1 - }, - "pmm_server_telemetry_id": { - "type": "string", - "x-order": 2 - }, - "connected_to_portal": { - "type": "boolean", - "x-order": 3 - } - } - } - }, - "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/platform/user": { - "get": { - "description": "Check if the current user is logged in with their Percona Account.", - "tags": [ - "PlatformService" - ], - "summary": "Get User Status", - "operationId": "UserStatus", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "is_platform_user": { - "type": "boolean", - "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/platform:connect": { - "post": { - "description": "Connect a PMM server to the organization created on Percona Portal. That allows the user to sign in to the PMM server with their Percona Account.", - "tags": [ - "PlatformService" - ], - "summary": "Connect PMM Server", - "operationId": "Connect", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "server_name": { - "description": "User defined human readable PMM Server Name.", - "type": "string", - "x-order": 0 - }, - "personal_access_token": { - "description": "Personal Access Token that the user obtains from Percona Portal.", - "type": "string", - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/platform:disconnect": { - "post": { - "description": "Disconnect a PMM server from the organization created on Percona Portal.", - "tags": [ - "PlatformService" - ], - "summary": "Disconnect PMM Server", - "operationId": "Disconnect", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "force": { - "type": "boolean", - "title": "Forces the cleanup process for connected PMM instances regardless of the Portal API response", - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - } - }, - "tags": [ - { - "name": "PlatformService" - } - ] -} \ No newline at end of file diff --git a/api/platform/v1/platform.pb.go b/api/platform/v1/platform.pb.go deleted file mode 100644 index ea8216e42ef..00000000000 --- a/api/platform/v1/platform.pb.go +++ /dev/null @@ -1,1174 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.10 -// protoc (unknown) -// source: platform/v1/platform.proto - -package platformv1 - -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" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type ConnectRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // User defined human readable PMM Server Name. - ServerName string `protobuf:"bytes,1,opt,name=server_name,json=serverName,proto3" json:"server_name,omitempty"` - // Personal Access Token that the user obtains from Percona Portal. - PersonalAccessToken string `protobuf:"bytes,2,opt,name=personal_access_token,json=personalAccessToken,proto3" json:"personal_access_token,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ConnectRequest) Reset() { - *x = ConnectRequest{} - mi := &file_platform_v1_platform_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ConnectRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ConnectRequest) ProtoMessage() {} - -func (x *ConnectRequest) ProtoReflect() protoreflect.Message { - mi := &file_platform_v1_platform_proto_msgTypes[0] - 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 ConnectRequest.ProtoReflect.Descriptor instead. -func (*ConnectRequest) Descriptor() ([]byte, []int) { - return file_platform_v1_platform_proto_rawDescGZIP(), []int{0} -} - -func (x *ConnectRequest) GetServerName() string { - if x != nil { - return x.ServerName - } - return "" -} - -func (x *ConnectRequest) GetPersonalAccessToken() string { - if x != nil { - return x.PersonalAccessToken - } - return "" -} - -type ConnectResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ConnectResponse) Reset() { - *x = ConnectResponse{} - mi := &file_platform_v1_platform_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ConnectResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ConnectResponse) ProtoMessage() {} - -func (x *ConnectResponse) ProtoReflect() protoreflect.Message { - mi := &file_platform_v1_platform_proto_msgTypes[1] - 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 ConnectResponse.ProtoReflect.Descriptor instead. -func (*ConnectResponse) Descriptor() ([]byte, []int) { - return file_platform_v1_platform_proto_rawDescGZIP(), []int{1} -} - -type DisconnectRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Forces the cleanup process for connected PMM instances regardless of the Portal API response - Force bool `protobuf:"varint,1,opt,name=force,proto3" json:"force,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DisconnectRequest) Reset() { - *x = DisconnectRequest{} - mi := &file_platform_v1_platform_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DisconnectRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DisconnectRequest) ProtoMessage() {} - -func (x *DisconnectRequest) ProtoReflect() protoreflect.Message { - mi := &file_platform_v1_platform_proto_msgTypes[2] - 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 DisconnectRequest.ProtoReflect.Descriptor instead. -func (*DisconnectRequest) Descriptor() ([]byte, []int) { - return file_platform_v1_platform_proto_rawDescGZIP(), []int{2} -} - -func (x *DisconnectRequest) GetForce() bool { - if x != nil { - return x.Force - } - return false -} - -type DisconnectResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DisconnectResponse) Reset() { - *x = DisconnectResponse{} - mi := &file_platform_v1_platform_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DisconnectResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DisconnectResponse) ProtoMessage() {} - -func (x *DisconnectResponse) ProtoReflect() protoreflect.Message { - mi := &file_platform_v1_platform_proto_msgTypes[3] - 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 DisconnectResponse.ProtoReflect.Descriptor instead. -func (*DisconnectResponse) Descriptor() ([]byte, []int) { - return file_platform_v1_platform_proto_rawDescGZIP(), []int{3} -} - -type SearchOrganizationTicketsRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SearchOrganizationTicketsRequest) Reset() { - *x = SearchOrganizationTicketsRequest{} - mi := &file_platform_v1_platform_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SearchOrganizationTicketsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SearchOrganizationTicketsRequest) ProtoMessage() {} - -func (x *SearchOrganizationTicketsRequest) ProtoReflect() protoreflect.Message { - mi := &file_platform_v1_platform_proto_msgTypes[4] - 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 SearchOrganizationTicketsRequest.ProtoReflect.Descriptor instead. -func (*SearchOrganizationTicketsRequest) Descriptor() ([]byte, []int) { - return file_platform_v1_platform_proto_rawDescGZIP(), []int{4} -} - -type SearchOrganizationTicketsResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Support tickets belonging to the Percona Portal Organization. - Tickets []*OrganizationTicket `protobuf:"bytes,1,rep,name=tickets,proto3" json:"tickets,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SearchOrganizationTicketsResponse) Reset() { - *x = SearchOrganizationTicketsResponse{} - mi := &file_platform_v1_platform_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SearchOrganizationTicketsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SearchOrganizationTicketsResponse) ProtoMessage() {} - -func (x *SearchOrganizationTicketsResponse) ProtoReflect() protoreflect.Message { - mi := &file_platform_v1_platform_proto_msgTypes[5] - 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 SearchOrganizationTicketsResponse.ProtoReflect.Descriptor instead. -func (*SearchOrganizationTicketsResponse) Descriptor() ([]byte, []int) { - return file_platform_v1_platform_proto_rawDescGZIP(), []int{5} -} - -func (x *SearchOrganizationTicketsResponse) GetTickets() []*OrganizationTicket { - if x != nil { - return x.Tickets - } - return nil -} - -// OrganizationTicket contains information about the support ticket. -type OrganizationTicket struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Ticket number. - Number string `protobuf:"bytes,1,opt,name=number,proto3" json:"number,omitempty"` - // Ticket short description. - ShortDescription string `protobuf:"bytes,2,opt,name=short_description,json=shortDescription,proto3" json:"short_description,omitempty"` - // Ticket priority. - Priority string `protobuf:"bytes,3,opt,name=priority,proto3" json:"priority,omitempty"` - // Ticket state. - State string `protobuf:"bytes,4,opt,name=state,proto3" json:"state,omitempty"` - // Ticket creation time. - CreateTime *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` - // Department. - Department string `protobuf:"bytes,6,opt,name=department,proto3" json:"department,omitempty"` - // Ticket requester. - Requester string `protobuf:"bytes,7,opt,name=requester,proto3" json:"requester,omitempty"` - // Task type. - TaskType string `protobuf:"bytes,8,opt,name=task_type,json=taskType,proto3" json:"task_type,omitempty"` - // Ticket url. - Url string `protobuf:"bytes,9,opt,name=url,proto3" json:"url,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *OrganizationTicket) Reset() { - *x = OrganizationTicket{} - mi := &file_platform_v1_platform_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *OrganizationTicket) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*OrganizationTicket) ProtoMessage() {} - -func (x *OrganizationTicket) ProtoReflect() protoreflect.Message { - mi := &file_platform_v1_platform_proto_msgTypes[6] - 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 OrganizationTicket.ProtoReflect.Descriptor instead. -func (*OrganizationTicket) Descriptor() ([]byte, []int) { - return file_platform_v1_platform_proto_rawDescGZIP(), []int{6} -} - -func (x *OrganizationTicket) GetNumber() string { - if x != nil { - return x.Number - } - return "" -} - -func (x *OrganizationTicket) GetShortDescription() string { - if x != nil { - return x.ShortDescription - } - return "" -} - -func (x *OrganizationTicket) GetPriority() string { - if x != nil { - return x.Priority - } - return "" -} - -func (x *OrganizationTicket) GetState() string { - if x != nil { - return x.State - } - return "" -} - -func (x *OrganizationTicket) GetCreateTime() *timestamppb.Timestamp { - if x != nil { - return x.CreateTime - } - return nil -} - -func (x *OrganizationTicket) GetDepartment() string { - if x != nil { - return x.Department - } - return "" -} - -func (x *OrganizationTicket) GetRequester() string { - if x != nil { - return x.Requester - } - return "" -} - -func (x *OrganizationTicket) GetTaskType() string { - if x != nil { - return x.TaskType - } - return "" -} - -func (x *OrganizationTicket) GetUrl() string { - if x != nil { - return x.Url - } - return "" -} - -type SearchOrganizationEntitlementsRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SearchOrganizationEntitlementsRequest) Reset() { - *x = SearchOrganizationEntitlementsRequest{} - mi := &file_platform_v1_platform_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SearchOrganizationEntitlementsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SearchOrganizationEntitlementsRequest) ProtoMessage() {} - -func (x *SearchOrganizationEntitlementsRequest) ProtoReflect() protoreflect.Message { - mi := &file_platform_v1_platform_proto_msgTypes[7] - 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 SearchOrganizationEntitlementsRequest.ProtoReflect.Descriptor instead. -func (*SearchOrganizationEntitlementsRequest) Descriptor() ([]byte, []int) { - return file_platform_v1_platform_proto_rawDescGZIP(), []int{7} -} - -type SearchOrganizationEntitlementsResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Entitlements []*OrganizationEntitlement `protobuf:"bytes,1,rep,name=entitlements,proto3" json:"entitlements,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SearchOrganizationEntitlementsResponse) Reset() { - *x = SearchOrganizationEntitlementsResponse{} - mi := &file_platform_v1_platform_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SearchOrganizationEntitlementsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SearchOrganizationEntitlementsResponse) ProtoMessage() {} - -func (x *SearchOrganizationEntitlementsResponse) ProtoReflect() protoreflect.Message { - mi := &file_platform_v1_platform_proto_msgTypes[8] - 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 SearchOrganizationEntitlementsResponse.ProtoReflect.Descriptor instead. -func (*SearchOrganizationEntitlementsResponse) Descriptor() ([]byte, []int) { - return file_platform_v1_platform_proto_rawDescGZIP(), []int{8} -} - -func (x *SearchOrganizationEntitlementsResponse) GetEntitlements() []*OrganizationEntitlement { - if x != nil { - return x.Entitlements - } - return nil -} - -// OrganizationEntitlement contains information about Organization entitlement. -type OrganizationEntitlement struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Entitlement number. - Number string `protobuf:"bytes,1,opt,name=number,proto3" json:"number,omitempty"` - // Entitlement name. - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - // Entitlement short summary. - Summary string `protobuf:"bytes,3,opt,name=summary,proto3" json:"summary,omitempty"` - // Entitlement tier. - Tier *string `protobuf:"bytes,4,opt,name=tier,proto3,oneof" json:"tier,omitempty"` - // Total units covered by this entitlement. - TotalUnits *string `protobuf:"bytes,5,opt,name=total_units,json=totalUnits,proto3,oneof" json:"total_units,omitempty"` - // Flag indicates that unlimited units are covered. - UnlimitedUnits *bool `protobuf:"varint,6,opt,name=unlimited_units,json=unlimitedUnits,proto3,oneof" json:"unlimited_units,omitempty"` - // Support level covered by this entitlement. - SupportLevel *string `protobuf:"bytes,7,opt,name=support_level,json=supportLevel,proto3,oneof" json:"support_level,omitempty"` - // Percona product families covered by this entitlement. - SoftwareFamilies []string `protobuf:"bytes,8,rep,name=software_families,json=softwareFamilies,proto3" json:"software_families,omitempty"` - // Entitlement start data. - // Note: only date is used here but not time. - StartDate *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=start_date,json=startDate,proto3" json:"start_date,omitempty"` - // Entitlement end date. - // Note: only date is used here but not time. - EndDate *timestamppb.Timestamp `protobuf:"bytes,10,opt,name=end_date,json=endDate,proto3" json:"end_date,omitempty"` - // Platform specific options covered by this entitlement. - Platform *OrganizationEntitlement_Platform `protobuf:"bytes,11,opt,name=platform,proto3" json:"platform,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *OrganizationEntitlement) Reset() { - *x = OrganizationEntitlement{} - mi := &file_platform_v1_platform_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *OrganizationEntitlement) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*OrganizationEntitlement) ProtoMessage() {} - -func (x *OrganizationEntitlement) ProtoReflect() protoreflect.Message { - mi := &file_platform_v1_platform_proto_msgTypes[9] - 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 OrganizationEntitlement.ProtoReflect.Descriptor instead. -func (*OrganizationEntitlement) Descriptor() ([]byte, []int) { - return file_platform_v1_platform_proto_rawDescGZIP(), []int{9} -} - -func (x *OrganizationEntitlement) GetNumber() string { - if x != nil { - return x.Number - } - return "" -} - -func (x *OrganizationEntitlement) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *OrganizationEntitlement) GetSummary() string { - if x != nil { - return x.Summary - } - return "" -} - -func (x *OrganizationEntitlement) GetTier() string { - if x != nil && x.Tier != nil { - return *x.Tier - } - return "" -} - -func (x *OrganizationEntitlement) GetTotalUnits() string { - if x != nil && x.TotalUnits != nil { - return *x.TotalUnits - } - return "" -} - -func (x *OrganizationEntitlement) GetUnlimitedUnits() bool { - if x != nil && x.UnlimitedUnits != nil { - return *x.UnlimitedUnits - } - return false -} - -func (x *OrganizationEntitlement) GetSupportLevel() string { - if x != nil && x.SupportLevel != nil { - return *x.SupportLevel - } - return "" -} - -func (x *OrganizationEntitlement) GetSoftwareFamilies() []string { - if x != nil { - return x.SoftwareFamilies - } - return nil -} - -func (x *OrganizationEntitlement) GetStartDate() *timestamppb.Timestamp { - if x != nil { - return x.StartDate - } - return nil -} - -func (x *OrganizationEntitlement) GetEndDate() *timestamppb.Timestamp { - if x != nil { - return x.EndDate - } - return nil -} - -func (x *OrganizationEntitlement) GetPlatform() *OrganizationEntitlement_Platform { - if x != nil { - return x.Platform - } - return nil -} - -type GetContactInformationRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetContactInformationRequest) Reset() { - *x = GetContactInformationRequest{} - mi := &file_platform_v1_platform_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetContactInformationRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetContactInformationRequest) ProtoMessage() {} - -func (x *GetContactInformationRequest) ProtoReflect() protoreflect.Message { - mi := &file_platform_v1_platform_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 GetContactInformationRequest.ProtoReflect.Descriptor instead. -func (*GetContactInformationRequest) Descriptor() ([]byte, []int) { - return file_platform_v1_platform_proto_rawDescGZIP(), []int{10} -} - -type GetContactInformationResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - CustomerSuccess *GetContactInformationResponse_CustomerSuccess `protobuf:"bytes,1,opt,name=customer_success,json=customerSuccess,proto3" json:"customer_success,omitempty"` - // URL to open a new support ticket. - NewTicketUrl string `protobuf:"bytes,2,opt,name=new_ticket_url,json=newTicketUrl,proto3" json:"new_ticket_url,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetContactInformationResponse) Reset() { - *x = GetContactInformationResponse{} - mi := &file_platform_v1_platform_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetContactInformationResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetContactInformationResponse) ProtoMessage() {} - -func (x *GetContactInformationResponse) ProtoReflect() protoreflect.Message { - mi := &file_platform_v1_platform_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 GetContactInformationResponse.ProtoReflect.Descriptor instead. -func (*GetContactInformationResponse) Descriptor() ([]byte, []int) { - return file_platform_v1_platform_proto_rawDescGZIP(), []int{11} -} - -func (x *GetContactInformationResponse) GetCustomerSuccess() *GetContactInformationResponse_CustomerSuccess { - if x != nil { - return x.CustomerSuccess - } - return nil -} - -func (x *GetContactInformationResponse) GetNewTicketUrl() string { - if x != nil { - return x.NewTicketUrl - } - return "" -} - -type ServerInfoRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ServerInfoRequest) Reset() { - *x = ServerInfoRequest{} - mi := &file_platform_v1_platform_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ServerInfoRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ServerInfoRequest) ProtoMessage() {} - -func (x *ServerInfoRequest) ProtoReflect() protoreflect.Message { - mi := &file_platform_v1_platform_proto_msgTypes[12] - 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 ServerInfoRequest.ProtoReflect.Descriptor instead. -func (*ServerInfoRequest) Descriptor() ([]byte, []int) { - return file_platform_v1_platform_proto_rawDescGZIP(), []int{12} -} - -type ServerInfoResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - PmmServerName string `protobuf:"bytes,1,opt,name=pmm_server_name,json=pmmServerName,proto3" json:"pmm_server_name,omitempty"` - PmmServerId string `protobuf:"bytes,2,opt,name=pmm_server_id,json=pmmServerId,proto3" json:"pmm_server_id,omitempty"` - PmmServerTelemetryId string `protobuf:"bytes,3,opt,name=pmm_server_telemetry_id,json=pmmServerTelemetryId,proto3" json:"pmm_server_telemetry_id,omitempty"` - ConnectedToPortal bool `protobuf:"varint,4,opt,name=connected_to_portal,json=connectedToPortal,proto3" json:"connected_to_portal,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ServerInfoResponse) Reset() { - *x = ServerInfoResponse{} - mi := &file_platform_v1_platform_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ServerInfoResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ServerInfoResponse) ProtoMessage() {} - -func (x *ServerInfoResponse) ProtoReflect() protoreflect.Message { - mi := &file_platform_v1_platform_proto_msgTypes[13] - 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 ServerInfoResponse.ProtoReflect.Descriptor instead. -func (*ServerInfoResponse) Descriptor() ([]byte, []int) { - return file_platform_v1_platform_proto_rawDescGZIP(), []int{13} -} - -func (x *ServerInfoResponse) GetPmmServerName() string { - if x != nil { - return x.PmmServerName - } - return "" -} - -func (x *ServerInfoResponse) GetPmmServerId() string { - if x != nil { - return x.PmmServerId - } - return "" -} - -func (x *ServerInfoResponse) GetPmmServerTelemetryId() string { - if x != nil { - return x.PmmServerTelemetryId - } - return "" -} - -func (x *ServerInfoResponse) GetConnectedToPortal() bool { - if x != nil { - return x.ConnectedToPortal - } - return false -} - -type UserStatusRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *UserStatusRequest) Reset() { - *x = UserStatusRequest{} - mi := &file_platform_v1_platform_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *UserStatusRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UserStatusRequest) ProtoMessage() {} - -func (x *UserStatusRequest) ProtoReflect() protoreflect.Message { - mi := &file_platform_v1_platform_proto_msgTypes[14] - 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 UserStatusRequest.ProtoReflect.Descriptor instead. -func (*UserStatusRequest) Descriptor() ([]byte, []int) { - return file_platform_v1_platform_proto_rawDescGZIP(), []int{14} -} - -type UserStatusResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - IsPlatformUser bool `protobuf:"varint,1,opt,name=is_platform_user,json=isPlatformUser,proto3" json:"is_platform_user,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *UserStatusResponse) Reset() { - *x = UserStatusResponse{} - mi := &file_platform_v1_platform_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *UserStatusResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UserStatusResponse) ProtoMessage() {} - -func (x *UserStatusResponse) ProtoReflect() protoreflect.Message { - mi := &file_platform_v1_platform_proto_msgTypes[15] - 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 UserStatusResponse.ProtoReflect.Descriptor instead. -func (*UserStatusResponse) Descriptor() ([]byte, []int) { - return file_platform_v1_platform_proto_rawDescGZIP(), []int{15} -} - -func (x *UserStatusResponse) GetIsPlatformUser() bool { - if x != nil { - return x.IsPlatformUser - } - return false -} - -// Platform indicates platform specific entitlements. -type OrganizationEntitlement_Platform struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Flag indicates that security advisors are covered by this entitlement. - SecurityAdvisor *string `protobuf:"bytes,1,opt,name=security_advisor,json=securityAdvisor,proto3,oneof" json:"security_advisor,omitempty"` - // Flag indicates that config advisors are covered by this entitlement. - ConfigAdvisor *string `protobuf:"bytes,2,opt,name=config_advisor,json=configAdvisor,proto3,oneof" json:"config_advisor,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *OrganizationEntitlement_Platform) Reset() { - *x = OrganizationEntitlement_Platform{} - mi := &file_platform_v1_platform_proto_msgTypes[16] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *OrganizationEntitlement_Platform) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*OrganizationEntitlement_Platform) ProtoMessage() {} - -func (x *OrganizationEntitlement_Platform) ProtoReflect() protoreflect.Message { - mi := &file_platform_v1_platform_proto_msgTypes[16] - 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 OrganizationEntitlement_Platform.ProtoReflect.Descriptor instead. -func (*OrganizationEntitlement_Platform) Descriptor() ([]byte, []int) { - return file_platform_v1_platform_proto_rawDescGZIP(), []int{9, 0} -} - -func (x *OrganizationEntitlement_Platform) GetSecurityAdvisor() string { - if x != nil && x.SecurityAdvisor != nil { - return *x.SecurityAdvisor - } - return "" -} - -func (x *OrganizationEntitlement_Platform) GetConfigAdvisor() string { - if x != nil && x.ConfigAdvisor != nil { - return *x.ConfigAdvisor - } - return "" -} - -// CustomerSuccess contains the contanct details of the customer success employee assigned to a customer's account. -type GetContactInformationResponse_CustomerSuccess struct { - state protoimpl.MessageState `protogen:"open.v1"` - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Email string `protobuf:"bytes,2,opt,name=email,proto3" json:"email,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetContactInformationResponse_CustomerSuccess) Reset() { - *x = GetContactInformationResponse_CustomerSuccess{} - mi := &file_platform_v1_platform_proto_msgTypes[17] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetContactInformationResponse_CustomerSuccess) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetContactInformationResponse_CustomerSuccess) ProtoMessage() {} - -func (x *GetContactInformationResponse_CustomerSuccess) ProtoReflect() protoreflect.Message { - mi := &file_platform_v1_platform_proto_msgTypes[17] - 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 GetContactInformationResponse_CustomerSuccess.ProtoReflect.Descriptor instead. -func (*GetContactInformationResponse_CustomerSuccess) Descriptor() ([]byte, []int) { - return file_platform_v1_platform_proto_rawDescGZIP(), []int{11, 0} -} - -func (x *GetContactInformationResponse_CustomerSuccess) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *GetContactInformationResponse_CustomerSuccess) GetEmail() string { - if x != nil { - return x.Email - } - return "" -} - -var File_platform_v1_platform_proto protoreflect.FileDescriptor - -const file_platform_v1_platform_proto_rawDesc = "" + - "\n" + - "\x1aplatform/v1/platform.proto\x12\vplatform.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a.protoc-gen-openapiv2/options/annotations.proto\x1a\x17validate/validate.proto\"n\n" + - "\x0eConnectRequest\x12(\n" + - "\vserver_name\x18\x01 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\n" + - "serverName\x122\n" + - "\x15personal_access_token\x18\x02 \x01(\tR\x13personalAccessToken\"\x11\n" + - "\x0fConnectResponse\")\n" + - "\x11DisconnectRequest\x12\x14\n" + - "\x05force\x18\x01 \x01(\bR\x05force\"\x14\n" + - "\x12DisconnectResponse\"\"\n" + - " SearchOrganizationTicketsRequest\"^\n" + - "!SearchOrganizationTicketsResponse\x129\n" + - "\atickets\x18\x01 \x03(\v2\x1f.platform.v1.OrganizationTicketR\atickets\"\xb5\x02\n" + - "\x12OrganizationTicket\x12\x16\n" + - "\x06number\x18\x01 \x01(\tR\x06number\x12+\n" + - "\x11short_description\x18\x02 \x01(\tR\x10shortDescription\x12\x1a\n" + - "\bpriority\x18\x03 \x01(\tR\bpriority\x12\x14\n" + - "\x05state\x18\x04 \x01(\tR\x05state\x12;\n" + - "\vcreate_time\x18\x05 \x01(\v2\x1a.google.protobuf.TimestampR\n" + - "createTime\x12\x1e\n" + - "\n" + - "department\x18\x06 \x01(\tR\n" + - "department\x12\x1c\n" + - "\trequester\x18\a \x01(\tR\trequester\x12\x1b\n" + - "\ttask_type\x18\b \x01(\tR\btaskType\x12\x10\n" + - "\x03url\x18\t \x01(\tR\x03url\"'\n" + - "%SearchOrganizationEntitlementsRequest\"r\n" + - "&SearchOrganizationEntitlementsResponse\x12H\n" + - "\fentitlements\x18\x01 \x03(\v2$.platform.v1.OrganizationEntitlementR\fentitlements\"\xb0\x05\n" + - "\x17OrganizationEntitlement\x12\x16\n" + - "\x06number\x18\x01 \x01(\tR\x06number\x12\x12\n" + - "\x04name\x18\x02 \x01(\tR\x04name\x12\x18\n" + - "\asummary\x18\x03 \x01(\tR\asummary\x12\x17\n" + - "\x04tier\x18\x04 \x01(\tH\x00R\x04tier\x88\x01\x01\x12$\n" + - "\vtotal_units\x18\x05 \x01(\tH\x01R\n" + - "totalUnits\x88\x01\x01\x12,\n" + - "\x0funlimited_units\x18\x06 \x01(\bH\x02R\x0eunlimitedUnits\x88\x01\x01\x12(\n" + - "\rsupport_level\x18\a \x01(\tH\x03R\fsupportLevel\x88\x01\x01\x12+\n" + - "\x11software_families\x18\b \x03(\tR\x10softwareFamilies\x129\n" + - "\n" + - "start_date\x18\t \x01(\v2\x1a.google.protobuf.TimestampR\tstartDate\x125\n" + - "\bend_date\x18\n" + - " \x01(\v2\x1a.google.protobuf.TimestampR\aendDate\x12I\n" + - "\bplatform\x18\v \x01(\v2-.platform.v1.OrganizationEntitlement.PlatformR\bplatform\x1a\x8e\x01\n" + - "\bPlatform\x12.\n" + - "\x10security_advisor\x18\x01 \x01(\tH\x00R\x0fsecurityAdvisor\x88\x01\x01\x12*\n" + - "\x0econfig_advisor\x18\x02 \x01(\tH\x01R\rconfigAdvisor\x88\x01\x01B\x13\n" + - "\x11_security_advisorB\x11\n" + - "\x0f_config_advisorB\a\n" + - "\x05_tierB\x0e\n" + - "\f_total_unitsB\x12\n" + - "\x10_unlimited_unitsB\x10\n" + - "\x0e_support_level\"\x1e\n" + - "\x1cGetContactInformationRequest\"\xe9\x01\n" + - "\x1dGetContactInformationResponse\x12e\n" + - "\x10customer_success\x18\x01 \x01(\v2:.platform.v1.GetContactInformationResponse.CustomerSuccessR\x0fcustomerSuccess\x12$\n" + - "\x0enew_ticket_url\x18\x02 \x01(\tR\fnewTicketUrl\x1a;\n" + - "\x0fCustomerSuccess\x12\x12\n" + - "\x04name\x18\x01 \x01(\tR\x04name\x12\x14\n" + - "\x05email\x18\x02 \x01(\tR\x05email\"\x13\n" + - "\x11ServerInfoRequest\"\xc7\x01\n" + - "\x12ServerInfoResponse\x12&\n" + - "\x0fpmm_server_name\x18\x01 \x01(\tR\rpmmServerName\x12\"\n" + - "\rpmm_server_id\x18\x02 \x01(\tR\vpmmServerId\x125\n" + - "\x17pmm_server_telemetry_id\x18\x03 \x01(\tR\x14pmmServerTelemetryId\x12.\n" + - "\x13connected_to_portal\x18\x04 \x01(\bR\x11connectedToPortal\"\x13\n" + - "\x11UserStatusRequest\">\n" + - "\x12UserStatusResponse\x12(\n" + - "\x10is_platform_user\x18\x01 \x01(\bR\x0eisPlatformUser2\xe6\r\n" + - "\x0fPlatformService\x12\x92\x02\n" + - "\aConnect\x12\x1b.platform.v1.ConnectRequest\x1a\x1c.platform.v1.ConnectResponse\"\xcb\x01\x92A\xa8\x01\x12\x12Connect PMM Server\x1a\x91\x01Connect a PMM server to the organization created on Percona Portal. That allows the user to sign in to the PMM server with their Percona Account.\x82\xd3\xe4\x93\x02\x19:\x01*\"\x14/v1/platform:connect\x12\xd6\x01\n" + - "\n" + - "Disconnect\x12\x1e.platform.v1.DisconnectRequest\x1a\x1f.platform.v1.DisconnectResponse\"\x86\x01\x92Aa\x12\x15Disconnect PMM Server\x1aHDisconnect a PMM server from the organization created on Percona Portal.\x82\xd3\xe4\x93\x02\x1c:\x01*\"\x17/v1/platform:disconnect\x12\xb0\x02\n" + - "\x19SearchOrganizationTickets\x12-.platform.v1.SearchOrganizationTicketsRequest\x1a..platform.v1.SearchOrganizationTicketsResponse\"\xb3\x01\x92A\x86\x01\x12\x1bSearch Organization Tickets\x1agFetch support tickets belonging to the Percona Portal Organization that the PMM server is connected to.\x82\xd3\xe4\x93\x02#\x12!/v1/platform/organization/tickets\x12\xbe\x02\n" + - "\x1eSearchOrganizationEntitlements\x122.platform.v1.SearchOrganizationEntitlementsRequest\x1a3.platform.v1.SearchOrganizationEntitlementsResponse\"\xb2\x01\x92A\x80\x01\x12 Search Organization Entitlements\x1a\\Fetch entitlements available to the Portal organization that the PMM server is connected to.\x82\xd3\xe4\x93\x02(\x12&/v1/platform/organization/entitlements\x12\x8c\x02\n" + - "\x15GetContactInformation\x12).platform.v1.GetContactInformationRequest\x1a*.platform.v1.GetContactInformationResponse\"\x9b\x01\x92A|\x12\x17Get Contact Information\x1aaFetch the contact details of the customer success employee handling the Percona customer account.\x82\xd3\xe4\x93\x02\x16\x12\x14/v1/platform/contact\x12\x9e\x01\n" + - "\n" + - "ServerInfo\x12\x1e.platform.v1.ServerInfoRequest\x1a\x1f.platform.v1.ServerInfoResponse\"O\x92A1\x12\x0fGet Server Info\x1a\x1eReturn PMM server ID and name.\x82\xd3\xe4\x93\x02\x15\x12\x13/v1/platform/server\x12\xc0\x01\n" + - "\n" + - "UserStatus\x12\x1e.platform.v1.UserStatusRequest\x1a\x1f.platform.v1.UserStatusResponse\"q\x92AU\x12\x0fGet User Status\x1aBCheck if the current user is logged in with their Percona Account.\x82\xd3\xe4\x93\x02\x13\x12\x11/v1/platform/userB\xb3\x01\x92A\x10\x12\x0e\n" + - "\fPlatform API\n" + - "\x0fcom.platform.v1B\rPlatformProtoP\x01Z1github.com/percona/pmm/api/platform/v1;platformv1\xa2\x02\x03PXX\xaa\x02\vPlatform.V1\xca\x02\vPlatform\\V1\xe2\x02\x17Platform\\V1\\GPBMetadata\xea\x02\fPlatform::V1b\x06proto3" - -var ( - file_platform_v1_platform_proto_rawDescOnce sync.Once - file_platform_v1_platform_proto_rawDescData []byte -) - -func file_platform_v1_platform_proto_rawDescGZIP() []byte { - file_platform_v1_platform_proto_rawDescOnce.Do(func() { - file_platform_v1_platform_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_platform_v1_platform_proto_rawDesc), len(file_platform_v1_platform_proto_rawDesc))) - }) - return file_platform_v1_platform_proto_rawDescData -} - -var ( - file_platform_v1_platform_proto_msgTypes = make([]protoimpl.MessageInfo, 18) - file_platform_v1_platform_proto_goTypes = []any{ - (*ConnectRequest)(nil), // 0: platform.v1.ConnectRequest - (*ConnectResponse)(nil), // 1: platform.v1.ConnectResponse - (*DisconnectRequest)(nil), // 2: platform.v1.DisconnectRequest - (*DisconnectResponse)(nil), // 3: platform.v1.DisconnectResponse - (*SearchOrganizationTicketsRequest)(nil), // 4: platform.v1.SearchOrganizationTicketsRequest - (*SearchOrganizationTicketsResponse)(nil), // 5: platform.v1.SearchOrganizationTicketsResponse - (*OrganizationTicket)(nil), // 6: platform.v1.OrganizationTicket - (*SearchOrganizationEntitlementsRequest)(nil), // 7: platform.v1.SearchOrganizationEntitlementsRequest - (*SearchOrganizationEntitlementsResponse)(nil), // 8: platform.v1.SearchOrganizationEntitlementsResponse - (*OrganizationEntitlement)(nil), // 9: platform.v1.OrganizationEntitlement - (*GetContactInformationRequest)(nil), // 10: platform.v1.GetContactInformationRequest - (*GetContactInformationResponse)(nil), // 11: platform.v1.GetContactInformationResponse - (*ServerInfoRequest)(nil), // 12: platform.v1.ServerInfoRequest - (*ServerInfoResponse)(nil), // 13: platform.v1.ServerInfoResponse - (*UserStatusRequest)(nil), // 14: platform.v1.UserStatusRequest - (*UserStatusResponse)(nil), // 15: platform.v1.UserStatusResponse - (*OrganizationEntitlement_Platform)(nil), // 16: platform.v1.OrganizationEntitlement.Platform - (*GetContactInformationResponse_CustomerSuccess)(nil), // 17: platform.v1.GetContactInformationResponse.CustomerSuccess - (*timestamppb.Timestamp)(nil), // 18: google.protobuf.Timestamp - } -) - -var file_platform_v1_platform_proto_depIdxs = []int32{ - 6, // 0: platform.v1.SearchOrganizationTicketsResponse.tickets:type_name -> platform.v1.OrganizationTicket - 18, // 1: platform.v1.OrganizationTicket.create_time:type_name -> google.protobuf.Timestamp - 9, // 2: platform.v1.SearchOrganizationEntitlementsResponse.entitlements:type_name -> platform.v1.OrganizationEntitlement - 18, // 3: platform.v1.OrganizationEntitlement.start_date:type_name -> google.protobuf.Timestamp - 18, // 4: platform.v1.OrganizationEntitlement.end_date:type_name -> google.protobuf.Timestamp - 16, // 5: platform.v1.OrganizationEntitlement.platform:type_name -> platform.v1.OrganizationEntitlement.Platform - 17, // 6: platform.v1.GetContactInformationResponse.customer_success:type_name -> platform.v1.GetContactInformationResponse.CustomerSuccess - 0, // 7: platform.v1.PlatformService.Connect:input_type -> platform.v1.ConnectRequest - 2, // 8: platform.v1.PlatformService.Disconnect:input_type -> platform.v1.DisconnectRequest - 4, // 9: platform.v1.PlatformService.SearchOrganizationTickets:input_type -> platform.v1.SearchOrganizationTicketsRequest - 7, // 10: platform.v1.PlatformService.SearchOrganizationEntitlements:input_type -> platform.v1.SearchOrganizationEntitlementsRequest - 10, // 11: platform.v1.PlatformService.GetContactInformation:input_type -> platform.v1.GetContactInformationRequest - 12, // 12: platform.v1.PlatformService.ServerInfo:input_type -> platform.v1.ServerInfoRequest - 14, // 13: platform.v1.PlatformService.UserStatus:input_type -> platform.v1.UserStatusRequest - 1, // 14: platform.v1.PlatformService.Connect:output_type -> platform.v1.ConnectResponse - 3, // 15: platform.v1.PlatformService.Disconnect:output_type -> platform.v1.DisconnectResponse - 5, // 16: platform.v1.PlatformService.SearchOrganizationTickets:output_type -> platform.v1.SearchOrganizationTicketsResponse - 8, // 17: platform.v1.PlatformService.SearchOrganizationEntitlements:output_type -> platform.v1.SearchOrganizationEntitlementsResponse - 11, // 18: platform.v1.PlatformService.GetContactInformation:output_type -> platform.v1.GetContactInformationResponse - 13, // 19: platform.v1.PlatformService.ServerInfo:output_type -> platform.v1.ServerInfoResponse - 15, // 20: platform.v1.PlatformService.UserStatus:output_type -> platform.v1.UserStatusResponse - 14, // [14:21] is the sub-list for method output_type - 7, // [7:14] is the sub-list for method input_type - 7, // [7:7] is the sub-list for extension type_name - 7, // [7:7] is the sub-list for extension extendee - 0, // [0:7] is the sub-list for field type_name -} - -func init() { file_platform_v1_platform_proto_init() } -func file_platform_v1_platform_proto_init() { - if File_platform_v1_platform_proto != nil { - return - } - file_platform_v1_platform_proto_msgTypes[9].OneofWrappers = []any{} - file_platform_v1_platform_proto_msgTypes[16].OneofWrappers = []any{} - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_platform_v1_platform_proto_rawDesc), len(file_platform_v1_platform_proto_rawDesc)), - NumEnums: 0, - NumMessages: 18, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_platform_v1_platform_proto_goTypes, - DependencyIndexes: file_platform_v1_platform_proto_depIdxs, - MessageInfos: file_platform_v1_platform_proto_msgTypes, - }.Build() - File_platform_v1_platform_proto = out.File - file_platform_v1_platform_proto_goTypes = nil - file_platform_v1_platform_proto_depIdxs = nil -} diff --git a/api/platform/v1/platform.pb.gw.go b/api/platform/v1/platform.pb.gw.go deleted file mode 100644 index 247b9631b62..00000000000 --- a/api/platform/v1/platform.pb.gw.go +++ /dev/null @@ -1,523 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: platform/v1/platform.proto - -/* -Package platformv1 is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package platformv1 - -import ( - "context" - "errors" - "io" - "net/http" - - "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" - "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" - "google.golang.org/protobuf/proto" -) - -// Suppress "imported and not used" errors -var ( - _ codes.Code - _ io.Reader - _ status.Status - _ = errors.New - _ = runtime.String - _ = utilities.NewDoubleArray - _ = metadata.Join -) - -func request_PlatformService_Connect_0(ctx context.Context, marshaler runtime.Marshaler, client PlatformServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq ConnectRequest - 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.Connect(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_PlatformService_Connect_0(ctx context.Context, marshaler runtime.Marshaler, server PlatformServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq ConnectRequest - 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.Connect(ctx, &protoReq) - return msg, metadata, err -} - -func request_PlatformService_Disconnect_0(ctx context.Context, marshaler runtime.Marshaler, client PlatformServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq DisconnectRequest - 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.Disconnect(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_PlatformService_Disconnect_0(ctx context.Context, marshaler runtime.Marshaler, server PlatformServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq DisconnectRequest - 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.Disconnect(ctx, &protoReq) - return msg, metadata, err -} - -func request_PlatformService_SearchOrganizationTickets_0(ctx context.Context, marshaler runtime.Marshaler, client PlatformServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq SearchOrganizationTicketsRequest - metadata runtime.ServerMetadata - ) - if req.Body != nil { - _, _ = io.Copy(io.Discard, req.Body) - } - msg, err := client.SearchOrganizationTickets(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_PlatformService_SearchOrganizationTickets_0(ctx context.Context, marshaler runtime.Marshaler, server PlatformServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq SearchOrganizationTicketsRequest - metadata runtime.ServerMetadata - ) - msg, err := server.SearchOrganizationTickets(ctx, &protoReq) - return msg, metadata, err -} - -func request_PlatformService_SearchOrganizationEntitlements_0(ctx context.Context, marshaler runtime.Marshaler, client PlatformServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq SearchOrganizationEntitlementsRequest - metadata runtime.ServerMetadata - ) - if req.Body != nil { - _, _ = io.Copy(io.Discard, req.Body) - } - msg, err := client.SearchOrganizationEntitlements(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_PlatformService_SearchOrganizationEntitlements_0(ctx context.Context, marshaler runtime.Marshaler, server PlatformServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq SearchOrganizationEntitlementsRequest - metadata runtime.ServerMetadata - ) - msg, err := server.SearchOrganizationEntitlements(ctx, &protoReq) - return msg, metadata, err -} - -func request_PlatformService_GetContactInformation_0(ctx context.Context, marshaler runtime.Marshaler, client PlatformServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq GetContactInformationRequest - metadata runtime.ServerMetadata - ) - if req.Body != nil { - _, _ = io.Copy(io.Discard, req.Body) - } - msg, err := client.GetContactInformation(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_PlatformService_GetContactInformation_0(ctx context.Context, marshaler runtime.Marshaler, server PlatformServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq GetContactInformationRequest - metadata runtime.ServerMetadata - ) - msg, err := server.GetContactInformation(ctx, &protoReq) - return msg, metadata, err -} - -func request_PlatformService_ServerInfo_0(ctx context.Context, marshaler runtime.Marshaler, client PlatformServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq ServerInfoRequest - metadata runtime.ServerMetadata - ) - if req.Body != nil { - _, _ = io.Copy(io.Discard, req.Body) - } - msg, err := client.ServerInfo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_PlatformService_ServerInfo_0(ctx context.Context, marshaler runtime.Marshaler, server PlatformServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq ServerInfoRequest - metadata runtime.ServerMetadata - ) - msg, err := server.ServerInfo(ctx, &protoReq) - return msg, metadata, err -} - -func request_PlatformService_UserStatus_0(ctx context.Context, marshaler runtime.Marshaler, client PlatformServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq UserStatusRequest - metadata runtime.ServerMetadata - ) - if req.Body != nil { - _, _ = io.Copy(io.Discard, req.Body) - } - msg, err := client.UserStatus(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_PlatformService_UserStatus_0(ctx context.Context, marshaler runtime.Marshaler, server PlatformServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq UserStatusRequest - metadata runtime.ServerMetadata - ) - msg, err := server.UserStatus(ctx, &protoReq) - return msg, metadata, err -} - -// RegisterPlatformServiceHandlerServer registers the http handlers for service PlatformService to "mux". -// UnaryRPC :call PlatformServiceServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterPlatformServiceHandlerFromEndpoint instead. -// GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call. -func RegisterPlatformServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server PlatformServiceServer) error { - mux.Handle(http.MethodPost, pattern_PlatformService_Connect_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, "/platform.v1.PlatformService/Connect", runtime.WithHTTPPathPattern("/v1/platform:connect")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_PlatformService_Connect_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_PlatformService_Connect_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPost, pattern_PlatformService_Disconnect_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, "/platform.v1.PlatformService/Disconnect", runtime.WithHTTPPathPattern("/v1/platform:disconnect")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_PlatformService_Disconnect_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_PlatformService_Disconnect_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodGet, pattern_PlatformService_SearchOrganizationTickets_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, "/platform.v1.PlatformService/SearchOrganizationTickets", runtime.WithHTTPPathPattern("/v1/platform/organization/tickets")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_PlatformService_SearchOrganizationTickets_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_PlatformService_SearchOrganizationTickets_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodGet, pattern_PlatformService_SearchOrganizationEntitlements_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, "/platform.v1.PlatformService/SearchOrganizationEntitlements", runtime.WithHTTPPathPattern("/v1/platform/organization/entitlements")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_PlatformService_SearchOrganizationEntitlements_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_PlatformService_SearchOrganizationEntitlements_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodGet, pattern_PlatformService_GetContactInformation_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, "/platform.v1.PlatformService/GetContactInformation", runtime.WithHTTPPathPattern("/v1/platform/contact")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_PlatformService_GetContactInformation_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_PlatformService_GetContactInformation_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodGet, pattern_PlatformService_ServerInfo_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, "/platform.v1.PlatformService/ServerInfo", runtime.WithHTTPPathPattern("/v1/platform/server")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_PlatformService_ServerInfo_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_PlatformService_ServerInfo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodGet, pattern_PlatformService_UserStatus_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, "/platform.v1.PlatformService/UserStatus", runtime.WithHTTPPathPattern("/v1/platform/user")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_PlatformService_UserStatus_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_PlatformService_UserStatus_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - return nil -} - -// RegisterPlatformServiceHandlerFromEndpoint is same as RegisterPlatformServiceHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterPlatformServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.NewClient(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - return RegisterPlatformServiceHandler(ctx, mux, conn) -} - -// RegisterPlatformServiceHandler registers the http handlers for service PlatformService to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterPlatformServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterPlatformServiceHandlerClient(ctx, mux, NewPlatformServiceClient(conn)) -} - -// RegisterPlatformServiceHandlerClient registers the http handlers for service PlatformService -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "PlatformServiceClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "PlatformServiceClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "PlatformServiceClient" to call the correct interceptors. This client ignores the HTTP middlewares. -func RegisterPlatformServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client PlatformServiceClient) error { - mux.Handle(http.MethodPost, pattern_PlatformService_Connect_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, "/platform.v1.PlatformService/Connect", runtime.WithHTTPPathPattern("/v1/platform:connect")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_PlatformService_Connect_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_PlatformService_Connect_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPost, pattern_PlatformService_Disconnect_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, "/platform.v1.PlatformService/Disconnect", runtime.WithHTTPPathPattern("/v1/platform:disconnect")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_PlatformService_Disconnect_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_PlatformService_Disconnect_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodGet, pattern_PlatformService_SearchOrganizationTickets_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, "/platform.v1.PlatformService/SearchOrganizationTickets", runtime.WithHTTPPathPattern("/v1/platform/organization/tickets")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_PlatformService_SearchOrganizationTickets_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_PlatformService_SearchOrganizationTickets_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodGet, pattern_PlatformService_SearchOrganizationEntitlements_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, "/platform.v1.PlatformService/SearchOrganizationEntitlements", runtime.WithHTTPPathPattern("/v1/platform/organization/entitlements")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_PlatformService_SearchOrganizationEntitlements_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_PlatformService_SearchOrganizationEntitlements_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodGet, pattern_PlatformService_GetContactInformation_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, "/platform.v1.PlatformService/GetContactInformation", runtime.WithHTTPPathPattern("/v1/platform/contact")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_PlatformService_GetContactInformation_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_PlatformService_GetContactInformation_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodGet, pattern_PlatformService_ServerInfo_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, "/platform.v1.PlatformService/ServerInfo", runtime.WithHTTPPathPattern("/v1/platform/server")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_PlatformService_ServerInfo_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_PlatformService_ServerInfo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodGet, pattern_PlatformService_UserStatus_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, "/platform.v1.PlatformService/UserStatus", runtime.WithHTTPPathPattern("/v1/platform/user")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_PlatformService_UserStatus_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_PlatformService_UserStatus_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - return nil -} - -var ( - pattern_PlatformService_Connect_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "platform"}, "connect")) - pattern_PlatformService_Disconnect_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "platform"}, "disconnect")) - pattern_PlatformService_SearchOrganizationTickets_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "platform", "organization", "tickets"}, "")) - pattern_PlatformService_SearchOrganizationEntitlements_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "platform", "organization", "entitlements"}, "")) - pattern_PlatformService_GetContactInformation_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "platform", "contact"}, "")) - pattern_PlatformService_ServerInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "platform", "server"}, "")) - pattern_PlatformService_UserStatus_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "platform", "user"}, "")) -) - -var ( - forward_PlatformService_Connect_0 = runtime.ForwardResponseMessage - forward_PlatformService_Disconnect_0 = runtime.ForwardResponseMessage - forward_PlatformService_SearchOrganizationTickets_0 = runtime.ForwardResponseMessage - forward_PlatformService_SearchOrganizationEntitlements_0 = runtime.ForwardResponseMessage - forward_PlatformService_GetContactInformation_0 = runtime.ForwardResponseMessage - forward_PlatformService_ServerInfo_0 = runtime.ForwardResponseMessage - forward_PlatformService_UserStatus_0 = runtime.ForwardResponseMessage -) diff --git a/api/platform/v1/platform.pb.validate.go b/api/platform/v1/platform.pb.validate.go deleted file mode 100644 index e738d7f3ab9..00000000000 --- a/api/platform/v1/platform.pb.validate.go +++ /dev/null @@ -1,2183 +0,0 @@ -// Code generated by protoc-gen-validate. DO NOT EDIT. -// source: platform/v1/platform.proto - -package platformv1 - -import ( - "bytes" - "errors" - "fmt" - "net" - "net/mail" - "net/url" - "regexp" - "sort" - "strings" - "time" - "unicode/utf8" - - "google.golang.org/protobuf/types/known/anypb" -) - -// ensure the imports are used -var ( - _ = bytes.MinRead - _ = errors.New("") - _ = fmt.Print - _ = utf8.UTFMax - _ = (*regexp.Regexp)(nil) - _ = (*strings.Reader)(nil) - _ = net.IPv4len - _ = time.Duration(0) - _ = (*url.URL)(nil) - _ = (*mail.Address)(nil) - _ = anypb.Any{} - _ = sort.Sort -) - -// Validate checks the field values on ConnectRequest 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 *ConnectRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ConnectRequest 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 ConnectRequestMultiError, -// or nil if none found. -func (m *ConnectRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *ConnectRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetServerName()) < 1 { - err := ConnectRequestValidationError{ - field: "ServerName", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for PersonalAccessToken - - if len(errors) > 0 { - return ConnectRequestMultiError(errors) - } - - return nil -} - -// ConnectRequestMultiError is an error wrapping multiple validation errors -// returned by ConnectRequest.ValidateAll() if the designated constraints -// aren't met. -type ConnectRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ConnectRequestMultiError) 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 ConnectRequestMultiError) AllErrors() []error { return m } - -// ConnectRequestValidationError is the validation error returned by -// ConnectRequest.Validate if the designated constraints aren't met. -type ConnectRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ConnectRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ConnectRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ConnectRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ConnectRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ConnectRequestValidationError) ErrorName() string { return "ConnectRequestValidationError" } - -// Error satisfies the builtin error interface -func (e ConnectRequestValidationError) 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 %sConnectRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ConnectRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ConnectRequestValidationError{} - -// Validate checks the field values on ConnectResponse 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 *ConnectResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ConnectResponse 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 -// ConnectResponseMultiError, or nil if none found. -func (m *ConnectResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *ConnectResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return ConnectResponseMultiError(errors) - } - - return nil -} - -// ConnectResponseMultiError is an error wrapping multiple validation errors -// returned by ConnectResponse.ValidateAll() if the designated constraints -// aren't met. -type ConnectResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ConnectResponseMultiError) 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 ConnectResponseMultiError) AllErrors() []error { return m } - -// ConnectResponseValidationError is the validation error returned by -// ConnectResponse.Validate if the designated constraints aren't met. -type ConnectResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ConnectResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ConnectResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ConnectResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ConnectResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ConnectResponseValidationError) ErrorName() string { return "ConnectResponseValidationError" } - -// Error satisfies the builtin error interface -func (e ConnectResponseValidationError) 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 %sConnectResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ConnectResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ConnectResponseValidationError{} - -// Validate checks the field values on DisconnectRequest 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 *DisconnectRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on DisconnectRequest 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 -// DisconnectRequestMultiError, or nil if none found. -func (m *DisconnectRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *DisconnectRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Force - - if len(errors) > 0 { - return DisconnectRequestMultiError(errors) - } - - return nil -} - -// DisconnectRequestMultiError is an error wrapping multiple validation errors -// returned by DisconnectRequest.ValidateAll() if the designated constraints -// aren't met. -type DisconnectRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m DisconnectRequestMultiError) 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 DisconnectRequestMultiError) AllErrors() []error { return m } - -// DisconnectRequestValidationError is the validation error returned by -// DisconnectRequest.Validate if the designated constraints aren't met. -type DisconnectRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e DisconnectRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e DisconnectRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e DisconnectRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e DisconnectRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e DisconnectRequestValidationError) ErrorName() string { - return "DisconnectRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e DisconnectRequestValidationError) 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 %sDisconnectRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = DisconnectRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = DisconnectRequestValidationError{} - -// Validate checks the field values on DisconnectResponse 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 *DisconnectResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on DisconnectResponse 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 -// DisconnectResponseMultiError, or nil if none found. -func (m *DisconnectResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *DisconnectResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return DisconnectResponseMultiError(errors) - } - - return nil -} - -// DisconnectResponseMultiError is an error wrapping multiple validation errors -// returned by DisconnectResponse.ValidateAll() if the designated constraints -// aren't met. -type DisconnectResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m DisconnectResponseMultiError) 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 DisconnectResponseMultiError) AllErrors() []error { return m } - -// DisconnectResponseValidationError is the validation error returned by -// DisconnectResponse.Validate if the designated constraints aren't met. -type DisconnectResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e DisconnectResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e DisconnectResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e DisconnectResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e DisconnectResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e DisconnectResponseValidationError) ErrorName() string { - return "DisconnectResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e DisconnectResponseValidationError) 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 %sDisconnectResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = DisconnectResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = DisconnectResponseValidationError{} - -// Validate checks the field values on SearchOrganizationTicketsRequest 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 *SearchOrganizationTicketsRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on SearchOrganizationTicketsRequest 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 -// SearchOrganizationTicketsRequestMultiError, or nil if none found. -func (m *SearchOrganizationTicketsRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *SearchOrganizationTicketsRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return SearchOrganizationTicketsRequestMultiError(errors) - } - - return nil -} - -// SearchOrganizationTicketsRequestMultiError is an error wrapping multiple -// validation errors returned by -// SearchOrganizationTicketsRequest.ValidateAll() if the designated -// constraints aren't met. -type SearchOrganizationTicketsRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m SearchOrganizationTicketsRequestMultiError) 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 SearchOrganizationTicketsRequestMultiError) AllErrors() []error { return m } - -// SearchOrganizationTicketsRequestValidationError is the validation error -// returned by SearchOrganizationTicketsRequest.Validate if the designated -// constraints aren't met. -type SearchOrganizationTicketsRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e SearchOrganizationTicketsRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e SearchOrganizationTicketsRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e SearchOrganizationTicketsRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e SearchOrganizationTicketsRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e SearchOrganizationTicketsRequestValidationError) ErrorName() string { - return "SearchOrganizationTicketsRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e SearchOrganizationTicketsRequestValidationError) 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 %sSearchOrganizationTicketsRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = SearchOrganizationTicketsRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = SearchOrganizationTicketsRequestValidationError{} - -// Validate checks the field values on SearchOrganizationTicketsResponse 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 *SearchOrganizationTicketsResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on SearchOrganizationTicketsResponse -// 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 -// SearchOrganizationTicketsResponseMultiError, or nil if none found. -func (m *SearchOrganizationTicketsResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *SearchOrganizationTicketsResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - for idx, item := range m.GetTickets() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, SearchOrganizationTicketsResponseValidationError{ - field: fmt.Sprintf("Tickets[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, SearchOrganizationTicketsResponseValidationError{ - field: fmt.Sprintf("Tickets[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return SearchOrganizationTicketsResponseValidationError{ - field: fmt.Sprintf("Tickets[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - if len(errors) > 0 { - return SearchOrganizationTicketsResponseMultiError(errors) - } - - return nil -} - -// SearchOrganizationTicketsResponseMultiError is an error wrapping multiple -// validation errors returned by -// SearchOrganizationTicketsResponse.ValidateAll() if the designated -// constraints aren't met. -type SearchOrganizationTicketsResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m SearchOrganizationTicketsResponseMultiError) 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 SearchOrganizationTicketsResponseMultiError) AllErrors() []error { return m } - -// SearchOrganizationTicketsResponseValidationError is the validation error -// returned by SearchOrganizationTicketsResponse.Validate if the designated -// constraints aren't met. -type SearchOrganizationTicketsResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e SearchOrganizationTicketsResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e SearchOrganizationTicketsResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e SearchOrganizationTicketsResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e SearchOrganizationTicketsResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e SearchOrganizationTicketsResponseValidationError) ErrorName() string { - return "SearchOrganizationTicketsResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e SearchOrganizationTicketsResponseValidationError) 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 %sSearchOrganizationTicketsResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = SearchOrganizationTicketsResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = SearchOrganizationTicketsResponseValidationError{} - -// Validate checks the field values on OrganizationTicket 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 *OrganizationTicket) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on OrganizationTicket 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 -// OrganizationTicketMultiError, or nil if none found. -func (m *OrganizationTicket) ValidateAll() error { - return m.validate(true) -} - -func (m *OrganizationTicket) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Number - - // no validation rules for ShortDescription - - // no validation rules for Priority - - // no validation rules for State - - if all { - switch v := interface{}(m.GetCreateTime()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, OrganizationTicketValidationError{ - field: "CreateTime", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, OrganizationTicketValidationError{ - field: "CreateTime", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetCreateTime()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return OrganizationTicketValidationError{ - field: "CreateTime", - reason: "embedded message failed validation", - cause: err, - } - } - } - - // no validation rules for Department - - // no validation rules for Requester - - // no validation rules for TaskType - - // no validation rules for Url - - if len(errors) > 0 { - return OrganizationTicketMultiError(errors) - } - - return nil -} - -// OrganizationTicketMultiError is an error wrapping multiple validation errors -// returned by OrganizationTicket.ValidateAll() if the designated constraints -// aren't met. -type OrganizationTicketMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m OrganizationTicketMultiError) 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 OrganizationTicketMultiError) AllErrors() []error { return m } - -// OrganizationTicketValidationError is the validation error returned by -// OrganizationTicket.Validate if the designated constraints aren't met. -type OrganizationTicketValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e OrganizationTicketValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e OrganizationTicketValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e OrganizationTicketValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e OrganizationTicketValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e OrganizationTicketValidationError) ErrorName() string { - return "OrganizationTicketValidationError" -} - -// Error satisfies the builtin error interface -func (e OrganizationTicketValidationError) 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 %sOrganizationTicket.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = OrganizationTicketValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = OrganizationTicketValidationError{} - -// Validate checks the field values on SearchOrganizationEntitlementsRequest -// 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 *SearchOrganizationEntitlementsRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on SearchOrganizationEntitlementsRequest -// 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 -// SearchOrganizationEntitlementsRequestMultiError, or nil if none found. -func (m *SearchOrganizationEntitlementsRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *SearchOrganizationEntitlementsRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return SearchOrganizationEntitlementsRequestMultiError(errors) - } - - return nil -} - -// SearchOrganizationEntitlementsRequestMultiError is an error wrapping -// multiple validation errors returned by -// SearchOrganizationEntitlementsRequest.ValidateAll() if the designated -// constraints aren't met. -type SearchOrganizationEntitlementsRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m SearchOrganizationEntitlementsRequestMultiError) 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 SearchOrganizationEntitlementsRequestMultiError) AllErrors() []error { return m } - -// SearchOrganizationEntitlementsRequestValidationError is the validation error -// returned by SearchOrganizationEntitlementsRequest.Validate if the -// designated constraints aren't met. -type SearchOrganizationEntitlementsRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e SearchOrganizationEntitlementsRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e SearchOrganizationEntitlementsRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e SearchOrganizationEntitlementsRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e SearchOrganizationEntitlementsRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e SearchOrganizationEntitlementsRequestValidationError) ErrorName() string { - return "SearchOrganizationEntitlementsRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e SearchOrganizationEntitlementsRequestValidationError) 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 %sSearchOrganizationEntitlementsRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = SearchOrganizationEntitlementsRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = SearchOrganizationEntitlementsRequestValidationError{} - -// Validate checks the field values on SearchOrganizationEntitlementsResponse -// 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 *SearchOrganizationEntitlementsResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on -// SearchOrganizationEntitlementsResponse 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 -// SearchOrganizationEntitlementsResponseMultiError, or nil if none found. -func (m *SearchOrganizationEntitlementsResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *SearchOrganizationEntitlementsResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - for idx, item := range m.GetEntitlements() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, SearchOrganizationEntitlementsResponseValidationError{ - field: fmt.Sprintf("Entitlements[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, SearchOrganizationEntitlementsResponseValidationError{ - field: fmt.Sprintf("Entitlements[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return SearchOrganizationEntitlementsResponseValidationError{ - field: fmt.Sprintf("Entitlements[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - if len(errors) > 0 { - return SearchOrganizationEntitlementsResponseMultiError(errors) - } - - return nil -} - -// SearchOrganizationEntitlementsResponseMultiError is an error wrapping -// multiple validation errors returned by -// SearchOrganizationEntitlementsResponse.ValidateAll() if the designated -// constraints aren't met. -type SearchOrganizationEntitlementsResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m SearchOrganizationEntitlementsResponseMultiError) 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 SearchOrganizationEntitlementsResponseMultiError) AllErrors() []error { return m } - -// SearchOrganizationEntitlementsResponseValidationError is the validation -// error returned by SearchOrganizationEntitlementsResponse.Validate if the -// designated constraints aren't met. -type SearchOrganizationEntitlementsResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e SearchOrganizationEntitlementsResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e SearchOrganizationEntitlementsResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e SearchOrganizationEntitlementsResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e SearchOrganizationEntitlementsResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e SearchOrganizationEntitlementsResponseValidationError) ErrorName() string { - return "SearchOrganizationEntitlementsResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e SearchOrganizationEntitlementsResponseValidationError) 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 %sSearchOrganizationEntitlementsResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = SearchOrganizationEntitlementsResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = SearchOrganizationEntitlementsResponseValidationError{} - -// Validate checks the field values on OrganizationEntitlement 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 *OrganizationEntitlement) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on OrganizationEntitlement 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 -// OrganizationEntitlementMultiError, or nil if none found. -func (m *OrganizationEntitlement) ValidateAll() error { - return m.validate(true) -} - -func (m *OrganizationEntitlement) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Number - - // no validation rules for Name - - // no validation rules for Summary - - if all { - switch v := interface{}(m.GetStartDate()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, OrganizationEntitlementValidationError{ - field: "StartDate", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, OrganizationEntitlementValidationError{ - field: "StartDate", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetStartDate()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return OrganizationEntitlementValidationError{ - field: "StartDate", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetEndDate()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, OrganizationEntitlementValidationError{ - field: "EndDate", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, OrganizationEntitlementValidationError{ - field: "EndDate", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetEndDate()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return OrganizationEntitlementValidationError{ - field: "EndDate", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetPlatform()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, OrganizationEntitlementValidationError{ - field: "Platform", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, OrganizationEntitlementValidationError{ - field: "Platform", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetPlatform()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return OrganizationEntitlementValidationError{ - field: "Platform", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if m.Tier != nil { - // no validation rules for Tier - } - - if m.TotalUnits != nil { - // no validation rules for TotalUnits - } - - if m.UnlimitedUnits != nil { - // no validation rules for UnlimitedUnits - } - - if m.SupportLevel != nil { - // no validation rules for SupportLevel - } - - if len(errors) > 0 { - return OrganizationEntitlementMultiError(errors) - } - - return nil -} - -// OrganizationEntitlementMultiError is an error wrapping multiple validation -// errors returned by OrganizationEntitlement.ValidateAll() if the designated -// constraints aren't met. -type OrganizationEntitlementMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m OrganizationEntitlementMultiError) 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 OrganizationEntitlementMultiError) AllErrors() []error { return m } - -// OrganizationEntitlementValidationError is the validation error returned by -// OrganizationEntitlement.Validate if the designated constraints aren't met. -type OrganizationEntitlementValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e OrganizationEntitlementValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e OrganizationEntitlementValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e OrganizationEntitlementValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e OrganizationEntitlementValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e OrganizationEntitlementValidationError) ErrorName() string { - return "OrganizationEntitlementValidationError" -} - -// Error satisfies the builtin error interface -func (e OrganizationEntitlementValidationError) 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 %sOrganizationEntitlement.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = OrganizationEntitlementValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = OrganizationEntitlementValidationError{} - -// Validate checks the field values on GetContactInformationRequest 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 *GetContactInformationRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on GetContactInformationRequest 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 -// GetContactInformationRequestMultiError, or nil if none found. -func (m *GetContactInformationRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *GetContactInformationRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return GetContactInformationRequestMultiError(errors) - } - - return nil -} - -// GetContactInformationRequestMultiError is an error wrapping multiple -// validation errors returned by GetContactInformationRequest.ValidateAll() if -// the designated constraints aren't met. -type GetContactInformationRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m GetContactInformationRequestMultiError) 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 GetContactInformationRequestMultiError) AllErrors() []error { return m } - -// GetContactInformationRequestValidationError is the validation error returned -// by GetContactInformationRequest.Validate if the designated constraints -// aren't met. -type GetContactInformationRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e GetContactInformationRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e GetContactInformationRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e GetContactInformationRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e GetContactInformationRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e GetContactInformationRequestValidationError) ErrorName() string { - return "GetContactInformationRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e GetContactInformationRequestValidationError) 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 %sGetContactInformationRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = GetContactInformationRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = GetContactInformationRequestValidationError{} - -// Validate checks the field values on GetContactInformationResponse 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 *GetContactInformationResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on GetContactInformationResponse 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 -// GetContactInformationResponseMultiError, or nil if none found. -func (m *GetContactInformationResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *GetContactInformationResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if all { - switch v := interface{}(m.GetCustomerSuccess()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GetContactInformationResponseValidationError{ - field: "CustomerSuccess", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GetContactInformationResponseValidationError{ - field: "CustomerSuccess", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetCustomerSuccess()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GetContactInformationResponseValidationError{ - field: "CustomerSuccess", - reason: "embedded message failed validation", - cause: err, - } - } - } - - // no validation rules for NewTicketUrl - - if len(errors) > 0 { - return GetContactInformationResponseMultiError(errors) - } - - return nil -} - -// GetContactInformationResponseMultiError is an error wrapping multiple -// validation errors returned by GetContactInformationResponse.ValidateAll() -// if the designated constraints aren't met. -type GetContactInformationResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m GetContactInformationResponseMultiError) 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 GetContactInformationResponseMultiError) AllErrors() []error { return m } - -// GetContactInformationResponseValidationError is the validation error -// returned by GetContactInformationResponse.Validate if the designated -// constraints aren't met. -type GetContactInformationResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e GetContactInformationResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e GetContactInformationResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e GetContactInformationResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e GetContactInformationResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e GetContactInformationResponseValidationError) ErrorName() string { - return "GetContactInformationResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e GetContactInformationResponseValidationError) 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 %sGetContactInformationResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = GetContactInformationResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = GetContactInformationResponseValidationError{} - -// Validate checks the field values on ServerInfoRequest 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 *ServerInfoRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ServerInfoRequest 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 -// ServerInfoRequestMultiError, or nil if none found. -func (m *ServerInfoRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *ServerInfoRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return ServerInfoRequestMultiError(errors) - } - - return nil -} - -// ServerInfoRequestMultiError is an error wrapping multiple validation errors -// returned by ServerInfoRequest.ValidateAll() if the designated constraints -// aren't met. -type ServerInfoRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ServerInfoRequestMultiError) 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 ServerInfoRequestMultiError) AllErrors() []error { return m } - -// ServerInfoRequestValidationError is the validation error returned by -// ServerInfoRequest.Validate if the designated constraints aren't met. -type ServerInfoRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ServerInfoRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ServerInfoRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ServerInfoRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ServerInfoRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ServerInfoRequestValidationError) ErrorName() string { - return "ServerInfoRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e ServerInfoRequestValidationError) 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 %sServerInfoRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ServerInfoRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ServerInfoRequestValidationError{} - -// Validate checks the field values on ServerInfoResponse 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 *ServerInfoResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ServerInfoResponse 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 -// ServerInfoResponseMultiError, or nil if none found. -func (m *ServerInfoResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *ServerInfoResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for PmmServerName - - // no validation rules for PmmServerId - - // no validation rules for PmmServerTelemetryId - - // no validation rules for ConnectedToPortal - - if len(errors) > 0 { - return ServerInfoResponseMultiError(errors) - } - - return nil -} - -// ServerInfoResponseMultiError is an error wrapping multiple validation errors -// returned by ServerInfoResponse.ValidateAll() if the designated constraints -// aren't met. -type ServerInfoResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ServerInfoResponseMultiError) 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 ServerInfoResponseMultiError) AllErrors() []error { return m } - -// ServerInfoResponseValidationError is the validation error returned by -// ServerInfoResponse.Validate if the designated constraints aren't met. -type ServerInfoResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ServerInfoResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ServerInfoResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ServerInfoResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ServerInfoResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ServerInfoResponseValidationError) ErrorName() string { - return "ServerInfoResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e ServerInfoResponseValidationError) 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 %sServerInfoResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ServerInfoResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ServerInfoResponseValidationError{} - -// Validate checks the field values on UserStatusRequest 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 *UserStatusRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on UserStatusRequest 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 -// UserStatusRequestMultiError, or nil if none found. -func (m *UserStatusRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *UserStatusRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return UserStatusRequestMultiError(errors) - } - - return nil -} - -// UserStatusRequestMultiError is an error wrapping multiple validation errors -// returned by UserStatusRequest.ValidateAll() if the designated constraints -// aren't met. -type UserStatusRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m UserStatusRequestMultiError) 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 UserStatusRequestMultiError) AllErrors() []error { return m } - -// UserStatusRequestValidationError is the validation error returned by -// UserStatusRequest.Validate if the designated constraints aren't met. -type UserStatusRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e UserStatusRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e UserStatusRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e UserStatusRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e UserStatusRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e UserStatusRequestValidationError) ErrorName() string { - return "UserStatusRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e UserStatusRequestValidationError) 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 %sUserStatusRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = UserStatusRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = UserStatusRequestValidationError{} - -// Validate checks the field values on UserStatusResponse 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 *UserStatusResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on UserStatusResponse 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 -// UserStatusResponseMultiError, or nil if none found. -func (m *UserStatusResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *UserStatusResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for IsPlatformUser - - if len(errors) > 0 { - return UserStatusResponseMultiError(errors) - } - - return nil -} - -// UserStatusResponseMultiError is an error wrapping multiple validation errors -// returned by UserStatusResponse.ValidateAll() if the designated constraints -// aren't met. -type UserStatusResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m UserStatusResponseMultiError) 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 UserStatusResponseMultiError) AllErrors() []error { return m } - -// UserStatusResponseValidationError is the validation error returned by -// UserStatusResponse.Validate if the designated constraints aren't met. -type UserStatusResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e UserStatusResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e UserStatusResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e UserStatusResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e UserStatusResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e UserStatusResponseValidationError) ErrorName() string { - return "UserStatusResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e UserStatusResponseValidationError) 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 %sUserStatusResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = UserStatusResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = UserStatusResponseValidationError{} - -// Validate checks the field values on OrganizationEntitlement_Platform 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 *OrganizationEntitlement_Platform) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on OrganizationEntitlement_Platform 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 -// OrganizationEntitlement_PlatformMultiError, or nil if none found. -func (m *OrganizationEntitlement_Platform) ValidateAll() error { - return m.validate(true) -} - -func (m *OrganizationEntitlement_Platform) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if m.SecurityAdvisor != nil { - // no validation rules for SecurityAdvisor - } - - if m.ConfigAdvisor != nil { - // no validation rules for ConfigAdvisor - } - - if len(errors) > 0 { - return OrganizationEntitlement_PlatformMultiError(errors) - } - - return nil -} - -// OrganizationEntitlement_PlatformMultiError is an error wrapping multiple -// validation errors returned by -// OrganizationEntitlement_Platform.ValidateAll() if the designated -// constraints aren't met. -type OrganizationEntitlement_PlatformMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m OrganizationEntitlement_PlatformMultiError) 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 OrganizationEntitlement_PlatformMultiError) AllErrors() []error { return m } - -// OrganizationEntitlement_PlatformValidationError is the validation error -// returned by OrganizationEntitlement_Platform.Validate if the designated -// constraints aren't met. -type OrganizationEntitlement_PlatformValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e OrganizationEntitlement_PlatformValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e OrganizationEntitlement_PlatformValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e OrganizationEntitlement_PlatformValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e OrganizationEntitlement_PlatformValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e OrganizationEntitlement_PlatformValidationError) ErrorName() string { - return "OrganizationEntitlement_PlatformValidationError" -} - -// Error satisfies the builtin error interface -func (e OrganizationEntitlement_PlatformValidationError) 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 %sOrganizationEntitlement_Platform.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = OrganizationEntitlement_PlatformValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = OrganizationEntitlement_PlatformValidationError{} - -// Validate checks the field values on -// GetContactInformationResponse_CustomerSuccess 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 *GetContactInformationResponse_CustomerSuccess) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on -// GetContactInformationResponse_CustomerSuccess 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 -// GetContactInformationResponse_CustomerSuccessMultiError, or nil if none found. -func (m *GetContactInformationResponse_CustomerSuccess) ValidateAll() error { - return m.validate(true) -} - -func (m *GetContactInformationResponse_CustomerSuccess) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Name - - // no validation rules for Email - - if len(errors) > 0 { - return GetContactInformationResponse_CustomerSuccessMultiError(errors) - } - - return nil -} - -// GetContactInformationResponse_CustomerSuccessMultiError is an error wrapping -// multiple validation errors returned by -// GetContactInformationResponse_CustomerSuccess.ValidateAll() if the -// designated constraints aren't met. -type GetContactInformationResponse_CustomerSuccessMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m GetContactInformationResponse_CustomerSuccessMultiError) 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 GetContactInformationResponse_CustomerSuccessMultiError) AllErrors() []error { return m } - -// GetContactInformationResponse_CustomerSuccessValidationError is the -// validation error returned by -// GetContactInformationResponse_CustomerSuccess.Validate if the designated -// constraints aren't met. -type GetContactInformationResponse_CustomerSuccessValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e GetContactInformationResponse_CustomerSuccessValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e GetContactInformationResponse_CustomerSuccessValidationError) Reason() string { - return e.reason -} - -// Cause function returns cause value. -func (e GetContactInformationResponse_CustomerSuccessValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e GetContactInformationResponse_CustomerSuccessValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e GetContactInformationResponse_CustomerSuccessValidationError) ErrorName() string { - return "GetContactInformationResponse_CustomerSuccessValidationError" -} - -// Error satisfies the builtin error interface -func (e GetContactInformationResponse_CustomerSuccessValidationError) 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 %sGetContactInformationResponse_CustomerSuccess.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = GetContactInformationResponse_CustomerSuccessValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = GetContactInformationResponse_CustomerSuccessValidationError{} diff --git a/api/platform/v1/platform_grpc.pb.go b/api/platform/v1/platform_grpc.pb.go deleted file mode 100644 index 65c0fe9c599..00000000000 --- a/api/platform/v1/platform_grpc.pb.go +++ /dev/null @@ -1,374 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.6.0 -// - protoc (unknown) -// source: platform/v1/platform.proto - -package platformv1 - -import ( - context "context" - - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.64.0 or later. -const _ = grpc.SupportPackageIsVersion9 - -const ( - PlatformService_Connect_FullMethodName = "/platform.v1.PlatformService/Connect" - PlatformService_Disconnect_FullMethodName = "/platform.v1.PlatformService/Disconnect" - PlatformService_SearchOrganizationTickets_FullMethodName = "/platform.v1.PlatformService/SearchOrganizationTickets" - PlatformService_SearchOrganizationEntitlements_FullMethodName = "/platform.v1.PlatformService/SearchOrganizationEntitlements" - PlatformService_GetContactInformation_FullMethodName = "/platform.v1.PlatformService/GetContactInformation" - PlatformService_ServerInfo_FullMethodName = "/platform.v1.PlatformService/ServerInfo" - PlatformService_UserStatus_FullMethodName = "/platform.v1.PlatformService/UserStatus" -) - -// PlatformServiceClient is the client API for PlatformService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -// -// Platform contains rpcs related to Percona Platform. -type PlatformServiceClient interface { - // Connect a PMM server to the organization created on Percona Portal. That allows the user to sign in to the PMM server with their Percona Account. - Connect(ctx context.Context, in *ConnectRequest, opts ...grpc.CallOption) (*ConnectResponse, error) - // Disconnect a PMM server from the organization created on Percona Portal. - Disconnect(ctx context.Context, in *DisconnectRequest, opts ...grpc.CallOption) (*DisconnectResponse, error) - // SearchOrganizationTickets searches support tickets belonging to the Percona Portal Organization that the PMM server is connected to. - SearchOrganizationTickets(ctx context.Context, in *SearchOrganizationTicketsRequest, opts ...grpc.CallOption) (*SearchOrganizationTicketsResponse, error) - // SearchOrganizationEntitlements fetches entitlements available to the Portal organization that the PMM server is connected to. - SearchOrganizationEntitlements(ctx context.Context, in *SearchOrganizationEntitlementsRequest, opts ...grpc.CallOption) (*SearchOrganizationEntitlementsResponse, error) - // GetContactInformation fetches the contact details of the customer success employee handling the Percona customer account. - GetContactInformation(ctx context.Context, in *GetContactInformationRequest, opts ...grpc.CallOption) (*GetContactInformationResponse, error) - // ServerInfo returns PMM server ID and name. - ServerInfo(ctx context.Context, in *ServerInfoRequest, opts ...grpc.CallOption) (*ServerInfoResponse, error) - // UserStatus check if the current user is logged in with their Percona Account. - UserStatus(ctx context.Context, in *UserStatusRequest, opts ...grpc.CallOption) (*UserStatusResponse, error) -} - -type platformServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewPlatformServiceClient(cc grpc.ClientConnInterface) PlatformServiceClient { - return &platformServiceClient{cc} -} - -func (c *platformServiceClient) Connect(ctx context.Context, in *ConnectRequest, opts ...grpc.CallOption) (*ConnectResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(ConnectResponse) - err := c.cc.Invoke(ctx, PlatformService_Connect_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *platformServiceClient) Disconnect(ctx context.Context, in *DisconnectRequest, opts ...grpc.CallOption) (*DisconnectResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(DisconnectResponse) - err := c.cc.Invoke(ctx, PlatformService_Disconnect_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *platformServiceClient) SearchOrganizationTickets(ctx context.Context, in *SearchOrganizationTicketsRequest, opts ...grpc.CallOption) (*SearchOrganizationTicketsResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(SearchOrganizationTicketsResponse) - err := c.cc.Invoke(ctx, PlatformService_SearchOrganizationTickets_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *platformServiceClient) SearchOrganizationEntitlements(ctx context.Context, in *SearchOrganizationEntitlementsRequest, opts ...grpc.CallOption) (*SearchOrganizationEntitlementsResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(SearchOrganizationEntitlementsResponse) - err := c.cc.Invoke(ctx, PlatformService_SearchOrganizationEntitlements_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *platformServiceClient) GetContactInformation(ctx context.Context, in *GetContactInformationRequest, opts ...grpc.CallOption) (*GetContactInformationResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetContactInformationResponse) - err := c.cc.Invoke(ctx, PlatformService_GetContactInformation_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *platformServiceClient) ServerInfo(ctx context.Context, in *ServerInfoRequest, opts ...grpc.CallOption) (*ServerInfoResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(ServerInfoResponse) - err := c.cc.Invoke(ctx, PlatformService_ServerInfo_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *platformServiceClient) UserStatus(ctx context.Context, in *UserStatusRequest, opts ...grpc.CallOption) (*UserStatusResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(UserStatusResponse) - err := c.cc.Invoke(ctx, PlatformService_UserStatus_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -// PlatformServiceServer is the server API for PlatformService service. -// All implementations must embed UnimplementedPlatformServiceServer -// for forward compatibility. -// -// Platform contains rpcs related to Percona Platform. -type PlatformServiceServer interface { - // Connect a PMM server to the organization created on Percona Portal. That allows the user to sign in to the PMM server with their Percona Account. - Connect(context.Context, *ConnectRequest) (*ConnectResponse, error) - // Disconnect a PMM server from the organization created on Percona Portal. - Disconnect(context.Context, *DisconnectRequest) (*DisconnectResponse, error) - // SearchOrganizationTickets searches support tickets belonging to the Percona Portal Organization that the PMM server is connected to. - SearchOrganizationTickets(context.Context, *SearchOrganizationTicketsRequest) (*SearchOrganizationTicketsResponse, error) - // SearchOrganizationEntitlements fetches entitlements available to the Portal organization that the PMM server is connected to. - SearchOrganizationEntitlements(context.Context, *SearchOrganizationEntitlementsRequest) (*SearchOrganizationEntitlementsResponse, error) - // GetContactInformation fetches the contact details of the customer success employee handling the Percona customer account. - GetContactInformation(context.Context, *GetContactInformationRequest) (*GetContactInformationResponse, error) - // ServerInfo returns PMM server ID and name. - ServerInfo(context.Context, *ServerInfoRequest) (*ServerInfoResponse, error) - // UserStatus check if the current user is logged in with their Percona Account. - UserStatus(context.Context, *UserStatusRequest) (*UserStatusResponse, error) - mustEmbedUnimplementedPlatformServiceServer() -} - -// UnimplementedPlatformServiceServer must be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -type UnimplementedPlatformServiceServer struct{} - -func (UnimplementedPlatformServiceServer) Connect(context.Context, *ConnectRequest) (*ConnectResponse, error) { - return nil, status.Error(codes.Unimplemented, "method Connect not implemented") -} - -func (UnimplementedPlatformServiceServer) Disconnect(context.Context, *DisconnectRequest) (*DisconnectResponse, error) { - return nil, status.Error(codes.Unimplemented, "method Disconnect not implemented") -} - -func (UnimplementedPlatformServiceServer) SearchOrganizationTickets(context.Context, *SearchOrganizationTicketsRequest) (*SearchOrganizationTicketsResponse, error) { - return nil, status.Error(codes.Unimplemented, "method SearchOrganizationTickets not implemented") -} - -func (UnimplementedPlatformServiceServer) SearchOrganizationEntitlements(context.Context, *SearchOrganizationEntitlementsRequest) (*SearchOrganizationEntitlementsResponse, error) { - return nil, status.Error(codes.Unimplemented, "method SearchOrganizationEntitlements not implemented") -} - -func (UnimplementedPlatformServiceServer) GetContactInformation(context.Context, *GetContactInformationRequest) (*GetContactInformationResponse, error) { - return nil, status.Error(codes.Unimplemented, "method GetContactInformation not implemented") -} - -func (UnimplementedPlatformServiceServer) ServerInfo(context.Context, *ServerInfoRequest) (*ServerInfoResponse, error) { - return nil, status.Error(codes.Unimplemented, "method ServerInfo not implemented") -} - -func (UnimplementedPlatformServiceServer) UserStatus(context.Context, *UserStatusRequest) (*UserStatusResponse, error) { - return nil, status.Error(codes.Unimplemented, "method UserStatus not implemented") -} -func (UnimplementedPlatformServiceServer) mustEmbedUnimplementedPlatformServiceServer() {} -func (UnimplementedPlatformServiceServer) testEmbeddedByValue() {} - -// UnsafePlatformServiceServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to PlatformServiceServer will -// result in compilation errors. -type UnsafePlatformServiceServer interface { - mustEmbedUnimplementedPlatformServiceServer() -} - -func RegisterPlatformServiceServer(s grpc.ServiceRegistrar, srv PlatformServiceServer) { - // If the following call panics, it indicates UnimplementedPlatformServiceServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } - s.RegisterService(&PlatformService_ServiceDesc, srv) -} - -func _PlatformService_Connect_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ConnectRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(PlatformServiceServer).Connect(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: PlatformService_Connect_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(PlatformServiceServer).Connect(ctx, req.(*ConnectRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _PlatformService_Disconnect_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DisconnectRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(PlatformServiceServer).Disconnect(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: PlatformService_Disconnect_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(PlatformServiceServer).Disconnect(ctx, req.(*DisconnectRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _PlatformService_SearchOrganizationTickets_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SearchOrganizationTicketsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(PlatformServiceServer).SearchOrganizationTickets(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: PlatformService_SearchOrganizationTickets_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(PlatformServiceServer).SearchOrganizationTickets(ctx, req.(*SearchOrganizationTicketsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _PlatformService_SearchOrganizationEntitlements_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SearchOrganizationEntitlementsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(PlatformServiceServer).SearchOrganizationEntitlements(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: PlatformService_SearchOrganizationEntitlements_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(PlatformServiceServer).SearchOrganizationEntitlements(ctx, req.(*SearchOrganizationEntitlementsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _PlatformService_GetContactInformation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetContactInformationRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(PlatformServiceServer).GetContactInformation(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: PlatformService_GetContactInformation_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(PlatformServiceServer).GetContactInformation(ctx, req.(*GetContactInformationRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _PlatformService_ServerInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ServerInfoRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(PlatformServiceServer).ServerInfo(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: PlatformService_ServerInfo_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(PlatformServiceServer).ServerInfo(ctx, req.(*ServerInfoRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _PlatformService_UserStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UserStatusRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(PlatformServiceServer).UserStatus(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: PlatformService_UserStatus_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(PlatformServiceServer).UserStatus(ctx, req.(*UserStatusRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// PlatformService_ServiceDesc is the grpc.ServiceDesc for PlatformService service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var PlatformService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "platform.v1.PlatformService", - HandlerType: (*PlatformServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Connect", - Handler: _PlatformService_Connect_Handler, - }, - { - MethodName: "Disconnect", - Handler: _PlatformService_Disconnect_Handler, - }, - { - MethodName: "SearchOrganizationTickets", - Handler: _PlatformService_SearchOrganizationTickets_Handler, - }, - { - MethodName: "SearchOrganizationEntitlements", - Handler: _PlatformService_SearchOrganizationEntitlements_Handler, - }, - { - MethodName: "GetContactInformation", - Handler: _PlatformService_GetContactInformation_Handler, - }, - { - MethodName: "ServerInfo", - Handler: _PlatformService_ServerInfo_Handler, - }, - { - MethodName: "UserStatus", - Handler: _PlatformService_UserStatus_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "platform/v1/platform.proto", -} diff --git a/api/qan/v1/collector.pb.go b/api/qan/v1/collector.pb.go deleted file mode 100644 index ba1e11f4967..00000000000 --- a/api/qan/v1/collector.pb.go +++ /dev/null @@ -1,2742 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.10 -// protoc (unknown) -// source: qan/v1/collector.proto - -package qanv1 - -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" - - v1 "github.com/percona/pmm/api/inventory/v1" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type CollectRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - MetricsBucket []*MetricsBucket `protobuf:"bytes,1,rep,name=metrics_bucket,json=metricsBucket,proto3" json:"metrics_bucket,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CollectRequest) Reset() { - *x = CollectRequest{} - mi := &file_qan_v1_collector_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CollectRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CollectRequest) ProtoMessage() {} - -func (x *CollectRequest) ProtoReflect() protoreflect.Message { - mi := &file_qan_v1_collector_proto_msgTypes[0] - 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 CollectRequest.ProtoReflect.Descriptor instead. -func (*CollectRequest) Descriptor() ([]byte, []int) { - return file_qan_v1_collector_proto_rawDescGZIP(), []int{0} -} - -func (x *CollectRequest) GetMetricsBucket() []*MetricsBucket { - if x != nil { - return x.MetricsBucket - } - return nil -} - -// MetricsBucket is aggregated message created by pmm-agent. -// Contains information about one query selected in defined way from query class in specific period of time. -type MetricsBucket struct { - state protoimpl.MessageState `protogen:"open.v1"` - // md5 of digest_text/fingerprint. - Queryid string `protobuf:"bytes,1,opt,name=queryid,proto3" json:"queryid,omitempty"` - // contains fingerprint prepared by sql parser, which can be different than fingerprint. - ExplainFingerprint string `protobuf:"bytes,2,opt,name=explain_fingerprint,json=explainFingerprint,proto3" json:"explain_fingerprint,omitempty"` - // ammount of variables in query. - PlaceholdersCount uint32 `protobuf:"varint,3,opt,name=placeholders_count,json=placeholdersCount,proto3" json:"placeholders_count,omitempty"` - // digest_text - query signature. Query without values. - Fingerprint string `protobuf:"bytes,4,opt,name=fingerprint,proto3" json:"fingerprint,omitempty"` - // Service Name (can be several Services on one Node). - ServiceName string `protobuf:"bytes,10,opt,name=service_name,json=serviceName,proto3" json:"service_name,omitempty"` - // MongoDB or PostgreSQL database. - // Several databases can't be combined in a single declarative query. - Database string `protobuf:"bytes,11,opt,name=database,proto3" json:"database,omitempty"` - // MySQL database or PostgreSQL schema. - // Several schemas can be combined in a single declarative query. - Schema string `protobuf:"bytes,12,opt,name=schema,proto3" json:"schema,omitempty"` - // Tables or Collections list. - Tables []string `protobuf:"bytes,13,rep,name=tables,proto3" json:"tables,omitempty"` - // client user name. - Username string `protobuf:"bytes,14,opt,name=username,proto3" json:"username,omitempty"` - // client IP or hostname. - ClientHost string `protobuf:"bytes,15,opt,name=client_host,json=clientHost,proto3" json:"client_host,omitempty"` - // Node identifier - NodeId string `protobuf:"bytes,20,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` - // Node name - NodeName string `protobuf:"bytes,21,opt,name=node_name,json=nodeName,proto3" json:"node_name,omitempty"` - // Node type - NodeType string `protobuf:"bytes,22,opt,name=node_type,json=nodeType,proto3" json:"node_type,omitempty"` - // Machine identifier - MachineId string `protobuf:"bytes,23,opt,name=machine_id,json=machineId,proto3" json:"machine_id,omitempty"` - // Container identifier - ContainerId string `protobuf:"bytes,24,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` - // Container name - ContainerName string `protobuf:"bytes,25,opt,name=container_name,json=containerName,proto3" json:"container_name,omitempty"` - // Node model - NodeModel string `protobuf:"bytes,26,opt,name=node_model,json=nodeModel,proto3" json:"node_model,omitempty"` - // Region name - Region string `protobuf:"bytes,27,opt,name=region,proto3" json:"region,omitempty"` - // Availability zone - Az string `protobuf:"bytes,28,opt,name=az,proto3" json:"az,omitempty"` - // Service identifier - ServiceId string `protobuf:"bytes,29,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` - // Type of service - ServiceType string `protobuf:"bytes,30,opt,name=service_type,json=serviceType,proto3" json:"service_type,omitempty"` - // Environment name - Environment string `protobuf:"bytes,31,opt,name=environment,proto3" json:"environment,omitempty"` - // Cluster name - Cluster string `protobuf:"bytes,32,opt,name=cluster,proto3" json:"cluster,omitempty"` - // Name of replication set - ReplicationSet string `protobuf:"bytes,33,opt,name=replication_set,json=replicationSet,proto3" json:"replication_set,omitempty"` - // Identifier of agent that collect and send metrics. - AgentId string `protobuf:"bytes,34,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"` - // Metrics source. - AgentType v1.AgentType `protobuf:"varint,35,opt,name=agent_type,json=agentType,proto3,enum=inventory.v1.AgentType" json:"agent_type,omitempty"` - // Custom labels names:values. - Labels map[string]string `protobuf:"bytes,36,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - // Time when collection of bucket started. - PeriodStartUnixSecs uint32 `protobuf:"varint,40,opt,name=period_start_unix_secs,json=periodStartUnixSecs,proto3" json:"period_start_unix_secs,omitempty"` - // Duration of bucket. - PeriodLengthSecs uint32 `protobuf:"varint,41,opt,name=period_length_secs,json=periodLengthSecs,proto3" json:"period_length_secs,omitempty"` - // One of query example from set found in bucket. - Example string `protobuf:"bytes,42,opt,name=example,proto3" json:"example,omitempty"` - // Indicates if the query example is truncated. - IsTruncated bool `protobuf:"varint,43,opt,name=is_truncated,json=isTruncated,proto3" json:"is_truncated,omitempty"` - ExampleType ExampleType `protobuf:"varint,44,opt,name=example_type,json=exampleType,proto3,enum=qan.v1.ExampleType" json:"example_type,omitempty"` - // Metrics of query example in JSON format. - ExampleMetrics string `protobuf:"bytes,45,opt,name=example_metrics,json=exampleMetrics,proto3" json:"example_metrics,omitempty"` - // How many queries was with warnings in bucket. - NumQueriesWithWarnings float32 `protobuf:"fixed32,50,opt,name=num_queries_with_warnings,json=numQueriesWithWarnings,proto3" json:"num_queries_with_warnings,omitempty"` - // List of warnings: {code: count}. - Warnings map[uint64]uint64 `protobuf:"bytes,51,rep,name=warnings,proto3" json:"warnings,omitempty" protobuf_key:"varint,1,opt,name=key" protobuf_val:"varint,2,opt,name=value"` - // How many queries was with error in bucket. - NumQueriesWithErrors float32 `protobuf:"fixed32,52,opt,name=num_queries_with_errors,json=numQueriesWithErrors,proto3" json:"num_queries_with_errors,omitempty"` - // List of errors: {code: count}. - Errors map[uint64]uint64 `protobuf:"bytes,53,rep,name=errors,proto3" json:"errors,omitempty" protobuf_key:"varint,1,opt,name=key" protobuf_val:"varint,2,opt,name=value"` - // Amount queries in this bucket. - NumQueries float32 `protobuf:"fixed32,54,opt,name=num_queries,json=numQueries,proto3" json:"num_queries,omitempty"` - // How many times query_time was found. - MQueryTimeCnt float32 `protobuf:"fixed32,55,opt,name=m_query_time_cnt,json=mQueryTimeCnt,proto3" json:"m_query_time_cnt,omitempty"` - // The statement execution time in seconds. - MQueryTimeSum float32 `protobuf:"fixed32,56,opt,name=m_query_time_sum,json=mQueryTimeSum,proto3" json:"m_query_time_sum,omitempty"` - // Smallest value of query_time in bucket. - MQueryTimeMin float32 `protobuf:"fixed32,57,opt,name=m_query_time_min,json=mQueryTimeMin,proto3" json:"m_query_time_min,omitempty"` - // Biggest value of query_time in bucket. - MQueryTimeMax float32 `protobuf:"fixed32,58,opt,name=m_query_time_max,json=mQueryTimeMax,proto3" json:"m_query_time_max,omitempty"` - // 99 percentile of value of query_time in bucket. - MQueryTimeP99 float32 `protobuf:"fixed32,59,opt,name=m_query_time_p99,json=mQueryTimeP99,proto3" json:"m_query_time_p99,omitempty"` - MLockTimeCnt float32 `protobuf:"fixed32,60,opt,name=m_lock_time_cnt,json=mLockTimeCnt,proto3" json:"m_lock_time_cnt,omitempty"` - // The time to acquire locks in seconds. - MLockTimeSum float32 `protobuf:"fixed32,61,opt,name=m_lock_time_sum,json=mLockTimeSum,proto3" json:"m_lock_time_sum,omitempty"` - MLockTimeMin float32 `protobuf:"fixed32,62,opt,name=m_lock_time_min,json=mLockTimeMin,proto3" json:"m_lock_time_min,omitempty"` - MLockTimeMax float32 `protobuf:"fixed32,63,opt,name=m_lock_time_max,json=mLockTimeMax,proto3" json:"m_lock_time_max,omitempty"` - MLockTimeP99 float32 `protobuf:"fixed32,64,opt,name=m_lock_time_p99,json=mLockTimeP99,proto3" json:"m_lock_time_p99,omitempty"` - MRowsSentCnt float32 `protobuf:"fixed32,65,opt,name=m_rows_sent_cnt,json=mRowsSentCnt,proto3" json:"m_rows_sent_cnt,omitempty"` - // The number of rows sent to the client. - MRowsSentSum float32 `protobuf:"fixed32,66,opt,name=m_rows_sent_sum,json=mRowsSentSum,proto3" json:"m_rows_sent_sum,omitempty"` - MRowsSentMin float32 `protobuf:"fixed32,67,opt,name=m_rows_sent_min,json=mRowsSentMin,proto3" json:"m_rows_sent_min,omitempty"` - MRowsSentMax float32 `protobuf:"fixed32,68,opt,name=m_rows_sent_max,json=mRowsSentMax,proto3" json:"m_rows_sent_max,omitempty"` - MRowsSentP99 float32 `protobuf:"fixed32,69,opt,name=m_rows_sent_p99,json=mRowsSentP99,proto3" json:"m_rows_sent_p99,omitempty"` - MRowsExaminedCnt float32 `protobuf:"fixed32,70,opt,name=m_rows_examined_cnt,json=mRowsExaminedCnt,proto3" json:"m_rows_examined_cnt,omitempty"` - // Number of rows scanned - SELECT. - MRowsExaminedSum float32 `protobuf:"fixed32,71,opt,name=m_rows_examined_sum,json=mRowsExaminedSum,proto3" json:"m_rows_examined_sum,omitempty"` - MRowsExaminedMin float32 `protobuf:"fixed32,72,opt,name=m_rows_examined_min,json=mRowsExaminedMin,proto3" json:"m_rows_examined_min,omitempty"` - MRowsExaminedMax float32 `protobuf:"fixed32,73,opt,name=m_rows_examined_max,json=mRowsExaminedMax,proto3" json:"m_rows_examined_max,omitempty"` - MRowsExaminedP99 float32 `protobuf:"fixed32,74,opt,name=m_rows_examined_p99,json=mRowsExaminedP99,proto3" json:"m_rows_examined_p99,omitempty"` - MRowsAffectedCnt float32 `protobuf:"fixed32,75,opt,name=m_rows_affected_cnt,json=mRowsAffectedCnt,proto3" json:"m_rows_affected_cnt,omitempty"` - // Number of rows changed - UPDATE, DELETE, INSERT. - MRowsAffectedSum float32 `protobuf:"fixed32,76,opt,name=m_rows_affected_sum,json=mRowsAffectedSum,proto3" json:"m_rows_affected_sum,omitempty"` - MRowsAffectedMin float32 `protobuf:"fixed32,77,opt,name=m_rows_affected_min,json=mRowsAffectedMin,proto3" json:"m_rows_affected_min,omitempty"` - MRowsAffectedMax float32 `protobuf:"fixed32,78,opt,name=m_rows_affected_max,json=mRowsAffectedMax,proto3" json:"m_rows_affected_max,omitempty"` - MRowsAffectedP99 float32 `protobuf:"fixed32,79,opt,name=m_rows_affected_p99,json=mRowsAffectedP99,proto3" json:"m_rows_affected_p99,omitempty"` - MRowsReadCnt float32 `protobuf:"fixed32,80,opt,name=m_rows_read_cnt,json=mRowsReadCnt,proto3" json:"m_rows_read_cnt,omitempty"` - // The number of rows read from tables. - MRowsReadSum float32 `protobuf:"fixed32,81,opt,name=m_rows_read_sum,json=mRowsReadSum,proto3" json:"m_rows_read_sum,omitempty"` - MRowsReadMin float32 `protobuf:"fixed32,82,opt,name=m_rows_read_min,json=mRowsReadMin,proto3" json:"m_rows_read_min,omitempty"` - MRowsReadMax float32 `protobuf:"fixed32,83,opt,name=m_rows_read_max,json=mRowsReadMax,proto3" json:"m_rows_read_max,omitempty"` - MRowsReadP99 float32 `protobuf:"fixed32,84,opt,name=m_rows_read_p99,json=mRowsReadP99,proto3" json:"m_rows_read_p99,omitempty"` - MMergePassesCnt float32 `protobuf:"fixed32,85,opt,name=m_merge_passes_cnt,json=mMergePassesCnt,proto3" json:"m_merge_passes_cnt,omitempty"` - // The number of merge passes that the sort algorithm has had to do. - MMergePassesSum float32 `protobuf:"fixed32,86,opt,name=m_merge_passes_sum,json=mMergePassesSum,proto3" json:"m_merge_passes_sum,omitempty"` - MMergePassesMin float32 `protobuf:"fixed32,87,opt,name=m_merge_passes_min,json=mMergePassesMin,proto3" json:"m_merge_passes_min,omitempty"` - MMergePassesMax float32 `protobuf:"fixed32,88,opt,name=m_merge_passes_max,json=mMergePassesMax,proto3" json:"m_merge_passes_max,omitempty"` - MMergePassesP99 float32 `protobuf:"fixed32,89,opt,name=m_merge_passes_p99,json=mMergePassesP99,proto3" json:"m_merge_passes_p99,omitempty"` - MInnodbIoROpsCnt float32 `protobuf:"fixed32,90,opt,name=m_innodb_io_r_ops_cnt,json=mInnodbIoROpsCnt,proto3" json:"m_innodb_io_r_ops_cnt,omitempty"` - // Counts the number of page read operations scheduled. - MInnodbIoROpsSum float32 `protobuf:"fixed32,91,opt,name=m_innodb_io_r_ops_sum,json=mInnodbIoROpsSum,proto3" json:"m_innodb_io_r_ops_sum,omitempty"` - MInnodbIoROpsMin float32 `protobuf:"fixed32,92,opt,name=m_innodb_io_r_ops_min,json=mInnodbIoROpsMin,proto3" json:"m_innodb_io_r_ops_min,omitempty"` - MInnodbIoROpsMax float32 `protobuf:"fixed32,93,opt,name=m_innodb_io_r_ops_max,json=mInnodbIoROpsMax,proto3" json:"m_innodb_io_r_ops_max,omitempty"` - MInnodbIoROpsP99 float32 `protobuf:"fixed32,94,opt,name=m_innodb_io_r_ops_p99,json=mInnodbIoROpsP99,proto3" json:"m_innodb_io_r_ops_p99,omitempty"` - MInnodbIoRBytesCnt float32 `protobuf:"fixed32,95,opt,name=m_innodb_io_r_bytes_cnt,json=mInnodbIoRBytesCnt,proto3" json:"m_innodb_io_r_bytes_cnt,omitempty"` - // Similar to innodb_IO_r_ops, but the unit is bytes. - MInnodbIoRBytesSum float32 `protobuf:"fixed32,96,opt,name=m_innodb_io_r_bytes_sum,json=mInnodbIoRBytesSum,proto3" json:"m_innodb_io_r_bytes_sum,omitempty"` - MInnodbIoRBytesMin float32 `protobuf:"fixed32,97,opt,name=m_innodb_io_r_bytes_min,json=mInnodbIoRBytesMin,proto3" json:"m_innodb_io_r_bytes_min,omitempty"` - MInnodbIoRBytesMax float32 `protobuf:"fixed32,98,opt,name=m_innodb_io_r_bytes_max,json=mInnodbIoRBytesMax,proto3" json:"m_innodb_io_r_bytes_max,omitempty"` - MInnodbIoRBytesP99 float32 `protobuf:"fixed32,99,opt,name=m_innodb_io_r_bytes_p99,json=mInnodbIoRBytesP99,proto3" json:"m_innodb_io_r_bytes_p99,omitempty"` - MInnodbIoRWaitCnt float32 `protobuf:"fixed32,100,opt,name=m_innodb_io_r_wait_cnt,json=mInnodbIoRWaitCnt,proto3" json:"m_innodb_io_r_wait_cnt,omitempty"` - // Shows how long (in seconds) it took InnoDB to actually read the data from storage. - MInnodbIoRWaitSum float32 `protobuf:"fixed32,101,opt,name=m_innodb_io_r_wait_sum,json=mInnodbIoRWaitSum,proto3" json:"m_innodb_io_r_wait_sum,omitempty"` - MInnodbIoRWaitMin float32 `protobuf:"fixed32,102,opt,name=m_innodb_io_r_wait_min,json=mInnodbIoRWaitMin,proto3" json:"m_innodb_io_r_wait_min,omitempty"` - MInnodbIoRWaitMax float32 `protobuf:"fixed32,103,opt,name=m_innodb_io_r_wait_max,json=mInnodbIoRWaitMax,proto3" json:"m_innodb_io_r_wait_max,omitempty"` - MInnodbIoRWaitP99 float32 `protobuf:"fixed32,104,opt,name=m_innodb_io_r_wait_p99,json=mInnodbIoRWaitP99,proto3" json:"m_innodb_io_r_wait_p99,omitempty"` - MInnodbRecLockWaitCnt float32 `protobuf:"fixed32,105,opt,name=m_innodb_rec_lock_wait_cnt,json=mInnodbRecLockWaitCnt,proto3" json:"m_innodb_rec_lock_wait_cnt,omitempty"` - // Shows how long (in seconds) the query waited for row locks. - MInnodbRecLockWaitSum float32 `protobuf:"fixed32,106,opt,name=m_innodb_rec_lock_wait_sum,json=mInnodbRecLockWaitSum,proto3" json:"m_innodb_rec_lock_wait_sum,omitempty"` - MInnodbRecLockWaitMin float32 `protobuf:"fixed32,107,opt,name=m_innodb_rec_lock_wait_min,json=mInnodbRecLockWaitMin,proto3" json:"m_innodb_rec_lock_wait_min,omitempty"` - MInnodbRecLockWaitMax float32 `protobuf:"fixed32,108,opt,name=m_innodb_rec_lock_wait_max,json=mInnodbRecLockWaitMax,proto3" json:"m_innodb_rec_lock_wait_max,omitempty"` - MInnodbRecLockWaitP99 float32 `protobuf:"fixed32,109,opt,name=m_innodb_rec_lock_wait_p99,json=mInnodbRecLockWaitP99,proto3" json:"m_innodb_rec_lock_wait_p99,omitempty"` - MInnodbQueueWaitCnt float32 `protobuf:"fixed32,110,opt,name=m_innodb_queue_wait_cnt,json=mInnodbQueueWaitCnt,proto3" json:"m_innodb_queue_wait_cnt,omitempty"` - // Shows how long (in seconds) the query spent either waiting to enter the InnoDB queue or inside that queue waiting for execution. - MInnodbQueueWaitSum float32 `protobuf:"fixed32,111,opt,name=m_innodb_queue_wait_sum,json=mInnodbQueueWaitSum,proto3" json:"m_innodb_queue_wait_sum,omitempty"` - MInnodbQueueWaitMin float32 `protobuf:"fixed32,112,opt,name=m_innodb_queue_wait_min,json=mInnodbQueueWaitMin,proto3" json:"m_innodb_queue_wait_min,omitempty"` - MInnodbQueueWaitMax float32 `protobuf:"fixed32,113,opt,name=m_innodb_queue_wait_max,json=mInnodbQueueWaitMax,proto3" json:"m_innodb_queue_wait_max,omitempty"` - MInnodbQueueWaitP99 float32 `protobuf:"fixed32,114,opt,name=m_innodb_queue_wait_p99,json=mInnodbQueueWaitP99,proto3" json:"m_innodb_queue_wait_p99,omitempty"` - MInnodbPagesDistinctCnt float32 `protobuf:"fixed32,115,opt,name=m_innodb_pages_distinct_cnt,json=mInnodbPagesDistinctCnt,proto3" json:"m_innodb_pages_distinct_cnt,omitempty"` - // Counts approximately the number of unique pages the query accessed. - MInnodbPagesDistinctSum float32 `protobuf:"fixed32,116,opt,name=m_innodb_pages_distinct_sum,json=mInnodbPagesDistinctSum,proto3" json:"m_innodb_pages_distinct_sum,omitempty"` - MInnodbPagesDistinctMin float32 `protobuf:"fixed32,117,opt,name=m_innodb_pages_distinct_min,json=mInnodbPagesDistinctMin,proto3" json:"m_innodb_pages_distinct_min,omitempty"` - MInnodbPagesDistinctMax float32 `protobuf:"fixed32,118,opt,name=m_innodb_pages_distinct_max,json=mInnodbPagesDistinctMax,proto3" json:"m_innodb_pages_distinct_max,omitempty"` - MInnodbPagesDistinctP99 float32 `protobuf:"fixed32,119,opt,name=m_innodb_pages_distinct_p99,json=mInnodbPagesDistinctP99,proto3" json:"m_innodb_pages_distinct_p99,omitempty"` - MQueryLengthCnt float32 `protobuf:"fixed32,120,opt,name=m_query_length_cnt,json=mQueryLengthCnt,proto3" json:"m_query_length_cnt,omitempty"` - // Shows how long the query is. - MQueryLengthSum float32 `protobuf:"fixed32,121,opt,name=m_query_length_sum,json=mQueryLengthSum,proto3" json:"m_query_length_sum,omitempty"` - MQueryLengthMin float32 `protobuf:"fixed32,122,opt,name=m_query_length_min,json=mQueryLengthMin,proto3" json:"m_query_length_min,omitempty"` - MQueryLengthMax float32 `protobuf:"fixed32,123,opt,name=m_query_length_max,json=mQueryLengthMax,proto3" json:"m_query_length_max,omitempty"` - MQueryLengthP99 float32 `protobuf:"fixed32,124,opt,name=m_query_length_p99,json=mQueryLengthP99,proto3" json:"m_query_length_p99,omitempty"` - MBytesSentCnt float32 `protobuf:"fixed32,125,opt,name=m_bytes_sent_cnt,json=mBytesSentCnt,proto3" json:"m_bytes_sent_cnt,omitempty"` - // The number of bytes sent to all clients. - MBytesSentSum float32 `protobuf:"fixed32,126,opt,name=m_bytes_sent_sum,json=mBytesSentSum,proto3" json:"m_bytes_sent_sum,omitempty"` - MBytesSentMin float32 `protobuf:"fixed32,127,opt,name=m_bytes_sent_min,json=mBytesSentMin,proto3" json:"m_bytes_sent_min,omitempty"` - MBytesSentMax float32 `protobuf:"fixed32,128,opt,name=m_bytes_sent_max,json=mBytesSentMax,proto3" json:"m_bytes_sent_max,omitempty"` - MBytesSentP99 float32 `protobuf:"fixed32,129,opt,name=m_bytes_sent_p99,json=mBytesSentP99,proto3" json:"m_bytes_sent_p99,omitempty"` - MTmpTablesCnt float32 `protobuf:"fixed32,130,opt,name=m_tmp_tables_cnt,json=mTmpTablesCnt,proto3" json:"m_tmp_tables_cnt,omitempty"` - // Number of temporary tables created on memory for the query. - MTmpTablesSum float32 `protobuf:"fixed32,131,opt,name=m_tmp_tables_sum,json=mTmpTablesSum,proto3" json:"m_tmp_tables_sum,omitempty"` - MTmpTablesMin float32 `protobuf:"fixed32,132,opt,name=m_tmp_tables_min,json=mTmpTablesMin,proto3" json:"m_tmp_tables_min,omitempty"` - MTmpTablesMax float32 `protobuf:"fixed32,133,opt,name=m_tmp_tables_max,json=mTmpTablesMax,proto3" json:"m_tmp_tables_max,omitempty"` - MTmpTablesP99 float32 `protobuf:"fixed32,134,opt,name=m_tmp_tables_p99,json=mTmpTablesP99,proto3" json:"m_tmp_tables_p99,omitempty"` - MTmpDiskTablesCnt float32 `protobuf:"fixed32,135,opt,name=m_tmp_disk_tables_cnt,json=mTmpDiskTablesCnt,proto3" json:"m_tmp_disk_tables_cnt,omitempty"` - // Number of temporary tables created on disk for the query. - MTmpDiskTablesSum float32 `protobuf:"fixed32,136,opt,name=m_tmp_disk_tables_sum,json=mTmpDiskTablesSum,proto3" json:"m_tmp_disk_tables_sum,omitempty"` - MTmpDiskTablesMin float32 `protobuf:"fixed32,137,opt,name=m_tmp_disk_tables_min,json=mTmpDiskTablesMin,proto3" json:"m_tmp_disk_tables_min,omitempty"` - MTmpDiskTablesMax float32 `protobuf:"fixed32,138,opt,name=m_tmp_disk_tables_max,json=mTmpDiskTablesMax,proto3" json:"m_tmp_disk_tables_max,omitempty"` - MTmpDiskTablesP99 float32 `protobuf:"fixed32,139,opt,name=m_tmp_disk_tables_p99,json=mTmpDiskTablesP99,proto3" json:"m_tmp_disk_tables_p99,omitempty"` - MTmpTableSizesCnt float32 `protobuf:"fixed32,140,opt,name=m_tmp_table_sizes_cnt,json=mTmpTableSizesCnt,proto3" json:"m_tmp_table_sizes_cnt,omitempty"` - // Total Size in bytes for all temporary tables used in the query. - MTmpTableSizesSum float32 `protobuf:"fixed32,141,opt,name=m_tmp_table_sizes_sum,json=mTmpTableSizesSum,proto3" json:"m_tmp_table_sizes_sum,omitempty"` - MTmpTableSizesMin float32 `protobuf:"fixed32,142,opt,name=m_tmp_table_sizes_min,json=mTmpTableSizesMin,proto3" json:"m_tmp_table_sizes_min,omitempty"` - MTmpTableSizesMax float32 `protobuf:"fixed32,143,opt,name=m_tmp_table_sizes_max,json=mTmpTableSizesMax,proto3" json:"m_tmp_table_sizes_max,omitempty"` - MTmpTableSizesP99 float32 `protobuf:"fixed32,144,opt,name=m_tmp_table_sizes_p99,json=mTmpTableSizesP99,proto3" json:"m_tmp_table_sizes_p99,omitempty"` - MQcHitCnt float32 `protobuf:"fixed32,150,opt,name=m_qc_hit_cnt,json=mQcHitCnt,proto3" json:"m_qc_hit_cnt,omitempty"` - // Query Cache hits. - MQcHitSum float32 `protobuf:"fixed32,151,opt,name=m_qc_hit_sum,json=mQcHitSum,proto3" json:"m_qc_hit_sum,omitempty"` - MFullScanCnt float32 `protobuf:"fixed32,152,opt,name=m_full_scan_cnt,json=mFullScanCnt,proto3" json:"m_full_scan_cnt,omitempty"` - // The query performed a full table scan. - MFullScanSum float32 `protobuf:"fixed32,153,opt,name=m_full_scan_sum,json=mFullScanSum,proto3" json:"m_full_scan_sum,omitempty"` - MFullJoinCnt float32 `protobuf:"fixed32,154,opt,name=m_full_join_cnt,json=mFullJoinCnt,proto3" json:"m_full_join_cnt,omitempty"` - // The query performed a full join (a join without indexes). - MFullJoinSum float32 `protobuf:"fixed32,155,opt,name=m_full_join_sum,json=mFullJoinSum,proto3" json:"m_full_join_sum,omitempty"` - MTmpTableCnt float32 `protobuf:"fixed32,156,opt,name=m_tmp_table_cnt,json=mTmpTableCnt,proto3" json:"m_tmp_table_cnt,omitempty"` - // The query created an implicit internal temporary table. - MTmpTableSum float32 `protobuf:"fixed32,157,opt,name=m_tmp_table_sum,json=mTmpTableSum,proto3" json:"m_tmp_table_sum,omitempty"` - MTmpTableOnDiskCnt float32 `protobuf:"fixed32,158,opt,name=m_tmp_table_on_disk_cnt,json=mTmpTableOnDiskCnt,proto3" json:"m_tmp_table_on_disk_cnt,omitempty"` - // The querys temporary table was stored on disk. - MTmpTableOnDiskSum float32 `protobuf:"fixed32,159,opt,name=m_tmp_table_on_disk_sum,json=mTmpTableOnDiskSum,proto3" json:"m_tmp_table_on_disk_sum,omitempty"` - MFilesortCnt float32 `protobuf:"fixed32,160,opt,name=m_filesort_cnt,json=mFilesortCnt,proto3" json:"m_filesort_cnt,omitempty"` - // The query used a filesort. - MFilesortSum float32 `protobuf:"fixed32,161,opt,name=m_filesort_sum,json=mFilesortSum,proto3" json:"m_filesort_sum,omitempty"` - MFilesortOnDiskCnt float32 `protobuf:"fixed32,162,opt,name=m_filesort_on_disk_cnt,json=mFilesortOnDiskCnt,proto3" json:"m_filesort_on_disk_cnt,omitempty"` - // The filesort was performed on disk. - MFilesortOnDiskSum float32 `protobuf:"fixed32,163,opt,name=m_filesort_on_disk_sum,json=mFilesortOnDiskSum,proto3" json:"m_filesort_on_disk_sum,omitempty"` - MSelectFullRangeJoinCnt float32 `protobuf:"fixed32,164,opt,name=m_select_full_range_join_cnt,json=mSelectFullRangeJoinCnt,proto3" json:"m_select_full_range_join_cnt,omitempty"` - // The number of joins that used a range search on a reference table. - MSelectFullRangeJoinSum float32 `protobuf:"fixed32,165,opt,name=m_select_full_range_join_sum,json=mSelectFullRangeJoinSum,proto3" json:"m_select_full_range_join_sum,omitempty"` - MSelectRangeCnt float32 `protobuf:"fixed32,166,opt,name=m_select_range_cnt,json=mSelectRangeCnt,proto3" json:"m_select_range_cnt,omitempty"` - // The number of joins that used ranges on the first table. - MSelectRangeSum float32 `protobuf:"fixed32,167,opt,name=m_select_range_sum,json=mSelectRangeSum,proto3" json:"m_select_range_sum,omitempty"` - MSelectRangeCheckCnt float32 `protobuf:"fixed32,168,opt,name=m_select_range_check_cnt,json=mSelectRangeCheckCnt,proto3" json:"m_select_range_check_cnt,omitempty"` - // The number of joins without keys that check for key usage after each row. - MSelectRangeCheckSum float32 `protobuf:"fixed32,169,opt,name=m_select_range_check_sum,json=mSelectRangeCheckSum,proto3" json:"m_select_range_check_sum,omitempty"` - MSortRangeCnt float32 `protobuf:"fixed32,170,opt,name=m_sort_range_cnt,json=mSortRangeCnt,proto3" json:"m_sort_range_cnt,omitempty"` - // The number of sorts that were done using ranges. - MSortRangeSum float32 `protobuf:"fixed32,171,opt,name=m_sort_range_sum,json=mSortRangeSum,proto3" json:"m_sort_range_sum,omitempty"` - MSortRowsCnt float32 `protobuf:"fixed32,172,opt,name=m_sort_rows_cnt,json=mSortRowsCnt,proto3" json:"m_sort_rows_cnt,omitempty"` - // The number of sorted rows. - MSortRowsSum float32 `protobuf:"fixed32,173,opt,name=m_sort_rows_sum,json=mSortRowsSum,proto3" json:"m_sort_rows_sum,omitempty"` - MSortScanCnt float32 `protobuf:"fixed32,174,opt,name=m_sort_scan_cnt,json=mSortScanCnt,proto3" json:"m_sort_scan_cnt,omitempty"` - // The number of sorts that were done by scanning the table. - MSortScanSum float32 `protobuf:"fixed32,175,opt,name=m_sort_scan_sum,json=mSortScanSum,proto3" json:"m_sort_scan_sum,omitempty"` - MNoIndexUsedCnt float32 `protobuf:"fixed32,176,opt,name=m_no_index_used_cnt,json=mNoIndexUsedCnt,proto3" json:"m_no_index_used_cnt,omitempty"` - // The number of queries without index. - MNoIndexUsedSum float32 `protobuf:"fixed32,177,opt,name=m_no_index_used_sum,json=mNoIndexUsedSum,proto3" json:"m_no_index_used_sum,omitempty"` - MNoGoodIndexUsedCnt float32 `protobuf:"fixed32,178,opt,name=m_no_good_index_used_cnt,json=mNoGoodIndexUsedCnt,proto3" json:"m_no_good_index_used_cnt,omitempty"` - // The number of queries without good index. - MNoGoodIndexUsedSum float32 `protobuf:"fixed32,179,opt,name=m_no_good_index_used_sum,json=mNoGoodIndexUsedSum,proto3" json:"m_no_good_index_used_sum,omitempty"` - MDocsReturnedCnt float32 `protobuf:"fixed32,190,opt,name=m_docs_returned_cnt,json=mDocsReturnedCnt,proto3" json:"m_docs_returned_cnt,omitempty"` - // The number of returned documents. - MDocsReturnedSum float32 `protobuf:"fixed32,191,opt,name=m_docs_returned_sum,json=mDocsReturnedSum,proto3" json:"m_docs_returned_sum,omitempty"` - MDocsReturnedMin float32 `protobuf:"fixed32,192,opt,name=m_docs_returned_min,json=mDocsReturnedMin,proto3" json:"m_docs_returned_min,omitempty"` - MDocsReturnedMax float32 `protobuf:"fixed32,193,opt,name=m_docs_returned_max,json=mDocsReturnedMax,proto3" json:"m_docs_returned_max,omitempty"` - MDocsReturnedP99 float32 `protobuf:"fixed32,147,opt,name=m_docs_returned_p99,json=mDocsReturnedP99,proto3" json:"m_docs_returned_p99,omitempty"` - MResponseLengthCnt float32 `protobuf:"fixed32,195,opt,name=m_response_length_cnt,json=mResponseLengthCnt,proto3" json:"m_response_length_cnt,omitempty"` - // The response length of the query result in bytes. - MResponseLengthSum float32 `protobuf:"fixed32,196,opt,name=m_response_length_sum,json=mResponseLengthSum,proto3" json:"m_response_length_sum,omitempty"` - MResponseLengthMin float32 `protobuf:"fixed32,197,opt,name=m_response_length_min,json=mResponseLengthMin,proto3" json:"m_response_length_min,omitempty"` - MResponseLengthMax float32 `protobuf:"fixed32,198,opt,name=m_response_length_max,json=mResponseLengthMax,proto3" json:"m_response_length_max,omitempty"` - MResponseLengthP99 float32 `protobuf:"fixed32,199,opt,name=m_response_length_p99,json=mResponseLengthP99,proto3" json:"m_response_length_p99,omitempty"` - MDocsScannedCnt float32 `protobuf:"fixed32,200,opt,name=m_docs_scanned_cnt,json=mDocsScannedCnt,proto3" json:"m_docs_scanned_cnt,omitempty"` - // The number of scanned documents. - MDocsScannedSum float32 `protobuf:"fixed32,201,opt,name=m_docs_scanned_sum,json=mDocsScannedSum,proto3" json:"m_docs_scanned_sum,omitempty"` - MDocsScannedMin float32 `protobuf:"fixed32,202,opt,name=m_docs_scanned_min,json=mDocsScannedMin,proto3" json:"m_docs_scanned_min,omitempty"` - MDocsScannedMax float32 `protobuf:"fixed32,203,opt,name=m_docs_scanned_max,json=mDocsScannedMax,proto3" json:"m_docs_scanned_max,omitempty"` - MDocsScannedP99 float32 `protobuf:"fixed32,204,opt,name=m_docs_scanned_p99,json=mDocsScannedP99,proto3" json:"m_docs_scanned_p99,omitempty"` - // Plan summary type (COLLSCAN, IXSCAN, etc). - PlanSummary string `protobuf:"bytes,205,opt,name=plan_summary,json=planSummary,proto3" json:"plan_summary,omitempty"` - // Total number of documents scanned during query execution. - MDocsExaminedCnt float32 `protobuf:"fixed32,269,opt,name=m_docs_examined_cnt,json=mDocsExaminedCnt,proto3" json:"m_docs_examined_cnt,omitempty"` - MDocsExaminedSum float32 `protobuf:"fixed32,270,opt,name=m_docs_examined_sum,json=mDocsExaminedSum,proto3" json:"m_docs_examined_sum,omitempty"` - MDocsExaminedMin float32 `protobuf:"fixed32,271,opt,name=m_docs_examined_min,json=mDocsExaminedMin,proto3" json:"m_docs_examined_min,omitempty"` - MDocsExaminedMax float32 `protobuf:"fixed32,272,opt,name=m_docs_examined_max,json=mDocsExaminedMax,proto3" json:"m_docs_examined_max,omitempty"` - MDocsExaminedP99 float32 `protobuf:"fixed32,273,opt,name=m_docs_examined_p99,json=mDocsExaminedP99,proto3" json:"m_docs_examined_p99,omitempty"` - // Total number of index keys scanned during query execution. - MKeysExaminedCnt float32 `protobuf:"fixed32,274,opt,name=m_keys_examined_cnt,json=mKeysExaminedCnt,proto3" json:"m_keys_examined_cnt,omitempty"` - MKeysExaminedSum float32 `protobuf:"fixed32,275,opt,name=m_keys_examined_sum,json=mKeysExaminedSum,proto3" json:"m_keys_examined_sum,omitempty"` - MKeysExaminedMin float32 `protobuf:"fixed32,276,opt,name=m_keys_examined_min,json=mKeysExaminedMin,proto3" json:"m_keys_examined_min,omitempty"` - MKeysExaminedMax float32 `protobuf:"fixed32,277,opt,name=m_keys_examined_max,json=mKeysExaminedMax,proto3" json:"m_keys_examined_max,omitempty"` - MKeysExaminedP99 float32 `protobuf:"fixed32,278,opt,name=m_keys_examined_p99,json=mKeysExaminedP99,proto3" json:"m_keys_examined_p99,omitempty"` - // Number of times a global read lock was acquired during query execution. - MLocksGlobalAcquireCountReadSharedCnt float32 `protobuf:"fixed32,279,opt,name=m_locks_global_acquire_count_read_shared_cnt,json=mLocksGlobalAcquireCountReadSharedCnt,proto3" json:"m_locks_global_acquire_count_read_shared_cnt,omitempty"` - MLocksGlobalAcquireCountReadSharedSum float32 `protobuf:"fixed32,280,opt,name=m_locks_global_acquire_count_read_shared_sum,json=mLocksGlobalAcquireCountReadSharedSum,proto3" json:"m_locks_global_acquire_count_read_shared_sum,omitempty"` - // Number of times a global write lock was acquired during query execution. - MLocksGlobalAcquireCountWriteSharedCnt float32 `protobuf:"fixed32,281,opt,name=m_locks_global_acquire_count_write_shared_cnt,json=mLocksGlobalAcquireCountWriteSharedCnt,proto3" json:"m_locks_global_acquire_count_write_shared_cnt,omitempty"` - MLocksGlobalAcquireCountWriteSharedSum float32 `protobuf:"fixed32,282,opt,name=m_locks_global_acquire_count_write_shared_sum,json=mLocksGlobalAcquireCountWriteSharedSum,proto3" json:"m_locks_global_acquire_count_write_shared_sum,omitempty"` - // Number of times a read lock was acquired at the database level during query execution. - MLocksDatabaseAcquireCountReadSharedCnt float32 `protobuf:"fixed32,283,opt,name=m_locks_database_acquire_count_read_shared_cnt,json=mLocksDatabaseAcquireCountReadSharedCnt,proto3" json:"m_locks_database_acquire_count_read_shared_cnt,omitempty"` - MLocksDatabaseAcquireCountReadSharedSum float32 `protobuf:"fixed32,284,opt,name=m_locks_database_acquire_count_read_shared_sum,json=mLocksDatabaseAcquireCountReadSharedSum,proto3" json:"m_locks_database_acquire_count_read_shared_sum,omitempty"` - // Number of times a read lock at the database level was requested but had to wait before being granted. - MLocksDatabaseAcquireWaitCountReadSharedCnt float32 `protobuf:"fixed32,285,opt,name=m_locks_database_acquire_wait_count_read_shared_cnt,json=mLocksDatabaseAcquireWaitCountReadSharedCnt,proto3" json:"m_locks_database_acquire_wait_count_read_shared_cnt,omitempty"` - MLocksDatabaseAcquireWaitCountReadSharedSum float32 `protobuf:"fixed32,286,opt,name=m_locks_database_acquire_wait_count_read_shared_sum,json=mLocksDatabaseAcquireWaitCountReadSharedSum,proto3" json:"m_locks_database_acquire_wait_count_read_shared_sum,omitempty"` - // Indicates the time, spent acquiring a read lock at the database level during an operation. - MLocksDatabaseTimeAcquiringMicrosReadSharedCnt float32 `protobuf:"fixed32,287,opt,name=m_locks_database_time_acquiring_micros_read_shared_cnt,json=mLocksDatabaseTimeAcquiringMicrosReadSharedCnt,proto3" json:"m_locks_database_time_acquiring_micros_read_shared_cnt,omitempty"` - MLocksDatabaseTimeAcquiringMicrosReadSharedSum float32 `protobuf:"fixed32,288,opt,name=m_locks_database_time_acquiring_micros_read_shared_sum,json=mLocksDatabaseTimeAcquiringMicrosReadSharedSum,proto3" json:"m_locks_database_time_acquiring_micros_read_shared_sum,omitempty"` - MLocksDatabaseTimeAcquiringMicrosReadSharedMin float32 `protobuf:"fixed32,289,opt,name=m_locks_database_time_acquiring_micros_read_shared_min,json=mLocksDatabaseTimeAcquiringMicrosReadSharedMin,proto3" json:"m_locks_database_time_acquiring_micros_read_shared_min,omitempty"` - MLocksDatabaseTimeAcquiringMicrosReadSharedMax float32 `protobuf:"fixed32,290,opt,name=m_locks_database_time_acquiring_micros_read_shared_max,json=mLocksDatabaseTimeAcquiringMicrosReadSharedMax,proto3" json:"m_locks_database_time_acquiring_micros_read_shared_max,omitempty"` - MLocksDatabaseTimeAcquiringMicrosReadSharedP99 float32 `protobuf:"fixed32,291,opt,name=m_locks_database_time_acquiring_micros_read_shared_p99,json=mLocksDatabaseTimeAcquiringMicrosReadSharedP99,proto3" json:"m_locks_database_time_acquiring_micros_read_shared_p99,omitempty"` - // Number of times a read lock was acquired on a specific collection during operations. - MLocksCollectionAcquireCountReadSharedCnt float32 `protobuf:"fixed32,292,opt,name=m_locks_collection_acquire_count_read_shared_cnt,json=mLocksCollectionAcquireCountReadSharedCnt,proto3" json:"m_locks_collection_acquire_count_read_shared_cnt,omitempty"` - MLocksCollectionAcquireCountReadSharedSum float32 `protobuf:"fixed32,293,opt,name=m_locks_collection_acquire_count_read_shared_sum,json=mLocksCollectionAcquireCountReadSharedSum,proto3" json:"m_locks_collection_acquire_count_read_shared_sum,omitempty"` - // Total number of bytes read from storage during a specific operation. - MStorageBytesReadCnt float32 `protobuf:"fixed32,294,opt,name=m_storage_bytes_read_cnt,json=mStorageBytesReadCnt,proto3" json:"m_storage_bytes_read_cnt,omitempty"` - MStorageBytesReadSum float32 `protobuf:"fixed32,295,opt,name=m_storage_bytes_read_sum,json=mStorageBytesReadSum,proto3" json:"m_storage_bytes_read_sum,omitempty"` - MStorageBytesReadMin float32 `protobuf:"fixed32,296,opt,name=m_storage_bytes_read_min,json=mStorageBytesReadMin,proto3" json:"m_storage_bytes_read_min,omitempty"` - MStorageBytesReadMax float32 `protobuf:"fixed32,297,opt,name=m_storage_bytes_read_max,json=mStorageBytesReadMax,proto3" json:"m_storage_bytes_read_max,omitempty"` - MStorageBytesReadP99 float32 `protobuf:"fixed32,298,opt,name=m_storage_bytes_read_p99,json=mStorageBytesReadP99,proto3" json:"m_storage_bytes_read_p99,omitempty"` - // Indicates the time, spent reading data from storage during an operation. - MStorageTimeReadingMicrosCnt float32 `protobuf:"fixed32,299,opt,name=m_storage_time_reading_micros_cnt,json=mStorageTimeReadingMicrosCnt,proto3" json:"m_storage_time_reading_micros_cnt,omitempty"` - MStorageTimeReadingMicrosSum float32 `protobuf:"fixed32,300,opt,name=m_storage_time_reading_micros_sum,json=mStorageTimeReadingMicrosSum,proto3" json:"m_storage_time_reading_micros_sum,omitempty"` - MStorageTimeReadingMicrosMin float32 `protobuf:"fixed32,301,opt,name=m_storage_time_reading_micros_min,json=mStorageTimeReadingMicrosMin,proto3" json:"m_storage_time_reading_micros_min,omitempty"` - MStorageTimeReadingMicrosMax float32 `protobuf:"fixed32,302,opt,name=m_storage_time_reading_micros_max,json=mStorageTimeReadingMicrosMax,proto3" json:"m_storage_time_reading_micros_max,omitempty"` - MStorageTimeReadingMicrosP99 float32 `protobuf:"fixed32,303,opt,name=m_storage_time_reading_micros_p99,json=mStorageTimeReadingMicrosP99,proto3" json:"m_storage_time_reading_micros_p99,omitempty"` - MSharedBlksHitCnt float32 `protobuf:"fixed32,210,opt,name=m_shared_blks_hit_cnt,json=mSharedBlksHitCnt,proto3" json:"m_shared_blks_hit_cnt,omitempty"` - // Total number of shared block cache hits by the statement. - MSharedBlksHitSum float32 `protobuf:"fixed32,211,opt,name=m_shared_blks_hit_sum,json=mSharedBlksHitSum,proto3" json:"m_shared_blks_hit_sum,omitempty"` - MSharedBlksReadCnt float32 `protobuf:"fixed32,212,opt,name=m_shared_blks_read_cnt,json=mSharedBlksReadCnt,proto3" json:"m_shared_blks_read_cnt,omitempty"` - // Total number of shared blocks read by the statement. - MSharedBlksReadSum float32 `protobuf:"fixed32,213,opt,name=m_shared_blks_read_sum,json=mSharedBlksReadSum,proto3" json:"m_shared_blks_read_sum,omitempty"` - MSharedBlksDirtiedCnt float32 `protobuf:"fixed32,214,opt,name=m_shared_blks_dirtied_cnt,json=mSharedBlksDirtiedCnt,proto3" json:"m_shared_blks_dirtied_cnt,omitempty"` - // Total number of shared blocks dirtied by the statement. - MSharedBlksDirtiedSum float32 `protobuf:"fixed32,215,opt,name=m_shared_blks_dirtied_sum,json=mSharedBlksDirtiedSum,proto3" json:"m_shared_blks_dirtied_sum,omitempty"` - MSharedBlksWrittenCnt float32 `protobuf:"fixed32,216,opt,name=m_shared_blks_written_cnt,json=mSharedBlksWrittenCnt,proto3" json:"m_shared_blks_written_cnt,omitempty"` - // Total number of shared blocks written by the statement. - MSharedBlksWrittenSum float32 `protobuf:"fixed32,217,opt,name=m_shared_blks_written_sum,json=mSharedBlksWrittenSum,proto3" json:"m_shared_blks_written_sum,omitempty"` - MLocalBlksHitCnt float32 `protobuf:"fixed32,218,opt,name=m_local_blks_hit_cnt,json=mLocalBlksHitCnt,proto3" json:"m_local_blks_hit_cnt,omitempty"` - // Total number of local block cache hits by the statement. - MLocalBlksHitSum float32 `protobuf:"fixed32,219,opt,name=m_local_blks_hit_sum,json=mLocalBlksHitSum,proto3" json:"m_local_blks_hit_sum,omitempty"` - MLocalBlksReadCnt float32 `protobuf:"fixed32,220,opt,name=m_local_blks_read_cnt,json=mLocalBlksReadCnt,proto3" json:"m_local_blks_read_cnt,omitempty"` - // Total number of local blocks read by the statement. - MLocalBlksReadSum float32 `protobuf:"fixed32,221,opt,name=m_local_blks_read_sum,json=mLocalBlksReadSum,proto3" json:"m_local_blks_read_sum,omitempty"` - MLocalBlksDirtiedCnt float32 `protobuf:"fixed32,222,opt,name=m_local_blks_dirtied_cnt,json=mLocalBlksDirtiedCnt,proto3" json:"m_local_blks_dirtied_cnt,omitempty"` - // Total number of local blocks dirtied by the statement. - MLocalBlksDirtiedSum float32 `protobuf:"fixed32,223,opt,name=m_local_blks_dirtied_sum,json=mLocalBlksDirtiedSum,proto3" json:"m_local_blks_dirtied_sum,omitempty"` - MLocalBlksWrittenCnt float32 `protobuf:"fixed32,224,opt,name=m_local_blks_written_cnt,json=mLocalBlksWrittenCnt,proto3" json:"m_local_blks_written_cnt,omitempty"` - // Total number of local blocks written by the statement. - MLocalBlksWrittenSum float32 `protobuf:"fixed32,225,opt,name=m_local_blks_written_sum,json=mLocalBlksWrittenSum,proto3" json:"m_local_blks_written_sum,omitempty"` - MTempBlksReadCnt float32 `protobuf:"fixed32,226,opt,name=m_temp_blks_read_cnt,json=mTempBlksReadCnt,proto3" json:"m_temp_blks_read_cnt,omitempty"` - // Total number of temp blocks read by the statement. - MTempBlksReadSum float32 `protobuf:"fixed32,227,opt,name=m_temp_blks_read_sum,json=mTempBlksReadSum,proto3" json:"m_temp_blks_read_sum,omitempty"` - MTempBlksWrittenCnt float32 `protobuf:"fixed32,228,opt,name=m_temp_blks_written_cnt,json=mTempBlksWrittenCnt,proto3" json:"m_temp_blks_written_cnt,omitempty"` - // Total number of temp blocks written by the statement. - MTempBlksWrittenSum float32 `protobuf:"fixed32,229,opt,name=m_temp_blks_written_sum,json=mTempBlksWrittenSum,proto3" json:"m_temp_blks_written_sum,omitempty"` - MBlkReadTimeCnt float32 `protobuf:"fixed32,230,opt,name=m_blk_read_time_cnt,json=mBlkReadTimeCnt,proto3" json:"m_blk_read_time_cnt,omitempty"` - // Total time the statement spent reading blocks, in milliseconds (if track_io_timing is enabled, otherwise zero). - MBlkReadTimeSum float32 `protobuf:"fixed32,231,opt,name=m_blk_read_time_sum,json=mBlkReadTimeSum,proto3" json:"m_blk_read_time_sum,omitempty"` - MBlkWriteTimeCnt float32 `protobuf:"fixed32,232,opt,name=m_blk_write_time_cnt,json=mBlkWriteTimeCnt,proto3" json:"m_blk_write_time_cnt,omitempty"` - // Total time the statement spent writing blocks, in milliseconds (if track_io_timing is enabled, otherwise zero). - MBlkWriteTimeSum float32 `protobuf:"fixed32,233,opt,name=m_blk_write_time_sum,json=mBlkWriteTimeSum,proto3" json:"m_blk_write_time_sum,omitempty"` - MSharedBlkReadTimeCnt float32 `protobuf:"fixed32,234,opt,name=m_shared_blk_read_time_cnt,json=mSharedBlkReadTimeCnt,proto3" json:"m_shared_blk_read_time_cnt,omitempty"` - // Total time the statement spent reading shared blocks, in milliseconds (if track_io_timing is enabled, otherwise zero). - MSharedBlkReadTimeSum float32 `protobuf:"fixed32,235,opt,name=m_shared_blk_read_time_sum,json=mSharedBlkReadTimeSum,proto3" json:"m_shared_blk_read_time_sum,omitempty"` - MSharedBlkWriteTimeCnt float32 `protobuf:"fixed32,236,opt,name=m_shared_blk_write_time_cnt,json=mSharedBlkWriteTimeCnt,proto3" json:"m_shared_blk_write_time_cnt,omitempty"` - // Total time the statement spent writing shared blocks, in milliseconds (if track_io_timing is enabled, otherwise zero). - MSharedBlkWriteTimeSum float32 `protobuf:"fixed32,237,opt,name=m_shared_blk_write_time_sum,json=mSharedBlkWriteTimeSum,proto3" json:"m_shared_blk_write_time_sum,omitempty"` - MLocalBlkReadTimeCnt float32 `protobuf:"fixed32,238,opt,name=m_local_blk_read_time_cnt,json=mLocalBlkReadTimeCnt,proto3" json:"m_local_blk_read_time_cnt,omitempty"` - // Total time the statement spent reading local blocks, in milliseconds (if track_io_timing is enabled, otherwise zero). - MLocalBlkReadTimeSum float32 `protobuf:"fixed32,239,opt,name=m_local_blk_read_time_sum,json=mLocalBlkReadTimeSum,proto3" json:"m_local_blk_read_time_sum,omitempty"` - MLocalBlkWriteTimeCnt float32 `protobuf:"fixed32,240,opt,name=m_local_blk_write_time_cnt,json=mLocalBlkWriteTimeCnt,proto3" json:"m_local_blk_write_time_cnt,omitempty"` - // Total time the statement spent writing local blocks, in milliseconds (if track_io_timing is enabled, otherwise zero). - MLocalBlkWriteTimeSum float32 `protobuf:"fixed32,241,opt,name=m_local_blk_write_time_sum,json=mLocalBlkWriteTimeSum,proto3" json:"m_local_blk_write_time_sum,omitempty"` - MCpuUserTimeCnt float32 `protobuf:"fixed32,242,opt,name=m_cpu_user_time_cnt,json=mCpuUserTimeCnt,proto3" json:"m_cpu_user_time_cnt,omitempty"` - // Total time user spent in query. - MCpuUserTimeSum float32 `protobuf:"fixed32,243,opt,name=m_cpu_user_time_sum,json=mCpuUserTimeSum,proto3" json:"m_cpu_user_time_sum,omitempty"` - MCpuSysTimeCnt float32 `protobuf:"fixed32,244,opt,name=m_cpu_sys_time_cnt,json=mCpuSysTimeCnt,proto3" json:"m_cpu_sys_time_cnt,omitempty"` - // Total time system spent in query. - MCpuSysTimeSum float32 `protobuf:"fixed32,245,opt,name=m_cpu_sys_time_sum,json=mCpuSysTimeSum,proto3" json:"m_cpu_sys_time_sum,omitempty"` - // Type of SQL command. - CmdType string `protobuf:"bytes,246,opt,name=cmd_type,json=cmdType,proto3" json:"cmd_type,omitempty"` - // Total number of planned calls. - MPlansCallsSum float32 `protobuf:"fixed32,250,opt,name=m_plans_calls_sum,json=mPlansCallsSum,proto3" json:"m_plans_calls_sum,omitempty"` - MPlansCallsCnt float32 `protobuf:"fixed32,251,opt,name=m_plans_calls_cnt,json=mPlansCallsCnt,proto3" json:"m_plans_calls_cnt,omitempty"` - // Total number of WAL (Write-ahead logging) records. - MWalRecordsSum float32 `protobuf:"fixed32,252,opt,name=m_wal_records_sum,json=mWalRecordsSum,proto3" json:"m_wal_records_sum,omitempty"` - MWalRecordsCnt float32 `protobuf:"fixed32,253,opt,name=m_wal_records_cnt,json=mWalRecordsCnt,proto3" json:"m_wal_records_cnt,omitempty"` - // Total number of FPI (full page images) in WAL (Write-ahead logging) records. - MWalFpiSum float32 `protobuf:"fixed32,254,opt,name=m_wal_fpi_sum,json=mWalFpiSum,proto3" json:"m_wal_fpi_sum,omitempty"` - MWalFpiCnt float32 `protobuf:"fixed32,255,opt,name=m_wal_fpi_cnt,json=mWalFpiCnt,proto3" json:"m_wal_fpi_cnt,omitempty"` - // Total bytes of WAL (Write-ahead logging) records. - MWalBytesSum float32 `protobuf:"fixed32,256,opt,name=m_wal_bytes_sum,json=mWalBytesSum,proto3" json:"m_wal_bytes_sum,omitempty"` - MWalBytesCnt float32 `protobuf:"fixed32,257,opt,name=m_wal_bytes_cnt,json=mWalBytesCnt,proto3" json:"m_wal_bytes_cnt,omitempty"` - // Sum, count, min, max of plan time. - MPlanTimeSum float32 `protobuf:"fixed32,258,opt,name=m_plan_time_sum,json=mPlanTimeSum,proto3" json:"m_plan_time_sum,omitempty"` - MPlanTimeCnt float32 `protobuf:"fixed32,259,opt,name=m_plan_time_cnt,json=mPlanTimeCnt,proto3" json:"m_plan_time_cnt,omitempty"` - MPlanTimeMin float32 `protobuf:"fixed32,260,opt,name=m_plan_time_min,json=mPlanTimeMin,proto3" json:"m_plan_time_min,omitempty"` - MPlanTimeMax float32 `protobuf:"fixed32,261,opt,name=m_plan_time_max,json=mPlanTimeMax,proto3" json:"m_plan_time_max,omitempty"` - // Metrics skipped due to different bucket_time in pg_stat_monitor (17min in PMM, 5min in pg_stat_monitor): - // min_time, max_time, mean_time - // plan_mean_time - // stddev_time - // Other metrics skipped (empty values, codes): - // cmd_type_text, elevel, sqlcode, message, state_code, state - TopQueryid string `protobuf:"bytes,263,opt,name=top_queryid,json=topQueryid,proto3" json:"top_queryid,omitempty"` - TopQuery string `protobuf:"bytes,264,opt,name=top_query,json=topQuery,proto3" json:"top_query,omitempty"` - ApplicationName string `protobuf:"bytes,265,opt,name=application_name,json=applicationName,proto3" json:"application_name,omitempty"` - Planid string `protobuf:"bytes,266,opt,name=planid,proto3" json:"planid,omitempty"` - QueryPlan string `protobuf:"bytes,267,opt,name=query_plan,json=queryPlan,proto3" json:"query_plan,omitempty"` - HistogramItems []string `protobuf:"bytes,268,rep,name=histogram_items,json=histogramItems,proto3" json:"histogram_items,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *MetricsBucket) Reset() { - *x = MetricsBucket{} - mi := &file_qan_v1_collector_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *MetricsBucket) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MetricsBucket) ProtoMessage() {} - -func (x *MetricsBucket) ProtoReflect() protoreflect.Message { - mi := &file_qan_v1_collector_proto_msgTypes[1] - 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 MetricsBucket.ProtoReflect.Descriptor instead. -func (*MetricsBucket) Descriptor() ([]byte, []int) { - return file_qan_v1_collector_proto_rawDescGZIP(), []int{1} -} - -func (x *MetricsBucket) GetQueryid() string { - if x != nil { - return x.Queryid - } - return "" -} - -func (x *MetricsBucket) GetExplainFingerprint() string { - if x != nil { - return x.ExplainFingerprint - } - return "" -} - -func (x *MetricsBucket) GetPlaceholdersCount() uint32 { - if x != nil { - return x.PlaceholdersCount - } - return 0 -} - -func (x *MetricsBucket) GetFingerprint() string { - if x != nil { - return x.Fingerprint - } - return "" -} - -func (x *MetricsBucket) GetServiceName() string { - if x != nil { - return x.ServiceName - } - return "" -} - -func (x *MetricsBucket) GetDatabase() string { - if x != nil { - return x.Database - } - return "" -} - -func (x *MetricsBucket) GetSchema() string { - if x != nil { - return x.Schema - } - return "" -} - -func (x *MetricsBucket) GetTables() []string { - if x != nil { - return x.Tables - } - return nil -} - -func (x *MetricsBucket) GetUsername() string { - if x != nil { - return x.Username - } - return "" -} - -func (x *MetricsBucket) GetClientHost() string { - if x != nil { - return x.ClientHost - } - return "" -} - -func (x *MetricsBucket) GetNodeId() string { - if x != nil { - return x.NodeId - } - return "" -} - -func (x *MetricsBucket) GetNodeName() string { - if x != nil { - return x.NodeName - } - return "" -} - -func (x *MetricsBucket) GetNodeType() string { - if x != nil { - return x.NodeType - } - return "" -} - -func (x *MetricsBucket) GetMachineId() string { - if x != nil { - return x.MachineId - } - return "" -} - -func (x *MetricsBucket) GetContainerId() string { - if x != nil { - return x.ContainerId - } - return "" -} - -func (x *MetricsBucket) GetContainerName() string { - if x != nil { - return x.ContainerName - } - return "" -} - -func (x *MetricsBucket) GetNodeModel() string { - if x != nil { - return x.NodeModel - } - return "" -} - -func (x *MetricsBucket) GetRegion() string { - if x != nil { - return x.Region - } - return "" -} - -func (x *MetricsBucket) GetAz() string { - if x != nil { - return x.Az - } - return "" -} - -func (x *MetricsBucket) GetServiceId() string { - if x != nil { - return x.ServiceId - } - return "" -} - -func (x *MetricsBucket) GetServiceType() string { - if x != nil { - return x.ServiceType - } - return "" -} - -func (x *MetricsBucket) GetEnvironment() string { - if x != nil { - return x.Environment - } - return "" -} - -func (x *MetricsBucket) GetCluster() string { - if x != nil { - return x.Cluster - } - return "" -} - -func (x *MetricsBucket) GetReplicationSet() string { - if x != nil { - return x.ReplicationSet - } - return "" -} - -func (x *MetricsBucket) GetAgentId() string { - if x != nil { - return x.AgentId - } - return "" -} - -func (x *MetricsBucket) GetAgentType() v1.AgentType { - if x != nil { - return x.AgentType - } - return v1.AgentType(0) -} - -func (x *MetricsBucket) GetLabels() map[string]string { - if x != nil { - return x.Labels - } - return nil -} - -func (x *MetricsBucket) GetPeriodStartUnixSecs() uint32 { - if x != nil { - return x.PeriodStartUnixSecs - } - return 0 -} - -func (x *MetricsBucket) GetPeriodLengthSecs() uint32 { - if x != nil { - return x.PeriodLengthSecs - } - return 0 -} - -func (x *MetricsBucket) GetExample() string { - if x != nil { - return x.Example - } - return "" -} - -func (x *MetricsBucket) GetIsTruncated() bool { - if x != nil { - return x.IsTruncated - } - return false -} - -func (x *MetricsBucket) GetExampleType() ExampleType { - if x != nil { - return x.ExampleType - } - return ExampleType_EXAMPLE_TYPE_UNSPECIFIED -} - -func (x *MetricsBucket) GetExampleMetrics() string { - if x != nil { - return x.ExampleMetrics - } - return "" -} - -func (x *MetricsBucket) GetNumQueriesWithWarnings() float32 { - if x != nil { - return x.NumQueriesWithWarnings - } - return 0 -} - -func (x *MetricsBucket) GetWarnings() map[uint64]uint64 { - if x != nil { - return x.Warnings - } - return nil -} - -func (x *MetricsBucket) GetNumQueriesWithErrors() float32 { - if x != nil { - return x.NumQueriesWithErrors - } - return 0 -} - -func (x *MetricsBucket) GetErrors() map[uint64]uint64 { - if x != nil { - return x.Errors - } - return nil -} - -func (x *MetricsBucket) GetNumQueries() float32 { - if x != nil { - return x.NumQueries - } - return 0 -} - -func (x *MetricsBucket) GetMQueryTimeCnt() float32 { - if x != nil { - return x.MQueryTimeCnt - } - return 0 -} - -func (x *MetricsBucket) GetMQueryTimeSum() float32 { - if x != nil { - return x.MQueryTimeSum - } - return 0 -} - -func (x *MetricsBucket) GetMQueryTimeMin() float32 { - if x != nil { - return x.MQueryTimeMin - } - return 0 -} - -func (x *MetricsBucket) GetMQueryTimeMax() float32 { - if x != nil { - return x.MQueryTimeMax - } - return 0 -} - -func (x *MetricsBucket) GetMQueryTimeP99() float32 { - if x != nil { - return x.MQueryTimeP99 - } - return 0 -} - -func (x *MetricsBucket) GetMLockTimeCnt() float32 { - if x != nil { - return x.MLockTimeCnt - } - return 0 -} - -func (x *MetricsBucket) GetMLockTimeSum() float32 { - if x != nil { - return x.MLockTimeSum - } - return 0 -} - -func (x *MetricsBucket) GetMLockTimeMin() float32 { - if x != nil { - return x.MLockTimeMin - } - return 0 -} - -func (x *MetricsBucket) GetMLockTimeMax() float32 { - if x != nil { - return x.MLockTimeMax - } - return 0 -} - -func (x *MetricsBucket) GetMLockTimeP99() float32 { - if x != nil { - return x.MLockTimeP99 - } - return 0 -} - -func (x *MetricsBucket) GetMRowsSentCnt() float32 { - if x != nil { - return x.MRowsSentCnt - } - return 0 -} - -func (x *MetricsBucket) GetMRowsSentSum() float32 { - if x != nil { - return x.MRowsSentSum - } - return 0 -} - -func (x *MetricsBucket) GetMRowsSentMin() float32 { - if x != nil { - return x.MRowsSentMin - } - return 0 -} - -func (x *MetricsBucket) GetMRowsSentMax() float32 { - if x != nil { - return x.MRowsSentMax - } - return 0 -} - -func (x *MetricsBucket) GetMRowsSentP99() float32 { - if x != nil { - return x.MRowsSentP99 - } - return 0 -} - -func (x *MetricsBucket) GetMRowsExaminedCnt() float32 { - if x != nil { - return x.MRowsExaminedCnt - } - return 0 -} - -func (x *MetricsBucket) GetMRowsExaminedSum() float32 { - if x != nil { - return x.MRowsExaminedSum - } - return 0 -} - -func (x *MetricsBucket) GetMRowsExaminedMin() float32 { - if x != nil { - return x.MRowsExaminedMin - } - return 0 -} - -func (x *MetricsBucket) GetMRowsExaminedMax() float32 { - if x != nil { - return x.MRowsExaminedMax - } - return 0 -} - -func (x *MetricsBucket) GetMRowsExaminedP99() float32 { - if x != nil { - return x.MRowsExaminedP99 - } - return 0 -} - -func (x *MetricsBucket) GetMRowsAffectedCnt() float32 { - if x != nil { - return x.MRowsAffectedCnt - } - return 0 -} - -func (x *MetricsBucket) GetMRowsAffectedSum() float32 { - if x != nil { - return x.MRowsAffectedSum - } - return 0 -} - -func (x *MetricsBucket) GetMRowsAffectedMin() float32 { - if x != nil { - return x.MRowsAffectedMin - } - return 0 -} - -func (x *MetricsBucket) GetMRowsAffectedMax() float32 { - if x != nil { - return x.MRowsAffectedMax - } - return 0 -} - -func (x *MetricsBucket) GetMRowsAffectedP99() float32 { - if x != nil { - return x.MRowsAffectedP99 - } - return 0 -} - -func (x *MetricsBucket) GetMRowsReadCnt() float32 { - if x != nil { - return x.MRowsReadCnt - } - return 0 -} - -func (x *MetricsBucket) GetMRowsReadSum() float32 { - if x != nil { - return x.MRowsReadSum - } - return 0 -} - -func (x *MetricsBucket) GetMRowsReadMin() float32 { - if x != nil { - return x.MRowsReadMin - } - return 0 -} - -func (x *MetricsBucket) GetMRowsReadMax() float32 { - if x != nil { - return x.MRowsReadMax - } - return 0 -} - -func (x *MetricsBucket) GetMRowsReadP99() float32 { - if x != nil { - return x.MRowsReadP99 - } - return 0 -} - -func (x *MetricsBucket) GetMMergePassesCnt() float32 { - if x != nil { - return x.MMergePassesCnt - } - return 0 -} - -func (x *MetricsBucket) GetMMergePassesSum() float32 { - if x != nil { - return x.MMergePassesSum - } - return 0 -} - -func (x *MetricsBucket) GetMMergePassesMin() float32 { - if x != nil { - return x.MMergePassesMin - } - return 0 -} - -func (x *MetricsBucket) GetMMergePassesMax() float32 { - if x != nil { - return x.MMergePassesMax - } - return 0 -} - -func (x *MetricsBucket) GetMMergePassesP99() float32 { - if x != nil { - return x.MMergePassesP99 - } - return 0 -} - -func (x *MetricsBucket) GetMInnodbIoROpsCnt() float32 { - if x != nil { - return x.MInnodbIoROpsCnt - } - return 0 -} - -func (x *MetricsBucket) GetMInnodbIoROpsSum() float32 { - if x != nil { - return x.MInnodbIoROpsSum - } - return 0 -} - -func (x *MetricsBucket) GetMInnodbIoROpsMin() float32 { - if x != nil { - return x.MInnodbIoROpsMin - } - return 0 -} - -func (x *MetricsBucket) GetMInnodbIoROpsMax() float32 { - if x != nil { - return x.MInnodbIoROpsMax - } - return 0 -} - -func (x *MetricsBucket) GetMInnodbIoROpsP99() float32 { - if x != nil { - return x.MInnodbIoROpsP99 - } - return 0 -} - -func (x *MetricsBucket) GetMInnodbIoRBytesCnt() float32 { - if x != nil { - return x.MInnodbIoRBytesCnt - } - return 0 -} - -func (x *MetricsBucket) GetMInnodbIoRBytesSum() float32 { - if x != nil { - return x.MInnodbIoRBytesSum - } - return 0 -} - -func (x *MetricsBucket) GetMInnodbIoRBytesMin() float32 { - if x != nil { - return x.MInnodbIoRBytesMin - } - return 0 -} - -func (x *MetricsBucket) GetMInnodbIoRBytesMax() float32 { - if x != nil { - return x.MInnodbIoRBytesMax - } - return 0 -} - -func (x *MetricsBucket) GetMInnodbIoRBytesP99() float32 { - if x != nil { - return x.MInnodbIoRBytesP99 - } - return 0 -} - -func (x *MetricsBucket) GetMInnodbIoRWaitCnt() float32 { - if x != nil { - return x.MInnodbIoRWaitCnt - } - return 0 -} - -func (x *MetricsBucket) GetMInnodbIoRWaitSum() float32 { - if x != nil { - return x.MInnodbIoRWaitSum - } - return 0 -} - -func (x *MetricsBucket) GetMInnodbIoRWaitMin() float32 { - if x != nil { - return x.MInnodbIoRWaitMin - } - return 0 -} - -func (x *MetricsBucket) GetMInnodbIoRWaitMax() float32 { - if x != nil { - return x.MInnodbIoRWaitMax - } - return 0 -} - -func (x *MetricsBucket) GetMInnodbIoRWaitP99() float32 { - if x != nil { - return x.MInnodbIoRWaitP99 - } - return 0 -} - -func (x *MetricsBucket) GetMInnodbRecLockWaitCnt() float32 { - if x != nil { - return x.MInnodbRecLockWaitCnt - } - return 0 -} - -func (x *MetricsBucket) GetMInnodbRecLockWaitSum() float32 { - if x != nil { - return x.MInnodbRecLockWaitSum - } - return 0 -} - -func (x *MetricsBucket) GetMInnodbRecLockWaitMin() float32 { - if x != nil { - return x.MInnodbRecLockWaitMin - } - return 0 -} - -func (x *MetricsBucket) GetMInnodbRecLockWaitMax() float32 { - if x != nil { - return x.MInnodbRecLockWaitMax - } - return 0 -} - -func (x *MetricsBucket) GetMInnodbRecLockWaitP99() float32 { - if x != nil { - return x.MInnodbRecLockWaitP99 - } - return 0 -} - -func (x *MetricsBucket) GetMInnodbQueueWaitCnt() float32 { - if x != nil { - return x.MInnodbQueueWaitCnt - } - return 0 -} - -func (x *MetricsBucket) GetMInnodbQueueWaitSum() float32 { - if x != nil { - return x.MInnodbQueueWaitSum - } - return 0 -} - -func (x *MetricsBucket) GetMInnodbQueueWaitMin() float32 { - if x != nil { - return x.MInnodbQueueWaitMin - } - return 0 -} - -func (x *MetricsBucket) GetMInnodbQueueWaitMax() float32 { - if x != nil { - return x.MInnodbQueueWaitMax - } - return 0 -} - -func (x *MetricsBucket) GetMInnodbQueueWaitP99() float32 { - if x != nil { - return x.MInnodbQueueWaitP99 - } - return 0 -} - -func (x *MetricsBucket) GetMInnodbPagesDistinctCnt() float32 { - if x != nil { - return x.MInnodbPagesDistinctCnt - } - return 0 -} - -func (x *MetricsBucket) GetMInnodbPagesDistinctSum() float32 { - if x != nil { - return x.MInnodbPagesDistinctSum - } - return 0 -} - -func (x *MetricsBucket) GetMInnodbPagesDistinctMin() float32 { - if x != nil { - return x.MInnodbPagesDistinctMin - } - return 0 -} - -func (x *MetricsBucket) GetMInnodbPagesDistinctMax() float32 { - if x != nil { - return x.MInnodbPagesDistinctMax - } - return 0 -} - -func (x *MetricsBucket) GetMInnodbPagesDistinctP99() float32 { - if x != nil { - return x.MInnodbPagesDistinctP99 - } - return 0 -} - -func (x *MetricsBucket) GetMQueryLengthCnt() float32 { - if x != nil { - return x.MQueryLengthCnt - } - return 0 -} - -func (x *MetricsBucket) GetMQueryLengthSum() float32 { - if x != nil { - return x.MQueryLengthSum - } - return 0 -} - -func (x *MetricsBucket) GetMQueryLengthMin() float32 { - if x != nil { - return x.MQueryLengthMin - } - return 0 -} - -func (x *MetricsBucket) GetMQueryLengthMax() float32 { - if x != nil { - return x.MQueryLengthMax - } - return 0 -} - -func (x *MetricsBucket) GetMQueryLengthP99() float32 { - if x != nil { - return x.MQueryLengthP99 - } - return 0 -} - -func (x *MetricsBucket) GetMBytesSentCnt() float32 { - if x != nil { - return x.MBytesSentCnt - } - return 0 -} - -func (x *MetricsBucket) GetMBytesSentSum() float32 { - if x != nil { - return x.MBytesSentSum - } - return 0 -} - -func (x *MetricsBucket) GetMBytesSentMin() float32 { - if x != nil { - return x.MBytesSentMin - } - return 0 -} - -func (x *MetricsBucket) GetMBytesSentMax() float32 { - if x != nil { - return x.MBytesSentMax - } - return 0 -} - -func (x *MetricsBucket) GetMBytesSentP99() float32 { - if x != nil { - return x.MBytesSentP99 - } - return 0 -} - -func (x *MetricsBucket) GetMTmpTablesCnt() float32 { - if x != nil { - return x.MTmpTablesCnt - } - return 0 -} - -func (x *MetricsBucket) GetMTmpTablesSum() float32 { - if x != nil { - return x.MTmpTablesSum - } - return 0 -} - -func (x *MetricsBucket) GetMTmpTablesMin() float32 { - if x != nil { - return x.MTmpTablesMin - } - return 0 -} - -func (x *MetricsBucket) GetMTmpTablesMax() float32 { - if x != nil { - return x.MTmpTablesMax - } - return 0 -} - -func (x *MetricsBucket) GetMTmpTablesP99() float32 { - if x != nil { - return x.MTmpTablesP99 - } - return 0 -} - -func (x *MetricsBucket) GetMTmpDiskTablesCnt() float32 { - if x != nil { - return x.MTmpDiskTablesCnt - } - return 0 -} - -func (x *MetricsBucket) GetMTmpDiskTablesSum() float32 { - if x != nil { - return x.MTmpDiskTablesSum - } - return 0 -} - -func (x *MetricsBucket) GetMTmpDiskTablesMin() float32 { - if x != nil { - return x.MTmpDiskTablesMin - } - return 0 -} - -func (x *MetricsBucket) GetMTmpDiskTablesMax() float32 { - if x != nil { - return x.MTmpDiskTablesMax - } - return 0 -} - -func (x *MetricsBucket) GetMTmpDiskTablesP99() float32 { - if x != nil { - return x.MTmpDiskTablesP99 - } - return 0 -} - -func (x *MetricsBucket) GetMTmpTableSizesCnt() float32 { - if x != nil { - return x.MTmpTableSizesCnt - } - return 0 -} - -func (x *MetricsBucket) GetMTmpTableSizesSum() float32 { - if x != nil { - return x.MTmpTableSizesSum - } - return 0 -} - -func (x *MetricsBucket) GetMTmpTableSizesMin() float32 { - if x != nil { - return x.MTmpTableSizesMin - } - return 0 -} - -func (x *MetricsBucket) GetMTmpTableSizesMax() float32 { - if x != nil { - return x.MTmpTableSizesMax - } - return 0 -} - -func (x *MetricsBucket) GetMTmpTableSizesP99() float32 { - if x != nil { - return x.MTmpTableSizesP99 - } - return 0 -} - -func (x *MetricsBucket) GetMQcHitCnt() float32 { - if x != nil { - return x.MQcHitCnt - } - return 0 -} - -func (x *MetricsBucket) GetMQcHitSum() float32 { - if x != nil { - return x.MQcHitSum - } - return 0 -} - -func (x *MetricsBucket) GetMFullScanCnt() float32 { - if x != nil { - return x.MFullScanCnt - } - return 0 -} - -func (x *MetricsBucket) GetMFullScanSum() float32 { - if x != nil { - return x.MFullScanSum - } - return 0 -} - -func (x *MetricsBucket) GetMFullJoinCnt() float32 { - if x != nil { - return x.MFullJoinCnt - } - return 0 -} - -func (x *MetricsBucket) GetMFullJoinSum() float32 { - if x != nil { - return x.MFullJoinSum - } - return 0 -} - -func (x *MetricsBucket) GetMTmpTableCnt() float32 { - if x != nil { - return x.MTmpTableCnt - } - return 0 -} - -func (x *MetricsBucket) GetMTmpTableSum() float32 { - if x != nil { - return x.MTmpTableSum - } - return 0 -} - -func (x *MetricsBucket) GetMTmpTableOnDiskCnt() float32 { - if x != nil { - return x.MTmpTableOnDiskCnt - } - return 0 -} - -func (x *MetricsBucket) GetMTmpTableOnDiskSum() float32 { - if x != nil { - return x.MTmpTableOnDiskSum - } - return 0 -} - -func (x *MetricsBucket) GetMFilesortCnt() float32 { - if x != nil { - return x.MFilesortCnt - } - return 0 -} - -func (x *MetricsBucket) GetMFilesortSum() float32 { - if x != nil { - return x.MFilesortSum - } - return 0 -} - -func (x *MetricsBucket) GetMFilesortOnDiskCnt() float32 { - if x != nil { - return x.MFilesortOnDiskCnt - } - return 0 -} - -func (x *MetricsBucket) GetMFilesortOnDiskSum() float32 { - if x != nil { - return x.MFilesortOnDiskSum - } - return 0 -} - -func (x *MetricsBucket) GetMSelectFullRangeJoinCnt() float32 { - if x != nil { - return x.MSelectFullRangeJoinCnt - } - return 0 -} - -func (x *MetricsBucket) GetMSelectFullRangeJoinSum() float32 { - if x != nil { - return x.MSelectFullRangeJoinSum - } - return 0 -} - -func (x *MetricsBucket) GetMSelectRangeCnt() float32 { - if x != nil { - return x.MSelectRangeCnt - } - return 0 -} - -func (x *MetricsBucket) GetMSelectRangeSum() float32 { - if x != nil { - return x.MSelectRangeSum - } - return 0 -} - -func (x *MetricsBucket) GetMSelectRangeCheckCnt() float32 { - if x != nil { - return x.MSelectRangeCheckCnt - } - return 0 -} - -func (x *MetricsBucket) GetMSelectRangeCheckSum() float32 { - if x != nil { - return x.MSelectRangeCheckSum - } - return 0 -} - -func (x *MetricsBucket) GetMSortRangeCnt() float32 { - if x != nil { - return x.MSortRangeCnt - } - return 0 -} - -func (x *MetricsBucket) GetMSortRangeSum() float32 { - if x != nil { - return x.MSortRangeSum - } - return 0 -} - -func (x *MetricsBucket) GetMSortRowsCnt() float32 { - if x != nil { - return x.MSortRowsCnt - } - return 0 -} - -func (x *MetricsBucket) GetMSortRowsSum() float32 { - if x != nil { - return x.MSortRowsSum - } - return 0 -} - -func (x *MetricsBucket) GetMSortScanCnt() float32 { - if x != nil { - return x.MSortScanCnt - } - return 0 -} - -func (x *MetricsBucket) GetMSortScanSum() float32 { - if x != nil { - return x.MSortScanSum - } - return 0 -} - -func (x *MetricsBucket) GetMNoIndexUsedCnt() float32 { - if x != nil { - return x.MNoIndexUsedCnt - } - return 0 -} - -func (x *MetricsBucket) GetMNoIndexUsedSum() float32 { - if x != nil { - return x.MNoIndexUsedSum - } - return 0 -} - -func (x *MetricsBucket) GetMNoGoodIndexUsedCnt() float32 { - if x != nil { - return x.MNoGoodIndexUsedCnt - } - return 0 -} - -func (x *MetricsBucket) GetMNoGoodIndexUsedSum() float32 { - if x != nil { - return x.MNoGoodIndexUsedSum - } - return 0 -} - -func (x *MetricsBucket) GetMDocsReturnedCnt() float32 { - if x != nil { - return x.MDocsReturnedCnt - } - return 0 -} - -func (x *MetricsBucket) GetMDocsReturnedSum() float32 { - if x != nil { - return x.MDocsReturnedSum - } - return 0 -} - -func (x *MetricsBucket) GetMDocsReturnedMin() float32 { - if x != nil { - return x.MDocsReturnedMin - } - return 0 -} - -func (x *MetricsBucket) GetMDocsReturnedMax() float32 { - if x != nil { - return x.MDocsReturnedMax - } - return 0 -} - -func (x *MetricsBucket) GetMDocsReturnedP99() float32 { - if x != nil { - return x.MDocsReturnedP99 - } - return 0 -} - -func (x *MetricsBucket) GetMResponseLengthCnt() float32 { - if x != nil { - return x.MResponseLengthCnt - } - return 0 -} - -func (x *MetricsBucket) GetMResponseLengthSum() float32 { - if x != nil { - return x.MResponseLengthSum - } - return 0 -} - -func (x *MetricsBucket) GetMResponseLengthMin() float32 { - if x != nil { - return x.MResponseLengthMin - } - return 0 -} - -func (x *MetricsBucket) GetMResponseLengthMax() float32 { - if x != nil { - return x.MResponseLengthMax - } - return 0 -} - -func (x *MetricsBucket) GetMResponseLengthP99() float32 { - if x != nil { - return x.MResponseLengthP99 - } - return 0 -} - -func (x *MetricsBucket) GetMDocsScannedCnt() float32 { - if x != nil { - return x.MDocsScannedCnt - } - return 0 -} - -func (x *MetricsBucket) GetMDocsScannedSum() float32 { - if x != nil { - return x.MDocsScannedSum - } - return 0 -} - -func (x *MetricsBucket) GetMDocsScannedMin() float32 { - if x != nil { - return x.MDocsScannedMin - } - return 0 -} - -func (x *MetricsBucket) GetMDocsScannedMax() float32 { - if x != nil { - return x.MDocsScannedMax - } - return 0 -} - -func (x *MetricsBucket) GetMDocsScannedP99() float32 { - if x != nil { - return x.MDocsScannedP99 - } - return 0 -} - -func (x *MetricsBucket) GetPlanSummary() string { - if x != nil { - return x.PlanSummary - } - return "" -} - -func (x *MetricsBucket) GetMDocsExaminedCnt() float32 { - if x != nil { - return x.MDocsExaminedCnt - } - return 0 -} - -func (x *MetricsBucket) GetMDocsExaminedSum() float32 { - if x != nil { - return x.MDocsExaminedSum - } - return 0 -} - -func (x *MetricsBucket) GetMDocsExaminedMin() float32 { - if x != nil { - return x.MDocsExaminedMin - } - return 0 -} - -func (x *MetricsBucket) GetMDocsExaminedMax() float32 { - if x != nil { - return x.MDocsExaminedMax - } - return 0 -} - -func (x *MetricsBucket) GetMDocsExaminedP99() float32 { - if x != nil { - return x.MDocsExaminedP99 - } - return 0 -} - -func (x *MetricsBucket) GetMKeysExaminedCnt() float32 { - if x != nil { - return x.MKeysExaminedCnt - } - return 0 -} - -func (x *MetricsBucket) GetMKeysExaminedSum() float32 { - if x != nil { - return x.MKeysExaminedSum - } - return 0 -} - -func (x *MetricsBucket) GetMKeysExaminedMin() float32 { - if x != nil { - return x.MKeysExaminedMin - } - return 0 -} - -func (x *MetricsBucket) GetMKeysExaminedMax() float32 { - if x != nil { - return x.MKeysExaminedMax - } - return 0 -} - -func (x *MetricsBucket) GetMKeysExaminedP99() float32 { - if x != nil { - return x.MKeysExaminedP99 - } - return 0 -} - -func (x *MetricsBucket) GetMLocksGlobalAcquireCountReadSharedCnt() float32 { - if x != nil { - return x.MLocksGlobalAcquireCountReadSharedCnt - } - return 0 -} - -func (x *MetricsBucket) GetMLocksGlobalAcquireCountReadSharedSum() float32 { - if x != nil { - return x.MLocksGlobalAcquireCountReadSharedSum - } - return 0 -} - -func (x *MetricsBucket) GetMLocksGlobalAcquireCountWriteSharedCnt() float32 { - if x != nil { - return x.MLocksGlobalAcquireCountWriteSharedCnt - } - return 0 -} - -func (x *MetricsBucket) GetMLocksGlobalAcquireCountWriteSharedSum() float32 { - if x != nil { - return x.MLocksGlobalAcquireCountWriteSharedSum - } - return 0 -} - -func (x *MetricsBucket) GetMLocksDatabaseAcquireCountReadSharedCnt() float32 { - if x != nil { - return x.MLocksDatabaseAcquireCountReadSharedCnt - } - return 0 -} - -func (x *MetricsBucket) GetMLocksDatabaseAcquireCountReadSharedSum() float32 { - if x != nil { - return x.MLocksDatabaseAcquireCountReadSharedSum - } - return 0 -} - -func (x *MetricsBucket) GetMLocksDatabaseAcquireWaitCountReadSharedCnt() float32 { - if x != nil { - return x.MLocksDatabaseAcquireWaitCountReadSharedCnt - } - return 0 -} - -func (x *MetricsBucket) GetMLocksDatabaseAcquireWaitCountReadSharedSum() float32 { - if x != nil { - return x.MLocksDatabaseAcquireWaitCountReadSharedSum - } - return 0 -} - -func (x *MetricsBucket) GetMLocksDatabaseTimeAcquiringMicrosReadSharedCnt() float32 { - if x != nil { - return x.MLocksDatabaseTimeAcquiringMicrosReadSharedCnt - } - return 0 -} - -func (x *MetricsBucket) GetMLocksDatabaseTimeAcquiringMicrosReadSharedSum() float32 { - if x != nil { - return x.MLocksDatabaseTimeAcquiringMicrosReadSharedSum - } - return 0 -} - -func (x *MetricsBucket) GetMLocksDatabaseTimeAcquiringMicrosReadSharedMin() float32 { - if x != nil { - return x.MLocksDatabaseTimeAcquiringMicrosReadSharedMin - } - return 0 -} - -func (x *MetricsBucket) GetMLocksDatabaseTimeAcquiringMicrosReadSharedMax() float32 { - if x != nil { - return x.MLocksDatabaseTimeAcquiringMicrosReadSharedMax - } - return 0 -} - -func (x *MetricsBucket) GetMLocksDatabaseTimeAcquiringMicrosReadSharedP99() float32 { - if x != nil { - return x.MLocksDatabaseTimeAcquiringMicrosReadSharedP99 - } - return 0 -} - -func (x *MetricsBucket) GetMLocksCollectionAcquireCountReadSharedCnt() float32 { - if x != nil { - return x.MLocksCollectionAcquireCountReadSharedCnt - } - return 0 -} - -func (x *MetricsBucket) GetMLocksCollectionAcquireCountReadSharedSum() float32 { - if x != nil { - return x.MLocksCollectionAcquireCountReadSharedSum - } - return 0 -} - -func (x *MetricsBucket) GetMStorageBytesReadCnt() float32 { - if x != nil { - return x.MStorageBytesReadCnt - } - return 0 -} - -func (x *MetricsBucket) GetMStorageBytesReadSum() float32 { - if x != nil { - return x.MStorageBytesReadSum - } - return 0 -} - -func (x *MetricsBucket) GetMStorageBytesReadMin() float32 { - if x != nil { - return x.MStorageBytesReadMin - } - return 0 -} - -func (x *MetricsBucket) GetMStorageBytesReadMax() float32 { - if x != nil { - return x.MStorageBytesReadMax - } - return 0 -} - -func (x *MetricsBucket) GetMStorageBytesReadP99() float32 { - if x != nil { - return x.MStorageBytesReadP99 - } - return 0 -} - -func (x *MetricsBucket) GetMStorageTimeReadingMicrosCnt() float32 { - if x != nil { - return x.MStorageTimeReadingMicrosCnt - } - return 0 -} - -func (x *MetricsBucket) GetMStorageTimeReadingMicrosSum() float32 { - if x != nil { - return x.MStorageTimeReadingMicrosSum - } - return 0 -} - -func (x *MetricsBucket) GetMStorageTimeReadingMicrosMin() float32 { - if x != nil { - return x.MStorageTimeReadingMicrosMin - } - return 0 -} - -func (x *MetricsBucket) GetMStorageTimeReadingMicrosMax() float32 { - if x != nil { - return x.MStorageTimeReadingMicrosMax - } - return 0 -} - -func (x *MetricsBucket) GetMStorageTimeReadingMicrosP99() float32 { - if x != nil { - return x.MStorageTimeReadingMicrosP99 - } - return 0 -} - -func (x *MetricsBucket) GetMSharedBlksHitCnt() float32 { - if x != nil { - return x.MSharedBlksHitCnt - } - return 0 -} - -func (x *MetricsBucket) GetMSharedBlksHitSum() float32 { - if x != nil { - return x.MSharedBlksHitSum - } - return 0 -} - -func (x *MetricsBucket) GetMSharedBlksReadCnt() float32 { - if x != nil { - return x.MSharedBlksReadCnt - } - return 0 -} - -func (x *MetricsBucket) GetMSharedBlksReadSum() float32 { - if x != nil { - return x.MSharedBlksReadSum - } - return 0 -} - -func (x *MetricsBucket) GetMSharedBlksDirtiedCnt() float32 { - if x != nil { - return x.MSharedBlksDirtiedCnt - } - return 0 -} - -func (x *MetricsBucket) GetMSharedBlksDirtiedSum() float32 { - if x != nil { - return x.MSharedBlksDirtiedSum - } - return 0 -} - -func (x *MetricsBucket) GetMSharedBlksWrittenCnt() float32 { - if x != nil { - return x.MSharedBlksWrittenCnt - } - return 0 -} - -func (x *MetricsBucket) GetMSharedBlksWrittenSum() float32 { - if x != nil { - return x.MSharedBlksWrittenSum - } - return 0 -} - -func (x *MetricsBucket) GetMLocalBlksHitCnt() float32 { - if x != nil { - return x.MLocalBlksHitCnt - } - return 0 -} - -func (x *MetricsBucket) GetMLocalBlksHitSum() float32 { - if x != nil { - return x.MLocalBlksHitSum - } - return 0 -} - -func (x *MetricsBucket) GetMLocalBlksReadCnt() float32 { - if x != nil { - return x.MLocalBlksReadCnt - } - return 0 -} - -func (x *MetricsBucket) GetMLocalBlksReadSum() float32 { - if x != nil { - return x.MLocalBlksReadSum - } - return 0 -} - -func (x *MetricsBucket) GetMLocalBlksDirtiedCnt() float32 { - if x != nil { - return x.MLocalBlksDirtiedCnt - } - return 0 -} - -func (x *MetricsBucket) GetMLocalBlksDirtiedSum() float32 { - if x != nil { - return x.MLocalBlksDirtiedSum - } - return 0 -} - -func (x *MetricsBucket) GetMLocalBlksWrittenCnt() float32 { - if x != nil { - return x.MLocalBlksWrittenCnt - } - return 0 -} - -func (x *MetricsBucket) GetMLocalBlksWrittenSum() float32 { - if x != nil { - return x.MLocalBlksWrittenSum - } - return 0 -} - -func (x *MetricsBucket) GetMTempBlksReadCnt() float32 { - if x != nil { - return x.MTempBlksReadCnt - } - return 0 -} - -func (x *MetricsBucket) GetMTempBlksReadSum() float32 { - if x != nil { - return x.MTempBlksReadSum - } - return 0 -} - -func (x *MetricsBucket) GetMTempBlksWrittenCnt() float32 { - if x != nil { - return x.MTempBlksWrittenCnt - } - return 0 -} - -func (x *MetricsBucket) GetMTempBlksWrittenSum() float32 { - if x != nil { - return x.MTempBlksWrittenSum - } - return 0 -} - -func (x *MetricsBucket) GetMBlkReadTimeCnt() float32 { - if x != nil { - return x.MBlkReadTimeCnt - } - return 0 -} - -func (x *MetricsBucket) GetMBlkReadTimeSum() float32 { - if x != nil { - return x.MBlkReadTimeSum - } - return 0 -} - -func (x *MetricsBucket) GetMBlkWriteTimeCnt() float32 { - if x != nil { - return x.MBlkWriteTimeCnt - } - return 0 -} - -func (x *MetricsBucket) GetMBlkWriteTimeSum() float32 { - if x != nil { - return x.MBlkWriteTimeSum - } - return 0 -} - -func (x *MetricsBucket) GetMSharedBlkReadTimeCnt() float32 { - if x != nil { - return x.MSharedBlkReadTimeCnt - } - return 0 -} - -func (x *MetricsBucket) GetMSharedBlkReadTimeSum() float32 { - if x != nil { - return x.MSharedBlkReadTimeSum - } - return 0 -} - -func (x *MetricsBucket) GetMSharedBlkWriteTimeCnt() float32 { - if x != nil { - return x.MSharedBlkWriteTimeCnt - } - return 0 -} - -func (x *MetricsBucket) GetMSharedBlkWriteTimeSum() float32 { - if x != nil { - return x.MSharedBlkWriteTimeSum - } - return 0 -} - -func (x *MetricsBucket) GetMLocalBlkReadTimeCnt() float32 { - if x != nil { - return x.MLocalBlkReadTimeCnt - } - return 0 -} - -func (x *MetricsBucket) GetMLocalBlkReadTimeSum() float32 { - if x != nil { - return x.MLocalBlkReadTimeSum - } - return 0 -} - -func (x *MetricsBucket) GetMLocalBlkWriteTimeCnt() float32 { - if x != nil { - return x.MLocalBlkWriteTimeCnt - } - return 0 -} - -func (x *MetricsBucket) GetMLocalBlkWriteTimeSum() float32 { - if x != nil { - return x.MLocalBlkWriteTimeSum - } - return 0 -} - -func (x *MetricsBucket) GetMCpuUserTimeCnt() float32 { - if x != nil { - return x.MCpuUserTimeCnt - } - return 0 -} - -func (x *MetricsBucket) GetMCpuUserTimeSum() float32 { - if x != nil { - return x.MCpuUserTimeSum - } - return 0 -} - -func (x *MetricsBucket) GetMCpuSysTimeCnt() float32 { - if x != nil { - return x.MCpuSysTimeCnt - } - return 0 -} - -func (x *MetricsBucket) GetMCpuSysTimeSum() float32 { - if x != nil { - return x.MCpuSysTimeSum - } - return 0 -} - -func (x *MetricsBucket) GetCmdType() string { - if x != nil { - return x.CmdType - } - return "" -} - -func (x *MetricsBucket) GetMPlansCallsSum() float32 { - if x != nil { - return x.MPlansCallsSum - } - return 0 -} - -func (x *MetricsBucket) GetMPlansCallsCnt() float32 { - if x != nil { - return x.MPlansCallsCnt - } - return 0 -} - -func (x *MetricsBucket) GetMWalRecordsSum() float32 { - if x != nil { - return x.MWalRecordsSum - } - return 0 -} - -func (x *MetricsBucket) GetMWalRecordsCnt() float32 { - if x != nil { - return x.MWalRecordsCnt - } - return 0 -} - -func (x *MetricsBucket) GetMWalFpiSum() float32 { - if x != nil { - return x.MWalFpiSum - } - return 0 -} - -func (x *MetricsBucket) GetMWalFpiCnt() float32 { - if x != nil { - return x.MWalFpiCnt - } - return 0 -} - -func (x *MetricsBucket) GetMWalBytesSum() float32 { - if x != nil { - return x.MWalBytesSum - } - return 0 -} - -func (x *MetricsBucket) GetMWalBytesCnt() float32 { - if x != nil { - return x.MWalBytesCnt - } - return 0 -} - -func (x *MetricsBucket) GetMPlanTimeSum() float32 { - if x != nil { - return x.MPlanTimeSum - } - return 0 -} - -func (x *MetricsBucket) GetMPlanTimeCnt() float32 { - if x != nil { - return x.MPlanTimeCnt - } - return 0 -} - -func (x *MetricsBucket) GetMPlanTimeMin() float32 { - if x != nil { - return x.MPlanTimeMin - } - return 0 -} - -func (x *MetricsBucket) GetMPlanTimeMax() float32 { - if x != nil { - return x.MPlanTimeMax - } - return 0 -} - -func (x *MetricsBucket) GetTopQueryid() string { - if x != nil { - return x.TopQueryid - } - return "" -} - -func (x *MetricsBucket) GetTopQuery() string { - if x != nil { - return x.TopQuery - } - return "" -} - -func (x *MetricsBucket) GetApplicationName() string { - if x != nil { - return x.ApplicationName - } - return "" -} - -func (x *MetricsBucket) GetPlanid() string { - if x != nil { - return x.Planid - } - return "" -} - -func (x *MetricsBucket) GetQueryPlan() string { - if x != nil { - return x.QueryPlan - } - return "" -} - -func (x *MetricsBucket) GetHistogramItems() []string { - if x != nil { - return x.HistogramItems - } - return nil -} - -type CollectResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CollectResponse) Reset() { - *x = CollectResponse{} - mi := &file_qan_v1_collector_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CollectResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CollectResponse) ProtoMessage() {} - -func (x *CollectResponse) ProtoReflect() protoreflect.Message { - mi := &file_qan_v1_collector_proto_msgTypes[2] - 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 CollectResponse.ProtoReflect.Descriptor instead. -func (*CollectResponse) Descriptor() ([]byte, []int) { - return file_qan_v1_collector_proto_rawDescGZIP(), []int{2} -} - -var File_qan_v1_collector_proto protoreflect.FileDescriptor - -const file_qan_v1_collector_proto_rawDesc = "" + - "\n" + - "\x16qan/v1/collector.proto\x12\x06qan.v1\x1a\x1bgoogle/api/visibility.proto\x1a\x19inventory/v1/agents.proto\x1a\x10qan/v1/qan.proto\"N\n" + - "\x0eCollectRequest\x12<\n" + - "\x0emetrics_bucket\x18\x01 \x03(\v2\x15.qan.v1.MetricsBucketR\rmetricsBucket\"\xd6h\n" + - "\rMetricsBucket\x12\x18\n" + - "\aqueryid\x18\x01 \x01(\tR\aqueryid\x12/\n" + - "\x13explain_fingerprint\x18\x02 \x01(\tR\x12explainFingerprint\x12-\n" + - "\x12placeholders_count\x18\x03 \x01(\rR\x11placeholdersCount\x12 \n" + - "\vfingerprint\x18\x04 \x01(\tR\vfingerprint\x12!\n" + - "\fservice_name\x18\n" + - " \x01(\tR\vserviceName\x12\x1a\n" + - "\bdatabase\x18\v \x01(\tR\bdatabase\x12\x16\n" + - "\x06schema\x18\f \x01(\tR\x06schema\x12\x16\n" + - "\x06tables\x18\r \x03(\tR\x06tables\x12\x1a\n" + - "\busername\x18\x0e \x01(\tR\busername\x12\x1f\n" + - "\vclient_host\x18\x0f \x01(\tR\n" + - "clientHost\x12\x17\n" + - "\anode_id\x18\x14 \x01(\tR\x06nodeId\x12\x1b\n" + - "\tnode_name\x18\x15 \x01(\tR\bnodeName\x12\x1b\n" + - "\tnode_type\x18\x16 \x01(\tR\bnodeType\x12\x1d\n" + - "\n" + - "machine_id\x18\x17 \x01(\tR\tmachineId\x12!\n" + - "\fcontainer_id\x18\x18 \x01(\tR\vcontainerId\x12%\n" + - "\x0econtainer_name\x18\x19 \x01(\tR\rcontainerName\x12\x1d\n" + - "\n" + - "node_model\x18\x1a \x01(\tR\tnodeModel\x12\x16\n" + - "\x06region\x18\x1b \x01(\tR\x06region\x12\x0e\n" + - "\x02az\x18\x1c \x01(\tR\x02az\x12\x1d\n" + - "\n" + - "service_id\x18\x1d \x01(\tR\tserviceId\x12!\n" + - "\fservice_type\x18\x1e \x01(\tR\vserviceType\x12 \n" + - "\venvironment\x18\x1f \x01(\tR\venvironment\x12\x18\n" + - "\acluster\x18 \x01(\tR\acluster\x12'\n" + - "\x0freplication_set\x18! \x01(\tR\x0ereplicationSet\x12\x19\n" + - "\bagent_id\x18\" \x01(\tR\aagentId\x126\n" + - "\n" + - "agent_type\x18# \x01(\x0e2\x17.inventory.v1.AgentTypeR\tagentType\x129\n" + - "\x06labels\x18$ \x03(\v2!.qan.v1.MetricsBucket.LabelsEntryR\x06labels\x123\n" + - "\x16period_start_unix_secs\x18( \x01(\rR\x13periodStartUnixSecs\x12,\n" + - "\x12period_length_secs\x18) \x01(\rR\x10periodLengthSecs\x12\x18\n" + - "\aexample\x18* \x01(\tR\aexample\x12!\n" + - "\fis_truncated\x18+ \x01(\bR\visTruncated\x126\n" + - "\fexample_type\x18, \x01(\x0e2\x13.qan.v1.ExampleTypeR\vexampleType\x12'\n" + - "\x0fexample_metrics\x18- \x01(\tR\x0eexampleMetrics\x129\n" + - "\x19num_queries_with_warnings\x182 \x01(\x02R\x16numQueriesWithWarnings\x12?\n" + - "\bwarnings\x183 \x03(\v2#.qan.v1.MetricsBucket.WarningsEntryR\bwarnings\x125\n" + - "\x17num_queries_with_errors\x184 \x01(\x02R\x14numQueriesWithErrors\x129\n" + - "\x06errors\x185 \x03(\v2!.qan.v1.MetricsBucket.ErrorsEntryR\x06errors\x12\x1f\n" + - "\vnum_queries\x186 \x01(\x02R\n" + - "numQueries\x12'\n" + - "\x10m_query_time_cnt\x187 \x01(\x02R\rmQueryTimeCnt\x12'\n" + - "\x10m_query_time_sum\x188 \x01(\x02R\rmQueryTimeSum\x12'\n" + - "\x10m_query_time_min\x189 \x01(\x02R\rmQueryTimeMin\x12'\n" + - "\x10m_query_time_max\x18: \x01(\x02R\rmQueryTimeMax\x12'\n" + - "\x10m_query_time_p99\x18; \x01(\x02R\rmQueryTimeP99\x12%\n" + - "\x0fm_lock_time_cnt\x18< \x01(\x02R\fmLockTimeCnt\x12%\n" + - "\x0fm_lock_time_sum\x18= \x01(\x02R\fmLockTimeSum\x12%\n" + - "\x0fm_lock_time_min\x18> \x01(\x02R\fmLockTimeMin\x12%\n" + - "\x0fm_lock_time_max\x18? \x01(\x02R\fmLockTimeMax\x12%\n" + - "\x0fm_lock_time_p99\x18@ \x01(\x02R\fmLockTimeP99\x12%\n" + - "\x0fm_rows_sent_cnt\x18A \x01(\x02R\fmRowsSentCnt\x12%\n" + - "\x0fm_rows_sent_sum\x18B \x01(\x02R\fmRowsSentSum\x12%\n" + - "\x0fm_rows_sent_min\x18C \x01(\x02R\fmRowsSentMin\x12%\n" + - "\x0fm_rows_sent_max\x18D \x01(\x02R\fmRowsSentMax\x12%\n" + - "\x0fm_rows_sent_p99\x18E \x01(\x02R\fmRowsSentP99\x12-\n" + - "\x13m_rows_examined_cnt\x18F \x01(\x02R\x10mRowsExaminedCnt\x12-\n" + - "\x13m_rows_examined_sum\x18G \x01(\x02R\x10mRowsExaminedSum\x12-\n" + - "\x13m_rows_examined_min\x18H \x01(\x02R\x10mRowsExaminedMin\x12-\n" + - "\x13m_rows_examined_max\x18I \x01(\x02R\x10mRowsExaminedMax\x12-\n" + - "\x13m_rows_examined_p99\x18J \x01(\x02R\x10mRowsExaminedP99\x12-\n" + - "\x13m_rows_affected_cnt\x18K \x01(\x02R\x10mRowsAffectedCnt\x12-\n" + - "\x13m_rows_affected_sum\x18L \x01(\x02R\x10mRowsAffectedSum\x12-\n" + - "\x13m_rows_affected_min\x18M \x01(\x02R\x10mRowsAffectedMin\x12-\n" + - "\x13m_rows_affected_max\x18N \x01(\x02R\x10mRowsAffectedMax\x12-\n" + - "\x13m_rows_affected_p99\x18O \x01(\x02R\x10mRowsAffectedP99\x12%\n" + - "\x0fm_rows_read_cnt\x18P \x01(\x02R\fmRowsReadCnt\x12%\n" + - "\x0fm_rows_read_sum\x18Q \x01(\x02R\fmRowsReadSum\x12%\n" + - "\x0fm_rows_read_min\x18R \x01(\x02R\fmRowsReadMin\x12%\n" + - "\x0fm_rows_read_max\x18S \x01(\x02R\fmRowsReadMax\x12%\n" + - "\x0fm_rows_read_p99\x18T \x01(\x02R\fmRowsReadP99\x12+\n" + - "\x12m_merge_passes_cnt\x18U \x01(\x02R\x0fmMergePassesCnt\x12+\n" + - "\x12m_merge_passes_sum\x18V \x01(\x02R\x0fmMergePassesSum\x12+\n" + - "\x12m_merge_passes_min\x18W \x01(\x02R\x0fmMergePassesMin\x12+\n" + - "\x12m_merge_passes_max\x18X \x01(\x02R\x0fmMergePassesMax\x12+\n" + - "\x12m_merge_passes_p99\x18Y \x01(\x02R\x0fmMergePassesP99\x12/\n" + - "\x15m_innodb_io_r_ops_cnt\x18Z \x01(\x02R\x10mInnodbIoROpsCnt\x12/\n" + - "\x15m_innodb_io_r_ops_sum\x18[ \x01(\x02R\x10mInnodbIoROpsSum\x12/\n" + - "\x15m_innodb_io_r_ops_min\x18\\ \x01(\x02R\x10mInnodbIoROpsMin\x12/\n" + - "\x15m_innodb_io_r_ops_max\x18] \x01(\x02R\x10mInnodbIoROpsMax\x12/\n" + - "\x15m_innodb_io_r_ops_p99\x18^ \x01(\x02R\x10mInnodbIoROpsP99\x123\n" + - "\x17m_innodb_io_r_bytes_cnt\x18_ \x01(\x02R\x12mInnodbIoRBytesCnt\x123\n" + - "\x17m_innodb_io_r_bytes_sum\x18` \x01(\x02R\x12mInnodbIoRBytesSum\x123\n" + - "\x17m_innodb_io_r_bytes_min\x18a \x01(\x02R\x12mInnodbIoRBytesMin\x123\n" + - "\x17m_innodb_io_r_bytes_max\x18b \x01(\x02R\x12mInnodbIoRBytesMax\x123\n" + - "\x17m_innodb_io_r_bytes_p99\x18c \x01(\x02R\x12mInnodbIoRBytesP99\x121\n" + - "\x16m_innodb_io_r_wait_cnt\x18d \x01(\x02R\x11mInnodbIoRWaitCnt\x121\n" + - "\x16m_innodb_io_r_wait_sum\x18e \x01(\x02R\x11mInnodbIoRWaitSum\x121\n" + - "\x16m_innodb_io_r_wait_min\x18f \x01(\x02R\x11mInnodbIoRWaitMin\x121\n" + - "\x16m_innodb_io_r_wait_max\x18g \x01(\x02R\x11mInnodbIoRWaitMax\x121\n" + - "\x16m_innodb_io_r_wait_p99\x18h \x01(\x02R\x11mInnodbIoRWaitP99\x129\n" + - "\x1am_innodb_rec_lock_wait_cnt\x18i \x01(\x02R\x15mInnodbRecLockWaitCnt\x129\n" + - "\x1am_innodb_rec_lock_wait_sum\x18j \x01(\x02R\x15mInnodbRecLockWaitSum\x129\n" + - "\x1am_innodb_rec_lock_wait_min\x18k \x01(\x02R\x15mInnodbRecLockWaitMin\x129\n" + - "\x1am_innodb_rec_lock_wait_max\x18l \x01(\x02R\x15mInnodbRecLockWaitMax\x129\n" + - "\x1am_innodb_rec_lock_wait_p99\x18m \x01(\x02R\x15mInnodbRecLockWaitP99\x124\n" + - "\x17m_innodb_queue_wait_cnt\x18n \x01(\x02R\x13mInnodbQueueWaitCnt\x124\n" + - "\x17m_innodb_queue_wait_sum\x18o \x01(\x02R\x13mInnodbQueueWaitSum\x124\n" + - "\x17m_innodb_queue_wait_min\x18p \x01(\x02R\x13mInnodbQueueWaitMin\x124\n" + - "\x17m_innodb_queue_wait_max\x18q \x01(\x02R\x13mInnodbQueueWaitMax\x124\n" + - "\x17m_innodb_queue_wait_p99\x18r \x01(\x02R\x13mInnodbQueueWaitP99\x12<\n" + - "\x1bm_innodb_pages_distinct_cnt\x18s \x01(\x02R\x17mInnodbPagesDistinctCnt\x12<\n" + - "\x1bm_innodb_pages_distinct_sum\x18t \x01(\x02R\x17mInnodbPagesDistinctSum\x12<\n" + - "\x1bm_innodb_pages_distinct_min\x18u \x01(\x02R\x17mInnodbPagesDistinctMin\x12<\n" + - "\x1bm_innodb_pages_distinct_max\x18v \x01(\x02R\x17mInnodbPagesDistinctMax\x12<\n" + - "\x1bm_innodb_pages_distinct_p99\x18w \x01(\x02R\x17mInnodbPagesDistinctP99\x12+\n" + - "\x12m_query_length_cnt\x18x \x01(\x02R\x0fmQueryLengthCnt\x12+\n" + - "\x12m_query_length_sum\x18y \x01(\x02R\x0fmQueryLengthSum\x12+\n" + - "\x12m_query_length_min\x18z \x01(\x02R\x0fmQueryLengthMin\x12+\n" + - "\x12m_query_length_max\x18{ \x01(\x02R\x0fmQueryLengthMax\x12+\n" + - "\x12m_query_length_p99\x18| \x01(\x02R\x0fmQueryLengthP99\x12'\n" + - "\x10m_bytes_sent_cnt\x18} \x01(\x02R\rmBytesSentCnt\x12'\n" + - "\x10m_bytes_sent_sum\x18~ \x01(\x02R\rmBytesSentSum\x12'\n" + - "\x10m_bytes_sent_min\x18\x7f \x01(\x02R\rmBytesSentMin\x12(\n" + - "\x10m_bytes_sent_max\x18\x80\x01 \x01(\x02R\rmBytesSentMax\x12(\n" + - "\x10m_bytes_sent_p99\x18\x81\x01 \x01(\x02R\rmBytesSentP99\x12(\n" + - "\x10m_tmp_tables_cnt\x18\x82\x01 \x01(\x02R\rmTmpTablesCnt\x12(\n" + - "\x10m_tmp_tables_sum\x18\x83\x01 \x01(\x02R\rmTmpTablesSum\x12(\n" + - "\x10m_tmp_tables_min\x18\x84\x01 \x01(\x02R\rmTmpTablesMin\x12(\n" + - "\x10m_tmp_tables_max\x18\x85\x01 \x01(\x02R\rmTmpTablesMax\x12(\n" + - "\x10m_tmp_tables_p99\x18\x86\x01 \x01(\x02R\rmTmpTablesP99\x121\n" + - "\x15m_tmp_disk_tables_cnt\x18\x87\x01 \x01(\x02R\x11mTmpDiskTablesCnt\x121\n" + - "\x15m_tmp_disk_tables_sum\x18\x88\x01 \x01(\x02R\x11mTmpDiskTablesSum\x121\n" + - "\x15m_tmp_disk_tables_min\x18\x89\x01 \x01(\x02R\x11mTmpDiskTablesMin\x121\n" + - "\x15m_tmp_disk_tables_max\x18\x8a\x01 \x01(\x02R\x11mTmpDiskTablesMax\x121\n" + - "\x15m_tmp_disk_tables_p99\x18\x8b\x01 \x01(\x02R\x11mTmpDiskTablesP99\x121\n" + - "\x15m_tmp_table_sizes_cnt\x18\x8c\x01 \x01(\x02R\x11mTmpTableSizesCnt\x121\n" + - "\x15m_tmp_table_sizes_sum\x18\x8d\x01 \x01(\x02R\x11mTmpTableSizesSum\x121\n" + - "\x15m_tmp_table_sizes_min\x18\x8e\x01 \x01(\x02R\x11mTmpTableSizesMin\x121\n" + - "\x15m_tmp_table_sizes_max\x18\x8f\x01 \x01(\x02R\x11mTmpTableSizesMax\x121\n" + - "\x15m_tmp_table_sizes_p99\x18\x90\x01 \x01(\x02R\x11mTmpTableSizesP99\x12 \n" + - "\fm_qc_hit_cnt\x18\x96\x01 \x01(\x02R\tmQcHitCnt\x12 \n" + - "\fm_qc_hit_sum\x18\x97\x01 \x01(\x02R\tmQcHitSum\x12&\n" + - "\x0fm_full_scan_cnt\x18\x98\x01 \x01(\x02R\fmFullScanCnt\x12&\n" + - "\x0fm_full_scan_sum\x18\x99\x01 \x01(\x02R\fmFullScanSum\x12&\n" + - "\x0fm_full_join_cnt\x18\x9a\x01 \x01(\x02R\fmFullJoinCnt\x12&\n" + - "\x0fm_full_join_sum\x18\x9b\x01 \x01(\x02R\fmFullJoinSum\x12&\n" + - "\x0fm_tmp_table_cnt\x18\x9c\x01 \x01(\x02R\fmTmpTableCnt\x12&\n" + - "\x0fm_tmp_table_sum\x18\x9d\x01 \x01(\x02R\fmTmpTableSum\x124\n" + - "\x17m_tmp_table_on_disk_cnt\x18\x9e\x01 \x01(\x02R\x12mTmpTableOnDiskCnt\x124\n" + - "\x17m_tmp_table_on_disk_sum\x18\x9f\x01 \x01(\x02R\x12mTmpTableOnDiskSum\x12%\n" + - "\x0em_filesort_cnt\x18\xa0\x01 \x01(\x02R\fmFilesortCnt\x12%\n" + - "\x0em_filesort_sum\x18\xa1\x01 \x01(\x02R\fmFilesortSum\x123\n" + - "\x16m_filesort_on_disk_cnt\x18\xa2\x01 \x01(\x02R\x12mFilesortOnDiskCnt\x123\n" + - "\x16m_filesort_on_disk_sum\x18\xa3\x01 \x01(\x02R\x12mFilesortOnDiskSum\x12>\n" + - "\x1cm_select_full_range_join_cnt\x18\xa4\x01 \x01(\x02R\x17mSelectFullRangeJoinCnt\x12>\n" + - "\x1cm_select_full_range_join_sum\x18\xa5\x01 \x01(\x02R\x17mSelectFullRangeJoinSum\x12,\n" + - "\x12m_select_range_cnt\x18\xa6\x01 \x01(\x02R\x0fmSelectRangeCnt\x12,\n" + - "\x12m_select_range_sum\x18\xa7\x01 \x01(\x02R\x0fmSelectRangeSum\x127\n" + - "\x18m_select_range_check_cnt\x18\xa8\x01 \x01(\x02R\x14mSelectRangeCheckCnt\x127\n" + - "\x18m_select_range_check_sum\x18\xa9\x01 \x01(\x02R\x14mSelectRangeCheckSum\x12(\n" + - "\x10m_sort_range_cnt\x18\xaa\x01 \x01(\x02R\rmSortRangeCnt\x12(\n" + - "\x10m_sort_range_sum\x18\xab\x01 \x01(\x02R\rmSortRangeSum\x12&\n" + - "\x0fm_sort_rows_cnt\x18\xac\x01 \x01(\x02R\fmSortRowsCnt\x12&\n" + - "\x0fm_sort_rows_sum\x18\xad\x01 \x01(\x02R\fmSortRowsSum\x12&\n" + - "\x0fm_sort_scan_cnt\x18\xae\x01 \x01(\x02R\fmSortScanCnt\x12&\n" + - "\x0fm_sort_scan_sum\x18\xaf\x01 \x01(\x02R\fmSortScanSum\x12-\n" + - "\x13m_no_index_used_cnt\x18\xb0\x01 \x01(\x02R\x0fmNoIndexUsedCnt\x12-\n" + - "\x13m_no_index_used_sum\x18\xb1\x01 \x01(\x02R\x0fmNoIndexUsedSum\x126\n" + - "\x18m_no_good_index_used_cnt\x18\xb2\x01 \x01(\x02R\x13mNoGoodIndexUsedCnt\x126\n" + - "\x18m_no_good_index_used_sum\x18\xb3\x01 \x01(\x02R\x13mNoGoodIndexUsedSum\x12.\n" + - "\x13m_docs_returned_cnt\x18\xbe\x01 \x01(\x02R\x10mDocsReturnedCnt\x12.\n" + - "\x13m_docs_returned_sum\x18\xbf\x01 \x01(\x02R\x10mDocsReturnedSum\x12.\n" + - "\x13m_docs_returned_min\x18\xc0\x01 \x01(\x02R\x10mDocsReturnedMin\x12.\n" + - "\x13m_docs_returned_max\x18\xc1\x01 \x01(\x02R\x10mDocsReturnedMax\x12.\n" + - "\x13m_docs_returned_p99\x18\x93\x01 \x01(\x02R\x10mDocsReturnedP99\x122\n" + - "\x15m_response_length_cnt\x18\xc3\x01 \x01(\x02R\x12mResponseLengthCnt\x122\n" + - "\x15m_response_length_sum\x18\xc4\x01 \x01(\x02R\x12mResponseLengthSum\x122\n" + - "\x15m_response_length_min\x18\xc5\x01 \x01(\x02R\x12mResponseLengthMin\x122\n" + - "\x15m_response_length_max\x18\xc6\x01 \x01(\x02R\x12mResponseLengthMax\x122\n" + - "\x15m_response_length_p99\x18\xc7\x01 \x01(\x02R\x12mResponseLengthP99\x12,\n" + - "\x12m_docs_scanned_cnt\x18\xc8\x01 \x01(\x02R\x0fmDocsScannedCnt\x12,\n" + - "\x12m_docs_scanned_sum\x18\xc9\x01 \x01(\x02R\x0fmDocsScannedSum\x12,\n" + - "\x12m_docs_scanned_min\x18\xca\x01 \x01(\x02R\x0fmDocsScannedMin\x12,\n" + - "\x12m_docs_scanned_max\x18\xcb\x01 \x01(\x02R\x0fmDocsScannedMax\x12,\n" + - "\x12m_docs_scanned_p99\x18\xcc\x01 \x01(\x02R\x0fmDocsScannedP99\x12\"\n" + - "\fplan_summary\x18\xcd\x01 \x01(\tR\vplanSummary\x12.\n" + - "\x13m_docs_examined_cnt\x18\x8d\x02 \x01(\x02R\x10mDocsExaminedCnt\x12.\n" + - "\x13m_docs_examined_sum\x18\x8e\x02 \x01(\x02R\x10mDocsExaminedSum\x12.\n" + - "\x13m_docs_examined_min\x18\x8f\x02 \x01(\x02R\x10mDocsExaminedMin\x12.\n" + - "\x13m_docs_examined_max\x18\x90\x02 \x01(\x02R\x10mDocsExaminedMax\x12.\n" + - "\x13m_docs_examined_p99\x18\x91\x02 \x01(\x02R\x10mDocsExaminedP99\x12.\n" + - "\x13m_keys_examined_cnt\x18\x92\x02 \x01(\x02R\x10mKeysExaminedCnt\x12.\n" + - "\x13m_keys_examined_sum\x18\x93\x02 \x01(\x02R\x10mKeysExaminedSum\x12.\n" + - "\x13m_keys_examined_min\x18\x94\x02 \x01(\x02R\x10mKeysExaminedMin\x12.\n" + - "\x13m_keys_examined_max\x18\x95\x02 \x01(\x02R\x10mKeysExaminedMax\x12.\n" + - "\x13m_keys_examined_p99\x18\x96\x02 \x01(\x02R\x10mKeysExaminedP99\x12\\\n" + - ",m_locks_global_acquire_count_read_shared_cnt\x18\x97\x02 \x01(\x02R%mLocksGlobalAcquireCountReadSharedCnt\x12\\\n" + - ",m_locks_global_acquire_count_read_shared_sum\x18\x98\x02 \x01(\x02R%mLocksGlobalAcquireCountReadSharedSum\x12^\n" + - "-m_locks_global_acquire_count_write_shared_cnt\x18\x99\x02 \x01(\x02R&mLocksGlobalAcquireCountWriteSharedCnt\x12^\n" + - "-m_locks_global_acquire_count_write_shared_sum\x18\x9a\x02 \x01(\x02R&mLocksGlobalAcquireCountWriteSharedSum\x12`\n" + - ".m_locks_database_acquire_count_read_shared_cnt\x18\x9b\x02 \x01(\x02R'mLocksDatabaseAcquireCountReadSharedCnt\x12`\n" + - ".m_locks_database_acquire_count_read_shared_sum\x18\x9c\x02 \x01(\x02R'mLocksDatabaseAcquireCountReadSharedSum\x12i\n" + - "3m_locks_database_acquire_wait_count_read_shared_cnt\x18\x9d\x02 \x01(\x02R+mLocksDatabaseAcquireWaitCountReadSharedCnt\x12i\n" + - "3m_locks_database_acquire_wait_count_read_shared_sum\x18\x9e\x02 \x01(\x02R+mLocksDatabaseAcquireWaitCountReadSharedSum\x12o\n" + - "6m_locks_database_time_acquiring_micros_read_shared_cnt\x18\x9f\x02 \x01(\x02R.mLocksDatabaseTimeAcquiringMicrosReadSharedCnt\x12o\n" + - "6m_locks_database_time_acquiring_micros_read_shared_sum\x18\xa0\x02 \x01(\x02R.mLocksDatabaseTimeAcquiringMicrosReadSharedSum\x12o\n" + - "6m_locks_database_time_acquiring_micros_read_shared_min\x18\xa1\x02 \x01(\x02R.mLocksDatabaseTimeAcquiringMicrosReadSharedMin\x12o\n" + - "6m_locks_database_time_acquiring_micros_read_shared_max\x18\xa2\x02 \x01(\x02R.mLocksDatabaseTimeAcquiringMicrosReadSharedMax\x12o\n" + - "6m_locks_database_time_acquiring_micros_read_shared_p99\x18\xa3\x02 \x01(\x02R.mLocksDatabaseTimeAcquiringMicrosReadSharedP99\x12d\n" + - "0m_locks_collection_acquire_count_read_shared_cnt\x18\xa4\x02 \x01(\x02R)mLocksCollectionAcquireCountReadSharedCnt\x12d\n" + - "0m_locks_collection_acquire_count_read_shared_sum\x18\xa5\x02 \x01(\x02R)mLocksCollectionAcquireCountReadSharedSum\x127\n" + - "\x18m_storage_bytes_read_cnt\x18\xa6\x02 \x01(\x02R\x14mStorageBytesReadCnt\x127\n" + - "\x18m_storage_bytes_read_sum\x18\xa7\x02 \x01(\x02R\x14mStorageBytesReadSum\x127\n" + - "\x18m_storage_bytes_read_min\x18\xa8\x02 \x01(\x02R\x14mStorageBytesReadMin\x127\n" + - "\x18m_storage_bytes_read_max\x18\xa9\x02 \x01(\x02R\x14mStorageBytesReadMax\x127\n" + - "\x18m_storage_bytes_read_p99\x18\xaa\x02 \x01(\x02R\x14mStorageBytesReadP99\x12H\n" + - "!m_storage_time_reading_micros_cnt\x18\xab\x02 \x01(\x02R\x1cmStorageTimeReadingMicrosCnt\x12H\n" + - "!m_storage_time_reading_micros_sum\x18\xac\x02 \x01(\x02R\x1cmStorageTimeReadingMicrosSum\x12H\n" + - "!m_storage_time_reading_micros_min\x18\xad\x02 \x01(\x02R\x1cmStorageTimeReadingMicrosMin\x12H\n" + - "!m_storage_time_reading_micros_max\x18\xae\x02 \x01(\x02R\x1cmStorageTimeReadingMicrosMax\x12H\n" + - "!m_storage_time_reading_micros_p99\x18\xaf\x02 \x01(\x02R\x1cmStorageTimeReadingMicrosP99\x121\n" + - "\x15m_shared_blks_hit_cnt\x18\xd2\x01 \x01(\x02R\x11mSharedBlksHitCnt\x121\n" + - "\x15m_shared_blks_hit_sum\x18\xd3\x01 \x01(\x02R\x11mSharedBlksHitSum\x123\n" + - "\x16m_shared_blks_read_cnt\x18\xd4\x01 \x01(\x02R\x12mSharedBlksReadCnt\x123\n" + - "\x16m_shared_blks_read_sum\x18\xd5\x01 \x01(\x02R\x12mSharedBlksReadSum\x129\n" + - "\x19m_shared_blks_dirtied_cnt\x18\xd6\x01 \x01(\x02R\x15mSharedBlksDirtiedCnt\x129\n" + - "\x19m_shared_blks_dirtied_sum\x18\xd7\x01 \x01(\x02R\x15mSharedBlksDirtiedSum\x129\n" + - "\x19m_shared_blks_written_cnt\x18\xd8\x01 \x01(\x02R\x15mSharedBlksWrittenCnt\x129\n" + - "\x19m_shared_blks_written_sum\x18\xd9\x01 \x01(\x02R\x15mSharedBlksWrittenSum\x12/\n" + - "\x14m_local_blks_hit_cnt\x18\xda\x01 \x01(\x02R\x10mLocalBlksHitCnt\x12/\n" + - "\x14m_local_blks_hit_sum\x18\xdb\x01 \x01(\x02R\x10mLocalBlksHitSum\x121\n" + - "\x15m_local_blks_read_cnt\x18\xdc\x01 \x01(\x02R\x11mLocalBlksReadCnt\x121\n" + - "\x15m_local_blks_read_sum\x18\xdd\x01 \x01(\x02R\x11mLocalBlksReadSum\x127\n" + - "\x18m_local_blks_dirtied_cnt\x18\xde\x01 \x01(\x02R\x14mLocalBlksDirtiedCnt\x127\n" + - "\x18m_local_blks_dirtied_sum\x18\xdf\x01 \x01(\x02R\x14mLocalBlksDirtiedSum\x127\n" + - "\x18m_local_blks_written_cnt\x18\xe0\x01 \x01(\x02R\x14mLocalBlksWrittenCnt\x127\n" + - "\x18m_local_blks_written_sum\x18\xe1\x01 \x01(\x02R\x14mLocalBlksWrittenSum\x12/\n" + - "\x14m_temp_blks_read_cnt\x18\xe2\x01 \x01(\x02R\x10mTempBlksReadCnt\x12/\n" + - "\x14m_temp_blks_read_sum\x18\xe3\x01 \x01(\x02R\x10mTempBlksReadSum\x125\n" + - "\x17m_temp_blks_written_cnt\x18\xe4\x01 \x01(\x02R\x13mTempBlksWrittenCnt\x125\n" + - "\x17m_temp_blks_written_sum\x18\xe5\x01 \x01(\x02R\x13mTempBlksWrittenSum\x12-\n" + - "\x13m_blk_read_time_cnt\x18\xe6\x01 \x01(\x02R\x0fmBlkReadTimeCnt\x12-\n" + - "\x13m_blk_read_time_sum\x18\xe7\x01 \x01(\x02R\x0fmBlkReadTimeSum\x12/\n" + - "\x14m_blk_write_time_cnt\x18\xe8\x01 \x01(\x02R\x10mBlkWriteTimeCnt\x12/\n" + - "\x14m_blk_write_time_sum\x18\xe9\x01 \x01(\x02R\x10mBlkWriteTimeSum\x12:\n" + - "\x1am_shared_blk_read_time_cnt\x18\xea\x01 \x01(\x02R\x15mSharedBlkReadTimeCnt\x12:\n" + - "\x1am_shared_blk_read_time_sum\x18\xeb\x01 \x01(\x02R\x15mSharedBlkReadTimeSum\x12<\n" + - "\x1bm_shared_blk_write_time_cnt\x18\xec\x01 \x01(\x02R\x16mSharedBlkWriteTimeCnt\x12<\n" + - "\x1bm_shared_blk_write_time_sum\x18\xed\x01 \x01(\x02R\x16mSharedBlkWriteTimeSum\x128\n" + - "\x19m_local_blk_read_time_cnt\x18\xee\x01 \x01(\x02R\x14mLocalBlkReadTimeCnt\x128\n" + - "\x19m_local_blk_read_time_sum\x18\xef\x01 \x01(\x02R\x14mLocalBlkReadTimeSum\x12:\n" + - "\x1am_local_blk_write_time_cnt\x18\xf0\x01 \x01(\x02R\x15mLocalBlkWriteTimeCnt\x12:\n" + - "\x1am_local_blk_write_time_sum\x18\xf1\x01 \x01(\x02R\x15mLocalBlkWriteTimeSum\x12-\n" + - "\x13m_cpu_user_time_cnt\x18\xf2\x01 \x01(\x02R\x0fmCpuUserTimeCnt\x12-\n" + - "\x13m_cpu_user_time_sum\x18\xf3\x01 \x01(\x02R\x0fmCpuUserTimeSum\x12+\n" + - "\x12m_cpu_sys_time_cnt\x18\xf4\x01 \x01(\x02R\x0emCpuSysTimeCnt\x12+\n" + - "\x12m_cpu_sys_time_sum\x18\xf5\x01 \x01(\x02R\x0emCpuSysTimeSum\x12\x1a\n" + - "\bcmd_type\x18\xf6\x01 \x01(\tR\acmdType\x12*\n" + - "\x11m_plans_calls_sum\x18\xfa\x01 \x01(\x02R\x0emPlansCallsSum\x12*\n" + - "\x11m_plans_calls_cnt\x18\xfb\x01 \x01(\x02R\x0emPlansCallsCnt\x12*\n" + - "\x11m_wal_records_sum\x18\xfc\x01 \x01(\x02R\x0emWalRecordsSum\x12*\n" + - "\x11m_wal_records_cnt\x18\xfd\x01 \x01(\x02R\x0emWalRecordsCnt\x12\"\n" + - "\rm_wal_fpi_sum\x18\xfe\x01 \x01(\x02R\n" + - "mWalFpiSum\x12\"\n" + - "\rm_wal_fpi_cnt\x18\xff\x01 \x01(\x02R\n" + - "mWalFpiCnt\x12&\n" + - "\x0fm_wal_bytes_sum\x18\x80\x02 \x01(\x02R\fmWalBytesSum\x12&\n" + - "\x0fm_wal_bytes_cnt\x18\x81\x02 \x01(\x02R\fmWalBytesCnt\x12&\n" + - "\x0fm_plan_time_sum\x18\x82\x02 \x01(\x02R\fmPlanTimeSum\x12&\n" + - "\x0fm_plan_time_cnt\x18\x83\x02 \x01(\x02R\fmPlanTimeCnt\x12&\n" + - "\x0fm_plan_time_min\x18\x84\x02 \x01(\x02R\fmPlanTimeMin\x12&\n" + - "\x0fm_plan_time_max\x18\x85\x02 \x01(\x02R\fmPlanTimeMax\x12 \n" + - "\vtop_queryid\x18\x87\x02 \x01(\tR\n" + - "topQueryid\x12\x1c\n" + - "\ttop_query\x18\x88\x02 \x01(\tR\btopQuery\x12*\n" + - "\x10application_name\x18\x89\x02 \x01(\tR\x0fapplicationName\x12\x17\n" + - "\x06planid\x18\x8a\x02 \x01(\tR\x06planid\x12\x1e\n" + - "\n" + - "query_plan\x18\x8b\x02 \x01(\tR\tqueryPlan\x12(\n" + - "\x0fhistogram_items\x18\x8c\x02 \x03(\tR\x0ehistogramItems\x1a9\n" + - "\vLabelsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\x1a;\n" + - "\rWarningsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\x04R\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\x04R\x05value:\x028\x01\x1a9\n" + - "\vErrorsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\x04R\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\x04R\x05value:\x028\x01\"\x11\n" + - "\x0fCollectResponse2`\n" + - "\x10CollectorService\x12:\n" + - "\aCollect\x12\x16.qan.v1.CollectRequest\x1a\x17.qan.v1.CollectResponse\x1a\x10\xfa\xd2\xe4\x93\x02\n" + - "\x12\bINTERNALB~\n" + - "\n" + - "com.qan.v1B\x0eCollectorProtoP\x01Z'github.com/percona/pmm/api/qan/v1;qanv1\xa2\x02\x03QXX\xaa\x02\x06Qan.V1\xca\x02\x06Qan\\V1\xe2\x02\x12Qan\\V1\\GPBMetadata\xea\x02\aQan::V1b\x06proto3" - -var ( - file_qan_v1_collector_proto_rawDescOnce sync.Once - file_qan_v1_collector_proto_rawDescData []byte -) - -func file_qan_v1_collector_proto_rawDescGZIP() []byte { - file_qan_v1_collector_proto_rawDescOnce.Do(func() { - file_qan_v1_collector_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_qan_v1_collector_proto_rawDesc), len(file_qan_v1_collector_proto_rawDesc))) - }) - 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_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 - 3, // 2: qan.v1.MetricsBucket.labels:type_name -> qan.v1.MetricsBucket.LabelsEntry - 7, // 3: qan.v1.MetricsBucket.example_type:type_name -> qan.v1.ExampleType - 4, // 4: qan.v1.MetricsBucket.warnings:type_name -> qan.v1.MetricsBucket.WarningsEntry - 5, // 5: qan.v1.MetricsBucket.errors:type_name -> qan.v1.MetricsBucket.ErrorsEntry - 0, // 6: qan.v1.CollectorService.Collect:input_type -> qan.v1.CollectRequest - 2, // 7: qan.v1.CollectorService.Collect:output_type -> qan.v1.CollectResponse - 7, // [7:8] is the sub-list for method output_type - 6, // [6:7] is the sub-list for method input_type - 6, // [6:6] is the sub-list for extension type_name - 6, // [6:6] is the sub-list for extension extendee - 0, // [0:6] is the sub-list for field type_name -} - -func init() { file_qan_v1_collector_proto_init() } -func file_qan_v1_collector_proto_init() { - if File_qan_v1_collector_proto != nil { - return - } - file_qan_v1_qan_proto_init() - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_qan_v1_collector_proto_rawDesc), len(file_qan_v1_collector_proto_rawDesc)), - NumEnums: 0, - NumMessages: 6, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_qan_v1_collector_proto_goTypes, - DependencyIndexes: file_qan_v1_collector_proto_depIdxs, - MessageInfos: file_qan_v1_collector_proto_msgTypes, - }.Build() - File_qan_v1_collector_proto = out.File - file_qan_v1_collector_proto_goTypes = nil - file_qan_v1_collector_proto_depIdxs = nil -} diff --git a/api/qan/v1/collector.pb.validate.go b/api/qan/v1/collector.pb.validate.go deleted file mode 100644 index eeae914a4a8..00000000000 --- a/api/qan/v1/collector.pb.validate.go +++ /dev/null @@ -1,898 +0,0 @@ -// Code generated by protoc-gen-validate. DO NOT EDIT. -// source: qan/v1/collector.proto - -package qanv1 - -import ( - "bytes" - "errors" - "fmt" - "net" - "net/mail" - "net/url" - "regexp" - "sort" - "strings" - "time" - "unicode/utf8" - - "google.golang.org/protobuf/types/known/anypb" - - inventoryv1 "github.com/percona/pmm/api/inventory/v1" -) - -// ensure the imports are used -var ( - _ = bytes.MinRead - _ = errors.New("") - _ = fmt.Print - _ = utf8.UTFMax - _ = (*regexp.Regexp)(nil) - _ = (*strings.Reader)(nil) - _ = net.IPv4len - _ = time.Duration(0) - _ = (*url.URL)(nil) - _ = (*mail.Address)(nil) - _ = anypb.Any{} - _ = sort.Sort - - _ = inventoryv1.AgentType(0) -) - -// Validate checks the field values on CollectRequest 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 *CollectRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on CollectRequest 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 CollectRequestMultiError, -// or nil if none found. -func (m *CollectRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *CollectRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - for idx, item := range m.GetMetricsBucket() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, CollectRequestValidationError{ - field: fmt.Sprintf("MetricsBucket[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, CollectRequestValidationError{ - field: fmt.Sprintf("MetricsBucket[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return CollectRequestValidationError{ - field: fmt.Sprintf("MetricsBucket[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - if len(errors) > 0 { - return CollectRequestMultiError(errors) - } - - return nil -} - -// CollectRequestMultiError is an error wrapping multiple validation errors -// returned by CollectRequest.ValidateAll() if the designated constraints -// aren't met. -type CollectRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m CollectRequestMultiError) 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 CollectRequestMultiError) AllErrors() []error { return m } - -// CollectRequestValidationError is the validation error returned by -// CollectRequest.Validate if the designated constraints aren't met. -type CollectRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e CollectRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e CollectRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e CollectRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e CollectRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e CollectRequestValidationError) ErrorName() string { return "CollectRequestValidationError" } - -// Error satisfies the builtin error interface -func (e CollectRequestValidationError) 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 %sCollectRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = CollectRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = CollectRequestValidationError{} - -// Validate checks the field values on MetricsBucket 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 *MetricsBucket) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on MetricsBucket 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 MetricsBucketMultiError, or -// nil if none found. -func (m *MetricsBucket) ValidateAll() error { - return m.validate(true) -} - -func (m *MetricsBucket) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Queryid - - // no validation rules for ExplainFingerprint - - // no validation rules for PlaceholdersCount - - // no validation rules for Fingerprint - - // no validation rules for ServiceName - - // no validation rules for Database - - // no validation rules for Schema - - // no validation rules for Username - - // no validation rules for ClientHost - - // no validation rules for NodeId - - // no validation rules for NodeName - - // no validation rules for NodeType - - // no validation rules for MachineId - - // no validation rules for ContainerId - - // no validation rules for ContainerName - - // no validation rules for NodeModel - - // no validation rules for Region - - // no validation rules for Az - - // no validation rules for ServiceId - - // no validation rules for ServiceType - - // no validation rules for Environment - - // no validation rules for Cluster - - // no validation rules for ReplicationSet - - // no validation rules for AgentId - - // no validation rules for AgentType - - // no validation rules for Labels - - // no validation rules for PeriodStartUnixSecs - - // no validation rules for PeriodLengthSecs - - // no validation rules for Example - - // no validation rules for IsTruncated - - // no validation rules for ExampleType - - // no validation rules for ExampleMetrics - - // no validation rules for NumQueriesWithWarnings - - // no validation rules for Warnings - - // no validation rules for NumQueriesWithErrors - - // no validation rules for Errors - - // no validation rules for NumQueries - - // no validation rules for MQueryTimeCnt - - // no validation rules for MQueryTimeSum - - // no validation rules for MQueryTimeMin - - // no validation rules for MQueryTimeMax - - // no validation rules for MQueryTimeP99 - - // no validation rules for MLockTimeCnt - - // no validation rules for MLockTimeSum - - // no validation rules for MLockTimeMin - - // no validation rules for MLockTimeMax - - // no validation rules for MLockTimeP99 - - // no validation rules for MRowsSentCnt - - // no validation rules for MRowsSentSum - - // no validation rules for MRowsSentMin - - // no validation rules for MRowsSentMax - - // no validation rules for MRowsSentP99 - - // no validation rules for MRowsExaminedCnt - - // no validation rules for MRowsExaminedSum - - // no validation rules for MRowsExaminedMin - - // no validation rules for MRowsExaminedMax - - // no validation rules for MRowsExaminedP99 - - // no validation rules for MRowsAffectedCnt - - // no validation rules for MRowsAffectedSum - - // no validation rules for MRowsAffectedMin - - // no validation rules for MRowsAffectedMax - - // no validation rules for MRowsAffectedP99 - - // no validation rules for MRowsReadCnt - - // no validation rules for MRowsReadSum - - // no validation rules for MRowsReadMin - - // no validation rules for MRowsReadMax - - // no validation rules for MRowsReadP99 - - // no validation rules for MMergePassesCnt - - // no validation rules for MMergePassesSum - - // no validation rules for MMergePassesMin - - // no validation rules for MMergePassesMax - - // no validation rules for MMergePassesP99 - - // no validation rules for MInnodbIoROpsCnt - - // no validation rules for MInnodbIoROpsSum - - // no validation rules for MInnodbIoROpsMin - - // no validation rules for MInnodbIoROpsMax - - // no validation rules for MInnodbIoROpsP99 - - // no validation rules for MInnodbIoRBytesCnt - - // no validation rules for MInnodbIoRBytesSum - - // no validation rules for MInnodbIoRBytesMin - - // no validation rules for MInnodbIoRBytesMax - - // no validation rules for MInnodbIoRBytesP99 - - // no validation rules for MInnodbIoRWaitCnt - - // no validation rules for MInnodbIoRWaitSum - - // no validation rules for MInnodbIoRWaitMin - - // no validation rules for MInnodbIoRWaitMax - - // no validation rules for MInnodbIoRWaitP99 - - // no validation rules for MInnodbRecLockWaitCnt - - // no validation rules for MInnodbRecLockWaitSum - - // no validation rules for MInnodbRecLockWaitMin - - // no validation rules for MInnodbRecLockWaitMax - - // no validation rules for MInnodbRecLockWaitP99 - - // no validation rules for MInnodbQueueWaitCnt - - // no validation rules for MInnodbQueueWaitSum - - // no validation rules for MInnodbQueueWaitMin - - // no validation rules for MInnodbQueueWaitMax - - // no validation rules for MInnodbQueueWaitP99 - - // no validation rules for MInnodbPagesDistinctCnt - - // no validation rules for MInnodbPagesDistinctSum - - // no validation rules for MInnodbPagesDistinctMin - - // no validation rules for MInnodbPagesDistinctMax - - // no validation rules for MInnodbPagesDistinctP99 - - // no validation rules for MQueryLengthCnt - - // no validation rules for MQueryLengthSum - - // no validation rules for MQueryLengthMin - - // no validation rules for MQueryLengthMax - - // no validation rules for MQueryLengthP99 - - // no validation rules for MBytesSentCnt - - // no validation rules for MBytesSentSum - - // no validation rules for MBytesSentMin - - // no validation rules for MBytesSentMax - - // no validation rules for MBytesSentP99 - - // no validation rules for MTmpTablesCnt - - // no validation rules for MTmpTablesSum - - // no validation rules for MTmpTablesMin - - // no validation rules for MTmpTablesMax - - // no validation rules for MTmpTablesP99 - - // no validation rules for MTmpDiskTablesCnt - - // no validation rules for MTmpDiskTablesSum - - // no validation rules for MTmpDiskTablesMin - - // no validation rules for MTmpDiskTablesMax - - // no validation rules for MTmpDiskTablesP99 - - // no validation rules for MTmpTableSizesCnt - - // no validation rules for MTmpTableSizesSum - - // no validation rules for MTmpTableSizesMin - - // no validation rules for MTmpTableSizesMax - - // no validation rules for MTmpTableSizesP99 - - // no validation rules for MQcHitCnt - - // no validation rules for MQcHitSum - - // no validation rules for MFullScanCnt - - // no validation rules for MFullScanSum - - // no validation rules for MFullJoinCnt - - // no validation rules for MFullJoinSum - - // no validation rules for MTmpTableCnt - - // no validation rules for MTmpTableSum - - // no validation rules for MTmpTableOnDiskCnt - - // no validation rules for MTmpTableOnDiskSum - - // no validation rules for MFilesortCnt - - // no validation rules for MFilesortSum - - // no validation rules for MFilesortOnDiskCnt - - // no validation rules for MFilesortOnDiskSum - - // no validation rules for MSelectFullRangeJoinCnt - - // no validation rules for MSelectFullRangeJoinSum - - // no validation rules for MSelectRangeCnt - - // no validation rules for MSelectRangeSum - - // no validation rules for MSelectRangeCheckCnt - - // no validation rules for MSelectRangeCheckSum - - // no validation rules for MSortRangeCnt - - // no validation rules for MSortRangeSum - - // no validation rules for MSortRowsCnt - - // no validation rules for MSortRowsSum - - // no validation rules for MSortScanCnt - - // no validation rules for MSortScanSum - - // no validation rules for MNoIndexUsedCnt - - // no validation rules for MNoIndexUsedSum - - // no validation rules for MNoGoodIndexUsedCnt - - // no validation rules for MNoGoodIndexUsedSum - - // no validation rules for MDocsReturnedCnt - - // no validation rules for MDocsReturnedSum - - // no validation rules for MDocsReturnedMin - - // no validation rules for MDocsReturnedMax - - // no validation rules for MDocsReturnedP99 - - // no validation rules for MResponseLengthCnt - - // no validation rules for MResponseLengthSum - - // no validation rules for MResponseLengthMin - - // no validation rules for MResponseLengthMax - - // no validation rules for MResponseLengthP99 - - // no validation rules for MDocsScannedCnt - - // no validation rules for MDocsScannedSum - - // no validation rules for MDocsScannedMin - - // no validation rules for MDocsScannedMax - - // no validation rules for MDocsScannedP99 - - // no validation rules for PlanSummary - - // no validation rules for MDocsExaminedCnt - - // no validation rules for MDocsExaminedSum - - // no validation rules for MDocsExaminedMin - - // no validation rules for MDocsExaminedMax - - // no validation rules for MDocsExaminedP99 - - // no validation rules for MKeysExaminedCnt - - // no validation rules for MKeysExaminedSum - - // no validation rules for MKeysExaminedMin - - // no validation rules for MKeysExaminedMax - - // no validation rules for MKeysExaminedP99 - - // no validation rules for MLocksGlobalAcquireCountReadSharedCnt - - // no validation rules for MLocksGlobalAcquireCountReadSharedSum - - // no validation rules for MLocksGlobalAcquireCountWriteSharedCnt - - // no validation rules for MLocksGlobalAcquireCountWriteSharedSum - - // no validation rules for MLocksDatabaseAcquireCountReadSharedCnt - - // no validation rules for MLocksDatabaseAcquireCountReadSharedSum - - // no validation rules for MLocksDatabaseAcquireWaitCountReadSharedCnt - - // no validation rules for MLocksDatabaseAcquireWaitCountReadSharedSum - - // no validation rules for MLocksDatabaseTimeAcquiringMicrosReadSharedCnt - - // no validation rules for MLocksDatabaseTimeAcquiringMicrosReadSharedSum - - // no validation rules for MLocksDatabaseTimeAcquiringMicrosReadSharedMin - - // no validation rules for MLocksDatabaseTimeAcquiringMicrosReadSharedMax - - // no validation rules for MLocksDatabaseTimeAcquiringMicrosReadSharedP99 - - // no validation rules for MLocksCollectionAcquireCountReadSharedCnt - - // no validation rules for MLocksCollectionAcquireCountReadSharedSum - - // no validation rules for MStorageBytesReadCnt - - // no validation rules for MStorageBytesReadSum - - // no validation rules for MStorageBytesReadMin - - // no validation rules for MStorageBytesReadMax - - // no validation rules for MStorageBytesReadP99 - - // no validation rules for MStorageTimeReadingMicrosCnt - - // no validation rules for MStorageTimeReadingMicrosSum - - // no validation rules for MStorageTimeReadingMicrosMin - - // no validation rules for MStorageTimeReadingMicrosMax - - // no validation rules for MStorageTimeReadingMicrosP99 - - // no validation rules for MSharedBlksHitCnt - - // no validation rules for MSharedBlksHitSum - - // no validation rules for MSharedBlksReadCnt - - // no validation rules for MSharedBlksReadSum - - // no validation rules for MSharedBlksDirtiedCnt - - // no validation rules for MSharedBlksDirtiedSum - - // no validation rules for MSharedBlksWrittenCnt - - // no validation rules for MSharedBlksWrittenSum - - // no validation rules for MLocalBlksHitCnt - - // no validation rules for MLocalBlksHitSum - - // no validation rules for MLocalBlksReadCnt - - // no validation rules for MLocalBlksReadSum - - // no validation rules for MLocalBlksDirtiedCnt - - // no validation rules for MLocalBlksDirtiedSum - - // no validation rules for MLocalBlksWrittenCnt - - // no validation rules for MLocalBlksWrittenSum - - // no validation rules for MTempBlksReadCnt - - // no validation rules for MTempBlksReadSum - - // no validation rules for MTempBlksWrittenCnt - - // no validation rules for MTempBlksWrittenSum - - // no validation rules for MBlkReadTimeCnt - - // no validation rules for MBlkReadTimeSum - - // no validation rules for MBlkWriteTimeCnt - - // no validation rules for MBlkWriteTimeSum - - // no validation rules for MSharedBlkReadTimeCnt - - // no validation rules for MSharedBlkReadTimeSum - - // no validation rules for MSharedBlkWriteTimeCnt - - // no validation rules for MSharedBlkWriteTimeSum - - // no validation rules for MLocalBlkReadTimeCnt - - // no validation rules for MLocalBlkReadTimeSum - - // no validation rules for MLocalBlkWriteTimeCnt - - // no validation rules for MLocalBlkWriteTimeSum - - // no validation rules for MCpuUserTimeCnt - - // no validation rules for MCpuUserTimeSum - - // no validation rules for MCpuSysTimeCnt - - // no validation rules for MCpuSysTimeSum - - // no validation rules for CmdType - - // no validation rules for MPlansCallsSum - - // no validation rules for MPlansCallsCnt - - // no validation rules for MWalRecordsSum - - // no validation rules for MWalRecordsCnt - - // no validation rules for MWalFpiSum - - // no validation rules for MWalFpiCnt - - // no validation rules for MWalBytesSum - - // no validation rules for MWalBytesCnt - - // no validation rules for MPlanTimeSum - - // no validation rules for MPlanTimeCnt - - // no validation rules for MPlanTimeMin - - // no validation rules for MPlanTimeMax - - // no validation rules for TopQueryid - - // no validation rules for TopQuery - - // no validation rules for ApplicationName - - // no validation rules for Planid - - // no validation rules for QueryPlan - - if len(errors) > 0 { - return MetricsBucketMultiError(errors) - } - - return nil -} - -// MetricsBucketMultiError is an error wrapping multiple validation errors -// returned by MetricsBucket.ValidateAll() if the designated constraints -// aren't met. -type MetricsBucketMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m MetricsBucketMultiError) 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 MetricsBucketMultiError) AllErrors() []error { return m } - -// MetricsBucketValidationError is the validation error returned by -// MetricsBucket.Validate if the designated constraints aren't met. -type MetricsBucketValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e MetricsBucketValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e MetricsBucketValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e MetricsBucketValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e MetricsBucketValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e MetricsBucketValidationError) ErrorName() string { return "MetricsBucketValidationError" } - -// Error satisfies the builtin error interface -func (e MetricsBucketValidationError) 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 %sMetricsBucket.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = MetricsBucketValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = MetricsBucketValidationError{} - -// Validate checks the field values on CollectResponse 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 *CollectResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on CollectResponse 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 -// CollectResponseMultiError, or nil if none found. -func (m *CollectResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *CollectResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return CollectResponseMultiError(errors) - } - - return nil -} - -// CollectResponseMultiError is an error wrapping multiple validation errors -// returned by CollectResponse.ValidateAll() if the designated constraints -// aren't met. -type CollectResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m CollectResponseMultiError) 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 CollectResponseMultiError) AllErrors() []error { return m } - -// CollectResponseValidationError is the validation error returned by -// CollectResponse.Validate if the designated constraints aren't met. -type CollectResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e CollectResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e CollectResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e CollectResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e CollectResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e CollectResponseValidationError) ErrorName() string { return "CollectResponseValidationError" } - -// Error satisfies the builtin error interface -func (e CollectResponseValidationError) 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 %sCollectResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = CollectResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = CollectResponseValidationError{} diff --git a/api/qan/v1/collector_grpc.pb.go b/api/qan/v1/collector_grpc.pb.go deleted file mode 100644 index e13e55d5599..00000000000 --- a/api/qan/v1/collector_grpc.pb.go +++ /dev/null @@ -1,128 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.6.0 -// - protoc (unknown) -// source: qan/v1/collector.proto - -package qanv1 - -import ( - context "context" - - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.64.0 or later. -const _ = grpc.SupportPackageIsVersion9 - -const ( - CollectorService_Collect_FullMethodName = "/qan.v1.CollectorService/Collect" -) - -// CollectorServiceClient is the client API for CollectorService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -// -// Collector service accepts data from pmm-agent (via pmm-managed). -type CollectorServiceClient interface { - // Collect accepts data from pmm-agent (via pmm-managed). - Collect(ctx context.Context, in *CollectRequest, opts ...grpc.CallOption) (*CollectResponse, error) -} - -type collectorServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewCollectorServiceClient(cc grpc.ClientConnInterface) CollectorServiceClient { - return &collectorServiceClient{cc} -} - -func (c *collectorServiceClient) Collect(ctx context.Context, in *CollectRequest, opts ...grpc.CallOption) (*CollectResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(CollectResponse) - err := c.cc.Invoke(ctx, CollectorService_Collect_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -// CollectorServiceServer is the server API for CollectorService service. -// All implementations must embed UnimplementedCollectorServiceServer -// for forward compatibility. -// -// Collector service accepts data from pmm-agent (via pmm-managed). -type CollectorServiceServer interface { - // Collect accepts data from pmm-agent (via pmm-managed). - Collect(context.Context, *CollectRequest) (*CollectResponse, error) - mustEmbedUnimplementedCollectorServiceServer() -} - -// UnimplementedCollectorServiceServer must be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -type UnimplementedCollectorServiceServer struct{} - -func (UnimplementedCollectorServiceServer) Collect(context.Context, *CollectRequest) (*CollectResponse, error) { - return nil, status.Error(codes.Unimplemented, "method Collect not implemented") -} -func (UnimplementedCollectorServiceServer) mustEmbedUnimplementedCollectorServiceServer() {} -func (UnimplementedCollectorServiceServer) testEmbeddedByValue() {} - -// UnsafeCollectorServiceServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to CollectorServiceServer will -// result in compilation errors. -type UnsafeCollectorServiceServer interface { - mustEmbedUnimplementedCollectorServiceServer() -} - -func RegisterCollectorServiceServer(s grpc.ServiceRegistrar, srv CollectorServiceServer) { - // If the following call panics, it indicates UnimplementedCollectorServiceServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } - s.RegisterService(&CollectorService_ServiceDesc, srv) -} - -func _CollectorService_Collect_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CollectRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(CollectorServiceServer).Collect(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: CollectorService_Collect_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(CollectorServiceServer).Collect(ctx, req.(*CollectRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// CollectorService_ServiceDesc is the grpc.ServiceDesc for CollectorService service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var CollectorService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "qan.v1.CollectorService", - HandlerType: (*CollectorServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Collect", - Handler: _CollectorService_Collect_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "qan/v1/collector.proto", -} diff --git a/api/qan/v1/filters.pb.go b/api/qan/v1/filters.pb.go deleted file mode 100644 index d69cad82b1f..00000000000 --- a/api/qan/v1/filters.pb.go +++ /dev/null @@ -1,334 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.10 -// protoc (unknown) -// source: qan/v1/filters.proto - -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" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// GetFilteredMetricsNamesRequest contains period for which we need filters. -type GetFilteredMetricsNamesRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - PeriodStartFrom *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=period_start_from,json=periodStartFrom,proto3" json:"period_start_from,omitempty"` - PeriodStartTo *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=period_start_to,json=periodStartTo,proto3" json:"period_start_to,omitempty"` - MainMetricName string `protobuf:"bytes,3,opt,name=main_metric_name,json=mainMetricName,proto3" json:"main_metric_name,omitempty"` - Labels []*MapFieldEntry `protobuf:"bytes,4,rep,name=labels,proto3" json:"labels,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetFilteredMetricsNamesRequest) Reset() { - *x = GetFilteredMetricsNamesRequest{} - mi := &file_qan_v1_filters_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetFilteredMetricsNamesRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetFilteredMetricsNamesRequest) ProtoMessage() {} - -func (x *GetFilteredMetricsNamesRequest) ProtoReflect() protoreflect.Message { - mi := &file_qan_v1_filters_proto_msgTypes[0] - 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 GetFilteredMetricsNamesRequest.ProtoReflect.Descriptor instead. -func (*GetFilteredMetricsNamesRequest) Descriptor() ([]byte, []int) { - return file_qan_v1_filters_proto_rawDescGZIP(), []int{0} -} - -func (x *GetFilteredMetricsNamesRequest) GetPeriodStartFrom() *timestamppb.Timestamp { - if x != nil { - return x.PeriodStartFrom - } - return nil -} - -func (x *GetFilteredMetricsNamesRequest) GetPeriodStartTo() *timestamppb.Timestamp { - if x != nil { - return x.PeriodStartTo - } - return nil -} - -func (x *GetFilteredMetricsNamesRequest) GetMainMetricName() string { - if x != nil { - return x.MainMetricName - } - return "" -} - -func (x *GetFilteredMetricsNamesRequest) GetLabels() []*MapFieldEntry { - if x != nil { - return x.Labels - } - return nil -} - -// GetFilteredMetricsNamesResponse is map of labels for given period by key. -// Key is label's name and value is label's value and how many times it occur. -type GetFilteredMetricsNamesResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Labels map[string]*ListLabels `protobuf:"bytes,1,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetFilteredMetricsNamesResponse) Reset() { - *x = GetFilteredMetricsNamesResponse{} - mi := &file_qan_v1_filters_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetFilteredMetricsNamesResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetFilteredMetricsNamesResponse) ProtoMessage() {} - -func (x *GetFilteredMetricsNamesResponse) ProtoReflect() protoreflect.Message { - mi := &file_qan_v1_filters_proto_msgTypes[1] - 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 GetFilteredMetricsNamesResponse.ProtoReflect.Descriptor instead. -func (*GetFilteredMetricsNamesResponse) Descriptor() ([]byte, []int) { - return file_qan_v1_filters_proto_rawDescGZIP(), []int{1} -} - -func (x *GetFilteredMetricsNamesResponse) GetLabels() map[string]*ListLabels { - if x != nil { - return x.Labels - } - return nil -} - -// ListLabels is list of label's values: duplicates are impossible. -type ListLabels struct { - state protoimpl.MessageState `protogen:"open.v1"` - Name []*Values `protobuf:"bytes,1,rep,name=name,proto3" json:"name,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ListLabels) Reset() { - *x = ListLabels{} - mi := &file_qan_v1_filters_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ListLabels) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListLabels) ProtoMessage() {} - -func (x *ListLabels) ProtoReflect() protoreflect.Message { - mi := &file_qan_v1_filters_proto_msgTypes[2] - 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 ListLabels.ProtoReflect.Descriptor instead. -func (*ListLabels) Descriptor() ([]byte, []int) { - return file_qan_v1_filters_proto_rawDescGZIP(), []int{2} -} - -func (x *ListLabels) GetName() []*Values { - if x != nil { - return x.Name - } - return nil -} - -// Values is label values and main metric percent and per second. -type Values struct { - state protoimpl.MessageState `protogen:"open.v1"` - Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` - MainMetricPercent float32 `protobuf:"fixed32,2,opt,name=main_metric_percent,json=mainMetricPercent,proto3" json:"main_metric_percent,omitempty"` - MainMetricPerSec float32 `protobuf:"fixed32,3,opt,name=main_metric_per_sec,json=mainMetricPerSec,proto3" json:"main_metric_per_sec,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Values) Reset() { - *x = Values{} - mi := &file_qan_v1_filters_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Values) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Values) ProtoMessage() {} - -func (x *Values) ProtoReflect() protoreflect.Message { - mi := &file_qan_v1_filters_proto_msgTypes[3] - 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 Values.ProtoReflect.Descriptor instead. -func (*Values) Descriptor() ([]byte, []int) { - return file_qan_v1_filters_proto_rawDescGZIP(), []int{3} -} - -func (x *Values) GetValue() string { - if x != nil { - return x.Value - } - return "" -} - -func (x *Values) GetMainMetricPercent() float32 { - if x != nil { - return x.MainMetricPercent - } - return 0 -} - -func (x *Values) GetMainMetricPerSec() float32 { - if x != nil { - return x.MainMetricPerSec - } - return 0 -} - -var File_qan_v1_filters_proto protoreflect.FileDescriptor - -const file_qan_v1_filters_proto_rawDesc = "" + - "\n" + - "\x14qan/v1/filters.proto\x12\x06qan.v1\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x10qan/v1/qan.proto\"\x85\x02\n" + - "\x1eGetFilteredMetricsNamesRequest\x12F\n" + - "\x11period_start_from\x18\x01 \x01(\v2\x1a.google.protobuf.TimestampR\x0fperiodStartFrom\x12B\n" + - "\x0fperiod_start_to\x18\x02 \x01(\v2\x1a.google.protobuf.TimestampR\rperiodStartTo\x12(\n" + - "\x10main_metric_name\x18\x03 \x01(\tR\x0emainMetricName\x12-\n" + - "\x06labels\x18\x04 \x03(\v2\x15.qan.v1.MapFieldEntryR\x06labels\"\xbd\x01\n" + - "\x1fGetFilteredMetricsNamesResponse\x12K\n" + - "\x06labels\x18\x01 \x03(\v23.qan.v1.GetFilteredMetricsNamesResponse.LabelsEntryR\x06labels\x1aM\n" + - "\vLabelsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12(\n" + - "\x05value\x18\x02 \x01(\v2\x12.qan.v1.ListLabelsR\x05value:\x028\x01\"0\n" + - "\n" + - "ListLabels\x12\"\n" + - "\x04name\x18\x01 \x03(\v2\x0e.qan.v1.ValuesR\x04name\"}\n" + - "\x06Values\x12\x14\n" + - "\x05value\x18\x01 \x01(\tR\x05value\x12.\n" + - "\x13main_metric_percent\x18\x02 \x01(\x02R\x11mainMetricPercent\x12-\n" + - "\x13main_metric_per_sec\x18\x03 \x01(\x02R\x10mainMetricPerSecB|\n" + - "\n" + - "com.qan.v1B\fFiltersProtoP\x01Z'github.com/percona/pmm/api/qan/v1;qanv1\xa2\x02\x03QXX\xaa\x02\x06Qan.V1\xca\x02\x06Qan\\V1\xe2\x02\x12Qan\\V1\\GPBMetadata\xea\x02\aQan::V1b\x06proto3" - -var ( - file_qan_v1_filters_proto_rawDescOnce sync.Once - file_qan_v1_filters_proto_rawDescData []byte -) - -func file_qan_v1_filters_proto_rawDescGZIP() []byte { - file_qan_v1_filters_proto_rawDescOnce.Do(func() { - file_qan_v1_filters_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_qan_v1_filters_proto_rawDesc), len(file_qan_v1_filters_proto_rawDesc))) - }) - 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_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 - 6, // 2: qan.v1.GetFilteredMetricsNamesRequest.labels:type_name -> qan.v1.MapFieldEntry - 4, // 3: qan.v1.GetFilteredMetricsNamesResponse.labels:type_name -> qan.v1.GetFilteredMetricsNamesResponse.LabelsEntry - 3, // 4: qan.v1.ListLabels.name:type_name -> qan.v1.Values - 2, // 5: qan.v1.GetFilteredMetricsNamesResponse.LabelsEntry.value:type_name -> qan.v1.ListLabels - 6, // [6:6] is the sub-list for method output_type - 6, // [6:6] is the sub-list for method input_type - 6, // [6:6] is the sub-list for extension type_name - 6, // [6:6] is the sub-list for extension extendee - 0, // [0:6] is the sub-list for field type_name -} - -func init() { file_qan_v1_filters_proto_init() } -func file_qan_v1_filters_proto_init() { - if File_qan_v1_filters_proto != nil { - return - } - file_qan_v1_qan_proto_init() - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_qan_v1_filters_proto_rawDesc), len(file_qan_v1_filters_proto_rawDesc)), - NumEnums: 0, - NumMessages: 5, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_qan_v1_filters_proto_goTypes, - DependencyIndexes: file_qan_v1_filters_proto_depIdxs, - MessageInfos: file_qan_v1_filters_proto_msgTypes, - }.Build() - File_qan_v1_filters_proto = out.File - file_qan_v1_filters_proto_goTypes = nil - file_qan_v1_filters_proto_depIdxs = nil -} diff --git a/api/qan/v1/filters.pb.validate.go b/api/qan/v1/filters.pb.validate.go deleted file mode 100644 index bdd9c5d42dd..00000000000 --- a/api/qan/v1/filters.pb.validate.go +++ /dev/null @@ -1,619 +0,0 @@ -// Code generated by protoc-gen-validate. DO NOT EDIT. -// source: qan/v1/filters.proto - -package qanv1 - -import ( - "bytes" - "errors" - "fmt" - "net" - "net/mail" - "net/url" - "regexp" - "sort" - "strings" - "time" - "unicode/utf8" - - "google.golang.org/protobuf/types/known/anypb" -) - -// ensure the imports are used -var ( - _ = bytes.MinRead - _ = errors.New("") - _ = fmt.Print - _ = utf8.UTFMax - _ = (*regexp.Regexp)(nil) - _ = (*strings.Reader)(nil) - _ = net.IPv4len - _ = time.Duration(0) - _ = (*url.URL)(nil) - _ = (*mail.Address)(nil) - _ = anypb.Any{} - _ = sort.Sort -) - -// Validate checks the field values on GetFilteredMetricsNamesRequest 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 *GetFilteredMetricsNamesRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on GetFilteredMetricsNamesRequest 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 -// GetFilteredMetricsNamesRequestMultiError, or nil if none found. -func (m *GetFilteredMetricsNamesRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *GetFilteredMetricsNamesRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if all { - switch v := interface{}(m.GetPeriodStartFrom()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GetFilteredMetricsNamesRequestValidationError{ - field: "PeriodStartFrom", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GetFilteredMetricsNamesRequestValidationError{ - field: "PeriodStartFrom", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetPeriodStartFrom()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GetFilteredMetricsNamesRequestValidationError{ - field: "PeriodStartFrom", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetPeriodStartTo()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GetFilteredMetricsNamesRequestValidationError{ - field: "PeriodStartTo", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GetFilteredMetricsNamesRequestValidationError{ - field: "PeriodStartTo", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetPeriodStartTo()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GetFilteredMetricsNamesRequestValidationError{ - field: "PeriodStartTo", - reason: "embedded message failed validation", - cause: err, - } - } - } - - // no validation rules for MainMetricName - - for idx, item := range m.GetLabels() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GetFilteredMetricsNamesRequestValidationError{ - field: fmt.Sprintf("Labels[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GetFilteredMetricsNamesRequestValidationError{ - field: fmt.Sprintf("Labels[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GetFilteredMetricsNamesRequestValidationError{ - field: fmt.Sprintf("Labels[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - if len(errors) > 0 { - return GetFilteredMetricsNamesRequestMultiError(errors) - } - - return nil -} - -// GetFilteredMetricsNamesRequestMultiError is an error wrapping multiple -// validation errors returned by GetFilteredMetricsNamesRequest.ValidateAll() -// if the designated constraints aren't met. -type GetFilteredMetricsNamesRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m GetFilteredMetricsNamesRequestMultiError) 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 GetFilteredMetricsNamesRequestMultiError) AllErrors() []error { return m } - -// GetFilteredMetricsNamesRequestValidationError is the validation error -// returned by GetFilteredMetricsNamesRequest.Validate if the designated -// constraints aren't met. -type GetFilteredMetricsNamesRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e GetFilteredMetricsNamesRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e GetFilteredMetricsNamesRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e GetFilteredMetricsNamesRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e GetFilteredMetricsNamesRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e GetFilteredMetricsNamesRequestValidationError) ErrorName() string { - return "GetFilteredMetricsNamesRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e GetFilteredMetricsNamesRequestValidationError) 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 %sGetFilteredMetricsNamesRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = GetFilteredMetricsNamesRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = GetFilteredMetricsNamesRequestValidationError{} - -// Validate checks the field values on GetFilteredMetricsNamesResponse 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 *GetFilteredMetricsNamesResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on GetFilteredMetricsNamesResponse 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 -// GetFilteredMetricsNamesResponseMultiError, or nil if none found. -func (m *GetFilteredMetricsNamesResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *GetFilteredMetricsNamesResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - { - sorted_keys := make([]string, len(m.GetLabels())) - i := 0 - for key := range m.GetLabels() { - sorted_keys[i] = key - i++ - } - sort.Slice(sorted_keys, func(i, j int) bool { return sorted_keys[i] < sorted_keys[j] }) - for _, key := range sorted_keys { - val := m.GetLabels()[key] - _ = val - - // no validation rules for Labels[key] - - if all { - switch v := interface{}(val).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GetFilteredMetricsNamesResponseValidationError{ - field: fmt.Sprintf("Labels[%v]", key), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GetFilteredMetricsNamesResponseValidationError{ - field: fmt.Sprintf("Labels[%v]", key), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(val).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GetFilteredMetricsNamesResponseValidationError{ - field: fmt.Sprintf("Labels[%v]", key), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - } - - if len(errors) > 0 { - return GetFilteredMetricsNamesResponseMultiError(errors) - } - - return nil -} - -// GetFilteredMetricsNamesResponseMultiError is an error wrapping multiple -// validation errors returned by GetFilteredMetricsNamesResponse.ValidateAll() -// if the designated constraints aren't met. -type GetFilteredMetricsNamesResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m GetFilteredMetricsNamesResponseMultiError) 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 GetFilteredMetricsNamesResponseMultiError) AllErrors() []error { return m } - -// GetFilteredMetricsNamesResponseValidationError is the validation error -// returned by GetFilteredMetricsNamesResponse.Validate if the designated -// constraints aren't met. -type GetFilteredMetricsNamesResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e GetFilteredMetricsNamesResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e GetFilteredMetricsNamesResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e GetFilteredMetricsNamesResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e GetFilteredMetricsNamesResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e GetFilteredMetricsNamesResponseValidationError) ErrorName() string { - return "GetFilteredMetricsNamesResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e GetFilteredMetricsNamesResponseValidationError) 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 %sGetFilteredMetricsNamesResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = GetFilteredMetricsNamesResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = GetFilteredMetricsNamesResponseValidationError{} - -// Validate checks the field values on ListLabels 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 *ListLabels) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ListLabels 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 ListLabelsMultiError, or -// nil if none found. -func (m *ListLabels) ValidateAll() error { - return m.validate(true) -} - -func (m *ListLabels) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - for idx, item := range m.GetName() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ListLabelsValidationError{ - field: fmt.Sprintf("Name[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ListLabelsValidationError{ - field: fmt.Sprintf("Name[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ListLabelsValidationError{ - field: fmt.Sprintf("Name[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - if len(errors) > 0 { - return ListLabelsMultiError(errors) - } - - return nil -} - -// ListLabelsMultiError is an error wrapping multiple validation errors -// returned by ListLabels.ValidateAll() if the designated constraints aren't met. -type ListLabelsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ListLabelsMultiError) 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 ListLabelsMultiError) AllErrors() []error { return m } - -// ListLabelsValidationError is the validation error returned by -// ListLabels.Validate if the designated constraints aren't met. -type ListLabelsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ListLabelsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ListLabelsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ListLabelsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ListLabelsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ListLabelsValidationError) ErrorName() string { return "ListLabelsValidationError" } - -// Error satisfies the builtin error interface -func (e ListLabelsValidationError) 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 %sListLabels.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ListLabelsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ListLabelsValidationError{} - -// Validate checks the field values on Values 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 *Values) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on Values 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 ValuesMultiError, or nil if none found. -func (m *Values) ValidateAll() error { - return m.validate(true) -} - -func (m *Values) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Value - - // no validation rules for MainMetricPercent - - // no validation rules for MainMetricPerSec - - if len(errors) > 0 { - return ValuesMultiError(errors) - } - - return nil -} - -// ValuesMultiError is an error wrapping multiple validation errors returned by -// Values.ValidateAll() if the designated constraints aren't met. -type ValuesMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ValuesMultiError) 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 ValuesMultiError) AllErrors() []error { return m } - -// ValuesValidationError is the validation error returned by Values.Validate if -// the designated constraints aren't met. -type ValuesValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ValuesValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ValuesValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ValuesValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ValuesValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ValuesValidationError) ErrorName() string { return "ValuesValidationError" } - -// Error satisfies the builtin error interface -func (e ValuesValidationError) 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 %sValues.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ValuesValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ValuesValidationError{} diff --git a/api/qan/v1/json/client/pmm_qan_api_client.go b/api/qan/v1/json/client/pmm_qan_api_client.go deleted file mode 100644 index e6d0807cacf..00000000000 --- a/api/qan/v1/json/client/pmm_qan_api_client.go +++ /dev/null @@ -1,112 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package client - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/percona/pmm/api/qan/v1/json/client/qan_service" -) - -// Default PMM QAN API HTTP client. -var Default = NewHTTPClient(nil) - -const ( - // DefaultHost is the default Host - // found in Meta (info) section of spec file - DefaultHost string = "localhost" - // DefaultBasePath is the default BasePath - // found in Meta (info) section of spec file - DefaultBasePath string = "/" -) - -// DefaultSchemes are the default schemes found in Meta (info) section of spec file -var DefaultSchemes = []string{"http", "https"} - -// NewHTTPClient creates a new PMM QAN API HTTP client. -func NewHTTPClient(formats strfmt.Registry) *PMMQANAPI { - return NewHTTPClientWithConfig(formats, nil) -} - -// NewHTTPClientWithConfig creates a new PMM QAN API HTTP client, -// using a customizable transport config. -func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *PMMQANAPI { - // ensure nullable parameters have default - if cfg == nil { - cfg = DefaultTransportConfig() - } - - // create transport and client - transport := httptransport.New(cfg.Host, cfg.BasePath, cfg.Schemes) - return New(transport, formats) -} - -// New creates a new PMM QAN API client -func New(transport runtime.ClientTransport, formats strfmt.Registry) *PMMQANAPI { - // ensure nullable parameters have default - if formats == nil { - formats = strfmt.Default - } - - cli := new(PMMQANAPI) - cli.Transport = transport - cli.QANService = qan_service.New(transport, formats) - return cli -} - -// DefaultTransportConfig creates a TransportConfig with the -// default settings taken from the meta section of the spec file. -func DefaultTransportConfig() *TransportConfig { - return &TransportConfig{ - Host: DefaultHost, - BasePath: DefaultBasePath, - Schemes: DefaultSchemes, - } -} - -// TransportConfig contains the transport related info, -// found in the meta section of the spec file. -type TransportConfig struct { - Host string - BasePath string - Schemes []string -} - -// WithHost overrides the default host, -// provided by the meta section of the spec file. -func (cfg *TransportConfig) WithHost(host string) *TransportConfig { - cfg.Host = host - return cfg -} - -// WithBasePath overrides the default basePath, -// provided by the meta section of the spec file. -func (cfg *TransportConfig) WithBasePath(basePath string) *TransportConfig { - cfg.BasePath = basePath - return cfg -} - -// WithSchemes overrides the default schemes, -// provided by the meta section of the spec file. -func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig { - cfg.Schemes = schemes - return cfg -} - -// PMMQANAPI is a client for PMM QAN API -type PMMQANAPI struct { - QANService qan_service.ClientService - - Transport runtime.ClientTransport -} - -// SetTransport changes the transport on the client and all its subresources -func (c *PMMQANAPI) SetTransport(transport runtime.ClientTransport) { - c.Transport = transport - c.QANService.SetTransport(transport) -} diff --git a/api/qan/v1/json/client/qan_service/explain_fingerprint_by_query_id_parameters.go b/api/qan/v1/json/client/qan_service/explain_fingerprint_by_query_id_parameters.go deleted file mode 100644 index 5b2c7bf438c..00000000000 --- a/api/qan/v1/json/client/qan_service/explain_fingerprint_by_query_id_parameters.go +++ /dev/null @@ -1,147 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package qan_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" -) - -// NewExplainFingerprintByQueryIDParams creates a new ExplainFingerprintByQueryIDParams 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 NewExplainFingerprintByQueryIDParams() *ExplainFingerprintByQueryIDParams { - return &ExplainFingerprintByQueryIDParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewExplainFingerprintByQueryIDParamsWithTimeout creates a new ExplainFingerprintByQueryIDParams object -// with the ability to set a timeout on a request. -func NewExplainFingerprintByQueryIDParamsWithTimeout(timeout time.Duration) *ExplainFingerprintByQueryIDParams { - return &ExplainFingerprintByQueryIDParams{ - timeout: timeout, - } -} - -// NewExplainFingerprintByQueryIDParamsWithContext creates a new ExplainFingerprintByQueryIDParams object -// with the ability to set a context for a request. -func NewExplainFingerprintByQueryIDParamsWithContext(ctx context.Context) *ExplainFingerprintByQueryIDParams { - return &ExplainFingerprintByQueryIDParams{ - Context: ctx, - } -} - -// NewExplainFingerprintByQueryIDParamsWithHTTPClient creates a new ExplainFingerprintByQueryIDParams object -// with the ability to set a custom HTTPClient for a request. -func NewExplainFingerprintByQueryIDParamsWithHTTPClient(client *http.Client) *ExplainFingerprintByQueryIDParams { - return &ExplainFingerprintByQueryIDParams{ - HTTPClient: client, - } -} - -/* -ExplainFingerprintByQueryIDParams contains all the parameters to send to the API endpoint - - for the explain fingerprint by query ID operation. - - Typically these are written to a http.Request. -*/ -type ExplainFingerprintByQueryIDParams struct { - /* Body. - - ExplainFingerprintByQueryIDRequest get explain fingerprint for given query ID. - */ - Body ExplainFingerprintByQueryIDBody - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the explain fingerprint by query ID params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ExplainFingerprintByQueryIDParams) WithDefaults() *ExplainFingerprintByQueryIDParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the explain fingerprint by query ID params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ExplainFingerprintByQueryIDParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the explain fingerprint by query ID params -func (o *ExplainFingerprintByQueryIDParams) WithTimeout(timeout time.Duration) *ExplainFingerprintByQueryIDParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the explain fingerprint by query ID params -func (o *ExplainFingerprintByQueryIDParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the explain fingerprint by query ID params -func (o *ExplainFingerprintByQueryIDParams) WithContext(ctx context.Context) *ExplainFingerprintByQueryIDParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the explain fingerprint by query ID params -func (o *ExplainFingerprintByQueryIDParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the explain fingerprint by query ID params -func (o *ExplainFingerprintByQueryIDParams) WithHTTPClient(client *http.Client) *ExplainFingerprintByQueryIDParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the explain fingerprint by query ID params -func (o *ExplainFingerprintByQueryIDParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the explain fingerprint by query ID params -func (o *ExplainFingerprintByQueryIDParams) WithBody(body ExplainFingerprintByQueryIDBody) *ExplainFingerprintByQueryIDParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the explain fingerprint by query ID params -func (o *ExplainFingerprintByQueryIDParams) SetBody(body ExplainFingerprintByQueryIDBody) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *ExplainFingerprintByQueryIDParams) 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/qan/v1/json/client/qan_service/explain_fingerprint_by_query_id_responses.go b/api/qan/v1/json/client/qan_service/explain_fingerprint_by_query_id_responses.go deleted file mode 100644 index 55cf6802df7..00000000000 --- a/api/qan/v1/json/client/qan_service/explain_fingerprint_by_query_id_responses.go +++ /dev/null @@ -1,496 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package qan_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" -) - -// ExplainFingerprintByQueryIDReader is a Reader for the ExplainFingerprintByQueryID structure. -type ExplainFingerprintByQueryIDReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ExplainFingerprintByQueryIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewExplainFingerprintByQueryIDOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewExplainFingerprintByQueryIDDefault(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 - } -} - -// NewExplainFingerprintByQueryIDOK creates a ExplainFingerprintByQueryIDOK with default headers values -func NewExplainFingerprintByQueryIDOK() *ExplainFingerprintByQueryIDOK { - return &ExplainFingerprintByQueryIDOK{} -} - -/* -ExplainFingerprintByQueryIDOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type ExplainFingerprintByQueryIDOK struct { - Payload *ExplainFingerprintByQueryIDOKBody -} - -// IsSuccess returns true when this explain fingerprint by query Id Ok response has a 2xx status code -func (o *ExplainFingerprintByQueryIDOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this explain fingerprint by query Id Ok response has a 3xx status code -func (o *ExplainFingerprintByQueryIDOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this explain fingerprint by query Id Ok response has a 4xx status code -func (o *ExplainFingerprintByQueryIDOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this explain fingerprint by query Id Ok response has a 5xx status code -func (o *ExplainFingerprintByQueryIDOK) IsServerError() bool { - return false -} - -// IsCode returns true when this explain fingerprint by query Id Ok response a status code equal to that given -func (o *ExplainFingerprintByQueryIDOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the explain fingerprint by query Id Ok response -func (o *ExplainFingerprintByQueryIDOK) Code() int { - return 200 -} - -func (o *ExplainFingerprintByQueryIDOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/qan:explainFingerprint][%d] explainFingerprintByQueryIdOk %s", 200, payload) -} - -func (o *ExplainFingerprintByQueryIDOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/qan:explainFingerprint][%d] explainFingerprintByQueryIdOk %s", 200, payload) -} - -func (o *ExplainFingerprintByQueryIDOK) GetPayload() *ExplainFingerprintByQueryIDOKBody { - return o.Payload -} - -func (o *ExplainFingerprintByQueryIDOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(ExplainFingerprintByQueryIDOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -// NewExplainFingerprintByQueryIDDefault creates a ExplainFingerprintByQueryIDDefault with default headers values -func NewExplainFingerprintByQueryIDDefault(code int) *ExplainFingerprintByQueryIDDefault { - return &ExplainFingerprintByQueryIDDefault{ - _statusCode: code, - } -} - -/* -ExplainFingerprintByQueryIDDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type ExplainFingerprintByQueryIDDefault struct { - _statusCode int - - Payload *ExplainFingerprintByQueryIDDefaultBody -} - -// IsSuccess returns true when this explain fingerprint by query ID default response has a 2xx status code -func (o *ExplainFingerprintByQueryIDDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this explain fingerprint by query ID default response has a 3xx status code -func (o *ExplainFingerprintByQueryIDDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this explain fingerprint by query ID default response has a 4xx status code -func (o *ExplainFingerprintByQueryIDDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this explain fingerprint by query ID default response has a 5xx status code -func (o *ExplainFingerprintByQueryIDDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this explain fingerprint by query ID default response a status code equal to that given -func (o *ExplainFingerprintByQueryIDDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the explain fingerprint by query ID default response -func (o *ExplainFingerprintByQueryIDDefault) Code() int { - return o._statusCode -} - -func (o *ExplainFingerprintByQueryIDDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/qan:explainFingerprint][%d] ExplainFingerprintByQueryID default %s", o._statusCode, payload) -} - -func (o *ExplainFingerprintByQueryIDDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/qan:explainFingerprint][%d] ExplainFingerprintByQueryID default %s", o._statusCode, payload) -} - -func (o *ExplainFingerprintByQueryIDDefault) GetPayload() *ExplainFingerprintByQueryIDDefaultBody { - return o.Payload -} - -func (o *ExplainFingerprintByQueryIDDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(ExplainFingerprintByQueryIDDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -ExplainFingerprintByQueryIDBody ExplainFingerprintByQueryIDRequest get explain fingerprint for given query ID. -swagger:model ExplainFingerprintByQueryIDBody -*/ -type ExplainFingerprintByQueryIDBody struct { - // serviceid - Serviceid string `json:"serviceid,omitempty"` - - // query id - QueryID string `json:"query_id,omitempty"` -} - -// Validate validates this explain fingerprint by query ID body -func (o *ExplainFingerprintByQueryIDBody) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this explain fingerprint by query ID body based on context it is used -func (o *ExplainFingerprintByQueryIDBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ExplainFingerprintByQueryIDBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ExplainFingerprintByQueryIDBody) UnmarshalBinary(b []byte) error { - var res ExplainFingerprintByQueryIDBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ExplainFingerprintByQueryIDDefaultBody explain fingerprint by query ID default body -swagger:model ExplainFingerprintByQueryIDDefaultBody -*/ -type ExplainFingerprintByQueryIDDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*ExplainFingerprintByQueryIDDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this explain fingerprint by query ID default body -func (o *ExplainFingerprintByQueryIDDefaultBody) 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 *ExplainFingerprintByQueryIDDefaultBody) 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("ExplainFingerprintByQueryID default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("ExplainFingerprintByQueryID default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this explain fingerprint by query ID default body based on the context it is used -func (o *ExplainFingerprintByQueryIDDefaultBody) 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 *ExplainFingerprintByQueryIDDefaultBody) 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("ExplainFingerprintByQueryID default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("ExplainFingerprintByQueryID default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ExplainFingerprintByQueryIDDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ExplainFingerprintByQueryIDDefaultBody) UnmarshalBinary(b []byte) error { - var res ExplainFingerprintByQueryIDDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ExplainFingerprintByQueryIDDefaultBodyDetailsItems0 explain fingerprint by query ID default body details items0 -swagger:model ExplainFingerprintByQueryIDDefaultBodyDetailsItems0 -*/ -type ExplainFingerprintByQueryIDDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` - - // explain fingerprint by query ID default body details items0 - ExplainFingerprintByQueryIDDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *ExplainFingerprintByQueryIDDefaultBodyDetailsItems0) 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 ExplainFingerprintByQueryIDDefaultBodyDetailsItems0 - - 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.ExplainFingerprintByQueryIDDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o ExplainFingerprintByQueryIDDefaultBodyDetailsItems0) 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.ExplainFingerprintByQueryIDDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.ExplainFingerprintByQueryIDDefaultBodyDetailsItems0) - 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 explain fingerprint by query ID default body details items0 -func (o *ExplainFingerprintByQueryIDDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this explain fingerprint by query ID default body details items0 based on context it is used -func (o *ExplainFingerprintByQueryIDDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ExplainFingerprintByQueryIDDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ExplainFingerprintByQueryIDDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res ExplainFingerprintByQueryIDDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ExplainFingerprintByQueryIDOKBody ExplainFingerprintByQueryIDResponse is explain fingerprint and placeholders count for given query ID. -swagger:model ExplainFingerprintByQueryIDOKBody -*/ -type ExplainFingerprintByQueryIDOKBody struct { - // explain fingerprint - ExplainFingerprint string `json:"explain_fingerprint,omitempty"` - - // placeholders count - PlaceholdersCount int64 `json:"placeholders_count,omitempty"` -} - -// Validate validates this explain fingerprint by query ID OK body -func (o *ExplainFingerprintByQueryIDOKBody) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this explain fingerprint by query ID OK body based on context it is used -func (o *ExplainFingerprintByQueryIDOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ExplainFingerprintByQueryIDOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ExplainFingerprintByQueryIDOKBody) UnmarshalBinary(b []byte) error { - var res ExplainFingerprintByQueryIDOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/qan/v1/json/client/qan_service/get_filtered_metrics_names_parameters.go b/api/qan/v1/json/client/qan_service/get_filtered_metrics_names_parameters.go deleted file mode 100644 index 7b377ad61a2..00000000000 --- a/api/qan/v1/json/client/qan_service/get_filtered_metrics_names_parameters.go +++ /dev/null @@ -1,147 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package qan_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" -) - -// NewGetFilteredMetricsNamesParams creates a new GetFilteredMetricsNamesParams 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 NewGetFilteredMetricsNamesParams() *GetFilteredMetricsNamesParams { - return &GetFilteredMetricsNamesParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetFilteredMetricsNamesParamsWithTimeout creates a new GetFilteredMetricsNamesParams object -// with the ability to set a timeout on a request. -func NewGetFilteredMetricsNamesParamsWithTimeout(timeout time.Duration) *GetFilteredMetricsNamesParams { - return &GetFilteredMetricsNamesParams{ - timeout: timeout, - } -} - -// NewGetFilteredMetricsNamesParamsWithContext creates a new GetFilteredMetricsNamesParams object -// with the ability to set a context for a request. -func NewGetFilteredMetricsNamesParamsWithContext(ctx context.Context) *GetFilteredMetricsNamesParams { - return &GetFilteredMetricsNamesParams{ - Context: ctx, - } -} - -// NewGetFilteredMetricsNamesParamsWithHTTPClient creates a new GetFilteredMetricsNamesParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetFilteredMetricsNamesParamsWithHTTPClient(client *http.Client) *GetFilteredMetricsNamesParams { - return &GetFilteredMetricsNamesParams{ - HTTPClient: client, - } -} - -/* -GetFilteredMetricsNamesParams contains all the parameters to send to the API endpoint - - for the get filtered metrics names operation. - - Typically these are written to a http.Request. -*/ -type GetFilteredMetricsNamesParams struct { - /* Body. - - GetFilteredMetricsNamesRequest contains period for which we need filters. - */ - Body GetFilteredMetricsNamesBody - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get filtered metrics names params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetFilteredMetricsNamesParams) WithDefaults() *GetFilteredMetricsNamesParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get filtered metrics names params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetFilteredMetricsNamesParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the get filtered metrics names params -func (o *GetFilteredMetricsNamesParams) WithTimeout(timeout time.Duration) *GetFilteredMetricsNamesParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get filtered metrics names params -func (o *GetFilteredMetricsNamesParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get filtered metrics names params -func (o *GetFilteredMetricsNamesParams) WithContext(ctx context.Context) *GetFilteredMetricsNamesParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get filtered metrics names params -func (o *GetFilteredMetricsNamesParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get filtered metrics names params -func (o *GetFilteredMetricsNamesParams) WithHTTPClient(client *http.Client) *GetFilteredMetricsNamesParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get filtered metrics names params -func (o *GetFilteredMetricsNamesParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the get filtered metrics names params -func (o *GetFilteredMetricsNamesParams) WithBody(body GetFilteredMetricsNamesBody) *GetFilteredMetricsNamesParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the get filtered metrics names params -func (o *GetFilteredMetricsNamesParams) SetBody(body GetFilteredMetricsNamesBody) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *GetFilteredMetricsNamesParams) 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/qan/v1/json/client/qan_service/get_filtered_metrics_names_responses.go b/api/qan/v1/json/client/qan_service/get_filtered_metrics_names_responses.go deleted file mode 100644 index 2d3c57609d7..00000000000 --- a/api/qan/v1/json/client/qan_service/get_filtered_metrics_names_responses.go +++ /dev/null @@ -1,863 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package qan_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" -) - -// GetFilteredMetricsNamesReader is a Reader for the GetFilteredMetricsNames structure. -type GetFilteredMetricsNamesReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetFilteredMetricsNamesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewGetFilteredMetricsNamesOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewGetFilteredMetricsNamesDefault(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 - } -} - -// NewGetFilteredMetricsNamesOK creates a GetFilteredMetricsNamesOK with default headers values -func NewGetFilteredMetricsNamesOK() *GetFilteredMetricsNamesOK { - return &GetFilteredMetricsNamesOK{} -} - -/* -GetFilteredMetricsNamesOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type GetFilteredMetricsNamesOK struct { - Payload *GetFilteredMetricsNamesOKBody -} - -// IsSuccess returns true when this get filtered metrics names Ok response has a 2xx status code -func (o *GetFilteredMetricsNamesOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this get filtered metrics names Ok response has a 3xx status code -func (o *GetFilteredMetricsNamesOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this get filtered metrics names Ok response has a 4xx status code -func (o *GetFilteredMetricsNamesOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this get filtered metrics names Ok response has a 5xx status code -func (o *GetFilteredMetricsNamesOK) IsServerError() bool { - return false -} - -// IsCode returns true when this get filtered metrics names Ok response a status code equal to that given -func (o *GetFilteredMetricsNamesOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the get filtered metrics names Ok response -func (o *GetFilteredMetricsNamesOK) Code() int { - return 200 -} - -func (o *GetFilteredMetricsNamesOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/qan/metrics:getFilters][%d] getFilteredMetricsNamesOk %s", 200, payload) -} - -func (o *GetFilteredMetricsNamesOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/qan/metrics:getFilters][%d] getFilteredMetricsNamesOk %s", 200, payload) -} - -func (o *GetFilteredMetricsNamesOK) GetPayload() *GetFilteredMetricsNamesOKBody { - return o.Payload -} - -func (o *GetFilteredMetricsNamesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(GetFilteredMetricsNamesOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -// NewGetFilteredMetricsNamesDefault creates a GetFilteredMetricsNamesDefault with default headers values -func NewGetFilteredMetricsNamesDefault(code int) *GetFilteredMetricsNamesDefault { - return &GetFilteredMetricsNamesDefault{ - _statusCode: code, - } -} - -/* -GetFilteredMetricsNamesDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type GetFilteredMetricsNamesDefault struct { - _statusCode int - - Payload *GetFilteredMetricsNamesDefaultBody -} - -// IsSuccess returns true when this get filtered metrics names default response has a 2xx status code -func (o *GetFilteredMetricsNamesDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this get filtered metrics names default response has a 3xx status code -func (o *GetFilteredMetricsNamesDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this get filtered metrics names default response has a 4xx status code -func (o *GetFilteredMetricsNamesDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this get filtered metrics names default response has a 5xx status code -func (o *GetFilteredMetricsNamesDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this get filtered metrics names default response a status code equal to that given -func (o *GetFilteredMetricsNamesDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the get filtered metrics names default response -func (o *GetFilteredMetricsNamesDefault) Code() int { - return o._statusCode -} - -func (o *GetFilteredMetricsNamesDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/qan/metrics:getFilters][%d] GetFilteredMetricsNames default %s", o._statusCode, payload) -} - -func (o *GetFilteredMetricsNamesDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/qan/metrics:getFilters][%d] GetFilteredMetricsNames default %s", o._statusCode, payload) -} - -func (o *GetFilteredMetricsNamesDefault) GetPayload() *GetFilteredMetricsNamesDefaultBody { - return o.Payload -} - -func (o *GetFilteredMetricsNamesDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(GetFilteredMetricsNamesDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -GetFilteredMetricsNamesBody GetFilteredMetricsNamesRequest contains period for which we need filters. -swagger:model GetFilteredMetricsNamesBody -*/ -type GetFilteredMetricsNamesBody struct { - // period start from - // Format: date-time - PeriodStartFrom strfmt.DateTime `json:"period_start_from,omitempty"` - - // period start to - // Format: date-time - PeriodStartTo strfmt.DateTime `json:"period_start_to,omitempty"` - - // main metric name - MainMetricName string `json:"main_metric_name,omitempty"` - - // labels - Labels []*GetFilteredMetricsNamesParamsBodyLabelsItems0 `json:"labels"` -} - -// Validate validates this get filtered metrics names body -func (o *GetFilteredMetricsNamesBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validatePeriodStartFrom(formats); err != nil { - res = append(res, err) - } - - if err := o.validatePeriodStartTo(formats); err != nil { - res = append(res, err) - } - - if err := o.validateLabels(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetFilteredMetricsNamesBody) validatePeriodStartFrom(formats strfmt.Registry) error { - if swag.IsZero(o.PeriodStartFrom) { // not required - return nil - } - - if err := validate.FormatOf("body"+"."+"period_start_from", "body", "date-time", o.PeriodStartFrom.String(), formats); err != nil { - return err - } - - return nil -} - -func (o *GetFilteredMetricsNamesBody) validatePeriodStartTo(formats strfmt.Registry) error { - if swag.IsZero(o.PeriodStartTo) { // not required - return nil - } - - if err := validate.FormatOf("body"+"."+"period_start_to", "body", "date-time", o.PeriodStartTo.String(), formats); err != nil { - return err - } - - return nil -} - -func (o *GetFilteredMetricsNamesBody) validateLabels(formats strfmt.Registry) error { - if swag.IsZero(o.Labels) { // not required - return nil - } - - for i := 0; i < len(o.Labels); i++ { - if swag.IsZero(o.Labels[i]) { // not required - continue - } - - if o.Labels[i] != nil { - if err := o.Labels[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "labels" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "labels" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this get filtered metrics names body based on the context it is used -func (o *GetFilteredMetricsNamesBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateLabels(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetFilteredMetricsNamesBody) contextValidateLabels(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Labels); i++ { - if o.Labels[i] != nil { - - if swag.IsZero(o.Labels[i]) { // not required - return nil - } - - if err := o.Labels[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "labels" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "labels" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetFilteredMetricsNamesBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetFilteredMetricsNamesBody) UnmarshalBinary(b []byte) error { - var res GetFilteredMetricsNamesBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetFilteredMetricsNamesDefaultBody get filtered metrics names default body -swagger:model GetFilteredMetricsNamesDefaultBody -*/ -type GetFilteredMetricsNamesDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*GetFilteredMetricsNamesDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this get filtered metrics names default body -func (o *GetFilteredMetricsNamesDefaultBody) 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 *GetFilteredMetricsNamesDefaultBody) 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("GetFilteredMetricsNames default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("GetFilteredMetricsNames default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this get filtered metrics names default body based on the context it is used -func (o *GetFilteredMetricsNamesDefaultBody) 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 *GetFilteredMetricsNamesDefaultBody) 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("GetFilteredMetricsNames default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("GetFilteredMetricsNames default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetFilteredMetricsNamesDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetFilteredMetricsNamesDefaultBody) UnmarshalBinary(b []byte) error { - var res GetFilteredMetricsNamesDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetFilteredMetricsNamesDefaultBodyDetailsItems0 get filtered metrics names default body details items0 -swagger:model GetFilteredMetricsNamesDefaultBodyDetailsItems0 -*/ -type GetFilteredMetricsNamesDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` - - // get filtered metrics names default body details items0 - GetFilteredMetricsNamesDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *GetFilteredMetricsNamesDefaultBodyDetailsItems0) 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 GetFilteredMetricsNamesDefaultBodyDetailsItems0 - - 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.GetFilteredMetricsNamesDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o GetFilteredMetricsNamesDefaultBodyDetailsItems0) 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.GetFilteredMetricsNamesDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.GetFilteredMetricsNamesDefaultBodyDetailsItems0) - 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 get filtered metrics names default body details items0 -func (o *GetFilteredMetricsNamesDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get filtered metrics names default body details items0 based on context it is used -func (o *GetFilteredMetricsNamesDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetFilteredMetricsNamesDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetFilteredMetricsNamesDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res GetFilteredMetricsNamesDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetFilteredMetricsNamesOKBody GetFilteredMetricsNamesResponse is map of labels for given period by key. -// Key is label's name and value is label's value and how many times it occur. -swagger:model GetFilteredMetricsNamesOKBody -*/ -type GetFilteredMetricsNamesOKBody struct { - // labels - Labels map[string]GetFilteredMetricsNamesOKBodyLabelsAnon `json:"labels,omitempty"` -} - -// Validate validates this get filtered metrics names OK body -func (o *GetFilteredMetricsNamesOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateLabels(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetFilteredMetricsNamesOKBody) validateLabels(formats strfmt.Registry) error { - if swag.IsZero(o.Labels) { // not required - return nil - } - - for k := range o.Labels { - - if swag.IsZero(o.Labels[k]) { // not required - continue - } - if val, ok := o.Labels[k]; ok { - if err := val.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getFilteredMetricsNamesOk" + "." + "labels" + "." + k) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getFilteredMetricsNamesOk" + "." + "labels" + "." + k) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this get filtered metrics names OK body based on the context it is used -func (o *GetFilteredMetricsNamesOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateLabels(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetFilteredMetricsNamesOKBody) contextValidateLabels(ctx context.Context, formats strfmt.Registry) error { - for k := range o.Labels { - if val, ok := o.Labels[k]; ok { - if err := val.ContextValidate(ctx, formats); err != nil { - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetFilteredMetricsNamesOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetFilteredMetricsNamesOKBody) UnmarshalBinary(b []byte) error { - var res GetFilteredMetricsNamesOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetFilteredMetricsNamesOKBodyLabelsAnon ListLabels is list of label's values: duplicates are impossible. -swagger:model GetFilteredMetricsNamesOKBodyLabelsAnon -*/ -type GetFilteredMetricsNamesOKBodyLabelsAnon struct { - // name - Name []*GetFilteredMetricsNamesOKBodyLabelsAnonNameItems0 `json:"name"` -} - -// Validate validates this get filtered metrics names OK body labels anon -func (o *GetFilteredMetricsNamesOKBodyLabelsAnon) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateName(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetFilteredMetricsNamesOKBodyLabelsAnon) validateName(formats strfmt.Registry) error { - if swag.IsZero(o.Name) { // not required - return nil - } - - for i := 0; i < len(o.Name); i++ { - if swag.IsZero(o.Name[i]) { // not required - continue - } - - if o.Name[i] != nil { - if err := o.Name[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("name" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("name" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this get filtered metrics names OK body labels anon based on the context it is used -func (o *GetFilteredMetricsNamesOKBodyLabelsAnon) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateName(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetFilteredMetricsNamesOKBodyLabelsAnon) contextValidateName(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Name); i++ { - if o.Name[i] != nil { - - if swag.IsZero(o.Name[i]) { // not required - return nil - } - - if err := o.Name[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("name" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("name" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetFilteredMetricsNamesOKBodyLabelsAnon) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetFilteredMetricsNamesOKBodyLabelsAnon) UnmarshalBinary(b []byte) error { - var res GetFilteredMetricsNamesOKBodyLabelsAnon - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetFilteredMetricsNamesOKBodyLabelsAnonNameItems0 Values is label values and main metric percent and per second. -swagger:model GetFilteredMetricsNamesOKBodyLabelsAnonNameItems0 -*/ -type GetFilteredMetricsNamesOKBodyLabelsAnonNameItems0 struct { - // value - Value string `json:"value,omitempty"` - - // main metric percent - MainMetricPercent float32 `json:"main_metric_percent,omitempty"` - - // main metric per sec - MainMetricPerSec float32 `json:"main_metric_per_sec,omitempty"` -} - -// Validate validates this get filtered metrics names OK body labels anon name items0 -func (o *GetFilteredMetricsNamesOKBodyLabelsAnonNameItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get filtered metrics names OK body labels anon name items0 based on context it is used -func (o *GetFilteredMetricsNamesOKBodyLabelsAnonNameItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetFilteredMetricsNamesOKBodyLabelsAnonNameItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetFilteredMetricsNamesOKBodyLabelsAnonNameItems0) UnmarshalBinary(b []byte) error { - var res GetFilteredMetricsNamesOKBodyLabelsAnonNameItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetFilteredMetricsNamesParamsBodyLabelsItems0 MapFieldEntry allows to pass labels/dimensions in form like {"server": ["db1", "db2"...]}. -swagger:model GetFilteredMetricsNamesParamsBodyLabelsItems0 -*/ -type GetFilteredMetricsNamesParamsBodyLabelsItems0 struct { - // key - Key string `json:"key,omitempty"` - - // value - Value []string `json:"value"` -} - -// Validate validates this get filtered metrics names params body labels items0 -func (o *GetFilteredMetricsNamesParamsBodyLabelsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get filtered metrics names params body labels items0 based on context it is used -func (o *GetFilteredMetricsNamesParamsBodyLabelsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetFilteredMetricsNamesParamsBodyLabelsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetFilteredMetricsNamesParamsBodyLabelsItems0) UnmarshalBinary(b []byte) error { - var res GetFilteredMetricsNamesParamsBodyLabelsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/qan/v1/json/client/qan_service/get_histogram_parameters.go b/api/qan/v1/json/client/qan_service/get_histogram_parameters.go deleted file mode 100644 index 273d1c7ba35..00000000000 --- a/api/qan/v1/json/client/qan_service/get_histogram_parameters.go +++ /dev/null @@ -1,147 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package qan_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" -) - -// NewGetHistogramParams creates a new GetHistogramParams 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 NewGetHistogramParams() *GetHistogramParams { - return &GetHistogramParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetHistogramParamsWithTimeout creates a new GetHistogramParams object -// with the ability to set a timeout on a request. -func NewGetHistogramParamsWithTimeout(timeout time.Duration) *GetHistogramParams { - return &GetHistogramParams{ - timeout: timeout, - } -} - -// NewGetHistogramParamsWithContext creates a new GetHistogramParams object -// with the ability to set a context for a request. -func NewGetHistogramParamsWithContext(ctx context.Context) *GetHistogramParams { - return &GetHistogramParams{ - Context: ctx, - } -} - -// NewGetHistogramParamsWithHTTPClient creates a new GetHistogramParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetHistogramParamsWithHTTPClient(client *http.Client) *GetHistogramParams { - return &GetHistogramParams{ - HTTPClient: client, - } -} - -/* -GetHistogramParams contains all the parameters to send to the API endpoint - - for the get histogram operation. - - Typically these are written to a http.Request. -*/ -type GetHistogramParams struct { - /* Body. - - GetHistogramRequest defines filtering by time range, labels and queryid. - */ - Body GetHistogramBody - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get histogram params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetHistogramParams) WithDefaults() *GetHistogramParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get histogram params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetHistogramParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the get histogram params -func (o *GetHistogramParams) WithTimeout(timeout time.Duration) *GetHistogramParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get histogram params -func (o *GetHistogramParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get histogram params -func (o *GetHistogramParams) WithContext(ctx context.Context) *GetHistogramParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get histogram params -func (o *GetHistogramParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get histogram params -func (o *GetHistogramParams) WithHTTPClient(client *http.Client) *GetHistogramParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get histogram params -func (o *GetHistogramParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the get histogram params -func (o *GetHistogramParams) WithBody(body GetHistogramBody) *GetHistogramParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the get histogram params -func (o *GetHistogramParams) SetBody(body GetHistogramBody) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *GetHistogramParams) 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/qan/v1/json/client/qan_service/get_histogram_responses.go b/api/qan/v1/json/client/qan_service/get_histogram_responses.go deleted file mode 100644 index 6bb68146f35..00000000000 --- a/api/qan/v1/json/client/qan_service/get_histogram_responses.go +++ /dev/null @@ -1,762 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package qan_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" -) - -// GetHistogramReader is a Reader for the GetHistogram structure. -type GetHistogramReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetHistogramReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewGetHistogramOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewGetHistogramDefault(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 - } -} - -// NewGetHistogramOK creates a GetHistogramOK with default headers values -func NewGetHistogramOK() *GetHistogramOK { - return &GetHistogramOK{} -} - -/* -GetHistogramOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type GetHistogramOK struct { - Payload *GetHistogramOKBody -} - -// IsSuccess returns true when this get histogram Ok response has a 2xx status code -func (o *GetHistogramOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this get histogram Ok response has a 3xx status code -func (o *GetHistogramOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this get histogram Ok response has a 4xx status code -func (o *GetHistogramOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this get histogram Ok response has a 5xx status code -func (o *GetHistogramOK) IsServerError() bool { - return false -} - -// IsCode returns true when this get histogram Ok response a status code equal to that given -func (o *GetHistogramOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the get histogram Ok response -func (o *GetHistogramOK) Code() int { - return 200 -} - -func (o *GetHistogramOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/qan:getHistogram][%d] getHistogramOk %s", 200, payload) -} - -func (o *GetHistogramOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/qan:getHistogram][%d] getHistogramOk %s", 200, payload) -} - -func (o *GetHistogramOK) GetPayload() *GetHistogramOKBody { - return o.Payload -} - -func (o *GetHistogramOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(GetHistogramOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -// NewGetHistogramDefault creates a GetHistogramDefault with default headers values -func NewGetHistogramDefault(code int) *GetHistogramDefault { - return &GetHistogramDefault{ - _statusCode: code, - } -} - -/* -GetHistogramDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type GetHistogramDefault struct { - _statusCode int - - Payload *GetHistogramDefaultBody -} - -// IsSuccess returns true when this get histogram default response has a 2xx status code -func (o *GetHistogramDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this get histogram default response has a 3xx status code -func (o *GetHistogramDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this get histogram default response has a 4xx status code -func (o *GetHistogramDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this get histogram default response has a 5xx status code -func (o *GetHistogramDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this get histogram default response a status code equal to that given -func (o *GetHistogramDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the get histogram default response -func (o *GetHistogramDefault) Code() int { - return o._statusCode -} - -func (o *GetHistogramDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/qan:getHistogram][%d] GetHistogram default %s", o._statusCode, payload) -} - -func (o *GetHistogramDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/qan:getHistogram][%d] GetHistogram default %s", o._statusCode, payload) -} - -func (o *GetHistogramDefault) GetPayload() *GetHistogramDefaultBody { - return o.Payload -} - -func (o *GetHistogramDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(GetHistogramDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -GetHistogramBody GetHistogramRequest defines filtering by time range, labels and queryid. -swagger:model GetHistogramBody -*/ -type GetHistogramBody struct { - // period start from - // Format: date-time - PeriodStartFrom strfmt.DateTime `json:"period_start_from,omitempty"` - - // period start to - // Format: date-time - PeriodStartTo strfmt.DateTime `json:"period_start_to,omitempty"` - - // labels - Labels []*GetHistogramParamsBodyLabelsItems0 `json:"labels"` - - // queryid - Queryid string `json:"queryid,omitempty"` -} - -// Validate validates this get histogram body -func (o *GetHistogramBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validatePeriodStartFrom(formats); err != nil { - res = append(res, err) - } - - if err := o.validatePeriodStartTo(formats); err != nil { - res = append(res, err) - } - - if err := o.validateLabels(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetHistogramBody) validatePeriodStartFrom(formats strfmt.Registry) error { - if swag.IsZero(o.PeriodStartFrom) { // not required - return nil - } - - if err := validate.FormatOf("body"+"."+"period_start_from", "body", "date-time", o.PeriodStartFrom.String(), formats); err != nil { - return err - } - - return nil -} - -func (o *GetHistogramBody) validatePeriodStartTo(formats strfmt.Registry) error { - if swag.IsZero(o.PeriodStartTo) { // not required - return nil - } - - if err := validate.FormatOf("body"+"."+"period_start_to", "body", "date-time", o.PeriodStartTo.String(), formats); err != nil { - return err - } - - return nil -} - -func (o *GetHistogramBody) validateLabels(formats strfmt.Registry) error { - if swag.IsZero(o.Labels) { // not required - return nil - } - - for i := 0; i < len(o.Labels); i++ { - if swag.IsZero(o.Labels[i]) { // not required - continue - } - - if o.Labels[i] != nil { - if err := o.Labels[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "labels" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "labels" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this get histogram body based on the context it is used -func (o *GetHistogramBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateLabels(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetHistogramBody) contextValidateLabels(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Labels); i++ { - if o.Labels[i] != nil { - - if swag.IsZero(o.Labels[i]) { // not required - return nil - } - - if err := o.Labels[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "labels" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "labels" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetHistogramBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetHistogramBody) UnmarshalBinary(b []byte) error { - var res GetHistogramBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetHistogramDefaultBody get histogram default body -swagger:model GetHistogramDefaultBody -*/ -type GetHistogramDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*GetHistogramDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this get histogram default body -func (o *GetHistogramDefaultBody) 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 *GetHistogramDefaultBody) 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("GetHistogram default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("GetHistogram default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this get histogram default body based on the context it is used -func (o *GetHistogramDefaultBody) 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 *GetHistogramDefaultBody) 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("GetHistogram default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("GetHistogram default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetHistogramDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetHistogramDefaultBody) UnmarshalBinary(b []byte) error { - var res GetHistogramDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetHistogramDefaultBodyDetailsItems0 get histogram default body details items0 -swagger:model GetHistogramDefaultBodyDetailsItems0 -*/ -type GetHistogramDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` - - // get histogram default body details items0 - GetHistogramDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *GetHistogramDefaultBodyDetailsItems0) 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 GetHistogramDefaultBodyDetailsItems0 - - 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.GetHistogramDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o GetHistogramDefaultBodyDetailsItems0) 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.GetHistogramDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.GetHistogramDefaultBodyDetailsItems0) - 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 get histogram default body details items0 -func (o *GetHistogramDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get histogram default body details items0 based on context it is used -func (o *GetHistogramDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetHistogramDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetHistogramDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res GetHistogramDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetHistogramOKBody GetHistogramResponse is histogram items as a list. -swagger:model GetHistogramOKBody -*/ -type GetHistogramOKBody struct { - // histogram items - HistogramItems []*GetHistogramOKBodyHistogramItemsItems0 `json:"histogram_items"` -} - -// Validate validates this get histogram OK body -func (o *GetHistogramOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateHistogramItems(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetHistogramOKBody) validateHistogramItems(formats strfmt.Registry) error { - if swag.IsZero(o.HistogramItems) { // not required - return nil - } - - for i := 0; i < len(o.HistogramItems); i++ { - if swag.IsZero(o.HistogramItems[i]) { // not required - continue - } - - if o.HistogramItems[i] != nil { - if err := o.HistogramItems[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getHistogramOk" + "." + "histogram_items" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getHistogramOk" + "." + "histogram_items" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this get histogram OK body based on the context it is used -func (o *GetHistogramOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateHistogramItems(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetHistogramOKBody) contextValidateHistogramItems(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.HistogramItems); i++ { - if o.HistogramItems[i] != nil { - - if swag.IsZero(o.HistogramItems[i]) { // not required - return nil - } - - if err := o.HistogramItems[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getHistogramOk" + "." + "histogram_items" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getHistogramOk" + "." + "histogram_items" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetHistogramOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetHistogramOKBody) UnmarshalBinary(b []byte) error { - var res GetHistogramOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetHistogramOKBodyHistogramItemsItems0 HistogramItem represents one item in histogram. -swagger:model GetHistogramOKBodyHistogramItemsItems0 -*/ -type GetHistogramOKBodyHistogramItemsItems0 struct { - // range - Range string `json:"range,omitempty"` - - // frequency - Frequency int64 `json:"frequency,omitempty"` -} - -// Validate validates this get histogram OK body histogram items items0 -func (o *GetHistogramOKBodyHistogramItemsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get histogram OK body histogram items items0 based on context it is used -func (o *GetHistogramOKBodyHistogramItemsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetHistogramOKBodyHistogramItemsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetHistogramOKBodyHistogramItemsItems0) UnmarshalBinary(b []byte) error { - var res GetHistogramOKBodyHistogramItemsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetHistogramParamsBodyLabelsItems0 MapFieldEntry allows to pass labels/dimensions in form like {"server": ["db1", "db2"...]}. -swagger:model GetHistogramParamsBodyLabelsItems0 -*/ -type GetHistogramParamsBodyLabelsItems0 struct { - // key - Key string `json:"key,omitempty"` - - // value - Value []string `json:"value"` -} - -// Validate validates this get histogram params body labels items0 -func (o *GetHistogramParamsBodyLabelsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get histogram params body labels items0 based on context it is used -func (o *GetHistogramParamsBodyLabelsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetHistogramParamsBodyLabelsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetHistogramParamsBodyLabelsItems0) UnmarshalBinary(b []byte) error { - var res GetHistogramParamsBodyLabelsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/qan/v1/json/client/qan_service/get_labels_parameters.go b/api/qan/v1/json/client/qan_service/get_labels_parameters.go deleted file mode 100644 index ebf388c1281..00000000000 --- a/api/qan/v1/json/client/qan_service/get_labels_parameters.go +++ /dev/null @@ -1,148 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package qan_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" -) - -// NewGetLabelsParams creates a new GetLabelsParams 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 NewGetLabelsParams() *GetLabelsParams { - return &GetLabelsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetLabelsParamsWithTimeout creates a new GetLabelsParams object -// with the ability to set a timeout on a request. -func NewGetLabelsParamsWithTimeout(timeout time.Duration) *GetLabelsParams { - return &GetLabelsParams{ - timeout: timeout, - } -} - -// NewGetLabelsParamsWithContext creates a new GetLabelsParams object -// with the ability to set a context for a request. -func NewGetLabelsParamsWithContext(ctx context.Context) *GetLabelsParams { - return &GetLabelsParams{ - Context: ctx, - } -} - -// NewGetLabelsParamsWithHTTPClient creates a new GetLabelsParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetLabelsParamsWithHTTPClient(client *http.Client) *GetLabelsParams { - return &GetLabelsParams{ - HTTPClient: client, - } -} - -/* -GetLabelsParams contains all the parameters to send to the API endpoint - - for the get labels operation. - - Typically these are written to a http.Request. -*/ -type GetLabelsParams struct { - /* Body. - - GetLabelsRequest defines filtering of object detail's labels for specific value of - dimension (ex.: host=hostname1 or queryid=1D410B4BE5060972. - */ - Body GetLabelsBody - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get labels params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetLabelsParams) WithDefaults() *GetLabelsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get labels params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetLabelsParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the get labels params -func (o *GetLabelsParams) WithTimeout(timeout time.Duration) *GetLabelsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get labels params -func (o *GetLabelsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get labels params -func (o *GetLabelsParams) WithContext(ctx context.Context) *GetLabelsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get labels params -func (o *GetLabelsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get labels params -func (o *GetLabelsParams) WithHTTPClient(client *http.Client) *GetLabelsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get labels params -func (o *GetLabelsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the get labels params -func (o *GetLabelsParams) WithBody(body GetLabelsBody) *GetLabelsParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the get labels params -func (o *GetLabelsParams) SetBody(body GetLabelsBody) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *GetLabelsParams) 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/qan/v1/json/client/qan_service/get_labels_responses.go b/api/qan/v1/json/client/qan_service/get_labels_responses.go deleted file mode 100644 index 7425ccfc09c..00000000000 --- a/api/qan/v1/json/client/qan_service/get_labels_responses.go +++ /dev/null @@ -1,637 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package qan_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" -) - -// GetLabelsReader is a Reader for the GetLabels structure. -type GetLabelsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetLabelsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewGetLabelsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewGetLabelsDefault(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 - } -} - -// NewGetLabelsOK creates a GetLabelsOK with default headers values -func NewGetLabelsOK() *GetLabelsOK { - return &GetLabelsOK{} -} - -/* -GetLabelsOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type GetLabelsOK struct { - Payload *GetLabelsOKBody -} - -// IsSuccess returns true when this get labels Ok response has a 2xx status code -func (o *GetLabelsOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this get labels Ok response has a 3xx status code -func (o *GetLabelsOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this get labels Ok response has a 4xx status code -func (o *GetLabelsOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this get labels Ok response has a 5xx status code -func (o *GetLabelsOK) IsServerError() bool { - return false -} - -// IsCode returns true when this get labels Ok response a status code equal to that given -func (o *GetLabelsOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the get labels Ok response -func (o *GetLabelsOK) Code() int { - return 200 -} - -func (o *GetLabelsOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/qan:getLabels][%d] getLabelsOk %s", 200, payload) -} - -func (o *GetLabelsOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/qan:getLabels][%d] getLabelsOk %s", 200, payload) -} - -func (o *GetLabelsOK) GetPayload() *GetLabelsOKBody { - return o.Payload -} - -func (o *GetLabelsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(GetLabelsOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -// NewGetLabelsDefault creates a GetLabelsDefault with default headers values -func NewGetLabelsDefault(code int) *GetLabelsDefault { - return &GetLabelsDefault{ - _statusCode: code, - } -} - -/* -GetLabelsDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type GetLabelsDefault struct { - _statusCode int - - Payload *GetLabelsDefaultBody -} - -// IsSuccess returns true when this get labels default response has a 2xx status code -func (o *GetLabelsDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this get labels default response has a 3xx status code -func (o *GetLabelsDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this get labels default response has a 4xx status code -func (o *GetLabelsDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this get labels default response has a 5xx status code -func (o *GetLabelsDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this get labels default response a status code equal to that given -func (o *GetLabelsDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the get labels default response -func (o *GetLabelsDefault) Code() int { - return o._statusCode -} - -func (o *GetLabelsDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/qan:getLabels][%d] GetLabels default %s", o._statusCode, payload) -} - -func (o *GetLabelsDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/qan:getLabels][%d] GetLabels default %s", o._statusCode, payload) -} - -func (o *GetLabelsDefault) GetPayload() *GetLabelsDefaultBody { - return o.Payload -} - -func (o *GetLabelsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(GetLabelsDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -GetLabelsBody GetLabelsRequest defines filtering of object detail's labels for specific value of -// dimension (ex.: host=hostname1 or queryid=1D410B4BE5060972. -swagger:model GetLabelsBody -*/ -type GetLabelsBody struct { - // period start from - // Format: date-time - PeriodStartFrom strfmt.DateTime `json:"period_start_from,omitempty"` - - // period start to - // Format: date-time - PeriodStartTo strfmt.DateTime `json:"period_start_to,omitempty"` - - // dimension value: ex: queryid - 1D410B4BE5060972. - FilterBy string `json:"filter_by,omitempty"` - - // one of dimension: queryid | host ... - GroupBy string `json:"group_by,omitempty"` -} - -// Validate validates this get labels body -func (o *GetLabelsBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validatePeriodStartFrom(formats); err != nil { - res = append(res, err) - } - - if err := o.validatePeriodStartTo(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetLabelsBody) validatePeriodStartFrom(formats strfmt.Registry) error { - if swag.IsZero(o.PeriodStartFrom) { // not required - return nil - } - - if err := validate.FormatOf("body"+"."+"period_start_from", "body", "date-time", o.PeriodStartFrom.String(), formats); err != nil { - return err - } - - return nil -} - -func (o *GetLabelsBody) validatePeriodStartTo(formats strfmt.Registry) error { - if swag.IsZero(o.PeriodStartTo) { // not required - return nil - } - - if err := validate.FormatOf("body"+"."+"period_start_to", "body", "date-time", o.PeriodStartTo.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this get labels body based on context it is used -func (o *GetLabelsBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetLabelsBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetLabelsBody) UnmarshalBinary(b []byte) error { - var res GetLabelsBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetLabelsDefaultBody get labels default body -swagger:model GetLabelsDefaultBody -*/ -type GetLabelsDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*GetLabelsDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this get labels default body -func (o *GetLabelsDefaultBody) 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 *GetLabelsDefaultBody) 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("GetLabels default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("GetLabels default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this get labels default body based on the context it is used -func (o *GetLabelsDefaultBody) 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 *GetLabelsDefaultBody) 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("GetLabels default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("GetLabels default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetLabelsDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetLabelsDefaultBody) UnmarshalBinary(b []byte) error { - var res GetLabelsDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetLabelsDefaultBodyDetailsItems0 get labels default body details items0 -swagger:model GetLabelsDefaultBodyDetailsItems0 -*/ -type GetLabelsDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` - - // get labels default body details items0 - GetLabelsDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *GetLabelsDefaultBodyDetailsItems0) 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 GetLabelsDefaultBodyDetailsItems0 - - 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.GetLabelsDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o GetLabelsDefaultBodyDetailsItems0) 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.GetLabelsDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.GetLabelsDefaultBodyDetailsItems0) - 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 get labels default body details items0 -func (o *GetLabelsDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get labels default body details items0 based on context it is used -func (o *GetLabelsDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetLabelsDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetLabelsDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res GetLabelsDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetLabelsOKBody GetLabelsResponse is a map of labels names as keys and labels values as a list. -swagger:model GetLabelsOKBody -*/ -type GetLabelsOKBody struct { - // labels - Labels map[string]GetLabelsOKBodyLabelsAnon `json:"labels,omitempty"` -} - -// Validate validates this get labels OK body -func (o *GetLabelsOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateLabels(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetLabelsOKBody) validateLabels(formats strfmt.Registry) error { - if swag.IsZero(o.Labels) { // not required - return nil - } - - for k := range o.Labels { - - if swag.IsZero(o.Labels[k]) { // not required - continue - } - if val, ok := o.Labels[k]; ok { - if err := val.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getLabelsOk" + "." + "labels" + "." + k) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getLabelsOk" + "." + "labels" + "." + k) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this get labels OK body based on the context it is used -func (o *GetLabelsOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateLabels(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetLabelsOKBody) contextValidateLabels(ctx context.Context, formats strfmt.Registry) error { - for k := range o.Labels { - if val, ok := o.Labels[k]; ok { - if err := val.ContextValidate(ctx, formats); err != nil { - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetLabelsOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetLabelsOKBody) UnmarshalBinary(b []byte) error { - var res GetLabelsOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetLabelsOKBodyLabelsAnon ListLabelValues is list of label's values. -swagger:model GetLabelsOKBodyLabelsAnon -*/ -type GetLabelsOKBodyLabelsAnon struct { - // values - Values []string `json:"values"` -} - -// Validate validates this get labels OK body labels anon -func (o *GetLabelsOKBodyLabelsAnon) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get labels OK body labels anon based on context it is used -func (o *GetLabelsOKBodyLabelsAnon) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetLabelsOKBodyLabelsAnon) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetLabelsOKBodyLabelsAnon) UnmarshalBinary(b []byte) error { - var res GetLabelsOKBodyLabelsAnon - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/qan/v1/json/client/qan_service/get_metrics_names_parameters.go b/api/qan/v1/json/client/qan_service/get_metrics_names_parameters.go deleted file mode 100644 index eda3e3369e0..00000000000 --- a/api/qan/v1/json/client/qan_service/get_metrics_names_parameters.go +++ /dev/null @@ -1,149 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package qan_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" -) - -// NewGetMetricsNamesParams creates a new GetMetricsNamesParams 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 NewGetMetricsNamesParams() *GetMetricsNamesParams { - return &GetMetricsNamesParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetMetricsNamesParamsWithTimeout creates a new GetMetricsNamesParams object -// with the ability to set a timeout on a request. -func NewGetMetricsNamesParamsWithTimeout(timeout time.Duration) *GetMetricsNamesParams { - return &GetMetricsNamesParams{ - timeout: timeout, - } -} - -// NewGetMetricsNamesParamsWithContext creates a new GetMetricsNamesParams object -// with the ability to set a context for a request. -func NewGetMetricsNamesParamsWithContext(ctx context.Context) *GetMetricsNamesParams { - return &GetMetricsNamesParams{ - Context: ctx, - } -} - -// NewGetMetricsNamesParamsWithHTTPClient creates a new GetMetricsNamesParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetMetricsNamesParamsWithHTTPClient(client *http.Client) *GetMetricsNamesParams { - return &GetMetricsNamesParams{ - HTTPClient: client, - } -} - -/* -GetMetricsNamesParams contains all the parameters to send to the API endpoint - - for the get metrics names operation. - - Typically these are written to a http.Request. -*/ -type GetMetricsNamesParams struct { - /* Body. - - MetricsNamesRequest is empty. - */ - Body any - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get metrics names params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetMetricsNamesParams) WithDefaults() *GetMetricsNamesParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get metrics names params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetMetricsNamesParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the get metrics names params -func (o *GetMetricsNamesParams) WithTimeout(timeout time.Duration) *GetMetricsNamesParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get metrics names params -func (o *GetMetricsNamesParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get metrics names params -func (o *GetMetricsNamesParams) WithContext(ctx context.Context) *GetMetricsNamesParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get metrics names params -func (o *GetMetricsNamesParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get metrics names params -func (o *GetMetricsNamesParams) WithHTTPClient(client *http.Client) *GetMetricsNamesParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get metrics names params -func (o *GetMetricsNamesParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the get metrics names params -func (o *GetMetricsNamesParams) WithBody(body any) *GetMetricsNamesParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the get metrics names params -func (o *GetMetricsNamesParams) SetBody(body any) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *GetMetricsNamesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/api/qan/v1/json/client/qan_service/get_metrics_names_responses.go b/api/qan/v1/json/client/qan_service/get_metrics_names_responses.go deleted file mode 100644 index e59b8c2e83c..00000000000 --- a/api/qan/v1/json/client/qan_service/get_metrics_names_responses.go +++ /dev/null @@ -1,455 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package qan_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" -) - -// GetMetricsNamesReader is a Reader for the GetMetricsNames structure. -type GetMetricsNamesReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetMetricsNamesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewGetMetricsNamesOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewGetMetricsNamesDefault(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 - } -} - -// NewGetMetricsNamesOK creates a GetMetricsNamesOK with default headers values -func NewGetMetricsNamesOK() *GetMetricsNamesOK { - return &GetMetricsNamesOK{} -} - -/* -GetMetricsNamesOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type GetMetricsNamesOK struct { - Payload *GetMetricsNamesOKBody -} - -// IsSuccess returns true when this get metrics names Ok response has a 2xx status code -func (o *GetMetricsNamesOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this get metrics names Ok response has a 3xx status code -func (o *GetMetricsNamesOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this get metrics names Ok response has a 4xx status code -func (o *GetMetricsNamesOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this get metrics names Ok response has a 5xx status code -func (o *GetMetricsNamesOK) IsServerError() bool { - return false -} - -// IsCode returns true when this get metrics names Ok response a status code equal to that given -func (o *GetMetricsNamesOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the get metrics names Ok response -func (o *GetMetricsNamesOK) Code() int { - return 200 -} - -func (o *GetMetricsNamesOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/qan/metrics:getNames][%d] getMetricsNamesOk %s", 200, payload) -} - -func (o *GetMetricsNamesOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/qan/metrics:getNames][%d] getMetricsNamesOk %s", 200, payload) -} - -func (o *GetMetricsNamesOK) GetPayload() *GetMetricsNamesOKBody { - return o.Payload -} - -func (o *GetMetricsNamesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(GetMetricsNamesOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -// NewGetMetricsNamesDefault creates a GetMetricsNamesDefault with default headers values -func NewGetMetricsNamesDefault(code int) *GetMetricsNamesDefault { - return &GetMetricsNamesDefault{ - _statusCode: code, - } -} - -/* -GetMetricsNamesDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type GetMetricsNamesDefault struct { - _statusCode int - - Payload *GetMetricsNamesDefaultBody -} - -// IsSuccess returns true when this get metrics names default response has a 2xx status code -func (o *GetMetricsNamesDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this get metrics names default response has a 3xx status code -func (o *GetMetricsNamesDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this get metrics names default response has a 4xx status code -func (o *GetMetricsNamesDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this get metrics names default response has a 5xx status code -func (o *GetMetricsNamesDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this get metrics names default response a status code equal to that given -func (o *GetMetricsNamesDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the get metrics names default response -func (o *GetMetricsNamesDefault) Code() int { - return o._statusCode -} - -func (o *GetMetricsNamesDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/qan/metrics:getNames][%d] GetMetricsNames default %s", o._statusCode, payload) -} - -func (o *GetMetricsNamesDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/qan/metrics:getNames][%d] GetMetricsNames default %s", o._statusCode, payload) -} - -func (o *GetMetricsNamesDefault) GetPayload() *GetMetricsNamesDefaultBody { - return o.Payload -} - -func (o *GetMetricsNamesDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(GetMetricsNamesDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -GetMetricsNamesDefaultBody get metrics names default body -swagger:model GetMetricsNamesDefaultBody -*/ -type GetMetricsNamesDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*GetMetricsNamesDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this get metrics names default body -func (o *GetMetricsNamesDefaultBody) 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 *GetMetricsNamesDefaultBody) 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("GetMetricsNames default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("GetMetricsNames default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this get metrics names default body based on the context it is used -func (o *GetMetricsNamesDefaultBody) 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 *GetMetricsNamesDefaultBody) 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("GetMetricsNames default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("GetMetricsNames default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetMetricsNamesDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetMetricsNamesDefaultBody) UnmarshalBinary(b []byte) error { - var res GetMetricsNamesDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetMetricsNamesDefaultBodyDetailsItems0 get metrics names default body details items0 -swagger:model GetMetricsNamesDefaultBodyDetailsItems0 -*/ -type GetMetricsNamesDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` - - // get metrics names default body details items0 - GetMetricsNamesDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *GetMetricsNamesDefaultBodyDetailsItems0) 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 GetMetricsNamesDefaultBodyDetailsItems0 - - 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.GetMetricsNamesDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o GetMetricsNamesDefaultBodyDetailsItems0) 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.GetMetricsNamesDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.GetMetricsNamesDefaultBodyDetailsItems0) - 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 get metrics names default body details items0 -func (o *GetMetricsNamesDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get metrics names default body details items0 based on context it is used -func (o *GetMetricsNamesDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetMetricsNamesDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetMetricsNamesDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res GetMetricsNamesDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetMetricsNamesOKBody MetricsNamesReply is map of stored metrics: -// key is root of metric name in db (Ex:. [m_]query_time[_sum]); -// value - Human readable name of metrics. -swagger:model GetMetricsNamesOKBody -*/ -type GetMetricsNamesOKBody struct { - // data - Data map[string]string `json:"data,omitempty"` -} - -// Validate validates this get metrics names OK body -func (o *GetMetricsNamesOKBody) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get metrics names OK body based on context it is used -func (o *GetMetricsNamesOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetMetricsNamesOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetMetricsNamesOKBody) UnmarshalBinary(b []byte) error { - var res GetMetricsNamesOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/qan/v1/json/client/qan_service/get_metrics_parameters.go b/api/qan/v1/json/client/qan_service/get_metrics_parameters.go deleted file mode 100644 index 65e95eae003..00000000000 --- a/api/qan/v1/json/client/qan_service/get_metrics_parameters.go +++ /dev/null @@ -1,147 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package qan_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" -) - -// NewGetMetricsParams creates a new GetMetricsParams 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 NewGetMetricsParams() *GetMetricsParams { - return &GetMetricsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetMetricsParamsWithTimeout creates a new GetMetricsParams object -// with the ability to set a timeout on a request. -func NewGetMetricsParamsWithTimeout(timeout time.Duration) *GetMetricsParams { - return &GetMetricsParams{ - timeout: timeout, - } -} - -// NewGetMetricsParamsWithContext creates a new GetMetricsParams object -// with the ability to set a context for a request. -func NewGetMetricsParamsWithContext(ctx context.Context) *GetMetricsParams { - return &GetMetricsParams{ - Context: ctx, - } -} - -// NewGetMetricsParamsWithHTTPClient creates a new GetMetricsParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetMetricsParamsWithHTTPClient(client *http.Client) *GetMetricsParams { - return &GetMetricsParams{ - HTTPClient: client, - } -} - -/* -GetMetricsParams contains all the parameters to send to the API endpoint - - for the get metrics operation. - - Typically these are written to a http.Request. -*/ -type GetMetricsParams struct { - /* Body. - - GetMetricsRequest defines filtering of metrics for specific value of dimension (ex.: host=hostname1 or queryid=1D410B4BE5060972. - */ - Body GetMetricsBody - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get metrics params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetMetricsParams) WithDefaults() *GetMetricsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get metrics params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetMetricsParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the get metrics params -func (o *GetMetricsParams) WithTimeout(timeout time.Duration) *GetMetricsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get metrics params -func (o *GetMetricsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get metrics params -func (o *GetMetricsParams) WithContext(ctx context.Context) *GetMetricsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get metrics params -func (o *GetMetricsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get metrics params -func (o *GetMetricsParams) WithHTTPClient(client *http.Client) *GetMetricsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get metrics params -func (o *GetMetricsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the get metrics params -func (o *GetMetricsParams) WithBody(body GetMetricsBody) *GetMetricsParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the get metrics params -func (o *GetMetricsParams) SetBody(body GetMetricsBody) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *GetMetricsParams) 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/qan/v1/json/client/qan_service/get_metrics_responses.go b/api/qan/v1/json/client/qan_service/get_metrics_responses.go deleted file mode 100644 index 65a3376dfff..00000000000 --- a/api/qan/v1/json/client/qan_service/get_metrics_responses.go +++ /dev/null @@ -1,1350 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package qan_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" -) - -// GetMetricsReader is a Reader for the GetMetrics structure. -type GetMetricsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetMetricsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewGetMetricsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewGetMetricsDefault(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 - } -} - -// NewGetMetricsOK creates a GetMetricsOK with default headers values -func NewGetMetricsOK() *GetMetricsOK { - return &GetMetricsOK{} -} - -/* -GetMetricsOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type GetMetricsOK struct { - Payload *GetMetricsOKBody -} - -// IsSuccess returns true when this get metrics Ok response has a 2xx status code -func (o *GetMetricsOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this get metrics Ok response has a 3xx status code -func (o *GetMetricsOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this get metrics Ok response has a 4xx status code -func (o *GetMetricsOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this get metrics Ok response has a 5xx status code -func (o *GetMetricsOK) IsServerError() bool { - return false -} - -// IsCode returns true when this get metrics Ok response a status code equal to that given -func (o *GetMetricsOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the get metrics Ok response -func (o *GetMetricsOK) Code() int { - return 200 -} - -func (o *GetMetricsOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/qan:getMetrics][%d] getMetricsOk %s", 200, payload) -} - -func (o *GetMetricsOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/qan:getMetrics][%d] getMetricsOk %s", 200, payload) -} - -func (o *GetMetricsOK) GetPayload() *GetMetricsOKBody { - return o.Payload -} - -func (o *GetMetricsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(GetMetricsOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -// NewGetMetricsDefault creates a GetMetricsDefault with default headers values -func NewGetMetricsDefault(code int) *GetMetricsDefault { - return &GetMetricsDefault{ - _statusCode: code, - } -} - -/* -GetMetricsDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type GetMetricsDefault struct { - _statusCode int - - Payload *GetMetricsDefaultBody -} - -// IsSuccess returns true when this get metrics default response has a 2xx status code -func (o *GetMetricsDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this get metrics default response has a 3xx status code -func (o *GetMetricsDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this get metrics default response has a 4xx status code -func (o *GetMetricsDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this get metrics default response has a 5xx status code -func (o *GetMetricsDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this get metrics default response a status code equal to that given -func (o *GetMetricsDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the get metrics default response -func (o *GetMetricsDefault) Code() int { - return o._statusCode -} - -func (o *GetMetricsDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/qan:getMetrics][%d] GetMetrics default %s", o._statusCode, payload) -} - -func (o *GetMetricsDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/qan:getMetrics][%d] GetMetrics default %s", o._statusCode, payload) -} - -func (o *GetMetricsDefault) GetPayload() *GetMetricsDefaultBody { - return o.Payload -} - -func (o *GetMetricsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(GetMetricsDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -GetMetricsBody GetMetricsRequest defines filtering of metrics for specific value of dimension (ex.: host=hostname1 or queryid=1D410B4BE5060972. -swagger:model GetMetricsBody -*/ -type GetMetricsBody struct { - // period start from - // Format: date-time - PeriodStartFrom strfmt.DateTime `json:"period_start_from,omitempty"` - - // period start to - // Format: date-time - PeriodStartTo strfmt.DateTime `json:"period_start_to,omitempty"` - - // dimension value: ex: queryid - 1D410B4BE5060972. - FilterBy string `json:"filter_by,omitempty"` - - // one of dimension: queryid | host ... - GroupBy string `json:"group_by,omitempty"` - - // labels - Labels []*GetMetricsParamsBodyLabelsItems0 `json:"labels"` - - // include only fields - IncludeOnlyFields []string `json:"include_only_fields"` - - // retrieve only values for totals, excluding N/A values - Totals bool `json:"totals,omitempty"` -} - -// Validate validates this get metrics body -func (o *GetMetricsBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validatePeriodStartFrom(formats); err != nil { - res = append(res, err) - } - - if err := o.validatePeriodStartTo(formats); err != nil { - res = append(res, err) - } - - if err := o.validateLabels(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetMetricsBody) validatePeriodStartFrom(formats strfmt.Registry) error { - if swag.IsZero(o.PeriodStartFrom) { // not required - return nil - } - - if err := validate.FormatOf("body"+"."+"period_start_from", "body", "date-time", o.PeriodStartFrom.String(), formats); err != nil { - return err - } - - return nil -} - -func (o *GetMetricsBody) validatePeriodStartTo(formats strfmt.Registry) error { - if swag.IsZero(o.PeriodStartTo) { // not required - return nil - } - - if err := validate.FormatOf("body"+"."+"period_start_to", "body", "date-time", o.PeriodStartTo.String(), formats); err != nil { - return err - } - - return nil -} - -func (o *GetMetricsBody) validateLabels(formats strfmt.Registry) error { - if swag.IsZero(o.Labels) { // not required - return nil - } - - for i := 0; i < len(o.Labels); i++ { - if swag.IsZero(o.Labels[i]) { // not required - continue - } - - if o.Labels[i] != nil { - if err := o.Labels[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "labels" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "labels" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this get metrics body based on the context it is used -func (o *GetMetricsBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateLabels(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetMetricsBody) contextValidateLabels(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Labels); i++ { - if o.Labels[i] != nil { - - if swag.IsZero(o.Labels[i]) { // not required - return nil - } - - if err := o.Labels[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "labels" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "labels" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetMetricsBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetMetricsBody) UnmarshalBinary(b []byte) error { - var res GetMetricsBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetMetricsDefaultBody get metrics default body -swagger:model GetMetricsDefaultBody -*/ -type GetMetricsDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*GetMetricsDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this get metrics default body -func (o *GetMetricsDefaultBody) 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 *GetMetricsDefaultBody) 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("GetMetrics default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("GetMetrics default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this get metrics default body based on the context it is used -func (o *GetMetricsDefaultBody) 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 *GetMetricsDefaultBody) 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("GetMetrics default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("GetMetrics default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetMetricsDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetMetricsDefaultBody) UnmarshalBinary(b []byte) error { - var res GetMetricsDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetMetricsDefaultBodyDetailsItems0 get metrics default body details items0 -swagger:model GetMetricsDefaultBodyDetailsItems0 -*/ -type GetMetricsDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` - - // get metrics default body details items0 - GetMetricsDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *GetMetricsDefaultBodyDetailsItems0) 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 GetMetricsDefaultBodyDetailsItems0 - - 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.GetMetricsDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o GetMetricsDefaultBodyDetailsItems0) 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.GetMetricsDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.GetMetricsDefaultBodyDetailsItems0) - 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 get metrics default body details items0 -func (o *GetMetricsDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get metrics default body details items0 based on context it is used -func (o *GetMetricsDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetMetricsDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetMetricsDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res GetMetricsDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetMetricsOKBody GetMetricsResponse defines metrics for specific value of dimension (ex.: host=hostname1 or queryid=1D410B4BE5060972. -swagger:model GetMetricsOKBody -*/ -type GetMetricsOKBody struct { - // metrics - Metrics map[string]GetMetricsOKBodyMetricsAnon `json:"metrics,omitempty"` - - // text metrics - TextMetrics map[string]string `json:"text_metrics,omitempty"` - - // sparkline - Sparkline []*GetMetricsOKBodySparklineItems0 `json:"sparkline"` - - // totals - Totals map[string]GetMetricsOKBodyTotalsAnon `json:"totals,omitempty"` - - // fingerprint - Fingerprint string `json:"fingerprint,omitempty"` - - // metadata - Metadata *GetMetricsOKBodyMetadata `json:"metadata,omitempty"` -} - -// Validate validates this get metrics OK body -func (o *GetMetricsOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateMetrics(formats); err != nil { - res = append(res, err) - } - - if err := o.validateSparkline(formats); err != nil { - res = append(res, err) - } - - if err := o.validateTotals(formats); err != nil { - res = append(res, err) - } - - if err := o.validateMetadata(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetMetricsOKBody) validateMetrics(formats strfmt.Registry) error { - if swag.IsZero(o.Metrics) { // not required - return nil - } - - for k := range o.Metrics { - - if swag.IsZero(o.Metrics[k]) { // not required - continue - } - if val, ok := o.Metrics[k]; ok { - if err := val.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getMetricsOk" + "." + "metrics" + "." + k) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getMetricsOk" + "." + "metrics" + "." + k) - } - - return err - } - } - - } - - return nil -} - -func (o *GetMetricsOKBody) validateSparkline(formats strfmt.Registry) error { - if swag.IsZero(o.Sparkline) { // not required - return nil - } - - for i := 0; i < len(o.Sparkline); i++ { - if swag.IsZero(o.Sparkline[i]) { // not required - continue - } - - if o.Sparkline[i] != nil { - if err := o.Sparkline[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getMetricsOk" + "." + "sparkline" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getMetricsOk" + "." + "sparkline" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -func (o *GetMetricsOKBody) validateTotals(formats strfmt.Registry) error { - if swag.IsZero(o.Totals) { // not required - return nil - } - - for k := range o.Totals { - - if swag.IsZero(o.Totals[k]) { // not required - continue - } - if val, ok := o.Totals[k]; ok { - if err := val.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getMetricsOk" + "." + "totals" + "." + k) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getMetricsOk" + "." + "totals" + "." + k) - } - - return err - } - } - - } - - return nil -} - -func (o *GetMetricsOKBody) validateMetadata(formats strfmt.Registry) error { - if swag.IsZero(o.Metadata) { // not required - return nil - } - - if o.Metadata != nil { - if err := o.Metadata.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getMetricsOk" + "." + "metadata") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getMetricsOk" + "." + "metadata") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this get metrics OK body based on the context it is used -func (o *GetMetricsOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateMetrics(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateSparkline(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateTotals(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateMetadata(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetMetricsOKBody) contextValidateMetrics(ctx context.Context, formats strfmt.Registry) error { - for k := range o.Metrics { - if val, ok := o.Metrics[k]; ok { - if err := val.ContextValidate(ctx, formats); err != nil { - return err - } - } - } - - return nil -} - -func (o *GetMetricsOKBody) contextValidateSparkline(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Sparkline); i++ { - if o.Sparkline[i] != nil { - - if swag.IsZero(o.Sparkline[i]) { // not required - return nil - } - - if err := o.Sparkline[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getMetricsOk" + "." + "sparkline" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getMetricsOk" + "." + "sparkline" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -func (o *GetMetricsOKBody) contextValidateTotals(ctx context.Context, formats strfmt.Registry) error { - for k := range o.Totals { - if val, ok := o.Totals[k]; ok { - if err := val.ContextValidate(ctx, formats); err != nil { - return err - } - } - } - - return nil -} - -func (o *GetMetricsOKBody) contextValidateMetadata(ctx context.Context, formats strfmt.Registry) error { - if o.Metadata != nil { - - if swag.IsZero(o.Metadata) { // not required - return nil - } - - if err := o.Metadata.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getMetricsOk" + "." + "metadata") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getMetricsOk" + "." + "metadata") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetMetricsOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetMetricsOKBody) UnmarshalBinary(b []byte) error { - var res GetMetricsOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetMetricsOKBodyMetadata GetSlecetedQueryMetadataResponse consists selected query metadata to show in details for given query ID. -swagger:model GetMetricsOKBodyMetadata -*/ -type GetMetricsOKBodyMetadata struct { - // service name - ServiceName string `json:"service_name,omitempty"` - - // database - Database string `json:"database,omitempty"` - - // schema - Schema string `json:"schema,omitempty"` - - // username - Username string `json:"username,omitempty"` - - // replication set - ReplicationSet string `json:"replication_set,omitempty"` - - // cluster - Cluster string `json:"cluster,omitempty"` - - // service type - ServiceType string `json:"service_type,omitempty"` - - // service id - ServiceID string `json:"service_id,omitempty"` - - // environment - Environment string `json:"environment,omitempty"` - - // node id - NodeID string `json:"node_id,omitempty"` - - // node name - NodeName string `json:"node_name,omitempty"` - - // node type - NodeType string `json:"node_type,omitempty"` -} - -// Validate validates this get metrics OK body metadata -func (o *GetMetricsOKBodyMetadata) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get metrics OK body metadata based on context it is used -func (o *GetMetricsOKBodyMetadata) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetMetricsOKBodyMetadata) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetMetricsOKBodyMetadata) UnmarshalBinary(b []byte) error { - var res GetMetricsOKBodyMetadata - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetMetricsOKBodyMetricsAnon MetricValues is statistics of specific metric. -swagger:model GetMetricsOKBodyMetricsAnon -*/ -type GetMetricsOKBodyMetricsAnon struct { - // rate - Rate float32 `json:"rate,omitempty"` - - // cnt - Cnt float32 `json:"cnt,omitempty"` - - // sum - Sum float32 `json:"sum,omitempty"` - - // min - Min float32 `json:"min,omitempty"` - - // max - Max float32 `json:"max,omitempty"` - - // avg - Avg float32 `json:"avg,omitempty"` - - // p99 - P99 float32 `json:"p99,omitempty"` - - // percent of total - PercentOfTotal float32 `json:"percent_of_total,omitempty"` -} - -// Validate validates this get metrics OK body metrics anon -func (o *GetMetricsOKBodyMetricsAnon) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get metrics OK body metrics anon based on context it is used -func (o *GetMetricsOKBodyMetricsAnon) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetMetricsOKBodyMetricsAnon) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetMetricsOKBodyMetricsAnon) UnmarshalBinary(b []byte) error { - var res GetMetricsOKBodyMetricsAnon - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetMetricsOKBodySparklineItems0 Point contains values that represents abscissa (time) and ordinate (volume etc.) -// of every point in a coordinate system of Sparklines. -swagger:model GetMetricsOKBodySparklineItems0 -*/ -type GetMetricsOKBodySparklineItems0 struct { - // The serial number of the chart point from the largest time in the time interval to the lowest time in the time range. - Point int64 `json:"point,omitempty"` - - // Duration beetween two points. - TimeFrame int64 `json:"time_frame,omitempty"` - - // Time of point in format RFC3339. - Timestamp string `json:"timestamp,omitempty"` - - // load is query_time / time_range. - Load float32 `json:"load,omitempty"` - - // number of queries in bucket. - NumQueriesPerSec float32 `json:"num_queries_per_sec,omitempty"` - - // number of queries with errors. - NumQueriesWithErrorsPerSec float32 `json:"num_queries_with_errors_per_sec,omitempty"` - - // number of queries with warnings. - NumQueriesWithWarningsPerSec float32 `json:"num_queries_with_warnings_per_sec,omitempty"` - - // The statement execution time in seconds. - MQueryTimeSumPerSec float32 `json:"m_query_time_sum_per_sec,omitempty"` - - // The time to acquire locks in seconds. - MLockTimeSumPerSec float32 `json:"m_lock_time_sum_per_sec,omitempty"` - - // The number of rows sent to the client. - MRowsSentSumPerSec float32 `json:"m_rows_sent_sum_per_sec,omitempty"` - - // Number of rows scanned - SELECT. - MRowsExaminedSumPerSec float32 `json:"m_rows_examined_sum_per_sec,omitempty"` - - // Number of rows changed - UPDATE, DELETE, INSERT. - MRowsAffectedSumPerSec float32 `json:"m_rows_affected_sum_per_sec,omitempty"` - - // The number of rows read from tables. - MRowsReadSumPerSec float32 `json:"m_rows_read_sum_per_sec,omitempty"` - - // The number of merge passes that the sort algorithm has had to do. - MMergePassesSumPerSec float32 `json:"m_merge_passes_sum_per_sec,omitempty"` - - // Counts the number of page read operations scheduled. - MInnodbIorOpsSumPerSec float32 `json:"m_innodb_io_r_ops_sum_per_sec,omitempty"` - - // Similar to innodb_IO_r_ops, but the unit is bytes. - MInnodbIorBytesSumPerSec float32 `json:"m_innodb_io_r_bytes_sum_per_sec,omitempty"` - - // Shows how long (in seconds) it took InnoDB to actually read the data from storage. - MInnodbIorWaitSumPerSec float32 `json:"m_innodb_io_r_wait_sum_per_sec,omitempty"` - - // Shows how long (in seconds) the query waited for row locks. - MInnodbRecLockWaitSumPerSec float32 `json:"m_innodb_rec_lock_wait_sum_per_sec,omitempty"` - - // Shows how long (in seconds) the query spent either waiting to enter the InnoDB queue or inside that queue waiting for execution. - MInnodbQueueWaitSumPerSec float32 `json:"m_innodb_queue_wait_sum_per_sec,omitempty"` - - // Counts approximately the number of unique pages the query accessed. - MInnodbPagesDistinctSumPerSec float32 `json:"m_innodb_pages_distinct_sum_per_sec,omitempty"` - - // Shows how long the query is. - MQueryLengthSumPerSec float32 `json:"m_query_length_sum_per_sec,omitempty"` - - // The number of bytes sent to all clients. - MBytesSentSumPerSec float32 `json:"m_bytes_sent_sum_per_sec,omitempty"` - - // Number of temporary tables created on memory for the query. - MTmpTablesSumPerSec float32 `json:"m_tmp_tables_sum_per_sec,omitempty"` - - // Number of temporary tables created on disk for the query. - MTmpDiskTablesSumPerSec float32 `json:"m_tmp_disk_tables_sum_per_sec,omitempty"` - - // Total Size in bytes for all temporary tables used in the query. - MTmpTableSizesSumPerSec float32 `json:"m_tmp_table_sizes_sum_per_sec,omitempty"` - - // Query Cache hits. - MQcHitSumPerSec float32 `json:"m_qc_hit_sum_per_sec,omitempty"` - - // The query performed a full table scan. - MFullScanSumPerSec float32 `json:"m_full_scan_sum_per_sec,omitempty"` - - // The query performed a full join (a join without indexes). - MFullJoinSumPerSec float32 `json:"m_full_join_sum_per_sec,omitempty"` - - // The query created an implicit internal temporary table. - MTmpTableSumPerSec float32 `json:"m_tmp_table_sum_per_sec,omitempty"` - - // The querys temporary table was stored on disk. - MTmpTableOnDiskSumPerSec float32 `json:"m_tmp_table_on_disk_sum_per_sec,omitempty"` - - // The query used a filesort. - MFilesortSumPerSec float32 `json:"m_filesort_sum_per_sec,omitempty"` - - // The filesort was performed on disk. - MFilesortOnDiskSumPerSec float32 `json:"m_filesort_on_disk_sum_per_sec,omitempty"` - - // The number of joins that used a range search on a reference table. - MSelectFullRangeJoinSumPerSec float32 `json:"m_select_full_range_join_sum_per_sec,omitempty"` - - // The number of joins that used ranges on the first table. - MSelectRangeSumPerSec float32 `json:"m_select_range_sum_per_sec,omitempty"` - - // The number of joins without keys that check for key usage after each row. - MSelectRangeCheckSumPerSec float32 `json:"m_select_range_check_sum_per_sec,omitempty"` - - // The number of sorts that were done using ranges. - MSortRangeSumPerSec float32 `json:"m_sort_range_sum_per_sec,omitempty"` - - // The number of sorted rows. - MSortRowsSumPerSec float32 `json:"m_sort_rows_sum_per_sec,omitempty"` - - // The number of sorts that were done by scanning the table. - MSortScanSumPerSec float32 `json:"m_sort_scan_sum_per_sec,omitempty"` - - // The number of queries without index. - MNoIndexUsedSumPerSec float32 `json:"m_no_index_used_sum_per_sec,omitempty"` - - // The number of queries without good index. - MNoGoodIndexUsedSumPerSec float32 `json:"m_no_good_index_used_sum_per_sec,omitempty"` - - // The number of returned documents. - MDocsReturnedSumPerSec float32 `json:"m_docs_returned_sum_per_sec,omitempty"` - - // The response length of the query result in bytes. - MResponseLengthSumPerSec float32 `json:"m_response_length_sum_per_sec,omitempty"` - - // The number of scanned documents. - MDocsScannedSumPerSec float32 `json:"m_docs_scanned_sum_per_sec,omitempty"` - - // Total number of documents scanned during query execution. - MDocsExaminedSumPerSec float32 `json:"m_docs_examined_sum_per_sec,omitempty"` - - // Total number of index keys scanned during query execution. - MKeysExaminedSumPerSec float32 `json:"m_keys_examined_sum_per_sec,omitempty"` - - // Number of times a global read lock was acquired during query execution. - MLocksGlobalAcquireCountReadSharedSumPerSec float32 `json:"m_locks_global_acquire_count_read_shared_sum_per_sec,omitempty"` - - // Number of times a global write lock was acquired during query execution. - MLocksGlobalAcquireCountWriteSharedSumPerSec float32 `json:"m_locks_global_acquire_count_write_shared_sum_per_sec,omitempty"` - - // Number of times a read lock was acquired at the database level during query execution. - MLocksDatabaseAcquireCountReadSharedSumPerSec float32 `json:"m_locks_database_acquire_count_read_shared_sum_per_sec,omitempty"` - - // Number of times a read lock at the database level was requested but had to wait before being granted. - MLocksDatabaseAcquireWaitCountReadSharedSumPerSec float32 `json:"m_locks_database_acquire_wait_count_read_shared_sum_per_sec,omitempty"` - - // Indicates the time, spent acquiring a read lock at the database level during an operation. - MLocksDatabaseTimeAcquiringMicrosReadSharedSumPerSec float32 `json:"m_locks_database_time_acquiring_micros_read_shared_sum_per_sec,omitempty"` - - // Number of times a read lock was acquired on a specific collection during operations. - MLocksCollectionAcquireCountReadSharedSumPerSec float32 `json:"m_locks_collection_acquire_count_read_shared_sum_per_sec,omitempty"` - - // Total number of bytes read from storage during a specific operation. - MStorageBytesReadSumPerSec float32 `json:"m_storage_bytes_read_sum_per_sec,omitempty"` - - // Indicates the time, spent reading data from storage during an operation. - MStorageTimeReadingMicrosSumPerSec float32 `json:"m_storage_time_reading_micros_sum_per_sec,omitempty"` - - // Total number of shared block cache hits by the statement. - MSharedBlksHitSumPerSec float32 `json:"m_shared_blks_hit_sum_per_sec,omitempty"` - - // Total number of shared blocks read by the statement. - MSharedBlksReadSumPerSec float32 `json:"m_shared_blks_read_sum_per_sec,omitempty"` - - // Total number of shared blocks dirtied by the statement. - MSharedBlksDirtiedSumPerSec float32 `json:"m_shared_blks_dirtied_sum_per_sec,omitempty"` - - // Total number of shared blocks written by the statement. - MSharedBlksWrittenSumPerSec float32 `json:"m_shared_blks_written_sum_per_sec,omitempty"` - - // Total time the statement spent reading shared blocks, in milliseconds (if track_io_timing is enabled, otherwise zero). - MSharedBlkReadTimeSumPerSec float32 `json:"m_shared_blk_read_time_sum_per_sec,omitempty"` - - // Total time the statement spent writing shared blocks, in milliseconds (if track_io_timing is enabled, otherwise zero). - MSharedBlkWriteTimeSumPerSec float32 `json:"m_shared_blk_write_time_sum_per_sec,omitempty"` - - // Total time the statement spent reading shared blocks, in milliseconds (if track_io_timing is enabled, otherwise zero). - MLocalBlkReadTimeSumPerSec float32 `json:"m_local_blk_read_time_sum_per_sec,omitempty"` - - // Total time the statement spent writing shared blocks, in milliseconds (if track_io_timing is enabled, otherwise zero). - MLocalBlkWriteTimeSumPerSec float32 `json:"m_local_blk_write_time_sum_per_sec,omitempty"` - - // Total number of local block cache hits by the statement. - MLocalBlksHitSumPerSec float32 `json:"m_local_blks_hit_sum_per_sec,omitempty"` - - // Total number of local blocks read by the statement. - MLocalBlksReadSumPerSec float32 `json:"m_local_blks_read_sum_per_sec,omitempty"` - - // Total number of local blocks dirtied by the statement. - MLocalBlksDirtiedSumPerSec float32 `json:"m_local_blks_dirtied_sum_per_sec,omitempty"` - - // Total number of local blocks written by the statement. - MLocalBlksWrittenSumPerSec float32 `json:"m_local_blks_written_sum_per_sec,omitempty"` - - // Total number of temp blocks read by the statement. - MTempBlksReadSumPerSec float32 `json:"m_temp_blks_read_sum_per_sec,omitempty"` - - // Total number of temp blocks written by the statement. - MTempBlksWrittenSumPerSec float32 `json:"m_temp_blks_written_sum_per_sec,omitempty"` - - // Total time the statement spent reading blocks, in milliseconds (if track_io_timing is enabled, otherwise zero). - MBlkReadTimeSumPerSec float32 `json:"m_blk_read_time_sum_per_sec,omitempty"` - - // Total time the statement spent writing blocks, in milliseconds (if track_io_timing is enabled, otherwise zero). - MBlkWriteTimeSumPerSec float32 `json:"m_blk_write_time_sum_per_sec,omitempty"` - - // Total time user spent in query. - MCPUUserTimeSumPerSec float32 `json:"m_cpu_user_time_sum_per_sec,omitempty"` - - // Total time system spent in query. - MCPUSysTimeSumPerSec float32 `json:"m_cpu_sys_time_sum_per_sec,omitempty"` - - // Total number of planned calls. - MPlansCallsSumPerSec float32 `json:"m_plans_calls_sum_per_sec,omitempty"` - - // Total number of WAL (Write-ahead logging) records. - MWalRecordsSumPerSec float32 `json:"m_wal_records_sum_per_sec,omitempty"` - - // Total number of FPI (full page images) in WAL (Write-ahead logging) records. - MWalFpiSumPerSec float32 `json:"m_wal_fpi_sum_per_sec,omitempty"` - - // Total bytes of WAL (Write-ahead logging) records. - MWalBytesSumPerSec float32 `json:"m_wal_bytes_sum_per_sec,omitempty"` - - // Plan time in per seconds. - MPlanTimeSumPerSec float32 `json:"m_plan_time_sum_per_sec,omitempty"` -} - -// Validate validates this get metrics OK body sparkline items0 -func (o *GetMetricsOKBodySparklineItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get metrics OK body sparkline items0 based on context it is used -func (o *GetMetricsOKBodySparklineItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetMetricsOKBodySparklineItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetMetricsOKBodySparklineItems0) UnmarshalBinary(b []byte) error { - var res GetMetricsOKBodySparklineItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetMetricsOKBodyTotalsAnon MetricValues is statistics of specific metric. -swagger:model GetMetricsOKBodyTotalsAnon -*/ -type GetMetricsOKBodyTotalsAnon struct { - // rate - Rate float32 `json:"rate,omitempty"` - - // cnt - Cnt float32 `json:"cnt,omitempty"` - - // sum - Sum float32 `json:"sum,omitempty"` - - // min - Min float32 `json:"min,omitempty"` - - // max - Max float32 `json:"max,omitempty"` - - // avg - Avg float32 `json:"avg,omitempty"` - - // p99 - P99 float32 `json:"p99,omitempty"` - - // percent of total - PercentOfTotal float32 `json:"percent_of_total,omitempty"` -} - -// Validate validates this get metrics OK body totals anon -func (o *GetMetricsOKBodyTotalsAnon) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get metrics OK body totals anon based on context it is used -func (o *GetMetricsOKBodyTotalsAnon) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetMetricsOKBodyTotalsAnon) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetMetricsOKBodyTotalsAnon) UnmarshalBinary(b []byte) error { - var res GetMetricsOKBodyTotalsAnon - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetMetricsParamsBodyLabelsItems0 MapFieldEntry allows to pass labels/dimensions in form like {"server": ["db1", "db2"...]}. -swagger:model GetMetricsParamsBodyLabelsItems0 -*/ -type GetMetricsParamsBodyLabelsItems0 struct { - // key - Key string `json:"key,omitempty"` - - // value - Value []string `json:"value"` -} - -// Validate validates this get metrics params body labels items0 -func (o *GetMetricsParamsBodyLabelsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get metrics params body labels items0 based on context it is used -func (o *GetMetricsParamsBodyLabelsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetMetricsParamsBodyLabelsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetMetricsParamsBodyLabelsItems0) UnmarshalBinary(b []byte) error { - var res GetMetricsParamsBodyLabelsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/qan/v1/json/client/qan_service/get_query_example_parameters.go b/api/qan/v1/json/client/qan_service/get_query_example_parameters.go deleted file mode 100644 index 7757bae1c9c..00000000000 --- a/api/qan/v1/json/client/qan_service/get_query_example_parameters.go +++ /dev/null @@ -1,148 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package qan_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" -) - -// NewGetQueryExampleParams creates a new GetQueryExampleParams 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 NewGetQueryExampleParams() *GetQueryExampleParams { - return &GetQueryExampleParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetQueryExampleParamsWithTimeout creates a new GetQueryExampleParams object -// with the ability to set a timeout on a request. -func NewGetQueryExampleParamsWithTimeout(timeout time.Duration) *GetQueryExampleParams { - return &GetQueryExampleParams{ - timeout: timeout, - } -} - -// NewGetQueryExampleParamsWithContext creates a new GetQueryExampleParams object -// with the ability to set a context for a request. -func NewGetQueryExampleParamsWithContext(ctx context.Context) *GetQueryExampleParams { - return &GetQueryExampleParams{ - Context: ctx, - } -} - -// NewGetQueryExampleParamsWithHTTPClient creates a new GetQueryExampleParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetQueryExampleParamsWithHTTPClient(client *http.Client) *GetQueryExampleParams { - return &GetQueryExampleParams{ - HTTPClient: client, - } -} - -/* -GetQueryExampleParams contains all the parameters to send to the API endpoint - - for the get query example operation. - - Typically these are written to a http.Request. -*/ -type GetQueryExampleParams struct { - /* Body. - - GetQueryExampleRequest defines filtering of query examples for specific value of - dimension (ex.: host=hostname1 or queryid=1D410B4BE5060972. - */ - Body GetQueryExampleBody - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get query example params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetQueryExampleParams) WithDefaults() *GetQueryExampleParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get query example params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetQueryExampleParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the get query example params -func (o *GetQueryExampleParams) WithTimeout(timeout time.Duration) *GetQueryExampleParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get query example params -func (o *GetQueryExampleParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get query example params -func (o *GetQueryExampleParams) WithContext(ctx context.Context) *GetQueryExampleParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get query example params -func (o *GetQueryExampleParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get query example params -func (o *GetQueryExampleParams) WithHTTPClient(client *http.Client) *GetQueryExampleParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get query example params -func (o *GetQueryExampleParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the get query example params -func (o *GetQueryExampleParams) WithBody(body GetQueryExampleBody) *GetQueryExampleParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the get query example params -func (o *GetQueryExampleParams) SetBody(body GetQueryExampleBody) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *GetQueryExampleParams) 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/qan/v1/json/client/qan_service/get_query_example_responses.go b/api/qan/v1/json/client/qan_service/get_query_example_responses.go deleted file mode 100644 index a9ffcad7993..00000000000 --- a/api/qan/v1/json/client/qan_service/get_query_example_responses.go +++ /dev/null @@ -1,857 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package qan_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" -) - -// GetQueryExampleReader is a Reader for the GetQueryExample structure. -type GetQueryExampleReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetQueryExampleReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewGetQueryExampleOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewGetQueryExampleDefault(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 - } -} - -// NewGetQueryExampleOK creates a GetQueryExampleOK with default headers values -func NewGetQueryExampleOK() *GetQueryExampleOK { - return &GetQueryExampleOK{} -} - -/* -GetQueryExampleOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type GetQueryExampleOK struct { - Payload *GetQueryExampleOKBody -} - -// IsSuccess returns true when this get query example Ok response has a 2xx status code -func (o *GetQueryExampleOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this get query example Ok response has a 3xx status code -func (o *GetQueryExampleOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this get query example Ok response has a 4xx status code -func (o *GetQueryExampleOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this get query example Ok response has a 5xx status code -func (o *GetQueryExampleOK) IsServerError() bool { - return false -} - -// IsCode returns true when this get query example Ok response a status code equal to that given -func (o *GetQueryExampleOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the get query example Ok response -func (o *GetQueryExampleOK) Code() int { - return 200 -} - -func (o *GetQueryExampleOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/qan/query:getExample][%d] getQueryExampleOk %s", 200, payload) -} - -func (o *GetQueryExampleOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/qan/query:getExample][%d] getQueryExampleOk %s", 200, payload) -} - -func (o *GetQueryExampleOK) GetPayload() *GetQueryExampleOKBody { - return o.Payload -} - -func (o *GetQueryExampleOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(GetQueryExampleOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -// NewGetQueryExampleDefault creates a GetQueryExampleDefault with default headers values -func NewGetQueryExampleDefault(code int) *GetQueryExampleDefault { - return &GetQueryExampleDefault{ - _statusCode: code, - } -} - -/* -GetQueryExampleDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type GetQueryExampleDefault struct { - _statusCode int - - Payload *GetQueryExampleDefaultBody -} - -// IsSuccess returns true when this get query example default response has a 2xx status code -func (o *GetQueryExampleDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this get query example default response has a 3xx status code -func (o *GetQueryExampleDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this get query example default response has a 4xx status code -func (o *GetQueryExampleDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this get query example default response has a 5xx status code -func (o *GetQueryExampleDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this get query example default response a status code equal to that given -func (o *GetQueryExampleDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the get query example default response -func (o *GetQueryExampleDefault) Code() int { - return o._statusCode -} - -func (o *GetQueryExampleDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/qan/query:getExample][%d] GetQueryExample default %s", o._statusCode, payload) -} - -func (o *GetQueryExampleDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/qan/query:getExample][%d] GetQueryExample default %s", o._statusCode, payload) -} - -func (o *GetQueryExampleDefault) GetPayload() *GetQueryExampleDefaultBody { - return o.Payload -} - -func (o *GetQueryExampleDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(GetQueryExampleDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -GetQueryExampleBody GetQueryExampleRequest defines filtering of query examples for specific value of -// dimension (ex.: host=hostname1 or queryid=1D410B4BE5060972. -swagger:model GetQueryExampleBody -*/ -type GetQueryExampleBody struct { - // period start from - // Format: date-time - PeriodStartFrom strfmt.DateTime `json:"period_start_from,omitempty"` - - // period start to - // Format: date-time - PeriodStartTo strfmt.DateTime `json:"period_start_to,omitempty"` - - // dimension value: ex: queryid - 1D410B4BE5060972. - FilterBy string `json:"filter_by,omitempty"` - - // one of dimension: queryid | host ... - GroupBy string `json:"group_by,omitempty"` - - // labels - Labels []*GetQueryExampleParamsBodyLabelsItems0 `json:"labels"` - - // limit - Limit int64 `json:"limit,omitempty"` -} - -// Validate validates this get query example body -func (o *GetQueryExampleBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validatePeriodStartFrom(formats); err != nil { - res = append(res, err) - } - - if err := o.validatePeriodStartTo(formats); err != nil { - res = append(res, err) - } - - if err := o.validateLabels(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetQueryExampleBody) validatePeriodStartFrom(formats strfmt.Registry) error { - if swag.IsZero(o.PeriodStartFrom) { // not required - return nil - } - - if err := validate.FormatOf("body"+"."+"period_start_from", "body", "date-time", o.PeriodStartFrom.String(), formats); err != nil { - return err - } - - return nil -} - -func (o *GetQueryExampleBody) validatePeriodStartTo(formats strfmt.Registry) error { - if swag.IsZero(o.PeriodStartTo) { // not required - return nil - } - - if err := validate.FormatOf("body"+"."+"period_start_to", "body", "date-time", o.PeriodStartTo.String(), formats); err != nil { - return err - } - - return nil -} - -func (o *GetQueryExampleBody) validateLabels(formats strfmt.Registry) error { - if swag.IsZero(o.Labels) { // not required - return nil - } - - for i := 0; i < len(o.Labels); i++ { - if swag.IsZero(o.Labels[i]) { // not required - continue - } - - if o.Labels[i] != nil { - if err := o.Labels[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "labels" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "labels" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this get query example body based on the context it is used -func (o *GetQueryExampleBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateLabels(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetQueryExampleBody) contextValidateLabels(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Labels); i++ { - if o.Labels[i] != nil { - - if swag.IsZero(o.Labels[i]) { // not required - return nil - } - - if err := o.Labels[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "labels" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "labels" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetQueryExampleBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetQueryExampleBody) UnmarshalBinary(b []byte) error { - var res GetQueryExampleBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetQueryExampleDefaultBody get query example default body -swagger:model GetQueryExampleDefaultBody -*/ -type GetQueryExampleDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*GetQueryExampleDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this get query example default body -func (o *GetQueryExampleDefaultBody) 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 *GetQueryExampleDefaultBody) 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("GetQueryExample default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("GetQueryExample default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this get query example default body based on the context it is used -func (o *GetQueryExampleDefaultBody) 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 *GetQueryExampleDefaultBody) 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("GetQueryExample default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("GetQueryExample default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetQueryExampleDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetQueryExampleDefaultBody) UnmarshalBinary(b []byte) error { - var res GetQueryExampleDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetQueryExampleDefaultBodyDetailsItems0 get query example default body details items0 -swagger:model GetQueryExampleDefaultBodyDetailsItems0 -*/ -type GetQueryExampleDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` - - // get query example default body details items0 - GetQueryExampleDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *GetQueryExampleDefaultBodyDetailsItems0) 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 GetQueryExampleDefaultBodyDetailsItems0 - - 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.GetQueryExampleDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o GetQueryExampleDefaultBodyDetailsItems0) 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.GetQueryExampleDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.GetQueryExampleDefaultBodyDetailsItems0) - 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 get query example default body details items0 -func (o *GetQueryExampleDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get query example default body details items0 based on context it is used -func (o *GetQueryExampleDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetQueryExampleDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetQueryExampleDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res GetQueryExampleDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetQueryExampleOKBody GetQueryExampleResponse list of query examples. -swagger:model GetQueryExampleOKBody -*/ -type GetQueryExampleOKBody struct { - // query examples - QueryExamples []*GetQueryExampleOKBodyQueryExamplesItems0 `json:"query_examples"` -} - -// Validate validates this get query example OK body -func (o *GetQueryExampleOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateQueryExamples(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetQueryExampleOKBody) validateQueryExamples(formats strfmt.Registry) error { - if swag.IsZero(o.QueryExamples) { // not required - return nil - } - - for i := 0; i < len(o.QueryExamples); i++ { - if swag.IsZero(o.QueryExamples[i]) { // not required - continue - } - - if o.QueryExamples[i] != nil { - if err := o.QueryExamples[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getQueryExampleOk" + "." + "query_examples" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getQueryExampleOk" + "." + "query_examples" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this get query example OK body based on the context it is used -func (o *GetQueryExampleOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateQueryExamples(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetQueryExampleOKBody) contextValidateQueryExamples(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.QueryExamples); i++ { - if o.QueryExamples[i] != nil { - - if swag.IsZero(o.QueryExamples[i]) { // not required - return nil - } - - if err := o.QueryExamples[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getQueryExampleOk" + "." + "query_examples" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getQueryExampleOk" + "." + "query_examples" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetQueryExampleOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetQueryExampleOKBody) UnmarshalBinary(b []byte) error { - var res GetQueryExampleOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetQueryExampleOKBodyQueryExamplesItems0 QueryExample shows query examples and their metrics. -swagger:model GetQueryExampleOKBodyQueryExamplesItems0 -*/ -type GetQueryExampleOKBodyQueryExamplesItems0 struct { - // example - Example string `json:"example,omitempty"` - - // ExampleType is a type of query example selected for this query class in given period of time. - // Enum: ["EXAMPLE_TYPE_UNSPECIFIED","EXAMPLE_TYPE_RANDOM","EXAMPLE_TYPE_SLOWEST","EXAMPLE_TYPE_FASTEST","EXAMPLE_TYPE_WITH_ERROR"] - ExampleType *string `json:"example_type,omitempty"` - - // is truncated - IsTruncated int64 `json:"is_truncated,omitempty"` - - // placeholders count - PlaceholdersCount int64 `json:"placeholders_count,omitempty"` - - // explain fingerprint - ExplainFingerprint string `json:"explain_fingerprint,omitempty"` - - // query id - QueryID string `json:"query_id,omitempty"` - - // example metrics - ExampleMetrics string `json:"example_metrics,omitempty"` - - // service id - ServiceID string `json:"service_id,omitempty"` - - // service type - ServiceType string `json:"service_type,omitempty"` - - // schema - Schema string `json:"schema,omitempty"` - - // tables - Tables []string `json:"tables"` -} - -// Validate validates this get query example OK body query examples items0 -func (o *GetQueryExampleOKBodyQueryExamplesItems0) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateExampleType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var getQueryExampleOkBodyQueryExamplesItems0TypeExampleTypePropEnum []any - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["EXAMPLE_TYPE_UNSPECIFIED","EXAMPLE_TYPE_RANDOM","EXAMPLE_TYPE_SLOWEST","EXAMPLE_TYPE_FASTEST","EXAMPLE_TYPE_WITH_ERROR"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - getQueryExampleOkBodyQueryExamplesItems0TypeExampleTypePropEnum = append(getQueryExampleOkBodyQueryExamplesItems0TypeExampleTypePropEnum, v) - } -} - -const ( - - // GetQueryExampleOKBodyQueryExamplesItems0ExampleTypeEXAMPLETYPEUNSPECIFIED captures enum value "EXAMPLE_TYPE_UNSPECIFIED" - GetQueryExampleOKBodyQueryExamplesItems0ExampleTypeEXAMPLETYPEUNSPECIFIED string = "EXAMPLE_TYPE_UNSPECIFIED" - - // GetQueryExampleOKBodyQueryExamplesItems0ExampleTypeEXAMPLETYPERANDOM captures enum value "EXAMPLE_TYPE_RANDOM" - GetQueryExampleOKBodyQueryExamplesItems0ExampleTypeEXAMPLETYPERANDOM string = "EXAMPLE_TYPE_RANDOM" - - // GetQueryExampleOKBodyQueryExamplesItems0ExampleTypeEXAMPLETYPESLOWEST captures enum value "EXAMPLE_TYPE_SLOWEST" - GetQueryExampleOKBodyQueryExamplesItems0ExampleTypeEXAMPLETYPESLOWEST string = "EXAMPLE_TYPE_SLOWEST" - - // GetQueryExampleOKBodyQueryExamplesItems0ExampleTypeEXAMPLETYPEFASTEST captures enum value "EXAMPLE_TYPE_FASTEST" - GetQueryExampleOKBodyQueryExamplesItems0ExampleTypeEXAMPLETYPEFASTEST string = "EXAMPLE_TYPE_FASTEST" - - // GetQueryExampleOKBodyQueryExamplesItems0ExampleTypeEXAMPLETYPEWITHERROR captures enum value "EXAMPLE_TYPE_WITH_ERROR" - GetQueryExampleOKBodyQueryExamplesItems0ExampleTypeEXAMPLETYPEWITHERROR string = "EXAMPLE_TYPE_WITH_ERROR" -) - -// prop value enum -func (o *GetQueryExampleOKBodyQueryExamplesItems0) validateExampleTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, getQueryExampleOkBodyQueryExamplesItems0TypeExampleTypePropEnum, true); err != nil { - return err - } - return nil -} - -func (o *GetQueryExampleOKBodyQueryExamplesItems0) validateExampleType(formats strfmt.Registry) error { - if swag.IsZero(o.ExampleType) { // not required - return nil - } - - // value enum - if err := o.validateExampleTypeEnum("example_type", "body", *o.ExampleType); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this get query example OK body query examples items0 based on context it is used -func (o *GetQueryExampleOKBodyQueryExamplesItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetQueryExampleOKBodyQueryExamplesItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetQueryExampleOKBodyQueryExamplesItems0) UnmarshalBinary(b []byte) error { - var res GetQueryExampleOKBodyQueryExamplesItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetQueryExampleParamsBodyLabelsItems0 MapFieldEntry allows to pass labels/dimensions in form like {"server": ["db1", "db2"...]}. -swagger:model GetQueryExampleParamsBodyLabelsItems0 -*/ -type GetQueryExampleParamsBodyLabelsItems0 struct { - // key - Key string `json:"key,omitempty"` - - // value - Value []string `json:"value"` -} - -// Validate validates this get query example params body labels items0 -func (o *GetQueryExampleParamsBodyLabelsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get query example params body labels items0 based on context it is used -func (o *GetQueryExampleParamsBodyLabelsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetQueryExampleParamsBodyLabelsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetQueryExampleParamsBodyLabelsItems0) UnmarshalBinary(b []byte) error { - var res GetQueryExampleParamsBodyLabelsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/qan/v1/json/client/qan_service/get_query_plan_parameters.go b/api/qan/v1/json/client/qan_service/get_query_plan_parameters.go deleted file mode 100644 index 3d949920218..00000000000 --- a/api/qan/v1/json/client/qan_service/get_query_plan_parameters.go +++ /dev/null @@ -1,146 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package qan_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" -) - -// NewGetQueryPlanParams creates a new GetQueryPlanParams 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 NewGetQueryPlanParams() *GetQueryPlanParams { - return &GetQueryPlanParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetQueryPlanParamsWithTimeout creates a new GetQueryPlanParams object -// with the ability to set a timeout on a request. -func NewGetQueryPlanParamsWithTimeout(timeout time.Duration) *GetQueryPlanParams { - return &GetQueryPlanParams{ - timeout: timeout, - } -} - -// NewGetQueryPlanParamsWithContext creates a new GetQueryPlanParams object -// with the ability to set a context for a request. -func NewGetQueryPlanParamsWithContext(ctx context.Context) *GetQueryPlanParams { - return &GetQueryPlanParams{ - Context: ctx, - } -} - -// NewGetQueryPlanParamsWithHTTPClient creates a new GetQueryPlanParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetQueryPlanParamsWithHTTPClient(client *http.Client) *GetQueryPlanParams { - return &GetQueryPlanParams{ - HTTPClient: client, - } -} - -/* -GetQueryPlanParams contains all the parameters to send to the API endpoint - - for the get query plan operation. - - Typically these are written to a http.Request. -*/ -type GetQueryPlanParams struct { - // Queryid. - Queryid string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get query plan params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetQueryPlanParams) WithDefaults() *GetQueryPlanParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get query plan params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetQueryPlanParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the get query plan params -func (o *GetQueryPlanParams) WithTimeout(timeout time.Duration) *GetQueryPlanParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get query plan params -func (o *GetQueryPlanParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get query plan params -func (o *GetQueryPlanParams) WithContext(ctx context.Context) *GetQueryPlanParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get query plan params -func (o *GetQueryPlanParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get query plan params -func (o *GetQueryPlanParams) WithHTTPClient(client *http.Client) *GetQueryPlanParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get query plan params -func (o *GetQueryPlanParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithQueryid adds the queryid to the get query plan params -func (o *GetQueryPlanParams) WithQueryid(queryid string) *GetQueryPlanParams { - o.SetQueryid(queryid) - return o -} - -// SetQueryid adds the queryid to the get query plan params -func (o *GetQueryPlanParams) SetQueryid(queryid string) { - o.Queryid = queryid -} - -// WriteToRequest writes these params to a swagger request -func (o *GetQueryPlanParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param queryid - if err := r.SetPathParam("queryid", o.Queryid); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/api/qan/v1/json/client/qan_service/get_query_plan_responses.go b/api/qan/v1/json/client/qan_service/get_query_plan_responses.go deleted file mode 100644 index a5d3157a37a..00000000000 --- a/api/qan/v1/json/client/qan_service/get_query_plan_responses.go +++ /dev/null @@ -1,456 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package qan_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" -) - -// GetQueryPlanReader is a Reader for the GetQueryPlan structure. -type GetQueryPlanReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetQueryPlanReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewGetQueryPlanOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewGetQueryPlanDefault(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 - } -} - -// NewGetQueryPlanOK creates a GetQueryPlanOK with default headers values -func NewGetQueryPlanOK() *GetQueryPlanOK { - return &GetQueryPlanOK{} -} - -/* -GetQueryPlanOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type GetQueryPlanOK struct { - Payload *GetQueryPlanOKBody -} - -// IsSuccess returns true when this get query plan Ok response has a 2xx status code -func (o *GetQueryPlanOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this get query plan Ok response has a 3xx status code -func (o *GetQueryPlanOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this get query plan Ok response has a 4xx status code -func (o *GetQueryPlanOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this get query plan Ok response has a 5xx status code -func (o *GetQueryPlanOK) IsServerError() bool { - return false -} - -// IsCode returns true when this get query plan Ok response a status code equal to that given -func (o *GetQueryPlanOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the get query plan Ok response -func (o *GetQueryPlanOK) Code() int { - return 200 -} - -func (o *GetQueryPlanOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/qan/query/{queryid}/plan][%d] getQueryPlanOk %s", 200, payload) -} - -func (o *GetQueryPlanOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/qan/query/{queryid}/plan][%d] getQueryPlanOk %s", 200, payload) -} - -func (o *GetQueryPlanOK) GetPayload() *GetQueryPlanOKBody { - return o.Payload -} - -func (o *GetQueryPlanOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(GetQueryPlanOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -// NewGetQueryPlanDefault creates a GetQueryPlanDefault with default headers values -func NewGetQueryPlanDefault(code int) *GetQueryPlanDefault { - return &GetQueryPlanDefault{ - _statusCode: code, - } -} - -/* -GetQueryPlanDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type GetQueryPlanDefault struct { - _statusCode int - - Payload *GetQueryPlanDefaultBody -} - -// IsSuccess returns true when this get query plan default response has a 2xx status code -func (o *GetQueryPlanDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this get query plan default response has a 3xx status code -func (o *GetQueryPlanDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this get query plan default response has a 4xx status code -func (o *GetQueryPlanDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this get query plan default response has a 5xx status code -func (o *GetQueryPlanDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this get query plan default response a status code equal to that given -func (o *GetQueryPlanDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the get query plan default response -func (o *GetQueryPlanDefault) Code() int { - return o._statusCode -} - -func (o *GetQueryPlanDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/qan/query/{queryid}/plan][%d] GetQueryPlan default %s", o._statusCode, payload) -} - -func (o *GetQueryPlanDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/qan/query/{queryid}/plan][%d] GetQueryPlan default %s", o._statusCode, payload) -} - -func (o *GetQueryPlanDefault) GetPayload() *GetQueryPlanDefaultBody { - return o.Payload -} - -func (o *GetQueryPlanDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(GetQueryPlanDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -GetQueryPlanDefaultBody get query plan default body -swagger:model GetQueryPlanDefaultBody -*/ -type GetQueryPlanDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*GetQueryPlanDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this get query plan default body -func (o *GetQueryPlanDefaultBody) 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 *GetQueryPlanDefaultBody) 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("GetQueryPlan default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("GetQueryPlan default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this get query plan default body based on the context it is used -func (o *GetQueryPlanDefaultBody) 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 *GetQueryPlanDefaultBody) 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("GetQueryPlan default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("GetQueryPlan default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetQueryPlanDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetQueryPlanDefaultBody) UnmarshalBinary(b []byte) error { - var res GetQueryPlanDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetQueryPlanDefaultBodyDetailsItems0 get query plan default body details items0 -swagger:model GetQueryPlanDefaultBodyDetailsItems0 -*/ -type GetQueryPlanDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` - - // get query plan default body details items0 - GetQueryPlanDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *GetQueryPlanDefaultBodyDetailsItems0) 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 GetQueryPlanDefaultBodyDetailsItems0 - - 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.GetQueryPlanDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o GetQueryPlanDefaultBodyDetailsItems0) 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.GetQueryPlanDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.GetQueryPlanDefaultBodyDetailsItems0) - 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 get query plan default body details items0 -func (o *GetQueryPlanDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get query plan default body details items0 based on context it is used -func (o *GetQueryPlanDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetQueryPlanDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetQueryPlanDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res GetQueryPlanDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetQueryPlanOKBody GetQueryPlanResponse contains planid and query_plan. -swagger:model GetQueryPlanOKBody -*/ -type GetQueryPlanOKBody struct { - // planid - Planid string `json:"planid,omitempty"` - - // query plan - QueryPlan string `json:"query_plan,omitempty"` -} - -// Validate validates this get query plan OK body -func (o *GetQueryPlanOKBody) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get query plan OK body based on context it is used -func (o *GetQueryPlanOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetQueryPlanOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetQueryPlanOKBody) UnmarshalBinary(b []byte) error { - var res GetQueryPlanOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/qan/v1/json/client/qan_service/get_report_parameters.go b/api/qan/v1/json/client/qan_service/get_report_parameters.go deleted file mode 100644 index 41494719a45..00000000000 --- a/api/qan/v1/json/client/qan_service/get_report_parameters.go +++ /dev/null @@ -1,147 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package qan_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" -) - -// NewGetReportParams creates a new GetReportParams 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 NewGetReportParams() *GetReportParams { - return &GetReportParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetReportParamsWithTimeout creates a new GetReportParams object -// with the ability to set a timeout on a request. -func NewGetReportParamsWithTimeout(timeout time.Duration) *GetReportParams { - return &GetReportParams{ - timeout: timeout, - } -} - -// NewGetReportParamsWithContext creates a new GetReportParams object -// with the ability to set a context for a request. -func NewGetReportParamsWithContext(ctx context.Context) *GetReportParams { - return &GetReportParams{ - Context: ctx, - } -} - -// NewGetReportParamsWithHTTPClient creates a new GetReportParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetReportParamsWithHTTPClient(client *http.Client) *GetReportParams { - return &GetReportParams{ - HTTPClient: client, - } -} - -/* -GetReportParams contains all the parameters to send to the API endpoint - - for the get report operation. - - Typically these are written to a http.Request. -*/ -type GetReportParams struct { - /* Body. - - ReportRequest defines filtering of metrics report for db server or other dimentions. - */ - Body GetReportBody - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get report params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetReportParams) WithDefaults() *GetReportParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get report params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetReportParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the get report params -func (o *GetReportParams) WithTimeout(timeout time.Duration) *GetReportParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get report params -func (o *GetReportParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get report params -func (o *GetReportParams) WithContext(ctx context.Context) *GetReportParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get report params -func (o *GetReportParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get report params -func (o *GetReportParams) WithHTTPClient(client *http.Client) *GetReportParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get report params -func (o *GetReportParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the get report params -func (o *GetReportParams) WithBody(body GetReportBody) *GetReportParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the get report params -func (o *GetReportParams) SetBody(body GetReportBody) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *GetReportParams) 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/qan/v1/json/client/qan_service/get_report_responses.go b/api/qan/v1/json/client/qan_service/get_report_responses.go deleted file mode 100644 index f39af5c3994..00000000000 --- a/api/qan/v1/json/client/qan_service/get_report_responses.go +++ /dev/null @@ -1,1357 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package qan_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" -) - -// GetReportReader is a Reader for the GetReport structure. -type GetReportReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetReportReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewGetReportOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewGetReportDefault(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 - } -} - -// NewGetReportOK creates a GetReportOK with default headers values -func NewGetReportOK() *GetReportOK { - return &GetReportOK{} -} - -/* -GetReportOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type GetReportOK struct { - Payload *GetReportOKBody -} - -// IsSuccess returns true when this get report Ok response has a 2xx status code -func (o *GetReportOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this get report Ok response has a 3xx status code -func (o *GetReportOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this get report Ok response has a 4xx status code -func (o *GetReportOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this get report Ok response has a 5xx status code -func (o *GetReportOK) IsServerError() bool { - return false -} - -// IsCode returns true when this get report Ok response a status code equal to that given -func (o *GetReportOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the get report Ok response -func (o *GetReportOK) Code() int { - return 200 -} - -func (o *GetReportOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/qan/metrics:getReport][%d] getReportOk %s", 200, payload) -} - -func (o *GetReportOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/qan/metrics:getReport][%d] getReportOk %s", 200, payload) -} - -func (o *GetReportOK) GetPayload() *GetReportOKBody { - return o.Payload -} - -func (o *GetReportOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(GetReportOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -// NewGetReportDefault creates a GetReportDefault with default headers values -func NewGetReportDefault(code int) *GetReportDefault { - return &GetReportDefault{ - _statusCode: code, - } -} - -/* -GetReportDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type GetReportDefault struct { - _statusCode int - - Payload *GetReportDefaultBody -} - -// IsSuccess returns true when this get report default response has a 2xx status code -func (o *GetReportDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this get report default response has a 3xx status code -func (o *GetReportDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this get report default response has a 4xx status code -func (o *GetReportDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this get report default response has a 5xx status code -func (o *GetReportDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this get report default response a status code equal to that given -func (o *GetReportDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the get report default response -func (o *GetReportDefault) Code() int { - return o._statusCode -} - -func (o *GetReportDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/qan/metrics:getReport][%d] GetReport default %s", o._statusCode, payload) -} - -func (o *GetReportDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/qan/metrics:getReport][%d] GetReport default %s", o._statusCode, payload) -} - -func (o *GetReportDefault) GetPayload() *GetReportDefaultBody { - return o.Payload -} - -func (o *GetReportDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(GetReportDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -GetReportBody ReportRequest defines filtering of metrics report for db server or other dimentions. -swagger:model GetReportBody -*/ -type GetReportBody struct { - // period start from - // Format: date-time - PeriodStartFrom strfmt.DateTime `json:"period_start_from,omitempty"` - - // period start to - // Format: date-time - PeriodStartTo strfmt.DateTime `json:"period_start_to,omitempty"` - - // group by - GroupBy string `json:"group_by,omitempty"` - - // labels - Labels []*GetReportParamsBodyLabelsItems0 `json:"labels"` - - // columns - Columns []string `json:"columns"` - - // order by - OrderBy string `json:"order_by,omitempty"` - - // offset - Offset int64 `json:"offset,omitempty"` - - // limit - Limit int64 `json:"limit,omitempty"` - - // main metric - MainMetric string `json:"main_metric,omitempty"` - - // search - Search string `json:"search,omitempty"` -} - -// Validate validates this get report body -func (o *GetReportBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validatePeriodStartFrom(formats); err != nil { - res = append(res, err) - } - - if err := o.validatePeriodStartTo(formats); err != nil { - res = append(res, err) - } - - if err := o.validateLabels(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetReportBody) validatePeriodStartFrom(formats strfmt.Registry) error { - if swag.IsZero(o.PeriodStartFrom) { // not required - return nil - } - - if err := validate.FormatOf("body"+"."+"period_start_from", "body", "date-time", o.PeriodStartFrom.String(), formats); err != nil { - return err - } - - return nil -} - -func (o *GetReportBody) validatePeriodStartTo(formats strfmt.Registry) error { - if swag.IsZero(o.PeriodStartTo) { // not required - return nil - } - - if err := validate.FormatOf("body"+"."+"period_start_to", "body", "date-time", o.PeriodStartTo.String(), formats); err != nil { - return err - } - - return nil -} - -func (o *GetReportBody) validateLabels(formats strfmt.Registry) error { - if swag.IsZero(o.Labels) { // not required - return nil - } - - for i := 0; i < len(o.Labels); i++ { - if swag.IsZero(o.Labels[i]) { // not required - continue - } - - if o.Labels[i] != nil { - if err := o.Labels[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "labels" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "labels" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this get report body based on the context it is used -func (o *GetReportBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateLabels(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetReportBody) contextValidateLabels(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Labels); i++ { - if o.Labels[i] != nil { - - if swag.IsZero(o.Labels[i]) { // not required - return nil - } - - if err := o.Labels[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "labels" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "labels" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetReportBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetReportBody) UnmarshalBinary(b []byte) error { - var res GetReportBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetReportDefaultBody get report default body -swagger:model GetReportDefaultBody -*/ -type GetReportDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*GetReportDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this get report default body -func (o *GetReportDefaultBody) 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 *GetReportDefaultBody) 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("GetReport default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("GetReport default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this get report default body based on the context it is used -func (o *GetReportDefaultBody) 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 *GetReportDefaultBody) 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("GetReport default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("GetReport default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetReportDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetReportDefaultBody) UnmarshalBinary(b []byte) error { - var res GetReportDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetReportDefaultBodyDetailsItems0 get report default body details items0 -swagger:model GetReportDefaultBodyDetailsItems0 -*/ -type GetReportDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` - - // get report default body details items0 - GetReportDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *GetReportDefaultBodyDetailsItems0) 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 GetReportDefaultBodyDetailsItems0 - - 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.GetReportDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o GetReportDefaultBodyDetailsItems0) 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.GetReportDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.GetReportDefaultBodyDetailsItems0) - 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 get report default body details items0 -func (o *GetReportDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get report default body details items0 based on context it is used -func (o *GetReportDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetReportDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetReportDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res GetReportDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetReportOKBody ReportReply is list of reports per quieryids, hosts etc. -swagger:model GetReportOKBody -*/ -type GetReportOKBody struct { - // total rows - TotalRows int64 `json:"total_rows,omitempty"` - - // offset - Offset int64 `json:"offset,omitempty"` - - // limit - Limit int64 `json:"limit,omitempty"` - - // rows - Rows []*GetReportOKBodyRowsItems0 `json:"rows"` -} - -// Validate validates this get report OK body -func (o *GetReportOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateRows(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetReportOKBody) validateRows(formats strfmt.Registry) error { - if swag.IsZero(o.Rows) { // not required - return nil - } - - for i := 0; i < len(o.Rows); i++ { - if swag.IsZero(o.Rows[i]) { // not required - continue - } - - if o.Rows[i] != nil { - if err := o.Rows[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getReportOk" + "." + "rows" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getReportOk" + "." + "rows" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this get report OK body based on the context it is used -func (o *GetReportOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateRows(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetReportOKBody) contextValidateRows(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Rows); i++ { - if o.Rows[i] != nil { - - if swag.IsZero(o.Rows[i]) { // not required - return nil - } - - if err := o.Rows[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getReportOk" + "." + "rows" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getReportOk" + "." + "rows" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetReportOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetReportOKBody) UnmarshalBinary(b []byte) error { - var res GetReportOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetReportOKBodyRowsItems0 Row define metrics for selected dimention. -swagger:model GetReportOKBodyRowsItems0 -*/ -type GetReportOKBodyRowsItems0 struct { - // rank - Rank int64 `json:"rank,omitempty"` - - // dimension - Dimension string `json:"dimension,omitempty"` - - // database - Database string `json:"database,omitempty"` - - // metrics - Metrics map[string]GetReportOKBodyRowsItems0MetricsAnon `json:"metrics,omitempty"` - - // sparkline - Sparkline []*GetReportOKBodyRowsItems0SparklineItems0 `json:"sparkline"` - - // fingerprint - Fingerprint string `json:"fingerprint,omitempty"` - - // num queries - NumQueries int64 `json:"num_queries,omitempty"` - - // qps - QPS float32 `json:"qps,omitempty"` - - // load - Load float32 `json:"load,omitempty"` -} - -// Validate validates this get report OK body rows items0 -func (o *GetReportOKBodyRowsItems0) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateMetrics(formats); err != nil { - res = append(res, err) - } - - if err := o.validateSparkline(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetReportOKBodyRowsItems0) validateMetrics(formats strfmt.Registry) error { - if swag.IsZero(o.Metrics) { // not required - return nil - } - - for k := range o.Metrics { - - if swag.IsZero(o.Metrics[k]) { // not required - continue - } - if val, ok := o.Metrics[k]; ok { - if err := val.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("metrics" + "." + k) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("metrics" + "." + k) - } - - return err - } - } - - } - - return nil -} - -func (o *GetReportOKBodyRowsItems0) validateSparkline(formats strfmt.Registry) error { - if swag.IsZero(o.Sparkline) { // not required - return nil - } - - for i := 0; i < len(o.Sparkline); i++ { - if swag.IsZero(o.Sparkline[i]) { // not required - continue - } - - if o.Sparkline[i] != nil { - if err := o.Sparkline[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("sparkline" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("sparkline" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this get report OK body rows items0 based on the context it is used -func (o *GetReportOKBodyRowsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateMetrics(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateSparkline(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetReportOKBodyRowsItems0) contextValidateMetrics(ctx context.Context, formats strfmt.Registry) error { - for k := range o.Metrics { - if val, ok := o.Metrics[k]; ok { - if err := val.ContextValidate(ctx, formats); err != nil { - return err - } - } - } - - return nil -} - -func (o *GetReportOKBodyRowsItems0) contextValidateSparkline(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Sparkline); i++ { - if o.Sparkline[i] != nil { - - if swag.IsZero(o.Sparkline[i]) { // not required - return nil - } - - if err := o.Sparkline[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("sparkline" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("sparkline" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetReportOKBodyRowsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetReportOKBodyRowsItems0) UnmarshalBinary(b []byte) error { - var res GetReportOKBodyRowsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetReportOKBodyRowsItems0MetricsAnon Metric cell. -swagger:model GetReportOKBodyRowsItems0MetricsAnon -*/ -type GetReportOKBodyRowsItems0MetricsAnon struct { - // stats - Stats *GetReportOKBodyRowsItems0MetricsAnonStats `json:"stats,omitempty"` -} - -// Validate validates this get report OK body rows items0 metrics anon -func (o *GetReportOKBodyRowsItems0MetricsAnon) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateStats(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetReportOKBodyRowsItems0MetricsAnon) validateStats(formats strfmt.Registry) error { - if swag.IsZero(o.Stats) { // not required - return nil - } - - if o.Stats != nil { - if err := o.Stats.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("stats") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("stats") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this get report OK body rows items0 metrics anon based on the context it is used -func (o *GetReportOKBodyRowsItems0MetricsAnon) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateStats(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetReportOKBodyRowsItems0MetricsAnon) contextValidateStats(ctx context.Context, formats strfmt.Registry) error { - if o.Stats != nil { - - if swag.IsZero(o.Stats) { // not required - return nil - } - - if err := o.Stats.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("stats") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("stats") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetReportOKBodyRowsItems0MetricsAnon) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetReportOKBodyRowsItems0MetricsAnon) UnmarshalBinary(b []byte) error { - var res GetReportOKBodyRowsItems0MetricsAnon - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetReportOKBodyRowsItems0MetricsAnonStats Stat is statistics of specific metric. -swagger:model GetReportOKBodyRowsItems0MetricsAnonStats -*/ -type GetReportOKBodyRowsItems0MetricsAnonStats struct { - // rate - Rate float32 `json:"rate,omitempty"` - - // cnt - Cnt float32 `json:"cnt,omitempty"` - - // sum - Sum float32 `json:"sum,omitempty"` - - // min - Min float32 `json:"min,omitempty"` - - // max - Max float32 `json:"max,omitempty"` - - // p99 - P99 float32 `json:"p99,omitempty"` - - // avg - Avg float32 `json:"avg,omitempty"` - - // sum per sec - SumPerSec float32 `json:"sum_per_sec,omitempty"` -} - -// Validate validates this get report OK body rows items0 metrics anon stats -func (o *GetReportOKBodyRowsItems0MetricsAnonStats) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get report OK body rows items0 metrics anon stats based on context it is used -func (o *GetReportOKBodyRowsItems0MetricsAnonStats) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetReportOKBodyRowsItems0MetricsAnonStats) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetReportOKBodyRowsItems0MetricsAnonStats) UnmarshalBinary(b []byte) error { - var res GetReportOKBodyRowsItems0MetricsAnonStats - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetReportOKBodyRowsItems0SparklineItems0 Point contains values that represents abscissa (time) and ordinate (volume etc.) -// of every point in a coordinate system of Sparklines. -swagger:model GetReportOKBodyRowsItems0SparklineItems0 -*/ -type GetReportOKBodyRowsItems0SparklineItems0 struct { - // The serial number of the chart point from the largest time in the time interval to the lowest time in the time range. - Point int64 `json:"point,omitempty"` - - // Duration beetween two points. - TimeFrame int64 `json:"time_frame,omitempty"` - - // Time of point in format RFC3339. - Timestamp string `json:"timestamp,omitempty"` - - // load is query_time / time_range. - Load float32 `json:"load,omitempty"` - - // number of queries in bucket. - NumQueriesPerSec float32 `json:"num_queries_per_sec,omitempty"` - - // number of queries with errors. - NumQueriesWithErrorsPerSec float32 `json:"num_queries_with_errors_per_sec,omitempty"` - - // number of queries with warnings. - NumQueriesWithWarningsPerSec float32 `json:"num_queries_with_warnings_per_sec,omitempty"` - - // The statement execution time in seconds. - MQueryTimeSumPerSec float32 `json:"m_query_time_sum_per_sec,omitempty"` - - // The time to acquire locks in seconds. - MLockTimeSumPerSec float32 `json:"m_lock_time_sum_per_sec,omitempty"` - - // The number of rows sent to the client. - MRowsSentSumPerSec float32 `json:"m_rows_sent_sum_per_sec,omitempty"` - - // Number of rows scanned - SELECT. - MRowsExaminedSumPerSec float32 `json:"m_rows_examined_sum_per_sec,omitempty"` - - // Number of rows changed - UPDATE, DELETE, INSERT. - MRowsAffectedSumPerSec float32 `json:"m_rows_affected_sum_per_sec,omitempty"` - - // The number of rows read from tables. - MRowsReadSumPerSec float32 `json:"m_rows_read_sum_per_sec,omitempty"` - - // The number of merge passes that the sort algorithm has had to do. - MMergePassesSumPerSec float32 `json:"m_merge_passes_sum_per_sec,omitempty"` - - // Counts the number of page read operations scheduled. - MInnodbIorOpsSumPerSec float32 `json:"m_innodb_io_r_ops_sum_per_sec,omitempty"` - - // Similar to innodb_IO_r_ops, but the unit is bytes. - MInnodbIorBytesSumPerSec float32 `json:"m_innodb_io_r_bytes_sum_per_sec,omitempty"` - - // Shows how long (in seconds) it took InnoDB to actually read the data from storage. - MInnodbIorWaitSumPerSec float32 `json:"m_innodb_io_r_wait_sum_per_sec,omitempty"` - - // Shows how long (in seconds) the query waited for row locks. - MInnodbRecLockWaitSumPerSec float32 `json:"m_innodb_rec_lock_wait_sum_per_sec,omitempty"` - - // Shows how long (in seconds) the query spent either waiting to enter the InnoDB queue or inside that queue waiting for execution. - MInnodbQueueWaitSumPerSec float32 `json:"m_innodb_queue_wait_sum_per_sec,omitempty"` - - // Counts approximately the number of unique pages the query accessed. - MInnodbPagesDistinctSumPerSec float32 `json:"m_innodb_pages_distinct_sum_per_sec,omitempty"` - - // Shows how long the query is. - MQueryLengthSumPerSec float32 `json:"m_query_length_sum_per_sec,omitempty"` - - // The number of bytes sent to all clients. - MBytesSentSumPerSec float32 `json:"m_bytes_sent_sum_per_sec,omitempty"` - - // Number of temporary tables created on memory for the query. - MTmpTablesSumPerSec float32 `json:"m_tmp_tables_sum_per_sec,omitempty"` - - // Number of temporary tables created on disk for the query. - MTmpDiskTablesSumPerSec float32 `json:"m_tmp_disk_tables_sum_per_sec,omitempty"` - - // Total Size in bytes for all temporary tables used in the query. - MTmpTableSizesSumPerSec float32 `json:"m_tmp_table_sizes_sum_per_sec,omitempty"` - - // Query Cache hits. - MQcHitSumPerSec float32 `json:"m_qc_hit_sum_per_sec,omitempty"` - - // The query performed a full table scan. - MFullScanSumPerSec float32 `json:"m_full_scan_sum_per_sec,omitempty"` - - // The query performed a full join (a join without indexes). - MFullJoinSumPerSec float32 `json:"m_full_join_sum_per_sec,omitempty"` - - // The query created an implicit internal temporary table. - MTmpTableSumPerSec float32 `json:"m_tmp_table_sum_per_sec,omitempty"` - - // The querys temporary table was stored on disk. - MTmpTableOnDiskSumPerSec float32 `json:"m_tmp_table_on_disk_sum_per_sec,omitempty"` - - // The query used a filesort. - MFilesortSumPerSec float32 `json:"m_filesort_sum_per_sec,omitempty"` - - // The filesort was performed on disk. - MFilesortOnDiskSumPerSec float32 `json:"m_filesort_on_disk_sum_per_sec,omitempty"` - - // The number of joins that used a range search on a reference table. - MSelectFullRangeJoinSumPerSec float32 `json:"m_select_full_range_join_sum_per_sec,omitempty"` - - // The number of joins that used ranges on the first table. - MSelectRangeSumPerSec float32 `json:"m_select_range_sum_per_sec,omitempty"` - - // The number of joins without keys that check for key usage after each row. - MSelectRangeCheckSumPerSec float32 `json:"m_select_range_check_sum_per_sec,omitempty"` - - // The number of sorts that were done using ranges. - MSortRangeSumPerSec float32 `json:"m_sort_range_sum_per_sec,omitempty"` - - // The number of sorted rows. - MSortRowsSumPerSec float32 `json:"m_sort_rows_sum_per_sec,omitempty"` - - // The number of sorts that were done by scanning the table. - MSortScanSumPerSec float32 `json:"m_sort_scan_sum_per_sec,omitempty"` - - // The number of queries without index. - MNoIndexUsedSumPerSec float32 `json:"m_no_index_used_sum_per_sec,omitempty"` - - // The number of queries without good index. - MNoGoodIndexUsedSumPerSec float32 `json:"m_no_good_index_used_sum_per_sec,omitempty"` - - // The number of returned documents. - MDocsReturnedSumPerSec float32 `json:"m_docs_returned_sum_per_sec,omitempty"` - - // The response length of the query result in bytes. - MResponseLengthSumPerSec float32 `json:"m_response_length_sum_per_sec,omitempty"` - - // The number of scanned documents. - MDocsScannedSumPerSec float32 `json:"m_docs_scanned_sum_per_sec,omitempty"` - - // Total number of documents scanned during query execution. - MDocsExaminedSumPerSec float32 `json:"m_docs_examined_sum_per_sec,omitempty"` - - // Total number of index keys scanned during query execution. - MKeysExaminedSumPerSec float32 `json:"m_keys_examined_sum_per_sec,omitempty"` - - // Number of times a global read lock was acquired during query execution. - MLocksGlobalAcquireCountReadSharedSumPerSec float32 `json:"m_locks_global_acquire_count_read_shared_sum_per_sec,omitempty"` - - // Number of times a global write lock was acquired during query execution. - MLocksGlobalAcquireCountWriteSharedSumPerSec float32 `json:"m_locks_global_acquire_count_write_shared_sum_per_sec,omitempty"` - - // Number of times a read lock was acquired at the database level during query execution. - MLocksDatabaseAcquireCountReadSharedSumPerSec float32 `json:"m_locks_database_acquire_count_read_shared_sum_per_sec,omitempty"` - - // Number of times a read lock at the database level was requested but had to wait before being granted. - MLocksDatabaseAcquireWaitCountReadSharedSumPerSec float32 `json:"m_locks_database_acquire_wait_count_read_shared_sum_per_sec,omitempty"` - - // Indicates the time, spent acquiring a read lock at the database level during an operation. - MLocksDatabaseTimeAcquiringMicrosReadSharedSumPerSec float32 `json:"m_locks_database_time_acquiring_micros_read_shared_sum_per_sec,omitempty"` - - // Number of times a read lock was acquired on a specific collection during operations. - MLocksCollectionAcquireCountReadSharedSumPerSec float32 `json:"m_locks_collection_acquire_count_read_shared_sum_per_sec,omitempty"` - - // Total number of bytes read from storage during a specific operation. - MStorageBytesReadSumPerSec float32 `json:"m_storage_bytes_read_sum_per_sec,omitempty"` - - // Indicates the time, spent reading data from storage during an operation. - MStorageTimeReadingMicrosSumPerSec float32 `json:"m_storage_time_reading_micros_sum_per_sec,omitempty"` - - // Total number of shared block cache hits by the statement. - MSharedBlksHitSumPerSec float32 `json:"m_shared_blks_hit_sum_per_sec,omitempty"` - - // Total number of shared blocks read by the statement. - MSharedBlksReadSumPerSec float32 `json:"m_shared_blks_read_sum_per_sec,omitempty"` - - // Total number of shared blocks dirtied by the statement. - MSharedBlksDirtiedSumPerSec float32 `json:"m_shared_blks_dirtied_sum_per_sec,omitempty"` - - // Total number of shared blocks written by the statement. - MSharedBlksWrittenSumPerSec float32 `json:"m_shared_blks_written_sum_per_sec,omitempty"` - - // Total time the statement spent reading shared blocks, in milliseconds (if track_io_timing is enabled, otherwise zero). - MSharedBlkReadTimeSumPerSec float32 `json:"m_shared_blk_read_time_sum_per_sec,omitempty"` - - // Total time the statement spent writing shared blocks, in milliseconds (if track_io_timing is enabled, otherwise zero). - MSharedBlkWriteTimeSumPerSec float32 `json:"m_shared_blk_write_time_sum_per_sec,omitempty"` - - // Total time the statement spent reading shared blocks, in milliseconds (if track_io_timing is enabled, otherwise zero). - MLocalBlkReadTimeSumPerSec float32 `json:"m_local_blk_read_time_sum_per_sec,omitempty"` - - // Total time the statement spent writing shared blocks, in milliseconds (if track_io_timing is enabled, otherwise zero). - MLocalBlkWriteTimeSumPerSec float32 `json:"m_local_blk_write_time_sum_per_sec,omitempty"` - - // Total number of local block cache hits by the statement. - MLocalBlksHitSumPerSec float32 `json:"m_local_blks_hit_sum_per_sec,omitempty"` - - // Total number of local blocks read by the statement. - MLocalBlksReadSumPerSec float32 `json:"m_local_blks_read_sum_per_sec,omitempty"` - - // Total number of local blocks dirtied by the statement. - MLocalBlksDirtiedSumPerSec float32 `json:"m_local_blks_dirtied_sum_per_sec,omitempty"` - - // Total number of local blocks written by the statement. - MLocalBlksWrittenSumPerSec float32 `json:"m_local_blks_written_sum_per_sec,omitempty"` - - // Total number of temp blocks read by the statement. - MTempBlksReadSumPerSec float32 `json:"m_temp_blks_read_sum_per_sec,omitempty"` - - // Total number of temp blocks written by the statement. - MTempBlksWrittenSumPerSec float32 `json:"m_temp_blks_written_sum_per_sec,omitempty"` - - // Total time the statement spent reading blocks, in milliseconds (if track_io_timing is enabled, otherwise zero). - MBlkReadTimeSumPerSec float32 `json:"m_blk_read_time_sum_per_sec,omitempty"` - - // Total time the statement spent writing blocks, in milliseconds (if track_io_timing is enabled, otherwise zero). - MBlkWriteTimeSumPerSec float32 `json:"m_blk_write_time_sum_per_sec,omitempty"` - - // Total time user spent in query. - MCPUUserTimeSumPerSec float32 `json:"m_cpu_user_time_sum_per_sec,omitempty"` - - // Total time system spent in query. - MCPUSysTimeSumPerSec float32 `json:"m_cpu_sys_time_sum_per_sec,omitempty"` - - // Total number of planned calls. - MPlansCallsSumPerSec float32 `json:"m_plans_calls_sum_per_sec,omitempty"` - - // Total number of WAL (Write-ahead logging) records. - MWalRecordsSumPerSec float32 `json:"m_wal_records_sum_per_sec,omitempty"` - - // Total number of FPI (full page images) in WAL (Write-ahead logging) records. - MWalFpiSumPerSec float32 `json:"m_wal_fpi_sum_per_sec,omitempty"` - - // Total bytes of WAL (Write-ahead logging) records. - MWalBytesSumPerSec float32 `json:"m_wal_bytes_sum_per_sec,omitempty"` - - // Plan time in per seconds. - MPlanTimeSumPerSec float32 `json:"m_plan_time_sum_per_sec,omitempty"` -} - -// Validate validates this get report OK body rows items0 sparkline items0 -func (o *GetReportOKBodyRowsItems0SparklineItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get report OK body rows items0 sparkline items0 based on context it is used -func (o *GetReportOKBodyRowsItems0SparklineItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetReportOKBodyRowsItems0SparklineItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetReportOKBodyRowsItems0SparklineItems0) UnmarshalBinary(b []byte) error { - var res GetReportOKBodyRowsItems0SparklineItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetReportParamsBodyLabelsItems0 ReportMapFieldEntry allows to pass labels/dimentions in form like {"server": ["db1", "db2"...]}. -swagger:model GetReportParamsBodyLabelsItems0 -*/ -type GetReportParamsBodyLabelsItems0 struct { - // key - Key string `json:"key,omitempty"` - - // value - Value []string `json:"value"` -} - -// Validate validates this get report params body labels items0 -func (o *GetReportParamsBodyLabelsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get report params body labels items0 based on context it is used -func (o *GetReportParamsBodyLabelsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetReportParamsBodyLabelsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetReportParamsBodyLabelsItems0) UnmarshalBinary(b []byte) error { - var res GetReportParamsBodyLabelsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/qan/v1/json/client/qan_service/qan_service_client.go b/api/qan/v1/json/client/qan_service/qan_service_client.go deleted file mode 100644 index 855a5bef66e..00000000000 --- a/api/qan/v1/json/client/qan_service/qan_service_client.go +++ /dev/null @@ -1,569 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package qan_service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// New creates a new qan service API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -// New creates a new qan service API client with basic auth credentials. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - user: user for basic authentication header. -// - password: password for basic authentication header. -func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BasicAuth(user, password) - return &Client{transport: transport, formats: strfmt.Default} -} - -// New creates a new qan service API client with a bearer token for authentication. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - bearerToken: bearer token for Bearer authentication header. -func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BearerToken(bearerToken) - return &Client{transport: transport, formats: strfmt.Default} -} - -/* -Client for qan service API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption may be used to customize the behavior of Client methods. -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - ExplainFingerprintByQueryID(params *ExplainFingerprintByQueryIDParams, opts ...ClientOption) (*ExplainFingerprintByQueryIDOK, error) - - GetFilteredMetricsNames(params *GetFilteredMetricsNamesParams, opts ...ClientOption) (*GetFilteredMetricsNamesOK, error) - - GetHistogram(params *GetHistogramParams, opts ...ClientOption) (*GetHistogramOK, error) - - GetLabels(params *GetLabelsParams, opts ...ClientOption) (*GetLabelsOK, error) - - GetMetrics(params *GetMetricsParams, opts ...ClientOption) (*GetMetricsOK, error) - - GetMetricsNames(params *GetMetricsNamesParams, opts ...ClientOption) (*GetMetricsNamesOK, error) - - GetQueryExample(params *GetQueryExampleParams, opts ...ClientOption) (*GetQueryExampleOK, error) - - GetQueryPlan(params *GetQueryPlanParams, opts ...ClientOption) (*GetQueryPlanOK, error) - - GetReport(params *GetReportParams, opts ...ClientOption) (*GetReportOK, error) - - QueryExists(params *QueryExistsParams, opts ...ClientOption) (*QueryExistsOK, error) - - SchemaByQueryID(params *SchemaByQueryIDParams, opts ...ClientOption) (*SchemaByQueryIDOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -ExplainFingerprintByQueryID gets explain fingerprint - -Provides an explain fingerprint for given query ID. -*/ -func (a *Client) ExplainFingerprintByQueryID(params *ExplainFingerprintByQueryIDParams, opts ...ClientOption) (*ExplainFingerprintByQueryIDOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewExplainFingerprintByQueryIDParams() - } - op := &runtime.ClientOperation{ - ID: "ExplainFingerprintByQueryID", - Method: "POST", - PathPattern: "/v1/qan:explainFingerprint", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &ExplainFingerprintByQueryIDReader{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.(*ExplainFingerprintByQueryIDOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*ExplainFingerprintByQueryIDDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -GetFilteredMetricsNames gets filters - -Provides a filtered map of metrics names. -*/ -func (a *Client) GetFilteredMetricsNames(params *GetFilteredMetricsNamesParams, opts ...ClientOption) (*GetFilteredMetricsNamesOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewGetFilteredMetricsNamesParams() - } - op := &runtime.ClientOperation{ - ID: "GetFilteredMetricsNames", - Method: "POST", - PathPattern: "/v1/qan/metrics:getFilters", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &GetFilteredMetricsNamesReader{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.(*GetFilteredMetricsNamesOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*GetFilteredMetricsNamesDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -GetHistogram gets histogram - -Provides histogram items for specific filtering. -*/ -func (a *Client) GetHistogram(params *GetHistogramParams, opts ...ClientOption) (*GetHistogramOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewGetHistogramParams() - } - op := &runtime.ClientOperation{ - ID: "GetHistogram", - Method: "POST", - PathPattern: "/v1/qan:getHistogram", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &GetHistogramReader{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.(*GetHistogramOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*GetHistogramDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -GetLabels gets labels - -Provides a list of labels for object details. -*/ -func (a *Client) GetLabels(params *GetLabelsParams, opts ...ClientOption) (*GetLabelsOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewGetLabelsParams() - } - op := &runtime.ClientOperation{ - ID: "GetLabels", - Method: "POST", - PathPattern: "/v1/qan:getLabels", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &GetLabelsReader{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.(*GetLabelsOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*GetLabelsDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -GetMetrics gets metrics - -Provides a map of metrics for specific filtering. -*/ -func (a *Client) GetMetrics(params *GetMetricsParams, opts ...ClientOption) (*GetMetricsOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewGetMetricsParams() - } - op := &runtime.ClientOperation{ - ID: "GetMetrics", - Method: "POST", - PathPattern: "/v1/qan:getMetrics", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &GetMetricsReader{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.(*GetMetricsOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*GetMetricsDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -GetMetricsNames gets metrics names - -Provides a map of all metrics names. -*/ -func (a *Client) GetMetricsNames(params *GetMetricsNamesParams, opts ...ClientOption) (*GetMetricsNamesOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewGetMetricsNamesParams() - } - op := &runtime.ClientOperation{ - ID: "GetMetricsNames", - Method: "POST", - PathPattern: "/v1/qan/metrics:getNames", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &GetMetricsNamesReader{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.(*GetMetricsNamesOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*GetMetricsNamesDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -GetQueryExample gets query example - -Provides a list of query examples. -*/ -func (a *Client) GetQueryExample(params *GetQueryExampleParams, opts ...ClientOption) (*GetQueryExampleOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewGetQueryExampleParams() - } - op := &runtime.ClientOperation{ - ID: "GetQueryExample", - Method: "POST", - PathPattern: "/v1/qan/query:getExample", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &GetQueryExampleReader{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.(*GetQueryExampleOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*GetQueryExampleDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -GetQueryPlan gets query plan - -Provides a query plan and plan id for specific filtering. -*/ -func (a *Client) GetQueryPlan(params *GetQueryPlanParams, opts ...ClientOption) (*GetQueryPlanOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewGetQueryPlanParams() - } - op := &runtime.ClientOperation{ - ID: "GetQueryPlan", - Method: "GET", - PathPattern: "/v1/qan/query/{queryid}/plan", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &GetQueryPlanReader{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.(*GetQueryPlanOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*GetQueryPlanDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -GetReport gets report - -Returns a list of metrics grouped by queryid or other dimensions. -*/ -func (a *Client) GetReport(params *GetReportParams, opts ...ClientOption) (*GetReportOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewGetReportParams() - } - op := &runtime.ClientOperation{ - ID: "GetReport", - Method: "POST", - PathPattern: "/v1/qan/metrics:getReport", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &GetReportReader{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.(*GetReportOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*GetReportDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -QueryExists checks query existence - -Checks if query exists in clickhouse. -*/ -func (a *Client) QueryExists(params *QueryExistsParams, opts ...ClientOption) (*QueryExistsOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewQueryExistsParams() - } - op := &runtime.ClientOperation{ - ID: "QueryExists", - Method: "POST", - PathPattern: "/v1/qan/query:exists", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &QueryExistsReader{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.(*QueryExistsOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*QueryExistsDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -SchemaByQueryID gets schema - -Provides the schema for a given queryID and serviceID. -*/ -func (a *Client) SchemaByQueryID(params *SchemaByQueryIDParams, opts ...ClientOption) (*SchemaByQueryIDOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewSchemaByQueryIDParams() - } - op := &runtime.ClientOperation{ - ID: "SchemaByQueryID", - Method: "POST", - PathPattern: "/v1/qan/query:getSchema", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &SchemaByQueryIDReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - - // only one success response has to be checked - success, ok := result.(*SchemaByQueryIDOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*SchemaByQueryIDDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/api/qan/v1/json/client/qan_service/query_exists_parameters.go b/api/qan/v1/json/client/qan_service/query_exists_parameters.go deleted file mode 100644 index 7650af6a9df..00000000000 --- a/api/qan/v1/json/client/qan_service/query_exists_parameters.go +++ /dev/null @@ -1,147 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package qan_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" -) - -// NewQueryExistsParams creates a new QueryExistsParams 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 NewQueryExistsParams() *QueryExistsParams { - return &QueryExistsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewQueryExistsParamsWithTimeout creates a new QueryExistsParams object -// with the ability to set a timeout on a request. -func NewQueryExistsParamsWithTimeout(timeout time.Duration) *QueryExistsParams { - return &QueryExistsParams{ - timeout: timeout, - } -} - -// NewQueryExistsParamsWithContext creates a new QueryExistsParams object -// with the ability to set a context for a request. -func NewQueryExistsParamsWithContext(ctx context.Context) *QueryExistsParams { - return &QueryExistsParams{ - Context: ctx, - } -} - -// NewQueryExistsParamsWithHTTPClient creates a new QueryExistsParams object -// with the ability to set a custom HTTPClient for a request. -func NewQueryExistsParamsWithHTTPClient(client *http.Client) *QueryExistsParams { - return &QueryExistsParams{ - HTTPClient: client, - } -} - -/* -QueryExistsParams contains all the parameters to send to the API endpoint - - for the query exists operation. - - Typically these are written to a http.Request. -*/ -type QueryExistsParams struct { - /* Body. - - QueryExistsRequest check if provided query exists or not. - */ - Body QueryExistsBody - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the query exists params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *QueryExistsParams) WithDefaults() *QueryExistsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the query exists params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *QueryExistsParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the query exists params -func (o *QueryExistsParams) WithTimeout(timeout time.Duration) *QueryExistsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the query exists params -func (o *QueryExistsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the query exists params -func (o *QueryExistsParams) WithContext(ctx context.Context) *QueryExistsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the query exists params -func (o *QueryExistsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the query exists params -func (o *QueryExistsParams) WithHTTPClient(client *http.Client) *QueryExistsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the query exists params -func (o *QueryExistsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the query exists params -func (o *QueryExistsParams) WithBody(body QueryExistsBody) *QueryExistsParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the query exists params -func (o *QueryExistsParams) SetBody(body QueryExistsBody) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *QueryExistsParams) 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/qan/v1/json/client/qan_service/query_exists_responses.go b/api/qan/v1/json/client/qan_service/query_exists_responses.go deleted file mode 100644 index a6e036b1d42..00000000000 --- a/api/qan/v1/json/client/qan_service/query_exists_responses.go +++ /dev/null @@ -1,493 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package qan_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" -) - -// QueryExistsReader is a Reader for the QueryExists structure. -type QueryExistsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *QueryExistsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewQueryExistsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewQueryExistsDefault(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 - } -} - -// NewQueryExistsOK creates a QueryExistsOK with default headers values -func NewQueryExistsOK() *QueryExistsOK { - return &QueryExistsOK{} -} - -/* -QueryExistsOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type QueryExistsOK struct { - Payload *QueryExistsOKBody -} - -// IsSuccess returns true when this query exists Ok response has a 2xx status code -func (o *QueryExistsOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this query exists Ok response has a 3xx status code -func (o *QueryExistsOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this query exists Ok response has a 4xx status code -func (o *QueryExistsOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this query exists Ok response has a 5xx status code -func (o *QueryExistsOK) IsServerError() bool { - return false -} - -// IsCode returns true when this query exists Ok response a status code equal to that given -func (o *QueryExistsOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the query exists Ok response -func (o *QueryExistsOK) Code() int { - return 200 -} - -func (o *QueryExistsOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/qan/query:exists][%d] queryExistsOk %s", 200, payload) -} - -func (o *QueryExistsOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/qan/query:exists][%d] queryExistsOk %s", 200, payload) -} - -func (o *QueryExistsOK) GetPayload() *QueryExistsOKBody { - return o.Payload -} - -func (o *QueryExistsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(QueryExistsOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -// NewQueryExistsDefault creates a QueryExistsDefault with default headers values -func NewQueryExistsDefault(code int) *QueryExistsDefault { - return &QueryExistsDefault{ - _statusCode: code, - } -} - -/* -QueryExistsDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type QueryExistsDefault struct { - _statusCode int - - Payload *QueryExistsDefaultBody -} - -// IsSuccess returns true when this query exists default response has a 2xx status code -func (o *QueryExistsDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this query exists default response has a 3xx status code -func (o *QueryExistsDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this query exists default response has a 4xx status code -func (o *QueryExistsDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this query exists default response has a 5xx status code -func (o *QueryExistsDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this query exists default response a status code equal to that given -func (o *QueryExistsDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the query exists default response -func (o *QueryExistsDefault) Code() int { - return o._statusCode -} - -func (o *QueryExistsDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/qan/query:exists][%d] QueryExists default %s", o._statusCode, payload) -} - -func (o *QueryExistsDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/qan/query:exists][%d] QueryExists default %s", o._statusCode, payload) -} - -func (o *QueryExistsDefault) GetPayload() *QueryExistsDefaultBody { - return o.Payload -} - -func (o *QueryExistsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(QueryExistsDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -QueryExistsBody QueryExistsRequest check if provided query exists or not. -swagger:model QueryExistsBody -*/ -type QueryExistsBody struct { - // serviceid - Serviceid string `json:"serviceid,omitempty"` - - // query - Query string `json:"query,omitempty"` -} - -// Validate validates this query exists body -func (o *QueryExistsBody) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this query exists body based on context it is used -func (o *QueryExistsBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *QueryExistsBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *QueryExistsBody) UnmarshalBinary(b []byte) error { - var res QueryExistsBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -QueryExistsDefaultBody query exists default body -swagger:model QueryExistsDefaultBody -*/ -type QueryExistsDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*QueryExistsDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this query exists default body -func (o *QueryExistsDefaultBody) 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 *QueryExistsDefaultBody) 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("QueryExists default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("QueryExists default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this query exists default body based on the context it is used -func (o *QueryExistsDefaultBody) 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 *QueryExistsDefaultBody) 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("QueryExists default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("QueryExists default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *QueryExistsDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *QueryExistsDefaultBody) UnmarshalBinary(b []byte) error { - var res QueryExistsDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -QueryExistsDefaultBodyDetailsItems0 query exists default body details items0 -swagger:model QueryExistsDefaultBodyDetailsItems0 -*/ -type QueryExistsDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` - - // query exists default body details items0 - QueryExistsDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *QueryExistsDefaultBodyDetailsItems0) 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 QueryExistsDefaultBodyDetailsItems0 - - 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.QueryExistsDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o QueryExistsDefaultBodyDetailsItems0) 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.QueryExistsDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.QueryExistsDefaultBodyDetailsItems0) - 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 query exists default body details items0 -func (o *QueryExistsDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this query exists default body details items0 based on context it is used -func (o *QueryExistsDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *QueryExistsDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *QueryExistsDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res QueryExistsDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -QueryExistsOKBody QueryExistsResponse returns true if query exists. -swagger:model QueryExistsOKBody -*/ -type QueryExistsOKBody struct { - // exists - Exists bool `json:"exists,omitempty"` -} - -// Validate validates this query exists OK body -func (o *QueryExistsOKBody) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this query exists OK body based on context it is used -func (o *QueryExistsOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *QueryExistsOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *QueryExistsOKBody) UnmarshalBinary(b []byte) error { - var res QueryExistsOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/qan/v1/json/client/qan_service/schema_by_query_id_parameters.go b/api/qan/v1/json/client/qan_service/schema_by_query_id_parameters.go deleted file mode 100644 index f0be4d869ce..00000000000 --- a/api/qan/v1/json/client/qan_service/schema_by_query_id_parameters.go +++ /dev/null @@ -1,147 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package qan_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" -) - -// NewSchemaByQueryIDParams creates a new SchemaByQueryIDParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewSchemaByQueryIDParams() *SchemaByQueryIDParams { - return &SchemaByQueryIDParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewSchemaByQueryIDParamsWithTimeout creates a new SchemaByQueryIDParams object -// with the ability to set a timeout on a request. -func NewSchemaByQueryIDParamsWithTimeout(timeout time.Duration) *SchemaByQueryIDParams { - return &SchemaByQueryIDParams{ - timeout: timeout, - } -} - -// NewSchemaByQueryIDParamsWithContext creates a new SchemaByQueryIDParams object -// with the ability to set a context for a request. -func NewSchemaByQueryIDParamsWithContext(ctx context.Context) *SchemaByQueryIDParams { - return &SchemaByQueryIDParams{ - Context: ctx, - } -} - -// NewSchemaByQueryIDParamsWithHTTPClient creates a new SchemaByQueryIDParams object -// with the ability to set a custom HTTPClient for a request. -func NewSchemaByQueryIDParamsWithHTTPClient(client *http.Client) *SchemaByQueryIDParams { - return &SchemaByQueryIDParams{ - HTTPClient: client, - } -} - -/* -SchemaByQueryIDParams contains all the parameters to send to the API endpoint - - for the schema by query ID operation. - - Typically these are written to a http.Request. -*/ -type SchemaByQueryIDParams struct { - /* Body. - - SchemaByQueryIDRequest returns schema for given query ID and service ID. - */ - Body SchemaByQueryIDBody - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the schema by query ID params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *SchemaByQueryIDParams) WithDefaults() *SchemaByQueryIDParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the schema by query ID params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *SchemaByQueryIDParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the schema by query ID params -func (o *SchemaByQueryIDParams) WithTimeout(timeout time.Duration) *SchemaByQueryIDParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the schema by query ID params -func (o *SchemaByQueryIDParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the schema by query ID params -func (o *SchemaByQueryIDParams) WithContext(ctx context.Context) *SchemaByQueryIDParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the schema by query ID params -func (o *SchemaByQueryIDParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the schema by query ID params -func (o *SchemaByQueryIDParams) WithHTTPClient(client *http.Client) *SchemaByQueryIDParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the schema by query ID params -func (o *SchemaByQueryIDParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the schema by query ID params -func (o *SchemaByQueryIDParams) WithBody(body SchemaByQueryIDBody) *SchemaByQueryIDParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the schema by query ID params -func (o *SchemaByQueryIDParams) SetBody(body SchemaByQueryIDBody) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *SchemaByQueryIDParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/api/qan/v1/json/client/qan_service/schema_by_query_id_responses.go b/api/qan/v1/json/client/qan_service/schema_by_query_id_responses.go deleted file mode 100644 index 894c1d12cc9..00000000000 --- a/api/qan/v1/json/client/qan_service/schema_by_query_id_responses.go +++ /dev/null @@ -1,493 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package qan_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" -) - -// SchemaByQueryIDReader is a Reader for the SchemaByQueryID structure. -type SchemaByQueryIDReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *SchemaByQueryIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewSchemaByQueryIDOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewSchemaByQueryIDDefault(response.Code()) - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - if response.Code()/100 == 2 { - return result, nil - } - return nil, result - } -} - -// NewSchemaByQueryIDOK creates a SchemaByQueryIDOK with default headers values -func NewSchemaByQueryIDOK() *SchemaByQueryIDOK { - return &SchemaByQueryIDOK{} -} - -/* -SchemaByQueryIDOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type SchemaByQueryIDOK struct { - Payload *SchemaByQueryIDOKBody -} - -// IsSuccess returns true when this schema by query Id Ok response has a 2xx status code -func (o *SchemaByQueryIDOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this schema by query Id Ok response has a 3xx status code -func (o *SchemaByQueryIDOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this schema by query Id Ok response has a 4xx status code -func (o *SchemaByQueryIDOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this schema by query Id Ok response has a 5xx status code -func (o *SchemaByQueryIDOK) IsServerError() bool { - return false -} - -// IsCode returns true when this schema by query Id Ok response a status code equal to that given -func (o *SchemaByQueryIDOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the schema by query Id Ok response -func (o *SchemaByQueryIDOK) Code() int { - return 200 -} - -func (o *SchemaByQueryIDOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/qan/query:getSchema][%d] schemaByQueryIdOk %s", 200, payload) -} - -func (o *SchemaByQueryIDOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/qan/query:getSchema][%d] schemaByQueryIdOk %s", 200, payload) -} - -func (o *SchemaByQueryIDOK) GetPayload() *SchemaByQueryIDOKBody { - return o.Payload -} - -func (o *SchemaByQueryIDOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(SchemaByQueryIDOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -// NewSchemaByQueryIDDefault creates a SchemaByQueryIDDefault with default headers values -func NewSchemaByQueryIDDefault(code int) *SchemaByQueryIDDefault { - return &SchemaByQueryIDDefault{ - _statusCode: code, - } -} - -/* -SchemaByQueryIDDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type SchemaByQueryIDDefault struct { - _statusCode int - - Payload *SchemaByQueryIDDefaultBody -} - -// IsSuccess returns true when this schema by query ID default response has a 2xx status code -func (o *SchemaByQueryIDDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this schema by query ID default response has a 3xx status code -func (o *SchemaByQueryIDDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this schema by query ID default response has a 4xx status code -func (o *SchemaByQueryIDDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this schema by query ID default response has a 5xx status code -func (o *SchemaByQueryIDDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this schema by query ID default response a status code equal to that given -func (o *SchemaByQueryIDDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the schema by query ID default response -func (o *SchemaByQueryIDDefault) Code() int { - return o._statusCode -} - -func (o *SchemaByQueryIDDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/qan/query:getSchema][%d] SchemaByQueryID default %s", o._statusCode, payload) -} - -func (o *SchemaByQueryIDDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/qan/query:getSchema][%d] SchemaByQueryID default %s", o._statusCode, payload) -} - -func (o *SchemaByQueryIDDefault) GetPayload() *SchemaByQueryIDDefaultBody { - return o.Payload -} - -func (o *SchemaByQueryIDDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(SchemaByQueryIDDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -SchemaByQueryIDBody SchemaByQueryIDRequest returns schema for given query ID and service ID. -swagger:model SchemaByQueryIDBody -*/ -type SchemaByQueryIDBody struct { - // service id - ServiceID string `json:"service_id,omitempty"` - - // query id - QueryID string `json:"query_id,omitempty"` -} - -// Validate validates this schema by query ID body -func (o *SchemaByQueryIDBody) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this schema by query ID body based on context it is used -func (o *SchemaByQueryIDBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *SchemaByQueryIDBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *SchemaByQueryIDBody) UnmarshalBinary(b []byte) error { - var res SchemaByQueryIDBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -SchemaByQueryIDDefaultBody schema by query ID default body -swagger:model SchemaByQueryIDDefaultBody -*/ -type SchemaByQueryIDDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*SchemaByQueryIDDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this schema by query ID default body -func (o *SchemaByQueryIDDefaultBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateDetails(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *SchemaByQueryIDDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required - return nil - } - - for i := 0; i < len(o.Details); i++ { - if swag.IsZero(o.Details[i]) { // not required - continue - } - - if o.Details[i] != nil { - if err := o.Details[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("SchemaByQueryID default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("SchemaByQueryID default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this schema by query ID default body based on the context it is used -func (o *SchemaByQueryIDDefaultBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateDetails(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *SchemaByQueryIDDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Details); i++ { - if o.Details[i] != nil { - - if 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("SchemaByQueryID default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("SchemaByQueryID default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *SchemaByQueryIDDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *SchemaByQueryIDDefaultBody) UnmarshalBinary(b []byte) error { - var res SchemaByQueryIDDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -SchemaByQueryIDDefaultBodyDetailsItems0 schema by query ID default body details items0 -swagger:model SchemaByQueryIDDefaultBodyDetailsItems0 -*/ -type SchemaByQueryIDDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` - - // schema by query ID default body details items0 - SchemaByQueryIDDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *SchemaByQueryIDDefaultBodyDetailsItems0) 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 SchemaByQueryIDDefaultBodyDetailsItems0 - - 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.SchemaByQueryIDDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o SchemaByQueryIDDefaultBodyDetailsItems0) 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.SchemaByQueryIDDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.SchemaByQueryIDDefaultBodyDetailsItems0) - 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 schema by query ID default body details items0 -func (o *SchemaByQueryIDDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this schema by query ID default body details items0 based on context it is used -func (o *SchemaByQueryIDDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *SchemaByQueryIDDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *SchemaByQueryIDDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res SchemaByQueryIDDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -SchemaByQueryIDOKBody SchemaByQueryIDResponse is schema for given query ID and service ID. -swagger:model SchemaByQueryIDOKBody -*/ -type SchemaByQueryIDOKBody struct { - // schema - Schema string `json:"schema,omitempty"` -} - -// Validate validates this schema by query ID OK body -func (o *SchemaByQueryIDOKBody) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this schema by query ID OK body based on context it is used -func (o *SchemaByQueryIDOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *SchemaByQueryIDOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *SchemaByQueryIDOKBody) UnmarshalBinary(b []byte) error { - var res SchemaByQueryIDOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/qan/v1/json/v1.json b/api/qan/v1/json/v1.json deleted file mode 100644 index d436f318df4..00000000000 --- a/api/qan/v1/json/v1.json +++ /dev/null @@ -1,2399 +0,0 @@ -{ - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "schemes": [ - "https", - "http" - ], - "swagger": "2.0", - "info": { - "title": "PMM QAN API", - "version": "v1" - }, - "paths": { - "/v1/qan/metrics:getFilters": { - "post": { - "description": "Provides a filtered map of metrics names.", - "tags": [ - "QANService" - ], - "summary": "Get Filters", - "operationId": "GetFilteredMetricsNames", - "parameters": [ - { - "description": "GetFilteredMetricsNamesRequest contains period for which we need filters.", - "name": "body", - "in": "body", - "required": true, - "schema": { - "description": "GetFilteredMetricsNamesRequest contains period for which we need filters.", - "type": "object", - "properties": { - "period_start_from": { - "type": "string", - "format": "date-time", - "x-order": 0 - }, - "period_start_to": { - "type": "string", - "format": "date-time", - "x-order": 1 - }, - "main_metric_name": { - "type": "string", - "x-order": 2 - }, - "labels": { - "type": "array", - "items": { - "description": "MapFieldEntry allows to pass labels/dimensions in form like {\"server\": [\"db1\", \"db2\"...]}.", - "type": "object", - "properties": { - "key": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "array", - "items": { - "type": "string" - }, - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "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.", - "type": "object", - "properties": { - "labels": { - "type": "object", - "additionalProperties": { - "description": "ListLabels is list of label's values: duplicates are impossible.", - "type": "object", - "properties": { - "name": { - "type": "array", - "items": { - "description": "Values is label values and main metric percent and per second.", - "type": "object", - "properties": { - "value": { - "type": "string", - "x-order": 0 - }, - "main_metric_percent": { - "type": "number", - "format": "float", - "x-order": 1 - }, - "main_metric_per_sec": { - "type": "number", - "format": "float", - "x-order": 2 - } - } - }, - "x-order": 0 - } - } - }, - "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/qan/metrics:getNames": { - "post": { - "description": "Provides a map of all metrics names.", - "tags": [ - "QANService" - ], - "summary": "Get Metrics Names", - "operationId": "GetMetricsNames", - "parameters": [ - { - "description": "MetricsNamesRequest is empty.", - "name": "body", - "in": "body", - "required": true, - "schema": { - "description": "MetricsNamesRequest is empty.", - "type": "object" - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "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.", - "type": "object", - "properties": { - "data": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/qan/metrics:getReport": { - "post": { - "description": "Returns a list of metrics grouped by queryid or other dimensions.", - "tags": [ - "QANService" - ], - "summary": "Get Report", - "operationId": "GetReport", - "parameters": [ - { - "description": "ReportRequest defines filtering of metrics report for db server or other dimentions.", - "name": "body", - "in": "body", - "required": true, - "schema": { - "description": "ReportRequest defines filtering of metrics report for db server or other dimentions.", - "type": "object", - "properties": { - "period_start_from": { - "type": "string", - "format": "date-time", - "x-order": 0 - }, - "period_start_to": { - "type": "string", - "format": "date-time", - "x-order": 1 - }, - "group_by": { - "type": "string", - "x-order": 2 - }, - "labels": { - "type": "array", - "items": { - "description": "ReportMapFieldEntry allows to pass labels/dimentions in form like {\"server\": [\"db1\", \"db2\"...]}.", - "type": "object", - "properties": { - "key": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "array", - "items": { - "type": "string" - }, - "x-order": 1 - } - } - }, - "x-order": 3 - }, - "columns": { - "type": "array", - "items": { - "type": "string" - }, - "x-order": 4 - }, - "order_by": { - "type": "string", - "x-order": 5 - }, - "offset": { - "type": "integer", - "format": "int64", - "x-order": 6 - }, - "limit": { - "type": "integer", - "format": "int64", - "x-order": 7 - }, - "main_metric": { - "type": "string", - "x-order": 8 - }, - "search": { - "type": "string", - "x-order": 9 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "description": "ReportReply is list of reports per quieryids, hosts etc.", - "type": "object", - "properties": { - "total_rows": { - "type": "integer", - "format": "int64", - "x-order": 0 - }, - "offset": { - "type": "integer", - "format": "int64", - "x-order": 1 - }, - "limit": { - "type": "integer", - "format": "int64", - "x-order": 2 - }, - "rows": { - "type": "array", - "items": { - "description": "Row define metrics for selected dimention.", - "type": "object", - "properties": { - "rank": { - "type": "integer", - "format": "int64", - "x-order": 0 - }, - "dimension": { - "type": "string", - "x-order": 1 - }, - "database": { - "type": "string", - "x-order": 2 - }, - "metrics": { - "type": "object", - "additionalProperties": { - "description": "Metric cell.", - "type": "object", - "properties": { - "stats": { - "description": "Stat is statistics of specific metric.", - "type": "object", - "properties": { - "rate": { - "type": "number", - "format": "float", - "x-order": 0 - }, - "cnt": { - "type": "number", - "format": "float", - "x-order": 1 - }, - "sum": { - "type": "number", - "format": "float", - "x-order": 2 - }, - "min": { - "type": "number", - "format": "float", - "x-order": 3 - }, - "max": { - "type": "number", - "format": "float", - "x-order": 4 - }, - "p99": { - "type": "number", - "format": "float", - "x-order": 5 - }, - "avg": { - "type": "number", - "format": "float", - "x-order": 6 - }, - "sum_per_sec": { - "type": "number", - "format": "float", - "x-order": 7 - } - }, - "x-order": 0 - } - } - }, - "x-order": 3 - }, - "sparkline": { - "type": "array", - "items": { - "description": "Point contains values that represents abscissa (time) and ordinate (volume etc.)\nof every point in a coordinate system of Sparklines.", - "type": "object", - "properties": { - "point": { - "description": "The serial number of the chart point from the largest time in the time interval to the lowest time in the time range.", - "type": "integer", - "format": "int64", - "x-order": 0 - }, - "time_frame": { - "description": "Duration beetween two points.", - "type": "integer", - "format": "int64", - "x-order": 1 - }, - "timestamp": { - "description": "Time of point in format RFC3339.", - "type": "string", - "x-order": 2 - }, - "load": { - "description": "load is query_time / time_range.", - "type": "number", - "format": "float", - "x-order": 3 - }, - "num_queries_per_sec": { - "description": "number of queries in bucket.", - "type": "number", - "format": "float", - "x-order": 4 - }, - "num_queries_with_errors_per_sec": { - "description": "number of queries with errors.", - "type": "number", - "format": "float", - "x-order": 5 - }, - "num_queries_with_warnings_per_sec": { - "description": "number of queries with warnings.", - "type": "number", - "format": "float", - "x-order": 6 - }, - "m_query_time_sum_per_sec": { - "description": "The statement execution time in seconds.", - "type": "number", - "format": "float", - "x-order": 7 - }, - "m_lock_time_sum_per_sec": { - "description": "The time to acquire locks in seconds.", - "type": "number", - "format": "float", - "x-order": 8 - }, - "m_rows_sent_sum_per_sec": { - "description": "The number of rows sent to the client.", - "type": "number", - "format": "float", - "x-order": 9 - }, - "m_rows_examined_sum_per_sec": { - "description": "Number of rows scanned - SELECT.", - "type": "number", - "format": "float", - "x-order": 10 - }, - "m_rows_affected_sum_per_sec": { - "description": "Number of rows changed - UPDATE, DELETE, INSERT.", - "type": "number", - "format": "float", - "x-order": 11 - }, - "m_rows_read_sum_per_sec": { - "description": "The number of rows read from tables.", - "type": "number", - "format": "float", - "x-order": 12 - }, - "m_merge_passes_sum_per_sec": { - "description": "The number of merge passes that the sort algorithm has had to do.", - "type": "number", - "format": "float", - "x-order": 13 - }, - "m_innodb_io_r_ops_sum_per_sec": { - "description": "Counts the number of page read operations scheduled.", - "type": "number", - "format": "float", - "x-order": 14 - }, - "m_innodb_io_r_bytes_sum_per_sec": { - "description": "Similar to innodb_IO_r_ops, but the unit is bytes.", - "type": "number", - "format": "float", - "x-order": 15 - }, - "m_innodb_io_r_wait_sum_per_sec": { - "description": "Shows how long (in seconds) it took InnoDB to actually read the data from storage.", - "type": "number", - "format": "float", - "x-order": 16 - }, - "m_innodb_rec_lock_wait_sum_per_sec": { - "description": "Shows how long (in seconds) the query waited for row locks.", - "type": "number", - "format": "float", - "x-order": 17 - }, - "m_innodb_queue_wait_sum_per_sec": { - "description": "Shows how long (in seconds) the query spent either waiting to enter the InnoDB queue or inside that queue waiting for execution.", - "type": "number", - "format": "float", - "x-order": 18 - }, - "m_innodb_pages_distinct_sum_per_sec": { - "description": "Counts approximately the number of unique pages the query accessed.", - "type": "number", - "format": "float", - "x-order": 19 - }, - "m_query_length_sum_per_sec": { - "description": "Shows how long the query is.", - "type": "number", - "format": "float", - "x-order": 20 - }, - "m_bytes_sent_sum_per_sec": { - "description": "The number of bytes sent to all clients.", - "type": "number", - "format": "float", - "x-order": 21 - }, - "m_tmp_tables_sum_per_sec": { - "description": "Number of temporary tables created on memory for the query.", - "type": "number", - "format": "float", - "x-order": 22 - }, - "m_tmp_disk_tables_sum_per_sec": { - "description": "Number of temporary tables created on disk for the query.", - "type": "number", - "format": "float", - "x-order": 23 - }, - "m_tmp_table_sizes_sum_per_sec": { - "description": "Total Size in bytes for all temporary tables used in the query.", - "type": "number", - "format": "float", - "x-order": 24 - }, - "m_qc_hit_sum_per_sec": { - "description": "Query Cache hits.", - "type": "number", - "format": "float", - "x-order": 25 - }, - "m_full_scan_sum_per_sec": { - "description": "The query performed a full table scan.", - "type": "number", - "format": "float", - "x-order": 26 - }, - "m_full_join_sum_per_sec": { - "description": "The query performed a full join (a join without indexes).", - "type": "number", - "format": "float", - "x-order": 27 - }, - "m_tmp_table_sum_per_sec": { - "description": "The query created an implicit internal temporary table.", - "type": "number", - "format": "float", - "x-order": 28 - }, - "m_tmp_table_on_disk_sum_per_sec": { - "description": "The querys temporary table was stored on disk.", - "type": "number", - "format": "float", - "x-order": 29 - }, - "m_filesort_sum_per_sec": { - "description": "The query used a filesort.", - "type": "number", - "format": "float", - "x-order": 30 - }, - "m_filesort_on_disk_sum_per_sec": { - "description": "The filesort was performed on disk.", - "type": "number", - "format": "float", - "x-order": 31 - }, - "m_select_full_range_join_sum_per_sec": { - "description": "The number of joins that used a range search on a reference table.", - "type": "number", - "format": "float", - "x-order": 32 - }, - "m_select_range_sum_per_sec": { - "description": "The number of joins that used ranges on the first table.", - "type": "number", - "format": "float", - "x-order": 33 - }, - "m_select_range_check_sum_per_sec": { - "description": "The number of joins without keys that check for key usage after each row.", - "type": "number", - "format": "float", - "x-order": 34 - }, - "m_sort_range_sum_per_sec": { - "description": "The number of sorts that were done using ranges.", - "type": "number", - "format": "float", - "x-order": 35 - }, - "m_sort_rows_sum_per_sec": { - "description": "The number of sorted rows.", - "type": "number", - "format": "float", - "x-order": 36 - }, - "m_sort_scan_sum_per_sec": { - "description": "The number of sorts that were done by scanning the table.", - "type": "number", - "format": "float", - "x-order": 37 - }, - "m_no_index_used_sum_per_sec": { - "description": "The number of queries without index.", - "type": "number", - "format": "float", - "x-order": 38 - }, - "m_no_good_index_used_sum_per_sec": { - "description": "The number of queries without good index.", - "type": "number", - "format": "float", - "x-order": 39 - }, - "m_docs_returned_sum_per_sec": { - "description": "The number of returned documents.", - "type": "number", - "format": "float", - "x-order": 40 - }, - "m_response_length_sum_per_sec": { - "description": "The response length of the query result in bytes.", - "type": "number", - "format": "float", - "x-order": 41 - }, - "m_docs_scanned_sum_per_sec": { - "description": "The number of scanned documents.", - "type": "number", - "format": "float", - "x-order": 42 - }, - "m_docs_examined_sum_per_sec": { - "description": "Total number of documents scanned during query execution.", - "type": "number", - "format": "float", - "x-order": 43 - }, - "m_keys_examined_sum_per_sec": { - "description": "Total number of index keys scanned during query execution.", - "type": "number", - "format": "float", - "x-order": 44 - }, - "m_locks_global_acquire_count_read_shared_sum_per_sec": { - "description": "Number of times a global read lock was acquired during query execution.", - "type": "number", - "format": "float", - "x-order": 45 - }, - "m_locks_global_acquire_count_write_shared_sum_per_sec": { - "description": "Number of times a global write lock was acquired during query execution.", - "type": "number", - "format": "float", - "x-order": 46 - }, - "m_locks_database_acquire_count_read_shared_sum_per_sec": { - "description": "Number of times a read lock was acquired at the database level during query execution.", - "type": "number", - "format": "float", - "x-order": 47 - }, - "m_locks_database_acquire_wait_count_read_shared_sum_per_sec": { - "description": "Number of times a read lock at the database level was requested but had to wait before being granted.", - "type": "number", - "format": "float", - "x-order": 48 - }, - "m_locks_database_time_acquiring_micros_read_shared_sum_per_sec": { - "description": "Indicates the time, spent acquiring a read lock at the database level during an operation.", - "type": "number", - "format": "float", - "x-order": 49 - }, - "m_locks_collection_acquire_count_read_shared_sum_per_sec": { - "description": "Number of times a read lock was acquired on a specific collection during operations.", - "type": "number", - "format": "float", - "x-order": 50 - }, - "m_storage_bytes_read_sum_per_sec": { - "description": "Total number of bytes read from storage during a specific operation.", - "type": "number", - "format": "float", - "x-order": 51 - }, - "m_storage_time_reading_micros_sum_per_sec": { - "description": "Indicates the time, spent reading data from storage during an operation.", - "type": "number", - "format": "float", - "x-order": 52 - }, - "m_shared_blks_hit_sum_per_sec": { - "description": "Total number of shared block cache hits by the statement.", - "type": "number", - "format": "float", - "x-order": 53 - }, - "m_shared_blks_read_sum_per_sec": { - "description": "Total number of shared blocks read by the statement.", - "type": "number", - "format": "float", - "x-order": 54 - }, - "m_shared_blks_dirtied_sum_per_sec": { - "description": "Total number of shared blocks dirtied by the statement.", - "type": "number", - "format": "float", - "x-order": 55 - }, - "m_shared_blks_written_sum_per_sec": { - "description": "Total number of shared blocks written by the statement.", - "type": "number", - "format": "float", - "x-order": 56 - }, - "m_shared_blk_read_time_sum_per_sec": { - "description": "Total time the statement spent reading shared blocks, in milliseconds (if track_io_timing is enabled, otherwise zero).", - "type": "number", - "format": "float", - "x-order": 57 - }, - "m_shared_blk_write_time_sum_per_sec": { - "description": "Total time the statement spent writing shared blocks, in milliseconds (if track_io_timing is enabled, otherwise zero).", - "type": "number", - "format": "float", - "x-order": 58 - }, - "m_local_blk_read_time_sum_per_sec": { - "description": "Total time the statement spent reading shared blocks, in milliseconds (if track_io_timing is enabled, otherwise zero).", - "type": "number", - "format": "float", - "x-order": 59 - }, - "m_local_blk_write_time_sum_per_sec": { - "description": "Total time the statement spent writing shared blocks, in milliseconds (if track_io_timing is enabled, otherwise zero).", - "type": "number", - "format": "float", - "x-order": 60 - }, - "m_local_blks_hit_sum_per_sec": { - "description": "Total number of local block cache hits by the statement.", - "type": "number", - "format": "float", - "x-order": 61 - }, - "m_local_blks_read_sum_per_sec": { - "description": "Total number of local blocks read by the statement.", - "type": "number", - "format": "float", - "x-order": 62 - }, - "m_local_blks_dirtied_sum_per_sec": { - "description": "Total number of local blocks dirtied by the statement.", - "type": "number", - "format": "float", - "x-order": 63 - }, - "m_local_blks_written_sum_per_sec": { - "description": "Total number of local blocks written by the statement.", - "type": "number", - "format": "float", - "x-order": 64 - }, - "m_temp_blks_read_sum_per_sec": { - "description": "Total number of temp blocks read by the statement.", - "type": "number", - "format": "float", - "x-order": 65 - }, - "m_temp_blks_written_sum_per_sec": { - "description": "Total number of temp blocks written by the statement.", - "type": "number", - "format": "float", - "x-order": 66 - }, - "m_blk_read_time_sum_per_sec": { - "description": "Total time the statement spent reading blocks, in milliseconds (if track_io_timing is enabled, otherwise zero).", - "type": "number", - "format": "float", - "x-order": 67 - }, - "m_blk_write_time_sum_per_sec": { - "description": "Total time the statement spent writing blocks, in milliseconds (if track_io_timing is enabled, otherwise zero).", - "type": "number", - "format": "float", - "x-order": 68 - }, - "m_cpu_user_time_sum_per_sec": { - "description": "Total time user spent in query.", - "type": "number", - "format": "float", - "x-order": 69 - }, - "m_cpu_sys_time_sum_per_sec": { - "description": "Total time system spent in query.", - "type": "number", - "format": "float", - "x-order": 70 - }, - "m_plans_calls_sum_per_sec": { - "description": "Total number of planned calls.", - "type": "number", - "format": "float", - "x-order": 71 - }, - "m_wal_records_sum_per_sec": { - "description": "Total number of WAL (Write-ahead logging) records.", - "type": "number", - "format": "float", - "x-order": 72 - }, - "m_wal_fpi_sum_per_sec": { - "description": "Total number of FPI (full page images) in WAL (Write-ahead logging) records.", - "type": "number", - "format": "float", - "x-order": 73 - }, - "m_wal_bytes_sum_per_sec": { - "description": "Total bytes of WAL (Write-ahead logging) records.", - "type": "number", - "format": "float", - "x-order": 74 - }, - "m_plan_time_sum_per_sec": { - "description": "Plan time in per seconds.", - "type": "number", - "format": "float", - "x-order": 75 - } - } - }, - "x-order": 4 - }, - "fingerprint": { - "type": "string", - "x-order": 5 - }, - "num_queries": { - "type": "integer", - "format": "int64", - "x-order": 6 - }, - "qps": { - "type": "number", - "format": "float", - "x-order": 7 - }, - "load": { - "type": "number", - "format": "float", - "x-order": 8 - } - } - }, - "x-order": 3 - } - } - } - }, - "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/qan/query/{queryid}/plan": { - "get": { - "description": "Provides a query plan and plan id for specific filtering.", - "tags": [ - "QANService" - ], - "summary": "Get Query Plan", - "operationId": "GetQueryPlan", - "parameters": [ - { - "type": "string", - "name": "queryid", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "description": "GetQueryPlanResponse contains planid and query_plan.", - "type": "object", - "properties": { - "planid": { - "type": "string", - "x-order": 0 - }, - "query_plan": { - "type": "string", - "x-order": 1 - } - } - } - }, - "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/qan/query:exists": { - "post": { - "description": "Checks if query exists in clickhouse.", - "tags": [ - "QANService" - ], - "summary": "Check Query Existence", - "operationId": "QueryExists", - "parameters": [ - { - "description": "QueryExistsRequest check if provided query exists or not.", - "name": "body", - "in": "body", - "required": true, - "schema": { - "description": "QueryExistsRequest check if provided query exists or not.", - "type": "object", - "properties": { - "serviceid": { - "type": "string", - "x-order": 0 - }, - "query": { - "type": "string", - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "description": "QueryExistsResponse returns true if query exists.", - "type": "object", - "properties": { - "exists": { - "type": "boolean", - "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/qan/query:getExample": { - "post": { - "description": "Provides a list of query examples.", - "tags": [ - "QANService" - ], - "summary": "Get Query Example", - "operationId": "GetQueryExample", - "parameters": [ - { - "description": "GetQueryExampleRequest defines filtering of query examples for specific value of\ndimension (ex.: host=hostname1 or queryid=1D410B4BE5060972.", - "name": "body", - "in": "body", - "required": true, - "schema": { - "description": "GetQueryExampleRequest defines filtering of query examples for specific value of\ndimension (ex.: host=hostname1 or queryid=1D410B4BE5060972.", - "type": "object", - "properties": { - "period_start_from": { - "type": "string", - "format": "date-time", - "x-order": 0 - }, - "period_start_to": { - "type": "string", - "format": "date-time", - "x-order": 1 - }, - "filter_by": { - "description": "dimension value: ex: queryid - 1D410B4BE5060972.", - "type": "string", - "x-order": 2 - }, - "group_by": { - "description": "one of dimension: queryid | host ...", - "type": "string", - "x-order": 3 - }, - "labels": { - "type": "array", - "items": { - "description": "MapFieldEntry allows to pass labels/dimensions in form like {\"server\": [\"db1\", \"db2\"...]}.", - "type": "object", - "properties": { - "key": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "array", - "items": { - "type": "string" - }, - "x-order": 1 - } - } - }, - "x-order": 4 - }, - "limit": { - "type": "integer", - "format": "int64", - "x-order": 5 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "description": "GetQueryExampleResponse list of query examples.", - "type": "object", - "properties": { - "query_examples": { - "type": "array", - "items": { - "description": "QueryExample shows query examples and their metrics.", - "type": "object", - "properties": { - "example": { - "type": "string", - "x-order": 0 - }, - "example_type": { - "description": "ExampleType is a type of query example selected for this query class in given period of time.", - "type": "string", - "default": "EXAMPLE_TYPE_UNSPECIFIED", - "enum": [ - "EXAMPLE_TYPE_UNSPECIFIED", - "EXAMPLE_TYPE_RANDOM", - "EXAMPLE_TYPE_SLOWEST", - "EXAMPLE_TYPE_FASTEST", - "EXAMPLE_TYPE_WITH_ERROR" - ], - "x-order": 1 - }, - "is_truncated": { - "type": "integer", - "format": "int64", - "x-order": 2 - }, - "placeholders_count": { - "type": "integer", - "format": "int64", - "x-order": 3 - }, - "explain_fingerprint": { - "type": "string", - "x-order": 4 - }, - "query_id": { - "type": "string", - "x-order": 5 - }, - "example_metrics": { - "type": "string", - "x-order": 6 - }, - "service_id": { - "type": "string", - "x-order": 7 - }, - "service_type": { - "type": "string", - "x-order": 8 - }, - "schema": { - "type": "string", - "x-order": 9 - }, - "tables": { - "type": "array", - "items": { - "type": "string" - }, - "x-order": 10 - } - } - }, - "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/qan/query:getSchema": { - "post": { - "description": "Provides the schema for a given queryID and serviceID.", - "tags": [ - "QANService" - ], - "summary": "Get Schema", - "operationId": "SchemaByQueryID", - "parameters": [ - { - "description": "SchemaByQueryIDRequest returns schema for given query ID and service ID.", - "name": "body", - "in": "body", - "required": true, - "schema": { - "description": "SchemaByQueryIDRequest returns schema for given query ID and service ID.", - "type": "object", - "properties": { - "service_id": { - "type": "string", - "x-order": 0 - }, - "query_id": { - "type": "string", - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "description": "SchemaByQueryIDResponse is schema for given query ID and service ID.", - "type": "object", - "properties": { - "schema": { - "type": "string", - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/qan:explainFingerprint": { - "post": { - "description": "Provides an explain fingerprint for given query ID.", - "tags": [ - "QANService" - ], - "summary": "Get Explain Fingerprint", - "operationId": "ExplainFingerprintByQueryID", - "parameters": [ - { - "description": "ExplainFingerprintByQueryIDRequest get explain fingerprint for given query ID.", - "name": "body", - "in": "body", - "required": true, - "schema": { - "description": "ExplainFingerprintByQueryIDRequest get explain fingerprint for given query ID.", - "type": "object", - "properties": { - "serviceid": { - "type": "string", - "x-order": 0 - }, - "query_id": { - "type": "string", - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "description": "ExplainFingerprintByQueryIDResponse is explain fingerprint and placeholders count for given query ID.", - "type": "object", - "properties": { - "explain_fingerprint": { - "type": "string", - "x-order": 0 - }, - "placeholders_count": { - "type": "integer", - "format": "int64", - "x-order": 1 - } - } - } - }, - "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/qan:getHistogram": { - "post": { - "description": "Provides histogram items for specific filtering.", - "tags": [ - "QANService" - ], - "summary": "Get Histogram", - "operationId": "GetHistogram", - "parameters": [ - { - "description": "GetHistogramRequest defines filtering by time range, labels and queryid.", - "name": "body", - "in": "body", - "required": true, - "schema": { - "description": "GetHistogramRequest defines filtering by time range, labels and queryid.", - "type": "object", - "properties": { - "period_start_from": { - "type": "string", - "format": "date-time", - "x-order": 0 - }, - "period_start_to": { - "type": "string", - "format": "date-time", - "x-order": 1 - }, - "labels": { - "type": "array", - "items": { - "description": "MapFieldEntry allows to pass labels/dimensions in form like {\"server\": [\"db1\", \"db2\"...]}.", - "type": "object", - "properties": { - "key": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "array", - "items": { - "type": "string" - }, - "x-order": 1 - } - } - }, - "x-order": 2 - }, - "queryid": { - "type": "string", - "x-order": 3 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "description": "GetHistogramResponse is histogram items as a list.", - "type": "object", - "properties": { - "histogram_items": { - "type": "array", - "items": { - "description": "HistogramItem represents one item in histogram.", - "type": "object", - "properties": { - "range": { - "type": "string", - "x-order": 0 - }, - "frequency": { - "type": "integer", - "format": "int64", - "x-order": 1 - } - } - }, - "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/qan:getLabels": { - "post": { - "description": "Provides a list of labels for object details.", - "tags": [ - "QANService" - ], - "summary": "Get Labels", - "operationId": "GetLabels", - "parameters": [ - { - "description": "GetLabelsRequest defines filtering of object detail's labels for specific value of\ndimension (ex.: host=hostname1 or queryid=1D410B4BE5060972.", - "name": "body", - "in": "body", - "required": true, - "schema": { - "description": "GetLabelsRequest defines filtering of object detail's labels for specific value of\ndimension (ex.: host=hostname1 or queryid=1D410B4BE5060972.", - "type": "object", - "properties": { - "period_start_from": { - "type": "string", - "format": "date-time", - "x-order": 0 - }, - "period_start_to": { - "type": "string", - "format": "date-time", - "x-order": 1 - }, - "filter_by": { - "description": "dimension value: ex: queryid - 1D410B4BE5060972.", - "type": "string", - "x-order": 2 - }, - "group_by": { - "description": "one of dimension: queryid | host ...", - "type": "string", - "x-order": 3 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "description": "GetLabelsResponse is a map of labels names as keys and labels values as a list.", - "type": "object", - "properties": { - "labels": { - "type": "object", - "additionalProperties": { - "description": "ListLabelValues is list of label's values.", - "type": "object", - "properties": { - "values": { - "type": "array", - "items": { - "type": "string" - }, - "x-order": 0 - } - } - }, - "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/qan:getMetrics": { - "post": { - "description": "Provides a map of metrics for specific filtering.", - "tags": [ - "QANService" - ], - "summary": "Get Metrics", - "operationId": "GetMetrics", - "parameters": [ - { - "description": "GetMetricsRequest defines filtering of metrics for specific value of dimension (ex.: host=hostname1 or queryid=1D410B4BE5060972.", - "name": "body", - "in": "body", - "required": true, - "schema": { - "description": "GetMetricsRequest defines filtering of metrics for specific value of dimension (ex.: host=hostname1 or queryid=1D410B4BE5060972.", - "type": "object", - "properties": { - "period_start_from": { - "type": "string", - "format": "date-time", - "x-order": 0 - }, - "period_start_to": { - "type": "string", - "format": "date-time", - "x-order": 1 - }, - "filter_by": { - "description": "dimension value: ex: queryid - 1D410B4BE5060972.", - "type": "string", - "x-order": 2 - }, - "group_by": { - "description": "one of dimension: queryid | host ...", - "type": "string", - "x-order": 3 - }, - "labels": { - "type": "array", - "items": { - "description": "MapFieldEntry allows to pass labels/dimensions in form like {\"server\": [\"db1\", \"db2\"...]}.", - "type": "object", - "properties": { - "key": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "array", - "items": { - "type": "string" - }, - "x-order": 1 - } - } - }, - "x-order": 4 - }, - "include_only_fields": { - "type": "array", - "items": { - "type": "string" - }, - "x-order": 5 - }, - "totals": { - "type": "boolean", - "title": "retrieve only values for totals, excluding N/A values", - "x-order": 6 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "description": "GetMetricsResponse defines metrics for specific value of dimension (ex.: host=hostname1 or queryid=1D410B4BE5060972.", - "type": "object", - "properties": { - "metrics": { - "type": "object", - "additionalProperties": { - "description": "MetricValues is statistics of specific metric.", - "type": "object", - "properties": { - "rate": { - "type": "number", - "format": "float", - "x-order": 0 - }, - "cnt": { - "type": "number", - "format": "float", - "x-order": 1 - }, - "sum": { - "type": "number", - "format": "float", - "x-order": 2 - }, - "min": { - "type": "number", - "format": "float", - "x-order": 3 - }, - "max": { - "type": "number", - "format": "float", - "x-order": 4 - }, - "avg": { - "type": "number", - "format": "float", - "x-order": 5 - }, - "p99": { - "type": "number", - "format": "float", - "x-order": 6 - }, - "percent_of_total": { - "type": "number", - "format": "float", - "x-order": 7 - } - } - }, - "x-order": 0 - }, - "text_metrics": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 1 - }, - "sparkline": { - "type": "array", - "items": { - "description": "Point contains values that represents abscissa (time) and ordinate (volume etc.)\nof every point in a coordinate system of Sparklines.", - "type": "object", - "properties": { - "point": { - "description": "The serial number of the chart point from the largest time in the time interval to the lowest time in the time range.", - "type": "integer", - "format": "int64", - "x-order": 0 - }, - "time_frame": { - "description": "Duration beetween two points.", - "type": "integer", - "format": "int64", - "x-order": 1 - }, - "timestamp": { - "description": "Time of point in format RFC3339.", - "type": "string", - "x-order": 2 - }, - "load": { - "description": "load is query_time / time_range.", - "type": "number", - "format": "float", - "x-order": 3 - }, - "num_queries_per_sec": { - "description": "number of queries in bucket.", - "type": "number", - "format": "float", - "x-order": 4 - }, - "num_queries_with_errors_per_sec": { - "description": "number of queries with errors.", - "type": "number", - "format": "float", - "x-order": 5 - }, - "num_queries_with_warnings_per_sec": { - "description": "number of queries with warnings.", - "type": "number", - "format": "float", - "x-order": 6 - }, - "m_query_time_sum_per_sec": { - "description": "The statement execution time in seconds.", - "type": "number", - "format": "float", - "x-order": 7 - }, - "m_lock_time_sum_per_sec": { - "description": "The time to acquire locks in seconds.", - "type": "number", - "format": "float", - "x-order": 8 - }, - "m_rows_sent_sum_per_sec": { - "description": "The number of rows sent to the client.", - "type": "number", - "format": "float", - "x-order": 9 - }, - "m_rows_examined_sum_per_sec": { - "description": "Number of rows scanned - SELECT.", - "type": "number", - "format": "float", - "x-order": 10 - }, - "m_rows_affected_sum_per_sec": { - "description": "Number of rows changed - UPDATE, DELETE, INSERT.", - "type": "number", - "format": "float", - "x-order": 11 - }, - "m_rows_read_sum_per_sec": { - "description": "The number of rows read from tables.", - "type": "number", - "format": "float", - "x-order": 12 - }, - "m_merge_passes_sum_per_sec": { - "description": "The number of merge passes that the sort algorithm has had to do.", - "type": "number", - "format": "float", - "x-order": 13 - }, - "m_innodb_io_r_ops_sum_per_sec": { - "description": "Counts the number of page read operations scheduled.", - "type": "number", - "format": "float", - "x-order": 14 - }, - "m_innodb_io_r_bytes_sum_per_sec": { - "description": "Similar to innodb_IO_r_ops, but the unit is bytes.", - "type": "number", - "format": "float", - "x-order": 15 - }, - "m_innodb_io_r_wait_sum_per_sec": { - "description": "Shows how long (in seconds) it took InnoDB to actually read the data from storage.", - "type": "number", - "format": "float", - "x-order": 16 - }, - "m_innodb_rec_lock_wait_sum_per_sec": { - "description": "Shows how long (in seconds) the query waited for row locks.", - "type": "number", - "format": "float", - "x-order": 17 - }, - "m_innodb_queue_wait_sum_per_sec": { - "description": "Shows how long (in seconds) the query spent either waiting to enter the InnoDB queue or inside that queue waiting for execution.", - "type": "number", - "format": "float", - "x-order": 18 - }, - "m_innodb_pages_distinct_sum_per_sec": { - "description": "Counts approximately the number of unique pages the query accessed.", - "type": "number", - "format": "float", - "x-order": 19 - }, - "m_query_length_sum_per_sec": { - "description": "Shows how long the query is.", - "type": "number", - "format": "float", - "x-order": 20 - }, - "m_bytes_sent_sum_per_sec": { - "description": "The number of bytes sent to all clients.", - "type": "number", - "format": "float", - "x-order": 21 - }, - "m_tmp_tables_sum_per_sec": { - "description": "Number of temporary tables created on memory for the query.", - "type": "number", - "format": "float", - "x-order": 22 - }, - "m_tmp_disk_tables_sum_per_sec": { - "description": "Number of temporary tables created on disk for the query.", - "type": "number", - "format": "float", - "x-order": 23 - }, - "m_tmp_table_sizes_sum_per_sec": { - "description": "Total Size in bytes for all temporary tables used in the query.", - "type": "number", - "format": "float", - "x-order": 24 - }, - "m_qc_hit_sum_per_sec": { - "description": "Query Cache hits.", - "type": "number", - "format": "float", - "x-order": 25 - }, - "m_full_scan_sum_per_sec": { - "description": "The query performed a full table scan.", - "type": "number", - "format": "float", - "x-order": 26 - }, - "m_full_join_sum_per_sec": { - "description": "The query performed a full join (a join without indexes).", - "type": "number", - "format": "float", - "x-order": 27 - }, - "m_tmp_table_sum_per_sec": { - "description": "The query created an implicit internal temporary table.", - "type": "number", - "format": "float", - "x-order": 28 - }, - "m_tmp_table_on_disk_sum_per_sec": { - "description": "The querys temporary table was stored on disk.", - "type": "number", - "format": "float", - "x-order": 29 - }, - "m_filesort_sum_per_sec": { - "description": "The query used a filesort.", - "type": "number", - "format": "float", - "x-order": 30 - }, - "m_filesort_on_disk_sum_per_sec": { - "description": "The filesort was performed on disk.", - "type": "number", - "format": "float", - "x-order": 31 - }, - "m_select_full_range_join_sum_per_sec": { - "description": "The number of joins that used a range search on a reference table.", - "type": "number", - "format": "float", - "x-order": 32 - }, - "m_select_range_sum_per_sec": { - "description": "The number of joins that used ranges on the first table.", - "type": "number", - "format": "float", - "x-order": 33 - }, - "m_select_range_check_sum_per_sec": { - "description": "The number of joins without keys that check for key usage after each row.", - "type": "number", - "format": "float", - "x-order": 34 - }, - "m_sort_range_sum_per_sec": { - "description": "The number of sorts that were done using ranges.", - "type": "number", - "format": "float", - "x-order": 35 - }, - "m_sort_rows_sum_per_sec": { - "description": "The number of sorted rows.", - "type": "number", - "format": "float", - "x-order": 36 - }, - "m_sort_scan_sum_per_sec": { - "description": "The number of sorts that were done by scanning the table.", - "type": "number", - "format": "float", - "x-order": 37 - }, - "m_no_index_used_sum_per_sec": { - "description": "The number of queries without index.", - "type": "number", - "format": "float", - "x-order": 38 - }, - "m_no_good_index_used_sum_per_sec": { - "description": "The number of queries without good index.", - "type": "number", - "format": "float", - "x-order": 39 - }, - "m_docs_returned_sum_per_sec": { - "description": "The number of returned documents.", - "type": "number", - "format": "float", - "x-order": 40 - }, - "m_response_length_sum_per_sec": { - "description": "The response length of the query result in bytes.", - "type": "number", - "format": "float", - "x-order": 41 - }, - "m_docs_scanned_sum_per_sec": { - "description": "The number of scanned documents.", - "type": "number", - "format": "float", - "x-order": 42 - }, - "m_docs_examined_sum_per_sec": { - "description": "Total number of documents scanned during query execution.", - "type": "number", - "format": "float", - "x-order": 43 - }, - "m_keys_examined_sum_per_sec": { - "description": "Total number of index keys scanned during query execution.", - "type": "number", - "format": "float", - "x-order": 44 - }, - "m_locks_global_acquire_count_read_shared_sum_per_sec": { - "description": "Number of times a global read lock was acquired during query execution.", - "type": "number", - "format": "float", - "x-order": 45 - }, - "m_locks_global_acquire_count_write_shared_sum_per_sec": { - "description": "Number of times a global write lock was acquired during query execution.", - "type": "number", - "format": "float", - "x-order": 46 - }, - "m_locks_database_acquire_count_read_shared_sum_per_sec": { - "description": "Number of times a read lock was acquired at the database level during query execution.", - "type": "number", - "format": "float", - "x-order": 47 - }, - "m_locks_database_acquire_wait_count_read_shared_sum_per_sec": { - "description": "Number of times a read lock at the database level was requested but had to wait before being granted.", - "type": "number", - "format": "float", - "x-order": 48 - }, - "m_locks_database_time_acquiring_micros_read_shared_sum_per_sec": { - "description": "Indicates the time, spent acquiring a read lock at the database level during an operation.", - "type": "number", - "format": "float", - "x-order": 49 - }, - "m_locks_collection_acquire_count_read_shared_sum_per_sec": { - "description": "Number of times a read lock was acquired on a specific collection during operations.", - "type": "number", - "format": "float", - "x-order": 50 - }, - "m_storage_bytes_read_sum_per_sec": { - "description": "Total number of bytes read from storage during a specific operation.", - "type": "number", - "format": "float", - "x-order": 51 - }, - "m_storage_time_reading_micros_sum_per_sec": { - "description": "Indicates the time, spent reading data from storage during an operation.", - "type": "number", - "format": "float", - "x-order": 52 - }, - "m_shared_blks_hit_sum_per_sec": { - "description": "Total number of shared block cache hits by the statement.", - "type": "number", - "format": "float", - "x-order": 53 - }, - "m_shared_blks_read_sum_per_sec": { - "description": "Total number of shared blocks read by the statement.", - "type": "number", - "format": "float", - "x-order": 54 - }, - "m_shared_blks_dirtied_sum_per_sec": { - "description": "Total number of shared blocks dirtied by the statement.", - "type": "number", - "format": "float", - "x-order": 55 - }, - "m_shared_blks_written_sum_per_sec": { - "description": "Total number of shared blocks written by the statement.", - "type": "number", - "format": "float", - "x-order": 56 - }, - "m_shared_blk_read_time_sum_per_sec": { - "description": "Total time the statement spent reading shared blocks, in milliseconds (if track_io_timing is enabled, otherwise zero).", - "type": "number", - "format": "float", - "x-order": 57 - }, - "m_shared_blk_write_time_sum_per_sec": { - "description": "Total time the statement spent writing shared blocks, in milliseconds (if track_io_timing is enabled, otherwise zero).", - "type": "number", - "format": "float", - "x-order": 58 - }, - "m_local_blk_read_time_sum_per_sec": { - "description": "Total time the statement spent reading shared blocks, in milliseconds (if track_io_timing is enabled, otherwise zero).", - "type": "number", - "format": "float", - "x-order": 59 - }, - "m_local_blk_write_time_sum_per_sec": { - "description": "Total time the statement spent writing shared blocks, in milliseconds (if track_io_timing is enabled, otherwise zero).", - "type": "number", - "format": "float", - "x-order": 60 - }, - "m_local_blks_hit_sum_per_sec": { - "description": "Total number of local block cache hits by the statement.", - "type": "number", - "format": "float", - "x-order": 61 - }, - "m_local_blks_read_sum_per_sec": { - "description": "Total number of local blocks read by the statement.", - "type": "number", - "format": "float", - "x-order": 62 - }, - "m_local_blks_dirtied_sum_per_sec": { - "description": "Total number of local blocks dirtied by the statement.", - "type": "number", - "format": "float", - "x-order": 63 - }, - "m_local_blks_written_sum_per_sec": { - "description": "Total number of local blocks written by the statement.", - "type": "number", - "format": "float", - "x-order": 64 - }, - "m_temp_blks_read_sum_per_sec": { - "description": "Total number of temp blocks read by the statement.", - "type": "number", - "format": "float", - "x-order": 65 - }, - "m_temp_blks_written_sum_per_sec": { - "description": "Total number of temp blocks written by the statement.", - "type": "number", - "format": "float", - "x-order": 66 - }, - "m_blk_read_time_sum_per_sec": { - "description": "Total time the statement spent reading blocks, in milliseconds (if track_io_timing is enabled, otherwise zero).", - "type": "number", - "format": "float", - "x-order": 67 - }, - "m_blk_write_time_sum_per_sec": { - "description": "Total time the statement spent writing blocks, in milliseconds (if track_io_timing is enabled, otherwise zero).", - "type": "number", - "format": "float", - "x-order": 68 - }, - "m_cpu_user_time_sum_per_sec": { - "description": "Total time user spent in query.", - "type": "number", - "format": "float", - "x-order": 69 - }, - "m_cpu_sys_time_sum_per_sec": { - "description": "Total time system spent in query.", - "type": "number", - "format": "float", - "x-order": 70 - }, - "m_plans_calls_sum_per_sec": { - "description": "Total number of planned calls.", - "type": "number", - "format": "float", - "x-order": 71 - }, - "m_wal_records_sum_per_sec": { - "description": "Total number of WAL (Write-ahead logging) records.", - "type": "number", - "format": "float", - "x-order": 72 - }, - "m_wal_fpi_sum_per_sec": { - "description": "Total number of FPI (full page images) in WAL (Write-ahead logging) records.", - "type": "number", - "format": "float", - "x-order": 73 - }, - "m_wal_bytes_sum_per_sec": { - "description": "Total bytes of WAL (Write-ahead logging) records.", - "type": "number", - "format": "float", - "x-order": 74 - }, - "m_plan_time_sum_per_sec": { - "description": "Plan time in per seconds.", - "type": "number", - "format": "float", - "x-order": 75 - } - } - }, - "x-order": 2 - }, - "totals": { - "type": "object", - "additionalProperties": { - "description": "MetricValues is statistics of specific metric.", - "type": "object", - "properties": { - "rate": { - "type": "number", - "format": "float", - "x-order": 0 - }, - "cnt": { - "type": "number", - "format": "float", - "x-order": 1 - }, - "sum": { - "type": "number", - "format": "float", - "x-order": 2 - }, - "min": { - "type": "number", - "format": "float", - "x-order": 3 - }, - "max": { - "type": "number", - "format": "float", - "x-order": 4 - }, - "avg": { - "type": "number", - "format": "float", - "x-order": 5 - }, - "p99": { - "type": "number", - "format": "float", - "x-order": 6 - }, - "percent_of_total": { - "type": "number", - "format": "float", - "x-order": 7 - } - } - }, - "x-order": 3 - }, - "fingerprint": { - "type": "string", - "x-order": 4 - }, - "metadata": { - "description": "GetSlecetedQueryMetadataResponse consists selected query metadata to show in details for given query ID.", - "type": "object", - "properties": { - "service_name": { - "type": "string", - "x-order": 0 - }, - "database": { - "type": "string", - "x-order": 1 - }, - "schema": { - "type": "string", - "x-order": 2 - }, - "username": { - "type": "string", - "x-order": 3 - }, - "replication_set": { - "type": "string", - "x-order": 4 - }, - "cluster": { - "type": "string", - "x-order": 5 - }, - "service_type": { - "type": "string", - "x-order": 6 - }, - "service_id": { - "type": "string", - "x-order": 7 - }, - "environment": { - "type": "string", - "x-order": 8 - }, - "node_id": { - "type": "string", - "x-order": 9 - }, - "node_name": { - "type": "string", - "x-order": 10 - }, - "node_type": { - "type": "string", - "x-order": 11 - } - }, - "x-order": 5 - } - } - } - }, - "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 - } - } - } - } - } - } - } - }, - "tags": [ - { - "name": "QANService" - } - ] -} \ No newline at end of file diff --git a/api/qan/v1/object_details.pb.go b/api/qan/v1/object_details.pb.go deleted file mode 100644 index b3fa68a89da..00000000000 --- a/api/qan/v1/object_details.pb.go +++ /dev/null @@ -1,1701 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.10 -// protoc (unknown) -// source: qan/v1/object_details.proto - -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" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// GetMetricsRequest defines filtering of metrics for specific value of dimension (ex.: host=hostname1 or queryid=1D410B4BE5060972. -type GetMetricsRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - PeriodStartFrom *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=period_start_from,json=periodStartFrom,proto3" json:"period_start_from,omitempty"` - PeriodStartTo *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=period_start_to,json=periodStartTo,proto3" json:"period_start_to,omitempty"` - // dimension value: ex: queryid - 1D410B4BE5060972. - FilterBy string `protobuf:"bytes,3,opt,name=filter_by,json=filterBy,proto3" json:"filter_by,omitempty"` - // one of dimension: queryid | host ... - GroupBy string `protobuf:"bytes,4,opt,name=group_by,json=groupBy,proto3" json:"group_by,omitempty"` - Labels []*MapFieldEntry `protobuf:"bytes,5,rep,name=labels,proto3" json:"labels,omitempty"` - IncludeOnlyFields []string `protobuf:"bytes,6,rep,name=include_only_fields,json=includeOnlyFields,proto3" json:"include_only_fields,omitempty"` - // retrieve only values for totals, excluding N/A values - Totals bool `protobuf:"varint,7,opt,name=totals,proto3" json:"totals,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetMetricsRequest) Reset() { - *x = GetMetricsRequest{} - mi := &file_qan_v1_object_details_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetMetricsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetMetricsRequest) ProtoMessage() {} - -func (x *GetMetricsRequest) ProtoReflect() protoreflect.Message { - mi := &file_qan_v1_object_details_proto_msgTypes[0] - 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 GetMetricsRequest.ProtoReflect.Descriptor instead. -func (*GetMetricsRequest) Descriptor() ([]byte, []int) { - return file_qan_v1_object_details_proto_rawDescGZIP(), []int{0} -} - -func (x *GetMetricsRequest) GetPeriodStartFrom() *timestamppb.Timestamp { - if x != nil { - return x.PeriodStartFrom - } - return nil -} - -func (x *GetMetricsRequest) GetPeriodStartTo() *timestamppb.Timestamp { - if x != nil { - return x.PeriodStartTo - } - return nil -} - -func (x *GetMetricsRequest) GetFilterBy() string { - if x != nil { - return x.FilterBy - } - return "" -} - -func (x *GetMetricsRequest) GetGroupBy() string { - if x != nil { - return x.GroupBy - } - return "" -} - -func (x *GetMetricsRequest) GetLabels() []*MapFieldEntry { - if x != nil { - return x.Labels - } - return nil -} - -func (x *GetMetricsRequest) GetIncludeOnlyFields() []string { - if x != nil { - return x.IncludeOnlyFields - } - return nil -} - -func (x *GetMetricsRequest) GetTotals() bool { - if x != nil { - return x.Totals - } - return false -} - -// GetMetricsResponse defines metrics for specific value of dimension (ex.: host=hostname1 or queryid=1D410B4BE5060972. -type GetMetricsResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Metrics map[string]*MetricValues `protobuf:"bytes,3,rep,name=metrics,proto3" json:"metrics,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - TextMetrics map[string]string `protobuf:"bytes,7,rep,name=text_metrics,json=textMetrics,proto3" json:"text_metrics,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - Sparkline []*Point `protobuf:"bytes,4,rep,name=sparkline,proto3" json:"sparkline,omitempty"` - Totals map[string]*MetricValues `protobuf:"bytes,5,rep,name=totals,proto3" json:"totals,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - Fingerprint string `protobuf:"bytes,6,opt,name=fingerprint,proto3" json:"fingerprint,omitempty"` - Metadata *GetSelectedQueryMetadataResponse `protobuf:"bytes,8,opt,name=metadata,proto3" json:"metadata,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetMetricsResponse) Reset() { - *x = GetMetricsResponse{} - mi := &file_qan_v1_object_details_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetMetricsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetMetricsResponse) ProtoMessage() {} - -func (x *GetMetricsResponse) ProtoReflect() protoreflect.Message { - mi := &file_qan_v1_object_details_proto_msgTypes[1] - 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 GetMetricsResponse.ProtoReflect.Descriptor instead. -func (*GetMetricsResponse) Descriptor() ([]byte, []int) { - return file_qan_v1_object_details_proto_rawDescGZIP(), []int{1} -} - -func (x *GetMetricsResponse) GetMetrics() map[string]*MetricValues { - if x != nil { - return x.Metrics - } - return nil -} - -func (x *GetMetricsResponse) GetTextMetrics() map[string]string { - if x != nil { - return x.TextMetrics - } - return nil -} - -func (x *GetMetricsResponse) GetSparkline() []*Point { - if x != nil { - return x.Sparkline - } - return nil -} - -func (x *GetMetricsResponse) GetTotals() map[string]*MetricValues { - if x != nil { - return x.Totals - } - return nil -} - -func (x *GetMetricsResponse) GetFingerprint() string { - if x != nil { - return x.Fingerprint - } - return "" -} - -func (x *GetMetricsResponse) GetMetadata() *GetSelectedQueryMetadataResponse { - if x != nil { - return x.Metadata - } - return nil -} - -// MetricValues is statistics of specific metric. -type MetricValues struct { - state protoimpl.MessageState `protogen:"open.v1"` - Rate float32 `protobuf:"fixed32,1,opt,name=rate,proto3" json:"rate,omitempty"` - Cnt float32 `protobuf:"fixed32,2,opt,name=cnt,proto3" json:"cnt,omitempty"` - Sum float32 `protobuf:"fixed32,3,opt,name=sum,proto3" json:"sum,omitempty"` - Min float32 `protobuf:"fixed32,4,opt,name=min,proto3" json:"min,omitempty"` - Max float32 `protobuf:"fixed32,5,opt,name=max,proto3" json:"max,omitempty"` - Avg float32 `protobuf:"fixed32,6,opt,name=avg,proto3" json:"avg,omitempty"` - P99 float32 `protobuf:"fixed32,7,opt,name=p99,proto3" json:"p99,omitempty"` - PercentOfTotal float32 `protobuf:"fixed32,8,opt,name=percent_of_total,json=percentOfTotal,proto3" json:"percent_of_total,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *MetricValues) Reset() { - *x = MetricValues{} - mi := &file_qan_v1_object_details_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *MetricValues) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MetricValues) ProtoMessage() {} - -func (x *MetricValues) ProtoReflect() protoreflect.Message { - mi := &file_qan_v1_object_details_proto_msgTypes[2] - 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 MetricValues.ProtoReflect.Descriptor instead. -func (*MetricValues) Descriptor() ([]byte, []int) { - return file_qan_v1_object_details_proto_rawDescGZIP(), []int{2} -} - -func (x *MetricValues) GetRate() float32 { - if x != nil { - return x.Rate - } - return 0 -} - -func (x *MetricValues) GetCnt() float32 { - if x != nil { - return x.Cnt - } - return 0 -} - -func (x *MetricValues) GetSum() float32 { - if x != nil { - return x.Sum - } - return 0 -} - -func (x *MetricValues) GetMin() float32 { - if x != nil { - return x.Min - } - return 0 -} - -func (x *MetricValues) GetMax() float32 { - if x != nil { - return x.Max - } - return 0 -} - -func (x *MetricValues) GetAvg() float32 { - if x != nil { - return x.Avg - } - return 0 -} - -func (x *MetricValues) GetP99() float32 { - if x != nil { - return x.P99 - } - return 0 -} - -func (x *MetricValues) GetPercentOfTotal() float32 { - if x != nil { - return x.PercentOfTotal - } - return 0 -} - -// Labels are list of labels or dimensions values. -type Labels struct { - state protoimpl.MessageState `protogen:"open.v1"` - Value []string `protobuf:"bytes,1,rep,name=value,proto3" json:"value,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Labels) Reset() { - *x = Labels{} - mi := &file_qan_v1_object_details_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Labels) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Labels) ProtoMessage() {} - -func (x *Labels) ProtoReflect() protoreflect.Message { - mi := &file_qan_v1_object_details_proto_msgTypes[3] - 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 Labels.ProtoReflect.Descriptor instead. -func (*Labels) Descriptor() ([]byte, []int) { - return file_qan_v1_object_details_proto_rawDescGZIP(), []int{3} -} - -func (x *Labels) GetValue() []string { - if x != nil { - return x.Value - } - return nil -} - -// GetQueryExampleRequest defines filtering of query examples for specific value of -// dimension (ex.: host=hostname1 or queryid=1D410B4BE5060972. -type GetQueryExampleRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - PeriodStartFrom *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=period_start_from,json=periodStartFrom,proto3" json:"period_start_from,omitempty"` - PeriodStartTo *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=period_start_to,json=periodStartTo,proto3" json:"period_start_to,omitempty"` - // dimension value: ex: queryid - 1D410B4BE5060972. - FilterBy string `protobuf:"bytes,3,opt,name=filter_by,json=filterBy,proto3" json:"filter_by,omitempty"` - // one of dimension: queryid | host ... - GroupBy string `protobuf:"bytes,4,opt,name=group_by,json=groupBy,proto3" json:"group_by,omitempty"` - Labels []*MapFieldEntry `protobuf:"bytes,5,rep,name=labels,proto3" json:"labels,omitempty"` - Limit uint32 `protobuf:"varint,6,opt,name=limit,proto3" json:"limit,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetQueryExampleRequest) Reset() { - *x = GetQueryExampleRequest{} - mi := &file_qan_v1_object_details_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetQueryExampleRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetQueryExampleRequest) ProtoMessage() {} - -func (x *GetQueryExampleRequest) ProtoReflect() protoreflect.Message { - mi := &file_qan_v1_object_details_proto_msgTypes[4] - 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 GetQueryExampleRequest.ProtoReflect.Descriptor instead. -func (*GetQueryExampleRequest) Descriptor() ([]byte, []int) { - return file_qan_v1_object_details_proto_rawDescGZIP(), []int{4} -} - -func (x *GetQueryExampleRequest) GetPeriodStartFrom() *timestamppb.Timestamp { - if x != nil { - return x.PeriodStartFrom - } - return nil -} - -func (x *GetQueryExampleRequest) GetPeriodStartTo() *timestamppb.Timestamp { - if x != nil { - return x.PeriodStartTo - } - return nil -} - -func (x *GetQueryExampleRequest) GetFilterBy() string { - if x != nil { - return x.FilterBy - } - return "" -} - -func (x *GetQueryExampleRequest) GetGroupBy() string { - if x != nil { - return x.GroupBy - } - return "" -} - -func (x *GetQueryExampleRequest) GetLabels() []*MapFieldEntry { - if x != nil { - return x.Labels - } - return nil -} - -func (x *GetQueryExampleRequest) GetLimit() uint32 { - if x != nil { - return x.Limit - } - return 0 -} - -// GetQueryExampleResponse list of query examples. -type GetQueryExampleResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - QueryExamples []*QueryExample `protobuf:"bytes,1,rep,name=query_examples,json=queryExamples,proto3" json:"query_examples,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetQueryExampleResponse) Reset() { - *x = GetQueryExampleResponse{} - mi := &file_qan_v1_object_details_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetQueryExampleResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetQueryExampleResponse) ProtoMessage() {} - -func (x *GetQueryExampleResponse) ProtoReflect() protoreflect.Message { - mi := &file_qan_v1_object_details_proto_msgTypes[5] - 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 GetQueryExampleResponse.ProtoReflect.Descriptor instead. -func (*GetQueryExampleResponse) Descriptor() ([]byte, []int) { - return file_qan_v1_object_details_proto_rawDescGZIP(), []int{5} -} - -func (x *GetQueryExampleResponse) GetQueryExamples() []*QueryExample { - if x != nil { - return x.QueryExamples - } - return nil -} - -// QueryExample shows query examples and their metrics. -type QueryExample struct { - state protoimpl.MessageState `protogen:"open.v1"` - Example string `protobuf:"bytes,1,opt,name=example,proto3" json:"example,omitempty"` - ExampleType ExampleType `protobuf:"varint,2,opt,name=example_type,json=exampleType,proto3,enum=qan.v1.ExampleType" json:"example_type,omitempty"` - IsTruncated uint32 `protobuf:"varint,3,opt,name=is_truncated,json=isTruncated,proto3" json:"is_truncated,omitempty"` - PlaceholdersCount uint32 `protobuf:"varint,4,opt,name=placeholders_count,json=placeholdersCount,proto3" json:"placeholders_count,omitempty"` - ExplainFingerprint string `protobuf:"bytes,5,opt,name=explain_fingerprint,json=explainFingerprint,proto3" json:"explain_fingerprint,omitempty"` - QueryId string `protobuf:"bytes,6,opt,name=query_id,json=queryId,proto3" json:"query_id,omitempty"` - ExampleMetrics string `protobuf:"bytes,7,opt,name=example_metrics,json=exampleMetrics,proto3" json:"example_metrics,omitempty"` - ServiceId string `protobuf:"bytes,8,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` - ServiceType string `protobuf:"bytes,9,opt,name=service_type,json=serviceType,proto3" json:"service_type,omitempty"` - Schema string `protobuf:"bytes,10,opt,name=schema,proto3" json:"schema,omitempty"` - Tables []string `protobuf:"bytes,11,rep,name=tables,proto3" json:"tables,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *QueryExample) Reset() { - *x = QueryExample{} - mi := &file_qan_v1_object_details_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *QueryExample) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*QueryExample) ProtoMessage() {} - -func (x *QueryExample) ProtoReflect() protoreflect.Message { - mi := &file_qan_v1_object_details_proto_msgTypes[6] - 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 QueryExample.ProtoReflect.Descriptor instead. -func (*QueryExample) Descriptor() ([]byte, []int) { - return file_qan_v1_object_details_proto_rawDescGZIP(), []int{6} -} - -func (x *QueryExample) GetExample() string { - if x != nil { - return x.Example - } - return "" -} - -func (x *QueryExample) GetExampleType() ExampleType { - if x != nil { - return x.ExampleType - } - return ExampleType_EXAMPLE_TYPE_UNSPECIFIED -} - -func (x *QueryExample) GetIsTruncated() uint32 { - if x != nil { - return x.IsTruncated - } - return 0 -} - -func (x *QueryExample) GetPlaceholdersCount() uint32 { - if x != nil { - return x.PlaceholdersCount - } - return 0 -} - -func (x *QueryExample) GetExplainFingerprint() string { - if x != nil { - return x.ExplainFingerprint - } - return "" -} - -func (x *QueryExample) GetQueryId() string { - if x != nil { - return x.QueryId - } - return "" -} - -func (x *QueryExample) GetExampleMetrics() string { - if x != nil { - return x.ExampleMetrics - } - return "" -} - -func (x *QueryExample) GetServiceId() string { - if x != nil { - return x.ServiceId - } - return "" -} - -func (x *QueryExample) GetServiceType() string { - if x != nil { - return x.ServiceType - } - return "" -} - -func (x *QueryExample) GetSchema() string { - if x != nil { - return x.Schema - } - return "" -} - -func (x *QueryExample) GetTables() []string { - if x != nil { - return x.Tables - } - return nil -} - -// GetLabelsRequest defines filtering of object detail's labels for specific value of -// dimension (ex.: host=hostname1 or queryid=1D410B4BE5060972. -type GetLabelsRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - PeriodStartFrom *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=period_start_from,json=periodStartFrom,proto3" json:"period_start_from,omitempty"` - PeriodStartTo *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=period_start_to,json=periodStartTo,proto3" json:"period_start_to,omitempty"` - // dimension value: ex: queryid - 1D410B4BE5060972. - FilterBy string `protobuf:"bytes,3,opt,name=filter_by,json=filterBy,proto3" json:"filter_by,omitempty"` - // one of dimension: queryid | host ... - GroupBy string `protobuf:"bytes,4,opt,name=group_by,json=groupBy,proto3" json:"group_by,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetLabelsRequest) Reset() { - *x = GetLabelsRequest{} - mi := &file_qan_v1_object_details_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetLabelsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetLabelsRequest) ProtoMessage() {} - -func (x *GetLabelsRequest) ProtoReflect() protoreflect.Message { - mi := &file_qan_v1_object_details_proto_msgTypes[7] - 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 GetLabelsRequest.ProtoReflect.Descriptor instead. -func (*GetLabelsRequest) Descriptor() ([]byte, []int) { - return file_qan_v1_object_details_proto_rawDescGZIP(), []int{7} -} - -func (x *GetLabelsRequest) GetPeriodStartFrom() *timestamppb.Timestamp { - if x != nil { - return x.PeriodStartFrom - } - return nil -} - -func (x *GetLabelsRequest) GetPeriodStartTo() *timestamppb.Timestamp { - if x != nil { - return x.PeriodStartTo - } - return nil -} - -func (x *GetLabelsRequest) GetFilterBy() string { - if x != nil { - return x.FilterBy - } - return "" -} - -func (x *GetLabelsRequest) GetGroupBy() string { - if x != nil { - return x.GroupBy - } - return "" -} - -// GetLabelsResponse is a map of labels names as keys and labels values as a list. -type GetLabelsResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Labels map[string]*ListLabelValues `protobuf:"bytes,1,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetLabelsResponse) Reset() { - *x = GetLabelsResponse{} - mi := &file_qan_v1_object_details_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetLabelsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetLabelsResponse) ProtoMessage() {} - -func (x *GetLabelsResponse) ProtoReflect() protoreflect.Message { - mi := &file_qan_v1_object_details_proto_msgTypes[8] - 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 GetLabelsResponse.ProtoReflect.Descriptor instead. -func (*GetLabelsResponse) Descriptor() ([]byte, []int) { - return file_qan_v1_object_details_proto_rawDescGZIP(), []int{8} -} - -func (x *GetLabelsResponse) GetLabels() map[string]*ListLabelValues { - if x != nil { - return x.Labels - } - return nil -} - -// ListLabelValues is list of label's values. -type ListLabelValues struct { - state protoimpl.MessageState `protogen:"open.v1"` - Values []string `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ListLabelValues) Reset() { - *x = ListLabelValues{} - mi := &file_qan_v1_object_details_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ListLabelValues) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListLabelValues) ProtoMessage() {} - -func (x *ListLabelValues) ProtoReflect() protoreflect.Message { - mi := &file_qan_v1_object_details_proto_msgTypes[9] - 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 ListLabelValues.ProtoReflect.Descriptor instead. -func (*ListLabelValues) Descriptor() ([]byte, []int) { - return file_qan_v1_object_details_proto_rawDescGZIP(), []int{9} -} - -func (x *ListLabelValues) GetValues() []string { - if x != nil { - return x.Values - } - return nil -} - -// GetQueryPlanRequest defines filtering by queryid. -type GetQueryPlanRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - Queryid string `protobuf:"bytes,1,opt,name=queryid,proto3" json:"queryid,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetQueryPlanRequest) Reset() { - *x = GetQueryPlanRequest{} - mi := &file_qan_v1_object_details_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetQueryPlanRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetQueryPlanRequest) ProtoMessage() {} - -func (x *GetQueryPlanRequest) ProtoReflect() protoreflect.Message { - mi := &file_qan_v1_object_details_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 GetQueryPlanRequest.ProtoReflect.Descriptor instead. -func (*GetQueryPlanRequest) Descriptor() ([]byte, []int) { - return file_qan_v1_object_details_proto_rawDescGZIP(), []int{10} -} - -func (x *GetQueryPlanRequest) GetQueryid() string { - if x != nil { - return x.Queryid - } - return "" -} - -// GetQueryPlanResponse contains planid and query_plan. -type GetQueryPlanResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Planid string `protobuf:"bytes,1,opt,name=planid,proto3" json:"planid,omitempty"` - QueryPlan string `protobuf:"bytes,2,opt,name=query_plan,json=queryPlan,proto3" json:"query_plan,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetQueryPlanResponse) Reset() { - *x = GetQueryPlanResponse{} - mi := &file_qan_v1_object_details_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetQueryPlanResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetQueryPlanResponse) ProtoMessage() {} - -func (x *GetQueryPlanResponse) ProtoReflect() protoreflect.Message { - mi := &file_qan_v1_object_details_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 GetQueryPlanResponse.ProtoReflect.Descriptor instead. -func (*GetQueryPlanResponse) Descriptor() ([]byte, []int) { - return file_qan_v1_object_details_proto_rawDescGZIP(), []int{11} -} - -func (x *GetQueryPlanResponse) GetPlanid() string { - if x != nil { - return x.Planid - } - return "" -} - -func (x *GetQueryPlanResponse) GetQueryPlan() string { - if x != nil { - return x.QueryPlan - } - return "" -} - -// GetHistogramRequest defines filtering by time range, labels and queryid. -type GetHistogramRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - PeriodStartFrom *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=period_start_from,json=periodStartFrom,proto3" json:"period_start_from,omitempty"` - PeriodStartTo *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=period_start_to,json=periodStartTo,proto3" json:"period_start_to,omitempty"` - Labels []*MapFieldEntry `protobuf:"bytes,3,rep,name=labels,proto3" json:"labels,omitempty"` - Queryid string `protobuf:"bytes,4,opt,name=queryid,proto3" json:"queryid,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetHistogramRequest) Reset() { - *x = GetHistogramRequest{} - mi := &file_qan_v1_object_details_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetHistogramRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetHistogramRequest) ProtoMessage() {} - -func (x *GetHistogramRequest) ProtoReflect() protoreflect.Message { - mi := &file_qan_v1_object_details_proto_msgTypes[12] - 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 GetHistogramRequest.ProtoReflect.Descriptor instead. -func (*GetHistogramRequest) Descriptor() ([]byte, []int) { - return file_qan_v1_object_details_proto_rawDescGZIP(), []int{12} -} - -func (x *GetHistogramRequest) GetPeriodStartFrom() *timestamppb.Timestamp { - if x != nil { - return x.PeriodStartFrom - } - return nil -} - -func (x *GetHistogramRequest) GetPeriodStartTo() *timestamppb.Timestamp { - if x != nil { - return x.PeriodStartTo - } - return nil -} - -func (x *GetHistogramRequest) GetLabels() []*MapFieldEntry { - if x != nil { - return x.Labels - } - return nil -} - -func (x *GetHistogramRequest) GetQueryid() string { - if x != nil { - return x.Queryid - } - return "" -} - -// GetHistogramResponse is histogram items as a list. -type GetHistogramResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - HistogramItems []*HistogramItem `protobuf:"bytes,1,rep,name=histogram_items,json=histogramItems,proto3" json:"histogram_items,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetHistogramResponse) Reset() { - *x = GetHistogramResponse{} - mi := &file_qan_v1_object_details_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetHistogramResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetHistogramResponse) ProtoMessage() {} - -func (x *GetHistogramResponse) ProtoReflect() protoreflect.Message { - mi := &file_qan_v1_object_details_proto_msgTypes[13] - 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 GetHistogramResponse.ProtoReflect.Descriptor instead. -func (*GetHistogramResponse) Descriptor() ([]byte, []int) { - return file_qan_v1_object_details_proto_rawDescGZIP(), []int{13} -} - -func (x *GetHistogramResponse) GetHistogramItems() []*HistogramItem { - if x != nil { - return x.HistogramItems - } - return nil -} - -// HistogramItem represents one item in histogram. -type HistogramItem struct { - state protoimpl.MessageState `protogen:"open.v1"` - Range string `protobuf:"bytes,1,opt,name=range,proto3" json:"range,omitempty"` - Frequency uint32 `protobuf:"varint,2,opt,name=frequency,proto3" json:"frequency,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *HistogramItem) Reset() { - *x = HistogramItem{} - mi := &file_qan_v1_object_details_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *HistogramItem) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*HistogramItem) ProtoMessage() {} - -func (x *HistogramItem) ProtoReflect() protoreflect.Message { - mi := &file_qan_v1_object_details_proto_msgTypes[14] - 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 HistogramItem.ProtoReflect.Descriptor instead. -func (*HistogramItem) Descriptor() ([]byte, []int) { - return file_qan_v1_object_details_proto_rawDescGZIP(), []int{14} -} - -func (x *HistogramItem) GetRange() string { - if x != nil { - return x.Range - } - return "" -} - -func (x *HistogramItem) GetFrequency() uint32 { - if x != nil { - return x.Frequency - } - return 0 -} - -// QueryExistsRequest check if provided query exists or not. -type QueryExistsRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - Serviceid string `protobuf:"bytes,1,opt,name=serviceid,proto3" json:"serviceid,omitempty"` - Query string `protobuf:"bytes,2,opt,name=query,proto3" json:"query,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *QueryExistsRequest) Reset() { - *x = QueryExistsRequest{} - mi := &file_qan_v1_object_details_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *QueryExistsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*QueryExistsRequest) ProtoMessage() {} - -func (x *QueryExistsRequest) ProtoReflect() protoreflect.Message { - mi := &file_qan_v1_object_details_proto_msgTypes[15] - 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 QueryExistsRequest.ProtoReflect.Descriptor instead. -func (*QueryExistsRequest) Descriptor() ([]byte, []int) { - return file_qan_v1_object_details_proto_rawDescGZIP(), []int{15} -} - -func (x *QueryExistsRequest) GetServiceid() string { - if x != nil { - return x.Serviceid - } - return "" -} - -func (x *QueryExistsRequest) GetQuery() string { - if x != nil { - return x.Query - } - return "" -} - -// QueryExistsResponse returns true if query exists. -type QueryExistsResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Exists bool `protobuf:"varint,1,opt,name=exists,proto3" json:"exists,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *QueryExistsResponse) Reset() { - *x = QueryExistsResponse{} - mi := &file_qan_v1_object_details_proto_msgTypes[16] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *QueryExistsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*QueryExistsResponse) ProtoMessage() {} - -func (x *QueryExistsResponse) ProtoReflect() protoreflect.Message { - mi := &file_qan_v1_object_details_proto_msgTypes[16] - 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 QueryExistsResponse.ProtoReflect.Descriptor instead. -func (*QueryExistsResponse) Descriptor() ([]byte, []int) { - return file_qan_v1_object_details_proto_rawDescGZIP(), []int{16} -} - -func (x *QueryExistsResponse) GetExists() bool { - if x != nil { - return x.Exists - } - return false -} - -// SchemaByQueryIDRequest returns schema for given query ID and service ID. -type SchemaByQueryIDRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - ServiceId string `protobuf:"bytes,1,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` - QueryId string `protobuf:"bytes,2,opt,name=query_id,json=queryId,proto3" json:"query_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SchemaByQueryIDRequest) Reset() { - *x = SchemaByQueryIDRequest{} - mi := &file_qan_v1_object_details_proto_msgTypes[17] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SchemaByQueryIDRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SchemaByQueryIDRequest) ProtoMessage() {} - -func (x *SchemaByQueryIDRequest) ProtoReflect() protoreflect.Message { - mi := &file_qan_v1_object_details_proto_msgTypes[17] - 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 SchemaByQueryIDRequest.ProtoReflect.Descriptor instead. -func (*SchemaByQueryIDRequest) Descriptor() ([]byte, []int) { - return file_qan_v1_object_details_proto_rawDescGZIP(), []int{17} -} - -func (x *SchemaByQueryIDRequest) GetServiceId() string { - if x != nil { - return x.ServiceId - } - return "" -} - -func (x *SchemaByQueryIDRequest) GetQueryId() string { - if x != nil { - return x.QueryId - } - return "" -} - -// SchemaByQueryIDResponse is schema for given query ID and service ID. -type SchemaByQueryIDResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Schema string `protobuf:"bytes,1,opt,name=schema,proto3" json:"schema,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SchemaByQueryIDResponse) Reset() { - *x = SchemaByQueryIDResponse{} - mi := &file_qan_v1_object_details_proto_msgTypes[18] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SchemaByQueryIDResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SchemaByQueryIDResponse) ProtoMessage() {} - -func (x *SchemaByQueryIDResponse) ProtoReflect() protoreflect.Message { - mi := &file_qan_v1_object_details_proto_msgTypes[18] - 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 SchemaByQueryIDResponse.ProtoReflect.Descriptor instead. -func (*SchemaByQueryIDResponse) Descriptor() ([]byte, []int) { - return file_qan_v1_object_details_proto_rawDescGZIP(), []int{18} -} - -func (x *SchemaByQueryIDResponse) GetSchema() string { - if x != nil { - return x.Schema - } - return "" -} - -// ExplainFingerprintByQueryIDRequest get explain fingerprint for given query ID. -type ExplainFingerprintByQueryIDRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - Serviceid string `protobuf:"bytes,1,opt,name=serviceid,proto3" json:"serviceid,omitempty"` - QueryId string `protobuf:"bytes,2,opt,name=query_id,json=queryId,proto3" json:"query_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ExplainFingerprintByQueryIDRequest) Reset() { - *x = ExplainFingerprintByQueryIDRequest{} - mi := &file_qan_v1_object_details_proto_msgTypes[19] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ExplainFingerprintByQueryIDRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ExplainFingerprintByQueryIDRequest) ProtoMessage() {} - -func (x *ExplainFingerprintByQueryIDRequest) ProtoReflect() protoreflect.Message { - mi := &file_qan_v1_object_details_proto_msgTypes[19] - 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 ExplainFingerprintByQueryIDRequest.ProtoReflect.Descriptor instead. -func (*ExplainFingerprintByQueryIDRequest) Descriptor() ([]byte, []int) { - return file_qan_v1_object_details_proto_rawDescGZIP(), []int{19} -} - -func (x *ExplainFingerprintByQueryIDRequest) GetServiceid() string { - if x != nil { - return x.Serviceid - } - return "" -} - -func (x *ExplainFingerprintByQueryIDRequest) GetQueryId() string { - if x != nil { - return x.QueryId - } - return "" -} - -// ExplainFingerprintByQueryIDResponse is explain fingerprint and placeholders count for given query ID. -type ExplainFingerprintByQueryIDResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - ExplainFingerprint string `protobuf:"bytes,1,opt,name=explain_fingerprint,json=explainFingerprint,proto3" json:"explain_fingerprint,omitempty"` - PlaceholdersCount uint32 `protobuf:"varint,2,opt,name=placeholders_count,json=placeholdersCount,proto3" json:"placeholders_count,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ExplainFingerprintByQueryIDResponse) Reset() { - *x = ExplainFingerprintByQueryIDResponse{} - mi := &file_qan_v1_object_details_proto_msgTypes[20] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ExplainFingerprintByQueryIDResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ExplainFingerprintByQueryIDResponse) ProtoMessage() {} - -func (x *ExplainFingerprintByQueryIDResponse) ProtoReflect() protoreflect.Message { - mi := &file_qan_v1_object_details_proto_msgTypes[20] - 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 ExplainFingerprintByQueryIDResponse.ProtoReflect.Descriptor instead. -func (*ExplainFingerprintByQueryIDResponse) Descriptor() ([]byte, []int) { - return file_qan_v1_object_details_proto_rawDescGZIP(), []int{20} -} - -func (x *ExplainFingerprintByQueryIDResponse) GetExplainFingerprint() string { - if x != nil { - return x.ExplainFingerprint - } - return "" -} - -func (x *ExplainFingerprintByQueryIDResponse) GetPlaceholdersCount() uint32 { - if x != nil { - return x.PlaceholdersCount - } - return 0 -} - -// GetSlecetedQueryMetadataResponse consists selected query metadata to show in details for given query ID. -type GetSelectedQueryMetadataResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - ServiceName string `protobuf:"bytes,1,opt,name=service_name,json=serviceName,proto3" json:"service_name,omitempty"` - Database string `protobuf:"bytes,2,opt,name=database,proto3" json:"database,omitempty"` - Schema string `protobuf:"bytes,3,opt,name=schema,proto3" json:"schema,omitempty"` - Username string `protobuf:"bytes,4,opt,name=username,proto3" json:"username,omitempty"` - ReplicationSet string `protobuf:"bytes,5,opt,name=replication_set,json=replicationSet,proto3" json:"replication_set,omitempty"` - Cluster string `protobuf:"bytes,6,opt,name=cluster,proto3" json:"cluster,omitempty"` - ServiceType string `protobuf:"bytes,7,opt,name=service_type,json=serviceType,proto3" json:"service_type,omitempty"` - ServiceId string `protobuf:"bytes,8,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` - Environment string `protobuf:"bytes,9,opt,name=environment,proto3" json:"environment,omitempty"` - NodeId string `protobuf:"bytes,10,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` - NodeName string `protobuf:"bytes,11,opt,name=node_name,json=nodeName,proto3" json:"node_name,omitempty"` - NodeType string `protobuf:"bytes,12,opt,name=node_type,json=nodeType,proto3" json:"node_type,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetSelectedQueryMetadataResponse) Reset() { - *x = GetSelectedQueryMetadataResponse{} - mi := &file_qan_v1_object_details_proto_msgTypes[21] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetSelectedQueryMetadataResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetSelectedQueryMetadataResponse) ProtoMessage() {} - -func (x *GetSelectedQueryMetadataResponse) ProtoReflect() protoreflect.Message { - mi := &file_qan_v1_object_details_proto_msgTypes[21] - 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 GetSelectedQueryMetadataResponse.ProtoReflect.Descriptor instead. -func (*GetSelectedQueryMetadataResponse) Descriptor() ([]byte, []int) { - return file_qan_v1_object_details_proto_rawDescGZIP(), []int{21} -} - -func (x *GetSelectedQueryMetadataResponse) GetServiceName() string { - if x != nil { - return x.ServiceName - } - return "" -} - -func (x *GetSelectedQueryMetadataResponse) GetDatabase() string { - if x != nil { - return x.Database - } - return "" -} - -func (x *GetSelectedQueryMetadataResponse) GetSchema() string { - if x != nil { - return x.Schema - } - return "" -} - -func (x *GetSelectedQueryMetadataResponse) GetUsername() string { - if x != nil { - return x.Username - } - return "" -} - -func (x *GetSelectedQueryMetadataResponse) GetReplicationSet() string { - if x != nil { - return x.ReplicationSet - } - return "" -} - -func (x *GetSelectedQueryMetadataResponse) GetCluster() string { - if x != nil { - return x.Cluster - } - return "" -} - -func (x *GetSelectedQueryMetadataResponse) GetServiceType() string { - if x != nil { - return x.ServiceType - } - return "" -} - -func (x *GetSelectedQueryMetadataResponse) GetServiceId() string { - if x != nil { - return x.ServiceId - } - return "" -} - -func (x *GetSelectedQueryMetadataResponse) GetEnvironment() string { - if x != nil { - return x.Environment - } - return "" -} - -func (x *GetSelectedQueryMetadataResponse) GetNodeId() string { - if x != nil { - return x.NodeId - } - return "" -} - -func (x *GetSelectedQueryMetadataResponse) GetNodeName() string { - if x != nil { - return x.NodeName - } - return "" -} - -func (x *GetSelectedQueryMetadataResponse) GetNodeType() string { - if x != nil { - return x.NodeType - } - return "" -} - -var File_qan_v1_object_details_proto protoreflect.FileDescriptor - -const file_qan_v1_object_details_proto_rawDesc = "" + - "\n" + - "\x1bqan/v1/object_details.proto\x12\x06qan.v1\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x10qan/v1/qan.proto\"\xce\x02\n" + - "\x11GetMetricsRequest\x12F\n" + - "\x11period_start_from\x18\x01 \x01(\v2\x1a.google.protobuf.TimestampR\x0fperiodStartFrom\x12B\n" + - "\x0fperiod_start_to\x18\x02 \x01(\v2\x1a.google.protobuf.TimestampR\rperiodStartTo\x12\x1b\n" + - "\tfilter_by\x18\x03 \x01(\tR\bfilterBy\x12\x19\n" + - "\bgroup_by\x18\x04 \x01(\tR\agroupBy\x12-\n" + - "\x06labels\x18\x05 \x03(\v2\x15.qan.v1.MapFieldEntryR\x06labels\x12.\n" + - "\x13include_only_fields\x18\x06 \x03(\tR\x11includeOnlyFields\x12\x16\n" + - "\x06totals\x18\a \x01(\bR\x06totals\"\xdf\x04\n" + - "\x12GetMetricsResponse\x12A\n" + - "\ametrics\x18\x03 \x03(\v2'.qan.v1.GetMetricsResponse.MetricsEntryR\ametrics\x12N\n" + - "\ftext_metrics\x18\a \x03(\v2+.qan.v1.GetMetricsResponse.TextMetricsEntryR\vtextMetrics\x12+\n" + - "\tsparkline\x18\x04 \x03(\v2\r.qan.v1.PointR\tsparkline\x12>\n" + - "\x06totals\x18\x05 \x03(\v2&.qan.v1.GetMetricsResponse.TotalsEntryR\x06totals\x12 \n" + - "\vfingerprint\x18\x06 \x01(\tR\vfingerprint\x12D\n" + - "\bmetadata\x18\b \x01(\v2(.qan.v1.GetSelectedQueryMetadataResponseR\bmetadata\x1aP\n" + - "\fMetricsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12*\n" + - "\x05value\x18\x02 \x01(\v2\x14.qan.v1.MetricValuesR\x05value:\x028\x01\x1a>\n" + - "\x10TextMetricsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\x1aO\n" + - "\vTotalsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12*\n" + - "\x05value\x18\x02 \x01(\v2\x14.qan.v1.MetricValuesR\x05value:\x028\x01\"\xb8\x01\n" + - "\fMetricValues\x12\x12\n" + - "\x04rate\x18\x01 \x01(\x02R\x04rate\x12\x10\n" + - "\x03cnt\x18\x02 \x01(\x02R\x03cnt\x12\x10\n" + - "\x03sum\x18\x03 \x01(\x02R\x03sum\x12\x10\n" + - "\x03min\x18\x04 \x01(\x02R\x03min\x12\x10\n" + - "\x03max\x18\x05 \x01(\x02R\x03max\x12\x10\n" + - "\x03avg\x18\x06 \x01(\x02R\x03avg\x12\x10\n" + - "\x03p99\x18\a \x01(\x02R\x03p99\x12(\n" + - "\x10percent_of_total\x18\b \x01(\x02R\x0epercentOfTotal\"\x1e\n" + - "\x06Labels\x12\x14\n" + - "\x05value\x18\x01 \x03(\tR\x05value\"\xa1\x02\n" + - "\x16GetQueryExampleRequest\x12F\n" + - "\x11period_start_from\x18\x01 \x01(\v2\x1a.google.protobuf.TimestampR\x0fperiodStartFrom\x12B\n" + - "\x0fperiod_start_to\x18\x02 \x01(\v2\x1a.google.protobuf.TimestampR\rperiodStartTo\x12\x1b\n" + - "\tfilter_by\x18\x03 \x01(\tR\bfilterBy\x12\x19\n" + - "\bgroup_by\x18\x04 \x01(\tR\agroupBy\x12-\n" + - "\x06labels\x18\x05 \x03(\v2\x15.qan.v1.MapFieldEntryR\x06labels\x12\x14\n" + - "\x05limit\x18\x06 \x01(\rR\x05limit\"V\n" + - "\x17GetQueryExampleResponse\x12;\n" + - "\x0equery_examples\x18\x01 \x03(\v2\x14.qan.v1.QueryExampleR\rqueryExamples\"\x99\x03\n" + - "\fQueryExample\x12\x18\n" + - "\aexample\x18\x01 \x01(\tR\aexample\x126\n" + - "\fexample_type\x18\x02 \x01(\x0e2\x13.qan.v1.ExampleTypeR\vexampleType\x12!\n" + - "\fis_truncated\x18\x03 \x01(\rR\visTruncated\x12-\n" + - "\x12placeholders_count\x18\x04 \x01(\rR\x11placeholdersCount\x12/\n" + - "\x13explain_fingerprint\x18\x05 \x01(\tR\x12explainFingerprint\x12\x19\n" + - "\bquery_id\x18\x06 \x01(\tR\aqueryId\x12'\n" + - "\x0fexample_metrics\x18\a \x01(\tR\x0eexampleMetrics\x12\x1d\n" + - "\n" + - "service_id\x18\b \x01(\tR\tserviceId\x12!\n" + - "\fservice_type\x18\t \x01(\tR\vserviceType\x12\x16\n" + - "\x06schema\x18\n" + - " \x01(\tR\x06schema\x12\x16\n" + - "\x06tables\x18\v \x03(\tR\x06tables\"\xd6\x01\n" + - "\x10GetLabelsRequest\x12F\n" + - "\x11period_start_from\x18\x01 \x01(\v2\x1a.google.protobuf.TimestampR\x0fperiodStartFrom\x12B\n" + - "\x0fperiod_start_to\x18\x02 \x01(\v2\x1a.google.protobuf.TimestampR\rperiodStartTo\x12\x1b\n" + - "\tfilter_by\x18\x03 \x01(\tR\bfilterBy\x12\x19\n" + - "\bgroup_by\x18\x04 \x01(\tR\agroupBy\"\xa6\x01\n" + - "\x11GetLabelsResponse\x12=\n" + - "\x06labels\x18\x01 \x03(\v2%.qan.v1.GetLabelsResponse.LabelsEntryR\x06labels\x1aR\n" + - "\vLabelsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12-\n" + - "\x05value\x18\x02 \x01(\v2\x17.qan.v1.ListLabelValuesR\x05value:\x028\x01\")\n" + - "\x0fListLabelValues\x12\x16\n" + - "\x06values\x18\x01 \x03(\tR\x06values\"/\n" + - "\x13GetQueryPlanRequest\x12\x18\n" + - "\aqueryid\x18\x01 \x01(\tR\aqueryid\"M\n" + - "\x14GetQueryPlanResponse\x12\x16\n" + - "\x06planid\x18\x01 \x01(\tR\x06planid\x12\x1d\n" + - "\n" + - "query_plan\x18\x02 \x01(\tR\tqueryPlan\"\xea\x01\n" + - "\x13GetHistogramRequest\x12F\n" + - "\x11period_start_from\x18\x01 \x01(\v2\x1a.google.protobuf.TimestampR\x0fperiodStartFrom\x12B\n" + - "\x0fperiod_start_to\x18\x02 \x01(\v2\x1a.google.protobuf.TimestampR\rperiodStartTo\x12-\n" + - "\x06labels\x18\x03 \x03(\v2\x15.qan.v1.MapFieldEntryR\x06labels\x12\x18\n" + - "\aqueryid\x18\x04 \x01(\tR\aqueryid\"V\n" + - "\x14GetHistogramResponse\x12>\n" + - "\x0fhistogram_items\x18\x01 \x03(\v2\x15.qan.v1.HistogramItemR\x0ehistogramItems\"C\n" + - "\rHistogramItem\x12\x14\n" + - "\x05range\x18\x01 \x01(\tR\x05range\x12\x1c\n" + - "\tfrequency\x18\x02 \x01(\rR\tfrequency\"H\n" + - "\x12QueryExistsRequest\x12\x1c\n" + - "\tserviceid\x18\x01 \x01(\tR\tserviceid\x12\x14\n" + - "\x05query\x18\x02 \x01(\tR\x05query\"-\n" + - "\x13QueryExistsResponse\x12\x16\n" + - "\x06exists\x18\x01 \x01(\bR\x06exists\"R\n" + - "\x16SchemaByQueryIDRequest\x12\x1d\n" + - "\n" + - "service_id\x18\x01 \x01(\tR\tserviceId\x12\x19\n" + - "\bquery_id\x18\x02 \x01(\tR\aqueryId\"1\n" + - "\x17SchemaByQueryIDResponse\x12\x16\n" + - "\x06schema\x18\x01 \x01(\tR\x06schema\"]\n" + - "\"ExplainFingerprintByQueryIDRequest\x12\x1c\n" + - "\tserviceid\x18\x01 \x01(\tR\tserviceid\x12\x19\n" + - "\bquery_id\x18\x02 \x01(\tR\aqueryId\"\x85\x01\n" + - "#ExplainFingerprintByQueryIDResponse\x12/\n" + - "\x13explain_fingerprint\x18\x01 \x01(\tR\x12explainFingerprint\x12-\n" + - "\x12placeholders_count\x18\x02 \x01(\rR\x11placeholdersCount\"\x8f\x03\n" + - " GetSelectedQueryMetadataResponse\x12!\n" + - "\fservice_name\x18\x01 \x01(\tR\vserviceName\x12\x1a\n" + - "\bdatabase\x18\x02 \x01(\tR\bdatabase\x12\x16\n" + - "\x06schema\x18\x03 \x01(\tR\x06schema\x12\x1a\n" + - "\busername\x18\x04 \x01(\tR\busername\x12'\n" + - "\x0freplication_set\x18\x05 \x01(\tR\x0ereplicationSet\x12\x18\n" + - "\acluster\x18\x06 \x01(\tR\acluster\x12!\n" + - "\fservice_type\x18\a \x01(\tR\vserviceType\x12\x1d\n" + - "\n" + - "service_id\x18\b \x01(\tR\tserviceId\x12 \n" + - "\venvironment\x18\t \x01(\tR\venvironment\x12\x17\n" + - "\anode_id\x18\n" + - " \x01(\tR\x06nodeId\x12\x1b\n" + - "\tnode_name\x18\v \x01(\tR\bnodeName\x12\x1b\n" + - "\tnode_type\x18\f \x01(\tR\bnodeTypeB\x82\x01\n" + - "\n" + - "com.qan.v1B\x12ObjectDetailsProtoP\x01Z'github.com/percona/pmm/api/qan/v1;qanv1\xa2\x02\x03QXX\xaa\x02\x06Qan.V1\xca\x02\x06Qan\\V1\xe2\x02\x12Qan\\V1\\GPBMetadata\xea\x02\aQan::V1b\x06proto3" - -var ( - file_qan_v1_object_details_proto_rawDescOnce sync.Once - file_qan_v1_object_details_proto_rawDescData []byte -) - -func file_qan_v1_object_details_proto_rawDescGZIP() []byte { - file_qan_v1_object_details_proto_rawDescOnce.Do(func() { - file_qan_v1_object_details_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_qan_v1_object_details_proto_rawDesc), len(file_qan_v1_object_details_proto_rawDesc))) - }) - 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_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 - 27, // 2: qan.v1.GetMetricsRequest.labels:type_name -> qan.v1.MapFieldEntry - 22, // 3: qan.v1.GetMetricsResponse.metrics:type_name -> qan.v1.GetMetricsResponse.MetricsEntry - 23, // 4: qan.v1.GetMetricsResponse.text_metrics:type_name -> qan.v1.GetMetricsResponse.TextMetricsEntry - 28, // 5: qan.v1.GetMetricsResponse.sparkline:type_name -> qan.v1.Point - 24, // 6: qan.v1.GetMetricsResponse.totals:type_name -> qan.v1.GetMetricsResponse.TotalsEntry - 21, // 7: qan.v1.GetMetricsResponse.metadata:type_name -> qan.v1.GetSelectedQueryMetadataResponse - 26, // 8: qan.v1.GetQueryExampleRequest.period_start_from:type_name -> google.protobuf.Timestamp - 26, // 9: qan.v1.GetQueryExampleRequest.period_start_to:type_name -> google.protobuf.Timestamp - 27, // 10: qan.v1.GetQueryExampleRequest.labels:type_name -> qan.v1.MapFieldEntry - 6, // 11: qan.v1.GetQueryExampleResponse.query_examples:type_name -> qan.v1.QueryExample - 29, // 12: qan.v1.QueryExample.example_type:type_name -> qan.v1.ExampleType - 26, // 13: qan.v1.GetLabelsRequest.period_start_from:type_name -> google.protobuf.Timestamp - 26, // 14: qan.v1.GetLabelsRequest.period_start_to:type_name -> google.protobuf.Timestamp - 25, // 15: qan.v1.GetLabelsResponse.labels:type_name -> qan.v1.GetLabelsResponse.LabelsEntry - 26, // 16: qan.v1.GetHistogramRequest.period_start_from:type_name -> google.protobuf.Timestamp - 26, // 17: qan.v1.GetHistogramRequest.period_start_to:type_name -> google.protobuf.Timestamp - 27, // 18: qan.v1.GetHistogramRequest.labels:type_name -> qan.v1.MapFieldEntry - 14, // 19: qan.v1.GetHistogramResponse.histogram_items:type_name -> qan.v1.HistogramItem - 2, // 20: qan.v1.GetMetricsResponse.MetricsEntry.value:type_name -> qan.v1.MetricValues - 2, // 21: qan.v1.GetMetricsResponse.TotalsEntry.value:type_name -> qan.v1.MetricValues - 9, // 22: qan.v1.GetLabelsResponse.LabelsEntry.value:type_name -> qan.v1.ListLabelValues - 23, // [23:23] is the sub-list for method output_type - 23, // [23:23] is the sub-list for method input_type - 23, // [23:23] is the sub-list for extension type_name - 23, // [23:23] is the sub-list for extension extendee - 0, // [0:23] is the sub-list for field type_name -} - -func init() { file_qan_v1_object_details_proto_init() } -func file_qan_v1_object_details_proto_init() { - if File_qan_v1_object_details_proto != nil { - return - } - file_qan_v1_qan_proto_init() - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_qan_v1_object_details_proto_rawDesc), len(file_qan_v1_object_details_proto_rawDesc)), - NumEnums: 0, - NumMessages: 26, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_qan_v1_object_details_proto_goTypes, - DependencyIndexes: file_qan_v1_object_details_proto_depIdxs, - MessageInfos: file_qan_v1_object_details_proto_msgTypes, - }.Build() - File_qan_v1_object_details_proto = out.File - file_qan_v1_object_details_proto_goTypes = nil - file_qan_v1_object_details_proto_depIdxs = nil -} diff --git a/api/qan/v1/object_details.pb.validate.go b/api/qan/v1/object_details.pb.validate.go deleted file mode 100644 index 59861ff0fde..00000000000 --- a/api/qan/v1/object_details.pb.validate.go +++ /dev/null @@ -1,2988 +0,0 @@ -// Code generated by protoc-gen-validate. DO NOT EDIT. -// source: qan/v1/object_details.proto - -package qanv1 - -import ( - "bytes" - "errors" - "fmt" - "net" - "net/mail" - "net/url" - "regexp" - "sort" - "strings" - "time" - "unicode/utf8" - - "google.golang.org/protobuf/types/known/anypb" -) - -// ensure the imports are used -var ( - _ = bytes.MinRead - _ = errors.New("") - _ = fmt.Print - _ = utf8.UTFMax - _ = (*regexp.Regexp)(nil) - _ = (*strings.Reader)(nil) - _ = net.IPv4len - _ = time.Duration(0) - _ = (*url.URL)(nil) - _ = (*mail.Address)(nil) - _ = anypb.Any{} - _ = sort.Sort -) - -// Validate checks the field values on GetMetricsRequest 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 *GetMetricsRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on GetMetricsRequest 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 -// GetMetricsRequestMultiError, or nil if none found. -func (m *GetMetricsRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *GetMetricsRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if all { - switch v := interface{}(m.GetPeriodStartFrom()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GetMetricsRequestValidationError{ - field: "PeriodStartFrom", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GetMetricsRequestValidationError{ - field: "PeriodStartFrom", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetPeriodStartFrom()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GetMetricsRequestValidationError{ - field: "PeriodStartFrom", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetPeriodStartTo()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GetMetricsRequestValidationError{ - field: "PeriodStartTo", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GetMetricsRequestValidationError{ - field: "PeriodStartTo", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetPeriodStartTo()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GetMetricsRequestValidationError{ - field: "PeriodStartTo", - reason: "embedded message failed validation", - cause: err, - } - } - } - - // no validation rules for FilterBy - - // no validation rules for GroupBy - - for idx, item := range m.GetLabels() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GetMetricsRequestValidationError{ - field: fmt.Sprintf("Labels[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GetMetricsRequestValidationError{ - field: fmt.Sprintf("Labels[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GetMetricsRequestValidationError{ - field: fmt.Sprintf("Labels[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - // no validation rules for Totals - - if len(errors) > 0 { - return GetMetricsRequestMultiError(errors) - } - - return nil -} - -// GetMetricsRequestMultiError is an error wrapping multiple validation errors -// returned by GetMetricsRequest.ValidateAll() if the designated constraints -// aren't met. -type GetMetricsRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m GetMetricsRequestMultiError) 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 GetMetricsRequestMultiError) AllErrors() []error { return m } - -// GetMetricsRequestValidationError is the validation error returned by -// GetMetricsRequest.Validate if the designated constraints aren't met. -type GetMetricsRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e GetMetricsRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e GetMetricsRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e GetMetricsRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e GetMetricsRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e GetMetricsRequestValidationError) ErrorName() string { - return "GetMetricsRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e GetMetricsRequestValidationError) 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 %sGetMetricsRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = GetMetricsRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = GetMetricsRequestValidationError{} - -// Validate checks the field values on GetMetricsResponse 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 *GetMetricsResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on GetMetricsResponse 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 -// GetMetricsResponseMultiError, or nil if none found. -func (m *GetMetricsResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *GetMetricsResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - { - sorted_keys := make([]string, len(m.GetMetrics())) - i := 0 - for key := range m.GetMetrics() { - sorted_keys[i] = key - i++ - } - sort.Slice(sorted_keys, func(i, j int) bool { return sorted_keys[i] < sorted_keys[j] }) - for _, key := range sorted_keys { - val := m.GetMetrics()[key] - _ = val - - // no validation rules for Metrics[key] - - if all { - switch v := interface{}(val).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GetMetricsResponseValidationError{ - field: fmt.Sprintf("Metrics[%v]", key), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GetMetricsResponseValidationError{ - field: fmt.Sprintf("Metrics[%v]", key), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(val).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GetMetricsResponseValidationError{ - field: fmt.Sprintf("Metrics[%v]", key), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - } - - // no validation rules for TextMetrics - - for idx, item := range m.GetSparkline() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GetMetricsResponseValidationError{ - field: fmt.Sprintf("Sparkline[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GetMetricsResponseValidationError{ - field: fmt.Sprintf("Sparkline[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GetMetricsResponseValidationError{ - field: fmt.Sprintf("Sparkline[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - { - sorted_keys := make([]string, len(m.GetTotals())) - i := 0 - for key := range m.GetTotals() { - sorted_keys[i] = key - i++ - } - sort.Slice(sorted_keys, func(i, j int) bool { return sorted_keys[i] < sorted_keys[j] }) - for _, key := range sorted_keys { - val := m.GetTotals()[key] - _ = val - - // no validation rules for Totals[key] - - if all { - switch v := interface{}(val).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GetMetricsResponseValidationError{ - field: fmt.Sprintf("Totals[%v]", key), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GetMetricsResponseValidationError{ - field: fmt.Sprintf("Totals[%v]", key), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(val).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GetMetricsResponseValidationError{ - field: fmt.Sprintf("Totals[%v]", key), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - } - - // no validation rules for Fingerprint - - if all { - switch v := interface{}(m.GetMetadata()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GetMetricsResponseValidationError{ - field: "Metadata", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GetMetricsResponseValidationError{ - field: "Metadata", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GetMetricsResponseValidationError{ - field: "Metadata", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if len(errors) > 0 { - return GetMetricsResponseMultiError(errors) - } - - return nil -} - -// GetMetricsResponseMultiError is an error wrapping multiple validation errors -// returned by GetMetricsResponse.ValidateAll() if the designated constraints -// aren't met. -type GetMetricsResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m GetMetricsResponseMultiError) 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 GetMetricsResponseMultiError) AllErrors() []error { return m } - -// GetMetricsResponseValidationError is the validation error returned by -// GetMetricsResponse.Validate if the designated constraints aren't met. -type GetMetricsResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e GetMetricsResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e GetMetricsResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e GetMetricsResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e GetMetricsResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e GetMetricsResponseValidationError) ErrorName() string { - return "GetMetricsResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e GetMetricsResponseValidationError) 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 %sGetMetricsResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = GetMetricsResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = GetMetricsResponseValidationError{} - -// Validate checks the field values on MetricValues 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 *MetricValues) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on MetricValues 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 MetricValuesMultiError, or -// nil if none found. -func (m *MetricValues) ValidateAll() error { - return m.validate(true) -} - -func (m *MetricValues) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Rate - - // no validation rules for Cnt - - // no validation rules for Sum - - // no validation rules for Min - - // no validation rules for Max - - // no validation rules for Avg - - // no validation rules for P99 - - // no validation rules for PercentOfTotal - - if len(errors) > 0 { - return MetricValuesMultiError(errors) - } - - return nil -} - -// MetricValuesMultiError is an error wrapping multiple validation errors -// returned by MetricValues.ValidateAll() if the designated constraints aren't met. -type MetricValuesMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m MetricValuesMultiError) 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 MetricValuesMultiError) AllErrors() []error { return m } - -// MetricValuesValidationError is the validation error returned by -// MetricValues.Validate if the designated constraints aren't met. -type MetricValuesValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e MetricValuesValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e MetricValuesValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e MetricValuesValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e MetricValuesValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e MetricValuesValidationError) ErrorName() string { return "MetricValuesValidationError" } - -// Error satisfies the builtin error interface -func (e MetricValuesValidationError) 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 %sMetricValues.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = MetricValuesValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = MetricValuesValidationError{} - -// Validate checks the field values on Labels 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 *Labels) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on Labels 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 LabelsMultiError, or nil if none found. -func (m *Labels) ValidateAll() error { - return m.validate(true) -} - -func (m *Labels) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return LabelsMultiError(errors) - } - - return nil -} - -// LabelsMultiError is an error wrapping multiple validation errors returned by -// Labels.ValidateAll() if the designated constraints aren't met. -type LabelsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m LabelsMultiError) 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 LabelsMultiError) AllErrors() []error { return m } - -// LabelsValidationError is the validation error returned by Labels.Validate if -// the designated constraints aren't met. -type LabelsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e LabelsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e LabelsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e LabelsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e LabelsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e LabelsValidationError) ErrorName() string { return "LabelsValidationError" } - -// Error satisfies the builtin error interface -func (e LabelsValidationError) 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 %sLabels.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = LabelsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = LabelsValidationError{} - -// Validate checks the field values on GetQueryExampleRequest 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 *GetQueryExampleRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on GetQueryExampleRequest 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 -// GetQueryExampleRequestMultiError, or nil if none found. -func (m *GetQueryExampleRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *GetQueryExampleRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if all { - switch v := interface{}(m.GetPeriodStartFrom()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GetQueryExampleRequestValidationError{ - field: "PeriodStartFrom", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GetQueryExampleRequestValidationError{ - field: "PeriodStartFrom", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetPeriodStartFrom()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GetQueryExampleRequestValidationError{ - field: "PeriodStartFrom", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetPeriodStartTo()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GetQueryExampleRequestValidationError{ - field: "PeriodStartTo", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GetQueryExampleRequestValidationError{ - field: "PeriodStartTo", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetPeriodStartTo()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GetQueryExampleRequestValidationError{ - field: "PeriodStartTo", - reason: "embedded message failed validation", - cause: err, - } - } - } - - // no validation rules for FilterBy - - // no validation rules for GroupBy - - for idx, item := range m.GetLabels() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GetQueryExampleRequestValidationError{ - field: fmt.Sprintf("Labels[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GetQueryExampleRequestValidationError{ - field: fmt.Sprintf("Labels[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GetQueryExampleRequestValidationError{ - field: fmt.Sprintf("Labels[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - // no validation rules for Limit - - if len(errors) > 0 { - return GetQueryExampleRequestMultiError(errors) - } - - return nil -} - -// GetQueryExampleRequestMultiError is an error wrapping multiple validation -// errors returned by GetQueryExampleRequest.ValidateAll() if the designated -// constraints aren't met. -type GetQueryExampleRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m GetQueryExampleRequestMultiError) 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 GetQueryExampleRequestMultiError) AllErrors() []error { return m } - -// GetQueryExampleRequestValidationError is the validation error returned by -// GetQueryExampleRequest.Validate if the designated constraints aren't met. -type GetQueryExampleRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e GetQueryExampleRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e GetQueryExampleRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e GetQueryExampleRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e GetQueryExampleRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e GetQueryExampleRequestValidationError) ErrorName() string { - return "GetQueryExampleRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e GetQueryExampleRequestValidationError) 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 %sGetQueryExampleRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = GetQueryExampleRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = GetQueryExampleRequestValidationError{} - -// Validate checks the field values on GetQueryExampleResponse 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 *GetQueryExampleResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on GetQueryExampleResponse 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 -// GetQueryExampleResponseMultiError, or nil if none found. -func (m *GetQueryExampleResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *GetQueryExampleResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - for idx, item := range m.GetQueryExamples() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GetQueryExampleResponseValidationError{ - field: fmt.Sprintf("QueryExamples[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GetQueryExampleResponseValidationError{ - field: fmt.Sprintf("QueryExamples[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GetQueryExampleResponseValidationError{ - field: fmt.Sprintf("QueryExamples[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - if len(errors) > 0 { - return GetQueryExampleResponseMultiError(errors) - } - - return nil -} - -// GetQueryExampleResponseMultiError is an error wrapping multiple validation -// errors returned by GetQueryExampleResponse.ValidateAll() if the designated -// constraints aren't met. -type GetQueryExampleResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m GetQueryExampleResponseMultiError) 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 GetQueryExampleResponseMultiError) AllErrors() []error { return m } - -// GetQueryExampleResponseValidationError is the validation error returned by -// GetQueryExampleResponse.Validate if the designated constraints aren't met. -type GetQueryExampleResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e GetQueryExampleResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e GetQueryExampleResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e GetQueryExampleResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e GetQueryExampleResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e GetQueryExampleResponseValidationError) ErrorName() string { - return "GetQueryExampleResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e GetQueryExampleResponseValidationError) 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 %sGetQueryExampleResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = GetQueryExampleResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = GetQueryExampleResponseValidationError{} - -// Validate checks the field values on QueryExample 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 *QueryExample) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on QueryExample 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 QueryExampleMultiError, or -// nil if none found. -func (m *QueryExample) ValidateAll() error { - return m.validate(true) -} - -func (m *QueryExample) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Example - - // no validation rules for ExampleType - - // no validation rules for IsTruncated - - // no validation rules for PlaceholdersCount - - // no validation rules for ExplainFingerprint - - // no validation rules for QueryId - - // no validation rules for ExampleMetrics - - // no validation rules for ServiceId - - // no validation rules for ServiceType - - // no validation rules for Schema - - if len(errors) > 0 { - return QueryExampleMultiError(errors) - } - - return nil -} - -// QueryExampleMultiError is an error wrapping multiple validation errors -// returned by QueryExample.ValidateAll() if the designated constraints aren't met. -type QueryExampleMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m QueryExampleMultiError) 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 QueryExampleMultiError) AllErrors() []error { return m } - -// QueryExampleValidationError is the validation error returned by -// QueryExample.Validate if the designated constraints aren't met. -type QueryExampleValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e QueryExampleValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e QueryExampleValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e QueryExampleValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e QueryExampleValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e QueryExampleValidationError) ErrorName() string { return "QueryExampleValidationError" } - -// Error satisfies the builtin error interface -func (e QueryExampleValidationError) 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 %sQueryExample.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = QueryExampleValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = QueryExampleValidationError{} - -// Validate checks the field values on GetLabelsRequest 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 *GetLabelsRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on GetLabelsRequest 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 -// GetLabelsRequestMultiError, or nil if none found. -func (m *GetLabelsRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *GetLabelsRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if all { - switch v := interface{}(m.GetPeriodStartFrom()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GetLabelsRequestValidationError{ - field: "PeriodStartFrom", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GetLabelsRequestValidationError{ - field: "PeriodStartFrom", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetPeriodStartFrom()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GetLabelsRequestValidationError{ - field: "PeriodStartFrom", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetPeriodStartTo()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GetLabelsRequestValidationError{ - field: "PeriodStartTo", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GetLabelsRequestValidationError{ - field: "PeriodStartTo", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetPeriodStartTo()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GetLabelsRequestValidationError{ - field: "PeriodStartTo", - reason: "embedded message failed validation", - cause: err, - } - } - } - - // no validation rules for FilterBy - - // no validation rules for GroupBy - - if len(errors) > 0 { - return GetLabelsRequestMultiError(errors) - } - - return nil -} - -// GetLabelsRequestMultiError is an error wrapping multiple validation errors -// returned by GetLabelsRequest.ValidateAll() if the designated constraints -// aren't met. -type GetLabelsRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m GetLabelsRequestMultiError) 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 GetLabelsRequestMultiError) AllErrors() []error { return m } - -// GetLabelsRequestValidationError is the validation error returned by -// GetLabelsRequest.Validate if the designated constraints aren't met. -type GetLabelsRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e GetLabelsRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e GetLabelsRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e GetLabelsRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e GetLabelsRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e GetLabelsRequestValidationError) ErrorName() string { return "GetLabelsRequestValidationError" } - -// Error satisfies the builtin error interface -func (e GetLabelsRequestValidationError) 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 %sGetLabelsRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = GetLabelsRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = GetLabelsRequestValidationError{} - -// Validate checks the field values on GetLabelsResponse 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 *GetLabelsResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on GetLabelsResponse 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 -// GetLabelsResponseMultiError, or nil if none found. -func (m *GetLabelsResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *GetLabelsResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - { - sorted_keys := make([]string, len(m.GetLabels())) - i := 0 - for key := range m.GetLabels() { - sorted_keys[i] = key - i++ - } - sort.Slice(sorted_keys, func(i, j int) bool { return sorted_keys[i] < sorted_keys[j] }) - for _, key := range sorted_keys { - val := m.GetLabels()[key] - _ = val - - // no validation rules for Labels[key] - - if all { - switch v := interface{}(val).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GetLabelsResponseValidationError{ - field: fmt.Sprintf("Labels[%v]", key), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GetLabelsResponseValidationError{ - field: fmt.Sprintf("Labels[%v]", key), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(val).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GetLabelsResponseValidationError{ - field: fmt.Sprintf("Labels[%v]", key), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - } - - if len(errors) > 0 { - return GetLabelsResponseMultiError(errors) - } - - return nil -} - -// GetLabelsResponseMultiError is an error wrapping multiple validation errors -// returned by GetLabelsResponse.ValidateAll() if the designated constraints -// aren't met. -type GetLabelsResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m GetLabelsResponseMultiError) 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 GetLabelsResponseMultiError) AllErrors() []error { return m } - -// GetLabelsResponseValidationError is the validation error returned by -// GetLabelsResponse.Validate if the designated constraints aren't met. -type GetLabelsResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e GetLabelsResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e GetLabelsResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e GetLabelsResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e GetLabelsResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e GetLabelsResponseValidationError) ErrorName() string { - return "GetLabelsResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e GetLabelsResponseValidationError) 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 %sGetLabelsResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = GetLabelsResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = GetLabelsResponseValidationError{} - -// Validate checks the field values on ListLabelValues 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 *ListLabelValues) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ListLabelValues 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 -// ListLabelValuesMultiError, or nil if none found. -func (m *ListLabelValues) ValidateAll() error { - return m.validate(true) -} - -func (m *ListLabelValues) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return ListLabelValuesMultiError(errors) - } - - return nil -} - -// ListLabelValuesMultiError is an error wrapping multiple validation errors -// returned by ListLabelValues.ValidateAll() if the designated constraints -// aren't met. -type ListLabelValuesMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ListLabelValuesMultiError) 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 ListLabelValuesMultiError) AllErrors() []error { return m } - -// ListLabelValuesValidationError is the validation error returned by -// ListLabelValues.Validate if the designated constraints aren't met. -type ListLabelValuesValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ListLabelValuesValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ListLabelValuesValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ListLabelValuesValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ListLabelValuesValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ListLabelValuesValidationError) ErrorName() string { return "ListLabelValuesValidationError" } - -// Error satisfies the builtin error interface -func (e ListLabelValuesValidationError) 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 %sListLabelValues.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ListLabelValuesValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ListLabelValuesValidationError{} - -// Validate checks the field values on GetQueryPlanRequest 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 *GetQueryPlanRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on GetQueryPlanRequest 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 -// GetQueryPlanRequestMultiError, or nil if none found. -func (m *GetQueryPlanRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *GetQueryPlanRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Queryid - - if len(errors) > 0 { - return GetQueryPlanRequestMultiError(errors) - } - - return nil -} - -// GetQueryPlanRequestMultiError is an error wrapping multiple validation -// errors returned by GetQueryPlanRequest.ValidateAll() if the designated -// constraints aren't met. -type GetQueryPlanRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m GetQueryPlanRequestMultiError) 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 GetQueryPlanRequestMultiError) AllErrors() []error { return m } - -// GetQueryPlanRequestValidationError is the validation error returned by -// GetQueryPlanRequest.Validate if the designated constraints aren't met. -type GetQueryPlanRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e GetQueryPlanRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e GetQueryPlanRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e GetQueryPlanRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e GetQueryPlanRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e GetQueryPlanRequestValidationError) ErrorName() string { - return "GetQueryPlanRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e GetQueryPlanRequestValidationError) 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 %sGetQueryPlanRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = GetQueryPlanRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = GetQueryPlanRequestValidationError{} - -// Validate checks the field values on GetQueryPlanResponse 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 *GetQueryPlanResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on GetQueryPlanResponse 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 -// GetQueryPlanResponseMultiError, or nil if none found. -func (m *GetQueryPlanResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *GetQueryPlanResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Planid - - // no validation rules for QueryPlan - - if len(errors) > 0 { - return GetQueryPlanResponseMultiError(errors) - } - - return nil -} - -// GetQueryPlanResponseMultiError is an error wrapping multiple validation -// errors returned by GetQueryPlanResponse.ValidateAll() if the designated -// constraints aren't met. -type GetQueryPlanResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m GetQueryPlanResponseMultiError) 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 GetQueryPlanResponseMultiError) AllErrors() []error { return m } - -// GetQueryPlanResponseValidationError is the validation error returned by -// GetQueryPlanResponse.Validate if the designated constraints aren't met. -type GetQueryPlanResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e GetQueryPlanResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e GetQueryPlanResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e GetQueryPlanResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e GetQueryPlanResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e GetQueryPlanResponseValidationError) ErrorName() string { - return "GetQueryPlanResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e GetQueryPlanResponseValidationError) 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 %sGetQueryPlanResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = GetQueryPlanResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = GetQueryPlanResponseValidationError{} - -// Validate checks the field values on GetHistogramRequest 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 *GetHistogramRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on GetHistogramRequest 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 -// GetHistogramRequestMultiError, or nil if none found. -func (m *GetHistogramRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *GetHistogramRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if all { - switch v := interface{}(m.GetPeriodStartFrom()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GetHistogramRequestValidationError{ - field: "PeriodStartFrom", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GetHistogramRequestValidationError{ - field: "PeriodStartFrom", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetPeriodStartFrom()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GetHistogramRequestValidationError{ - field: "PeriodStartFrom", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetPeriodStartTo()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GetHistogramRequestValidationError{ - field: "PeriodStartTo", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GetHistogramRequestValidationError{ - field: "PeriodStartTo", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetPeriodStartTo()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GetHistogramRequestValidationError{ - field: "PeriodStartTo", - reason: "embedded message failed validation", - cause: err, - } - } - } - - for idx, item := range m.GetLabels() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GetHistogramRequestValidationError{ - field: fmt.Sprintf("Labels[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GetHistogramRequestValidationError{ - field: fmt.Sprintf("Labels[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GetHistogramRequestValidationError{ - field: fmt.Sprintf("Labels[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - // no validation rules for Queryid - - if len(errors) > 0 { - return GetHistogramRequestMultiError(errors) - } - - return nil -} - -// GetHistogramRequestMultiError is an error wrapping multiple validation -// errors returned by GetHistogramRequest.ValidateAll() if the designated -// constraints aren't met. -type GetHistogramRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m GetHistogramRequestMultiError) 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 GetHistogramRequestMultiError) AllErrors() []error { return m } - -// GetHistogramRequestValidationError is the validation error returned by -// GetHistogramRequest.Validate if the designated constraints aren't met. -type GetHistogramRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e GetHistogramRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e GetHistogramRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e GetHistogramRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e GetHistogramRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e GetHistogramRequestValidationError) ErrorName() string { - return "GetHistogramRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e GetHistogramRequestValidationError) 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 %sGetHistogramRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = GetHistogramRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = GetHistogramRequestValidationError{} - -// Validate checks the field values on GetHistogramResponse 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 *GetHistogramResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on GetHistogramResponse 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 -// GetHistogramResponseMultiError, or nil if none found. -func (m *GetHistogramResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *GetHistogramResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - for idx, item := range m.GetHistogramItems() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GetHistogramResponseValidationError{ - field: fmt.Sprintf("HistogramItems[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GetHistogramResponseValidationError{ - field: fmt.Sprintf("HistogramItems[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GetHistogramResponseValidationError{ - field: fmt.Sprintf("HistogramItems[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - if len(errors) > 0 { - return GetHistogramResponseMultiError(errors) - } - - return nil -} - -// GetHistogramResponseMultiError is an error wrapping multiple validation -// errors returned by GetHistogramResponse.ValidateAll() if the designated -// constraints aren't met. -type GetHistogramResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m GetHistogramResponseMultiError) 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 GetHistogramResponseMultiError) AllErrors() []error { return m } - -// GetHistogramResponseValidationError is the validation error returned by -// GetHistogramResponse.Validate if the designated constraints aren't met. -type GetHistogramResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e GetHistogramResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e GetHistogramResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e GetHistogramResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e GetHistogramResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e GetHistogramResponseValidationError) ErrorName() string { - return "GetHistogramResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e GetHistogramResponseValidationError) 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 %sGetHistogramResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = GetHistogramResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = GetHistogramResponseValidationError{} - -// Validate checks the field values on HistogramItem 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 *HistogramItem) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on HistogramItem 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 HistogramItemMultiError, or -// nil if none found. -func (m *HistogramItem) ValidateAll() error { - return m.validate(true) -} - -func (m *HistogramItem) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Range - - // no validation rules for Frequency - - if len(errors) > 0 { - return HistogramItemMultiError(errors) - } - - return nil -} - -// HistogramItemMultiError is an error wrapping multiple validation errors -// returned by HistogramItem.ValidateAll() if the designated constraints -// aren't met. -type HistogramItemMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m HistogramItemMultiError) 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 HistogramItemMultiError) AllErrors() []error { return m } - -// HistogramItemValidationError is the validation error returned by -// HistogramItem.Validate if the designated constraints aren't met. -type HistogramItemValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e HistogramItemValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e HistogramItemValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e HistogramItemValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e HistogramItemValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e HistogramItemValidationError) ErrorName() string { return "HistogramItemValidationError" } - -// Error satisfies the builtin error interface -func (e HistogramItemValidationError) 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 %sHistogramItem.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = HistogramItemValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = HistogramItemValidationError{} - -// Validate checks the field values on QueryExistsRequest 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 *QueryExistsRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on QueryExistsRequest 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 -// QueryExistsRequestMultiError, or nil if none found. -func (m *QueryExistsRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *QueryExistsRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Serviceid - - // no validation rules for Query - - if len(errors) > 0 { - return QueryExistsRequestMultiError(errors) - } - - return nil -} - -// QueryExistsRequestMultiError is an error wrapping multiple validation errors -// returned by QueryExistsRequest.ValidateAll() if the designated constraints -// aren't met. -type QueryExistsRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m QueryExistsRequestMultiError) 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 QueryExistsRequestMultiError) AllErrors() []error { return m } - -// QueryExistsRequestValidationError is the validation error returned by -// QueryExistsRequest.Validate if the designated constraints aren't met. -type QueryExistsRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e QueryExistsRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e QueryExistsRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e QueryExistsRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e QueryExistsRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e QueryExistsRequestValidationError) ErrorName() string { - return "QueryExistsRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e QueryExistsRequestValidationError) 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 %sQueryExistsRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = QueryExistsRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = QueryExistsRequestValidationError{} - -// Validate checks the field values on QueryExistsResponse 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 *QueryExistsResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on QueryExistsResponse 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 -// QueryExistsResponseMultiError, or nil if none found. -func (m *QueryExistsResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *QueryExistsResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Exists - - if len(errors) > 0 { - return QueryExistsResponseMultiError(errors) - } - - return nil -} - -// QueryExistsResponseMultiError is an error wrapping multiple validation -// errors returned by QueryExistsResponse.ValidateAll() if the designated -// constraints aren't met. -type QueryExistsResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m QueryExistsResponseMultiError) 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 QueryExistsResponseMultiError) AllErrors() []error { return m } - -// QueryExistsResponseValidationError is the validation error returned by -// QueryExistsResponse.Validate if the designated constraints aren't met. -type QueryExistsResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e QueryExistsResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e QueryExistsResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e QueryExistsResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e QueryExistsResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e QueryExistsResponseValidationError) ErrorName() string { - return "QueryExistsResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e QueryExistsResponseValidationError) 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 %sQueryExistsResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = QueryExistsResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = QueryExistsResponseValidationError{} - -// Validate checks the field values on SchemaByQueryIDRequest with the rules -// defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *SchemaByQueryIDRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on SchemaByQueryIDRequest with the rules -// defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// SchemaByQueryIDRequestMultiError, or nil if none found. -func (m *SchemaByQueryIDRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *SchemaByQueryIDRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for ServiceId - - // no validation rules for QueryId - - if len(errors) > 0 { - return SchemaByQueryIDRequestMultiError(errors) - } - - return nil -} - -// SchemaByQueryIDRequestMultiError is an error wrapping multiple validation -// errors returned by SchemaByQueryIDRequest.ValidateAll() if the designated -// constraints aren't met. -type SchemaByQueryIDRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m SchemaByQueryIDRequestMultiError) Error() string { - 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 SchemaByQueryIDRequestMultiError) AllErrors() []error { return m } - -// SchemaByQueryIDRequestValidationError is the validation error returned by -// SchemaByQueryIDRequest.Validate if the designated constraints aren't met. -type SchemaByQueryIDRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e SchemaByQueryIDRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e SchemaByQueryIDRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e SchemaByQueryIDRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e SchemaByQueryIDRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e SchemaByQueryIDRequestValidationError) ErrorName() string { - return "SchemaByQueryIDRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e SchemaByQueryIDRequestValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sSchemaByQueryIDRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = SchemaByQueryIDRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = SchemaByQueryIDRequestValidationError{} - -// Validate checks the field values on SchemaByQueryIDResponse 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 *SchemaByQueryIDResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on SchemaByQueryIDResponse 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 -// SchemaByQueryIDResponseMultiError, or nil if none found. -func (m *SchemaByQueryIDResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *SchemaByQueryIDResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Schema - - if len(errors) > 0 { - return SchemaByQueryIDResponseMultiError(errors) - } - - return nil -} - -// SchemaByQueryIDResponseMultiError is an error wrapping multiple validation -// errors returned by SchemaByQueryIDResponse.ValidateAll() if the designated -// constraints aren't met. -type SchemaByQueryIDResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m SchemaByQueryIDResponseMultiError) 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 SchemaByQueryIDResponseMultiError) AllErrors() []error { return m } - -// SchemaByQueryIDResponseValidationError is the validation error returned by -// SchemaByQueryIDResponse.Validate if the designated constraints aren't met. -type SchemaByQueryIDResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e SchemaByQueryIDResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e SchemaByQueryIDResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e SchemaByQueryIDResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e SchemaByQueryIDResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e SchemaByQueryIDResponseValidationError) ErrorName() string { - return "SchemaByQueryIDResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e SchemaByQueryIDResponseValidationError) 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 %sSchemaByQueryIDResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = SchemaByQueryIDResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = SchemaByQueryIDResponseValidationError{} - -// Validate checks the field values on ExplainFingerprintByQueryIDRequest with -// the rules defined in the proto definition for this message. If any rules -// are violated, the first error encountered is returned, or nil if there are -// no violations. -func (m *ExplainFingerprintByQueryIDRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ExplainFingerprintByQueryIDRequest -// 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 -// ExplainFingerprintByQueryIDRequestMultiError, or nil if none found. -func (m *ExplainFingerprintByQueryIDRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *ExplainFingerprintByQueryIDRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Serviceid - - // no validation rules for QueryId - - if len(errors) > 0 { - return ExplainFingerprintByQueryIDRequestMultiError(errors) - } - - return nil -} - -// ExplainFingerprintByQueryIDRequestMultiError is an error wrapping multiple -// validation errors returned by -// ExplainFingerprintByQueryIDRequest.ValidateAll() if the designated -// constraints aren't met. -type ExplainFingerprintByQueryIDRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ExplainFingerprintByQueryIDRequestMultiError) 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 ExplainFingerprintByQueryIDRequestMultiError) AllErrors() []error { return m } - -// ExplainFingerprintByQueryIDRequestValidationError is the validation error -// returned by ExplainFingerprintByQueryIDRequest.Validate if the designated -// constraints aren't met. -type ExplainFingerprintByQueryIDRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ExplainFingerprintByQueryIDRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ExplainFingerprintByQueryIDRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ExplainFingerprintByQueryIDRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ExplainFingerprintByQueryIDRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ExplainFingerprintByQueryIDRequestValidationError) ErrorName() string { - return "ExplainFingerprintByQueryIDRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e ExplainFingerprintByQueryIDRequestValidationError) 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 %sExplainFingerprintByQueryIDRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ExplainFingerprintByQueryIDRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ExplainFingerprintByQueryIDRequestValidationError{} - -// Validate checks the field values on ExplainFingerprintByQueryIDResponse 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 *ExplainFingerprintByQueryIDResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ExplainFingerprintByQueryIDResponse -// 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 -// ExplainFingerprintByQueryIDResponseMultiError, or nil if none found. -func (m *ExplainFingerprintByQueryIDResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *ExplainFingerprintByQueryIDResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for ExplainFingerprint - - // no validation rules for PlaceholdersCount - - if len(errors) > 0 { - return ExplainFingerprintByQueryIDResponseMultiError(errors) - } - - return nil -} - -// ExplainFingerprintByQueryIDResponseMultiError is an error wrapping multiple -// validation errors returned by -// ExplainFingerprintByQueryIDResponse.ValidateAll() if the designated -// constraints aren't met. -type ExplainFingerprintByQueryIDResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ExplainFingerprintByQueryIDResponseMultiError) 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 ExplainFingerprintByQueryIDResponseMultiError) AllErrors() []error { return m } - -// ExplainFingerprintByQueryIDResponseValidationError is the validation error -// returned by ExplainFingerprintByQueryIDResponse.Validate if the designated -// constraints aren't met. -type ExplainFingerprintByQueryIDResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ExplainFingerprintByQueryIDResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ExplainFingerprintByQueryIDResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ExplainFingerprintByQueryIDResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ExplainFingerprintByQueryIDResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ExplainFingerprintByQueryIDResponseValidationError) ErrorName() string { - return "ExplainFingerprintByQueryIDResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e ExplainFingerprintByQueryIDResponseValidationError) 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 %sExplainFingerprintByQueryIDResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ExplainFingerprintByQueryIDResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ExplainFingerprintByQueryIDResponseValidationError{} - -// Validate checks the field values on GetSelectedQueryMetadataResponse 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 *GetSelectedQueryMetadataResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on GetSelectedQueryMetadataResponse 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 -// GetSelectedQueryMetadataResponseMultiError, or nil if none found. -func (m *GetSelectedQueryMetadataResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *GetSelectedQueryMetadataResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for ServiceName - - // no validation rules for Database - - // no validation rules for Schema - - // no validation rules for Username - - // no validation rules for ReplicationSet - - // no validation rules for Cluster - - // no validation rules for ServiceType - - // no validation rules for ServiceId - - // no validation rules for Environment - - // no validation rules for NodeId - - // no validation rules for NodeName - - // no validation rules for NodeType - - if len(errors) > 0 { - return GetSelectedQueryMetadataResponseMultiError(errors) - } - - return nil -} - -// GetSelectedQueryMetadataResponseMultiError is an error wrapping multiple -// validation errors returned by -// GetSelectedQueryMetadataResponse.ValidateAll() if the designated -// constraints aren't met. -type GetSelectedQueryMetadataResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m GetSelectedQueryMetadataResponseMultiError) 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 GetSelectedQueryMetadataResponseMultiError) AllErrors() []error { return m } - -// GetSelectedQueryMetadataResponseValidationError is the validation error -// returned by GetSelectedQueryMetadataResponse.Validate if the designated -// constraints aren't met. -type GetSelectedQueryMetadataResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e GetSelectedQueryMetadataResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e GetSelectedQueryMetadataResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e GetSelectedQueryMetadataResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e GetSelectedQueryMetadataResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e GetSelectedQueryMetadataResponseValidationError) ErrorName() string { - return "GetSelectedQueryMetadataResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e GetSelectedQueryMetadataResponseValidationError) 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 %sGetSelectedQueryMetadataResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = GetSelectedQueryMetadataResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = GetSelectedQueryMetadataResponseValidationError{} diff --git a/api/qan/v1/profile.pb.go b/api/qan/v1/profile.pb.go deleted file mode 100644 index ff406029789..00000000000 --- a/api/qan/v1/profile.pb.go +++ /dev/null @@ -1,641 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.10 -// protoc (unknown) -// source: qan/v1/profile.proto - -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" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// ReportRequest defines filtering of metrics report for db server or other dimentions. -type GetReportRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - PeriodStartFrom *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=period_start_from,json=periodStartFrom,proto3" json:"period_start_from,omitempty"` - PeriodStartTo *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=period_start_to,json=periodStartTo,proto3" json:"period_start_to,omitempty"` - GroupBy string `protobuf:"bytes,3,opt,name=group_by,json=groupBy,proto3" json:"group_by,omitempty"` - Labels []*ReportMapFieldEntry `protobuf:"bytes,4,rep,name=labels,proto3" json:"labels,omitempty"` - Columns []string `protobuf:"bytes,5,rep,name=columns,proto3" json:"columns,omitempty"` - OrderBy string `protobuf:"bytes,6,opt,name=order_by,json=orderBy,proto3" json:"order_by,omitempty"` - Offset uint32 `protobuf:"varint,7,opt,name=offset,proto3" json:"offset,omitempty"` - Limit uint32 `protobuf:"varint,8,opt,name=limit,proto3" json:"limit,omitempty"` - MainMetric string `protobuf:"bytes,9,opt,name=main_metric,json=mainMetric,proto3" json:"main_metric,omitempty"` - Search string `protobuf:"bytes,10,opt,name=search,proto3" json:"search,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetReportRequest) Reset() { - *x = GetReportRequest{} - mi := &file_qan_v1_profile_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetReportRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetReportRequest) ProtoMessage() {} - -func (x *GetReportRequest) ProtoReflect() protoreflect.Message { - mi := &file_qan_v1_profile_proto_msgTypes[0] - 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 GetReportRequest.ProtoReflect.Descriptor instead. -func (*GetReportRequest) Descriptor() ([]byte, []int) { - return file_qan_v1_profile_proto_rawDescGZIP(), []int{0} -} - -func (x *GetReportRequest) GetPeriodStartFrom() *timestamppb.Timestamp { - if x != nil { - return x.PeriodStartFrom - } - return nil -} - -func (x *GetReportRequest) GetPeriodStartTo() *timestamppb.Timestamp { - if x != nil { - return x.PeriodStartTo - } - return nil -} - -func (x *GetReportRequest) GetGroupBy() string { - if x != nil { - return x.GroupBy - } - return "" -} - -func (x *GetReportRequest) GetLabels() []*ReportMapFieldEntry { - if x != nil { - return x.Labels - } - return nil -} - -func (x *GetReportRequest) GetColumns() []string { - if x != nil { - return x.Columns - } - return nil -} - -func (x *GetReportRequest) GetOrderBy() string { - if x != nil { - return x.OrderBy - } - return "" -} - -func (x *GetReportRequest) GetOffset() uint32 { - if x != nil { - return x.Offset - } - return 0 -} - -func (x *GetReportRequest) GetLimit() uint32 { - if x != nil { - return x.Limit - } - return 0 -} - -func (x *GetReportRequest) GetMainMetric() string { - if x != nil { - return x.MainMetric - } - return "" -} - -func (x *GetReportRequest) GetSearch() string { - if x != nil { - return x.Search - } - return "" -} - -// ReportMapFieldEntry allows to pass labels/dimentions in form like {"server": ["db1", "db2"...]}. -type ReportMapFieldEntry struct { - state protoimpl.MessageState `protogen:"open.v1"` - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - Value []string `protobuf:"bytes,2,rep,name=value,proto3" json:"value,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ReportMapFieldEntry) Reset() { - *x = ReportMapFieldEntry{} - mi := &file_qan_v1_profile_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ReportMapFieldEntry) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ReportMapFieldEntry) ProtoMessage() {} - -func (x *ReportMapFieldEntry) ProtoReflect() protoreflect.Message { - mi := &file_qan_v1_profile_proto_msgTypes[1] - 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 ReportMapFieldEntry.ProtoReflect.Descriptor instead. -func (*ReportMapFieldEntry) Descriptor() ([]byte, []int) { - return file_qan_v1_profile_proto_rawDescGZIP(), []int{1} -} - -func (x *ReportMapFieldEntry) GetKey() string { - if x != nil { - return x.Key - } - return "" -} - -func (x *ReportMapFieldEntry) GetValue() []string { - if x != nil { - return x.Value - } - return nil -} - -// ReportReply is list of reports per quieryids, hosts etc. -type GetReportResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - TotalRows uint32 `protobuf:"varint,1,opt,name=total_rows,json=totalRows,proto3" json:"total_rows,omitempty"` - Offset uint32 `protobuf:"varint,2,opt,name=offset,proto3" json:"offset,omitempty"` - Limit uint32 `protobuf:"varint,3,opt,name=limit,proto3" json:"limit,omitempty"` - Rows []*Row `protobuf:"bytes,4,rep,name=rows,proto3" json:"rows,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetReportResponse) Reset() { - *x = GetReportResponse{} - mi := &file_qan_v1_profile_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetReportResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetReportResponse) ProtoMessage() {} - -func (x *GetReportResponse) ProtoReflect() protoreflect.Message { - mi := &file_qan_v1_profile_proto_msgTypes[2] - 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 GetReportResponse.ProtoReflect.Descriptor instead. -func (*GetReportResponse) Descriptor() ([]byte, []int) { - return file_qan_v1_profile_proto_rawDescGZIP(), []int{2} -} - -func (x *GetReportResponse) GetTotalRows() uint32 { - if x != nil { - return x.TotalRows - } - return 0 -} - -func (x *GetReportResponse) GetOffset() uint32 { - if x != nil { - return x.Offset - } - return 0 -} - -func (x *GetReportResponse) GetLimit() uint32 { - if x != nil { - return x.Limit - } - return 0 -} - -func (x *GetReportResponse) GetRows() []*Row { - if x != nil { - return x.Rows - } - return nil -} - -// Row define metrics for selected dimention. -type Row struct { - state protoimpl.MessageState `protogen:"open.v1"` - Rank uint32 `protobuf:"varint,1,opt,name=rank,proto3" json:"rank,omitempty"` - Dimension string `protobuf:"bytes,2,opt,name=dimension,proto3" json:"dimension,omitempty"` - Database string `protobuf:"bytes,3,opt,name=database,proto3" json:"database,omitempty"` - Metrics map[string]*Metric `protobuf:"bytes,4,rep,name=metrics,proto3" json:"metrics,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - Sparkline []*Point `protobuf:"bytes,5,rep,name=sparkline,proto3" json:"sparkline,omitempty"` - Fingerprint string `protobuf:"bytes,6,opt,name=fingerprint,proto3" json:"fingerprint,omitempty"` - NumQueries uint32 `protobuf:"varint,7,opt,name=num_queries,json=numQueries,proto3" json:"num_queries,omitempty"` - Qps float32 `protobuf:"fixed32,8,opt,name=qps,proto3" json:"qps,omitempty"` - Load float32 `protobuf:"fixed32,9,opt,name=load,proto3" json:"load,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Row) Reset() { - *x = Row{} - mi := &file_qan_v1_profile_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Row) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Row) ProtoMessage() {} - -func (x *Row) ProtoReflect() protoreflect.Message { - mi := &file_qan_v1_profile_proto_msgTypes[3] - 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 Row.ProtoReflect.Descriptor instead. -func (*Row) Descriptor() ([]byte, []int) { - return file_qan_v1_profile_proto_rawDescGZIP(), []int{3} -} - -func (x *Row) GetRank() uint32 { - if x != nil { - return x.Rank - } - return 0 -} - -func (x *Row) GetDimension() string { - if x != nil { - return x.Dimension - } - return "" -} - -func (x *Row) GetDatabase() string { - if x != nil { - return x.Database - } - return "" -} - -func (x *Row) GetMetrics() map[string]*Metric { - if x != nil { - return x.Metrics - } - return nil -} - -func (x *Row) GetSparkline() []*Point { - if x != nil { - return x.Sparkline - } - return nil -} - -func (x *Row) GetFingerprint() string { - if x != nil { - return x.Fingerprint - } - return "" -} - -func (x *Row) GetNumQueries() uint32 { - if x != nil { - return x.NumQueries - } - return 0 -} - -func (x *Row) GetQps() float32 { - if x != nil { - return x.Qps - } - return 0 -} - -func (x *Row) GetLoad() float32 { - if x != nil { - return x.Load - } - return 0 -} - -// Metric cell. -type Metric struct { - state protoimpl.MessageState `protogen:"open.v1"` - Stats *Stat `protobuf:"bytes,1,opt,name=stats,proto3" json:"stats,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Metric) Reset() { - *x = Metric{} - mi := &file_qan_v1_profile_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Metric) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Metric) ProtoMessage() {} - -func (x *Metric) ProtoReflect() protoreflect.Message { - mi := &file_qan_v1_profile_proto_msgTypes[4] - 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 Metric.ProtoReflect.Descriptor instead. -func (*Metric) Descriptor() ([]byte, []int) { - return file_qan_v1_profile_proto_rawDescGZIP(), []int{4} -} - -func (x *Metric) GetStats() *Stat { - if x != nil { - return x.Stats - } - return nil -} - -// Stat is statistics of specific metric. -type Stat struct { - state protoimpl.MessageState `protogen:"open.v1"` - Rate float32 `protobuf:"fixed32,1,opt,name=rate,proto3" json:"rate,omitempty"` - Cnt float32 `protobuf:"fixed32,2,opt,name=cnt,proto3" json:"cnt,omitempty"` - Sum float32 `protobuf:"fixed32,3,opt,name=sum,proto3" json:"sum,omitempty"` - Min float32 `protobuf:"fixed32,4,opt,name=min,proto3" json:"min,omitempty"` - Max float32 `protobuf:"fixed32,5,opt,name=max,proto3" json:"max,omitempty"` - P99 float32 `protobuf:"fixed32,6,opt,name=p99,proto3" json:"p99,omitempty"` - Avg float32 `protobuf:"fixed32,7,opt,name=avg,proto3" json:"avg,omitempty"` - SumPerSec float32 `protobuf:"fixed32,8,opt,name=sum_per_sec,json=sumPerSec,proto3" json:"sum_per_sec,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Stat) Reset() { - *x = Stat{} - mi := &file_qan_v1_profile_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Stat) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Stat) ProtoMessage() {} - -func (x *Stat) ProtoReflect() protoreflect.Message { - mi := &file_qan_v1_profile_proto_msgTypes[5] - 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 Stat.ProtoReflect.Descriptor instead. -func (*Stat) Descriptor() ([]byte, []int) { - return file_qan_v1_profile_proto_rawDescGZIP(), []int{5} -} - -func (x *Stat) GetRate() float32 { - if x != nil { - return x.Rate - } - return 0 -} - -func (x *Stat) GetCnt() float32 { - if x != nil { - return x.Cnt - } - return 0 -} - -func (x *Stat) GetSum() float32 { - if x != nil { - return x.Sum - } - return 0 -} - -func (x *Stat) GetMin() float32 { - if x != nil { - return x.Min - } - return 0 -} - -func (x *Stat) GetMax() float32 { - if x != nil { - return x.Max - } - return 0 -} - -func (x *Stat) GetP99() float32 { - if x != nil { - return x.P99 - } - return 0 -} - -func (x *Stat) GetAvg() float32 { - if x != nil { - return x.Avg - } - return 0 -} - -func (x *Stat) GetSumPerSec() float32 { - if x != nil { - return x.SumPerSec - } - return 0 -} - -var File_qan_v1_profile_proto protoreflect.FileDescriptor - -const file_qan_v1_profile_proto_rawDesc = "" + - "\n" + - "\x14qan/v1/profile.proto\x12\x06qan.v1\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x10qan/v1/qan.proto\"\x8a\x03\n" + - "\x10GetReportRequest\x12F\n" + - "\x11period_start_from\x18\x01 \x01(\v2\x1a.google.protobuf.TimestampR\x0fperiodStartFrom\x12B\n" + - "\x0fperiod_start_to\x18\x02 \x01(\v2\x1a.google.protobuf.TimestampR\rperiodStartTo\x12\x19\n" + - "\bgroup_by\x18\x03 \x01(\tR\agroupBy\x123\n" + - "\x06labels\x18\x04 \x03(\v2\x1b.qan.v1.ReportMapFieldEntryR\x06labels\x12\x18\n" + - "\acolumns\x18\x05 \x03(\tR\acolumns\x12\x19\n" + - "\border_by\x18\x06 \x01(\tR\aorderBy\x12\x16\n" + - "\x06offset\x18\a \x01(\rR\x06offset\x12\x14\n" + - "\x05limit\x18\b \x01(\rR\x05limit\x12\x1f\n" + - "\vmain_metric\x18\t \x01(\tR\n" + - "mainMetric\x12\x16\n" + - "\x06search\x18\n" + - " \x01(\tR\x06search\"=\n" + - "\x13ReportMapFieldEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x03(\tR\x05value\"\x81\x01\n" + - "\x11GetReportResponse\x12\x1d\n" + - "\n" + - "total_rows\x18\x01 \x01(\rR\ttotalRows\x12\x16\n" + - "\x06offset\x18\x02 \x01(\rR\x06offset\x12\x14\n" + - "\x05limit\x18\x03 \x01(\rR\x05limit\x12\x1f\n" + - "\x04rows\x18\x04 \x03(\v2\v.qan.v1.RowR\x04rows\"\xe9\x02\n" + - "\x03Row\x12\x12\n" + - "\x04rank\x18\x01 \x01(\rR\x04rank\x12\x1c\n" + - "\tdimension\x18\x02 \x01(\tR\tdimension\x12\x1a\n" + - "\bdatabase\x18\x03 \x01(\tR\bdatabase\x122\n" + - "\ametrics\x18\x04 \x03(\v2\x18.qan.v1.Row.MetricsEntryR\ametrics\x12+\n" + - "\tsparkline\x18\x05 \x03(\v2\r.qan.v1.PointR\tsparkline\x12 \n" + - "\vfingerprint\x18\x06 \x01(\tR\vfingerprint\x12\x1f\n" + - "\vnum_queries\x18\a \x01(\rR\n" + - "numQueries\x12\x10\n" + - "\x03qps\x18\b \x01(\x02R\x03qps\x12\x12\n" + - "\x04load\x18\t \x01(\x02R\x04load\x1aJ\n" + - "\fMetricsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12$\n" + - "\x05value\x18\x02 \x01(\v2\x0e.qan.v1.MetricR\x05value:\x028\x01\",\n" + - "\x06Metric\x12\"\n" + - "\x05stats\x18\x01 \x01(\v2\f.qan.v1.StatR\x05stats\"\xa6\x01\n" + - "\x04Stat\x12\x12\n" + - "\x04rate\x18\x01 \x01(\x02R\x04rate\x12\x10\n" + - "\x03cnt\x18\x02 \x01(\x02R\x03cnt\x12\x10\n" + - "\x03sum\x18\x03 \x01(\x02R\x03sum\x12\x10\n" + - "\x03min\x18\x04 \x01(\x02R\x03min\x12\x10\n" + - "\x03max\x18\x05 \x01(\x02R\x03max\x12\x10\n" + - "\x03p99\x18\x06 \x01(\x02R\x03p99\x12\x10\n" + - "\x03avg\x18\a \x01(\x02R\x03avg\x12\x1e\n" + - "\vsum_per_sec\x18\b \x01(\x02R\tsumPerSecB|\n" + - "\n" + - "com.qan.v1B\fProfileProtoP\x01Z'github.com/percona/pmm/api/qan/v1;qanv1\xa2\x02\x03QXX\xaa\x02\x06Qan.V1\xca\x02\x06Qan\\V1\xe2\x02\x12Qan\\V1\\GPBMetadata\xea\x02\aQan::V1b\x06proto3" - -var ( - file_qan_v1_profile_proto_rawDescOnce sync.Once - file_qan_v1_profile_proto_rawDescData []byte -) - -func file_qan_v1_profile_proto_rawDescGZIP() []byte { - file_qan_v1_profile_proto_rawDescOnce.Do(func() { - file_qan_v1_profile_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_qan_v1_profile_proto_rawDesc), len(file_qan_v1_profile_proto_rawDesc))) - }) - 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_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 - 1, // 2: qan.v1.GetReportRequest.labels:type_name -> qan.v1.ReportMapFieldEntry - 3, // 3: qan.v1.GetReportResponse.rows:type_name -> qan.v1.Row - 6, // 4: qan.v1.Row.metrics:type_name -> qan.v1.Row.MetricsEntry - 8, // 5: qan.v1.Row.sparkline:type_name -> qan.v1.Point - 5, // 6: qan.v1.Metric.stats:type_name -> qan.v1.Stat - 4, // 7: qan.v1.Row.MetricsEntry.value:type_name -> qan.v1.Metric - 8, // [8:8] is the sub-list for method output_type - 8, // [8:8] is the sub-list for method input_type - 8, // [8:8] is the sub-list for extension type_name - 8, // [8:8] is the sub-list for extension extendee - 0, // [0:8] is the sub-list for field type_name -} - -func init() { file_qan_v1_profile_proto_init() } -func file_qan_v1_profile_proto_init() { - if File_qan_v1_profile_proto != nil { - return - } - file_qan_v1_qan_proto_init() - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_qan_v1_profile_proto_rawDesc), len(file_qan_v1_profile_proto_rawDesc)), - NumEnums: 0, - NumMessages: 7, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_qan_v1_profile_proto_goTypes, - DependencyIndexes: file_qan_v1_profile_proto_depIdxs, - MessageInfos: file_qan_v1_profile_proto_msgTypes, - }.Build() - File_qan_v1_profile_proto = out.File - file_qan_v1_profile_proto_goTypes = nil - file_qan_v1_profile_proto_depIdxs = nil -} diff --git a/api/qan/v1/profile.pb.validate.go b/api/qan/v1/profile.pb.validate.go deleted file mode 100644 index fe2eb0e7026..00000000000 --- a/api/qan/v1/profile.pb.validate.go +++ /dev/null @@ -1,919 +0,0 @@ -// Code generated by protoc-gen-validate. DO NOT EDIT. -// source: qan/v1/profile.proto - -package qanv1 - -import ( - "bytes" - "errors" - "fmt" - "net" - "net/mail" - "net/url" - "regexp" - "sort" - "strings" - "time" - "unicode/utf8" - - "google.golang.org/protobuf/types/known/anypb" -) - -// ensure the imports are used -var ( - _ = bytes.MinRead - _ = errors.New("") - _ = fmt.Print - _ = utf8.UTFMax - _ = (*regexp.Regexp)(nil) - _ = (*strings.Reader)(nil) - _ = net.IPv4len - _ = time.Duration(0) - _ = (*url.URL)(nil) - _ = (*mail.Address)(nil) - _ = anypb.Any{} - _ = sort.Sort -) - -// Validate checks the field values on GetReportRequest 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 *GetReportRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on GetReportRequest 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 -// GetReportRequestMultiError, or nil if none found. -func (m *GetReportRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *GetReportRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if all { - switch v := interface{}(m.GetPeriodStartFrom()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GetReportRequestValidationError{ - field: "PeriodStartFrom", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GetReportRequestValidationError{ - field: "PeriodStartFrom", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetPeriodStartFrom()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GetReportRequestValidationError{ - field: "PeriodStartFrom", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetPeriodStartTo()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GetReportRequestValidationError{ - field: "PeriodStartTo", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GetReportRequestValidationError{ - field: "PeriodStartTo", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetPeriodStartTo()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GetReportRequestValidationError{ - field: "PeriodStartTo", - reason: "embedded message failed validation", - cause: err, - } - } - } - - // no validation rules for GroupBy - - for idx, item := range m.GetLabels() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GetReportRequestValidationError{ - field: fmt.Sprintf("Labels[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GetReportRequestValidationError{ - field: fmt.Sprintf("Labels[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GetReportRequestValidationError{ - field: fmt.Sprintf("Labels[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - // no validation rules for OrderBy - - // no validation rules for Offset - - // no validation rules for Limit - - // no validation rules for MainMetric - - // no validation rules for Search - - if len(errors) > 0 { - return GetReportRequestMultiError(errors) - } - - return nil -} - -// GetReportRequestMultiError is an error wrapping multiple validation errors -// returned by GetReportRequest.ValidateAll() if the designated constraints -// aren't met. -type GetReportRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m GetReportRequestMultiError) 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 GetReportRequestMultiError) AllErrors() []error { return m } - -// GetReportRequestValidationError is the validation error returned by -// GetReportRequest.Validate if the designated constraints aren't met. -type GetReportRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e GetReportRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e GetReportRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e GetReportRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e GetReportRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e GetReportRequestValidationError) ErrorName() string { return "GetReportRequestValidationError" } - -// Error satisfies the builtin error interface -func (e GetReportRequestValidationError) 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 %sGetReportRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = GetReportRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = GetReportRequestValidationError{} - -// Validate checks the field values on ReportMapFieldEntry 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 *ReportMapFieldEntry) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ReportMapFieldEntry 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 -// ReportMapFieldEntryMultiError, or nil if none found. -func (m *ReportMapFieldEntry) ValidateAll() error { - return m.validate(true) -} - -func (m *ReportMapFieldEntry) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Key - - if len(errors) > 0 { - return ReportMapFieldEntryMultiError(errors) - } - - return nil -} - -// ReportMapFieldEntryMultiError is an error wrapping multiple validation -// errors returned by ReportMapFieldEntry.ValidateAll() if the designated -// constraints aren't met. -type ReportMapFieldEntryMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ReportMapFieldEntryMultiError) 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 ReportMapFieldEntryMultiError) AllErrors() []error { return m } - -// ReportMapFieldEntryValidationError is the validation error returned by -// ReportMapFieldEntry.Validate if the designated constraints aren't met. -type ReportMapFieldEntryValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ReportMapFieldEntryValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ReportMapFieldEntryValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ReportMapFieldEntryValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ReportMapFieldEntryValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ReportMapFieldEntryValidationError) ErrorName() string { - return "ReportMapFieldEntryValidationError" -} - -// Error satisfies the builtin error interface -func (e ReportMapFieldEntryValidationError) 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 %sReportMapFieldEntry.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ReportMapFieldEntryValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ReportMapFieldEntryValidationError{} - -// Validate checks the field values on GetReportResponse 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 *GetReportResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on GetReportResponse 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 -// GetReportResponseMultiError, or nil if none found. -func (m *GetReportResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *GetReportResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for TotalRows - - // no validation rules for Offset - - // no validation rules for Limit - - for idx, item := range m.GetRows() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GetReportResponseValidationError{ - field: fmt.Sprintf("Rows[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GetReportResponseValidationError{ - field: fmt.Sprintf("Rows[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GetReportResponseValidationError{ - field: fmt.Sprintf("Rows[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - if len(errors) > 0 { - return GetReportResponseMultiError(errors) - } - - return nil -} - -// GetReportResponseMultiError is an error wrapping multiple validation errors -// returned by GetReportResponse.ValidateAll() if the designated constraints -// aren't met. -type GetReportResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m GetReportResponseMultiError) 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 GetReportResponseMultiError) AllErrors() []error { return m } - -// GetReportResponseValidationError is the validation error returned by -// GetReportResponse.Validate if the designated constraints aren't met. -type GetReportResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e GetReportResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e GetReportResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e GetReportResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e GetReportResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e GetReportResponseValidationError) ErrorName() string { - return "GetReportResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e GetReportResponseValidationError) 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 %sGetReportResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = GetReportResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = GetReportResponseValidationError{} - -// Validate checks the field values on Row 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 *Row) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on Row 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 RowMultiError, or nil if none found. -func (m *Row) ValidateAll() error { - return m.validate(true) -} - -func (m *Row) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Rank - - // no validation rules for Dimension - - // no validation rules for Database - - { - sorted_keys := make([]string, len(m.GetMetrics())) - i := 0 - for key := range m.GetMetrics() { - sorted_keys[i] = key - i++ - } - sort.Slice(sorted_keys, func(i, j int) bool { return sorted_keys[i] < sorted_keys[j] }) - for _, key := range sorted_keys { - val := m.GetMetrics()[key] - _ = val - - // no validation rules for Metrics[key] - - if all { - switch v := interface{}(val).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, RowValidationError{ - field: fmt.Sprintf("Metrics[%v]", key), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, RowValidationError{ - field: fmt.Sprintf("Metrics[%v]", key), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(val).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return RowValidationError{ - field: fmt.Sprintf("Metrics[%v]", key), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - } - - for idx, item := range m.GetSparkline() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, RowValidationError{ - field: fmt.Sprintf("Sparkline[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, RowValidationError{ - field: fmt.Sprintf("Sparkline[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return RowValidationError{ - field: fmt.Sprintf("Sparkline[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - // no validation rules for Fingerprint - - // no validation rules for NumQueries - - // no validation rules for Qps - - // no validation rules for Load - - if len(errors) > 0 { - return RowMultiError(errors) - } - - return nil -} - -// RowMultiError is an error wrapping multiple validation errors returned by -// Row.ValidateAll() if the designated constraints aren't met. -type RowMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m RowMultiError) 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 RowMultiError) AllErrors() []error { return m } - -// RowValidationError is the validation error returned by Row.Validate if the -// designated constraints aren't met. -type RowValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e RowValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e RowValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e RowValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e RowValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e RowValidationError) ErrorName() string { return "RowValidationError" } - -// Error satisfies the builtin error interface -func (e RowValidationError) 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 %sRow.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = RowValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = RowValidationError{} - -// Validate checks the field values on Metric 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 *Metric) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on Metric 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 MetricMultiError, or nil if none found. -func (m *Metric) ValidateAll() error { - return m.validate(true) -} - -func (m *Metric) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if all { - switch v := interface{}(m.GetStats()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, MetricValidationError{ - field: "Stats", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, MetricValidationError{ - field: "Stats", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetStats()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return MetricValidationError{ - field: "Stats", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if len(errors) > 0 { - return MetricMultiError(errors) - } - - return nil -} - -// MetricMultiError is an error wrapping multiple validation errors returned by -// Metric.ValidateAll() if the designated constraints aren't met. -type MetricMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m MetricMultiError) 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 MetricMultiError) AllErrors() []error { return m } - -// MetricValidationError is the validation error returned by Metric.Validate if -// the designated constraints aren't met. -type MetricValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e MetricValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e MetricValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e MetricValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e MetricValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e MetricValidationError) ErrorName() string { return "MetricValidationError" } - -// Error satisfies the builtin error interface -func (e MetricValidationError) 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 %sMetric.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = MetricValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = MetricValidationError{} - -// Validate checks the field values on Stat 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 *Stat) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on Stat 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 StatMultiError, or nil if none found. -func (m *Stat) ValidateAll() error { - return m.validate(true) -} - -func (m *Stat) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Rate - - // no validation rules for Cnt - - // no validation rules for Sum - - // no validation rules for Min - - // no validation rules for Max - - // no validation rules for P99 - - // no validation rules for Avg - - // no validation rules for SumPerSec - - if len(errors) > 0 { - return StatMultiError(errors) - } - - return nil -} - -// StatMultiError is an error wrapping multiple validation errors returned by -// Stat.ValidateAll() if the designated constraints aren't met. -type StatMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m StatMultiError) 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 StatMultiError) AllErrors() []error { return m } - -// StatValidationError is the validation error returned by Stat.Validate if the -// designated constraints aren't met. -type StatValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e StatValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e StatValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e StatValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e StatValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e StatValidationError) ErrorName() string { return "StatValidationError" } - -// Error satisfies the builtin error interface -func (e StatValidationError) 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 %sStat.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = StatValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = StatValidationError{} diff --git a/api/qan/v1/qan.pb.go b/api/qan/v1/qan.pb.go deleted file mode 100644 index 97e660870d3..00000000000 --- a/api/qan/v1/qan.pb.go +++ /dev/null @@ -1,1005 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.10 -// protoc (unknown) -// source: qan/v1/qan.proto - -package qanv1 - -import ( - reflect "reflect" - sync "sync" - unsafe "unsafe" - - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// ExampleType is a type of query example selected for this query class in given period of time. -type ExampleType int32 - -const ( - ExampleType_EXAMPLE_TYPE_UNSPECIFIED ExampleType = 0 - ExampleType_EXAMPLE_TYPE_RANDOM ExampleType = 1 - ExampleType_EXAMPLE_TYPE_SLOWEST ExampleType = 2 - ExampleType_EXAMPLE_TYPE_FASTEST ExampleType = 3 - ExampleType_EXAMPLE_TYPE_WITH_ERROR ExampleType = 4 -) - -// Enum value maps for ExampleType. -var ( - ExampleType_name = map[int32]string{ - 0: "EXAMPLE_TYPE_UNSPECIFIED", - 1: "EXAMPLE_TYPE_RANDOM", - 2: "EXAMPLE_TYPE_SLOWEST", - 3: "EXAMPLE_TYPE_FASTEST", - 4: "EXAMPLE_TYPE_WITH_ERROR", - } - ExampleType_value = map[string]int32{ - "EXAMPLE_TYPE_UNSPECIFIED": 0, - "EXAMPLE_TYPE_RANDOM": 1, - "EXAMPLE_TYPE_SLOWEST": 2, - "EXAMPLE_TYPE_FASTEST": 3, - "EXAMPLE_TYPE_WITH_ERROR": 4, - } -) - -func (x ExampleType) Enum() *ExampleType { - p := new(ExampleType) - *p = x - return p -} - -func (x ExampleType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (ExampleType) Descriptor() protoreflect.EnumDescriptor { - return file_qan_v1_qan_proto_enumTypes[0].Descriptor() -} - -func (ExampleType) Type() protoreflect.EnumType { - return &file_qan_v1_qan_proto_enumTypes[0] -} - -func (x ExampleType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use ExampleType.Descriptor instead. -func (ExampleType) EnumDescriptor() ([]byte, []int) { - return file_qan_v1_qan_proto_rawDescGZIP(), []int{0} -} - -// Point contains values that represents abscissa (time) and ordinate (volume etc.) -// of every point in a coordinate system of Sparklines. -type Point struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The serial number of the chart point from the largest time in the time interval to the lowest time in the time range. - Point uint32 `protobuf:"varint,1,opt,name=point,proto3" json:"point,omitempty"` - // Duration beetween two points. - TimeFrame uint32 `protobuf:"varint,2,opt,name=time_frame,json=timeFrame,proto3" json:"time_frame,omitempty"` - // Time of point in format RFC3339. - Timestamp string `protobuf:"bytes,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - // load is query_time / time_range. - Load float32 `protobuf:"fixed32,4,opt,name=load,proto3" json:"load,omitempty"` - // number of queries in bucket. - NumQueriesPerSec float32 `protobuf:"fixed32,5,opt,name=num_queries_per_sec,json=numQueriesPerSec,proto3" json:"num_queries_per_sec,omitempty"` - // number of queries with errors. - NumQueriesWithErrorsPerSec float32 `protobuf:"fixed32,6,opt,name=num_queries_with_errors_per_sec,json=numQueriesWithErrorsPerSec,proto3" json:"num_queries_with_errors_per_sec,omitempty"` - // number of queries with warnings. - NumQueriesWithWarningsPerSec float32 `protobuf:"fixed32,7,opt,name=num_queries_with_warnings_per_sec,json=numQueriesWithWarningsPerSec,proto3" json:"num_queries_with_warnings_per_sec,omitempty"` - // The statement execution time in seconds. - MQueryTimeSumPerSec float32 `protobuf:"fixed32,8,opt,name=m_query_time_sum_per_sec,json=mQueryTimeSumPerSec,proto3" json:"m_query_time_sum_per_sec,omitempty"` - // The time to acquire locks in seconds. - MLockTimeSumPerSec float32 `protobuf:"fixed32,9,opt,name=m_lock_time_sum_per_sec,json=mLockTimeSumPerSec,proto3" json:"m_lock_time_sum_per_sec,omitempty"` - // The number of rows sent to the client. - MRowsSentSumPerSec float32 `protobuf:"fixed32,10,opt,name=m_rows_sent_sum_per_sec,json=mRowsSentSumPerSec,proto3" json:"m_rows_sent_sum_per_sec,omitempty"` - // Number of rows scanned - SELECT. - MRowsExaminedSumPerSec float32 `protobuf:"fixed32,11,opt,name=m_rows_examined_sum_per_sec,json=mRowsExaminedSumPerSec,proto3" json:"m_rows_examined_sum_per_sec,omitempty"` - // Number of rows changed - UPDATE, DELETE, INSERT. - MRowsAffectedSumPerSec float32 `protobuf:"fixed32,12,opt,name=m_rows_affected_sum_per_sec,json=mRowsAffectedSumPerSec,proto3" json:"m_rows_affected_sum_per_sec,omitempty"` - // The number of rows read from tables. - MRowsReadSumPerSec float32 `protobuf:"fixed32,13,opt,name=m_rows_read_sum_per_sec,json=mRowsReadSumPerSec,proto3" json:"m_rows_read_sum_per_sec,omitempty"` - // The number of merge passes that the sort algorithm has had to do. - MMergePassesSumPerSec float32 `protobuf:"fixed32,14,opt,name=m_merge_passes_sum_per_sec,json=mMergePassesSumPerSec,proto3" json:"m_merge_passes_sum_per_sec,omitempty"` - // Counts the number of page read operations scheduled. - MInnodbIoROpsSumPerSec float32 `protobuf:"fixed32,15,opt,name=m_innodb_io_r_ops_sum_per_sec,json=mInnodbIoROpsSumPerSec,proto3" json:"m_innodb_io_r_ops_sum_per_sec,omitempty"` - // Similar to innodb_IO_r_ops, but the unit is bytes. - MInnodbIoRBytesSumPerSec float32 `protobuf:"fixed32,16,opt,name=m_innodb_io_r_bytes_sum_per_sec,json=mInnodbIoRBytesSumPerSec,proto3" json:"m_innodb_io_r_bytes_sum_per_sec,omitempty"` - // Shows how long (in seconds) it took InnoDB to actually read the data from storage. - MInnodbIoRWaitSumPerSec float32 `protobuf:"fixed32,17,opt,name=m_innodb_io_r_wait_sum_per_sec,json=mInnodbIoRWaitSumPerSec,proto3" json:"m_innodb_io_r_wait_sum_per_sec,omitempty"` - // Shows how long (in seconds) the query waited for row locks. - MInnodbRecLockWaitSumPerSec float32 `protobuf:"fixed32,18,opt,name=m_innodb_rec_lock_wait_sum_per_sec,json=mInnodbRecLockWaitSumPerSec,proto3" json:"m_innodb_rec_lock_wait_sum_per_sec,omitempty"` - // Shows how long (in seconds) the query spent either waiting to enter the InnoDB queue or inside that queue waiting for execution. - MInnodbQueueWaitSumPerSec float32 `protobuf:"fixed32,19,opt,name=m_innodb_queue_wait_sum_per_sec,json=mInnodbQueueWaitSumPerSec,proto3" json:"m_innodb_queue_wait_sum_per_sec,omitempty"` - // Counts approximately the number of unique pages the query accessed. - MInnodbPagesDistinctSumPerSec float32 `protobuf:"fixed32,20,opt,name=m_innodb_pages_distinct_sum_per_sec,json=mInnodbPagesDistinctSumPerSec,proto3" json:"m_innodb_pages_distinct_sum_per_sec,omitempty"` - // Shows how long the query is. - MQueryLengthSumPerSec float32 `protobuf:"fixed32,21,opt,name=m_query_length_sum_per_sec,json=mQueryLengthSumPerSec,proto3" json:"m_query_length_sum_per_sec,omitempty"` - // The number of bytes sent to all clients. - MBytesSentSumPerSec float32 `protobuf:"fixed32,22,opt,name=m_bytes_sent_sum_per_sec,json=mBytesSentSumPerSec,proto3" json:"m_bytes_sent_sum_per_sec,omitempty"` - // Number of temporary tables created on memory for the query. - MTmpTablesSumPerSec float32 `protobuf:"fixed32,23,opt,name=m_tmp_tables_sum_per_sec,json=mTmpTablesSumPerSec,proto3" json:"m_tmp_tables_sum_per_sec,omitempty"` - // Number of temporary tables created on disk for the query. - MTmpDiskTablesSumPerSec float32 `protobuf:"fixed32,24,opt,name=m_tmp_disk_tables_sum_per_sec,json=mTmpDiskTablesSumPerSec,proto3" json:"m_tmp_disk_tables_sum_per_sec,omitempty"` - // Total Size in bytes for all temporary tables used in the query. - MTmpTableSizesSumPerSec float32 `protobuf:"fixed32,25,opt,name=m_tmp_table_sizes_sum_per_sec,json=mTmpTableSizesSumPerSec,proto3" json:"m_tmp_table_sizes_sum_per_sec,omitempty"` - // Query Cache hits. - MQcHitSumPerSec float32 `protobuf:"fixed32,30,opt,name=m_qc_hit_sum_per_sec,json=mQcHitSumPerSec,proto3" json:"m_qc_hit_sum_per_sec,omitempty"` - // The query performed a full table scan. - MFullScanSumPerSec float32 `protobuf:"fixed32,31,opt,name=m_full_scan_sum_per_sec,json=mFullScanSumPerSec,proto3" json:"m_full_scan_sum_per_sec,omitempty"` - // The query performed a full join (a join without indexes). - MFullJoinSumPerSec float32 `protobuf:"fixed32,32,opt,name=m_full_join_sum_per_sec,json=mFullJoinSumPerSec,proto3" json:"m_full_join_sum_per_sec,omitempty"` - // The query created an implicit internal temporary table. - MTmpTableSumPerSec float32 `protobuf:"fixed32,33,opt,name=m_tmp_table_sum_per_sec,json=mTmpTableSumPerSec,proto3" json:"m_tmp_table_sum_per_sec,omitempty"` - // The querys temporary table was stored on disk. - MTmpTableOnDiskSumPerSec float32 `protobuf:"fixed32,34,opt,name=m_tmp_table_on_disk_sum_per_sec,json=mTmpTableOnDiskSumPerSec,proto3" json:"m_tmp_table_on_disk_sum_per_sec,omitempty"` - // The query used a filesort. - MFilesortSumPerSec float32 `protobuf:"fixed32,35,opt,name=m_filesort_sum_per_sec,json=mFilesortSumPerSec,proto3" json:"m_filesort_sum_per_sec,omitempty"` - // The filesort was performed on disk. - MFilesortOnDiskSumPerSec float32 `protobuf:"fixed32,36,opt,name=m_filesort_on_disk_sum_per_sec,json=mFilesortOnDiskSumPerSec,proto3" json:"m_filesort_on_disk_sum_per_sec,omitempty"` - // The number of joins that used a range search on a reference table. - MSelectFullRangeJoinSumPerSec float32 `protobuf:"fixed32,37,opt,name=m_select_full_range_join_sum_per_sec,json=mSelectFullRangeJoinSumPerSec,proto3" json:"m_select_full_range_join_sum_per_sec,omitempty"` - // The number of joins that used ranges on the first table. - MSelectRangeSumPerSec float32 `protobuf:"fixed32,38,opt,name=m_select_range_sum_per_sec,json=mSelectRangeSumPerSec,proto3" json:"m_select_range_sum_per_sec,omitempty"` - // The number of joins without keys that check for key usage after each row. - MSelectRangeCheckSumPerSec float32 `protobuf:"fixed32,39,opt,name=m_select_range_check_sum_per_sec,json=mSelectRangeCheckSumPerSec,proto3" json:"m_select_range_check_sum_per_sec,omitempty"` - // The number of sorts that were done using ranges. - MSortRangeSumPerSec float32 `protobuf:"fixed32,40,opt,name=m_sort_range_sum_per_sec,json=mSortRangeSumPerSec,proto3" json:"m_sort_range_sum_per_sec,omitempty"` - // The number of sorted rows. - MSortRowsSumPerSec float32 `protobuf:"fixed32,41,opt,name=m_sort_rows_sum_per_sec,json=mSortRowsSumPerSec,proto3" json:"m_sort_rows_sum_per_sec,omitempty"` - // The number of sorts that were done by scanning the table. - MSortScanSumPerSec float32 `protobuf:"fixed32,42,opt,name=m_sort_scan_sum_per_sec,json=mSortScanSumPerSec,proto3" json:"m_sort_scan_sum_per_sec,omitempty"` - // The number of queries without index. - MNoIndexUsedSumPerSec float32 `protobuf:"fixed32,43,opt,name=m_no_index_used_sum_per_sec,json=mNoIndexUsedSumPerSec,proto3" json:"m_no_index_used_sum_per_sec,omitempty"` - // The number of queries without good index. - MNoGoodIndexUsedSumPerSec float32 `protobuf:"fixed32,44,opt,name=m_no_good_index_used_sum_per_sec,json=mNoGoodIndexUsedSumPerSec,proto3" json:"m_no_good_index_used_sum_per_sec,omitempty"` - // The number of returned documents. - MDocsReturnedSumPerSec float32 `protobuf:"fixed32,50,opt,name=m_docs_returned_sum_per_sec,json=mDocsReturnedSumPerSec,proto3" json:"m_docs_returned_sum_per_sec,omitempty"` - // The response length of the query result in bytes. - MResponseLengthSumPerSec float32 `protobuf:"fixed32,51,opt,name=m_response_length_sum_per_sec,json=mResponseLengthSumPerSec,proto3" json:"m_response_length_sum_per_sec,omitempty"` - // The number of scanned documents. - MDocsScannedSumPerSec float32 `protobuf:"fixed32,52,opt,name=m_docs_scanned_sum_per_sec,json=mDocsScannedSumPerSec,proto3" json:"m_docs_scanned_sum_per_sec,omitempty"` - // Total number of documents scanned during query execution. - MDocsExaminedSumPerSec float32 `protobuf:"fixed32,85,opt,name=m_docs_examined_sum_per_sec,json=mDocsExaminedSumPerSec,proto3" json:"m_docs_examined_sum_per_sec,omitempty"` - // Total number of index keys scanned during query execution. - MKeysExaminedSumPerSec float32 `protobuf:"fixed32,86,opt,name=m_keys_examined_sum_per_sec,json=mKeysExaminedSumPerSec,proto3" json:"m_keys_examined_sum_per_sec,omitempty"` - // Number of times a global read lock was acquired during query execution. - MLocksGlobalAcquireCountReadSharedSumPerSec float32 `protobuf:"fixed32,87,opt,name=m_locks_global_acquire_count_read_shared_sum_per_sec,json=mLocksGlobalAcquireCountReadSharedSumPerSec,proto3" json:"m_locks_global_acquire_count_read_shared_sum_per_sec,omitempty"` - // Number of times a global write lock was acquired during query execution. - MLocksGlobalAcquireCountWriteSharedSumPerSec float32 `protobuf:"fixed32,88,opt,name=m_locks_global_acquire_count_write_shared_sum_per_sec,json=mLocksGlobalAcquireCountWriteSharedSumPerSec,proto3" json:"m_locks_global_acquire_count_write_shared_sum_per_sec,omitempty"` - // Number of times a read lock was acquired at the database level during query execution. - MLocksDatabaseAcquireCountReadSharedSumPerSec float32 `protobuf:"fixed32,89,opt,name=m_locks_database_acquire_count_read_shared_sum_per_sec,json=mLocksDatabaseAcquireCountReadSharedSumPerSec,proto3" json:"m_locks_database_acquire_count_read_shared_sum_per_sec,omitempty"` - // Number of times a read lock at the database level was requested but had to wait before being granted. - MLocksDatabaseAcquireWaitCountReadSharedSumPerSec float32 `protobuf:"fixed32,90,opt,name=m_locks_database_acquire_wait_count_read_shared_sum_per_sec,json=mLocksDatabaseAcquireWaitCountReadSharedSumPerSec,proto3" json:"m_locks_database_acquire_wait_count_read_shared_sum_per_sec,omitempty"` - // Indicates the time, spent acquiring a read lock at the database level during an operation. - MLocksDatabaseTimeAcquiringMicrosReadSharedSumPerSec float32 `protobuf:"fixed32,91,opt,name=m_locks_database_time_acquiring_micros_read_shared_sum_per_sec,json=mLocksDatabaseTimeAcquiringMicrosReadSharedSumPerSec,proto3" json:"m_locks_database_time_acquiring_micros_read_shared_sum_per_sec,omitempty"` - // Number of times a read lock was acquired on a specific collection during operations. - MLocksCollectionAcquireCountReadSharedSumPerSec float32 `protobuf:"fixed32,92,opt,name=m_locks_collection_acquire_count_read_shared_sum_per_sec,json=mLocksCollectionAcquireCountReadSharedSumPerSec,proto3" json:"m_locks_collection_acquire_count_read_shared_sum_per_sec,omitempty"` - // Total number of bytes read from storage during a specific operation. - MStorageBytesReadSumPerSec float32 `protobuf:"fixed32,93,opt,name=m_storage_bytes_read_sum_per_sec,json=mStorageBytesReadSumPerSec,proto3" json:"m_storage_bytes_read_sum_per_sec,omitempty"` - // Indicates the time, spent reading data from storage during an operation. - MStorageTimeReadingMicrosSumPerSec float32 `protobuf:"fixed32,94,opt,name=m_storage_time_reading_micros_sum_per_sec,json=mStorageTimeReadingMicrosSumPerSec,proto3" json:"m_storage_time_reading_micros_sum_per_sec,omitempty"` - // Total number of shared block cache hits by the statement. - MSharedBlksHitSumPerSec float32 `protobuf:"fixed32,60,opt,name=m_shared_blks_hit_sum_per_sec,json=mSharedBlksHitSumPerSec,proto3" json:"m_shared_blks_hit_sum_per_sec,omitempty"` - // Total number of shared blocks read by the statement. - MSharedBlksReadSumPerSec float32 `protobuf:"fixed32,61,opt,name=m_shared_blks_read_sum_per_sec,json=mSharedBlksReadSumPerSec,proto3" json:"m_shared_blks_read_sum_per_sec,omitempty"` - // Total number of shared blocks dirtied by the statement. - MSharedBlksDirtiedSumPerSec float32 `protobuf:"fixed32,62,opt,name=m_shared_blks_dirtied_sum_per_sec,json=mSharedBlksDirtiedSumPerSec,proto3" json:"m_shared_blks_dirtied_sum_per_sec,omitempty"` - // Total number of shared blocks written by the statement. - MSharedBlksWrittenSumPerSec float32 `protobuf:"fixed32,63,opt,name=m_shared_blks_written_sum_per_sec,json=mSharedBlksWrittenSumPerSec,proto3" json:"m_shared_blks_written_sum_per_sec,omitempty"` - // Total time the statement spent reading shared blocks, in milliseconds (if track_io_timing is enabled, otherwise zero). - MSharedBlkReadTimeSumPerSec float32 `protobuf:"fixed32,64,opt,name=m_shared_blk_read_time_sum_per_sec,json=mSharedBlkReadTimeSumPerSec,proto3" json:"m_shared_blk_read_time_sum_per_sec,omitempty"` - // Total time the statement spent writing shared blocks, in milliseconds (if track_io_timing is enabled, otherwise zero). - MSharedBlkWriteTimeSumPerSec float32 `protobuf:"fixed32,65,opt,name=m_shared_blk_write_time_sum_per_sec,json=mSharedBlkWriteTimeSumPerSec,proto3" json:"m_shared_blk_write_time_sum_per_sec,omitempty"` - // Total time the statement spent reading shared blocks, in milliseconds (if track_io_timing is enabled, otherwise zero). - MLocalBlkReadTimeSumPerSec float32 `protobuf:"fixed32,66,opt,name=m_local_blk_read_time_sum_per_sec,json=mLocalBlkReadTimeSumPerSec,proto3" json:"m_local_blk_read_time_sum_per_sec,omitempty"` - // Total time the statement spent writing shared blocks, in milliseconds (if track_io_timing is enabled, otherwise zero). - MLocalBlkWriteTimeSumPerSec float32 `protobuf:"fixed32,67,opt,name=m_local_blk_write_time_sum_per_sec,json=mLocalBlkWriteTimeSumPerSec,proto3" json:"m_local_blk_write_time_sum_per_sec,omitempty"` - // Total number of local block cache hits by the statement. - MLocalBlksHitSumPerSec float32 `protobuf:"fixed32,68,opt,name=m_local_blks_hit_sum_per_sec,json=mLocalBlksHitSumPerSec,proto3" json:"m_local_blks_hit_sum_per_sec,omitempty"` - // Total number of local blocks read by the statement. - MLocalBlksReadSumPerSec float32 `protobuf:"fixed32,69,opt,name=m_local_blks_read_sum_per_sec,json=mLocalBlksReadSumPerSec,proto3" json:"m_local_blks_read_sum_per_sec,omitempty"` - // Total number of local blocks dirtied by the statement. - MLocalBlksDirtiedSumPerSec float32 `protobuf:"fixed32,70,opt,name=m_local_blks_dirtied_sum_per_sec,json=mLocalBlksDirtiedSumPerSec,proto3" json:"m_local_blks_dirtied_sum_per_sec,omitempty"` - // Total number of local blocks written by the statement. - MLocalBlksWrittenSumPerSec float32 `protobuf:"fixed32,71,opt,name=m_local_blks_written_sum_per_sec,json=mLocalBlksWrittenSumPerSec,proto3" json:"m_local_blks_written_sum_per_sec,omitempty"` - // Total number of temp blocks read by the statement. - MTempBlksReadSumPerSec float32 `protobuf:"fixed32,72,opt,name=m_temp_blks_read_sum_per_sec,json=mTempBlksReadSumPerSec,proto3" json:"m_temp_blks_read_sum_per_sec,omitempty"` - // Total number of temp blocks written by the statement. - MTempBlksWrittenSumPerSec float32 `protobuf:"fixed32,73,opt,name=m_temp_blks_written_sum_per_sec,json=mTempBlksWrittenSumPerSec,proto3" json:"m_temp_blks_written_sum_per_sec,omitempty"` - // Total time the statement spent reading blocks, in milliseconds (if track_io_timing is enabled, otherwise zero). - MBlkReadTimeSumPerSec float32 `protobuf:"fixed32,74,opt,name=m_blk_read_time_sum_per_sec,json=mBlkReadTimeSumPerSec,proto3" json:"m_blk_read_time_sum_per_sec,omitempty"` - // Total time the statement spent writing blocks, in milliseconds (if track_io_timing is enabled, otherwise zero). - MBlkWriteTimeSumPerSec float32 `protobuf:"fixed32,75,opt,name=m_blk_write_time_sum_per_sec,json=mBlkWriteTimeSumPerSec,proto3" json:"m_blk_write_time_sum_per_sec,omitempty"` - // Total time user spent in query. - MCpuUserTimeSumPerSec float32 `protobuf:"fixed32,76,opt,name=m_cpu_user_time_sum_per_sec,json=mCpuUserTimeSumPerSec,proto3" json:"m_cpu_user_time_sum_per_sec,omitempty"` - // Total time system spent in query. - MCpuSysTimeSumPerSec float32 `protobuf:"fixed32,77,opt,name=m_cpu_sys_time_sum_per_sec,json=mCpuSysTimeSumPerSec,proto3" json:"m_cpu_sys_time_sum_per_sec,omitempty"` - // Total number of planned calls. - MPlansCallsSumPerSec float32 `protobuf:"fixed32,80,opt,name=m_plans_calls_sum_per_sec,json=mPlansCallsSumPerSec,proto3" json:"m_plans_calls_sum_per_sec,omitempty"` - // Total number of WAL (Write-ahead logging) records. - MWalRecordsSumPerSec float32 `protobuf:"fixed32,81,opt,name=m_wal_records_sum_per_sec,json=mWalRecordsSumPerSec,proto3" json:"m_wal_records_sum_per_sec,omitempty"` - // Total number of FPI (full page images) in WAL (Write-ahead logging) records. - MWalFpiSumPerSec float32 `protobuf:"fixed32,82,opt,name=m_wal_fpi_sum_per_sec,json=mWalFpiSumPerSec,proto3" json:"m_wal_fpi_sum_per_sec,omitempty"` - // Total bytes of WAL (Write-ahead logging) records. - MWalBytesSumPerSec float32 `protobuf:"fixed32,83,opt,name=m_wal_bytes_sum_per_sec,json=mWalBytesSumPerSec,proto3" json:"m_wal_bytes_sum_per_sec,omitempty"` - // Plan time in per seconds. - MPlanTimeSumPerSec float32 `protobuf:"fixed32,84,opt,name=m_plan_time_sum_per_sec,json=mPlanTimeSumPerSec,proto3" json:"m_plan_time_sum_per_sec,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Point) Reset() { - *x = Point{} - mi := &file_qan_v1_qan_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Point) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Point) ProtoMessage() {} - -func (x *Point) ProtoReflect() protoreflect.Message { - mi := &file_qan_v1_qan_proto_msgTypes[0] - 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 Point.ProtoReflect.Descriptor instead. -func (*Point) Descriptor() ([]byte, []int) { - return file_qan_v1_qan_proto_rawDescGZIP(), []int{0} -} - -func (x *Point) GetPoint() uint32 { - if x != nil { - return x.Point - } - return 0 -} - -func (x *Point) GetTimeFrame() uint32 { - if x != nil { - return x.TimeFrame - } - return 0 -} - -func (x *Point) GetTimestamp() string { - if x != nil { - return x.Timestamp - } - return "" -} - -func (x *Point) GetLoad() float32 { - if x != nil { - return x.Load - } - return 0 -} - -func (x *Point) GetNumQueriesPerSec() float32 { - if x != nil { - return x.NumQueriesPerSec - } - return 0 -} - -func (x *Point) GetNumQueriesWithErrorsPerSec() float32 { - if x != nil { - return x.NumQueriesWithErrorsPerSec - } - return 0 -} - -func (x *Point) GetNumQueriesWithWarningsPerSec() float32 { - if x != nil { - return x.NumQueriesWithWarningsPerSec - } - return 0 -} - -func (x *Point) GetMQueryTimeSumPerSec() float32 { - if x != nil { - return x.MQueryTimeSumPerSec - } - return 0 -} - -func (x *Point) GetMLockTimeSumPerSec() float32 { - if x != nil { - return x.MLockTimeSumPerSec - } - return 0 -} - -func (x *Point) GetMRowsSentSumPerSec() float32 { - if x != nil { - return x.MRowsSentSumPerSec - } - return 0 -} - -func (x *Point) GetMRowsExaminedSumPerSec() float32 { - if x != nil { - return x.MRowsExaminedSumPerSec - } - return 0 -} - -func (x *Point) GetMRowsAffectedSumPerSec() float32 { - if x != nil { - return x.MRowsAffectedSumPerSec - } - return 0 -} - -func (x *Point) GetMRowsReadSumPerSec() float32 { - if x != nil { - return x.MRowsReadSumPerSec - } - return 0 -} - -func (x *Point) GetMMergePassesSumPerSec() float32 { - if x != nil { - return x.MMergePassesSumPerSec - } - return 0 -} - -func (x *Point) GetMInnodbIoROpsSumPerSec() float32 { - if x != nil { - return x.MInnodbIoROpsSumPerSec - } - return 0 -} - -func (x *Point) GetMInnodbIoRBytesSumPerSec() float32 { - if x != nil { - return x.MInnodbIoRBytesSumPerSec - } - return 0 -} - -func (x *Point) GetMInnodbIoRWaitSumPerSec() float32 { - if x != nil { - return x.MInnodbIoRWaitSumPerSec - } - return 0 -} - -func (x *Point) GetMInnodbRecLockWaitSumPerSec() float32 { - if x != nil { - return x.MInnodbRecLockWaitSumPerSec - } - return 0 -} - -func (x *Point) GetMInnodbQueueWaitSumPerSec() float32 { - if x != nil { - return x.MInnodbQueueWaitSumPerSec - } - return 0 -} - -func (x *Point) GetMInnodbPagesDistinctSumPerSec() float32 { - if x != nil { - return x.MInnodbPagesDistinctSumPerSec - } - return 0 -} - -func (x *Point) GetMQueryLengthSumPerSec() float32 { - if x != nil { - return x.MQueryLengthSumPerSec - } - return 0 -} - -func (x *Point) GetMBytesSentSumPerSec() float32 { - if x != nil { - return x.MBytesSentSumPerSec - } - return 0 -} - -func (x *Point) GetMTmpTablesSumPerSec() float32 { - if x != nil { - return x.MTmpTablesSumPerSec - } - return 0 -} - -func (x *Point) GetMTmpDiskTablesSumPerSec() float32 { - if x != nil { - return x.MTmpDiskTablesSumPerSec - } - return 0 -} - -func (x *Point) GetMTmpTableSizesSumPerSec() float32 { - if x != nil { - return x.MTmpTableSizesSumPerSec - } - return 0 -} - -func (x *Point) GetMQcHitSumPerSec() float32 { - if x != nil { - return x.MQcHitSumPerSec - } - return 0 -} - -func (x *Point) GetMFullScanSumPerSec() float32 { - if x != nil { - return x.MFullScanSumPerSec - } - return 0 -} - -func (x *Point) GetMFullJoinSumPerSec() float32 { - if x != nil { - return x.MFullJoinSumPerSec - } - return 0 -} - -func (x *Point) GetMTmpTableSumPerSec() float32 { - if x != nil { - return x.MTmpTableSumPerSec - } - return 0 -} - -func (x *Point) GetMTmpTableOnDiskSumPerSec() float32 { - if x != nil { - return x.MTmpTableOnDiskSumPerSec - } - return 0 -} - -func (x *Point) GetMFilesortSumPerSec() float32 { - if x != nil { - return x.MFilesortSumPerSec - } - return 0 -} - -func (x *Point) GetMFilesortOnDiskSumPerSec() float32 { - if x != nil { - return x.MFilesortOnDiskSumPerSec - } - return 0 -} - -func (x *Point) GetMSelectFullRangeJoinSumPerSec() float32 { - if x != nil { - return x.MSelectFullRangeJoinSumPerSec - } - return 0 -} - -func (x *Point) GetMSelectRangeSumPerSec() float32 { - if x != nil { - return x.MSelectRangeSumPerSec - } - return 0 -} - -func (x *Point) GetMSelectRangeCheckSumPerSec() float32 { - if x != nil { - return x.MSelectRangeCheckSumPerSec - } - return 0 -} - -func (x *Point) GetMSortRangeSumPerSec() float32 { - if x != nil { - return x.MSortRangeSumPerSec - } - return 0 -} - -func (x *Point) GetMSortRowsSumPerSec() float32 { - if x != nil { - return x.MSortRowsSumPerSec - } - return 0 -} - -func (x *Point) GetMSortScanSumPerSec() float32 { - if x != nil { - return x.MSortScanSumPerSec - } - return 0 -} - -func (x *Point) GetMNoIndexUsedSumPerSec() float32 { - if x != nil { - return x.MNoIndexUsedSumPerSec - } - return 0 -} - -func (x *Point) GetMNoGoodIndexUsedSumPerSec() float32 { - if x != nil { - return x.MNoGoodIndexUsedSumPerSec - } - return 0 -} - -func (x *Point) GetMDocsReturnedSumPerSec() float32 { - if x != nil { - return x.MDocsReturnedSumPerSec - } - return 0 -} - -func (x *Point) GetMResponseLengthSumPerSec() float32 { - if x != nil { - return x.MResponseLengthSumPerSec - } - return 0 -} - -func (x *Point) GetMDocsScannedSumPerSec() float32 { - if x != nil { - return x.MDocsScannedSumPerSec - } - return 0 -} - -func (x *Point) GetMDocsExaminedSumPerSec() float32 { - if x != nil { - return x.MDocsExaminedSumPerSec - } - return 0 -} - -func (x *Point) GetMKeysExaminedSumPerSec() float32 { - if x != nil { - return x.MKeysExaminedSumPerSec - } - return 0 -} - -func (x *Point) GetMLocksGlobalAcquireCountReadSharedSumPerSec() float32 { - if x != nil { - return x.MLocksGlobalAcquireCountReadSharedSumPerSec - } - return 0 -} - -func (x *Point) GetMLocksGlobalAcquireCountWriteSharedSumPerSec() float32 { - if x != nil { - return x.MLocksGlobalAcquireCountWriteSharedSumPerSec - } - return 0 -} - -func (x *Point) GetMLocksDatabaseAcquireCountReadSharedSumPerSec() float32 { - if x != nil { - return x.MLocksDatabaseAcquireCountReadSharedSumPerSec - } - return 0 -} - -func (x *Point) GetMLocksDatabaseAcquireWaitCountReadSharedSumPerSec() float32 { - if x != nil { - return x.MLocksDatabaseAcquireWaitCountReadSharedSumPerSec - } - return 0 -} - -func (x *Point) GetMLocksDatabaseTimeAcquiringMicrosReadSharedSumPerSec() float32 { - if x != nil { - return x.MLocksDatabaseTimeAcquiringMicrosReadSharedSumPerSec - } - return 0 -} - -func (x *Point) GetMLocksCollectionAcquireCountReadSharedSumPerSec() float32 { - if x != nil { - return x.MLocksCollectionAcquireCountReadSharedSumPerSec - } - return 0 -} - -func (x *Point) GetMStorageBytesReadSumPerSec() float32 { - if x != nil { - return x.MStorageBytesReadSumPerSec - } - return 0 -} - -func (x *Point) GetMStorageTimeReadingMicrosSumPerSec() float32 { - if x != nil { - return x.MStorageTimeReadingMicrosSumPerSec - } - return 0 -} - -func (x *Point) GetMSharedBlksHitSumPerSec() float32 { - if x != nil { - return x.MSharedBlksHitSumPerSec - } - return 0 -} - -func (x *Point) GetMSharedBlksReadSumPerSec() float32 { - if x != nil { - return x.MSharedBlksReadSumPerSec - } - return 0 -} - -func (x *Point) GetMSharedBlksDirtiedSumPerSec() float32 { - if x != nil { - return x.MSharedBlksDirtiedSumPerSec - } - return 0 -} - -func (x *Point) GetMSharedBlksWrittenSumPerSec() float32 { - if x != nil { - return x.MSharedBlksWrittenSumPerSec - } - return 0 -} - -func (x *Point) GetMSharedBlkReadTimeSumPerSec() float32 { - if x != nil { - return x.MSharedBlkReadTimeSumPerSec - } - return 0 -} - -func (x *Point) GetMSharedBlkWriteTimeSumPerSec() float32 { - if x != nil { - return x.MSharedBlkWriteTimeSumPerSec - } - return 0 -} - -func (x *Point) GetMLocalBlkReadTimeSumPerSec() float32 { - if x != nil { - return x.MLocalBlkReadTimeSumPerSec - } - return 0 -} - -func (x *Point) GetMLocalBlkWriteTimeSumPerSec() float32 { - if x != nil { - return x.MLocalBlkWriteTimeSumPerSec - } - return 0 -} - -func (x *Point) GetMLocalBlksHitSumPerSec() float32 { - if x != nil { - return x.MLocalBlksHitSumPerSec - } - return 0 -} - -func (x *Point) GetMLocalBlksReadSumPerSec() float32 { - if x != nil { - return x.MLocalBlksReadSumPerSec - } - return 0 -} - -func (x *Point) GetMLocalBlksDirtiedSumPerSec() float32 { - if x != nil { - return x.MLocalBlksDirtiedSumPerSec - } - return 0 -} - -func (x *Point) GetMLocalBlksWrittenSumPerSec() float32 { - if x != nil { - return x.MLocalBlksWrittenSumPerSec - } - return 0 -} - -func (x *Point) GetMTempBlksReadSumPerSec() float32 { - if x != nil { - return x.MTempBlksReadSumPerSec - } - return 0 -} - -func (x *Point) GetMTempBlksWrittenSumPerSec() float32 { - if x != nil { - return x.MTempBlksWrittenSumPerSec - } - return 0 -} - -func (x *Point) GetMBlkReadTimeSumPerSec() float32 { - if x != nil { - return x.MBlkReadTimeSumPerSec - } - return 0 -} - -func (x *Point) GetMBlkWriteTimeSumPerSec() float32 { - if x != nil { - return x.MBlkWriteTimeSumPerSec - } - return 0 -} - -func (x *Point) GetMCpuUserTimeSumPerSec() float32 { - if x != nil { - return x.MCpuUserTimeSumPerSec - } - return 0 -} - -func (x *Point) GetMCpuSysTimeSumPerSec() float32 { - if x != nil { - return x.MCpuSysTimeSumPerSec - } - return 0 -} - -func (x *Point) GetMPlansCallsSumPerSec() float32 { - if x != nil { - return x.MPlansCallsSumPerSec - } - return 0 -} - -func (x *Point) GetMWalRecordsSumPerSec() float32 { - if x != nil { - return x.MWalRecordsSumPerSec - } - return 0 -} - -func (x *Point) GetMWalFpiSumPerSec() float32 { - if x != nil { - return x.MWalFpiSumPerSec - } - return 0 -} - -func (x *Point) GetMWalBytesSumPerSec() float32 { - if x != nil { - return x.MWalBytesSumPerSec - } - return 0 -} - -func (x *Point) GetMPlanTimeSumPerSec() float32 { - if x != nil { - return x.MPlanTimeSumPerSec - } - return 0 -} - -// MapFieldEntry allows to pass labels/dimensions in form like {"server": ["db1", "db2"...]}. -type MapFieldEntry struct { - state protoimpl.MessageState `protogen:"open.v1"` - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - Value []string `protobuf:"bytes,2,rep,name=value,proto3" json:"value,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *MapFieldEntry) Reset() { - *x = MapFieldEntry{} - mi := &file_qan_v1_qan_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *MapFieldEntry) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MapFieldEntry) ProtoMessage() {} - -func (x *MapFieldEntry) ProtoReflect() protoreflect.Message { - mi := &file_qan_v1_qan_proto_msgTypes[1] - 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 MapFieldEntry.ProtoReflect.Descriptor instead. -func (*MapFieldEntry) Descriptor() ([]byte, []int) { - return file_qan_v1_qan_proto_rawDescGZIP(), []int{1} -} - -func (x *MapFieldEntry) GetKey() string { - if x != nil { - return x.Key - } - return "" -} - -func (x *MapFieldEntry) GetValue() []string { - if x != nil { - return x.Value - } - return nil -} - -var File_qan_v1_qan_proto protoreflect.FileDescriptor - -const file_qan_v1_qan_proto_rawDesc = "" + - "\n" + - "\x10qan/v1/qan.proto\x12\x06qan.v1\"\xb1&\n" + - "\x05Point\x12\x14\n" + - "\x05point\x18\x01 \x01(\rR\x05point\x12\x1d\n" + - "\n" + - "time_frame\x18\x02 \x01(\rR\ttimeFrame\x12\x1c\n" + - "\ttimestamp\x18\x03 \x01(\tR\ttimestamp\x12\x12\n" + - "\x04load\x18\x04 \x01(\x02R\x04load\x12-\n" + - "\x13num_queries_per_sec\x18\x05 \x01(\x02R\x10numQueriesPerSec\x12C\n" + - "\x1fnum_queries_with_errors_per_sec\x18\x06 \x01(\x02R\x1anumQueriesWithErrorsPerSec\x12G\n" + - "!num_queries_with_warnings_per_sec\x18\a \x01(\x02R\x1cnumQueriesWithWarningsPerSec\x125\n" + - "\x18m_query_time_sum_per_sec\x18\b \x01(\x02R\x13mQueryTimeSumPerSec\x123\n" + - "\x17m_lock_time_sum_per_sec\x18\t \x01(\x02R\x12mLockTimeSumPerSec\x123\n" + - "\x17m_rows_sent_sum_per_sec\x18\n" + - " \x01(\x02R\x12mRowsSentSumPerSec\x12;\n" + - "\x1bm_rows_examined_sum_per_sec\x18\v \x01(\x02R\x16mRowsExaminedSumPerSec\x12;\n" + - "\x1bm_rows_affected_sum_per_sec\x18\f \x01(\x02R\x16mRowsAffectedSumPerSec\x123\n" + - "\x17m_rows_read_sum_per_sec\x18\r \x01(\x02R\x12mRowsReadSumPerSec\x129\n" + - "\x1am_merge_passes_sum_per_sec\x18\x0e \x01(\x02R\x15mMergePassesSumPerSec\x12=\n" + - "\x1dm_innodb_io_r_ops_sum_per_sec\x18\x0f \x01(\x02R\x16mInnodbIoROpsSumPerSec\x12A\n" + - "\x1fm_innodb_io_r_bytes_sum_per_sec\x18\x10 \x01(\x02R\x18mInnodbIoRBytesSumPerSec\x12?\n" + - "\x1em_innodb_io_r_wait_sum_per_sec\x18\x11 \x01(\x02R\x17mInnodbIoRWaitSumPerSec\x12G\n" + - "\"m_innodb_rec_lock_wait_sum_per_sec\x18\x12 \x01(\x02R\x1bmInnodbRecLockWaitSumPerSec\x12B\n" + - "\x1fm_innodb_queue_wait_sum_per_sec\x18\x13 \x01(\x02R\x19mInnodbQueueWaitSumPerSec\x12J\n" + - "#m_innodb_pages_distinct_sum_per_sec\x18\x14 \x01(\x02R\x1dmInnodbPagesDistinctSumPerSec\x129\n" + - "\x1am_query_length_sum_per_sec\x18\x15 \x01(\x02R\x15mQueryLengthSumPerSec\x125\n" + - "\x18m_bytes_sent_sum_per_sec\x18\x16 \x01(\x02R\x13mBytesSentSumPerSec\x125\n" + - "\x18m_tmp_tables_sum_per_sec\x18\x17 \x01(\x02R\x13mTmpTablesSumPerSec\x12>\n" + - "\x1dm_tmp_disk_tables_sum_per_sec\x18\x18 \x01(\x02R\x17mTmpDiskTablesSumPerSec\x12>\n" + - "\x1dm_tmp_table_sizes_sum_per_sec\x18\x19 \x01(\x02R\x17mTmpTableSizesSumPerSec\x12-\n" + - "\x14m_qc_hit_sum_per_sec\x18\x1e \x01(\x02R\x0fmQcHitSumPerSec\x123\n" + - "\x17m_full_scan_sum_per_sec\x18\x1f \x01(\x02R\x12mFullScanSumPerSec\x123\n" + - "\x17m_full_join_sum_per_sec\x18 \x01(\x02R\x12mFullJoinSumPerSec\x123\n" + - "\x17m_tmp_table_sum_per_sec\x18! \x01(\x02R\x12mTmpTableSumPerSec\x12A\n" + - "\x1fm_tmp_table_on_disk_sum_per_sec\x18\" \x01(\x02R\x18mTmpTableOnDiskSumPerSec\x122\n" + - "\x16m_filesort_sum_per_sec\x18# \x01(\x02R\x12mFilesortSumPerSec\x12@\n" + - "\x1em_filesort_on_disk_sum_per_sec\x18$ \x01(\x02R\x18mFilesortOnDiskSumPerSec\x12K\n" + - "$m_select_full_range_join_sum_per_sec\x18% \x01(\x02R\x1dmSelectFullRangeJoinSumPerSec\x129\n" + - "\x1am_select_range_sum_per_sec\x18& \x01(\x02R\x15mSelectRangeSumPerSec\x12D\n" + - " m_select_range_check_sum_per_sec\x18' \x01(\x02R\x1amSelectRangeCheckSumPerSec\x125\n" + - "\x18m_sort_range_sum_per_sec\x18( \x01(\x02R\x13mSortRangeSumPerSec\x123\n" + - "\x17m_sort_rows_sum_per_sec\x18) \x01(\x02R\x12mSortRowsSumPerSec\x123\n" + - "\x17m_sort_scan_sum_per_sec\x18* \x01(\x02R\x12mSortScanSumPerSec\x12:\n" + - "\x1bm_no_index_used_sum_per_sec\x18+ \x01(\x02R\x15mNoIndexUsedSumPerSec\x12C\n" + - " m_no_good_index_used_sum_per_sec\x18, \x01(\x02R\x19mNoGoodIndexUsedSumPerSec\x12;\n" + - "\x1bm_docs_returned_sum_per_sec\x182 \x01(\x02R\x16mDocsReturnedSumPerSec\x12?\n" + - "\x1dm_response_length_sum_per_sec\x183 \x01(\x02R\x18mResponseLengthSumPerSec\x129\n" + - "\x1am_docs_scanned_sum_per_sec\x184 \x01(\x02R\x15mDocsScannedSumPerSec\x12;\n" + - "\x1bm_docs_examined_sum_per_sec\x18U \x01(\x02R\x16mDocsExaminedSumPerSec\x12;\n" + - "\x1bm_keys_examined_sum_per_sec\x18V \x01(\x02R\x16mKeysExaminedSumPerSec\x12i\n" + - "4m_locks_global_acquire_count_read_shared_sum_per_sec\x18W \x01(\x02R+mLocksGlobalAcquireCountReadSharedSumPerSec\x12k\n" + - "5m_locks_global_acquire_count_write_shared_sum_per_sec\x18X \x01(\x02R,mLocksGlobalAcquireCountWriteSharedSumPerSec\x12m\n" + - "6m_locks_database_acquire_count_read_shared_sum_per_sec\x18Y \x01(\x02R-mLocksDatabaseAcquireCountReadSharedSumPerSec\x12v\n" + - ";m_locks_database_acquire_wait_count_read_shared_sum_per_sec\x18Z \x01(\x02R1mLocksDatabaseAcquireWaitCountReadSharedSumPerSec\x12|\n" + - ">m_locks_database_time_acquiring_micros_read_shared_sum_per_sec\x18[ \x01(\x02R4mLocksDatabaseTimeAcquiringMicrosReadSharedSumPerSec\x12q\n" + - "8m_locks_collection_acquire_count_read_shared_sum_per_sec\x18\\ \x01(\x02R/mLocksCollectionAcquireCountReadSharedSumPerSec\x12D\n" + - " m_storage_bytes_read_sum_per_sec\x18] \x01(\x02R\x1amStorageBytesReadSumPerSec\x12U\n" + - ")m_storage_time_reading_micros_sum_per_sec\x18^ \x01(\x02R\"mStorageTimeReadingMicrosSumPerSec\x12>\n" + - "\x1dm_shared_blks_hit_sum_per_sec\x18< \x01(\x02R\x17mSharedBlksHitSumPerSec\x12@\n" + - "\x1em_shared_blks_read_sum_per_sec\x18= \x01(\x02R\x18mSharedBlksReadSumPerSec\x12F\n" + - "!m_shared_blks_dirtied_sum_per_sec\x18> \x01(\x02R\x1bmSharedBlksDirtiedSumPerSec\x12F\n" + - "!m_shared_blks_written_sum_per_sec\x18? \x01(\x02R\x1bmSharedBlksWrittenSumPerSec\x12G\n" + - "\"m_shared_blk_read_time_sum_per_sec\x18@ \x01(\x02R\x1bmSharedBlkReadTimeSumPerSec\x12I\n" + - "#m_shared_blk_write_time_sum_per_sec\x18A \x01(\x02R\x1cmSharedBlkWriteTimeSumPerSec\x12E\n" + - "!m_local_blk_read_time_sum_per_sec\x18B \x01(\x02R\x1amLocalBlkReadTimeSumPerSec\x12G\n" + - "\"m_local_blk_write_time_sum_per_sec\x18C \x01(\x02R\x1bmLocalBlkWriteTimeSumPerSec\x12<\n" + - "\x1cm_local_blks_hit_sum_per_sec\x18D \x01(\x02R\x16mLocalBlksHitSumPerSec\x12>\n" + - "\x1dm_local_blks_read_sum_per_sec\x18E \x01(\x02R\x17mLocalBlksReadSumPerSec\x12D\n" + - " m_local_blks_dirtied_sum_per_sec\x18F \x01(\x02R\x1amLocalBlksDirtiedSumPerSec\x12D\n" + - " m_local_blks_written_sum_per_sec\x18G \x01(\x02R\x1amLocalBlksWrittenSumPerSec\x12<\n" + - "\x1cm_temp_blks_read_sum_per_sec\x18H \x01(\x02R\x16mTempBlksReadSumPerSec\x12B\n" + - "\x1fm_temp_blks_written_sum_per_sec\x18I \x01(\x02R\x19mTempBlksWrittenSumPerSec\x12:\n" + - "\x1bm_blk_read_time_sum_per_sec\x18J \x01(\x02R\x15mBlkReadTimeSumPerSec\x12<\n" + - "\x1cm_blk_write_time_sum_per_sec\x18K \x01(\x02R\x16mBlkWriteTimeSumPerSec\x12:\n" + - "\x1bm_cpu_user_time_sum_per_sec\x18L \x01(\x02R\x15mCpuUserTimeSumPerSec\x128\n" + - "\x1am_cpu_sys_time_sum_per_sec\x18M \x01(\x02R\x14mCpuSysTimeSumPerSec\x127\n" + - "\x19m_plans_calls_sum_per_sec\x18P \x01(\x02R\x14mPlansCallsSumPerSec\x127\n" + - "\x19m_wal_records_sum_per_sec\x18Q \x01(\x02R\x14mWalRecordsSumPerSec\x12/\n" + - "\x15m_wal_fpi_sum_per_sec\x18R \x01(\x02R\x10mWalFpiSumPerSec\x123\n" + - "\x17m_wal_bytes_sum_per_sec\x18S \x01(\x02R\x12mWalBytesSumPerSec\x123\n" + - "\x17m_plan_time_sum_per_sec\x18T \x01(\x02R\x12mPlanTimeSumPerSec\"7\n" + - "\rMapFieldEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x03(\tR\x05value*\x95\x01\n" + - "\vExampleType\x12\x1c\n" + - "\x18EXAMPLE_TYPE_UNSPECIFIED\x10\x00\x12\x17\n" + - "\x13EXAMPLE_TYPE_RANDOM\x10\x01\x12\x18\n" + - "\x14EXAMPLE_TYPE_SLOWEST\x10\x02\x12\x18\n" + - "\x14EXAMPLE_TYPE_FASTEST\x10\x03\x12\x1b\n" + - "\x17EXAMPLE_TYPE_WITH_ERROR\x10\x04Bx\n" + - "\n" + - "com.qan.v1B\bQanProtoP\x01Z'github.com/percona/pmm/api/qan/v1;qanv1\xa2\x02\x03QXX\xaa\x02\x06Qan.V1\xca\x02\x06Qan\\V1\xe2\x02\x12Qan\\V1\\GPBMetadata\xea\x02\aQan::V1b\x06proto3" - -var ( - file_qan_v1_qan_proto_rawDescOnce sync.Once - file_qan_v1_qan_proto_rawDescData []byte -) - -func file_qan_v1_qan_proto_rawDescGZIP() []byte { - file_qan_v1_qan_proto_rawDescOnce.Do(func() { - file_qan_v1_qan_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_qan_v1_qan_proto_rawDesc), len(file_qan_v1_qan_proto_rawDesc))) - }) - 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_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_qan_v1_qan_proto_init() } -func file_qan_v1_qan_proto_init() { - if File_qan_v1_qan_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_qan_v1_qan_proto_rawDesc), len(file_qan_v1_qan_proto_rawDesc)), - NumEnums: 1, - NumMessages: 2, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_qan_v1_qan_proto_goTypes, - DependencyIndexes: file_qan_v1_qan_proto_depIdxs, - EnumInfos: file_qan_v1_qan_proto_enumTypes, - MessageInfos: file_qan_v1_qan_proto_msgTypes, - }.Build() - File_qan_v1_qan_proto = out.File - file_qan_v1_qan_proto_goTypes = nil - file_qan_v1_qan_proto_depIdxs = nil -} diff --git a/api/qan/v1/qan.pb.validate.go b/api/qan/v1/qan.pb.validate.go deleted file mode 100644 index e745a078eff..00000000000 --- a/api/qan/v1/qan.pb.validate.go +++ /dev/null @@ -1,388 +0,0 @@ -// Code generated by protoc-gen-validate. DO NOT EDIT. -// source: qan/v1/qan.proto - -package qanv1 - -import ( - "bytes" - "errors" - "fmt" - "net" - "net/mail" - "net/url" - "regexp" - "sort" - "strings" - "time" - "unicode/utf8" - - "google.golang.org/protobuf/types/known/anypb" -) - -// ensure the imports are used -var ( - _ = bytes.MinRead - _ = errors.New("") - _ = fmt.Print - _ = utf8.UTFMax - _ = (*regexp.Regexp)(nil) - _ = (*strings.Reader)(nil) - _ = net.IPv4len - _ = time.Duration(0) - _ = (*url.URL)(nil) - _ = (*mail.Address)(nil) - _ = anypb.Any{} - _ = sort.Sort -) - -// Validate checks the field values on Point 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 *Point) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on Point 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 PointMultiError, or nil if none found. -func (m *Point) ValidateAll() error { - return m.validate(true) -} - -func (m *Point) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Point - - // no validation rules for TimeFrame - - // no validation rules for Timestamp - - // no validation rules for Load - - // no validation rules for NumQueriesPerSec - - // no validation rules for NumQueriesWithErrorsPerSec - - // no validation rules for NumQueriesWithWarningsPerSec - - // no validation rules for MQueryTimeSumPerSec - - // no validation rules for MLockTimeSumPerSec - - // no validation rules for MRowsSentSumPerSec - - // no validation rules for MRowsExaminedSumPerSec - - // no validation rules for MRowsAffectedSumPerSec - - // no validation rules for MRowsReadSumPerSec - - // no validation rules for MMergePassesSumPerSec - - // no validation rules for MInnodbIoROpsSumPerSec - - // no validation rules for MInnodbIoRBytesSumPerSec - - // no validation rules for MInnodbIoRWaitSumPerSec - - // no validation rules for MInnodbRecLockWaitSumPerSec - - // no validation rules for MInnodbQueueWaitSumPerSec - - // no validation rules for MInnodbPagesDistinctSumPerSec - - // no validation rules for MQueryLengthSumPerSec - - // no validation rules for MBytesSentSumPerSec - - // no validation rules for MTmpTablesSumPerSec - - // no validation rules for MTmpDiskTablesSumPerSec - - // no validation rules for MTmpTableSizesSumPerSec - - // no validation rules for MQcHitSumPerSec - - // no validation rules for MFullScanSumPerSec - - // no validation rules for MFullJoinSumPerSec - - // no validation rules for MTmpTableSumPerSec - - // no validation rules for MTmpTableOnDiskSumPerSec - - // no validation rules for MFilesortSumPerSec - - // no validation rules for MFilesortOnDiskSumPerSec - - // no validation rules for MSelectFullRangeJoinSumPerSec - - // no validation rules for MSelectRangeSumPerSec - - // no validation rules for MSelectRangeCheckSumPerSec - - // no validation rules for MSortRangeSumPerSec - - // no validation rules for MSortRowsSumPerSec - - // no validation rules for MSortScanSumPerSec - - // no validation rules for MNoIndexUsedSumPerSec - - // no validation rules for MNoGoodIndexUsedSumPerSec - - // no validation rules for MDocsReturnedSumPerSec - - // no validation rules for MResponseLengthSumPerSec - - // no validation rules for MDocsScannedSumPerSec - - // no validation rules for MDocsExaminedSumPerSec - - // no validation rules for MKeysExaminedSumPerSec - - // no validation rules for MLocksGlobalAcquireCountReadSharedSumPerSec - - // no validation rules for MLocksGlobalAcquireCountWriteSharedSumPerSec - - // no validation rules for MLocksDatabaseAcquireCountReadSharedSumPerSec - - // no validation rules for MLocksDatabaseAcquireWaitCountReadSharedSumPerSec - - // no validation rules for MLocksDatabaseTimeAcquiringMicrosReadSharedSumPerSec - - // no validation rules for MLocksCollectionAcquireCountReadSharedSumPerSec - - // no validation rules for MStorageBytesReadSumPerSec - - // no validation rules for MStorageTimeReadingMicrosSumPerSec - - // no validation rules for MSharedBlksHitSumPerSec - - // no validation rules for MSharedBlksReadSumPerSec - - // no validation rules for MSharedBlksDirtiedSumPerSec - - // no validation rules for MSharedBlksWrittenSumPerSec - - // no validation rules for MSharedBlkReadTimeSumPerSec - - // no validation rules for MSharedBlkWriteTimeSumPerSec - - // no validation rules for MLocalBlkReadTimeSumPerSec - - // no validation rules for MLocalBlkWriteTimeSumPerSec - - // no validation rules for MLocalBlksHitSumPerSec - - // no validation rules for MLocalBlksReadSumPerSec - - // no validation rules for MLocalBlksDirtiedSumPerSec - - // no validation rules for MLocalBlksWrittenSumPerSec - - // no validation rules for MTempBlksReadSumPerSec - - // no validation rules for MTempBlksWrittenSumPerSec - - // no validation rules for MBlkReadTimeSumPerSec - - // no validation rules for MBlkWriteTimeSumPerSec - - // no validation rules for MCpuUserTimeSumPerSec - - // no validation rules for MCpuSysTimeSumPerSec - - // no validation rules for MPlansCallsSumPerSec - - // no validation rules for MWalRecordsSumPerSec - - // no validation rules for MWalFpiSumPerSec - - // no validation rules for MWalBytesSumPerSec - - // no validation rules for MPlanTimeSumPerSec - - if len(errors) > 0 { - return PointMultiError(errors) - } - - return nil -} - -// PointMultiError is an error wrapping multiple validation errors returned by -// Point.ValidateAll() if the designated constraints aren't met. -type PointMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m PointMultiError) 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 PointMultiError) AllErrors() []error { return m } - -// PointValidationError is the validation error returned by Point.Validate if -// the designated constraints aren't met. -type PointValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e PointValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e PointValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e PointValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e PointValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e PointValidationError) ErrorName() string { return "PointValidationError" } - -// Error satisfies the builtin error interface -func (e PointValidationError) 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 %sPoint.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = PointValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = PointValidationError{} - -// Validate checks the field values on MapFieldEntry 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 *MapFieldEntry) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on MapFieldEntry 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 MapFieldEntryMultiError, or -// nil if none found. -func (m *MapFieldEntry) ValidateAll() error { - return m.validate(true) -} - -func (m *MapFieldEntry) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Key - - if len(errors) > 0 { - return MapFieldEntryMultiError(errors) - } - - return nil -} - -// MapFieldEntryMultiError is an error wrapping multiple validation errors -// returned by MapFieldEntry.ValidateAll() if the designated constraints -// aren't met. -type MapFieldEntryMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m MapFieldEntryMultiError) 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 MapFieldEntryMultiError) AllErrors() []error { return m } - -// MapFieldEntryValidationError is the validation error returned by -// MapFieldEntry.Validate if the designated constraints aren't met. -type MapFieldEntryValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e MapFieldEntryValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e MapFieldEntryValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e MapFieldEntryValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e MapFieldEntryValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e MapFieldEntryValidationError) ErrorName() string { return "MapFieldEntryValidationError" } - -// Error satisfies the builtin error interface -func (e MapFieldEntryValidationError) 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 %sMapFieldEntry.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = MapFieldEntryValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = MapFieldEntryValidationError{} diff --git a/api/qan/v1/service.pb.go b/api/qan/v1/service.pb.go deleted file mode 100644 index 33891137af9..00000000000 --- a/api/qan/v1/service.pb.go +++ /dev/null @@ -1,239 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.10 -// protoc (unknown) -// source: qan/v1/service.proto - -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" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// MetricsNamesRequest is empty. -type GetMetricsNamesRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetMetricsNamesRequest) Reset() { - *x = GetMetricsNamesRequest{} - mi := &file_qan_v1_service_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetMetricsNamesRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetMetricsNamesRequest) ProtoMessage() {} - -func (x *GetMetricsNamesRequest) ProtoReflect() protoreflect.Message { - mi := &file_qan_v1_service_proto_msgTypes[0] - 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 GetMetricsNamesRequest.ProtoReflect.Descriptor instead. -func (*GetMetricsNamesRequest) Descriptor() ([]byte, []int) { - return file_qan_v1_service_proto_rawDescGZIP(), []int{0} -} - -// MetricsNamesReply is map of stored metrics: -// key is root of metric name in db (Ex:. [m_]query_time[_sum]); -// value - Human readable name of metrics. -type GetMetricsNamesResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Data map[string]string `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetMetricsNamesResponse) Reset() { - *x = GetMetricsNamesResponse{} - mi := &file_qan_v1_service_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetMetricsNamesResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetMetricsNamesResponse) ProtoMessage() {} - -func (x *GetMetricsNamesResponse) ProtoReflect() protoreflect.Message { - mi := &file_qan_v1_service_proto_msgTypes[1] - 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 GetMetricsNamesResponse.ProtoReflect.Descriptor instead. -func (*GetMetricsNamesResponse) Descriptor() ([]byte, []int) { - return file_qan_v1_service_proto_rawDescGZIP(), []int{1} -} - -func (x *GetMetricsNamesResponse) GetData() map[string]string { - if x != nil { - return x.Data - } - return nil -} - -var File_qan_v1_service_proto protoreflect.FileDescriptor - -const file_qan_v1_service_proto_rawDesc = "" + - "\n" + - "\x14qan/v1/service.proto\x12\x06qan.v1\x1a\x1cgoogle/api/annotations.proto\x1a.protoc-gen-openapiv2/options/annotations.proto\x1a\x14qan/v1/filters.proto\x1a\x1bqan/v1/object_details.proto\x1a\x14qan/v1/profile.proto\"\x18\n" + - "\x16GetMetricsNamesRequest\"\x91\x01\n" + - "\x17GetMetricsNamesResponse\x12=\n" + - "\x04data\x18\x01 \x03(\v2).qan.v1.GetMetricsNamesResponse.DataEntryR\x04data\x1a7\n" + - "\tDataEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x012\x94\x10\n" + - "\n" + - "QANService\x12\xb8\x01\n" + - "\tGetReport\x12\x18.qan.v1.GetReportRequest\x1a\x19.qan.v1.GetReportResponse\"v\x92AO\x12\n" + - "Get Report\x1aAReturns a list of metrics grouped by queryid or other dimensions.\x82\xd3\xe4\x93\x02\x1e:\x01*\"\x19/v1/qan/metrics:getReport\x12\xcc\x01\n" + - "\x17GetFilteredMetricsNames\x12&.qan.v1.GetFilteredMetricsNamesRequest\x1a'.qan.v1.GetFilteredMetricsNamesResponse\"`\x92A8\x12\vGet Filters\x1a)Provides a filtered map of metrics names.\x82\xd3\xe4\x93\x02\x1f:\x01*\"\x1a/v1/qan/metrics:getFilters\x12\xb3\x01\n" + - "\x0fGetMetricsNames\x12\x1e.qan.v1.GetMetricsNamesRequest\x1a\x1f.qan.v1.GetMetricsNamesResponse\"_\x92A9\x12\x11Get Metrics Names\x1a$Provides a map of all metrics names.\x82\xd3\xe4\x93\x02\x1d:\x01*\"\x18/v1/qan/metrics:getNames\x12\xa5\x01\n" + - "\n" + - "GetMetrics\x12\x19.qan.v1.GetMetricsRequest\x1a\x1a.qan.v1.GetMetricsResponse\"`\x92A@\x12\vGet Metrics\x1a1Provides a map of metrics for specific filtering.\x82\xd3\xe4\x93\x02\x17:\x01*\"\x12/v1/qan:getMetrics\x12\x9c\x01\n" + - "\tGetLabels\x12\x18.qan.v1.GetLabelsRequest\x1a\x19.qan.v1.GetLabelsResponse\"Z\x92A;\x12\n" + - "Get Labels\x1a-Provides a list of labels for object details.\x82\xd3\xe4\x93\x02\x16:\x01*\"\x11/v1/qan:getLabels\x12\xae\x01\n" + - "\fGetHistogram\x12\x1b.qan.v1.GetHistogramRequest\x1a\x1c.qan.v1.GetHistogramResponse\"c\x92AA\x12\rGet Histogram\x1a0Provides histogram items for specific filtering.\x82\xd3\xe4\x93\x02\x19:\x01*\"\x14/v1/qan:getHistogram\x12\xee\x01\n" + - "\x1bExplainFingerprintByQueryID\x12*.qan.v1.ExplainFingerprintByQueryIDRequest\x1a+.qan.v1.ExplainFingerprintByQueryIDResponse\"v\x92AN\x12\x17Get Explain Fingerprint\x1a3Provides an explain fingerprint for given query ID.\x82\xd3\xe4\x93\x02\x1f:\x01*\"\x1a/v1/qan:explainFingerprint\x12\xbd\x01\n" + - "\fGetQueryPlan\x12\x1b.qan.v1.GetQueryPlanRequest\x1a\x1c.qan.v1.GetQueryPlanResponse\"r\x92AK\x12\x0eGet Query Plan\x1a9Provides a query plan and plan id for specific filtering.\x82\xd3\xe4\x93\x02\x1e\x12\x1c/v1/qan/query/{queryid}/plan\x12\xa8\x01\n" + - "\vQueryExists\x12\x1a.qan.v1.QueryExistsRequest\x1a\x1b.qan.v1.QueryExistsResponse\"`\x92A>\x12\x15Check Query Existence\x1a%Checks if query exists in clickhouse.\x82\xd3\xe4\x93\x02\x19:\x01*\"\x14/v1/qan/query:exists\x12\xbd\x01\n" + - "\x0fSchemaByQueryID\x12\x1e.qan.v1.SchemaByQueryIDRequest\x1a\x1f.qan.v1.SchemaByQueryIDResponse\"i\x92AD\x12\n" + - "Get Schema\x1a6Provides the schema for a given queryID and serviceID.\x82\xd3\xe4\x93\x02\x1c:\x01*\"\x17/v1/qan/query:getSchema\x12\xb1\x01\n" + - "\x0fGetQueryExample\x12\x1e.qan.v1.GetQueryExampleRequest\x1a\x1f.qan.v1.GetQueryExampleResponse\"]\x92A7\x12\x11Get Query Example\x1a\"Provides a list of query examples.\x82\xd3\xe4\x93\x02\x1d:\x01*\"\x18/v1/qan/query:getExampleB|\n" + - "\n" + - "com.qan.v1B\fServiceProtoP\x01Z'github.com/percona/pmm/api/qan/v1;qanv1\xa2\x02\x03QXX\xaa\x02\x06Qan.V1\xca\x02\x06Qan\\V1\xe2\x02\x12Qan\\V1\\GPBMetadata\xea\x02\aQan::V1b\x06proto3" - -var ( - file_qan_v1_service_proto_rawDescOnce sync.Once - file_qan_v1_service_proto_rawDescData []byte -) - -func file_qan_v1_service_proto_rawDescGZIP() []byte { - file_qan_v1_service_proto_rawDescOnce.Do(func() { - file_qan_v1_service_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_qan_v1_service_proto_rawDesc), len(file_qan_v1_service_proto_rawDesc))) - }) - return file_qan_v1_service_proto_rawDescData -} - -var ( - file_qan_v1_service_proto_msgTypes = make([]protoimpl.MessageInfo, 3) - file_qan_v1_service_proto_goTypes = []any{ - (*GetMetricsNamesRequest)(nil), // 0: qan.v1.GetMetricsNamesRequest - (*GetMetricsNamesResponse)(nil), // 1: qan.v1.GetMetricsNamesResponse - nil, // 2: qan.v1.GetMetricsNamesResponse.DataEntry - (*GetReportRequest)(nil), // 3: qan.v1.GetReportRequest - (*GetFilteredMetricsNamesRequest)(nil), // 4: qan.v1.GetFilteredMetricsNamesRequest - (*GetMetricsRequest)(nil), // 5: qan.v1.GetMetricsRequest - (*GetLabelsRequest)(nil), // 6: qan.v1.GetLabelsRequest - (*GetHistogramRequest)(nil), // 7: qan.v1.GetHistogramRequest - (*ExplainFingerprintByQueryIDRequest)(nil), // 8: qan.v1.ExplainFingerprintByQueryIDRequest - (*GetQueryPlanRequest)(nil), // 9: qan.v1.GetQueryPlanRequest - (*QueryExistsRequest)(nil), // 10: qan.v1.QueryExistsRequest - (*SchemaByQueryIDRequest)(nil), // 11: qan.v1.SchemaByQueryIDRequest - (*GetQueryExampleRequest)(nil), // 12: qan.v1.GetQueryExampleRequest - (*GetReportResponse)(nil), // 13: qan.v1.GetReportResponse - (*GetFilteredMetricsNamesResponse)(nil), // 14: qan.v1.GetFilteredMetricsNamesResponse - (*GetMetricsResponse)(nil), // 15: qan.v1.GetMetricsResponse - (*GetLabelsResponse)(nil), // 16: qan.v1.GetLabelsResponse - (*GetHistogramResponse)(nil), // 17: qan.v1.GetHistogramResponse - (*ExplainFingerprintByQueryIDResponse)(nil), // 18: qan.v1.ExplainFingerprintByQueryIDResponse - (*GetQueryPlanResponse)(nil), // 19: qan.v1.GetQueryPlanResponse - (*QueryExistsResponse)(nil), // 20: qan.v1.QueryExistsResponse - (*SchemaByQueryIDResponse)(nil), // 21: qan.v1.SchemaByQueryIDResponse - (*GetQueryExampleResponse)(nil), // 22: qan.v1.GetQueryExampleResponse - } -) - -var file_qan_v1_service_proto_depIdxs = []int32{ - 2, // 0: qan.v1.GetMetricsNamesResponse.data:type_name -> qan.v1.GetMetricsNamesResponse.DataEntry - 3, // 1: qan.v1.QANService.GetReport:input_type -> qan.v1.GetReportRequest - 4, // 2: qan.v1.QANService.GetFilteredMetricsNames:input_type -> qan.v1.GetFilteredMetricsNamesRequest - 0, // 3: qan.v1.QANService.GetMetricsNames:input_type -> qan.v1.GetMetricsNamesRequest - 5, // 4: qan.v1.QANService.GetMetrics:input_type -> qan.v1.GetMetricsRequest - 6, // 5: qan.v1.QANService.GetLabels:input_type -> qan.v1.GetLabelsRequest - 7, // 6: qan.v1.QANService.GetHistogram:input_type -> qan.v1.GetHistogramRequest - 8, // 7: qan.v1.QANService.ExplainFingerprintByQueryID:input_type -> qan.v1.ExplainFingerprintByQueryIDRequest - 9, // 8: qan.v1.QANService.GetQueryPlan:input_type -> qan.v1.GetQueryPlanRequest - 10, // 9: qan.v1.QANService.QueryExists:input_type -> qan.v1.QueryExistsRequest - 11, // 10: qan.v1.QANService.SchemaByQueryID:input_type -> qan.v1.SchemaByQueryIDRequest - 12, // 11: qan.v1.QANService.GetQueryExample:input_type -> qan.v1.GetQueryExampleRequest - 13, // 12: qan.v1.QANService.GetReport:output_type -> qan.v1.GetReportResponse - 14, // 13: qan.v1.QANService.GetFilteredMetricsNames:output_type -> qan.v1.GetFilteredMetricsNamesResponse - 1, // 14: qan.v1.QANService.GetMetricsNames:output_type -> qan.v1.GetMetricsNamesResponse - 15, // 15: qan.v1.QANService.GetMetrics:output_type -> qan.v1.GetMetricsResponse - 16, // 16: qan.v1.QANService.GetLabels:output_type -> qan.v1.GetLabelsResponse - 17, // 17: qan.v1.QANService.GetHistogram:output_type -> qan.v1.GetHistogramResponse - 18, // 18: qan.v1.QANService.ExplainFingerprintByQueryID:output_type -> qan.v1.ExplainFingerprintByQueryIDResponse - 19, // 19: qan.v1.QANService.GetQueryPlan:output_type -> qan.v1.GetQueryPlanResponse - 20, // 20: qan.v1.QANService.QueryExists:output_type -> qan.v1.QueryExistsResponse - 21, // 21: qan.v1.QANService.SchemaByQueryID:output_type -> qan.v1.SchemaByQueryIDResponse - 22, // 22: qan.v1.QANService.GetQueryExample:output_type -> qan.v1.GetQueryExampleResponse - 12, // [12:23] is the sub-list for method output_type - 1, // [1:12] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name -} - -func init() { file_qan_v1_service_proto_init() } -func file_qan_v1_service_proto_init() { - if File_qan_v1_service_proto != nil { - return - } - file_qan_v1_filters_proto_init() - file_qan_v1_object_details_proto_init() - file_qan_v1_profile_proto_init() - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_qan_v1_service_proto_rawDesc), len(file_qan_v1_service_proto_rawDesc)), - NumEnums: 0, - NumMessages: 3, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_qan_v1_service_proto_goTypes, - DependencyIndexes: file_qan_v1_service_proto_depIdxs, - MessageInfos: file_qan_v1_service_proto_msgTypes, - }.Build() - File_qan_v1_service_proto = out.File - file_qan_v1_service_proto_goTypes = nil - file_qan_v1_service_proto_depIdxs = nil -} diff --git a/api/qan/v1/service.pb.gw.go b/api/qan/v1/service.pb.gw.go deleted file mode 100644 index 9ee6eb2d083..00000000000 --- a/api/qan/v1/service.pb.gw.go +++ /dev/null @@ -1,829 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: qan/v1/service.proto - -/* -Package qanv1 is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package qanv1 - -import ( - "context" - "errors" - "io" - "net/http" - - "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" - "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" - "google.golang.org/protobuf/proto" -) - -// Suppress "imported and not used" errors -var ( - _ codes.Code - _ io.Reader - _ status.Status - _ = errors.New - _ = runtime.String - _ = utilities.NewDoubleArray - _ = metadata.Join -) - -func request_QANService_GetReport_0(ctx context.Context, marshaler runtime.Marshaler, client QANServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq GetReportRequest - 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.GetReport(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_QANService_GetReport_0(ctx context.Context, marshaler runtime.Marshaler, server QANServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq GetReportRequest - 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.GetReport(ctx, &protoReq) - return msg, metadata, err -} - -func request_QANService_GetFilteredMetricsNames_0(ctx context.Context, marshaler runtime.Marshaler, client QANServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq GetFilteredMetricsNamesRequest - 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.GetFilteredMetricsNames(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_QANService_GetFilteredMetricsNames_0(ctx context.Context, marshaler runtime.Marshaler, server QANServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq GetFilteredMetricsNamesRequest - 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.GetFilteredMetricsNames(ctx, &protoReq) - return msg, metadata, err -} - -func request_QANService_GetMetricsNames_0(ctx context.Context, marshaler runtime.Marshaler, client QANServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq GetMetricsNamesRequest - 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.GetMetricsNames(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_QANService_GetMetricsNames_0(ctx context.Context, marshaler runtime.Marshaler, server QANServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq GetMetricsNamesRequest - 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.GetMetricsNames(ctx, &protoReq) - return msg, metadata, err -} - -func request_QANService_GetMetrics_0(ctx context.Context, marshaler runtime.Marshaler, client QANServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq GetMetricsRequest - 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.GetMetrics(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_QANService_GetMetrics_0(ctx context.Context, marshaler runtime.Marshaler, server QANServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq GetMetricsRequest - 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.GetMetrics(ctx, &protoReq) - return msg, metadata, err -} - -func request_QANService_GetLabels_0(ctx context.Context, marshaler runtime.Marshaler, client QANServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq GetLabelsRequest - 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.GetLabels(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_QANService_GetLabels_0(ctx context.Context, marshaler runtime.Marshaler, server QANServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq GetLabelsRequest - 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.GetLabels(ctx, &protoReq) - return msg, metadata, err -} - -func request_QANService_GetHistogram_0(ctx context.Context, marshaler runtime.Marshaler, client QANServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq GetHistogramRequest - 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.GetHistogram(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_QANService_GetHistogram_0(ctx context.Context, marshaler runtime.Marshaler, server QANServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq GetHistogramRequest - 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.GetHistogram(ctx, &protoReq) - return msg, metadata, err -} - -func request_QANService_ExplainFingerprintByQueryID_0(ctx context.Context, marshaler runtime.Marshaler, client QANServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq ExplainFingerprintByQueryIDRequest - 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.ExplainFingerprintByQueryID(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_QANService_ExplainFingerprintByQueryID_0(ctx context.Context, marshaler runtime.Marshaler, server QANServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq ExplainFingerprintByQueryIDRequest - 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.ExplainFingerprintByQueryID(ctx, &protoReq) - return msg, metadata, err -} - -func request_QANService_GetQueryPlan_0(ctx context.Context, marshaler runtime.Marshaler, client QANServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq GetQueryPlanRequest - metadata runtime.ServerMetadata - err error - ) - if req.Body != nil { - _, _ = io.Copy(io.Discard, req.Body) - } - val, ok := pathParams["queryid"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "queryid") - } - protoReq.Queryid, err = runtime.String(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "queryid", err) - } - msg, err := client.GetQueryPlan(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_QANService_GetQueryPlan_0(ctx context.Context, marshaler runtime.Marshaler, server QANServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq GetQueryPlanRequest - metadata runtime.ServerMetadata - err error - ) - val, ok := pathParams["queryid"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "queryid") - } - protoReq.Queryid, err = runtime.String(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "queryid", err) - } - msg, err := server.GetQueryPlan(ctx, &protoReq) - return msg, metadata, err -} - -func request_QANService_QueryExists_0(ctx context.Context, marshaler runtime.Marshaler, client QANServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq QueryExistsRequest - 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.QueryExists(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_QANService_QueryExists_0(ctx context.Context, marshaler runtime.Marshaler, server QANServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq QueryExistsRequest - 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.QueryExists(ctx, &protoReq) - return msg, metadata, err -} - -func request_QANService_SchemaByQueryID_0(ctx context.Context, marshaler runtime.Marshaler, client QANServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq SchemaByQueryIDRequest - 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.SchemaByQueryID(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_QANService_SchemaByQueryID_0(ctx context.Context, marshaler runtime.Marshaler, server QANServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq SchemaByQueryIDRequest - 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.SchemaByQueryID(ctx, &protoReq) - return msg, metadata, err -} - -func request_QANService_GetQueryExample_0(ctx context.Context, marshaler runtime.Marshaler, client QANServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq GetQueryExampleRequest - 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.GetQueryExample(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_QANService_GetQueryExample_0(ctx context.Context, marshaler runtime.Marshaler, server QANServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq GetQueryExampleRequest - 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.GetQueryExample(ctx, &protoReq) - return msg, metadata, err -} - -// RegisterQANServiceHandlerServer registers the http handlers for service QANService to "mux". -// UnaryRPC :call QANServiceServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQANServiceHandlerFromEndpoint instead. -// GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call. -func RegisterQANServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QANServiceServer) error { - mux.Handle(http.MethodPost, pattern_QANService_GetReport_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, "/qan.v1.QANService/GetReport", runtime.WithHTTPPathPattern("/v1/qan/metrics:getReport")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_QANService_GetReport_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_QANService_GetReport_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPost, pattern_QANService_GetFilteredMetricsNames_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, "/qan.v1.QANService/GetFilteredMetricsNames", runtime.WithHTTPPathPattern("/v1/qan/metrics:getFilters")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_QANService_GetFilteredMetricsNames_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_QANService_GetFilteredMetricsNames_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPost, pattern_QANService_GetMetricsNames_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, "/qan.v1.QANService/GetMetricsNames", runtime.WithHTTPPathPattern("/v1/qan/metrics:getNames")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_QANService_GetMetricsNames_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_QANService_GetMetricsNames_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPost, pattern_QANService_GetMetrics_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, "/qan.v1.QANService/GetMetrics", runtime.WithHTTPPathPattern("/v1/qan:getMetrics")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_QANService_GetMetrics_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_QANService_GetMetrics_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPost, pattern_QANService_GetLabels_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, "/qan.v1.QANService/GetLabels", runtime.WithHTTPPathPattern("/v1/qan:getLabels")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_QANService_GetLabels_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_QANService_GetLabels_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPost, pattern_QANService_GetHistogram_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, "/qan.v1.QANService/GetHistogram", runtime.WithHTTPPathPattern("/v1/qan:getHistogram")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_QANService_GetHistogram_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_QANService_GetHistogram_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPost, pattern_QANService_ExplainFingerprintByQueryID_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, "/qan.v1.QANService/ExplainFingerprintByQueryID", runtime.WithHTTPPathPattern("/v1/qan:explainFingerprint")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_QANService_ExplainFingerprintByQueryID_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_QANService_ExplainFingerprintByQueryID_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodGet, pattern_QANService_GetQueryPlan_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, "/qan.v1.QANService/GetQueryPlan", runtime.WithHTTPPathPattern("/v1/qan/query/{queryid}/plan")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_QANService_GetQueryPlan_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_QANService_GetQueryPlan_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPost, pattern_QANService_QueryExists_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, "/qan.v1.QANService/QueryExists", runtime.WithHTTPPathPattern("/v1/qan/query:exists")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_QANService_QueryExists_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_QANService_QueryExists_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPost, pattern_QANService_SchemaByQueryID_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/qan.v1.QANService/SchemaByQueryID", runtime.WithHTTPPathPattern("/v1/qan/query:getSchema")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_QANService_SchemaByQueryID_0(annotatedContext, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_QANService_SchemaByQueryID_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPost, pattern_QANService_GetQueryExample_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, "/qan.v1.QANService/GetQueryExample", runtime.WithHTTPPathPattern("/v1/qan/query:getExample")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_QANService_GetQueryExample_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_QANService_GetQueryExample_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - return nil -} - -// RegisterQANServiceHandlerFromEndpoint is same as RegisterQANServiceHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterQANServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.NewClient(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - return RegisterQANServiceHandler(ctx, mux, conn) -} - -// RegisterQANServiceHandler registers the http handlers for service QANService to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterQANServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterQANServiceHandlerClient(ctx, mux, NewQANServiceClient(conn)) -} - -// RegisterQANServiceHandlerClient registers the http handlers for service QANService -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QANServiceClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QANServiceClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "QANServiceClient" to call the correct interceptors. This client ignores the HTTP middlewares. -func RegisterQANServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QANServiceClient) error { - mux.Handle(http.MethodPost, pattern_QANService_GetReport_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, "/qan.v1.QANService/GetReport", runtime.WithHTTPPathPattern("/v1/qan/metrics:getReport")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_QANService_GetReport_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_QANService_GetReport_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPost, pattern_QANService_GetFilteredMetricsNames_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, "/qan.v1.QANService/GetFilteredMetricsNames", runtime.WithHTTPPathPattern("/v1/qan/metrics:getFilters")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_QANService_GetFilteredMetricsNames_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_QANService_GetFilteredMetricsNames_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPost, pattern_QANService_GetMetricsNames_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, "/qan.v1.QANService/GetMetricsNames", runtime.WithHTTPPathPattern("/v1/qan/metrics:getNames")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_QANService_GetMetricsNames_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_QANService_GetMetricsNames_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPost, pattern_QANService_GetMetrics_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, "/qan.v1.QANService/GetMetrics", runtime.WithHTTPPathPattern("/v1/qan:getMetrics")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_QANService_GetMetrics_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_QANService_GetMetrics_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPost, pattern_QANService_GetLabels_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, "/qan.v1.QANService/GetLabels", runtime.WithHTTPPathPattern("/v1/qan:getLabels")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_QANService_GetLabels_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_QANService_GetLabels_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPost, pattern_QANService_GetHistogram_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, "/qan.v1.QANService/GetHistogram", runtime.WithHTTPPathPattern("/v1/qan:getHistogram")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_QANService_GetHistogram_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_QANService_GetHistogram_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPost, pattern_QANService_ExplainFingerprintByQueryID_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, "/qan.v1.QANService/ExplainFingerprintByQueryID", runtime.WithHTTPPathPattern("/v1/qan:explainFingerprint")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_QANService_ExplainFingerprintByQueryID_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_QANService_ExplainFingerprintByQueryID_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodGet, pattern_QANService_GetQueryPlan_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, "/qan.v1.QANService/GetQueryPlan", runtime.WithHTTPPathPattern("/v1/qan/query/{queryid}/plan")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_QANService_GetQueryPlan_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_QANService_GetQueryPlan_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPost, pattern_QANService_QueryExists_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, "/qan.v1.QANService/QueryExists", runtime.WithHTTPPathPattern("/v1/qan/query:exists")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_QANService_QueryExists_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_QANService_QueryExists_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPost, pattern_QANService_SchemaByQueryID_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/qan.v1.QANService/SchemaByQueryID", runtime.WithHTTPPathPattern("/v1/qan/query:getSchema")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_QANService_SchemaByQueryID_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_QANService_SchemaByQueryID_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPost, pattern_QANService_GetQueryExample_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, "/qan.v1.QANService/GetQueryExample", runtime.WithHTTPPathPattern("/v1/qan/query:getExample")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_QANService_GetQueryExample_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_QANService_GetQueryExample_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - return nil -} - -var ( - pattern_QANService_GetReport_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "qan", "metrics"}, "getReport")) - pattern_QANService_GetFilteredMetricsNames_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "qan", "metrics"}, "getFilters")) - pattern_QANService_GetMetricsNames_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "qan", "metrics"}, "getNames")) - pattern_QANService_GetMetrics_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "qan"}, "getMetrics")) - pattern_QANService_GetLabels_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "qan"}, "getLabels")) - pattern_QANService_GetHistogram_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "qan"}, "getHistogram")) - pattern_QANService_ExplainFingerprintByQueryID_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "qan"}, "explainFingerprint")) - pattern_QANService_GetQueryPlan_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"v1", "qan", "query", "queryid", "plan"}, "")) - pattern_QANService_QueryExists_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "qan", "query"}, "exists")) - pattern_QANService_SchemaByQueryID_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "qan", "query"}, "getSchema")) - pattern_QANService_GetQueryExample_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "qan", "query"}, "getExample")) -) - -var ( - forward_QANService_GetReport_0 = runtime.ForwardResponseMessage - forward_QANService_GetFilteredMetricsNames_0 = runtime.ForwardResponseMessage - forward_QANService_GetMetricsNames_0 = runtime.ForwardResponseMessage - forward_QANService_GetMetrics_0 = runtime.ForwardResponseMessage - forward_QANService_GetLabels_0 = runtime.ForwardResponseMessage - forward_QANService_GetHistogram_0 = runtime.ForwardResponseMessage - forward_QANService_ExplainFingerprintByQueryID_0 = runtime.ForwardResponseMessage - forward_QANService_GetQueryPlan_0 = runtime.ForwardResponseMessage - forward_QANService_QueryExists_0 = runtime.ForwardResponseMessage - forward_QANService_SchemaByQueryID_0 = runtime.ForwardResponseMessage - forward_QANService_GetQueryExample_0 = runtime.ForwardResponseMessage -) diff --git a/api/qan/v1/service.pb.validate.go b/api/qan/v1/service.pb.validate.go deleted file mode 100644 index ce719a826ee..00000000000 --- a/api/qan/v1/service.pb.validate.go +++ /dev/null @@ -1,242 +0,0 @@ -// Code generated by protoc-gen-validate. DO NOT EDIT. -// source: qan/v1/service.proto - -package qanv1 - -import ( - "bytes" - "errors" - "fmt" - "net" - "net/mail" - "net/url" - "regexp" - "sort" - "strings" - "time" - "unicode/utf8" - - "google.golang.org/protobuf/types/known/anypb" -) - -// ensure the imports are used -var ( - _ = bytes.MinRead - _ = errors.New("") - _ = fmt.Print - _ = utf8.UTFMax - _ = (*regexp.Regexp)(nil) - _ = (*strings.Reader)(nil) - _ = net.IPv4len - _ = time.Duration(0) - _ = (*url.URL)(nil) - _ = (*mail.Address)(nil) - _ = anypb.Any{} - _ = sort.Sort -) - -// Validate checks the field values on GetMetricsNamesRequest 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 *GetMetricsNamesRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on GetMetricsNamesRequest 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 -// GetMetricsNamesRequestMultiError, or nil if none found. -func (m *GetMetricsNamesRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *GetMetricsNamesRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return GetMetricsNamesRequestMultiError(errors) - } - - return nil -} - -// GetMetricsNamesRequestMultiError is an error wrapping multiple validation -// errors returned by GetMetricsNamesRequest.ValidateAll() if the designated -// constraints aren't met. -type GetMetricsNamesRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m GetMetricsNamesRequestMultiError) 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 GetMetricsNamesRequestMultiError) AllErrors() []error { return m } - -// GetMetricsNamesRequestValidationError is the validation error returned by -// GetMetricsNamesRequest.Validate if the designated constraints aren't met. -type GetMetricsNamesRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e GetMetricsNamesRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e GetMetricsNamesRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e GetMetricsNamesRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e GetMetricsNamesRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e GetMetricsNamesRequestValidationError) ErrorName() string { - return "GetMetricsNamesRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e GetMetricsNamesRequestValidationError) 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 %sGetMetricsNamesRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = GetMetricsNamesRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = GetMetricsNamesRequestValidationError{} - -// Validate checks the field values on GetMetricsNamesResponse 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 *GetMetricsNamesResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on GetMetricsNamesResponse 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 -// GetMetricsNamesResponseMultiError, or nil if none found. -func (m *GetMetricsNamesResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *GetMetricsNamesResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Data - - if len(errors) > 0 { - return GetMetricsNamesResponseMultiError(errors) - } - - return nil -} - -// GetMetricsNamesResponseMultiError is an error wrapping multiple validation -// errors returned by GetMetricsNamesResponse.ValidateAll() if the designated -// constraints aren't met. -type GetMetricsNamesResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m GetMetricsNamesResponseMultiError) 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 GetMetricsNamesResponseMultiError) AllErrors() []error { return m } - -// GetMetricsNamesResponseValidationError is the validation error returned by -// GetMetricsNamesResponse.Validate if the designated constraints aren't met. -type GetMetricsNamesResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e GetMetricsNamesResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e GetMetricsNamesResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e GetMetricsNamesResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e GetMetricsNamesResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e GetMetricsNamesResponseValidationError) ErrorName() string { - return "GetMetricsNamesResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e GetMetricsNamesResponseValidationError) 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 %sGetMetricsNamesResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = GetMetricsNamesResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = GetMetricsNamesResponseValidationError{} diff --git a/api/qan/v1/service_grpc.pb.go b/api/qan/v1/service_grpc.pb.go deleted file mode 100644 index 3fbdc5eabc2..00000000000 --- a/api/qan/v1/service_grpc.pb.go +++ /dev/null @@ -1,538 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.6.0 -// - protoc (unknown) -// source: qan/v1/service.proto - -package qanv1 - -import ( - context "context" - - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.64.0 or later. -const _ = grpc.SupportPackageIsVersion9 - -const ( - QANService_GetReport_FullMethodName = "/qan.v1.QANService/GetReport" - QANService_GetFilteredMetricsNames_FullMethodName = "/qan.v1.QANService/GetFilteredMetricsNames" - QANService_GetMetricsNames_FullMethodName = "/qan.v1.QANService/GetMetricsNames" - QANService_GetMetrics_FullMethodName = "/qan.v1.QANService/GetMetrics" - QANService_GetLabels_FullMethodName = "/qan.v1.QANService/GetLabels" - QANService_GetHistogram_FullMethodName = "/qan.v1.QANService/GetHistogram" - QANService_ExplainFingerprintByQueryID_FullMethodName = "/qan.v1.QANService/ExplainFingerprintByQueryID" - QANService_GetQueryPlan_FullMethodName = "/qan.v1.QANService/GetQueryPlan" - QANService_QueryExists_FullMethodName = "/qan.v1.QANService/QueryExists" - QANService_SchemaByQueryID_FullMethodName = "/qan.v1.QANService/SchemaByQueryID" - QANService_GetQueryExample_FullMethodName = "/qan.v1.QANService/GetQueryExample" -) - -// QANServiceClient is the client API for QANService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -// -// QANService provides an API to interact with PMM Query Analytics. -type QANServiceClient interface { - // GetReport returns a list of metrics grouped by queryid or other dimensions. - GetReport(ctx context.Context, in *GetReportRequest, opts ...grpc.CallOption) (*GetReportResponse, error) - // Get provides a map of metrics names. - GetFilteredMetricsNames(ctx context.Context, in *GetFilteredMetricsNamesRequest, opts ...grpc.CallOption) (*GetFilteredMetricsNamesResponse, error) - // GetMetricsNames provides a map of metrics names. - GetMetricsNames(ctx context.Context, in *GetMetricsNamesRequest, opts ...grpc.CallOption) (*GetMetricsNamesResponse, error) - // GetMetrics returns a map of metrics for specific filtering. - GetMetrics(ctx context.Context, in *GetMetricsRequest, opts ...grpc.CallOption) (*GetMetricsResponse, error) - // GetLabels return a list of labels for object details. - GetLabels(ctx context.Context, in *GetLabelsRequest, opts ...grpc.CallOption) (*GetLabelsResponse, error) - // GetHistogram returns histogram items for specific filtering. - GetHistogram(ctx context.Context, in *GetHistogramRequest, opts ...grpc.CallOption) (*GetHistogramResponse, error) - // ExplainFingerprintByQueryID returns an explain fingerprint for given query ID. - ExplainFingerprintByQueryID(ctx context.Context, in *ExplainFingerprintByQueryIDRequest, opts ...grpc.CallOption) (*ExplainFingerprintByQueryIDResponse, error) - // GetQueryPlan returns a query plan and plan id for specific filtering. - GetQueryPlan(ctx context.Context, in *GetQueryPlanRequest, opts ...grpc.CallOption) (*GetQueryPlanResponse, error) - // QueryExists checks if query exists in clickhouse. - QueryExists(ctx context.Context, in *QueryExistsRequest, opts ...grpc.CallOption) (*QueryExistsResponse, error) - // SchemaByQueryID returns the schema for a given queryID and serviceID. - SchemaByQueryID(ctx context.Context, in *SchemaByQueryIDRequest, opts ...grpc.CallOption) (*SchemaByQueryIDResponse, error) - // GetQueryExample returns a list of query examples. - GetQueryExample(ctx context.Context, in *GetQueryExampleRequest, opts ...grpc.CallOption) (*GetQueryExampleResponse, error) -} - -type qANServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewQANServiceClient(cc grpc.ClientConnInterface) QANServiceClient { - return &qANServiceClient{cc} -} - -func (c *qANServiceClient) GetReport(ctx context.Context, in *GetReportRequest, opts ...grpc.CallOption) (*GetReportResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetReportResponse) - err := c.cc.Invoke(ctx, QANService_GetReport_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *qANServiceClient) GetFilteredMetricsNames(ctx context.Context, in *GetFilteredMetricsNamesRequest, opts ...grpc.CallOption) (*GetFilteredMetricsNamesResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetFilteredMetricsNamesResponse) - err := c.cc.Invoke(ctx, QANService_GetFilteredMetricsNames_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *qANServiceClient) GetMetricsNames(ctx context.Context, in *GetMetricsNamesRequest, opts ...grpc.CallOption) (*GetMetricsNamesResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetMetricsNamesResponse) - err := c.cc.Invoke(ctx, QANService_GetMetricsNames_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *qANServiceClient) GetMetrics(ctx context.Context, in *GetMetricsRequest, opts ...grpc.CallOption) (*GetMetricsResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetMetricsResponse) - err := c.cc.Invoke(ctx, QANService_GetMetrics_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *qANServiceClient) GetLabels(ctx context.Context, in *GetLabelsRequest, opts ...grpc.CallOption) (*GetLabelsResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetLabelsResponse) - err := c.cc.Invoke(ctx, QANService_GetLabels_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *qANServiceClient) GetHistogram(ctx context.Context, in *GetHistogramRequest, opts ...grpc.CallOption) (*GetHistogramResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetHistogramResponse) - err := c.cc.Invoke(ctx, QANService_GetHistogram_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *qANServiceClient) ExplainFingerprintByQueryID(ctx context.Context, in *ExplainFingerprintByQueryIDRequest, opts ...grpc.CallOption) (*ExplainFingerprintByQueryIDResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(ExplainFingerprintByQueryIDResponse) - err := c.cc.Invoke(ctx, QANService_ExplainFingerprintByQueryID_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *qANServiceClient) GetQueryPlan(ctx context.Context, in *GetQueryPlanRequest, opts ...grpc.CallOption) (*GetQueryPlanResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetQueryPlanResponse) - err := c.cc.Invoke(ctx, QANService_GetQueryPlan_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *qANServiceClient) QueryExists(ctx context.Context, in *QueryExistsRequest, opts ...grpc.CallOption) (*QueryExistsResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(QueryExistsResponse) - err := c.cc.Invoke(ctx, QANService_QueryExists_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *qANServiceClient) SchemaByQueryID(ctx context.Context, in *SchemaByQueryIDRequest, opts ...grpc.CallOption) (*SchemaByQueryIDResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(SchemaByQueryIDResponse) - err := c.cc.Invoke(ctx, QANService_SchemaByQueryID_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *qANServiceClient) GetQueryExample(ctx context.Context, in *GetQueryExampleRequest, opts ...grpc.CallOption) (*GetQueryExampleResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetQueryExampleResponse) - err := c.cc.Invoke(ctx, QANService_GetQueryExample_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -// QANServiceServer is the server API for QANService service. -// All implementations must embed UnimplementedQANServiceServer -// for forward compatibility. -// -// QANService provides an API to interact with PMM Query Analytics. -type QANServiceServer interface { - // GetReport returns a list of metrics grouped by queryid or other dimensions. - GetReport(context.Context, *GetReportRequest) (*GetReportResponse, error) - // Get provides a map of metrics names. - GetFilteredMetricsNames(context.Context, *GetFilteredMetricsNamesRequest) (*GetFilteredMetricsNamesResponse, error) - // GetMetricsNames provides a map of metrics names. - GetMetricsNames(context.Context, *GetMetricsNamesRequest) (*GetMetricsNamesResponse, error) - // GetMetrics returns a map of metrics for specific filtering. - GetMetrics(context.Context, *GetMetricsRequest) (*GetMetricsResponse, error) - // GetLabels return a list of labels for object details. - GetLabels(context.Context, *GetLabelsRequest) (*GetLabelsResponse, error) - // GetHistogram returns histogram items for specific filtering. - GetHistogram(context.Context, *GetHistogramRequest) (*GetHistogramResponse, error) - // ExplainFingerprintByQueryID returns an explain fingerprint for given query ID. - ExplainFingerprintByQueryID(context.Context, *ExplainFingerprintByQueryIDRequest) (*ExplainFingerprintByQueryIDResponse, error) - // GetQueryPlan returns a query plan and plan id for specific filtering. - GetQueryPlan(context.Context, *GetQueryPlanRequest) (*GetQueryPlanResponse, error) - // QueryExists checks if query exists in clickhouse. - QueryExists(context.Context, *QueryExistsRequest) (*QueryExistsResponse, error) - // SchemaByQueryID returns the schema for a given queryID and serviceID. - SchemaByQueryID(context.Context, *SchemaByQueryIDRequest) (*SchemaByQueryIDResponse, error) - // GetQueryExample returns a list of query examples. - GetQueryExample(context.Context, *GetQueryExampleRequest) (*GetQueryExampleResponse, error) - mustEmbedUnimplementedQANServiceServer() -} - -// UnimplementedQANServiceServer must be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -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) mustEmbedUnimplementedQANServiceServer() {} -func (UnimplementedQANServiceServer) testEmbeddedByValue() {} - -// UnsafeQANServiceServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to QANServiceServer will -// result in compilation errors. -type UnsafeQANServiceServer interface { - mustEmbedUnimplementedQANServiceServer() -} - -func RegisterQANServiceServer(s grpc.ServiceRegistrar, srv QANServiceServer) { - // If the following call panics, it indicates UnimplementedQANServiceServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } - s.RegisterService(&QANService_ServiceDesc, srv) -} - -func _QANService_GetReport_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetReportRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QANServiceServer).GetReport(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: QANService_GetReport_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QANServiceServer).GetReport(ctx, req.(*GetReportRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _QANService_GetFilteredMetricsNames_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetFilteredMetricsNamesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QANServiceServer).GetFilteredMetricsNames(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: QANService_GetFilteredMetricsNames_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QANServiceServer).GetFilteredMetricsNames(ctx, req.(*GetFilteredMetricsNamesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _QANService_GetMetricsNames_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetMetricsNamesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QANServiceServer).GetMetricsNames(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: QANService_GetMetricsNames_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QANServiceServer).GetMetricsNames(ctx, req.(*GetMetricsNamesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _QANService_GetMetrics_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetMetricsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QANServiceServer).GetMetrics(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: QANService_GetMetrics_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QANServiceServer).GetMetrics(ctx, req.(*GetMetricsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _QANService_GetLabels_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetLabelsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QANServiceServer).GetLabels(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: QANService_GetLabels_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QANServiceServer).GetLabels(ctx, req.(*GetLabelsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _QANService_GetHistogram_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetHistogramRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QANServiceServer).GetHistogram(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: QANService_GetHistogram_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QANServiceServer).GetHistogram(ctx, req.(*GetHistogramRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _QANService_ExplainFingerprintByQueryID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ExplainFingerprintByQueryIDRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QANServiceServer).ExplainFingerprintByQueryID(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: QANService_ExplainFingerprintByQueryID_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QANServiceServer).ExplainFingerprintByQueryID(ctx, req.(*ExplainFingerprintByQueryIDRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _QANService_GetQueryPlan_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetQueryPlanRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QANServiceServer).GetQueryPlan(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: QANService_GetQueryPlan_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QANServiceServer).GetQueryPlan(ctx, req.(*GetQueryPlanRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _QANService_QueryExists_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryExistsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QANServiceServer).QueryExists(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: QANService_QueryExists_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QANServiceServer).QueryExists(ctx, req.(*QueryExistsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _QANService_SchemaByQueryID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SchemaByQueryIDRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QANServiceServer).SchemaByQueryID(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: QANService_SchemaByQueryID_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QANServiceServer).SchemaByQueryID(ctx, req.(*SchemaByQueryIDRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _QANService_GetQueryExample_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetQueryExampleRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QANServiceServer).GetQueryExample(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: QANService_GetQueryExample_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QANServiceServer).GetQueryExample(ctx, req.(*GetQueryExampleRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// QANService_ServiceDesc is the grpc.ServiceDesc for QANService service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var QANService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "qan.v1.QANService", - HandlerType: (*QANServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "GetReport", - Handler: _QANService_GetReport_Handler, - }, - { - MethodName: "GetFilteredMetricsNames", - Handler: _QANService_GetFilteredMetricsNames_Handler, - }, - { - MethodName: "GetMetricsNames", - Handler: _QANService_GetMetricsNames_Handler, - }, - { - MethodName: "GetMetrics", - Handler: _QANService_GetMetrics_Handler, - }, - { - MethodName: "GetLabels", - Handler: _QANService_GetLabels_Handler, - }, - { - MethodName: "GetHistogram", - Handler: _QANService_GetHistogram_Handler, - }, - { - MethodName: "ExplainFingerprintByQueryID", - Handler: _QANService_ExplainFingerprintByQueryID_Handler, - }, - { - MethodName: "GetQueryPlan", - Handler: _QANService_GetQueryPlan_Handler, - }, - { - MethodName: "QueryExists", - Handler: _QANService_QueryExists_Handler, - }, - { - MethodName: "SchemaByQueryID", - Handler: _QANService_SchemaByQueryID_Handler, - }, - { - MethodName: "GetQueryExample", - Handler: _QANService_GetQueryExample_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "qan/v1/service.proto", -} diff --git a/api/server/v1/httperror.pb.go b/api/server/v1/httperror.pb.go deleted file mode 100644 index 89934750fc4..00000000000 --- a/api/server/v1/httperror.pb.go +++ /dev/null @@ -1,162 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.10 -// protoc (unknown) -// source: server/v1/httperror.proto - -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" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// Error is the generic error returned from unary RPCs. -type HttpError struct { - state protoimpl.MessageState `protogen:"open.v1"` - Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` - // This is to make the error more compatible with users that expect errors to be Status objects: - // https://github.com/grpc/grpc/blob/master/src/proto/grpc/status/status.proto - // It should be the exact same message as the Error field. - Code int32 `protobuf:"varint,2,opt,name=code,proto3" json:"code,omitempty"` - Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"` - Details []*anypb.Any `protobuf:"bytes,4,rep,name=details,proto3" json:"details,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *HttpError) Reset() { - *x = HttpError{} - mi := &file_server_v1_httperror_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *HttpError) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*HttpError) ProtoMessage() {} - -func (x *HttpError) ProtoReflect() protoreflect.Message { - mi := &file_server_v1_httperror_proto_msgTypes[0] - 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 HttpError.ProtoReflect.Descriptor instead. -func (*HttpError) Descriptor() ([]byte, []int) { - return file_server_v1_httperror_proto_rawDescGZIP(), []int{0} -} - -func (x *HttpError) GetError() string { - if x != nil { - return x.Error - } - return "" -} - -func (x *HttpError) GetCode() int32 { - if x != nil { - return x.Code - } - return 0 -} - -func (x *HttpError) GetMessage() string { - if x != nil { - return x.Message - } - return "" -} - -func (x *HttpError) GetDetails() []*anypb.Any { - if x != nil { - return x.Details - } - return nil -} - -var File_server_v1_httperror_proto protoreflect.FileDescriptor - -const file_server_v1_httperror_proto_rawDesc = "" + - "\n" + - "\x19server/v1/httperror.proto\x12\tserver.v1\x1a\x19google/protobuf/any.proto\"\x7f\n" + - "\tHttpError\x12\x14\n" + - "\x05error\x18\x01 \x01(\tR\x05error\x12\x12\n" + - "\x04code\x18\x02 \x01(\x05R\x04code\x12\x18\n" + - "\amessage\x18\x03 \x01(\tR\amessage\x12.\n" + - "\adetails\x18\x04 \x03(\v2\x14.google.protobuf.AnyR\adetailsB\x93\x01\n" + - "\rcom.server.v1B\x0eHttperrorProtoP\x01Z-github.com/percona/pmm/api/server/v1;serverv1\xa2\x02\x03SXX\xaa\x02\tServer.V1\xca\x02\tServer\\V1\xe2\x02\x15Server\\V1\\GPBMetadata\xea\x02\n" + - "Server::V1b\x06proto3" - -var ( - file_server_v1_httperror_proto_rawDescOnce sync.Once - file_server_v1_httperror_proto_rawDescData []byte -) - -func file_server_v1_httperror_proto_rawDescGZIP() []byte { - file_server_v1_httperror_proto_rawDescOnce.Do(func() { - file_server_v1_httperror_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_server_v1_httperror_proto_rawDesc), len(file_server_v1_httperror_proto_rawDesc))) - }) - 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_depIdxs = []int32{ - 1, // 0: server.v1.HttpError.details:type_name -> google.protobuf.Any - 1, // [1:1] is the sub-list for method output_type - 1, // [1:1] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name -} - -func init() { file_server_v1_httperror_proto_init() } -func file_server_v1_httperror_proto_init() { - if File_server_v1_httperror_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_server_v1_httperror_proto_rawDesc), len(file_server_v1_httperror_proto_rawDesc)), - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_server_v1_httperror_proto_goTypes, - DependencyIndexes: file_server_v1_httperror_proto_depIdxs, - MessageInfos: file_server_v1_httperror_proto_msgTypes, - }.Build() - File_server_v1_httperror_proto = out.File - file_server_v1_httperror_proto_goTypes = nil - file_server_v1_httperror_proto_depIdxs = nil -} diff --git a/api/server/v1/httperror.pb.validate.go b/api/server/v1/httperror.pb.validate.go deleted file mode 100644 index 81217e496fb..00000000000 --- a/api/server/v1/httperror.pb.validate.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by protoc-gen-validate. DO NOT EDIT. -// source: server/v1/httperror.proto - -package serverv1 - -import ( - "bytes" - "errors" - "fmt" - "net" - "net/mail" - "net/url" - "regexp" - "sort" - "strings" - "time" - "unicode/utf8" - - "google.golang.org/protobuf/types/known/anypb" -) - -// ensure the imports are used -var ( - _ = bytes.MinRead - _ = errors.New("") - _ = fmt.Print - _ = utf8.UTFMax - _ = (*regexp.Regexp)(nil) - _ = (*strings.Reader)(nil) - _ = net.IPv4len - _ = time.Duration(0) - _ = (*url.URL)(nil) - _ = (*mail.Address)(nil) - _ = anypb.Any{} - _ = sort.Sort -) - -// Validate checks the field values on HttpError 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 *HttpError) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on HttpError 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 HttpErrorMultiError, or nil -// if none found. -func (m *HttpError) ValidateAll() error { - return m.validate(true) -} - -func (m *HttpError) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Error - - // no validation rules for Code - - // no validation rules for Message - - for idx, item := range m.GetDetails() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, HttpErrorValidationError{ - field: fmt.Sprintf("Details[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, HttpErrorValidationError{ - field: fmt.Sprintf("Details[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return HttpErrorValidationError{ - field: fmt.Sprintf("Details[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - if len(errors) > 0 { - return HttpErrorMultiError(errors) - } - - return nil -} - -// HttpErrorMultiError is an error wrapping multiple validation errors returned -// by HttpError.ValidateAll() if the designated constraints aren't met. -type HttpErrorMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m HttpErrorMultiError) 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 HttpErrorMultiError) AllErrors() []error { return m } - -// HttpErrorValidationError is the validation error returned by -// HttpError.Validate if the designated constraints aren't met. -type HttpErrorValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e HttpErrorValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e HttpErrorValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e HttpErrorValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e HttpErrorValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e HttpErrorValidationError) ErrorName() string { return "HttpErrorValidationError" } - -// Error satisfies the builtin error interface -func (e HttpErrorValidationError) 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 %sHttpError.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = HttpErrorValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = HttpErrorValidationError{} diff --git a/api/server/v1/json/client/pmm_server_api_client.go b/api/server/v1/json/client/pmm_server_api_client.go deleted file mode 100644 index 46b708ab6e9..00000000000 --- a/api/server/v1/json/client/pmm_server_api_client.go +++ /dev/null @@ -1,112 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package client - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/percona/pmm/api/server/v1/json/client/server_service" -) - -// Default PMM server API HTTP client. -var Default = NewHTTPClient(nil) - -const ( - // DefaultHost is the default Host - // found in Meta (info) section of spec file - DefaultHost string = "localhost" - // DefaultBasePath is the default BasePath - // found in Meta (info) section of spec file - DefaultBasePath string = "/" -) - -// DefaultSchemes are the default schemes found in Meta (info) section of spec file -var DefaultSchemes = []string{"http", "https"} - -// NewHTTPClient creates a new PMM server API HTTP client. -func NewHTTPClient(formats strfmt.Registry) *PMMServerAPI { - return NewHTTPClientWithConfig(formats, nil) -} - -// NewHTTPClientWithConfig creates a new PMM server API HTTP client, -// using a customizable transport config. -func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *PMMServerAPI { - // ensure nullable parameters have default - if cfg == nil { - cfg = DefaultTransportConfig() - } - - // create transport and client - transport := httptransport.New(cfg.Host, cfg.BasePath, cfg.Schemes) - return New(transport, formats) -} - -// New creates a new PMM server API client -func New(transport runtime.ClientTransport, formats strfmt.Registry) *PMMServerAPI { - // ensure nullable parameters have default - if formats == nil { - formats = strfmt.Default - } - - cli := new(PMMServerAPI) - cli.Transport = transport - cli.ServerService = server_service.New(transport, formats) - return cli -} - -// DefaultTransportConfig creates a TransportConfig with the -// default settings taken from the meta section of the spec file. -func DefaultTransportConfig() *TransportConfig { - return &TransportConfig{ - Host: DefaultHost, - BasePath: DefaultBasePath, - Schemes: DefaultSchemes, - } -} - -// TransportConfig contains the transport related info, -// found in the meta section of the spec file. -type TransportConfig struct { - Host string - BasePath string - Schemes []string -} - -// WithHost overrides the default host, -// provided by the meta section of the spec file. -func (cfg *TransportConfig) WithHost(host string) *TransportConfig { - cfg.Host = host - return cfg -} - -// WithBasePath overrides the default basePath, -// provided by the meta section of the spec file. -func (cfg *TransportConfig) WithBasePath(basePath string) *TransportConfig { - cfg.BasePath = basePath - return cfg -} - -// WithSchemes overrides the default schemes, -// provided by the meta section of the spec file. -func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig { - cfg.Schemes = schemes - return cfg -} - -// PMMServerAPI is a client for PMM server API -type PMMServerAPI struct { - ServerService server_service.ClientService - - Transport runtime.ClientTransport -} - -// SetTransport changes the transport on the client and all its subresources -func (c *PMMServerAPI) SetTransport(transport runtime.ClientTransport) { - c.Transport = transport - c.ServerService.SetTransport(transport) -} diff --git a/api/server/v1/json/client/server_service/change_settings_parameters.go b/api/server/v1/json/client/server_service/change_settings_parameters.go deleted file mode 100644 index 12afd77da38..00000000000 --- a/api/server/v1/json/client/server_service/change_settings_parameters.go +++ /dev/null @@ -1,144 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package server_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" -) - -// NewChangeSettingsParams creates a new ChangeSettingsParams 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 NewChangeSettingsParams() *ChangeSettingsParams { - return &ChangeSettingsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewChangeSettingsParamsWithTimeout creates a new ChangeSettingsParams object -// with the ability to set a timeout on a request. -func NewChangeSettingsParamsWithTimeout(timeout time.Duration) *ChangeSettingsParams { - return &ChangeSettingsParams{ - timeout: timeout, - } -} - -// NewChangeSettingsParamsWithContext creates a new ChangeSettingsParams object -// with the ability to set a context for a request. -func NewChangeSettingsParamsWithContext(ctx context.Context) *ChangeSettingsParams { - return &ChangeSettingsParams{ - Context: ctx, - } -} - -// NewChangeSettingsParamsWithHTTPClient creates a new ChangeSettingsParams object -// with the ability to set a custom HTTPClient for a request. -func NewChangeSettingsParamsWithHTTPClient(client *http.Client) *ChangeSettingsParams { - return &ChangeSettingsParams{ - HTTPClient: client, - } -} - -/* -ChangeSettingsParams contains all the parameters to send to the API endpoint - - for the change settings operation. - - Typically these are written to a http.Request. -*/ -type ChangeSettingsParams struct { - // Body. - Body ChangeSettingsBody - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the change settings params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ChangeSettingsParams) WithDefaults() *ChangeSettingsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the change settings params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ChangeSettingsParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the change settings params -func (o *ChangeSettingsParams) WithTimeout(timeout time.Duration) *ChangeSettingsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the change settings params -func (o *ChangeSettingsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the change settings params -func (o *ChangeSettingsParams) WithContext(ctx context.Context) *ChangeSettingsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the change settings params -func (o *ChangeSettingsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the change settings params -func (o *ChangeSettingsParams) WithHTTPClient(client *http.Client) *ChangeSettingsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the change settings params -func (o *ChangeSettingsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the change settings params -func (o *ChangeSettingsParams) WithBody(body ChangeSettingsBody) *ChangeSettingsParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the change settings params -func (o *ChangeSettingsParams) SetBody(body ChangeSettingsBody) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *ChangeSettingsParams) 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/server/v1/json/client/server_service/change_settings_responses.go b/api/server/v1/json/client/server_service/change_settings_responses.go deleted file mode 100644 index 1efe52428a6..00000000000 --- a/api/server/v1/json/client/server_service/change_settings_responses.go +++ /dev/null @@ -1,1357 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package server_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" -) - -// ChangeSettingsReader is a Reader for the ChangeSettings structure. -type ChangeSettingsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ChangeSettingsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewChangeSettingsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewChangeSettingsDefault(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 - } -} - -// NewChangeSettingsOK creates a ChangeSettingsOK with default headers values -func NewChangeSettingsOK() *ChangeSettingsOK { - return &ChangeSettingsOK{} -} - -/* -ChangeSettingsOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type ChangeSettingsOK struct { - Payload *ChangeSettingsOKBody -} - -// IsSuccess returns true when this change settings Ok response has a 2xx status code -func (o *ChangeSettingsOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this change settings Ok response has a 3xx status code -func (o *ChangeSettingsOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this change settings Ok response has a 4xx status code -func (o *ChangeSettingsOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this change settings Ok response has a 5xx status code -func (o *ChangeSettingsOK) IsServerError() bool { - return false -} - -// IsCode returns true when this change settings Ok response a status code equal to that given -func (o *ChangeSettingsOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the change settings Ok response -func (o *ChangeSettingsOK) Code() int { - return 200 -} - -func (o *ChangeSettingsOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/server/settings][%d] changeSettingsOk %s", 200, payload) -} - -func (o *ChangeSettingsOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/server/settings][%d] changeSettingsOk %s", 200, payload) -} - -func (o *ChangeSettingsOK) GetPayload() *ChangeSettingsOKBody { - return o.Payload -} - -func (o *ChangeSettingsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(ChangeSettingsOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -// NewChangeSettingsDefault creates a ChangeSettingsDefault with default headers values -func NewChangeSettingsDefault(code int) *ChangeSettingsDefault { - return &ChangeSettingsDefault{ - _statusCode: code, - } -} - -/* -ChangeSettingsDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type ChangeSettingsDefault struct { - _statusCode int - - Payload *ChangeSettingsDefaultBody -} - -// IsSuccess returns true when this change settings default response has a 2xx status code -func (o *ChangeSettingsDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this change settings default response has a 3xx status code -func (o *ChangeSettingsDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this change settings default response has a 4xx status code -func (o *ChangeSettingsDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this change settings default response has a 5xx status code -func (o *ChangeSettingsDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this change settings default response a status code equal to that given -func (o *ChangeSettingsDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the change settings default response -func (o *ChangeSettingsDefault) Code() int { - return o._statusCode -} - -func (o *ChangeSettingsDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/server/settings][%d] ChangeSettings default %s", o._statusCode, payload) -} - -func (o *ChangeSettingsDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/server/settings][%d] ChangeSettings default %s", o._statusCode, payload) -} - -func (o *ChangeSettingsDefault) GetPayload() *ChangeSettingsDefaultBody { - return o.Payload -} - -func (o *ChangeSettingsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(ChangeSettingsDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -ChangeSettingsBody change settings body -swagger:model ChangeSettingsBody -*/ -type ChangeSettingsBody struct { - // enable updates - EnableUpdates *bool `json:"enable_updates,omitempty"` - - // enable telemetry - EnableTelemetry *bool `json:"enable_telemetry,omitempty"` - - // A number of full days for Prometheus and QAN data retention. Should have a suffix in JSON: 2592000s, 43200m, 720h. - DataRetention string `json:"data_retention,omitempty"` - - // ssh key - SSHKey *string `json:"ssh_key,omitempty"` - - // Enable Advisor. - EnableAdvisor *bool `json:"enable_advisor,omitempty"` - - // Enable Alerting. - EnableAlerting *bool `json:"enable_alerting,omitempty"` - - // PMM Server public address. - PMMPublicAddress *string `json:"pmm_public_address,omitempty"` - - // Enable Azure Discover. - EnableAzurediscover *bool `json:"enable_azurediscover,omitempty"` - - // Enable Backup Management. - EnableBackupManagement *bool `json:"enable_backup_management,omitempty"` - - // Enable Access Control - EnableAccessControl *bool `json:"enable_access_control,omitempty"` - - // Enable Query Analytics for PMM's internal PG database. - EnableInternalPgQAN *bool `json:"enable_internal_pg_qan,omitempty"` - - // A number of full days for which an update is snoozed, i.e. a multiple of 24h: 2592000s, 43200m, 720h. - UpdateSnoozeDuration string `json:"update_snooze_duration,omitempty"` - - // advisor run intervals - AdvisorRunIntervals *ChangeSettingsParamsBodyAdvisorRunIntervals `json:"advisor_run_intervals,omitempty"` - - // aws partitions - AWSPartitions *ChangeSettingsParamsBodyAWSPartitions `json:"aws_partitions,omitempty"` - - // metrics resolutions - MetricsResolutions *ChangeSettingsParamsBodyMetricsResolutions `json:"metrics_resolutions,omitempty"` -} - -// Validate validates this change settings body -func (o *ChangeSettingsBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateAdvisorRunIntervals(formats); err != nil { - res = append(res, err) - } - - if err := o.validateAWSPartitions(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 -} - -func (o *ChangeSettingsBody) validateAdvisorRunIntervals(formats strfmt.Registry) error { - if swag.IsZero(o.AdvisorRunIntervals) { // not required - return nil - } - - if o.AdvisorRunIntervals != nil { - if err := o.AdvisorRunIntervals.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "advisor_run_intervals") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "advisor_run_intervals") - } - - return err - } - } - - return nil -} - -func (o *ChangeSettingsBody) validateAWSPartitions(formats strfmt.Registry) error { - if swag.IsZero(o.AWSPartitions) { // not required - return nil - } - - if o.AWSPartitions != nil { - if err := o.AWSPartitions.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "aws_partitions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "aws_partitions") - } - - return err - } - } - - return nil -} - -func (o *ChangeSettingsBody) 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("body" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this change settings body based on the context it is used -func (o *ChangeSettingsBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateAdvisorRunIntervals(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateAWSPartitions(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateMetricsResolutions(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ChangeSettingsBody) contextValidateAdvisorRunIntervals(ctx context.Context, formats strfmt.Registry) error { - if o.AdvisorRunIntervals != nil { - - if swag.IsZero(o.AdvisorRunIntervals) { // not required - return nil - } - - if err := o.AdvisorRunIntervals.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "advisor_run_intervals") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "advisor_run_intervals") - } - - return err - } - } - - return nil -} - -func (o *ChangeSettingsBody) contextValidateAWSPartitions(ctx context.Context, formats strfmt.Registry) error { - if o.AWSPartitions != nil { - - if swag.IsZero(o.AWSPartitions) { // not required - return nil - } - - if err := o.AWSPartitions.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "aws_partitions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "aws_partitions") - } - - return err - } - } - - return nil -} - -func (o *ChangeSettingsBody) 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 { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("body" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("body" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeSettingsBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeSettingsBody) UnmarshalBinary(b []byte) error { - var res ChangeSettingsBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeSettingsDefaultBody change settings default body -swagger:model ChangeSettingsDefaultBody -*/ -type ChangeSettingsDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*ChangeSettingsDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this change settings default body -func (o *ChangeSettingsDefaultBody) 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 *ChangeSettingsDefaultBody) 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("ChangeSettings default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("ChangeSettings default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this change settings default body based on the context it is used -func (o *ChangeSettingsDefaultBody) 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 *ChangeSettingsDefaultBody) 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("ChangeSettings default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("ChangeSettings default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeSettingsDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeSettingsDefaultBody) UnmarshalBinary(b []byte) error { - var res ChangeSettingsDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeSettingsDefaultBodyDetailsItems0 `Any` contains an arbitrary serialized protocol buffer message along with a -// URL that describes the type of the serialized message. -// -// Protobuf library provides support to pack/unpack Any values in the form -// of utility functions or additional generated methods of the Any type. -// -// Example 1: Pack and unpack a message in C++. -// -// Foo foo = ...; -// Any any; -// any.PackFrom(foo); -// ... -// if (any.UnpackTo(&foo)) { -// ... -// } -// -// Example 2: Pack and unpack a message in Java. -// -// Foo foo = ...; -// Any any = Any.pack(foo); -// ... -// if (any.is(Foo.class)) { -// foo = any.unpack(Foo.class); -// } -// // or ... -// if (any.isSameTypeAs(Foo.getDefaultInstance())) { -// foo = any.unpack(Foo.getDefaultInstance()); -// } -// -// Example 3: Pack and unpack a message in Python. -// -// foo = Foo(...) -// any = Any() -// any.Pack(foo) -// ... -// if any.Is(Foo.DESCRIPTOR): -// any.Unpack(foo) -// ... -// -// Example 4: Pack and unpack a message in Go -// -// foo := &pb.Foo{...} -// any, err := anypb.New(foo) -// if err != nil { -// ... -// } -// ... -// foo := &pb.Foo{} -// if err := any.UnmarshalTo(foo); err != nil { -// ... -// } -// -// The pack methods provided by protobuf library will by default use -// 'type.googleapis.com/full.type.name' as the type URL and the unpack -// methods only use the fully qualified type name after the last '/' -// in the type URL, for example "foo.bar.com/x/y.z" will yield type -// name "y.z". -// -// JSON -// ==== -// The JSON representation of an `Any` value uses the regular -// representation of the deserialized, embedded message, with an -// additional field `@type` which contains the type URL. Example: -// -// package google.profile; -// message Person { -// string first_name = 1; -// string last_name = 2; -// } -// -// { -// "@type": "type.googleapis.com/google.profile.Person", -// "firstName": , -// "lastName": -// } -// -// If the embedded message type is well-known and has a custom JSON -// representation, that representation will be embedded adding a field -// `value` which holds the custom JSON in addition to the `@type` -// field. Example (for message [google.protobuf.Duration][]): -// -// { -// "@type": "type.googleapis.com/google.protobuf.Duration", -// "value": "1.212s" -// } -swagger:model ChangeSettingsDefaultBodyDetailsItems0 -*/ -type ChangeSettingsDefaultBodyDetailsItems0 struct { - // A URL/resource name that uniquely identifies the type of the serialized - // protocol buffer message. This string must contain at least - // one "/" character. The last segment of the URL's path must represent - // the fully qualified name of the type (as in - // `path/google.protobuf.Duration`). The name should be in a canonical form - // (e.g., leading "." is not accepted). - // - // In practice, teams usually precompile into the binary all types that they - // expect it to use in the context of Any. However, for URLs which use the - // scheme `http`, `https`, or no scheme, one can optionally set up a type - // server that maps type URLs to message definitions as follows: - // - // * If no scheme is provided, `https` is assumed. - // * An HTTP GET on the URL must yield a [google.protobuf.Type][] - // value in binary format, or produce an error. - // * Applications are allowed to cache lookup results based on the - // URL, or have them precompiled into a binary to avoid any - // lookup. Therefore, binary compatibility needs to be preserved - // on changes to types. (Use versioned type names to manage - // breaking changes.) - // - // Note: this functionality is not currently available in the official - // protobuf release, and it is not used for type URLs beginning with - // type.googleapis.com. As of May 2023, there are no widely used type server - // implementations and no plans to implement one. - // - // Schemes other than `http`, `https` (or the empty scheme) might be - // used with implementation specific semantics. - AtType string `json:"@type,omitempty"` - - // change settings default body details items0 - ChangeSettingsDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *ChangeSettingsDefaultBodyDetailsItems0) UnmarshalJSON(data []byte) error { - // stage 1, bind the properties - var stage1 struct { - // A URL/resource name that uniquely identifies the type of the serialized - // protocol buffer message. This string must contain at least - // one "/" character. The last segment of the URL's path must represent - // the fully qualified name of the type (as in - // `path/google.protobuf.Duration`). The name should be in a canonical form - // (e.g., leading "." is not accepted). - // - // In practice, teams usually precompile into the binary all types that they - // expect it to use in the context of Any. However, for URLs which use the - // scheme `http`, `https`, or no scheme, one can optionally set up a type - // server that maps type URLs to message definitions as follows: - // - // * If no scheme is provided, `https` is assumed. - // * An HTTP GET on the URL must yield a [google.protobuf.Type][] - // value in binary format, or produce an error. - // * Applications are allowed to cache lookup results based on the - // URL, or have them precompiled into a binary to avoid any - // lookup. Therefore, binary compatibility needs to be preserved - // on changes to types. (Use versioned type names to manage - // breaking changes.) - // - // Note: this functionality is not currently available in the official - // protobuf release, and it is not used for type URLs beginning with - // type.googleapis.com. As of May 2023, there are no widely used type server - // implementations and no plans to implement one. - // - // Schemes other than `http`, `https` (or the empty scheme) might be - // used with implementation specific semantics. - AtType string `json:"@type,omitempty"` - } - if err := json.Unmarshal(data, &stage1); err != nil { - return err - } - var rcv ChangeSettingsDefaultBodyDetailsItems0 - - 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.ChangeSettingsDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o ChangeSettingsDefaultBodyDetailsItems0) MarshalJSON() ([]byte, error) { - var stage1 struct { - // A URL/resource name that uniquely identifies the type of the serialized - // protocol buffer message. This string must contain at least - // one "/" character. The last segment of the URL's path must represent - // the fully qualified name of the type (as in - // `path/google.protobuf.Duration`). The name should be in a canonical form - // (e.g., leading "." is not accepted). - // - // In practice, teams usually precompile into the binary all types that they - // expect it to use in the context of Any. However, for URLs which use the - // scheme `http`, `https`, or no scheme, one can optionally set up a type - // server that maps type URLs to message definitions as follows: - // - // * If no scheme is provided, `https` is assumed. - // * An HTTP GET on the URL must yield a [google.protobuf.Type][] - // value in binary format, or produce an error. - // * Applications are allowed to cache lookup results based on the - // URL, or have them precompiled into a binary to avoid any - // lookup. Therefore, binary compatibility needs to be preserved - // on changes to types. (Use versioned type names to manage - // breaking changes.) - // - // Note: this functionality is not currently available in the official - // protobuf release, and it is not used for type URLs beginning with - // type.googleapis.com. As of May 2023, there are no widely used type server - // implementations and no plans to implement one. - // - // Schemes other than `http`, `https` (or the empty scheme) might be - // used with implementation specific semantics. - 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.ChangeSettingsDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.ChangeSettingsDefaultBodyDetailsItems0) - 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 change settings default body details items0 -func (o *ChangeSettingsDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this change settings default body details items0 based on context it is used -func (o *ChangeSettingsDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeSettingsDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeSettingsDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res ChangeSettingsDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeSettingsOKBody change settings OK body -swagger:model ChangeSettingsOKBody -*/ -type ChangeSettingsOKBody struct { - // settings - Settings *ChangeSettingsOKBodySettings `json:"settings,omitempty"` -} - -// Validate validates this change settings OK body -func (o *ChangeSettingsOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateSettings(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ChangeSettingsOKBody) validateSettings(formats strfmt.Registry) error { - if swag.IsZero(o.Settings) { // not required - return nil - } - - if o.Settings != nil { - if err := o.Settings.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("changeSettingsOk" + "." + "settings") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("changeSettingsOk" + "." + "settings") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this change settings OK body based on the context it is used -func (o *ChangeSettingsOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateSettings(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ChangeSettingsOKBody) contextValidateSettings(ctx context.Context, formats strfmt.Registry) error { - if o.Settings != nil { - - if swag.IsZero(o.Settings) { // not required - return nil - } - - if err := o.Settings.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("changeSettingsOk" + "." + "settings") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("changeSettingsOk" + "." + "settings") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeSettingsOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeSettingsOKBody) UnmarshalBinary(b []byte) error { - var res ChangeSettingsOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeSettingsOKBodySettings Settings represents PMM Server settings. -swagger:model ChangeSettingsOKBodySettings -*/ -type ChangeSettingsOKBodySettings struct { - // True if updates are enabled. - UpdatesEnabled bool `json:"updates_enabled,omitempty"` - - // True if telemetry is enabled. - TelemetryEnabled bool `json:"telemetry_enabled,omitempty"` - - // data retention - DataRetention string `json:"data_retention,omitempty"` - - // ssh key - SSHKey string `json:"ssh_key,omitempty"` - - // aws partitions - AWSPartitions []string `json:"aws_partitions"` - - // True if Advisor is enabled. - AdvisorEnabled bool `json:"advisor_enabled,omitempty"` - - // Percona Platform user's email, if this PMM instance is linked to the Platform. - PlatformEmail string `json:"platform_email,omitempty"` - - // True if Alerting is enabled. - AlertingEnabled bool `json:"alerting_enabled,omitempty"` - - // PMM Server public address. - PMMPublicAddress string `json:"pmm_public_address,omitempty"` - - // True if Backup Management is enabled. - BackupManagementEnabled bool `json:"backup_management_enabled,omitempty"` - - // True if Azure Discover is enabled. - AzurediscoverEnabled bool `json:"azurediscover_enabled,omitempty"` - - // True if the PMM instance is connected to Platform - ConnectedToPlatform bool `json:"connected_to_platform,omitempty"` - - // Includes list of collected telemetry - TelemetrySummaries []string `json:"telemetry_summaries"` - - // True if Access Control is enabled. - EnableAccessControl bool `json:"enable_access_control,omitempty"` - - // Default Access Control role ID for new users. - DefaultRoleID int64 `json:"default_role_id,omitempty"` - - // True if Query Analytics for PMM's internal PG database is enabled. - EnableInternalPgQAN bool `json:"enable_internal_pg_qan,omitempty"` - - // Duration for which an update is snoozed - UpdateSnoozeDuration string `json:"update_snooze_duration,omitempty"` - - // advisor run intervals - AdvisorRunIntervals *ChangeSettingsOKBodySettingsAdvisorRunIntervals `json:"advisor_run_intervals,omitempty"` - - // metrics resolutions - MetricsResolutions *ChangeSettingsOKBodySettingsMetricsResolutions `json:"metrics_resolutions,omitempty"` -} - -// Validate validates this change settings OK body settings -func (o *ChangeSettingsOKBodySettings) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateAdvisorRunIntervals(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 -} - -func (o *ChangeSettingsOKBodySettings) validateAdvisorRunIntervals(formats strfmt.Registry) error { - if swag.IsZero(o.AdvisorRunIntervals) { // not required - return nil - } - - if o.AdvisorRunIntervals != nil { - if err := o.AdvisorRunIntervals.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("changeSettingsOk" + "." + "settings" + "." + "advisor_run_intervals") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("changeSettingsOk" + "." + "settings" + "." + "advisor_run_intervals") - } - - return err - } - } - - return nil -} - -func (o *ChangeSettingsOKBodySettings) 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("changeSettingsOk" + "." + "settings" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("changeSettingsOk" + "." + "settings" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this change settings OK body settings based on the context it is used -func (o *ChangeSettingsOKBodySettings) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateAdvisorRunIntervals(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateMetricsResolutions(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ChangeSettingsOKBodySettings) contextValidateAdvisorRunIntervals(ctx context.Context, formats strfmt.Registry) error { - if o.AdvisorRunIntervals != nil { - - if swag.IsZero(o.AdvisorRunIntervals) { // not required - return nil - } - - if err := o.AdvisorRunIntervals.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("changeSettingsOk" + "." + "settings" + "." + "advisor_run_intervals") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("changeSettingsOk" + "." + "settings" + "." + "advisor_run_intervals") - } - - return err - } - } - - return nil -} - -func (o *ChangeSettingsOKBodySettings) 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 { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("changeSettingsOk" + "." + "settings" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("changeSettingsOk" + "." + "settings" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeSettingsOKBodySettings) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeSettingsOKBodySettings) UnmarshalBinary(b []byte) error { - var res ChangeSettingsOKBodySettings - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeSettingsOKBodySettingsAdvisorRunIntervals AdvisorRunIntervals represents intervals between each run of Advisor checks. -swagger:model ChangeSettingsOKBodySettingsAdvisorRunIntervals -*/ -type ChangeSettingsOKBodySettingsAdvisorRunIntervals struct { - // Standard check interval. - StandardInterval string `json:"standard_interval,omitempty"` - - // Interval for rare check runs. - RareInterval string `json:"rare_interval,omitempty"` - - // Interval for frequent check runs. - FrequentInterval string `json:"frequent_interval,omitempty"` -} - -// Validate validates this change settings OK body settings advisor run intervals -func (o *ChangeSettingsOKBodySettingsAdvisorRunIntervals) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this change settings OK body settings advisor run intervals based on context it is used -func (o *ChangeSettingsOKBodySettingsAdvisorRunIntervals) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeSettingsOKBodySettingsAdvisorRunIntervals) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeSettingsOKBodySettingsAdvisorRunIntervals) UnmarshalBinary(b []byte) error { - var res ChangeSettingsOKBodySettingsAdvisorRunIntervals - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeSettingsOKBodySettingsMetricsResolutions MetricsResolutions represents Prometheus exporters metrics resolutions. -swagger:model ChangeSettingsOKBodySettingsMetricsResolutions -*/ -type ChangeSettingsOKBodySettingsMetricsResolutions struct { - // High resolution. Should have a suffix in JSON: 1s, 1m, 1h. - Hr string `json:"hr,omitempty"` - - // Medium resolution. Should have a suffix in JSON: 1s, 1m, 1h. - Mr string `json:"mr,omitempty"` - - // Low resolution. Should have a suffix in JSON: 1s, 1m, 1h. - Lr string `json:"lr,omitempty"` -} - -// Validate validates this change settings OK body settings metrics resolutions -func (o *ChangeSettingsOKBodySettingsMetricsResolutions) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this change settings OK body settings metrics resolutions based on context it is used -func (o *ChangeSettingsOKBodySettingsMetricsResolutions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeSettingsOKBodySettingsMetricsResolutions) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeSettingsOKBodySettingsMetricsResolutions) UnmarshalBinary(b []byte) error { - var res ChangeSettingsOKBodySettingsMetricsResolutions - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeSettingsParamsBodyAWSPartitions A wrapper for a string array. This type allows to distinguish between an empty array and a null value. -swagger:model ChangeSettingsParamsBodyAWSPartitions -*/ -type ChangeSettingsParamsBodyAWSPartitions struct { - // values - Values []string `json:"values"` -} - -// Validate validates this change settings params body AWS partitions -func (o *ChangeSettingsParamsBodyAWSPartitions) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this change settings params body AWS partitions based on context it is used -func (o *ChangeSettingsParamsBodyAWSPartitions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeSettingsParamsBodyAWSPartitions) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeSettingsParamsBodyAWSPartitions) UnmarshalBinary(b []byte) error { - var res ChangeSettingsParamsBodyAWSPartitions - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeSettingsParamsBodyAdvisorRunIntervals AdvisorRunIntervals represents intervals between each run of Advisor checks. -swagger:model ChangeSettingsParamsBodyAdvisorRunIntervals -*/ -type ChangeSettingsParamsBodyAdvisorRunIntervals struct { - // Standard check interval. - StandardInterval string `json:"standard_interval,omitempty"` - - // Interval for rare check runs. - RareInterval string `json:"rare_interval,omitempty"` - - // Interval for frequent check runs. - FrequentInterval string `json:"frequent_interval,omitempty"` -} - -// Validate validates this change settings params body advisor run intervals -func (o *ChangeSettingsParamsBodyAdvisorRunIntervals) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this change settings params body advisor run intervals based on context it is used -func (o *ChangeSettingsParamsBodyAdvisorRunIntervals) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeSettingsParamsBodyAdvisorRunIntervals) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeSettingsParamsBodyAdvisorRunIntervals) UnmarshalBinary(b []byte) error { - var res ChangeSettingsParamsBodyAdvisorRunIntervals - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeSettingsParamsBodyMetricsResolutions MetricsResolutions represents Prometheus exporters metrics resolutions. -swagger:model ChangeSettingsParamsBodyMetricsResolutions -*/ -type ChangeSettingsParamsBodyMetricsResolutions struct { - // High resolution. Should have a suffix in JSON: 1s, 1m, 1h. - Hr string `json:"hr,omitempty"` - - // Medium resolution. Should have a suffix in JSON: 1s, 1m, 1h. - Mr string `json:"mr,omitempty"` - - // Low resolution. Should have a suffix in JSON: 1s, 1m, 1h. - Lr string `json:"lr,omitempty"` -} - -// Validate validates this change settings params body metrics resolutions -func (o *ChangeSettingsParamsBodyMetricsResolutions) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this change settings params body metrics resolutions based on context it is used -func (o *ChangeSettingsParamsBodyMetricsResolutions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeSettingsParamsBodyMetricsResolutions) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeSettingsParamsBodyMetricsResolutions) UnmarshalBinary(b []byte) error { - var res ChangeSettingsParamsBodyMetricsResolutions - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/server/v1/json/client/server_service/check_updates_parameters.go b/api/server/v1/json/client/server_service/check_updates_parameters.go deleted file mode 100644 index 9bf5b1322dc..00000000000 --- a/api/server/v1/json/client/server_service/check_updates_parameters.go +++ /dev/null @@ -1,194 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package server_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" - "github.com/go-openapi/swag" -) - -// NewCheckUpdatesParams creates a new CheckUpdatesParams 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 NewCheckUpdatesParams() *CheckUpdatesParams { - return &CheckUpdatesParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewCheckUpdatesParamsWithTimeout creates a new CheckUpdatesParams object -// with the ability to set a timeout on a request. -func NewCheckUpdatesParamsWithTimeout(timeout time.Duration) *CheckUpdatesParams { - return &CheckUpdatesParams{ - timeout: timeout, - } -} - -// NewCheckUpdatesParamsWithContext creates a new CheckUpdatesParams object -// with the ability to set a context for a request. -func NewCheckUpdatesParamsWithContext(ctx context.Context) *CheckUpdatesParams { - return &CheckUpdatesParams{ - Context: ctx, - } -} - -// NewCheckUpdatesParamsWithHTTPClient creates a new CheckUpdatesParams object -// with the ability to set a custom HTTPClient for a request. -func NewCheckUpdatesParamsWithHTTPClient(client *http.Client) *CheckUpdatesParams { - return &CheckUpdatesParams{ - HTTPClient: client, - } -} - -/* -CheckUpdatesParams contains all the parameters to send to the API endpoint - - for the check updates operation. - - Typically these are written to a http.Request. -*/ -type CheckUpdatesParams struct { - /* Force. - - If false, cached information may be returned. - */ - Force *bool - - /* OnlyInstalledVersion. - - If true, only installed version will be in response. - */ - OnlyInstalledVersion *bool - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the check updates params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CheckUpdatesParams) WithDefaults() *CheckUpdatesParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the check updates params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CheckUpdatesParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the check updates params -func (o *CheckUpdatesParams) WithTimeout(timeout time.Duration) *CheckUpdatesParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the check updates params -func (o *CheckUpdatesParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the check updates params -func (o *CheckUpdatesParams) WithContext(ctx context.Context) *CheckUpdatesParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the check updates params -func (o *CheckUpdatesParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the check updates params -func (o *CheckUpdatesParams) WithHTTPClient(client *http.Client) *CheckUpdatesParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the check updates params -func (o *CheckUpdatesParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithForce adds the force to the check updates params -func (o *CheckUpdatesParams) WithForce(force *bool) *CheckUpdatesParams { - o.SetForce(force) - return o -} - -// SetForce adds the force to the check updates params -func (o *CheckUpdatesParams) SetForce(force *bool) { - o.Force = force -} - -// WithOnlyInstalledVersion adds the onlyInstalledVersion to the check updates params -func (o *CheckUpdatesParams) WithOnlyInstalledVersion(onlyInstalledVersion *bool) *CheckUpdatesParams { - o.SetOnlyInstalledVersion(onlyInstalledVersion) - return o -} - -// SetOnlyInstalledVersion adds the onlyInstalledVersion to the check updates params -func (o *CheckUpdatesParams) SetOnlyInstalledVersion(onlyInstalledVersion *bool) { - o.OnlyInstalledVersion = onlyInstalledVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *CheckUpdatesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.Force != nil { - - // query param force - var qrForce bool - - if o.Force != nil { - qrForce = *o.Force - } - qForce := swag.FormatBool(qrForce) - if qForce != "" { - if err := r.SetQueryParam("force", qForce); err != nil { - return err - } - } - } - - if o.OnlyInstalledVersion != nil { - - // query param only_installed_version - var qrOnlyInstalledVersion bool - - if o.OnlyInstalledVersion != nil { - qrOnlyInstalledVersion = *o.OnlyInstalledVersion - } - qOnlyInstalledVersion := swag.FormatBool(qrOnlyInstalledVersion) - if qOnlyInstalledVersion != "" { - if err := r.SetQueryParam("only_installed_version", qOnlyInstalledVersion); err != nil { - return err - } - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/api/server/v1/json/client/server_service/check_updates_responses.go b/api/server/v1/json/client/server_service/check_updates_responses.go deleted file mode 100644 index 85b567a990f..00000000000 --- a/api/server/v1/json/client/server_service/check_updates_responses.go +++ /dev/null @@ -1,904 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package server_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" -) - -// CheckUpdatesReader is a Reader for the CheckUpdates structure. -type CheckUpdatesReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *CheckUpdatesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewCheckUpdatesOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewCheckUpdatesDefault(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 - } -} - -// NewCheckUpdatesOK creates a CheckUpdatesOK with default headers values -func NewCheckUpdatesOK() *CheckUpdatesOK { - return &CheckUpdatesOK{} -} - -/* -CheckUpdatesOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type CheckUpdatesOK struct { - Payload *CheckUpdatesOKBody -} - -// IsSuccess returns true when this check updates Ok response has a 2xx status code -func (o *CheckUpdatesOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this check updates Ok response has a 3xx status code -func (o *CheckUpdatesOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this check updates Ok response has a 4xx status code -func (o *CheckUpdatesOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this check updates Ok response has a 5xx status code -func (o *CheckUpdatesOK) IsServerError() bool { - return false -} - -// IsCode returns true when this check updates Ok response a status code equal to that given -func (o *CheckUpdatesOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the check updates Ok response -func (o *CheckUpdatesOK) Code() int { - return 200 -} - -func (o *CheckUpdatesOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/server/updates][%d] checkUpdatesOk %s", 200, payload) -} - -func (o *CheckUpdatesOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/server/updates][%d] checkUpdatesOk %s", 200, payload) -} - -func (o *CheckUpdatesOK) GetPayload() *CheckUpdatesOKBody { - return o.Payload -} - -func (o *CheckUpdatesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(CheckUpdatesOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -// NewCheckUpdatesDefault creates a CheckUpdatesDefault with default headers values -func NewCheckUpdatesDefault(code int) *CheckUpdatesDefault { - return &CheckUpdatesDefault{ - _statusCode: code, - } -} - -/* -CheckUpdatesDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type CheckUpdatesDefault struct { - _statusCode int - - Payload *CheckUpdatesDefaultBody -} - -// IsSuccess returns true when this check updates default response has a 2xx status code -func (o *CheckUpdatesDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this check updates default response has a 3xx status code -func (o *CheckUpdatesDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this check updates default response has a 4xx status code -func (o *CheckUpdatesDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this check updates default response has a 5xx status code -func (o *CheckUpdatesDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this check updates default response a status code equal to that given -func (o *CheckUpdatesDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the check updates default response -func (o *CheckUpdatesDefault) Code() int { - return o._statusCode -} - -func (o *CheckUpdatesDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/server/updates][%d] CheckUpdates default %s", o._statusCode, payload) -} - -func (o *CheckUpdatesDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/server/updates][%d] CheckUpdates default %s", o._statusCode, payload) -} - -func (o *CheckUpdatesDefault) GetPayload() *CheckUpdatesDefaultBody { - return o.Payload -} - -func (o *CheckUpdatesDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(CheckUpdatesDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -CheckUpdatesDefaultBody check updates default body -swagger:model CheckUpdatesDefaultBody -*/ -type CheckUpdatesDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*CheckUpdatesDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this check updates default body -func (o *CheckUpdatesDefaultBody) 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 *CheckUpdatesDefaultBody) 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("CheckUpdates default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("CheckUpdates default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this check updates default body based on the context it is used -func (o *CheckUpdatesDefaultBody) 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 *CheckUpdatesDefaultBody) 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("CheckUpdates default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("CheckUpdates default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *CheckUpdatesDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *CheckUpdatesDefaultBody) UnmarshalBinary(b []byte) error { - var res CheckUpdatesDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -CheckUpdatesDefaultBodyDetailsItems0 `Any` contains an arbitrary serialized protocol buffer message along with a -// URL that describes the type of the serialized message. -// -// Protobuf library provides support to pack/unpack Any values in the form -// of utility functions or additional generated methods of the Any type. -// -// Example 1: Pack and unpack a message in C++. -// -// Foo foo = ...; -// Any any; -// any.PackFrom(foo); -// ... -// if (any.UnpackTo(&foo)) { -// ... -// } -// -// Example 2: Pack and unpack a message in Java. -// -// Foo foo = ...; -// Any any = Any.pack(foo); -// ... -// if (any.is(Foo.class)) { -// foo = any.unpack(Foo.class); -// } -// // or ... -// if (any.isSameTypeAs(Foo.getDefaultInstance())) { -// foo = any.unpack(Foo.getDefaultInstance()); -// } -// -// Example 3: Pack and unpack a message in Python. -// -// foo = Foo(...) -// any = Any() -// any.Pack(foo) -// ... -// if any.Is(Foo.DESCRIPTOR): -// any.Unpack(foo) -// ... -// -// Example 4: Pack and unpack a message in Go -// -// foo := &pb.Foo{...} -// any, err := anypb.New(foo) -// if err != nil { -// ... -// } -// ... -// foo := &pb.Foo{} -// if err := any.UnmarshalTo(foo); err != nil { -// ... -// } -// -// The pack methods provided by protobuf library will by default use -// 'type.googleapis.com/full.type.name' as the type URL and the unpack -// methods only use the fully qualified type name after the last '/' -// in the type URL, for example "foo.bar.com/x/y.z" will yield type -// name "y.z". -// -// JSON -// ==== -// The JSON representation of an `Any` value uses the regular -// representation of the deserialized, embedded message, with an -// additional field `@type` which contains the type URL. Example: -// -// package google.profile; -// message Person { -// string first_name = 1; -// string last_name = 2; -// } -// -// { -// "@type": "type.googleapis.com/google.profile.Person", -// "firstName": , -// "lastName": -// } -// -// If the embedded message type is well-known and has a custom JSON -// representation, that representation will be embedded adding a field -// `value` which holds the custom JSON in addition to the `@type` -// field. Example (for message [google.protobuf.Duration][]): -// -// { -// "@type": "type.googleapis.com/google.protobuf.Duration", -// "value": "1.212s" -// } -swagger:model CheckUpdatesDefaultBodyDetailsItems0 -*/ -type CheckUpdatesDefaultBodyDetailsItems0 struct { - // A URL/resource name that uniquely identifies the type of the serialized - // protocol buffer message. This string must contain at least - // one "/" character. The last segment of the URL's path must represent - // the fully qualified name of the type (as in - // `path/google.protobuf.Duration`). The name should be in a canonical form - // (e.g., leading "." is not accepted). - // - // In practice, teams usually precompile into the binary all types that they - // expect it to use in the context of Any. However, for URLs which use the - // scheme `http`, `https`, or no scheme, one can optionally set up a type - // server that maps type URLs to message definitions as follows: - // - // * If no scheme is provided, `https` is assumed. - // * An HTTP GET on the URL must yield a [google.protobuf.Type][] - // value in binary format, or produce an error. - // * Applications are allowed to cache lookup results based on the - // URL, or have them precompiled into a binary to avoid any - // lookup. Therefore, binary compatibility needs to be preserved - // on changes to types. (Use versioned type names to manage - // breaking changes.) - // - // Note: this functionality is not currently available in the official - // protobuf release, and it is not used for type URLs beginning with - // type.googleapis.com. As of May 2023, there are no widely used type server - // implementations and no plans to implement one. - // - // Schemes other than `http`, `https` (or the empty scheme) might be - // used with implementation specific semantics. - AtType string `json:"@type,omitempty"` - - // check updates default body details items0 - CheckUpdatesDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *CheckUpdatesDefaultBodyDetailsItems0) UnmarshalJSON(data []byte) error { - // stage 1, bind the properties - var stage1 struct { - // A URL/resource name that uniquely identifies the type of the serialized - // protocol buffer message. This string must contain at least - // one "/" character. The last segment of the URL's path must represent - // the fully qualified name of the type (as in - // `path/google.protobuf.Duration`). The name should be in a canonical form - // (e.g., leading "." is not accepted). - // - // In practice, teams usually precompile into the binary all types that they - // expect it to use in the context of Any. However, for URLs which use the - // scheme `http`, `https`, or no scheme, one can optionally set up a type - // server that maps type URLs to message definitions as follows: - // - // * If no scheme is provided, `https` is assumed. - // * An HTTP GET on the URL must yield a [google.protobuf.Type][] - // value in binary format, or produce an error. - // * Applications are allowed to cache lookup results based on the - // URL, or have them precompiled into a binary to avoid any - // lookup. Therefore, binary compatibility needs to be preserved - // on changes to types. (Use versioned type names to manage - // breaking changes.) - // - // Note: this functionality is not currently available in the official - // protobuf release, and it is not used for type URLs beginning with - // type.googleapis.com. As of May 2023, there are no widely used type server - // implementations and no plans to implement one. - // - // Schemes other than `http`, `https` (or the empty scheme) might be - // used with implementation specific semantics. - AtType string `json:"@type,omitempty"` - } - if err := json.Unmarshal(data, &stage1); err != nil { - return err - } - var rcv CheckUpdatesDefaultBodyDetailsItems0 - - 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.CheckUpdatesDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o CheckUpdatesDefaultBodyDetailsItems0) MarshalJSON() ([]byte, error) { - var stage1 struct { - // A URL/resource name that uniquely identifies the type of the serialized - // protocol buffer message. This string must contain at least - // one "/" character. The last segment of the URL's path must represent - // the fully qualified name of the type (as in - // `path/google.protobuf.Duration`). The name should be in a canonical form - // (e.g., leading "." is not accepted). - // - // In practice, teams usually precompile into the binary all types that they - // expect it to use in the context of Any. However, for URLs which use the - // scheme `http`, `https`, or no scheme, one can optionally set up a type - // server that maps type URLs to message definitions as follows: - // - // * If no scheme is provided, `https` is assumed. - // * An HTTP GET on the URL must yield a [google.protobuf.Type][] - // value in binary format, or produce an error. - // * Applications are allowed to cache lookup results based on the - // URL, or have them precompiled into a binary to avoid any - // lookup. Therefore, binary compatibility needs to be preserved - // on changes to types. (Use versioned type names to manage - // breaking changes.) - // - // Note: this functionality is not currently available in the official - // protobuf release, and it is not used for type URLs beginning with - // type.googleapis.com. As of May 2023, there are no widely used type server - // implementations and no plans to implement one. - // - // Schemes other than `http`, `https` (or the empty scheme) might be - // used with implementation specific semantics. - 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.CheckUpdatesDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.CheckUpdatesDefaultBodyDetailsItems0) - 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 check updates default body details items0 -func (o *CheckUpdatesDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this check updates default body details items0 based on context it is used -func (o *CheckUpdatesDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *CheckUpdatesDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *CheckUpdatesDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res CheckUpdatesDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -CheckUpdatesOKBody check updates OK body -swagger:model CheckUpdatesOKBody -*/ -type CheckUpdatesOKBody struct { - // True if there is a PMM Server update available. - UpdateAvailable bool `json:"update_available,omitempty"` - - // Latest available PMM Server release announcement URL. - LatestNewsURL string `json:"latest_news_url,omitempty"` - - // Last check time. - // Format: date-time - LastCheck strfmt.DateTime `json:"last_check,omitempty"` - - // installed - Installed *CheckUpdatesOKBodyInstalled `json:"installed,omitempty"` - - // latest - Latest *CheckUpdatesOKBodyLatest `json:"latest,omitempty"` -} - -// Validate validates this check updates OK body -func (o *CheckUpdatesOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateLastCheck(formats); err != nil { - res = append(res, err) - } - - if err := o.validateInstalled(formats); err != nil { - res = append(res, err) - } - - if err := o.validateLatest(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *CheckUpdatesOKBody) validateLastCheck(formats strfmt.Registry) error { - if swag.IsZero(o.LastCheck) { // not required - return nil - } - - if err := validate.FormatOf("checkUpdatesOk"+"."+"last_check", "body", "date-time", o.LastCheck.String(), formats); err != nil { - return err - } - - return nil -} - -func (o *CheckUpdatesOKBody) validateInstalled(formats strfmt.Registry) error { - if swag.IsZero(o.Installed) { // not required - return nil - } - - if o.Installed != nil { - if err := o.Installed.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("checkUpdatesOk" + "." + "installed") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("checkUpdatesOk" + "." + "installed") - } - - return err - } - } - - return nil -} - -func (o *CheckUpdatesOKBody) validateLatest(formats strfmt.Registry) error { - if swag.IsZero(o.Latest) { // not required - return nil - } - - if o.Latest != nil { - if err := o.Latest.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("checkUpdatesOk" + "." + "latest") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("checkUpdatesOk" + "." + "latest") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this check updates OK body based on the context it is used -func (o *CheckUpdatesOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateInstalled(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateLatest(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *CheckUpdatesOKBody) contextValidateInstalled(ctx context.Context, formats strfmt.Registry) error { - if o.Installed != nil { - - if swag.IsZero(o.Installed) { // not required - return nil - } - - if err := o.Installed.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("checkUpdatesOk" + "." + "installed") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("checkUpdatesOk" + "." + "installed") - } - - return err - } - } - - return nil -} - -func (o *CheckUpdatesOKBody) contextValidateLatest(ctx context.Context, formats strfmt.Registry) error { - if o.Latest != nil { - - if swag.IsZero(o.Latest) { // not required - return nil - } - - if err := o.Latest.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("checkUpdatesOk" + "." + "latest") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("checkUpdatesOk" + "." + "latest") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *CheckUpdatesOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *CheckUpdatesOKBody) UnmarshalBinary(b []byte) error { - var res CheckUpdatesOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -CheckUpdatesOKBodyInstalled VersionInfo describes component version, or PMM Server as a whole. -swagger:model CheckUpdatesOKBodyInstalled -*/ -type CheckUpdatesOKBodyInstalled struct { - // User-visible version. - Version string `json:"version,omitempty"` - - // Full version for debugging. - FullVersion string `json:"full_version,omitempty"` - - // Build or release date. - // Format: date-time - Timestamp strfmt.DateTime `json:"timestamp,omitempty"` -} - -// Validate validates this check updates OK body installed -func (o *CheckUpdatesOKBodyInstalled) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateTimestamp(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *CheckUpdatesOKBodyInstalled) validateTimestamp(formats strfmt.Registry) error { - if swag.IsZero(o.Timestamp) { // not required - return nil - } - - if err := validate.FormatOf("checkUpdatesOk"+"."+"installed"+"."+"timestamp", "body", "date-time", o.Timestamp.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this check updates OK body installed based on context it is used -func (o *CheckUpdatesOKBodyInstalled) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *CheckUpdatesOKBodyInstalled) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *CheckUpdatesOKBodyInstalled) UnmarshalBinary(b []byte) error { - var res CheckUpdatesOKBodyInstalled - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -CheckUpdatesOKBodyLatest check updates OK body latest -swagger:model CheckUpdatesOKBodyLatest -*/ -type CheckUpdatesOKBodyLatest struct { - // PMM Version. - Version string `json:"version,omitempty"` - - // Docker image tag. - Tag string `json:"tag,omitempty"` - - // Release date. - // Format: date-time - Timestamp strfmt.DateTime `json:"timestamp,omitempty"` - - // Release notes URL for the version (if available). - ReleaseNotesURL string `json:"release_notes_url,omitempty"` - - // Release notes text for the version (if available). - ReleaseNotesText string `json:"release_notes_text,omitempty"` -} - -// Validate validates this check updates OK body latest -func (o *CheckUpdatesOKBodyLatest) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateTimestamp(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *CheckUpdatesOKBodyLatest) validateTimestamp(formats strfmt.Registry) error { - if swag.IsZero(o.Timestamp) { // not required - return nil - } - - if err := validate.FormatOf("checkUpdatesOk"+"."+"latest"+"."+"timestamp", "body", "date-time", o.Timestamp.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this check updates OK body latest based on context it is used -func (o *CheckUpdatesOKBodyLatest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *CheckUpdatesOKBodyLatest) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *CheckUpdatesOKBodyLatest) UnmarshalBinary(b []byte) error { - var res CheckUpdatesOKBodyLatest - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/server/v1/json/client/server_service/get_read_only_settings_parameters.go b/api/server/v1/json/client/server_service/get_read_only_settings_parameters.go deleted file mode 100644 index ce14210b120..00000000000 --- a/api/server/v1/json/client/server_service/get_read_only_settings_parameters.go +++ /dev/null @@ -1,127 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package server_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" -) - -// NewGetReadOnlySettingsParams creates a new GetReadOnlySettingsParams 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 NewGetReadOnlySettingsParams() *GetReadOnlySettingsParams { - return &GetReadOnlySettingsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetReadOnlySettingsParamsWithTimeout creates a new GetReadOnlySettingsParams object -// with the ability to set a timeout on a request. -func NewGetReadOnlySettingsParamsWithTimeout(timeout time.Duration) *GetReadOnlySettingsParams { - return &GetReadOnlySettingsParams{ - timeout: timeout, - } -} - -// NewGetReadOnlySettingsParamsWithContext creates a new GetReadOnlySettingsParams object -// with the ability to set a context for a request. -func NewGetReadOnlySettingsParamsWithContext(ctx context.Context) *GetReadOnlySettingsParams { - return &GetReadOnlySettingsParams{ - Context: ctx, - } -} - -// NewGetReadOnlySettingsParamsWithHTTPClient creates a new GetReadOnlySettingsParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetReadOnlySettingsParamsWithHTTPClient(client *http.Client) *GetReadOnlySettingsParams { - return &GetReadOnlySettingsParams{ - HTTPClient: client, - } -} - -/* -GetReadOnlySettingsParams contains all the parameters to send to the API endpoint - - for the get read only settings operation. - - Typically these are written to a http.Request. -*/ -type GetReadOnlySettingsParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get read only settings params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetReadOnlySettingsParams) WithDefaults() *GetReadOnlySettingsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get read only settings params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetReadOnlySettingsParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the get read only settings params -func (o *GetReadOnlySettingsParams) WithTimeout(timeout time.Duration) *GetReadOnlySettingsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get read only settings params -func (o *GetReadOnlySettingsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get read only settings params -func (o *GetReadOnlySettingsParams) WithContext(ctx context.Context) *GetReadOnlySettingsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get read only settings params -func (o *GetReadOnlySettingsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get read only settings params -func (o *GetReadOnlySettingsParams) WithHTTPClient(client *http.Client) *GetReadOnlySettingsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get read only settings params -func (o *GetReadOnlySettingsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *GetReadOnlySettingsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/api/server/v1/json/client/server_service/get_read_only_settings_responses.go b/api/server/v1/json/client/server_service/get_read_only_settings_responses.go deleted file mode 100644 index 31376147ddf..00000000000 --- a/api/server/v1/json/client/server_service/get_read_only_settings_responses.go +++ /dev/null @@ -1,741 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package server_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" -) - -// GetReadOnlySettingsReader is a Reader for the GetReadOnlySettings structure. -type GetReadOnlySettingsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetReadOnlySettingsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewGetReadOnlySettingsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewGetReadOnlySettingsDefault(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 - } -} - -// NewGetReadOnlySettingsOK creates a GetReadOnlySettingsOK with default headers values -func NewGetReadOnlySettingsOK() *GetReadOnlySettingsOK { - return &GetReadOnlySettingsOK{} -} - -/* -GetReadOnlySettingsOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type GetReadOnlySettingsOK struct { - Payload *GetReadOnlySettingsOKBody -} - -// IsSuccess returns true when this get read only settings Ok response has a 2xx status code -func (o *GetReadOnlySettingsOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this get read only settings Ok response has a 3xx status code -func (o *GetReadOnlySettingsOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this get read only settings Ok response has a 4xx status code -func (o *GetReadOnlySettingsOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this get read only settings Ok response has a 5xx status code -func (o *GetReadOnlySettingsOK) IsServerError() bool { - return false -} - -// IsCode returns true when this get read only settings Ok response a status code equal to that given -func (o *GetReadOnlySettingsOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the get read only settings Ok response -func (o *GetReadOnlySettingsOK) Code() int { - return 200 -} - -func (o *GetReadOnlySettingsOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/server/settings/readonly][%d] getReadOnlySettingsOk %s", 200, payload) -} - -func (o *GetReadOnlySettingsOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/server/settings/readonly][%d] getReadOnlySettingsOk %s", 200, payload) -} - -func (o *GetReadOnlySettingsOK) GetPayload() *GetReadOnlySettingsOKBody { - return o.Payload -} - -func (o *GetReadOnlySettingsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(GetReadOnlySettingsOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -// NewGetReadOnlySettingsDefault creates a GetReadOnlySettingsDefault with default headers values -func NewGetReadOnlySettingsDefault(code int) *GetReadOnlySettingsDefault { - return &GetReadOnlySettingsDefault{ - _statusCode: code, - } -} - -/* -GetReadOnlySettingsDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type GetReadOnlySettingsDefault struct { - _statusCode int - - Payload *GetReadOnlySettingsDefaultBody -} - -// IsSuccess returns true when this get read only settings default response has a 2xx status code -func (o *GetReadOnlySettingsDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this get read only settings default response has a 3xx status code -func (o *GetReadOnlySettingsDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this get read only settings default response has a 4xx status code -func (o *GetReadOnlySettingsDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this get read only settings default response has a 5xx status code -func (o *GetReadOnlySettingsDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this get read only settings default response a status code equal to that given -func (o *GetReadOnlySettingsDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the get read only settings default response -func (o *GetReadOnlySettingsDefault) Code() int { - return o._statusCode -} - -func (o *GetReadOnlySettingsDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/server/settings/readonly][%d] GetReadOnlySettings default %s", o._statusCode, payload) -} - -func (o *GetReadOnlySettingsDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/server/settings/readonly][%d] GetReadOnlySettings default %s", o._statusCode, payload) -} - -func (o *GetReadOnlySettingsDefault) GetPayload() *GetReadOnlySettingsDefaultBody { - return o.Payload -} - -func (o *GetReadOnlySettingsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(GetReadOnlySettingsDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -GetReadOnlySettingsDefaultBody get read only settings default body -swagger:model GetReadOnlySettingsDefaultBody -*/ -type GetReadOnlySettingsDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*GetReadOnlySettingsDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this get read only settings default body -func (o *GetReadOnlySettingsDefaultBody) 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 *GetReadOnlySettingsDefaultBody) 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("GetReadOnlySettings default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("GetReadOnlySettings default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this get read only settings default body based on the context it is used -func (o *GetReadOnlySettingsDefaultBody) 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 *GetReadOnlySettingsDefaultBody) 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("GetReadOnlySettings default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("GetReadOnlySettings default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetReadOnlySettingsDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetReadOnlySettingsDefaultBody) UnmarshalBinary(b []byte) error { - var res GetReadOnlySettingsDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetReadOnlySettingsDefaultBodyDetailsItems0 `Any` contains an arbitrary serialized protocol buffer message along with a -// URL that describes the type of the serialized message. -// -// Protobuf library provides support to pack/unpack Any values in the form -// of utility functions or additional generated methods of the Any type. -// -// Example 1: Pack and unpack a message in C++. -// -// Foo foo = ...; -// Any any; -// any.PackFrom(foo); -// ... -// if (any.UnpackTo(&foo)) { -// ... -// } -// -// Example 2: Pack and unpack a message in Java. -// -// Foo foo = ...; -// Any any = Any.pack(foo); -// ... -// if (any.is(Foo.class)) { -// foo = any.unpack(Foo.class); -// } -// // or ... -// if (any.isSameTypeAs(Foo.getDefaultInstance())) { -// foo = any.unpack(Foo.getDefaultInstance()); -// } -// -// Example 3: Pack and unpack a message in Python. -// -// foo = Foo(...) -// any = Any() -// any.Pack(foo) -// ... -// if any.Is(Foo.DESCRIPTOR): -// any.Unpack(foo) -// ... -// -// Example 4: Pack and unpack a message in Go -// -// foo := &pb.Foo{...} -// any, err := anypb.New(foo) -// if err != nil { -// ... -// } -// ... -// foo := &pb.Foo{} -// if err := any.UnmarshalTo(foo); err != nil { -// ... -// } -// -// The pack methods provided by protobuf library will by default use -// 'type.googleapis.com/full.type.name' as the type URL and the unpack -// methods only use the fully qualified type name after the last '/' -// in the type URL, for example "foo.bar.com/x/y.z" will yield type -// name "y.z". -// -// JSON -// ==== -// The JSON representation of an `Any` value uses the regular -// representation of the deserialized, embedded message, with an -// additional field `@type` which contains the type URL. Example: -// -// package google.profile; -// message Person { -// string first_name = 1; -// string last_name = 2; -// } -// -// { -// "@type": "type.googleapis.com/google.profile.Person", -// "firstName": , -// "lastName": -// } -// -// If the embedded message type is well-known and has a custom JSON -// representation, that representation will be embedded adding a field -// `value` which holds the custom JSON in addition to the `@type` -// field. Example (for message [google.protobuf.Duration][]): -// -// { -// "@type": "type.googleapis.com/google.protobuf.Duration", -// "value": "1.212s" -// } -swagger:model GetReadOnlySettingsDefaultBodyDetailsItems0 -*/ -type GetReadOnlySettingsDefaultBodyDetailsItems0 struct { - // A URL/resource name that uniquely identifies the type of the serialized - // protocol buffer message. This string must contain at least - // one "/" character. The last segment of the URL's path must represent - // the fully qualified name of the type (as in - // `path/google.protobuf.Duration`). The name should be in a canonical form - // (e.g., leading "." is not accepted). - // - // In practice, teams usually precompile into the binary all types that they - // expect it to use in the context of Any. However, for URLs which use the - // scheme `http`, `https`, or no scheme, one can optionally set up a type - // server that maps type URLs to message definitions as follows: - // - // * If no scheme is provided, `https` is assumed. - // * An HTTP GET on the URL must yield a [google.protobuf.Type][] - // value in binary format, or produce an error. - // * Applications are allowed to cache lookup results based on the - // URL, or have them precompiled into a binary to avoid any - // lookup. Therefore, binary compatibility needs to be preserved - // on changes to types. (Use versioned type names to manage - // breaking changes.) - // - // Note: this functionality is not currently available in the official - // protobuf release, and it is not used for type URLs beginning with - // type.googleapis.com. As of May 2023, there are no widely used type server - // implementations and no plans to implement one. - // - // Schemes other than `http`, `https` (or the empty scheme) might be - // used with implementation specific semantics. - AtType string `json:"@type,omitempty"` - - // get read only settings default body details items0 - GetReadOnlySettingsDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *GetReadOnlySettingsDefaultBodyDetailsItems0) UnmarshalJSON(data []byte) error { - // stage 1, bind the properties - var stage1 struct { - // A URL/resource name that uniquely identifies the type of the serialized - // protocol buffer message. This string must contain at least - // one "/" character. The last segment of the URL's path must represent - // the fully qualified name of the type (as in - // `path/google.protobuf.Duration`). The name should be in a canonical form - // (e.g., leading "." is not accepted). - // - // In practice, teams usually precompile into the binary all types that they - // expect it to use in the context of Any. However, for URLs which use the - // scheme `http`, `https`, or no scheme, one can optionally set up a type - // server that maps type URLs to message definitions as follows: - // - // * If no scheme is provided, `https` is assumed. - // * An HTTP GET on the URL must yield a [google.protobuf.Type][] - // value in binary format, or produce an error. - // * Applications are allowed to cache lookup results based on the - // URL, or have them precompiled into a binary to avoid any - // lookup. Therefore, binary compatibility needs to be preserved - // on changes to types. (Use versioned type names to manage - // breaking changes.) - // - // Note: this functionality is not currently available in the official - // protobuf release, and it is not used for type URLs beginning with - // type.googleapis.com. As of May 2023, there are no widely used type server - // implementations and no plans to implement one. - // - // Schemes other than `http`, `https` (or the empty scheme) might be - // used with implementation specific semantics. - AtType string `json:"@type,omitempty"` - } - if err := json.Unmarshal(data, &stage1); err != nil { - return err - } - var rcv GetReadOnlySettingsDefaultBodyDetailsItems0 - - 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.GetReadOnlySettingsDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o GetReadOnlySettingsDefaultBodyDetailsItems0) MarshalJSON() ([]byte, error) { - var stage1 struct { - // A URL/resource name that uniquely identifies the type of the serialized - // protocol buffer message. This string must contain at least - // one "/" character. The last segment of the URL's path must represent - // the fully qualified name of the type (as in - // `path/google.protobuf.Duration`). The name should be in a canonical form - // (e.g., leading "." is not accepted). - // - // In practice, teams usually precompile into the binary all types that they - // expect it to use in the context of Any. However, for URLs which use the - // scheme `http`, `https`, or no scheme, one can optionally set up a type - // server that maps type URLs to message definitions as follows: - // - // * If no scheme is provided, `https` is assumed. - // * An HTTP GET on the URL must yield a [google.protobuf.Type][] - // value in binary format, or produce an error. - // * Applications are allowed to cache lookup results based on the - // URL, or have them precompiled into a binary to avoid any - // lookup. Therefore, binary compatibility needs to be preserved - // on changes to types. (Use versioned type names to manage - // breaking changes.) - // - // Note: this functionality is not currently available in the official - // protobuf release, and it is not used for type URLs beginning with - // type.googleapis.com. As of May 2023, there are no widely used type server - // implementations and no plans to implement one. - // - // Schemes other than `http`, `https` (or the empty scheme) might be - // used with implementation specific semantics. - 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.GetReadOnlySettingsDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.GetReadOnlySettingsDefaultBodyDetailsItems0) - 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 get read only settings default body details items0 -func (o *GetReadOnlySettingsDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get read only settings default body details items0 based on context it is used -func (o *GetReadOnlySettingsDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetReadOnlySettingsDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetReadOnlySettingsDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res GetReadOnlySettingsDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetReadOnlySettingsOKBody get read only settings OK body -swagger:model GetReadOnlySettingsOKBody -*/ -type GetReadOnlySettingsOKBody struct { - // settings - Settings *GetReadOnlySettingsOKBodySettings `json:"settings,omitempty"` -} - -// Validate validates this get read only settings OK body -func (o *GetReadOnlySettingsOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateSettings(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetReadOnlySettingsOKBody) validateSettings(formats strfmt.Registry) error { - if swag.IsZero(o.Settings) { // not required - return nil - } - - if o.Settings != nil { - if err := o.Settings.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getReadOnlySettingsOk" + "." + "settings") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getReadOnlySettingsOk" + "." + "settings") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this get read only settings OK body based on the context it is used -func (o *GetReadOnlySettingsOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateSettings(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetReadOnlySettingsOKBody) contextValidateSettings(ctx context.Context, formats strfmt.Registry) error { - if o.Settings != nil { - - if swag.IsZero(o.Settings) { // not required - return nil - } - - if err := o.Settings.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getReadOnlySettingsOk" + "." + "settings") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getReadOnlySettingsOk" + "." + "settings") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetReadOnlySettingsOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetReadOnlySettingsOKBody) UnmarshalBinary(b []byte) error { - var res GetReadOnlySettingsOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetReadOnlySettingsOKBodySettings ReadOnlySettings represents a stripped-down version of PMM Server settings that can be accessed by users of all roles. -swagger:model GetReadOnlySettingsOKBodySettings -*/ -type GetReadOnlySettingsOKBodySettings struct { - // True if updates are enabled. - UpdatesEnabled bool `json:"updates_enabled,omitempty"` - - // True if telemetry is enabled. - TelemetryEnabled bool `json:"telemetry_enabled,omitempty"` - - // True if Advisor is enabled. - AdvisorEnabled bool `json:"advisor_enabled,omitempty"` - - // True if Alerting is enabled. - AlertingEnabled bool `json:"alerting_enabled,omitempty"` - - // PMM Server public address. - PMMPublicAddress string `json:"pmm_public_address,omitempty"` - - // True if Backup Management is enabled. - BackupManagementEnabled bool `json:"backup_management_enabled,omitempty"` - - // True if Azure Discover is enabled. - AzurediscoverEnabled bool `json:"azurediscover_enabled,omitempty"` - - // True if Access Control is enabled. - EnableAccessControl bool `json:"enable_access_control,omitempty"` -} - -// Validate validates this get read only settings OK body settings -func (o *GetReadOnlySettingsOKBodySettings) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get read only settings OK body settings based on context it is used -func (o *GetReadOnlySettingsOKBodySettings) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetReadOnlySettingsOKBodySettings) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetReadOnlySettingsOKBodySettings) UnmarshalBinary(b []byte) error { - var res GetReadOnlySettingsOKBodySettings - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/server/v1/json/client/server_service/get_settings_parameters.go b/api/server/v1/json/client/server_service/get_settings_parameters.go deleted file mode 100644 index a25fa8d3b24..00000000000 --- a/api/server/v1/json/client/server_service/get_settings_parameters.go +++ /dev/null @@ -1,127 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package server_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" -) - -// NewGetSettingsParams creates a new GetSettingsParams 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 NewGetSettingsParams() *GetSettingsParams { - return &GetSettingsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetSettingsParamsWithTimeout creates a new GetSettingsParams object -// with the ability to set a timeout on a request. -func NewGetSettingsParamsWithTimeout(timeout time.Duration) *GetSettingsParams { - return &GetSettingsParams{ - timeout: timeout, - } -} - -// NewGetSettingsParamsWithContext creates a new GetSettingsParams object -// with the ability to set a context for a request. -func NewGetSettingsParamsWithContext(ctx context.Context) *GetSettingsParams { - return &GetSettingsParams{ - Context: ctx, - } -} - -// NewGetSettingsParamsWithHTTPClient creates a new GetSettingsParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetSettingsParamsWithHTTPClient(client *http.Client) *GetSettingsParams { - return &GetSettingsParams{ - HTTPClient: client, - } -} - -/* -GetSettingsParams contains all the parameters to send to the API endpoint - - for the get settings operation. - - Typically these are written to a http.Request. -*/ -type GetSettingsParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get settings params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetSettingsParams) WithDefaults() *GetSettingsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get settings params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetSettingsParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the get settings params -func (o *GetSettingsParams) WithTimeout(timeout time.Duration) *GetSettingsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get settings params -func (o *GetSettingsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get settings params -func (o *GetSettingsParams) WithContext(ctx context.Context) *GetSettingsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get settings params -func (o *GetSettingsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get settings params -func (o *GetSettingsParams) WithHTTPClient(client *http.Client) *GetSettingsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get settings params -func (o *GetSettingsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *GetSettingsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/api/server/v1/json/client/server_service/get_settings_responses.go b/api/server/v1/json/client/server_service/get_settings_responses.go deleted file mode 100644 index 7f7dca6518c..00000000000 --- a/api/server/v1/json/client/server_service/get_settings_responses.go +++ /dev/null @@ -1,980 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package server_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" -) - -// GetSettingsReader is a Reader for the GetSettings structure. -type GetSettingsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetSettingsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewGetSettingsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewGetSettingsDefault(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 - } -} - -// NewGetSettingsOK creates a GetSettingsOK with default headers values -func NewGetSettingsOK() *GetSettingsOK { - return &GetSettingsOK{} -} - -/* -GetSettingsOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type GetSettingsOK struct { - Payload *GetSettingsOKBody -} - -// IsSuccess returns true when this get settings Ok response has a 2xx status code -func (o *GetSettingsOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this get settings Ok response has a 3xx status code -func (o *GetSettingsOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this get settings Ok response has a 4xx status code -func (o *GetSettingsOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this get settings Ok response has a 5xx status code -func (o *GetSettingsOK) IsServerError() bool { - return false -} - -// IsCode returns true when this get settings Ok response a status code equal to that given -func (o *GetSettingsOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the get settings Ok response -func (o *GetSettingsOK) Code() int { - return 200 -} - -func (o *GetSettingsOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/server/settings][%d] getSettingsOk %s", 200, payload) -} - -func (o *GetSettingsOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/server/settings][%d] getSettingsOk %s", 200, payload) -} - -func (o *GetSettingsOK) GetPayload() *GetSettingsOKBody { - return o.Payload -} - -func (o *GetSettingsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(GetSettingsOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -// NewGetSettingsDefault creates a GetSettingsDefault with default headers values -func NewGetSettingsDefault(code int) *GetSettingsDefault { - return &GetSettingsDefault{ - _statusCode: code, - } -} - -/* -GetSettingsDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type GetSettingsDefault struct { - _statusCode int - - Payload *GetSettingsDefaultBody -} - -// IsSuccess returns true when this get settings default response has a 2xx status code -func (o *GetSettingsDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this get settings default response has a 3xx status code -func (o *GetSettingsDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this get settings default response has a 4xx status code -func (o *GetSettingsDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this get settings default response has a 5xx status code -func (o *GetSettingsDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this get settings default response a status code equal to that given -func (o *GetSettingsDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the get settings default response -func (o *GetSettingsDefault) Code() int { - return o._statusCode -} - -func (o *GetSettingsDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/server/settings][%d] GetSettings default %s", o._statusCode, payload) -} - -func (o *GetSettingsDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/server/settings][%d] GetSettings default %s", o._statusCode, payload) -} - -func (o *GetSettingsDefault) GetPayload() *GetSettingsDefaultBody { - return o.Payload -} - -func (o *GetSettingsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(GetSettingsDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -GetSettingsDefaultBody get settings default body -swagger:model GetSettingsDefaultBody -*/ -type GetSettingsDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*GetSettingsDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this get settings default body -func (o *GetSettingsDefaultBody) 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 *GetSettingsDefaultBody) 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("GetSettings default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("GetSettings default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this get settings default body based on the context it is used -func (o *GetSettingsDefaultBody) 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 *GetSettingsDefaultBody) 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("GetSettings default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("GetSettings default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetSettingsDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetSettingsDefaultBody) UnmarshalBinary(b []byte) error { - var res GetSettingsDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetSettingsDefaultBodyDetailsItems0 `Any` contains an arbitrary serialized protocol buffer message along with a -// URL that describes the type of the serialized message. -// -// Protobuf library provides support to pack/unpack Any values in the form -// of utility functions or additional generated methods of the Any type. -// -// Example 1: Pack and unpack a message in C++. -// -// Foo foo = ...; -// Any any; -// any.PackFrom(foo); -// ... -// if (any.UnpackTo(&foo)) { -// ... -// } -// -// Example 2: Pack and unpack a message in Java. -// -// Foo foo = ...; -// Any any = Any.pack(foo); -// ... -// if (any.is(Foo.class)) { -// foo = any.unpack(Foo.class); -// } -// // or ... -// if (any.isSameTypeAs(Foo.getDefaultInstance())) { -// foo = any.unpack(Foo.getDefaultInstance()); -// } -// -// Example 3: Pack and unpack a message in Python. -// -// foo = Foo(...) -// any = Any() -// any.Pack(foo) -// ... -// if any.Is(Foo.DESCRIPTOR): -// any.Unpack(foo) -// ... -// -// Example 4: Pack and unpack a message in Go -// -// foo := &pb.Foo{...} -// any, err := anypb.New(foo) -// if err != nil { -// ... -// } -// ... -// foo := &pb.Foo{} -// if err := any.UnmarshalTo(foo); err != nil { -// ... -// } -// -// The pack methods provided by protobuf library will by default use -// 'type.googleapis.com/full.type.name' as the type URL and the unpack -// methods only use the fully qualified type name after the last '/' -// in the type URL, for example "foo.bar.com/x/y.z" will yield type -// name "y.z". -// -// JSON -// ==== -// The JSON representation of an `Any` value uses the regular -// representation of the deserialized, embedded message, with an -// additional field `@type` which contains the type URL. Example: -// -// package google.profile; -// message Person { -// string first_name = 1; -// string last_name = 2; -// } -// -// { -// "@type": "type.googleapis.com/google.profile.Person", -// "firstName": , -// "lastName": -// } -// -// If the embedded message type is well-known and has a custom JSON -// representation, that representation will be embedded adding a field -// `value` which holds the custom JSON in addition to the `@type` -// field. Example (for message [google.protobuf.Duration][]): -// -// { -// "@type": "type.googleapis.com/google.protobuf.Duration", -// "value": "1.212s" -// } -swagger:model GetSettingsDefaultBodyDetailsItems0 -*/ -type GetSettingsDefaultBodyDetailsItems0 struct { - // A URL/resource name that uniquely identifies the type of the serialized - // protocol buffer message. This string must contain at least - // one "/" character. The last segment of the URL's path must represent - // the fully qualified name of the type (as in - // `path/google.protobuf.Duration`). The name should be in a canonical form - // (e.g., leading "." is not accepted). - // - // In practice, teams usually precompile into the binary all types that they - // expect it to use in the context of Any. However, for URLs which use the - // scheme `http`, `https`, or no scheme, one can optionally set up a type - // server that maps type URLs to message definitions as follows: - // - // * If no scheme is provided, `https` is assumed. - // * An HTTP GET on the URL must yield a [google.protobuf.Type][] - // value in binary format, or produce an error. - // * Applications are allowed to cache lookup results based on the - // URL, or have them precompiled into a binary to avoid any - // lookup. Therefore, binary compatibility needs to be preserved - // on changes to types. (Use versioned type names to manage - // breaking changes.) - // - // Note: this functionality is not currently available in the official - // protobuf release, and it is not used for type URLs beginning with - // type.googleapis.com. As of May 2023, there are no widely used type server - // implementations and no plans to implement one. - // - // Schemes other than `http`, `https` (or the empty scheme) might be - // used with implementation specific semantics. - AtType string `json:"@type,omitempty"` - - // get settings default body details items0 - GetSettingsDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *GetSettingsDefaultBodyDetailsItems0) UnmarshalJSON(data []byte) error { - // stage 1, bind the properties - var stage1 struct { - // A URL/resource name that uniquely identifies the type of the serialized - // protocol buffer message. This string must contain at least - // one "/" character. The last segment of the URL's path must represent - // the fully qualified name of the type (as in - // `path/google.protobuf.Duration`). The name should be in a canonical form - // (e.g., leading "." is not accepted). - // - // In practice, teams usually precompile into the binary all types that they - // expect it to use in the context of Any. However, for URLs which use the - // scheme `http`, `https`, or no scheme, one can optionally set up a type - // server that maps type URLs to message definitions as follows: - // - // * If no scheme is provided, `https` is assumed. - // * An HTTP GET on the URL must yield a [google.protobuf.Type][] - // value in binary format, or produce an error. - // * Applications are allowed to cache lookup results based on the - // URL, or have them precompiled into a binary to avoid any - // lookup. Therefore, binary compatibility needs to be preserved - // on changes to types. (Use versioned type names to manage - // breaking changes.) - // - // Note: this functionality is not currently available in the official - // protobuf release, and it is not used for type URLs beginning with - // type.googleapis.com. As of May 2023, there are no widely used type server - // implementations and no plans to implement one. - // - // Schemes other than `http`, `https` (or the empty scheme) might be - // used with implementation specific semantics. - AtType string `json:"@type,omitempty"` - } - if err := json.Unmarshal(data, &stage1); err != nil { - return err - } - var rcv GetSettingsDefaultBodyDetailsItems0 - - 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.GetSettingsDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o GetSettingsDefaultBodyDetailsItems0) MarshalJSON() ([]byte, error) { - var stage1 struct { - // A URL/resource name that uniquely identifies the type of the serialized - // protocol buffer message. This string must contain at least - // one "/" character. The last segment of the URL's path must represent - // the fully qualified name of the type (as in - // `path/google.protobuf.Duration`). The name should be in a canonical form - // (e.g., leading "." is not accepted). - // - // In practice, teams usually precompile into the binary all types that they - // expect it to use in the context of Any. However, for URLs which use the - // scheme `http`, `https`, or no scheme, one can optionally set up a type - // server that maps type URLs to message definitions as follows: - // - // * If no scheme is provided, `https` is assumed. - // * An HTTP GET on the URL must yield a [google.protobuf.Type][] - // value in binary format, or produce an error. - // * Applications are allowed to cache lookup results based on the - // URL, or have them precompiled into a binary to avoid any - // lookup. Therefore, binary compatibility needs to be preserved - // on changes to types. (Use versioned type names to manage - // breaking changes.) - // - // Note: this functionality is not currently available in the official - // protobuf release, and it is not used for type URLs beginning with - // type.googleapis.com. As of May 2023, there are no widely used type server - // implementations and no plans to implement one. - // - // Schemes other than `http`, `https` (or the empty scheme) might be - // used with implementation specific semantics. - 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.GetSettingsDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.GetSettingsDefaultBodyDetailsItems0) - 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 get settings default body details items0 -func (o *GetSettingsDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get settings default body details items0 based on context it is used -func (o *GetSettingsDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetSettingsDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetSettingsDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res GetSettingsDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetSettingsOKBody get settings OK body -swagger:model GetSettingsOKBody -*/ -type GetSettingsOKBody struct { - // settings - Settings *GetSettingsOKBodySettings `json:"settings,omitempty"` -} - -// Validate validates this get settings OK body -func (o *GetSettingsOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateSettings(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetSettingsOKBody) validateSettings(formats strfmt.Registry) error { - if swag.IsZero(o.Settings) { // not required - return nil - } - - if o.Settings != nil { - if err := o.Settings.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getSettingsOk" + "." + "settings") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getSettingsOk" + "." + "settings") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this get settings OK body based on the context it is used -func (o *GetSettingsOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateSettings(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetSettingsOKBody) contextValidateSettings(ctx context.Context, formats strfmt.Registry) error { - if o.Settings != nil { - - if swag.IsZero(o.Settings) { // not required - return nil - } - - if err := o.Settings.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getSettingsOk" + "." + "settings") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getSettingsOk" + "." + "settings") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetSettingsOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetSettingsOKBody) UnmarshalBinary(b []byte) error { - var res GetSettingsOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetSettingsOKBodySettings Settings represents PMM Server settings. -swagger:model GetSettingsOKBodySettings -*/ -type GetSettingsOKBodySettings struct { - // True if updates are enabled. - UpdatesEnabled bool `json:"updates_enabled,omitempty"` - - // True if telemetry is enabled. - TelemetryEnabled bool `json:"telemetry_enabled,omitempty"` - - // data retention - DataRetention string `json:"data_retention,omitempty"` - - // ssh key - SSHKey string `json:"ssh_key,omitempty"` - - // aws partitions - AWSPartitions []string `json:"aws_partitions"` - - // True if Advisor is enabled. - AdvisorEnabled bool `json:"advisor_enabled,omitempty"` - - // Percona Platform user's email, if this PMM instance is linked to the Platform. - PlatformEmail string `json:"platform_email,omitempty"` - - // True if Alerting is enabled. - AlertingEnabled bool `json:"alerting_enabled,omitempty"` - - // PMM Server public address. - PMMPublicAddress string `json:"pmm_public_address,omitempty"` - - // True if Backup Management is enabled. - BackupManagementEnabled bool `json:"backup_management_enabled,omitempty"` - - // True if Azure Discover is enabled. - AzurediscoverEnabled bool `json:"azurediscover_enabled,omitempty"` - - // True if the PMM instance is connected to Platform - ConnectedToPlatform bool `json:"connected_to_platform,omitempty"` - - // Includes list of collected telemetry - TelemetrySummaries []string `json:"telemetry_summaries"` - - // True if Access Control is enabled. - EnableAccessControl bool `json:"enable_access_control,omitempty"` - - // Default Access Control role ID for new users. - DefaultRoleID int64 `json:"default_role_id,omitempty"` - - // True if Query Analytics for PMM's internal PG database is enabled. - EnableInternalPgQAN bool `json:"enable_internal_pg_qan,omitempty"` - - // Duration for which an update is snoozed - UpdateSnoozeDuration string `json:"update_snooze_duration,omitempty"` - - // advisor run intervals - AdvisorRunIntervals *GetSettingsOKBodySettingsAdvisorRunIntervals `json:"advisor_run_intervals,omitempty"` - - // metrics resolutions - MetricsResolutions *GetSettingsOKBodySettingsMetricsResolutions `json:"metrics_resolutions,omitempty"` -} - -// Validate validates this get settings OK body settings -func (o *GetSettingsOKBodySettings) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateAdvisorRunIntervals(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 -} - -func (o *GetSettingsOKBodySettings) validateAdvisorRunIntervals(formats strfmt.Registry) error { - if swag.IsZero(o.AdvisorRunIntervals) { // not required - return nil - } - - if o.AdvisorRunIntervals != nil { - if err := o.AdvisorRunIntervals.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getSettingsOk" + "." + "settings" + "." + "advisor_run_intervals") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getSettingsOk" + "." + "settings" + "." + "advisor_run_intervals") - } - - return err - } - } - - return nil -} - -func (o *GetSettingsOKBodySettings) 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("getSettingsOk" + "." + "settings" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getSettingsOk" + "." + "settings" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this get settings OK body settings based on the context it is used -func (o *GetSettingsOKBodySettings) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateAdvisorRunIntervals(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateMetricsResolutions(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetSettingsOKBodySettings) contextValidateAdvisorRunIntervals(ctx context.Context, formats strfmt.Registry) error { - if o.AdvisorRunIntervals != nil { - - if swag.IsZero(o.AdvisorRunIntervals) { // not required - return nil - } - - if err := o.AdvisorRunIntervals.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getSettingsOk" + "." + "settings" + "." + "advisor_run_intervals") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getSettingsOk" + "." + "settings" + "." + "advisor_run_intervals") - } - - return err - } - } - - return nil -} - -func (o *GetSettingsOKBodySettings) 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 { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("getSettingsOk" + "." + "settings" + "." + "metrics_resolutions") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("getSettingsOk" + "." + "settings" + "." + "metrics_resolutions") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetSettingsOKBodySettings) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetSettingsOKBodySettings) UnmarshalBinary(b []byte) error { - var res GetSettingsOKBodySettings - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetSettingsOKBodySettingsAdvisorRunIntervals AdvisorRunIntervals represents intervals between each run of Advisor checks. -swagger:model GetSettingsOKBodySettingsAdvisorRunIntervals -*/ -type GetSettingsOKBodySettingsAdvisorRunIntervals struct { - // Standard check interval. - StandardInterval string `json:"standard_interval,omitempty"` - - // Interval for rare check runs. - RareInterval string `json:"rare_interval,omitempty"` - - // Interval for frequent check runs. - FrequentInterval string `json:"frequent_interval,omitempty"` -} - -// Validate validates this get settings OK body settings advisor run intervals -func (o *GetSettingsOKBodySettingsAdvisorRunIntervals) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get settings OK body settings advisor run intervals based on context it is used -func (o *GetSettingsOKBodySettingsAdvisorRunIntervals) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetSettingsOKBodySettingsAdvisorRunIntervals) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetSettingsOKBodySettingsAdvisorRunIntervals) UnmarshalBinary(b []byte) error { - var res GetSettingsOKBodySettingsAdvisorRunIntervals - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetSettingsOKBodySettingsMetricsResolutions MetricsResolutions represents Prometheus exporters metrics resolutions. -swagger:model GetSettingsOKBodySettingsMetricsResolutions -*/ -type GetSettingsOKBodySettingsMetricsResolutions struct { - // High resolution. Should have a suffix in JSON: 1s, 1m, 1h. - Hr string `json:"hr,omitempty"` - - // Medium resolution. Should have a suffix in JSON: 1s, 1m, 1h. - Mr string `json:"mr,omitempty"` - - // Low resolution. Should have a suffix in JSON: 1s, 1m, 1h. - Lr string `json:"lr,omitempty"` -} - -// Validate validates this get settings OK body settings metrics resolutions -func (o *GetSettingsOKBodySettingsMetricsResolutions) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get settings OK body settings metrics resolutions based on context it is used -func (o *GetSettingsOKBodySettingsMetricsResolutions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetSettingsOKBodySettingsMetricsResolutions) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetSettingsOKBodySettingsMetricsResolutions) UnmarshalBinary(b []byte) error { - var res GetSettingsOKBodySettingsMetricsResolutions - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/server/v1/json/client/server_service/leader_health_check_parameters.go b/api/server/v1/json/client/server_service/leader_health_check_parameters.go deleted file mode 100644 index 86cdd9c398b..00000000000 --- a/api/server/v1/json/client/server_service/leader_health_check_parameters.go +++ /dev/null @@ -1,127 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package server_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" -) - -// NewLeaderHealthCheckParams creates a new LeaderHealthCheckParams 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 NewLeaderHealthCheckParams() *LeaderHealthCheckParams { - return &LeaderHealthCheckParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewLeaderHealthCheckParamsWithTimeout creates a new LeaderHealthCheckParams object -// with the ability to set a timeout on a request. -func NewLeaderHealthCheckParamsWithTimeout(timeout time.Duration) *LeaderHealthCheckParams { - return &LeaderHealthCheckParams{ - timeout: timeout, - } -} - -// NewLeaderHealthCheckParamsWithContext creates a new LeaderHealthCheckParams object -// with the ability to set a context for a request. -func NewLeaderHealthCheckParamsWithContext(ctx context.Context) *LeaderHealthCheckParams { - return &LeaderHealthCheckParams{ - Context: ctx, - } -} - -// NewLeaderHealthCheckParamsWithHTTPClient creates a new LeaderHealthCheckParams object -// with the ability to set a custom HTTPClient for a request. -func NewLeaderHealthCheckParamsWithHTTPClient(client *http.Client) *LeaderHealthCheckParams { - return &LeaderHealthCheckParams{ - HTTPClient: client, - } -} - -/* -LeaderHealthCheckParams contains all the parameters to send to the API endpoint - - for the leader health check operation. - - Typically these are written to a http.Request. -*/ -type LeaderHealthCheckParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the leader health check params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *LeaderHealthCheckParams) WithDefaults() *LeaderHealthCheckParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the leader health check params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *LeaderHealthCheckParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the leader health check params -func (o *LeaderHealthCheckParams) WithTimeout(timeout time.Duration) *LeaderHealthCheckParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the leader health check params -func (o *LeaderHealthCheckParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the leader health check params -func (o *LeaderHealthCheckParams) WithContext(ctx context.Context) *LeaderHealthCheckParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the leader health check params -func (o *LeaderHealthCheckParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the leader health check params -func (o *LeaderHealthCheckParams) WithHTTPClient(client *http.Client) *LeaderHealthCheckParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the leader health check params -func (o *LeaderHealthCheckParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *LeaderHealthCheckParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/api/server/v1/json/client/server_service/leader_health_check_responses.go b/api/server/v1/json/client/server_service/leader_health_check_responses.go deleted file mode 100644 index ab224190ccc..00000000000 --- a/api/server/v1/json/client/server_service/leader_health_check_responses.go +++ /dev/null @@ -1,579 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package server_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" -) - -// LeaderHealthCheckReader is a Reader for the LeaderHealthCheck structure. -type LeaderHealthCheckReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *LeaderHealthCheckReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewLeaderHealthCheckOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewLeaderHealthCheckDefault(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 - } -} - -// NewLeaderHealthCheckOK creates a LeaderHealthCheckOK with default headers values -func NewLeaderHealthCheckOK() *LeaderHealthCheckOK { - return &LeaderHealthCheckOK{} -} - -/* -LeaderHealthCheckOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type LeaderHealthCheckOK struct { - Payload any -} - -// IsSuccess returns true when this leader health check Ok response has a 2xx status code -func (o *LeaderHealthCheckOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this leader health check Ok response has a 3xx status code -func (o *LeaderHealthCheckOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this leader health check Ok response has a 4xx status code -func (o *LeaderHealthCheckOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this leader health check Ok response has a 5xx status code -func (o *LeaderHealthCheckOK) IsServerError() bool { - return false -} - -// IsCode returns true when this leader health check Ok response a status code equal to that given -func (o *LeaderHealthCheckOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the leader health check Ok response -func (o *LeaderHealthCheckOK) Code() int { - return 200 -} - -func (o *LeaderHealthCheckOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/server/leaderHealthCheck][%d] leaderHealthCheckOk %s", 200, payload) -} - -func (o *LeaderHealthCheckOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/server/leaderHealthCheck][%d] leaderHealthCheckOk %s", 200, payload) -} - -func (o *LeaderHealthCheckOK) GetPayload() any { - return o.Payload -} - -func (o *LeaderHealthCheckOK) 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) { - return err - } - - return nil -} - -// NewLeaderHealthCheckDefault creates a LeaderHealthCheckDefault with default headers values -func NewLeaderHealthCheckDefault(code int) *LeaderHealthCheckDefault { - return &LeaderHealthCheckDefault{ - _statusCode: code, - } -} - -/* -LeaderHealthCheckDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type LeaderHealthCheckDefault struct { - _statusCode int - - Payload *LeaderHealthCheckDefaultBody -} - -// IsSuccess returns true when this leader health check default response has a 2xx status code -func (o *LeaderHealthCheckDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this leader health check default response has a 3xx status code -func (o *LeaderHealthCheckDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this leader health check default response has a 4xx status code -func (o *LeaderHealthCheckDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this leader health check default response has a 5xx status code -func (o *LeaderHealthCheckDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this leader health check default response a status code equal to that given -func (o *LeaderHealthCheckDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the leader health check default response -func (o *LeaderHealthCheckDefault) Code() int { - return o._statusCode -} - -func (o *LeaderHealthCheckDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/server/leaderHealthCheck][%d] LeaderHealthCheck default %s", o._statusCode, payload) -} - -func (o *LeaderHealthCheckDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/server/leaderHealthCheck][%d] LeaderHealthCheck default %s", o._statusCode, payload) -} - -func (o *LeaderHealthCheckDefault) GetPayload() *LeaderHealthCheckDefaultBody { - return o.Payload -} - -func (o *LeaderHealthCheckDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(LeaderHealthCheckDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -LeaderHealthCheckDefaultBody leader health check default body -swagger:model LeaderHealthCheckDefaultBody -*/ -type LeaderHealthCheckDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*LeaderHealthCheckDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this leader health check default body -func (o *LeaderHealthCheckDefaultBody) 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 *LeaderHealthCheckDefaultBody) 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("LeaderHealthCheck default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("LeaderHealthCheck default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this leader health check default body based on the context it is used -func (o *LeaderHealthCheckDefaultBody) 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 *LeaderHealthCheckDefaultBody) 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("LeaderHealthCheck default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("LeaderHealthCheck default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *LeaderHealthCheckDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *LeaderHealthCheckDefaultBody) UnmarshalBinary(b []byte) error { - var res LeaderHealthCheckDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -LeaderHealthCheckDefaultBodyDetailsItems0 `Any` contains an arbitrary serialized protocol buffer message along with a -// URL that describes the type of the serialized message. -// -// Protobuf library provides support to pack/unpack Any values in the form -// of utility functions or additional generated methods of the Any type. -// -// Example 1: Pack and unpack a message in C++. -// -// Foo foo = ...; -// Any any; -// any.PackFrom(foo); -// ... -// if (any.UnpackTo(&foo)) { -// ... -// } -// -// Example 2: Pack and unpack a message in Java. -// -// Foo foo = ...; -// Any any = Any.pack(foo); -// ... -// if (any.is(Foo.class)) { -// foo = any.unpack(Foo.class); -// } -// // or ... -// if (any.isSameTypeAs(Foo.getDefaultInstance())) { -// foo = any.unpack(Foo.getDefaultInstance()); -// } -// -// Example 3: Pack and unpack a message in Python. -// -// foo = Foo(...) -// any = Any() -// any.Pack(foo) -// ... -// if any.Is(Foo.DESCRIPTOR): -// any.Unpack(foo) -// ... -// -// Example 4: Pack and unpack a message in Go -// -// foo := &pb.Foo{...} -// any, err := anypb.New(foo) -// if err != nil { -// ... -// } -// ... -// foo := &pb.Foo{} -// if err := any.UnmarshalTo(foo); err != nil { -// ... -// } -// -// The pack methods provided by protobuf library will by default use -// 'type.googleapis.com/full.type.name' as the type URL and the unpack -// methods only use the fully qualified type name after the last '/' -// in the type URL, for example "foo.bar.com/x/y.z" will yield type -// name "y.z". -// -// JSON -// ==== -// The JSON representation of an `Any` value uses the regular -// representation of the deserialized, embedded message, with an -// additional field `@type` which contains the type URL. Example: -// -// package google.profile; -// message Person { -// string first_name = 1; -// string last_name = 2; -// } -// -// { -// "@type": "type.googleapis.com/google.profile.Person", -// "firstName": , -// "lastName": -// } -// -// If the embedded message type is well-known and has a custom JSON -// representation, that representation will be embedded adding a field -// `value` which holds the custom JSON in addition to the `@type` -// field. Example (for message [google.protobuf.Duration][]): -// -// { -// "@type": "type.googleapis.com/google.protobuf.Duration", -// "value": "1.212s" -// } -swagger:model LeaderHealthCheckDefaultBodyDetailsItems0 -*/ -type LeaderHealthCheckDefaultBodyDetailsItems0 struct { - // A URL/resource name that uniquely identifies the type of the serialized - // protocol buffer message. This string must contain at least - // one "/" character. The last segment of the URL's path must represent - // the fully qualified name of the type (as in - // `path/google.protobuf.Duration`). The name should be in a canonical form - // (e.g., leading "." is not accepted). - // - // In practice, teams usually precompile into the binary all types that they - // expect it to use in the context of Any. However, for URLs which use the - // scheme `http`, `https`, or no scheme, one can optionally set up a type - // server that maps type URLs to message definitions as follows: - // - // * If no scheme is provided, `https` is assumed. - // * An HTTP GET on the URL must yield a [google.protobuf.Type][] - // value in binary format, or produce an error. - // * Applications are allowed to cache lookup results based on the - // URL, or have them precompiled into a binary to avoid any - // lookup. Therefore, binary compatibility needs to be preserved - // on changes to types. (Use versioned type names to manage - // breaking changes.) - // - // Note: this functionality is not currently available in the official - // protobuf release, and it is not used for type URLs beginning with - // type.googleapis.com. As of May 2023, there are no widely used type server - // implementations and no plans to implement one. - // - // Schemes other than `http`, `https` (or the empty scheme) might be - // used with implementation specific semantics. - AtType string `json:"@type,omitempty"` - - // leader health check default body details items0 - LeaderHealthCheckDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *LeaderHealthCheckDefaultBodyDetailsItems0) UnmarshalJSON(data []byte) error { - // stage 1, bind the properties - var stage1 struct { - // A URL/resource name that uniquely identifies the type of the serialized - // protocol buffer message. This string must contain at least - // one "/" character. The last segment of the URL's path must represent - // the fully qualified name of the type (as in - // `path/google.protobuf.Duration`). The name should be in a canonical form - // (e.g., leading "." is not accepted). - // - // In practice, teams usually precompile into the binary all types that they - // expect it to use in the context of Any. However, for URLs which use the - // scheme `http`, `https`, or no scheme, one can optionally set up a type - // server that maps type URLs to message definitions as follows: - // - // * If no scheme is provided, `https` is assumed. - // * An HTTP GET on the URL must yield a [google.protobuf.Type][] - // value in binary format, or produce an error. - // * Applications are allowed to cache lookup results based on the - // URL, or have them precompiled into a binary to avoid any - // lookup. Therefore, binary compatibility needs to be preserved - // on changes to types. (Use versioned type names to manage - // breaking changes.) - // - // Note: this functionality is not currently available in the official - // protobuf release, and it is not used for type URLs beginning with - // type.googleapis.com. As of May 2023, there are no widely used type server - // implementations and no plans to implement one. - // - // Schemes other than `http`, `https` (or the empty scheme) might be - // used with implementation specific semantics. - AtType string `json:"@type,omitempty"` - } - if err := json.Unmarshal(data, &stage1); err != nil { - return err - } - var rcv LeaderHealthCheckDefaultBodyDetailsItems0 - - 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.LeaderHealthCheckDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o LeaderHealthCheckDefaultBodyDetailsItems0) MarshalJSON() ([]byte, error) { - var stage1 struct { - // A URL/resource name that uniquely identifies the type of the serialized - // protocol buffer message. This string must contain at least - // one "/" character. The last segment of the URL's path must represent - // the fully qualified name of the type (as in - // `path/google.protobuf.Duration`). The name should be in a canonical form - // (e.g., leading "." is not accepted). - // - // In practice, teams usually precompile into the binary all types that they - // expect it to use in the context of Any. However, for URLs which use the - // scheme `http`, `https`, or no scheme, one can optionally set up a type - // server that maps type URLs to message definitions as follows: - // - // * If no scheme is provided, `https` is assumed. - // * An HTTP GET on the URL must yield a [google.protobuf.Type][] - // value in binary format, or produce an error. - // * Applications are allowed to cache lookup results based on the - // URL, or have them precompiled into a binary to avoid any - // lookup. Therefore, binary compatibility needs to be preserved - // on changes to types. (Use versioned type names to manage - // breaking changes.) - // - // Note: this functionality is not currently available in the official - // protobuf release, and it is not used for type URLs beginning with - // type.googleapis.com. As of May 2023, there are no widely used type server - // implementations and no plans to implement one. - // - // Schemes other than `http`, `https` (or the empty scheme) might be - // used with implementation specific semantics. - 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.LeaderHealthCheckDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.LeaderHealthCheckDefaultBodyDetailsItems0) - 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 leader health check default body details items0 -func (o *LeaderHealthCheckDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this leader health check default body details items0 based on context it is used -func (o *LeaderHealthCheckDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *LeaderHealthCheckDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *LeaderHealthCheckDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res LeaderHealthCheckDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/server/v1/json/client/server_service/list_change_logs_parameters.go b/api/server/v1/json/client/server_service/list_change_logs_parameters.go deleted file mode 100644 index 4160eaf6faa..00000000000 --- a/api/server/v1/json/client/server_service/list_change_logs_parameters.go +++ /dev/null @@ -1,127 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package server_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" -) - -// NewListChangeLogsParams creates a new ListChangeLogsParams 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 NewListChangeLogsParams() *ListChangeLogsParams { - return &ListChangeLogsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListChangeLogsParamsWithTimeout creates a new ListChangeLogsParams object -// with the ability to set a timeout on a request. -func NewListChangeLogsParamsWithTimeout(timeout time.Duration) *ListChangeLogsParams { - return &ListChangeLogsParams{ - timeout: timeout, - } -} - -// NewListChangeLogsParamsWithContext creates a new ListChangeLogsParams object -// with the ability to set a context for a request. -func NewListChangeLogsParamsWithContext(ctx context.Context) *ListChangeLogsParams { - return &ListChangeLogsParams{ - Context: ctx, - } -} - -// NewListChangeLogsParamsWithHTTPClient creates a new ListChangeLogsParams object -// with the ability to set a custom HTTPClient for a request. -func NewListChangeLogsParamsWithHTTPClient(client *http.Client) *ListChangeLogsParams { - return &ListChangeLogsParams{ - HTTPClient: client, - } -} - -/* -ListChangeLogsParams contains all the parameters to send to the API endpoint - - for the list change logs operation. - - Typically these are written to a http.Request. -*/ -type ListChangeLogsParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list change logs params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListChangeLogsParams) WithDefaults() *ListChangeLogsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list change logs params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListChangeLogsParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list change logs params -func (o *ListChangeLogsParams) WithTimeout(timeout time.Duration) *ListChangeLogsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list change logs params -func (o *ListChangeLogsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list change logs params -func (o *ListChangeLogsParams) WithContext(ctx context.Context) *ListChangeLogsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list change logs params -func (o *ListChangeLogsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list change logs params -func (o *ListChangeLogsParams) WithHTTPClient(client *http.Client) *ListChangeLogsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list change logs params -func (o *ListChangeLogsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *ListChangeLogsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/api/server/v1/json/client/server_service/list_change_logs_responses.go b/api/server/v1/json/client/server_service/list_change_logs_responses.go deleted file mode 100644 index f0943c1e69e..00000000000 --- a/api/server/v1/json/client/server_service/list_change_logs_responses.go +++ /dev/null @@ -1,784 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package server_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" -) - -// ListChangeLogsReader is a Reader for the ListChangeLogs structure. -type ListChangeLogsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListChangeLogsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewListChangeLogsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewListChangeLogsDefault(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 - } -} - -// NewListChangeLogsOK creates a ListChangeLogsOK with default headers values -func NewListChangeLogsOK() *ListChangeLogsOK { - return &ListChangeLogsOK{} -} - -/* -ListChangeLogsOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type ListChangeLogsOK struct { - Payload *ListChangeLogsOKBody -} - -// IsSuccess returns true when this list change logs Ok response has a 2xx status code -func (o *ListChangeLogsOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this list change logs Ok response has a 3xx status code -func (o *ListChangeLogsOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this list change logs Ok response has a 4xx status code -func (o *ListChangeLogsOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this list change logs Ok response has a 5xx status code -func (o *ListChangeLogsOK) IsServerError() bool { - return false -} - -// IsCode returns true when this list change logs Ok response a status code equal to that given -func (o *ListChangeLogsOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the list change logs Ok response -func (o *ListChangeLogsOK) Code() int { - return 200 -} - -func (o *ListChangeLogsOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/server/updates/changelogs][%d] listChangeLogsOk %s", 200, payload) -} - -func (o *ListChangeLogsOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/server/updates/changelogs][%d] listChangeLogsOk %s", 200, payload) -} - -func (o *ListChangeLogsOK) GetPayload() *ListChangeLogsOKBody { - return o.Payload -} - -func (o *ListChangeLogsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(ListChangeLogsOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -// NewListChangeLogsDefault creates a ListChangeLogsDefault with default headers values -func NewListChangeLogsDefault(code int) *ListChangeLogsDefault { - return &ListChangeLogsDefault{ - _statusCode: code, - } -} - -/* -ListChangeLogsDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type ListChangeLogsDefault struct { - _statusCode int - - Payload *ListChangeLogsDefaultBody -} - -// IsSuccess returns true when this list change logs default response has a 2xx status code -func (o *ListChangeLogsDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this list change logs default response has a 3xx status code -func (o *ListChangeLogsDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this list change logs default response has a 4xx status code -func (o *ListChangeLogsDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this list change logs default response has a 5xx status code -func (o *ListChangeLogsDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this list change logs default response a status code equal to that given -func (o *ListChangeLogsDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the list change logs default response -func (o *ListChangeLogsDefault) Code() int { - return o._statusCode -} - -func (o *ListChangeLogsDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/server/updates/changelogs][%d] ListChangeLogs default %s", o._statusCode, payload) -} - -func (o *ListChangeLogsDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/server/updates/changelogs][%d] ListChangeLogs default %s", o._statusCode, payload) -} - -func (o *ListChangeLogsDefault) GetPayload() *ListChangeLogsDefaultBody { - return o.Payload -} - -func (o *ListChangeLogsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(ListChangeLogsDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -ListChangeLogsDefaultBody list change logs default body -swagger:model ListChangeLogsDefaultBody -*/ -type ListChangeLogsDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*ListChangeLogsDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this list change logs default body -func (o *ListChangeLogsDefaultBody) 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 *ListChangeLogsDefaultBody) 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("ListChangeLogs default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("ListChangeLogs default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this list change logs default body based on the context it is used -func (o *ListChangeLogsDefaultBody) 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 *ListChangeLogsDefaultBody) 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("ListChangeLogs default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("ListChangeLogs default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListChangeLogsDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListChangeLogsDefaultBody) UnmarshalBinary(b []byte) error { - var res ListChangeLogsDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListChangeLogsDefaultBodyDetailsItems0 `Any` contains an arbitrary serialized protocol buffer message along with a -// URL that describes the type of the serialized message. -// -// Protobuf library provides support to pack/unpack Any values in the form -// of utility functions or additional generated methods of the Any type. -// -// Example 1: Pack and unpack a message in C++. -// -// Foo foo = ...; -// Any any; -// any.PackFrom(foo); -// ... -// if (any.UnpackTo(&foo)) { -// ... -// } -// -// Example 2: Pack and unpack a message in Java. -// -// Foo foo = ...; -// Any any = Any.pack(foo); -// ... -// if (any.is(Foo.class)) { -// foo = any.unpack(Foo.class); -// } -// // or ... -// if (any.isSameTypeAs(Foo.getDefaultInstance())) { -// foo = any.unpack(Foo.getDefaultInstance()); -// } -// -// Example 3: Pack and unpack a message in Python. -// -// foo = Foo(...) -// any = Any() -// any.Pack(foo) -// ... -// if any.Is(Foo.DESCRIPTOR): -// any.Unpack(foo) -// ... -// -// Example 4: Pack and unpack a message in Go -// -// foo := &pb.Foo{...} -// any, err := anypb.New(foo) -// if err != nil { -// ... -// } -// ... -// foo := &pb.Foo{} -// if err := any.UnmarshalTo(foo); err != nil { -// ... -// } -// -// The pack methods provided by protobuf library will by default use -// 'type.googleapis.com/full.type.name' as the type URL and the unpack -// methods only use the fully qualified type name after the last '/' -// in the type URL, for example "foo.bar.com/x/y.z" will yield type -// name "y.z". -// -// JSON -// ==== -// The JSON representation of an `Any` value uses the regular -// representation of the deserialized, embedded message, with an -// additional field `@type` which contains the type URL. Example: -// -// package google.profile; -// message Person { -// string first_name = 1; -// string last_name = 2; -// } -// -// { -// "@type": "type.googleapis.com/google.profile.Person", -// "firstName": , -// "lastName": -// } -// -// If the embedded message type is well-known and has a custom JSON -// representation, that representation will be embedded adding a field -// `value` which holds the custom JSON in addition to the `@type` -// field. Example (for message [google.protobuf.Duration][]): -// -// { -// "@type": "type.googleapis.com/google.protobuf.Duration", -// "value": "1.212s" -// } -swagger:model ListChangeLogsDefaultBodyDetailsItems0 -*/ -type ListChangeLogsDefaultBodyDetailsItems0 struct { - // A URL/resource name that uniquely identifies the type of the serialized - // protocol buffer message. This string must contain at least - // one "/" character. The last segment of the URL's path must represent - // the fully qualified name of the type (as in - // `path/google.protobuf.Duration`). The name should be in a canonical form - // (e.g., leading "." is not accepted). - // - // In practice, teams usually precompile into the binary all types that they - // expect it to use in the context of Any. However, for URLs which use the - // scheme `http`, `https`, or no scheme, one can optionally set up a type - // server that maps type URLs to message definitions as follows: - // - // * If no scheme is provided, `https` is assumed. - // * An HTTP GET on the URL must yield a [google.protobuf.Type][] - // value in binary format, or produce an error. - // * Applications are allowed to cache lookup results based on the - // URL, or have them precompiled into a binary to avoid any - // lookup. Therefore, binary compatibility needs to be preserved - // on changes to types. (Use versioned type names to manage - // breaking changes.) - // - // Note: this functionality is not currently available in the official - // protobuf release, and it is not used for type URLs beginning with - // type.googleapis.com. As of May 2023, there are no widely used type server - // implementations and no plans to implement one. - // - // Schemes other than `http`, `https` (or the empty scheme) might be - // used with implementation specific semantics. - AtType string `json:"@type,omitempty"` - - // list change logs default body details items0 - ListChangeLogsDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *ListChangeLogsDefaultBodyDetailsItems0) UnmarshalJSON(data []byte) error { - // stage 1, bind the properties - var stage1 struct { - // A URL/resource name that uniquely identifies the type of the serialized - // protocol buffer message. This string must contain at least - // one "/" character. The last segment of the URL's path must represent - // the fully qualified name of the type (as in - // `path/google.protobuf.Duration`). The name should be in a canonical form - // (e.g., leading "." is not accepted). - // - // In practice, teams usually precompile into the binary all types that they - // expect it to use in the context of Any. However, for URLs which use the - // scheme `http`, `https`, or no scheme, one can optionally set up a type - // server that maps type URLs to message definitions as follows: - // - // * If no scheme is provided, `https` is assumed. - // * An HTTP GET on the URL must yield a [google.protobuf.Type][] - // value in binary format, or produce an error. - // * Applications are allowed to cache lookup results based on the - // URL, or have them precompiled into a binary to avoid any - // lookup. Therefore, binary compatibility needs to be preserved - // on changes to types. (Use versioned type names to manage - // breaking changes.) - // - // Note: this functionality is not currently available in the official - // protobuf release, and it is not used for type URLs beginning with - // type.googleapis.com. As of May 2023, there are no widely used type server - // implementations and no plans to implement one. - // - // Schemes other than `http`, `https` (or the empty scheme) might be - // used with implementation specific semantics. - AtType string `json:"@type,omitempty"` - } - if err := json.Unmarshal(data, &stage1); err != nil { - return err - } - var rcv ListChangeLogsDefaultBodyDetailsItems0 - - 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.ListChangeLogsDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o ListChangeLogsDefaultBodyDetailsItems0) MarshalJSON() ([]byte, error) { - var stage1 struct { - // A URL/resource name that uniquely identifies the type of the serialized - // protocol buffer message. This string must contain at least - // one "/" character. The last segment of the URL's path must represent - // the fully qualified name of the type (as in - // `path/google.protobuf.Duration`). The name should be in a canonical form - // (e.g., leading "." is not accepted). - // - // In practice, teams usually precompile into the binary all types that they - // expect it to use in the context of Any. However, for URLs which use the - // scheme `http`, `https`, or no scheme, one can optionally set up a type - // server that maps type URLs to message definitions as follows: - // - // * If no scheme is provided, `https` is assumed. - // * An HTTP GET on the URL must yield a [google.protobuf.Type][] - // value in binary format, or produce an error. - // * Applications are allowed to cache lookup results based on the - // URL, or have them precompiled into a binary to avoid any - // lookup. Therefore, binary compatibility needs to be preserved - // on changes to types. (Use versioned type names to manage - // breaking changes.) - // - // Note: this functionality is not currently available in the official - // protobuf release, and it is not used for type URLs beginning with - // type.googleapis.com. As of May 2023, there are no widely used type server - // implementations and no plans to implement one. - // - // Schemes other than `http`, `https` (or the empty scheme) might be - // used with implementation specific semantics. - 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.ListChangeLogsDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.ListChangeLogsDefaultBodyDetailsItems0) - 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 list change logs default body details items0 -func (o *ListChangeLogsDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list change logs default body details items0 based on context it is used -func (o *ListChangeLogsDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListChangeLogsDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListChangeLogsDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res ListChangeLogsDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListChangeLogsOKBody list change logs OK body -swagger:model ListChangeLogsOKBody -*/ -type ListChangeLogsOKBody struct { - // List of available updates. - Updates []*ListChangeLogsOKBodyUpdatesItems0 `json:"updates"` - - // Last check time. - // Format: date-time - LastCheck strfmt.DateTime `json:"last_check,omitempty"` -} - -// Validate validates this list change logs OK body -func (o *ListChangeLogsOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateUpdates(formats); err != nil { - res = append(res, err) - } - - if err := o.validateLastCheck(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListChangeLogsOKBody) validateUpdates(formats strfmt.Registry) error { - if swag.IsZero(o.Updates) { // not required - return nil - } - - for i := 0; i < len(o.Updates); i++ { - if swag.IsZero(o.Updates[i]) { // not required - continue - } - - if o.Updates[i] != nil { - if err := o.Updates[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listChangeLogsOk" + "." + "updates" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listChangeLogsOk" + "." + "updates" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -func (o *ListChangeLogsOKBody) validateLastCheck(formats strfmt.Registry) error { - if swag.IsZero(o.LastCheck) { // not required - return nil - } - - if err := validate.FormatOf("listChangeLogsOk"+"."+"last_check", "body", "date-time", o.LastCheck.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this list change logs OK body based on the context it is used -func (o *ListChangeLogsOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateUpdates(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListChangeLogsOKBody) contextValidateUpdates(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Updates); i++ { - if o.Updates[i] != nil { - - if swag.IsZero(o.Updates[i]) { // not required - return nil - } - - if err := o.Updates[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listChangeLogsOk" + "." + "updates" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listChangeLogsOk" + "." + "updates" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListChangeLogsOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListChangeLogsOKBody) UnmarshalBinary(b []byte) error { - var res ListChangeLogsOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListChangeLogsOKBodyUpdatesItems0 list change logs OK body updates items0 -swagger:model ListChangeLogsOKBodyUpdatesItems0 -*/ -type ListChangeLogsOKBodyUpdatesItems0 struct { - // PMM Version. - Version string `json:"version,omitempty"` - - // Docker image tag. - Tag string `json:"tag,omitempty"` - - // Release date. - // Format: date-time - Timestamp strfmt.DateTime `json:"timestamp,omitempty"` - - // Release notes URL for the version (if available). - ReleaseNotesURL string `json:"release_notes_url,omitempty"` - - // Release notes text for the version (if available). - ReleaseNotesText string `json:"release_notes_text,omitempty"` -} - -// Validate validates this list change logs OK body updates items0 -func (o *ListChangeLogsOKBodyUpdatesItems0) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateTimestamp(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListChangeLogsOKBodyUpdatesItems0) validateTimestamp(formats strfmt.Registry) error { - if swag.IsZero(o.Timestamp) { // not required - return nil - } - - if err := validate.FormatOf("timestamp", "body", "date-time", o.Timestamp.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this list change logs OK body updates items0 based on context it is used -func (o *ListChangeLogsOKBodyUpdatesItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListChangeLogsOKBodyUpdatesItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListChangeLogsOKBodyUpdatesItems0) UnmarshalBinary(b []byte) error { - var res ListChangeLogsOKBodyUpdatesItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/server/v1/json/client/server_service/logs_parameters.go b/api/server/v1/json/client/server_service/logs_parameters.go deleted file mode 100644 index eac190ca90c..00000000000 --- a/api/server/v1/json/client/server_service/logs_parameters.go +++ /dev/null @@ -1,161 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package server_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" - "github.com/go-openapi/swag" -) - -// NewLogsParams creates a new LogsParams 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 NewLogsParams() *LogsParams { - return &LogsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewLogsParamsWithTimeout creates a new LogsParams object -// with the ability to set a timeout on a request. -func NewLogsParamsWithTimeout(timeout time.Duration) *LogsParams { - return &LogsParams{ - timeout: timeout, - } -} - -// NewLogsParamsWithContext creates a new LogsParams object -// with the ability to set a context for a request. -func NewLogsParamsWithContext(ctx context.Context) *LogsParams { - return &LogsParams{ - Context: ctx, - } -} - -// NewLogsParamsWithHTTPClient creates a new LogsParams object -// with the ability to set a custom HTTPClient for a request. -func NewLogsParamsWithHTTPClient(client *http.Client) *LogsParams { - return &LogsParams{ - HTTPClient: client, - } -} - -/* -LogsParams contains all the parameters to send to the API endpoint - - for the logs operation. - - Typically these are written to a http.Request. -*/ -type LogsParams struct { - /* Pprof. - - Include performance profiling data, - */ - Pprof *bool - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the logs params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *LogsParams) WithDefaults() *LogsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the logs params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *LogsParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the logs params -func (o *LogsParams) WithTimeout(timeout time.Duration) *LogsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the logs params -func (o *LogsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the logs params -func (o *LogsParams) WithContext(ctx context.Context) *LogsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the logs params -func (o *LogsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the logs params -func (o *LogsParams) WithHTTPClient(client *http.Client) *LogsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the logs params -func (o *LogsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithPprof adds the pprof to the logs params -func (o *LogsParams) WithPprof(pprof *bool) *LogsParams { - o.SetPprof(pprof) - return o -} - -// SetPprof adds the pprof to the logs params -func (o *LogsParams) SetPprof(pprof *bool) { - o.Pprof = pprof -} - -// WriteToRequest writes these params to a swagger request -func (o *LogsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.Pprof != nil { - - // query param pprof - var qrPprof bool - - if o.Pprof != nil { - qrPprof = *o.Pprof - } - qPprof := swag.FormatBool(qrPprof) - if qPprof != "" { - if err := r.SetQueryParam("pprof", qPprof); err != nil { - return err - } - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/api/server/v1/json/client/server_service/logs_responses.go b/api/server/v1/json/client/server_service/logs_responses.go deleted file mode 100644 index aef555e7c81..00000000000 --- a/api/server/v1/json/client/server_service/logs_responses.go +++ /dev/null @@ -1,228 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package server_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" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// LogsReader is a Reader for the Logs structure. -type LogsReader struct { - formats strfmt.Registry - writer io.Writer -} - -// ReadResponse reads a server response into the received o. -func (o *LogsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewLogsOK(o.writer) - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewLogsDefault(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 - } -} - -// NewLogsOK creates a LogsOK with default headers values -func NewLogsOK(writer io.Writer) *LogsOK { - return &LogsOK{ - Payload: writer, - } -} - -/* -LogsOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type LogsOK struct { - Payload io.Writer -} - -// IsSuccess returns true when this logs Ok response has a 2xx status code -func (o *LogsOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this logs Ok response has a 3xx status code -func (o *LogsOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this logs Ok response has a 4xx status code -func (o *LogsOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this logs Ok response has a 5xx status code -func (o *LogsOK) IsServerError() bool { - return false -} - -// IsCode returns true when this logs Ok response a status code equal to that given -func (o *LogsOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the logs Ok response -func (o *LogsOK) Code() int { - return 200 -} - -func (o *LogsOK) Error() string { - return fmt.Sprintf("[GET /v1/server/logs.zip][%d] logsOk", 200) -} - -func (o *LogsOK) String() string { - return fmt.Sprintf("[GET /v1/server/logs.zip][%d] logsOk", 200) -} - -func (o *LogsOK) GetPayload() io.Writer { - return o.Payload -} - -func (o *LogsOK) 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) { - return err - } - - return nil -} - -// NewLogsDefault creates a LogsDefault with default headers values -func NewLogsDefault(code int) *LogsDefault { - return &LogsDefault{ - _statusCode: code, - } -} - -/* -LogsDefault describes a response with status code -1, with default header values. - -An error response. -*/ -type LogsDefault struct { - _statusCode int - - Payload *LogsDefaultBody -} - -// IsSuccess returns true when this logs default response has a 2xx status code -func (o *LogsDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this logs default response has a 3xx status code -func (o *LogsDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this logs default response has a 4xx status code -func (o *LogsDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this logs default response has a 5xx status code -func (o *LogsDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this logs default response a status code equal to that given -func (o *LogsDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the logs default response -func (o *LogsDefault) Code() int { - return o._statusCode -} - -func (o *LogsDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/server/logs.zip][%d] Logs default %s", o._statusCode, payload) -} - -func (o *LogsDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/server/logs.zip][%d] Logs default %s", o._statusCode, payload) -} - -func (o *LogsDefault) GetPayload() *LogsDefaultBody { - return o.Payload -} - -func (o *LogsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(LogsDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -LogsDefaultBody ErrorResponse is a message returned on HTTP error. -swagger:model LogsDefaultBody -*/ -type LogsDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // error - Error string `json:"error,omitempty"` - - // message - Message string `json:"message,omitempty"` -} - -// Validate validates this logs default body -func (o *LogsDefaultBody) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this logs default body based on context it is used -func (o *LogsDefaultBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *LogsDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *LogsDefaultBody) UnmarshalBinary(b []byte) error { - var res LogsDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/server/v1/json/client/server_service/readiness_parameters.go b/api/server/v1/json/client/server_service/readiness_parameters.go deleted file mode 100644 index 88fbc323803..00000000000 --- a/api/server/v1/json/client/server_service/readiness_parameters.go +++ /dev/null @@ -1,127 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package server_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" -) - -// NewReadinessParams creates a new ReadinessParams 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 NewReadinessParams() *ReadinessParams { - return &ReadinessParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewReadinessParamsWithTimeout creates a new ReadinessParams object -// with the ability to set a timeout on a request. -func NewReadinessParamsWithTimeout(timeout time.Duration) *ReadinessParams { - return &ReadinessParams{ - timeout: timeout, - } -} - -// NewReadinessParamsWithContext creates a new ReadinessParams object -// with the ability to set a context for a request. -func NewReadinessParamsWithContext(ctx context.Context) *ReadinessParams { - return &ReadinessParams{ - Context: ctx, - } -} - -// NewReadinessParamsWithHTTPClient creates a new ReadinessParams object -// with the ability to set a custom HTTPClient for a request. -func NewReadinessParamsWithHTTPClient(client *http.Client) *ReadinessParams { - return &ReadinessParams{ - HTTPClient: client, - } -} - -/* -ReadinessParams contains all the parameters to send to the API endpoint - - for the readiness operation. - - Typically these are written to a http.Request. -*/ -type ReadinessParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the readiness params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ReadinessParams) WithDefaults() *ReadinessParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the readiness params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ReadinessParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the readiness params -func (o *ReadinessParams) WithTimeout(timeout time.Duration) *ReadinessParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the readiness params -func (o *ReadinessParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the readiness params -func (o *ReadinessParams) WithContext(ctx context.Context) *ReadinessParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the readiness params -func (o *ReadinessParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the readiness params -func (o *ReadinessParams) WithHTTPClient(client *http.Client) *ReadinessParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the readiness params -func (o *ReadinessParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *ReadinessParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/api/server/v1/json/client/server_service/readiness_responses.go b/api/server/v1/json/client/server_service/readiness_responses.go deleted file mode 100644 index dd64679b8db..00000000000 --- a/api/server/v1/json/client/server_service/readiness_responses.go +++ /dev/null @@ -1,579 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package server_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" -) - -// ReadinessReader is a Reader for the Readiness structure. -type ReadinessReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ReadinessReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewReadinessOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewReadinessDefault(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 - } -} - -// NewReadinessOK creates a ReadinessOK with default headers values -func NewReadinessOK() *ReadinessOK { - return &ReadinessOK{} -} - -/* -ReadinessOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type ReadinessOK struct { - Payload any -} - -// IsSuccess returns true when this readiness Ok response has a 2xx status code -func (o *ReadinessOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this readiness Ok response has a 3xx status code -func (o *ReadinessOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this readiness Ok response has a 4xx status code -func (o *ReadinessOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this readiness Ok response has a 5xx status code -func (o *ReadinessOK) IsServerError() bool { - return false -} - -// IsCode returns true when this readiness Ok response a status code equal to that given -func (o *ReadinessOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the readiness Ok response -func (o *ReadinessOK) Code() int { - return 200 -} - -func (o *ReadinessOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/server/readyz][%d] readinessOk %s", 200, payload) -} - -func (o *ReadinessOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/server/readyz][%d] readinessOk %s", 200, payload) -} - -func (o *ReadinessOK) GetPayload() any { - return o.Payload -} - -func (o *ReadinessOK) 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) { - return err - } - - return nil -} - -// NewReadinessDefault creates a ReadinessDefault with default headers values -func NewReadinessDefault(code int) *ReadinessDefault { - return &ReadinessDefault{ - _statusCode: code, - } -} - -/* -ReadinessDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type ReadinessDefault struct { - _statusCode int - - Payload *ReadinessDefaultBody -} - -// IsSuccess returns true when this readiness default response has a 2xx status code -func (o *ReadinessDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this readiness default response has a 3xx status code -func (o *ReadinessDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this readiness default response has a 4xx status code -func (o *ReadinessDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this readiness default response has a 5xx status code -func (o *ReadinessDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this readiness default response a status code equal to that given -func (o *ReadinessDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the readiness default response -func (o *ReadinessDefault) Code() int { - return o._statusCode -} - -func (o *ReadinessDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/server/readyz][%d] Readiness default %s", o._statusCode, payload) -} - -func (o *ReadinessDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/server/readyz][%d] Readiness default %s", o._statusCode, payload) -} - -func (o *ReadinessDefault) GetPayload() *ReadinessDefaultBody { - return o.Payload -} - -func (o *ReadinessDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(ReadinessDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -ReadinessDefaultBody readiness default body -swagger:model ReadinessDefaultBody -*/ -type ReadinessDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*ReadinessDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this readiness default body -func (o *ReadinessDefaultBody) 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 *ReadinessDefaultBody) 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("Readiness default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("Readiness default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this readiness default body based on the context it is used -func (o *ReadinessDefaultBody) 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 *ReadinessDefaultBody) 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("Readiness default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("Readiness default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ReadinessDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ReadinessDefaultBody) UnmarshalBinary(b []byte) error { - var res ReadinessDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ReadinessDefaultBodyDetailsItems0 `Any` contains an arbitrary serialized protocol buffer message along with a -// URL that describes the type of the serialized message. -// -// Protobuf library provides support to pack/unpack Any values in the form -// of utility functions or additional generated methods of the Any type. -// -// Example 1: Pack and unpack a message in C++. -// -// Foo foo = ...; -// Any any; -// any.PackFrom(foo); -// ... -// if (any.UnpackTo(&foo)) { -// ... -// } -// -// Example 2: Pack and unpack a message in Java. -// -// Foo foo = ...; -// Any any = Any.pack(foo); -// ... -// if (any.is(Foo.class)) { -// foo = any.unpack(Foo.class); -// } -// // or ... -// if (any.isSameTypeAs(Foo.getDefaultInstance())) { -// foo = any.unpack(Foo.getDefaultInstance()); -// } -// -// Example 3: Pack and unpack a message in Python. -// -// foo = Foo(...) -// any = Any() -// any.Pack(foo) -// ... -// if any.Is(Foo.DESCRIPTOR): -// any.Unpack(foo) -// ... -// -// Example 4: Pack and unpack a message in Go -// -// foo := &pb.Foo{...} -// any, err := anypb.New(foo) -// if err != nil { -// ... -// } -// ... -// foo := &pb.Foo{} -// if err := any.UnmarshalTo(foo); err != nil { -// ... -// } -// -// The pack methods provided by protobuf library will by default use -// 'type.googleapis.com/full.type.name' as the type URL and the unpack -// methods only use the fully qualified type name after the last '/' -// in the type URL, for example "foo.bar.com/x/y.z" will yield type -// name "y.z". -// -// JSON -// ==== -// The JSON representation of an `Any` value uses the regular -// representation of the deserialized, embedded message, with an -// additional field `@type` which contains the type URL. Example: -// -// package google.profile; -// message Person { -// string first_name = 1; -// string last_name = 2; -// } -// -// { -// "@type": "type.googleapis.com/google.profile.Person", -// "firstName": , -// "lastName": -// } -// -// If the embedded message type is well-known and has a custom JSON -// representation, that representation will be embedded adding a field -// `value` which holds the custom JSON in addition to the `@type` -// field. Example (for message [google.protobuf.Duration][]): -// -// { -// "@type": "type.googleapis.com/google.protobuf.Duration", -// "value": "1.212s" -// } -swagger:model ReadinessDefaultBodyDetailsItems0 -*/ -type ReadinessDefaultBodyDetailsItems0 struct { - // A URL/resource name that uniquely identifies the type of the serialized - // protocol buffer message. This string must contain at least - // one "/" character. The last segment of the URL's path must represent - // the fully qualified name of the type (as in - // `path/google.protobuf.Duration`). The name should be in a canonical form - // (e.g., leading "." is not accepted). - // - // In practice, teams usually precompile into the binary all types that they - // expect it to use in the context of Any. However, for URLs which use the - // scheme `http`, `https`, or no scheme, one can optionally set up a type - // server that maps type URLs to message definitions as follows: - // - // * If no scheme is provided, `https` is assumed. - // * An HTTP GET on the URL must yield a [google.protobuf.Type][] - // value in binary format, or produce an error. - // * Applications are allowed to cache lookup results based on the - // URL, or have them precompiled into a binary to avoid any - // lookup. Therefore, binary compatibility needs to be preserved - // on changes to types. (Use versioned type names to manage - // breaking changes.) - // - // Note: this functionality is not currently available in the official - // protobuf release, and it is not used for type URLs beginning with - // type.googleapis.com. As of May 2023, there are no widely used type server - // implementations and no plans to implement one. - // - // Schemes other than `http`, `https` (or the empty scheme) might be - // used with implementation specific semantics. - AtType string `json:"@type,omitempty"` - - // readiness default body details items0 - ReadinessDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *ReadinessDefaultBodyDetailsItems0) UnmarshalJSON(data []byte) error { - // stage 1, bind the properties - var stage1 struct { - // A URL/resource name that uniquely identifies the type of the serialized - // protocol buffer message. This string must contain at least - // one "/" character. The last segment of the URL's path must represent - // the fully qualified name of the type (as in - // `path/google.protobuf.Duration`). The name should be in a canonical form - // (e.g., leading "." is not accepted). - // - // In practice, teams usually precompile into the binary all types that they - // expect it to use in the context of Any. However, for URLs which use the - // scheme `http`, `https`, or no scheme, one can optionally set up a type - // server that maps type URLs to message definitions as follows: - // - // * If no scheme is provided, `https` is assumed. - // * An HTTP GET on the URL must yield a [google.protobuf.Type][] - // value in binary format, or produce an error. - // * Applications are allowed to cache lookup results based on the - // URL, or have them precompiled into a binary to avoid any - // lookup. Therefore, binary compatibility needs to be preserved - // on changes to types. (Use versioned type names to manage - // breaking changes.) - // - // Note: this functionality is not currently available in the official - // protobuf release, and it is not used for type URLs beginning with - // type.googleapis.com. As of May 2023, there are no widely used type server - // implementations and no plans to implement one. - // - // Schemes other than `http`, `https` (or the empty scheme) might be - // used with implementation specific semantics. - AtType string `json:"@type,omitempty"` - } - if err := json.Unmarshal(data, &stage1); err != nil { - return err - } - var rcv ReadinessDefaultBodyDetailsItems0 - - 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.ReadinessDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o ReadinessDefaultBodyDetailsItems0) MarshalJSON() ([]byte, error) { - var stage1 struct { - // A URL/resource name that uniquely identifies the type of the serialized - // protocol buffer message. This string must contain at least - // one "/" character. The last segment of the URL's path must represent - // the fully qualified name of the type (as in - // `path/google.protobuf.Duration`). The name should be in a canonical form - // (e.g., leading "." is not accepted). - // - // In practice, teams usually precompile into the binary all types that they - // expect it to use in the context of Any. However, for URLs which use the - // scheme `http`, `https`, or no scheme, one can optionally set up a type - // server that maps type URLs to message definitions as follows: - // - // * If no scheme is provided, `https` is assumed. - // * An HTTP GET on the URL must yield a [google.protobuf.Type][] - // value in binary format, or produce an error. - // * Applications are allowed to cache lookup results based on the - // URL, or have them precompiled into a binary to avoid any - // lookup. Therefore, binary compatibility needs to be preserved - // on changes to types. (Use versioned type names to manage - // breaking changes.) - // - // Note: this functionality is not currently available in the official - // protobuf release, and it is not used for type URLs beginning with - // type.googleapis.com. As of May 2023, there are no widely used type server - // implementations and no plans to implement one. - // - // Schemes other than `http`, `https` (or the empty scheme) might be - // used with implementation specific semantics. - 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.ReadinessDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.ReadinessDefaultBodyDetailsItems0) - 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 readiness default body details items0 -func (o *ReadinessDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this readiness default body details items0 based on context it is used -func (o *ReadinessDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ReadinessDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ReadinessDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res ReadinessDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/server/v1/json/client/server_service/server_service_client.go b/api/server/v1/json/client/server_service/server_service_client.go deleted file mode 100644 index b11647f7f53..00000000000 --- a/api/server/v1/json/client/server_service/server_service_client.go +++ /dev/null @@ -1,595 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package server_service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// New creates a new server service API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -// New creates a new server service API client with basic auth credentials. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - user: user for basic authentication header. -// - password: password for basic authentication header. -func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BasicAuth(user, password) - return &Client{transport: transport, formats: strfmt.Default} -} - -// New creates a new server service API client with a bearer token for authentication. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - bearerToken: bearer token for Bearer authentication header. -func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BearerToken(bearerToken) - return &Client{transport: transport, formats: strfmt.Default} -} - -/* -Client for server service API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption may be used to customize the behavior of Client methods. -type ClientOption func(*runtime.ClientOperation) - -// This client is generated with a few options you might find useful for your swagger spec. -// -// Feel free to add you own set of options. - -// WithAccept allows the client to force the Accept header -// to negotiate a specific Producer from the server. -// -// You may use this option to set arbitrary extensions to your MIME media type. -func WithAccept(mime string) ClientOption { - return func(r *runtime.ClientOperation) { - r.ProducesMediaTypes = []string{mime} - } -} - -// WithAcceptApplicationJSON sets the Accept header to "application/json". -func WithAcceptApplicationJSON(r *runtime.ClientOperation) { - r.ProducesMediaTypes = []string{"application/json"} -} - -// WithAcceptApplicationZip sets the Accept header to "application/zip". -func WithAcceptApplicationZip(r *runtime.ClientOperation) { - r.ProducesMediaTypes = []string{"application/zip"} -} - -// ClientService is the interface for Client methods -type ClientService interface { - ChangeSettings(params *ChangeSettingsParams, opts ...ClientOption) (*ChangeSettingsOK, error) - - CheckUpdates(params *CheckUpdatesParams, opts ...ClientOption) (*CheckUpdatesOK, error) - - GetReadOnlySettings(params *GetReadOnlySettingsParams, opts ...ClientOption) (*GetReadOnlySettingsOK, error) - - GetSettings(params *GetSettingsParams, opts ...ClientOption) (*GetSettingsOK, error) - - LeaderHealthCheck(params *LeaderHealthCheckParams, opts ...ClientOption) (*LeaderHealthCheckOK, error) - - ListChangeLogs(params *ListChangeLogsParams, opts ...ClientOption) (*ListChangeLogsOK, error) - - Logs(params *LogsParams, writer io.Writer, opts ...ClientOption) (*LogsOK, error) - - Readiness(params *ReadinessParams, opts ...ClientOption) (*ReadinessOK, error) - - StartUpdate(params *StartUpdateParams, opts ...ClientOption) (*StartUpdateOK, error) - - UpdateStatus(params *UpdateStatusParams, opts ...ClientOption) (*UpdateStatusOK, error) - - Version(params *VersionParams, opts ...ClientOption) (*VersionOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -ChangeSettings changes settings - -Changes PMM Server settings. -*/ -func (a *Client) ChangeSettings(params *ChangeSettingsParams, opts ...ClientOption) (*ChangeSettingsOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewChangeSettingsParams() - } - op := &runtime.ClientOperation{ - ID: "ChangeSettings", - Method: "PUT", - PathPattern: "/v1/server/settings", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &ChangeSettingsReader{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.(*ChangeSettingsOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*ChangeSettingsDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -CheckUpdates checks updates - -Checks for available PMM Server updates. -*/ -func (a *Client) CheckUpdates(params *CheckUpdatesParams, opts ...ClientOption) (*CheckUpdatesOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewCheckUpdatesParams() - } - op := &runtime.ClientOperation{ - ID: "CheckUpdates", - Method: "GET", - PathPattern: "/v1/server/updates", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &CheckUpdatesReader{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.(*CheckUpdatesOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*CheckUpdatesDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -GetReadOnlySettings gets read only settings - -Returns a stripped version of PMM Server settings. -*/ -func (a *Client) GetReadOnlySettings(params *GetReadOnlySettingsParams, opts ...ClientOption) (*GetReadOnlySettingsOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewGetReadOnlySettingsParams() - } - op := &runtime.ClientOperation{ - ID: "GetReadOnlySettings", - Method: "GET", - PathPattern: "/v1/server/settings/readonly", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &GetReadOnlySettingsReader{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.(*GetReadOnlySettingsOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*GetReadOnlySettingsDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -GetSettings gets settings - -Returns current PMM Server settings. -*/ -func (a *Client) GetSettings(params *GetSettingsParams, opts ...ClientOption) (*GetSettingsOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewGetSettingsParams() - } - op := &runtime.ClientOperation{ - ID: "GetSettings", - Method: "GET", - PathPattern: "/v1/server/settings", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &GetSettingsReader{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.(*GetSettingsOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*GetSettingsDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -LeaderHealthCheck checks leadership - -Checks if the instance is the leader in a cluster. Returns an error if the instance isn't the leader. -*/ -func (a *Client) LeaderHealthCheck(params *LeaderHealthCheckParams, opts ...ClientOption) (*LeaderHealthCheckOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewLeaderHealthCheckParams() - } - op := &runtime.ClientOperation{ - ID: "LeaderHealthCheck", - Method: "GET", - PathPattern: "/v1/server/leaderHealthCheck", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &LeaderHealthCheckReader{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.(*LeaderHealthCheckOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*LeaderHealthCheckDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -ListChangeLogs gets the changelog - -Display a changelog comparing the installed version to the latest available version. -*/ -func (a *Client) ListChangeLogs(params *ListChangeLogsParams, opts ...ClientOption) (*ListChangeLogsOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewListChangeLogsParams() - } - op := &runtime.ClientOperation{ - ID: "ListChangeLogs", - Method: "GET", - PathPattern: "/v1/server/updates/changelogs", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &ListChangeLogsReader{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.(*ListChangeLogsOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*ListChangeLogsDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -Logs logs - -Returns the PMM Server logs. -*/ -func (a *Client) Logs(params *LogsParams, writer io.Writer, opts ...ClientOption) (*LogsOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewLogsParams() - } - op := &runtime.ClientOperation{ - ID: "Logs", - Method: "GET", - PathPattern: "/v1/server/logs.zip", - ProducesMediaTypes: []string{"application/zip"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &LogsReader{formats: a.formats, writer: writer}, - 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.(*LogsOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*LogsDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -Readiness checks server readiness - -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. -*/ -func (a *Client) Readiness(params *ReadinessParams, opts ...ClientOption) (*ReadinessOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewReadinessParams() - } - op := &runtime.ClientOperation{ - ID: "Readiness", - Method: "GET", - PathPattern: "/v1/server/readyz", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &ReadinessReader{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.(*ReadinessOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*ReadinessDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -StartUpdate starts update - -Starts PMM Server update. -*/ -func (a *Client) StartUpdate(params *StartUpdateParams, opts ...ClientOption) (*StartUpdateOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewStartUpdateParams() - } - op := &runtime.ClientOperation{ - ID: "StartUpdate", - Method: "POST", - PathPattern: "/v1/server/updates:start", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &StartUpdateReader{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.(*StartUpdateOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*StartUpdateDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -UpdateStatus updates status - -Returns PMM Server update status. -*/ -func (a *Client) UpdateStatus(params *UpdateStatusParams, opts ...ClientOption) (*UpdateStatusOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewUpdateStatusParams() - } - op := &runtime.ClientOperation{ - ID: "UpdateStatus", - Method: "POST", - PathPattern: "/v1/server/updates:getStatus", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &UpdateStatusReader{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.(*UpdateStatusOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*UpdateStatusDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -Version versions - -Returns PMM Server versions. -*/ -func (a *Client) Version(params *VersionParams, opts ...ClientOption) (*VersionOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewVersionParams() - } - op := &runtime.ClientOperation{ - ID: "Version", - Method: "GET", - PathPattern: "/v1/server/version", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &VersionReader{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.(*VersionOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*VersionDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/api/server/v1/json/client/server_service/start_update_parameters.go b/api/server/v1/json/client/server_service/start_update_parameters.go deleted file mode 100644 index 82bb6c79150..00000000000 --- a/api/server/v1/json/client/server_service/start_update_parameters.go +++ /dev/null @@ -1,144 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package server_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" -) - -// NewStartUpdateParams creates a new StartUpdateParams 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 NewStartUpdateParams() *StartUpdateParams { - return &StartUpdateParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewStartUpdateParamsWithTimeout creates a new StartUpdateParams object -// with the ability to set a timeout on a request. -func NewStartUpdateParamsWithTimeout(timeout time.Duration) *StartUpdateParams { - return &StartUpdateParams{ - timeout: timeout, - } -} - -// NewStartUpdateParamsWithContext creates a new StartUpdateParams object -// with the ability to set a context for a request. -func NewStartUpdateParamsWithContext(ctx context.Context) *StartUpdateParams { - return &StartUpdateParams{ - Context: ctx, - } -} - -// NewStartUpdateParamsWithHTTPClient creates a new StartUpdateParams object -// with the ability to set a custom HTTPClient for a request. -func NewStartUpdateParamsWithHTTPClient(client *http.Client) *StartUpdateParams { - return &StartUpdateParams{ - HTTPClient: client, - } -} - -/* -StartUpdateParams contains all the parameters to send to the API endpoint - - for the start update operation. - - Typically these are written to a http.Request. -*/ -type StartUpdateParams struct { - // Body. - Body StartUpdateBody - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the start update params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *StartUpdateParams) WithDefaults() *StartUpdateParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the start update params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *StartUpdateParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the start update params -func (o *StartUpdateParams) WithTimeout(timeout time.Duration) *StartUpdateParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the start update params -func (o *StartUpdateParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the start update params -func (o *StartUpdateParams) WithContext(ctx context.Context) *StartUpdateParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the start update params -func (o *StartUpdateParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the start update params -func (o *StartUpdateParams) WithHTTPClient(client *http.Client) *StartUpdateParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the start update params -func (o *StartUpdateParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the start update params -func (o *StartUpdateParams) WithBody(body StartUpdateBody) *StartUpdateParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the start update params -func (o *StartUpdateParams) SetBody(body StartUpdateBody) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *StartUpdateParams) 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/server/v1/json/client/server_service/start_update_responses.go b/api/server/v1/json/client/server_service/start_update_responses.go deleted file mode 100644 index 97ef6b5f00c..00000000000 --- a/api/server/v1/json/client/server_service/start_update_responses.go +++ /dev/null @@ -1,658 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package server_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" -) - -// StartUpdateReader is a Reader for the StartUpdate structure. -type StartUpdateReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *StartUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewStartUpdateOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewStartUpdateDefault(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 - } -} - -// NewStartUpdateOK creates a StartUpdateOK with default headers values -func NewStartUpdateOK() *StartUpdateOK { - return &StartUpdateOK{} -} - -/* -StartUpdateOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type StartUpdateOK struct { - Payload *StartUpdateOKBody -} - -// IsSuccess returns true when this start update Ok response has a 2xx status code -func (o *StartUpdateOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this start update Ok response has a 3xx status code -func (o *StartUpdateOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this start update Ok response has a 4xx status code -func (o *StartUpdateOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this start update Ok response has a 5xx status code -func (o *StartUpdateOK) IsServerError() bool { - return false -} - -// IsCode returns true when this start update Ok response a status code equal to that given -func (o *StartUpdateOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the start update Ok response -func (o *StartUpdateOK) Code() int { - return 200 -} - -func (o *StartUpdateOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/server/updates:start][%d] startUpdateOk %s", 200, payload) -} - -func (o *StartUpdateOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/server/updates:start][%d] startUpdateOk %s", 200, payload) -} - -func (o *StartUpdateOK) GetPayload() *StartUpdateOKBody { - return o.Payload -} - -func (o *StartUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(StartUpdateOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -// NewStartUpdateDefault creates a StartUpdateDefault with default headers values -func NewStartUpdateDefault(code int) *StartUpdateDefault { - return &StartUpdateDefault{ - _statusCode: code, - } -} - -/* -StartUpdateDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type StartUpdateDefault struct { - _statusCode int - - Payload *StartUpdateDefaultBody -} - -// IsSuccess returns true when this start update default response has a 2xx status code -func (o *StartUpdateDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this start update default response has a 3xx status code -func (o *StartUpdateDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this start update default response has a 4xx status code -func (o *StartUpdateDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this start update default response has a 5xx status code -func (o *StartUpdateDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this start update default response a status code equal to that given -func (o *StartUpdateDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the start update default response -func (o *StartUpdateDefault) Code() int { - return o._statusCode -} - -func (o *StartUpdateDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/server/updates:start][%d] StartUpdate default %s", o._statusCode, payload) -} - -func (o *StartUpdateDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/server/updates:start][%d] StartUpdate default %s", o._statusCode, payload) -} - -func (o *StartUpdateDefault) GetPayload() *StartUpdateDefaultBody { - return o.Payload -} - -func (o *StartUpdateDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(StartUpdateDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -StartUpdateBody start update body -swagger:model StartUpdateBody -*/ -type StartUpdateBody struct { - // new image - NewImage string `json:"new_image,omitempty"` -} - -// Validate validates this start update body -func (o *StartUpdateBody) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this start update body based on context it is used -func (o *StartUpdateBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *StartUpdateBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *StartUpdateBody) UnmarshalBinary(b []byte) error { - var res StartUpdateBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -StartUpdateDefaultBody start update default body -swagger:model StartUpdateDefaultBody -*/ -type StartUpdateDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*StartUpdateDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this start update default body -func (o *StartUpdateDefaultBody) 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 *StartUpdateDefaultBody) 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("StartUpdate default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("StartUpdate default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this start update default body based on the context it is used -func (o *StartUpdateDefaultBody) 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 *StartUpdateDefaultBody) 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("StartUpdate default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("StartUpdate default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *StartUpdateDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *StartUpdateDefaultBody) UnmarshalBinary(b []byte) error { - var res StartUpdateDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -StartUpdateDefaultBodyDetailsItems0 `Any` contains an arbitrary serialized protocol buffer message along with a -// URL that describes the type of the serialized message. -// -// Protobuf library provides support to pack/unpack Any values in the form -// of utility functions or additional generated methods of the Any type. -// -// Example 1: Pack and unpack a message in C++. -// -// Foo foo = ...; -// Any any; -// any.PackFrom(foo); -// ... -// if (any.UnpackTo(&foo)) { -// ... -// } -// -// Example 2: Pack and unpack a message in Java. -// -// Foo foo = ...; -// Any any = Any.pack(foo); -// ... -// if (any.is(Foo.class)) { -// foo = any.unpack(Foo.class); -// } -// // or ... -// if (any.isSameTypeAs(Foo.getDefaultInstance())) { -// foo = any.unpack(Foo.getDefaultInstance()); -// } -// -// Example 3: Pack and unpack a message in Python. -// -// foo = Foo(...) -// any = Any() -// any.Pack(foo) -// ... -// if any.Is(Foo.DESCRIPTOR): -// any.Unpack(foo) -// ... -// -// Example 4: Pack and unpack a message in Go -// -// foo := &pb.Foo{...} -// any, err := anypb.New(foo) -// if err != nil { -// ... -// } -// ... -// foo := &pb.Foo{} -// if err := any.UnmarshalTo(foo); err != nil { -// ... -// } -// -// The pack methods provided by protobuf library will by default use -// 'type.googleapis.com/full.type.name' as the type URL and the unpack -// methods only use the fully qualified type name after the last '/' -// in the type URL, for example "foo.bar.com/x/y.z" will yield type -// name "y.z". -// -// JSON -// ==== -// The JSON representation of an `Any` value uses the regular -// representation of the deserialized, embedded message, with an -// additional field `@type` which contains the type URL. Example: -// -// package google.profile; -// message Person { -// string first_name = 1; -// string last_name = 2; -// } -// -// { -// "@type": "type.googleapis.com/google.profile.Person", -// "firstName": , -// "lastName": -// } -// -// If the embedded message type is well-known and has a custom JSON -// representation, that representation will be embedded adding a field -// `value` which holds the custom JSON in addition to the `@type` -// field. Example (for message [google.protobuf.Duration][]): -// -// { -// "@type": "type.googleapis.com/google.protobuf.Duration", -// "value": "1.212s" -// } -swagger:model StartUpdateDefaultBodyDetailsItems0 -*/ -type StartUpdateDefaultBodyDetailsItems0 struct { - // A URL/resource name that uniquely identifies the type of the serialized - // protocol buffer message. This string must contain at least - // one "/" character. The last segment of the URL's path must represent - // the fully qualified name of the type (as in - // `path/google.protobuf.Duration`). The name should be in a canonical form - // (e.g., leading "." is not accepted). - // - // In practice, teams usually precompile into the binary all types that they - // expect it to use in the context of Any. However, for URLs which use the - // scheme `http`, `https`, or no scheme, one can optionally set up a type - // server that maps type URLs to message definitions as follows: - // - // * If no scheme is provided, `https` is assumed. - // * An HTTP GET on the URL must yield a [google.protobuf.Type][] - // value in binary format, or produce an error. - // * Applications are allowed to cache lookup results based on the - // URL, or have them precompiled into a binary to avoid any - // lookup. Therefore, binary compatibility needs to be preserved - // on changes to types. (Use versioned type names to manage - // breaking changes.) - // - // Note: this functionality is not currently available in the official - // protobuf release, and it is not used for type URLs beginning with - // type.googleapis.com. As of May 2023, there are no widely used type server - // implementations and no plans to implement one. - // - // Schemes other than `http`, `https` (or the empty scheme) might be - // used with implementation specific semantics. - AtType string `json:"@type,omitempty"` - - // start update default body details items0 - StartUpdateDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *StartUpdateDefaultBodyDetailsItems0) UnmarshalJSON(data []byte) error { - // stage 1, bind the properties - var stage1 struct { - // A URL/resource name that uniquely identifies the type of the serialized - // protocol buffer message. This string must contain at least - // one "/" character. The last segment of the URL's path must represent - // the fully qualified name of the type (as in - // `path/google.protobuf.Duration`). The name should be in a canonical form - // (e.g., leading "." is not accepted). - // - // In practice, teams usually precompile into the binary all types that they - // expect it to use in the context of Any. However, for URLs which use the - // scheme `http`, `https`, or no scheme, one can optionally set up a type - // server that maps type URLs to message definitions as follows: - // - // * If no scheme is provided, `https` is assumed. - // * An HTTP GET on the URL must yield a [google.protobuf.Type][] - // value in binary format, or produce an error. - // * Applications are allowed to cache lookup results based on the - // URL, or have them precompiled into a binary to avoid any - // lookup. Therefore, binary compatibility needs to be preserved - // on changes to types. (Use versioned type names to manage - // breaking changes.) - // - // Note: this functionality is not currently available in the official - // protobuf release, and it is not used for type URLs beginning with - // type.googleapis.com. As of May 2023, there are no widely used type server - // implementations and no plans to implement one. - // - // Schemes other than `http`, `https` (or the empty scheme) might be - // used with implementation specific semantics. - AtType string `json:"@type,omitempty"` - } - if err := json.Unmarshal(data, &stage1); err != nil { - return err - } - var rcv StartUpdateDefaultBodyDetailsItems0 - - 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.StartUpdateDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o StartUpdateDefaultBodyDetailsItems0) MarshalJSON() ([]byte, error) { - var stage1 struct { - // A URL/resource name that uniquely identifies the type of the serialized - // protocol buffer message. This string must contain at least - // one "/" character. The last segment of the URL's path must represent - // the fully qualified name of the type (as in - // `path/google.protobuf.Duration`). The name should be in a canonical form - // (e.g., leading "." is not accepted). - // - // In practice, teams usually precompile into the binary all types that they - // expect it to use in the context of Any. However, for URLs which use the - // scheme `http`, `https`, or no scheme, one can optionally set up a type - // server that maps type URLs to message definitions as follows: - // - // * If no scheme is provided, `https` is assumed. - // * An HTTP GET on the URL must yield a [google.protobuf.Type][] - // value in binary format, or produce an error. - // * Applications are allowed to cache lookup results based on the - // URL, or have them precompiled into a binary to avoid any - // lookup. Therefore, binary compatibility needs to be preserved - // on changes to types. (Use versioned type names to manage - // breaking changes.) - // - // Note: this functionality is not currently available in the official - // protobuf release, and it is not used for type URLs beginning with - // type.googleapis.com. As of May 2023, there are no widely used type server - // implementations and no plans to implement one. - // - // Schemes other than `http`, `https` (or the empty scheme) might be - // used with implementation specific semantics. - 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.StartUpdateDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.StartUpdateDefaultBodyDetailsItems0) - 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 start update default body details items0 -func (o *StartUpdateDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this start update default body details items0 based on context it is used -func (o *StartUpdateDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *StartUpdateDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *StartUpdateDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res StartUpdateDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -StartUpdateOKBody start update OK body -swagger:model StartUpdateOKBody -*/ -type StartUpdateOKBody struct { - // Authentication token for getting update statuses. - AuthToken string `json:"auth_token,omitempty"` - - // Progress log offset. - LogOffset int64 `json:"log_offset,omitempty"` -} - -// Validate validates this start update OK body -func (o *StartUpdateOKBody) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this start update OK body based on context it is used -func (o *StartUpdateOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *StartUpdateOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *StartUpdateOKBody) UnmarshalBinary(b []byte) error { - var res StartUpdateOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/server/v1/json/client/server_service/update_status_parameters.go b/api/server/v1/json/client/server_service/update_status_parameters.go deleted file mode 100644 index c9ad7782841..00000000000 --- a/api/server/v1/json/client/server_service/update_status_parameters.go +++ /dev/null @@ -1,144 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package server_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" -) - -// NewUpdateStatusParams creates a new UpdateStatusParams 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 NewUpdateStatusParams() *UpdateStatusParams { - return &UpdateStatusParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewUpdateStatusParamsWithTimeout creates a new UpdateStatusParams object -// with the ability to set a timeout on a request. -func NewUpdateStatusParamsWithTimeout(timeout time.Duration) *UpdateStatusParams { - return &UpdateStatusParams{ - timeout: timeout, - } -} - -// NewUpdateStatusParamsWithContext creates a new UpdateStatusParams object -// with the ability to set a context for a request. -func NewUpdateStatusParamsWithContext(ctx context.Context) *UpdateStatusParams { - return &UpdateStatusParams{ - Context: ctx, - } -} - -// NewUpdateStatusParamsWithHTTPClient creates a new UpdateStatusParams object -// with the ability to set a custom HTTPClient for a request. -func NewUpdateStatusParamsWithHTTPClient(client *http.Client) *UpdateStatusParams { - return &UpdateStatusParams{ - HTTPClient: client, - } -} - -/* -UpdateStatusParams contains all the parameters to send to the API endpoint - - for the update status operation. - - Typically these are written to a http.Request. -*/ -type UpdateStatusParams struct { - // Body. - Body UpdateStatusBody - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the update status params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateStatusParams) WithDefaults() *UpdateStatusParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the update status params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateStatusParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the update status params -func (o *UpdateStatusParams) WithTimeout(timeout time.Duration) *UpdateStatusParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the update status params -func (o *UpdateStatusParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the update status params -func (o *UpdateStatusParams) WithContext(ctx context.Context) *UpdateStatusParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the update status params -func (o *UpdateStatusParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the update status params -func (o *UpdateStatusParams) WithHTTPClient(client *http.Client) *UpdateStatusParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the update status params -func (o *UpdateStatusParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the update status params -func (o *UpdateStatusParams) WithBody(body UpdateStatusBody) *UpdateStatusParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the update status params -func (o *UpdateStatusParams) SetBody(body UpdateStatusBody) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *UpdateStatusParams) 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/server/v1/json/client/server_service/update_status_responses.go b/api/server/v1/json/client/server_service/update_status_responses.go deleted file mode 100644 index b3d125d81dc..00000000000 --- a/api/server/v1/json/client/server_service/update_status_responses.go +++ /dev/null @@ -1,664 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package server_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" -) - -// UpdateStatusReader is a Reader for the UpdateStatus structure. -type UpdateStatusReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *UpdateStatusReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewUpdateStatusOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewUpdateStatusDefault(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 - } -} - -// NewUpdateStatusOK creates a UpdateStatusOK with default headers values -func NewUpdateStatusOK() *UpdateStatusOK { - return &UpdateStatusOK{} -} - -/* -UpdateStatusOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type UpdateStatusOK struct { - Payload *UpdateStatusOKBody -} - -// IsSuccess returns true when this update status Ok response has a 2xx status code -func (o *UpdateStatusOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this update status Ok response has a 3xx status code -func (o *UpdateStatusOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update status Ok response has a 4xx status code -func (o *UpdateStatusOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this update status Ok response has a 5xx status code -func (o *UpdateStatusOK) IsServerError() bool { - return false -} - -// IsCode returns true when this update status Ok response a status code equal to that given -func (o *UpdateStatusOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the update status Ok response -func (o *UpdateStatusOK) Code() int { - return 200 -} - -func (o *UpdateStatusOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/server/updates:getStatus][%d] updateStatusOk %s", 200, payload) -} - -func (o *UpdateStatusOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/server/updates:getStatus][%d] updateStatusOk %s", 200, payload) -} - -func (o *UpdateStatusOK) GetPayload() *UpdateStatusOKBody { - return o.Payload -} - -func (o *UpdateStatusOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(UpdateStatusOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -// NewUpdateStatusDefault creates a UpdateStatusDefault with default headers values -func NewUpdateStatusDefault(code int) *UpdateStatusDefault { - return &UpdateStatusDefault{ - _statusCode: code, - } -} - -/* -UpdateStatusDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type UpdateStatusDefault struct { - _statusCode int - - Payload *UpdateStatusDefaultBody -} - -// IsSuccess returns true when this update status default response has a 2xx status code -func (o *UpdateStatusDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this update status default response has a 3xx status code -func (o *UpdateStatusDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this update status default response has a 4xx status code -func (o *UpdateStatusDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this update status default response has a 5xx status code -func (o *UpdateStatusDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this update status default response a status code equal to that given -func (o *UpdateStatusDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the update status default response -func (o *UpdateStatusDefault) Code() int { - return o._statusCode -} - -func (o *UpdateStatusDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/server/updates:getStatus][%d] UpdateStatus default %s", o._statusCode, payload) -} - -func (o *UpdateStatusDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/server/updates:getStatus][%d] UpdateStatus default %s", o._statusCode, payload) -} - -func (o *UpdateStatusDefault) GetPayload() *UpdateStatusDefaultBody { - return o.Payload -} - -func (o *UpdateStatusDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(UpdateStatusDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -UpdateStatusBody update status body -swagger:model UpdateStatusBody -*/ -type UpdateStatusBody struct { - // Authentication token. - AuthToken string `json:"auth_token,omitempty"` - - // Progress log offset. - LogOffset int64 `json:"log_offset,omitempty"` -} - -// Validate validates this update status body -func (o *UpdateStatusBody) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this update status body based on context it is used -func (o *UpdateStatusBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *UpdateStatusBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *UpdateStatusBody) UnmarshalBinary(b []byte) error { - var res UpdateStatusBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -UpdateStatusDefaultBody update status default body -swagger:model UpdateStatusDefaultBody -*/ -type UpdateStatusDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*UpdateStatusDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this update status default body -func (o *UpdateStatusDefaultBody) 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 *UpdateStatusDefaultBody) 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("UpdateStatus default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("UpdateStatus default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this update status default body based on the context it is used -func (o *UpdateStatusDefaultBody) 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 *UpdateStatusDefaultBody) 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("UpdateStatus default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("UpdateStatus default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *UpdateStatusDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *UpdateStatusDefaultBody) UnmarshalBinary(b []byte) error { - var res UpdateStatusDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -UpdateStatusDefaultBodyDetailsItems0 `Any` contains an arbitrary serialized protocol buffer message along with a -// URL that describes the type of the serialized message. -// -// Protobuf library provides support to pack/unpack Any values in the form -// of utility functions or additional generated methods of the Any type. -// -// Example 1: Pack and unpack a message in C++. -// -// Foo foo = ...; -// Any any; -// any.PackFrom(foo); -// ... -// if (any.UnpackTo(&foo)) { -// ... -// } -// -// Example 2: Pack and unpack a message in Java. -// -// Foo foo = ...; -// Any any = Any.pack(foo); -// ... -// if (any.is(Foo.class)) { -// foo = any.unpack(Foo.class); -// } -// // or ... -// if (any.isSameTypeAs(Foo.getDefaultInstance())) { -// foo = any.unpack(Foo.getDefaultInstance()); -// } -// -// Example 3: Pack and unpack a message in Python. -// -// foo = Foo(...) -// any = Any() -// any.Pack(foo) -// ... -// if any.Is(Foo.DESCRIPTOR): -// any.Unpack(foo) -// ... -// -// Example 4: Pack and unpack a message in Go -// -// foo := &pb.Foo{...} -// any, err := anypb.New(foo) -// if err != nil { -// ... -// } -// ... -// foo := &pb.Foo{} -// if err := any.UnmarshalTo(foo); err != nil { -// ... -// } -// -// The pack methods provided by protobuf library will by default use -// 'type.googleapis.com/full.type.name' as the type URL and the unpack -// methods only use the fully qualified type name after the last '/' -// in the type URL, for example "foo.bar.com/x/y.z" will yield type -// name "y.z". -// -// JSON -// ==== -// The JSON representation of an `Any` value uses the regular -// representation of the deserialized, embedded message, with an -// additional field `@type` which contains the type URL. Example: -// -// package google.profile; -// message Person { -// string first_name = 1; -// string last_name = 2; -// } -// -// { -// "@type": "type.googleapis.com/google.profile.Person", -// "firstName": , -// "lastName": -// } -// -// If the embedded message type is well-known and has a custom JSON -// representation, that representation will be embedded adding a field -// `value` which holds the custom JSON in addition to the `@type` -// field. Example (for message [google.protobuf.Duration][]): -// -// { -// "@type": "type.googleapis.com/google.protobuf.Duration", -// "value": "1.212s" -// } -swagger:model UpdateStatusDefaultBodyDetailsItems0 -*/ -type UpdateStatusDefaultBodyDetailsItems0 struct { - // A URL/resource name that uniquely identifies the type of the serialized - // protocol buffer message. This string must contain at least - // one "/" character. The last segment of the URL's path must represent - // the fully qualified name of the type (as in - // `path/google.protobuf.Duration`). The name should be in a canonical form - // (e.g., leading "." is not accepted). - // - // In practice, teams usually precompile into the binary all types that they - // expect it to use in the context of Any. However, for URLs which use the - // scheme `http`, `https`, or no scheme, one can optionally set up a type - // server that maps type URLs to message definitions as follows: - // - // * If no scheme is provided, `https` is assumed. - // * An HTTP GET on the URL must yield a [google.protobuf.Type][] - // value in binary format, or produce an error. - // * Applications are allowed to cache lookup results based on the - // URL, or have them precompiled into a binary to avoid any - // lookup. Therefore, binary compatibility needs to be preserved - // on changes to types. (Use versioned type names to manage - // breaking changes.) - // - // Note: this functionality is not currently available in the official - // protobuf release, and it is not used for type URLs beginning with - // type.googleapis.com. As of May 2023, there are no widely used type server - // implementations and no plans to implement one. - // - // Schemes other than `http`, `https` (or the empty scheme) might be - // used with implementation specific semantics. - AtType string `json:"@type,omitempty"` - - // update status default body details items0 - UpdateStatusDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *UpdateStatusDefaultBodyDetailsItems0) UnmarshalJSON(data []byte) error { - // stage 1, bind the properties - var stage1 struct { - // A URL/resource name that uniquely identifies the type of the serialized - // protocol buffer message. This string must contain at least - // one "/" character. The last segment of the URL's path must represent - // the fully qualified name of the type (as in - // `path/google.protobuf.Duration`). The name should be in a canonical form - // (e.g., leading "." is not accepted). - // - // In practice, teams usually precompile into the binary all types that they - // expect it to use in the context of Any. However, for URLs which use the - // scheme `http`, `https`, or no scheme, one can optionally set up a type - // server that maps type URLs to message definitions as follows: - // - // * If no scheme is provided, `https` is assumed. - // * An HTTP GET on the URL must yield a [google.protobuf.Type][] - // value in binary format, or produce an error. - // * Applications are allowed to cache lookup results based on the - // URL, or have them precompiled into a binary to avoid any - // lookup. Therefore, binary compatibility needs to be preserved - // on changes to types. (Use versioned type names to manage - // breaking changes.) - // - // Note: this functionality is not currently available in the official - // protobuf release, and it is not used for type URLs beginning with - // type.googleapis.com. As of May 2023, there are no widely used type server - // implementations and no plans to implement one. - // - // Schemes other than `http`, `https` (or the empty scheme) might be - // used with implementation specific semantics. - AtType string `json:"@type,omitempty"` - } - if err := json.Unmarshal(data, &stage1); err != nil { - return err - } - var rcv UpdateStatusDefaultBodyDetailsItems0 - - 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.UpdateStatusDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o UpdateStatusDefaultBodyDetailsItems0) MarshalJSON() ([]byte, error) { - var stage1 struct { - // A URL/resource name that uniquely identifies the type of the serialized - // protocol buffer message. This string must contain at least - // one "/" character. The last segment of the URL's path must represent - // the fully qualified name of the type (as in - // `path/google.protobuf.Duration`). The name should be in a canonical form - // (e.g., leading "." is not accepted). - // - // In practice, teams usually precompile into the binary all types that they - // expect it to use in the context of Any. However, for URLs which use the - // scheme `http`, `https`, or no scheme, one can optionally set up a type - // server that maps type URLs to message definitions as follows: - // - // * If no scheme is provided, `https` is assumed. - // * An HTTP GET on the URL must yield a [google.protobuf.Type][] - // value in binary format, or produce an error. - // * Applications are allowed to cache lookup results based on the - // URL, or have them precompiled into a binary to avoid any - // lookup. Therefore, binary compatibility needs to be preserved - // on changes to types. (Use versioned type names to manage - // breaking changes.) - // - // Note: this functionality is not currently available in the official - // protobuf release, and it is not used for type URLs beginning with - // type.googleapis.com. As of May 2023, there are no widely used type server - // implementations and no plans to implement one. - // - // Schemes other than `http`, `https` (or the empty scheme) might be - // used with implementation specific semantics. - 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.UpdateStatusDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.UpdateStatusDefaultBodyDetailsItems0) - 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 update status default body details items0 -func (o *UpdateStatusDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this update status default body details items0 based on context it is used -func (o *UpdateStatusDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *UpdateStatusDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *UpdateStatusDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res UpdateStatusDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -UpdateStatusOKBody update status OK body -swagger:model UpdateStatusOKBody -*/ -type UpdateStatusOKBody struct { - // Progress log lines. - LogLines []string `json:"log_lines"` - - // Progress log offset for the next request. - LogOffset int64 `json:"log_offset,omitempty"` - - // True when update is done. - Done bool `json:"done,omitempty"` -} - -// Validate validates this update status OK body -func (o *UpdateStatusOKBody) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this update status OK body based on context it is used -func (o *UpdateStatusOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *UpdateStatusOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *UpdateStatusOKBody) UnmarshalBinary(b []byte) error { - var res UpdateStatusOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/server/v1/json/client/server_service/version_parameters.go b/api/server/v1/json/client/server_service/version_parameters.go deleted file mode 100644 index 89ff6074173..00000000000 --- a/api/server/v1/json/client/server_service/version_parameters.go +++ /dev/null @@ -1,160 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package server_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" -) - -// NewVersionParams creates a new VersionParams 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 NewVersionParams() *VersionParams { - return &VersionParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewVersionParamsWithTimeout creates a new VersionParams object -// with the ability to set a timeout on a request. -func NewVersionParamsWithTimeout(timeout time.Duration) *VersionParams { - return &VersionParams{ - timeout: timeout, - } -} - -// NewVersionParamsWithContext creates a new VersionParams object -// with the ability to set a context for a request. -func NewVersionParamsWithContext(ctx context.Context) *VersionParams { - return &VersionParams{ - Context: ctx, - } -} - -// NewVersionParamsWithHTTPClient creates a new VersionParams object -// with the ability to set a custom HTTPClient for a request. -func NewVersionParamsWithHTTPClient(client *http.Client) *VersionParams { - return &VersionParams{ - HTTPClient: client, - } -} - -/* -VersionParams contains all the parameters to send to the API endpoint - - for the version operation. - - Typically these are written to a http.Request. -*/ -type VersionParams struct { - /* Dummy. - - Dummy parameter for internal testing. Do not use. - */ - Dummy *string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the version params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *VersionParams) WithDefaults() *VersionParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the version params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *VersionParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the version params -func (o *VersionParams) WithTimeout(timeout time.Duration) *VersionParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the version params -func (o *VersionParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the version params -func (o *VersionParams) WithContext(ctx context.Context) *VersionParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the version params -func (o *VersionParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the version params -func (o *VersionParams) WithHTTPClient(client *http.Client) *VersionParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the version params -func (o *VersionParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithDummy adds the dummy to the version params -func (o *VersionParams) WithDummy(dummy *string) *VersionParams { - o.SetDummy(dummy) - return o -} - -// SetDummy adds the dummy to the version params -func (o *VersionParams) SetDummy(dummy *string) { - o.Dummy = dummy -} - -// WriteToRequest writes these params to a swagger request -func (o *VersionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.Dummy != nil { - - // query param dummy - var qrDummy string - - if o.Dummy != nil { - qrDummy = *o.Dummy - } - qDummy := qrDummy - if qDummy != "" { - if err := r.SetQueryParam("dummy", qDummy); err != nil { - return err - } - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/api/server/v1/json/client/server_service/version_responses.go b/api/server/v1/json/client/server_service/version_responses.go deleted file mode 100644 index 2357cddccd3..00000000000 --- a/api/server/v1/json/client/server_service/version_responses.go +++ /dev/null @@ -1,937 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package server_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" -) - -// VersionReader is a Reader for the Version structure. -type VersionReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *VersionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewVersionOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewVersionDefault(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 - } -} - -// NewVersionOK creates a VersionOK with default headers values -func NewVersionOK() *VersionOK { - return &VersionOK{} -} - -/* -VersionOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type VersionOK struct { - Payload *VersionOKBody -} - -// IsSuccess returns true when this version Ok response has a 2xx status code -func (o *VersionOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this version Ok response has a 3xx status code -func (o *VersionOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this version Ok response has a 4xx status code -func (o *VersionOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this version Ok response has a 5xx status code -func (o *VersionOK) IsServerError() bool { - return false -} - -// IsCode returns true when this version Ok response a status code equal to that given -func (o *VersionOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the version Ok response -func (o *VersionOK) Code() int { - return 200 -} - -func (o *VersionOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/server/version][%d] versionOk %s", 200, payload) -} - -func (o *VersionOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/server/version][%d] versionOk %s", 200, payload) -} - -func (o *VersionOK) GetPayload() *VersionOKBody { - return o.Payload -} - -func (o *VersionOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(VersionOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -// NewVersionDefault creates a VersionDefault with default headers values -func NewVersionDefault(code int) *VersionDefault { - return &VersionDefault{ - _statusCode: code, - } -} - -/* -VersionDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type VersionDefault struct { - _statusCode int - - Payload *VersionDefaultBody -} - -// IsSuccess returns true when this version default response has a 2xx status code -func (o *VersionDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this version default response has a 3xx status code -func (o *VersionDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this version default response has a 4xx status code -func (o *VersionDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this version default response has a 5xx status code -func (o *VersionDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this version default response a status code equal to that given -func (o *VersionDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the version default response -func (o *VersionDefault) Code() int { - return o._statusCode -} - -func (o *VersionDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/server/version][%d] Version default %s", o._statusCode, payload) -} - -func (o *VersionDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/server/version][%d] Version default %s", o._statusCode, payload) -} - -func (o *VersionDefault) GetPayload() *VersionDefaultBody { - return o.Payload -} - -func (o *VersionDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(VersionDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -VersionDefaultBody version default body -swagger:model VersionDefaultBody -*/ -type VersionDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*VersionDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this version default body -func (o *VersionDefaultBody) 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 *VersionDefaultBody) 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("Version default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("Version default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this version default body based on the context it is used -func (o *VersionDefaultBody) 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 *VersionDefaultBody) 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("Version default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("Version default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *VersionDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *VersionDefaultBody) UnmarshalBinary(b []byte) error { - var res VersionDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -VersionDefaultBodyDetailsItems0 `Any` contains an arbitrary serialized protocol buffer message along with a -// URL that describes the type of the serialized message. -// -// Protobuf library provides support to pack/unpack Any values in the form -// of utility functions or additional generated methods of the Any type. -// -// Example 1: Pack and unpack a message in C++. -// -// Foo foo = ...; -// Any any; -// any.PackFrom(foo); -// ... -// if (any.UnpackTo(&foo)) { -// ... -// } -// -// Example 2: Pack and unpack a message in Java. -// -// Foo foo = ...; -// Any any = Any.pack(foo); -// ... -// if (any.is(Foo.class)) { -// foo = any.unpack(Foo.class); -// } -// // or ... -// if (any.isSameTypeAs(Foo.getDefaultInstance())) { -// foo = any.unpack(Foo.getDefaultInstance()); -// } -// -// Example 3: Pack and unpack a message in Python. -// -// foo = Foo(...) -// any = Any() -// any.Pack(foo) -// ... -// if any.Is(Foo.DESCRIPTOR): -// any.Unpack(foo) -// ... -// -// Example 4: Pack and unpack a message in Go -// -// foo := &pb.Foo{...} -// any, err := anypb.New(foo) -// if err != nil { -// ... -// } -// ... -// foo := &pb.Foo{} -// if err := any.UnmarshalTo(foo); err != nil { -// ... -// } -// -// The pack methods provided by protobuf library will by default use -// 'type.googleapis.com/full.type.name' as the type URL and the unpack -// methods only use the fully qualified type name after the last '/' -// in the type URL, for example "foo.bar.com/x/y.z" will yield type -// name "y.z". -// -// JSON -// ==== -// The JSON representation of an `Any` value uses the regular -// representation of the deserialized, embedded message, with an -// additional field `@type` which contains the type URL. Example: -// -// package google.profile; -// message Person { -// string first_name = 1; -// string last_name = 2; -// } -// -// { -// "@type": "type.googleapis.com/google.profile.Person", -// "firstName": , -// "lastName": -// } -// -// If the embedded message type is well-known and has a custom JSON -// representation, that representation will be embedded adding a field -// `value` which holds the custom JSON in addition to the `@type` -// field. Example (for message [google.protobuf.Duration][]): -// -// { -// "@type": "type.googleapis.com/google.protobuf.Duration", -// "value": "1.212s" -// } -swagger:model VersionDefaultBodyDetailsItems0 -*/ -type VersionDefaultBodyDetailsItems0 struct { - // A URL/resource name that uniquely identifies the type of the serialized - // protocol buffer message. This string must contain at least - // one "/" character. The last segment of the URL's path must represent - // the fully qualified name of the type (as in - // `path/google.protobuf.Duration`). The name should be in a canonical form - // (e.g., leading "." is not accepted). - // - // In practice, teams usually precompile into the binary all types that they - // expect it to use in the context of Any. However, for URLs which use the - // scheme `http`, `https`, or no scheme, one can optionally set up a type - // server that maps type URLs to message definitions as follows: - // - // * If no scheme is provided, `https` is assumed. - // * An HTTP GET on the URL must yield a [google.protobuf.Type][] - // value in binary format, or produce an error. - // * Applications are allowed to cache lookup results based on the - // URL, or have them precompiled into a binary to avoid any - // lookup. Therefore, binary compatibility needs to be preserved - // on changes to types. (Use versioned type names to manage - // breaking changes.) - // - // Note: this functionality is not currently available in the official - // protobuf release, and it is not used for type URLs beginning with - // type.googleapis.com. As of May 2023, there are no widely used type server - // implementations and no plans to implement one. - // - // Schemes other than `http`, `https` (or the empty scheme) might be - // used with implementation specific semantics. - AtType string `json:"@type,omitempty"` - - // version default body details items0 - VersionDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *VersionDefaultBodyDetailsItems0) UnmarshalJSON(data []byte) error { - // stage 1, bind the properties - var stage1 struct { - // A URL/resource name that uniquely identifies the type of the serialized - // protocol buffer message. This string must contain at least - // one "/" character. The last segment of the URL's path must represent - // the fully qualified name of the type (as in - // `path/google.protobuf.Duration`). The name should be in a canonical form - // (e.g., leading "." is not accepted). - // - // In practice, teams usually precompile into the binary all types that they - // expect it to use in the context of Any. However, for URLs which use the - // scheme `http`, `https`, or no scheme, one can optionally set up a type - // server that maps type URLs to message definitions as follows: - // - // * If no scheme is provided, `https` is assumed. - // * An HTTP GET on the URL must yield a [google.protobuf.Type][] - // value in binary format, or produce an error. - // * Applications are allowed to cache lookup results based on the - // URL, or have them precompiled into a binary to avoid any - // lookup. Therefore, binary compatibility needs to be preserved - // on changes to types. (Use versioned type names to manage - // breaking changes.) - // - // Note: this functionality is not currently available in the official - // protobuf release, and it is not used for type URLs beginning with - // type.googleapis.com. As of May 2023, there are no widely used type server - // implementations and no plans to implement one. - // - // Schemes other than `http`, `https` (or the empty scheme) might be - // used with implementation specific semantics. - AtType string `json:"@type,omitempty"` - } - if err := json.Unmarshal(data, &stage1); err != nil { - return err - } - var rcv VersionDefaultBodyDetailsItems0 - - 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.VersionDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o VersionDefaultBodyDetailsItems0) MarshalJSON() ([]byte, error) { - var stage1 struct { - // A URL/resource name that uniquely identifies the type of the serialized - // protocol buffer message. This string must contain at least - // one "/" character. The last segment of the URL's path must represent - // the fully qualified name of the type (as in - // `path/google.protobuf.Duration`). The name should be in a canonical form - // (e.g., leading "." is not accepted). - // - // In practice, teams usually precompile into the binary all types that they - // expect it to use in the context of Any. However, for URLs which use the - // scheme `http`, `https`, or no scheme, one can optionally set up a type - // server that maps type URLs to message definitions as follows: - // - // * If no scheme is provided, `https` is assumed. - // * An HTTP GET on the URL must yield a [google.protobuf.Type][] - // value in binary format, or produce an error. - // * Applications are allowed to cache lookup results based on the - // URL, or have them precompiled into a binary to avoid any - // lookup. Therefore, binary compatibility needs to be preserved - // on changes to types. (Use versioned type names to manage - // breaking changes.) - // - // Note: this functionality is not currently available in the official - // protobuf release, and it is not used for type URLs beginning with - // type.googleapis.com. As of May 2023, there are no widely used type server - // implementations and no plans to implement one. - // - // Schemes other than `http`, `https` (or the empty scheme) might be - // used with implementation specific semantics. - 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.VersionDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.VersionDefaultBodyDetailsItems0) - 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 version default body details items0 -func (o *VersionDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this version default body details items0 based on context it is used -func (o *VersionDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *VersionDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *VersionDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res VersionDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -VersionOKBody version OK body -swagger:model VersionOKBody -*/ -type VersionOKBody struct { - // PMM Server version. - Version string `json:"version,omitempty"` - - // DistributionMethod defines PMM Server distribution method: Docker image, OVF/OVA, or AMI. - // Enum: ["DISTRIBUTION_METHOD_UNSPECIFIED","DISTRIBUTION_METHOD_DOCKER","DISTRIBUTION_METHOD_OVF","DISTRIBUTION_METHOD_AMI","DISTRIBUTION_METHOD_AZURE","DISTRIBUTION_METHOD_DO"] - DistributionMethod *string `json:"distribution_method,omitempty"` - - // managed - Managed *VersionOKBodyManaged `json:"managed,omitempty"` - - // server - Server *VersionOKBodyServer `json:"server,omitempty"` -} - -// Validate validates this version OK body -func (o *VersionOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateDistributionMethod(formats); err != nil { - res = append(res, err) - } - - if err := o.validateManaged(formats); err != nil { - res = append(res, err) - } - - if err := o.validateServer(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var versionOkBodyTypeDistributionMethodPropEnum []any - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["DISTRIBUTION_METHOD_UNSPECIFIED","DISTRIBUTION_METHOD_DOCKER","DISTRIBUTION_METHOD_OVF","DISTRIBUTION_METHOD_AMI","DISTRIBUTION_METHOD_AZURE","DISTRIBUTION_METHOD_DO"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - versionOkBodyTypeDistributionMethodPropEnum = append(versionOkBodyTypeDistributionMethodPropEnum, v) - } -} - -const ( - - // VersionOKBodyDistributionMethodDISTRIBUTIONMETHODUNSPECIFIED captures enum value "DISTRIBUTION_METHOD_UNSPECIFIED" - VersionOKBodyDistributionMethodDISTRIBUTIONMETHODUNSPECIFIED string = "DISTRIBUTION_METHOD_UNSPECIFIED" - - // VersionOKBodyDistributionMethodDISTRIBUTIONMETHODDOCKER captures enum value "DISTRIBUTION_METHOD_DOCKER" - VersionOKBodyDistributionMethodDISTRIBUTIONMETHODDOCKER string = "DISTRIBUTION_METHOD_DOCKER" - - // VersionOKBodyDistributionMethodDISTRIBUTIONMETHODOVF captures enum value "DISTRIBUTION_METHOD_OVF" - VersionOKBodyDistributionMethodDISTRIBUTIONMETHODOVF string = "DISTRIBUTION_METHOD_OVF" - - // VersionOKBodyDistributionMethodDISTRIBUTIONMETHODAMI captures enum value "DISTRIBUTION_METHOD_AMI" - VersionOKBodyDistributionMethodDISTRIBUTIONMETHODAMI string = "DISTRIBUTION_METHOD_AMI" - - // VersionOKBodyDistributionMethodDISTRIBUTIONMETHODAZURE captures enum value "DISTRIBUTION_METHOD_AZURE" - VersionOKBodyDistributionMethodDISTRIBUTIONMETHODAZURE string = "DISTRIBUTION_METHOD_AZURE" - - // VersionOKBodyDistributionMethodDISTRIBUTIONMETHODDO captures enum value "DISTRIBUTION_METHOD_DO" - VersionOKBodyDistributionMethodDISTRIBUTIONMETHODDO string = "DISTRIBUTION_METHOD_DO" -) - -// prop value enum -func (o *VersionOKBody) validateDistributionMethodEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, versionOkBodyTypeDistributionMethodPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *VersionOKBody) validateDistributionMethod(formats strfmt.Registry) error { - if swag.IsZero(o.DistributionMethod) { // not required - return nil - } - - // value enum - if err := o.validateDistributionMethodEnum("versionOk"+"."+"distribution_method", "body", *o.DistributionMethod); err != nil { - return err - } - - return nil -} - -func (o *VersionOKBody) validateManaged(formats strfmt.Registry) error { - if swag.IsZero(o.Managed) { // not required - return nil - } - - if o.Managed != nil { - if err := o.Managed.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("versionOk" + "." + "managed") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("versionOk" + "." + "managed") - } - - return err - } - } - - return nil -} - -func (o *VersionOKBody) validateServer(formats strfmt.Registry) error { - if swag.IsZero(o.Server) { // not required - return nil - } - - if o.Server != nil { - if err := o.Server.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("versionOk" + "." + "server") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("versionOk" + "." + "server") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this version OK body based on the context it is used -func (o *VersionOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateManaged(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateServer(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *VersionOKBody) contextValidateManaged(ctx context.Context, formats strfmt.Registry) error { - if o.Managed != nil { - - if swag.IsZero(o.Managed) { // not required - return nil - } - - if err := o.Managed.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("versionOk" + "." + "managed") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("versionOk" + "." + "managed") - } - - return err - } - } - - return nil -} - -func (o *VersionOKBody) contextValidateServer(ctx context.Context, formats strfmt.Registry) error { - if o.Server != nil { - - if swag.IsZero(o.Server) { // not required - return nil - } - - if err := o.Server.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("versionOk" + "." + "server") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("versionOk" + "." + "server") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *VersionOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *VersionOKBody) UnmarshalBinary(b []byte) error { - var res VersionOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -VersionOKBodyManaged VersionInfo describes component version, or PMM Server as a whole. -swagger:model VersionOKBodyManaged -*/ -type VersionOKBodyManaged struct { - // User-visible version. - Version string `json:"version,omitempty"` - - // Full version for debugging. - FullVersion string `json:"full_version,omitempty"` - - // Build or release date. - // Format: date-time - Timestamp strfmt.DateTime `json:"timestamp,omitempty"` -} - -// Validate validates this version OK body managed -func (o *VersionOKBodyManaged) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateTimestamp(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *VersionOKBodyManaged) validateTimestamp(formats strfmt.Registry) error { - if swag.IsZero(o.Timestamp) { // not required - return nil - } - - if err := validate.FormatOf("versionOk"+"."+"managed"+"."+"timestamp", "body", "date-time", o.Timestamp.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this version OK body managed based on context it is used -func (o *VersionOKBodyManaged) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *VersionOKBodyManaged) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *VersionOKBodyManaged) UnmarshalBinary(b []byte) error { - var res VersionOKBodyManaged - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -VersionOKBodyServer VersionInfo describes component version, or PMM Server as a whole. -swagger:model VersionOKBodyServer -*/ -type VersionOKBodyServer struct { - // User-visible version. - Version string `json:"version,omitempty"` - - // Full version for debugging. - FullVersion string `json:"full_version,omitempty"` - - // Build or release date. - // Format: date-time - Timestamp strfmt.DateTime `json:"timestamp,omitempty"` -} - -// Validate validates this version OK body server -func (o *VersionOKBodyServer) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateTimestamp(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *VersionOKBodyServer) validateTimestamp(formats strfmt.Registry) error { - if swag.IsZero(o.Timestamp) { // not required - return nil - } - - if err := validate.FormatOf("versionOk"+"."+"server"+"."+"timestamp", "body", "date-time", o.Timestamp.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this version OK body server based on context it is used -func (o *VersionOKBodyServer) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *VersionOKBodyServer) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *VersionOKBodyServer) UnmarshalBinary(b []byte) error { - var res VersionOKBodyServer - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/server/v1/json/v1.json b/api/server/v1/json/v1.json deleted file mode 100644 index 0abbd7c3951..00000000000 --- a/api/server/v1/json/v1.json +++ /dev/null @@ -1,1332 +0,0 @@ -{ - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "schemes": [ - "https", - "http" - ], - "swagger": "2.0", - "info": { - "title": "PMM Server API", - "version": "v1" - }, - "paths": { - "/v1/server/leaderHealthCheck": { - "get": { - "description": "Checks if the instance is the leader in a cluster. Returns an error if the instance isn't the leader.", - "tags": [ - "ServerService" - ], - "summary": "Check Leadership", - "operationId": "LeaderHealthCheck", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "description": "This probe is available without authentication, so it should not contain any data.", - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "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 }", - "type": "object", - "properties": { - "@type": { - "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.", - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/server/logs.zip": { - "get": { - "description": "Returns the PMM Server logs.", - "produces": [ - "application/zip" - ], - "tags": [ - "ServerService" - ], - "summary": "Logs", - "operationId": "Logs", - "parameters": [ - { - "type": "boolean", - "description": "Include performance profiling data,", - "name": "pprof", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "file" - } - }, - "default": { - "description": "An error response.", - "schema": { - "description": "ErrorResponse is a message returned on HTTP error.", - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32" - }, - "error": { - "type": "string" - }, - "message": { - "type": "string" - } - } - } - } - } - } - }, - "/v1/server/readyz": { - "get": { - "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.", - "tags": [ - "ServerService" - ], - "summary": "Check server readiness", - "operationId": "Readiness", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "description": "This probe is available without authentication, so it should not contain any data.", - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "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 }", - "type": "object", - "properties": { - "@type": { - "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.", - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/server/settings": { - "get": { - "description": "Returns current PMM Server settings.", - "tags": [ - "ServerService" - ], - "summary": "Get settings", - "operationId": "GetSettings", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "settings": { - "description": "Settings represents PMM Server settings.", - "type": "object", - "properties": { - "updates_enabled": { - "description": "True if updates are enabled.", - "type": "boolean", - "x-order": 0 - }, - "telemetry_enabled": { - "description": "True if telemetry is enabled.", - "type": "boolean", - "x-order": 1 - }, - "metrics_resolutions": { - "description": "MetricsResolutions represents Prometheus exporters metrics resolutions.", - "type": "object", - "properties": { - "hr": { - "description": "High resolution. Should have a suffix in JSON: 1s, 1m, 1h.", - "type": "string", - "x-order": 0 - }, - "mr": { - "description": "Medium resolution. Should have a suffix in JSON: 1s, 1m, 1h.", - "type": "string", - "x-order": 1 - }, - "lr": { - "description": "Low resolution. Should have a suffix in JSON: 1s, 1m, 1h.", - "type": "string", - "x-order": 2 - } - }, - "x-order": 2 - }, - "data_retention": { - "type": "string", - "x-order": 3 - }, - "ssh_key": { - "type": "string", - "x-order": 4 - }, - "aws_partitions": { - "type": "array", - "items": { - "type": "string" - }, - "x-order": 5 - }, - "advisor_enabled": { - "description": "True if Advisor is enabled.", - "type": "boolean", - "x-order": 6 - }, - "platform_email": { - "description": "Percona Platform user's email, if this PMM instance is linked to the Platform.", - "type": "string", - "x-order": 7 - }, - "alerting_enabled": { - "description": "True if Alerting is enabled.", - "type": "boolean", - "x-order": 8 - }, - "pmm_public_address": { - "description": "PMM Server public address.", - "type": "string", - "x-order": 9 - }, - "advisor_run_intervals": { - "description": "AdvisorRunIntervals represents intervals between each run of Advisor checks.", - "type": "object", - "properties": { - "standard_interval": { - "description": "Standard check interval.", - "type": "string", - "x-order": 0 - }, - "rare_interval": { - "description": "Interval for rare check runs.", - "type": "string", - "x-order": 1 - }, - "frequent_interval": { - "description": "Interval for frequent check runs.", - "type": "string", - "x-order": 2 - } - }, - "x-order": 10 - }, - "backup_management_enabled": { - "description": "True if Backup Management is enabled.", - "type": "boolean", - "x-order": 11 - }, - "azurediscover_enabled": { - "description": "True if Azure Discover is enabled.", - "type": "boolean", - "x-order": 12 - }, - "connected_to_platform": { - "type": "boolean", - "title": "True if the PMM instance is connected to Platform", - "x-order": 13 - }, - "telemetry_summaries": { - "type": "array", - "title": "Includes list of collected telemetry", - "items": { - "type": "string" - }, - "x-order": 14 - }, - "enable_access_control": { - "description": "True if Access Control is enabled.", - "type": "boolean", - "x-order": 15 - }, - "default_role_id": { - "description": "Default Access Control role ID for new users.", - "type": "integer", - "format": "int64", - "x-order": 16 - }, - "enable_internal_pg_qan": { - "description": "True if Query Analytics for PMM's internal PG database is enabled.", - "type": "boolean", - "x-order": 17 - }, - "update_snooze_duration": { - "type": "string", - "title": "Duration for which an update is snoozed", - "x-order": 18 - } - }, - "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": { - "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 }", - "type": "object", - "properties": { - "@type": { - "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.", - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - }, - "put": { - "description": "Changes PMM Server settings.", - "tags": [ - "ServerService" - ], - "summary": "Change settings", - "operationId": "ChangeSettings", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "enable_updates": { - "type": "boolean", - "x-nullable": true, - "x-order": 0 - }, - "enable_telemetry": { - "type": "boolean", - "x-nullable": true, - "x-order": 1 - }, - "metrics_resolutions": { - "description": "MetricsResolutions represents Prometheus exporters metrics resolutions.", - "type": "object", - "properties": { - "hr": { - "description": "High resolution. Should have a suffix in JSON: 1s, 1m, 1h.", - "type": "string", - "x-order": 0 - }, - "mr": { - "description": "Medium resolution. Should have a suffix in JSON: 1s, 1m, 1h.", - "type": "string", - "x-order": 1 - }, - "lr": { - "description": "Low resolution. Should have a suffix in JSON: 1s, 1m, 1h.", - "type": "string", - "x-order": 2 - } - }, - "x-order": 2 - }, - "data_retention": { - "description": "A number of full days for Prometheus and QAN data retention. Should have a suffix in JSON: 2592000s, 43200m, 720h.", - "type": "string", - "x-order": 3 - }, - "ssh_key": { - "type": "string", - "x-nullable": true, - "x-order": 4 - }, - "aws_partitions": { - "description": "A wrapper for a string array. This type allows to distinguish between an empty array and a null value.", - "type": "object", - "properties": { - "values": { - "type": "array", - "items": { - "type": "string" - }, - "x-order": 0 - } - }, - "x-nullable": true, - "x-order": 5 - }, - "enable_advisor": { - "description": "Enable Advisor.", - "type": "boolean", - "x-nullable": true, - "x-order": 6 - }, - "enable_alerting": { - "description": "Enable Alerting.", - "type": "boolean", - "x-nullable": true, - "x-order": 7 - }, - "pmm_public_address": { - "description": "PMM Server public address.", - "type": "string", - "x-nullable": true, - "x-order": 8 - }, - "advisor_run_intervals": { - "description": "AdvisorRunIntervals represents intervals between each run of Advisor checks.", - "type": "object", - "properties": { - "standard_interval": { - "description": "Standard check interval.", - "type": "string", - "x-order": 0 - }, - "rare_interval": { - "description": "Interval for rare check runs.", - "type": "string", - "x-order": 1 - }, - "frequent_interval": { - "description": "Interval for frequent check runs.", - "type": "string", - "x-order": 2 - } - }, - "x-order": 9 - }, - "enable_azurediscover": { - "description": "Enable Azure Discover.", - "type": "boolean", - "x-nullable": true, - "x-order": 10 - }, - "enable_backup_management": { - "description": "Enable Backup Management.", - "type": "boolean", - "x-nullable": true, - "x-order": 11 - }, - "enable_access_control": { - "type": "boolean", - "title": "Enable Access Control", - "x-nullable": true, - "x-order": 12 - }, - "enable_internal_pg_qan": { - "description": "Enable Query Analytics for PMM's internal PG database.", - "type": "boolean", - "x-nullable": true, - "x-order": 13 - }, - "update_snooze_duration": { - "description": "A number of full days for which an update is snoozed, i.e. a multiple of 24h: 2592000s, 43200m, 720h.", - "type": "string", - "x-order": 14 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "settings": { - "description": "Settings represents PMM Server settings.", - "type": "object", - "properties": { - "updates_enabled": { - "description": "True if updates are enabled.", - "type": "boolean", - "x-order": 0 - }, - "telemetry_enabled": { - "description": "True if telemetry is enabled.", - "type": "boolean", - "x-order": 1 - }, - "metrics_resolutions": { - "description": "MetricsResolutions represents Prometheus exporters metrics resolutions.", - "type": "object", - "properties": { - "hr": { - "description": "High resolution. Should have a suffix in JSON: 1s, 1m, 1h.", - "type": "string", - "x-order": 0 - }, - "mr": { - "description": "Medium resolution. Should have a suffix in JSON: 1s, 1m, 1h.", - "type": "string", - "x-order": 1 - }, - "lr": { - "description": "Low resolution. Should have a suffix in JSON: 1s, 1m, 1h.", - "type": "string", - "x-order": 2 - } - }, - "x-order": 2 - }, - "data_retention": { - "type": "string", - "x-order": 3 - }, - "ssh_key": { - "type": "string", - "x-order": 4 - }, - "aws_partitions": { - "type": "array", - "items": { - "type": "string" - }, - "x-order": 5 - }, - "advisor_enabled": { - "description": "True if Advisor is enabled.", - "type": "boolean", - "x-order": 6 - }, - "platform_email": { - "description": "Percona Platform user's email, if this PMM instance is linked to the Platform.", - "type": "string", - "x-order": 7 - }, - "alerting_enabled": { - "description": "True if Alerting is enabled.", - "type": "boolean", - "x-order": 8 - }, - "pmm_public_address": { - "description": "PMM Server public address.", - "type": "string", - "x-order": 9 - }, - "advisor_run_intervals": { - "description": "AdvisorRunIntervals represents intervals between each run of Advisor checks.", - "type": "object", - "properties": { - "standard_interval": { - "description": "Standard check interval.", - "type": "string", - "x-order": 0 - }, - "rare_interval": { - "description": "Interval for rare check runs.", - "type": "string", - "x-order": 1 - }, - "frequent_interval": { - "description": "Interval for frequent check runs.", - "type": "string", - "x-order": 2 - } - }, - "x-order": 10 - }, - "backup_management_enabled": { - "description": "True if Backup Management is enabled.", - "type": "boolean", - "x-order": 11 - }, - "azurediscover_enabled": { - "description": "True if Azure Discover is enabled.", - "type": "boolean", - "x-order": 12 - }, - "connected_to_platform": { - "type": "boolean", - "title": "True if the PMM instance is connected to Platform", - "x-order": 13 - }, - "telemetry_summaries": { - "type": "array", - "title": "Includes list of collected telemetry", - "items": { - "type": "string" - }, - "x-order": 14 - }, - "enable_access_control": { - "description": "True if Access Control is enabled.", - "type": "boolean", - "x-order": 15 - }, - "default_role_id": { - "description": "Default Access Control role ID for new users.", - "type": "integer", - "format": "int64", - "x-order": 16 - }, - "enable_internal_pg_qan": { - "description": "True if Query Analytics for PMM's internal PG database is enabled.", - "type": "boolean", - "x-order": 17 - }, - "update_snooze_duration": { - "type": "string", - "title": "Duration for which an update is snoozed", - "x-order": 18 - } - }, - "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": { - "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 }", - "type": "object", - "properties": { - "@type": { - "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.", - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/server/settings/readonly": { - "get": { - "description": "Returns a stripped version of PMM Server settings.", - "tags": [ - "ServerService" - ], - "summary": "Get read-only settings", - "operationId": "GetReadOnlySettings", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "settings": { - "description": "ReadOnlySettings represents a stripped-down version of PMM Server settings that can be accessed by users of all roles.", - "type": "object", - "properties": { - "updates_enabled": { - "description": "True if updates are enabled.", - "type": "boolean", - "x-order": 0 - }, - "telemetry_enabled": { - "description": "True if telemetry is enabled.", - "type": "boolean", - "x-order": 1 - }, - "advisor_enabled": { - "description": "True if Advisor is enabled.", - "type": "boolean", - "x-order": 2 - }, - "alerting_enabled": { - "description": "True if Alerting is enabled.", - "type": "boolean", - "x-order": 3 - }, - "pmm_public_address": { - "description": "PMM Server public address.", - "type": "string", - "x-order": 4 - }, - "backup_management_enabled": { - "description": "True if Backup Management is enabled.", - "type": "boolean", - "x-order": 5 - }, - "azurediscover_enabled": { - "description": "True if Azure Discover is enabled.", - "type": "boolean", - "x-order": 6 - }, - "enable_access_control": { - "description": "True if Access Control is enabled.", - "type": "boolean", - "x-order": 7 - } - }, - "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": { - "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 }", - "type": "object", - "properties": { - "@type": { - "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.", - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/server/updates": { - "get": { - "description": "Checks for available PMM Server updates.", - "tags": [ - "ServerService" - ], - "summary": "Check updates", - "operationId": "CheckUpdates", - "parameters": [ - { - "type": "boolean", - "description": "If false, cached information may be returned.", - "name": "force", - "in": "query" - }, - { - "type": "boolean", - "description": "If true, only installed version will be in response.", - "name": "only_installed_version", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "installed": { - "description": "VersionInfo describes component version, or PMM Server as a whole.", - "type": "object", - "properties": { - "version": { - "description": "User-visible version.", - "type": "string", - "x-order": 0 - }, - "full_version": { - "description": "Full version for debugging.", - "type": "string", - "x-order": 1 - }, - "timestamp": { - "description": "Build or release date.", - "type": "string", - "format": "date-time", - "x-order": 2 - } - }, - "x-order": 0 - }, - "latest": { - "type": "object", - "properties": { - "version": { - "description": "PMM Version.", - "type": "string", - "x-order": 0 - }, - "tag": { - "description": "Docker image tag.", - "type": "string", - "x-order": 1 - }, - "timestamp": { - "description": "Release date.", - "type": "string", - "format": "date-time", - "x-order": 2 - }, - "release_notes_url": { - "description": "Release notes URL for the version (if available).", - "type": "string", - "x-order": 3 - }, - "release_notes_text": { - "description": "Release notes text for the version (if available).", - "type": "string", - "x-order": 4 - } - }, - "x-order": 1 - }, - "update_available": { - "description": "True if there is a PMM Server update available.", - "type": "boolean", - "x-order": 2 - }, - "latest_news_url": { - "description": "Latest available PMM Server release announcement URL.", - "type": "string", - "x-order": 3 - }, - "last_check": { - "description": "Last check time.", - "type": "string", - "format": "date-time", - "x-order": 4 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "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 }", - "type": "object", - "properties": { - "@type": { - "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.", - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/server/updates/changelogs": { - "get": { - "description": "Display a changelog comparing the installed version to the latest available version.", - "tags": [ - "ServerService" - ], - "summary": "Get the changelog", - "operationId": "ListChangeLogs", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "updates": { - "description": "List of available updates.", - "type": "array", - "items": { - "type": "object", - "properties": { - "version": { - "description": "PMM Version.", - "type": "string", - "x-order": 0 - }, - "tag": { - "description": "Docker image tag.", - "type": "string", - "x-order": 1 - }, - "timestamp": { - "description": "Release date.", - "type": "string", - "format": "date-time", - "x-order": 2 - }, - "release_notes_url": { - "description": "Release notes URL for the version (if available).", - "type": "string", - "x-order": 3 - }, - "release_notes_text": { - "description": "Release notes text for the version (if available).", - "type": "string", - "x-order": 4 - } - } - }, - "x-order": 0 - }, - "last_check": { - "description": "Last check time.", - "type": "string", - "format": "date-time", - "x-order": 1 - } - } - } - }, - "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": { - "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 }", - "type": "object", - "properties": { - "@type": { - "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.", - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/server/updates:getStatus": { - "post": { - "description": "Returns PMM Server update status.", - "tags": [ - "ServerService" - ], - "summary": "Update status", - "operationId": "UpdateStatus", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "auth_token": { - "description": "Authentication token.", - "type": "string", - "x-order": 0 - }, - "log_offset": { - "description": "Progress log offset.", - "type": "integer", - "format": "int64", - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "log_lines": { - "description": "Progress log lines.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 0 - }, - "log_offset": { - "description": "Progress log offset for the next request.", - "type": "integer", - "format": "int64", - "x-order": 1 - }, - "done": { - "description": "True when update is done.", - "type": "boolean", - "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": { - "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 }", - "type": "object", - "properties": { - "@type": { - "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.", - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/server/updates:start": { - "post": { - "description": "Starts PMM Server update.", - "tags": [ - "ServerService" - ], - "summary": "Start update", - "operationId": "StartUpdate", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "new_image": { - "type": "string", - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "auth_token": { - "description": "Authentication token for getting update statuses.", - "type": "string", - "x-order": 0 - }, - "log_offset": { - "description": "Progress log offset.", - "type": "integer", - "format": "int64", - "x-order": 1 - } - } - } - }, - "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": { - "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 }", - "type": "object", - "properties": { - "@type": { - "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.", - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/server/version": { - "get": { - "description": "Returns PMM Server versions.", - "tags": [ - "ServerService" - ], - "summary": "Version", - "operationId": "Version", - "parameters": [ - { - "type": "string", - "description": "Dummy parameter for internal testing. Do not use.", - "name": "dummy", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "version": { - "description": "PMM Server version.", - "type": "string", - "x-order": 0 - }, - "server": { - "description": "VersionInfo describes component version, or PMM Server as a whole.", - "type": "object", - "properties": { - "version": { - "description": "User-visible version.", - "type": "string", - "x-order": 0 - }, - "full_version": { - "description": "Full version for debugging.", - "type": "string", - "x-order": 1 - }, - "timestamp": { - "description": "Build or release date.", - "type": "string", - "format": "date-time", - "x-order": 2 - } - }, - "x-order": 1 - }, - "managed": { - "description": "VersionInfo describes component version, or PMM Server as a whole.", - "type": "object", - "properties": { - "version": { - "description": "User-visible version.", - "type": "string", - "x-order": 0 - }, - "full_version": { - "description": "Full version for debugging.", - "type": "string", - "x-order": 1 - }, - "timestamp": { - "description": "Build or release date.", - "type": "string", - "format": "date-time", - "x-order": 2 - } - }, - "x-order": 2 - }, - "distribution_method": { - "description": "DistributionMethod defines PMM Server distribution method: Docker image, OVF/OVA, or AMI.", - "type": "string", - "default": "DISTRIBUTION_METHOD_UNSPECIFIED", - "enum": [ - "DISTRIBUTION_METHOD_UNSPECIFIED", - "DISTRIBUTION_METHOD_DOCKER", - "DISTRIBUTION_METHOD_OVF", - "DISTRIBUTION_METHOD_AMI", - "DISTRIBUTION_METHOD_AZURE", - "DISTRIBUTION_METHOD_DO" - ], - "x-order": 3 - } - } - } - }, - "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": { - "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 }", - "type": "object", - "properties": { - "@type": { - "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.", - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - } - }, - "tags": [ - { - "name": "ServerService" - } - ] -} \ No newline at end of file diff --git a/api/server/v1/server.pb.go b/api/server/v1/server.pb.go deleted file mode 100644 index 2d68fd2f651..00000000000 --- a/api/server/v1/server.pb.go +++ /dev/null @@ -1,2031 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.10 -// protoc (unknown) -// source: server/v1/server.proto - -package serverv1 - -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" - durationpb "google.golang.org/protobuf/types/known/durationpb" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" - - common "github.com/percona/pmm/api/common" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// DistributionMethod defines PMM Server distribution method: Docker image, OVF/OVA, or AMI. -type DistributionMethod int32 - -const ( - DistributionMethod_DISTRIBUTION_METHOD_UNSPECIFIED DistributionMethod = 0 - DistributionMethod_DISTRIBUTION_METHOD_DOCKER DistributionMethod = 1 - DistributionMethod_DISTRIBUTION_METHOD_OVF DistributionMethod = 2 - DistributionMethod_DISTRIBUTION_METHOD_AMI DistributionMethod = 3 - DistributionMethod_DISTRIBUTION_METHOD_AZURE DistributionMethod = 4 - DistributionMethod_DISTRIBUTION_METHOD_DO DistributionMethod = 5 -) - -// Enum value maps for DistributionMethod. -var ( - DistributionMethod_name = map[int32]string{ - 0: "DISTRIBUTION_METHOD_UNSPECIFIED", - 1: "DISTRIBUTION_METHOD_DOCKER", - 2: "DISTRIBUTION_METHOD_OVF", - 3: "DISTRIBUTION_METHOD_AMI", - 4: "DISTRIBUTION_METHOD_AZURE", - 5: "DISTRIBUTION_METHOD_DO", - } - DistributionMethod_value = map[string]int32{ - "DISTRIBUTION_METHOD_UNSPECIFIED": 0, - "DISTRIBUTION_METHOD_DOCKER": 1, - "DISTRIBUTION_METHOD_OVF": 2, - "DISTRIBUTION_METHOD_AMI": 3, - "DISTRIBUTION_METHOD_AZURE": 4, - "DISTRIBUTION_METHOD_DO": 5, - } -) - -func (x DistributionMethod) Enum() *DistributionMethod { - p := new(DistributionMethod) - *p = x - return p -} - -func (x DistributionMethod) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (DistributionMethod) Descriptor() protoreflect.EnumDescriptor { - return file_server_v1_server_proto_enumTypes[0].Descriptor() -} - -func (DistributionMethod) Type() protoreflect.EnumType { - return &file_server_v1_server_proto_enumTypes[0] -} - -func (x DistributionMethod) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use DistributionMethod.Descriptor instead. -func (DistributionMethod) EnumDescriptor() ([]byte, []int) { - return file_server_v1_server_proto_rawDescGZIP(), []int{0} -} - -// VersionInfo describes component version, or PMM Server as a whole. -type VersionInfo struct { - state protoimpl.MessageState `protogen:"open.v1"` - // User-visible version. - Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` - // Full version for debugging. - FullVersion string `protobuf:"bytes,2,opt,name=full_version,json=fullVersion,proto3" json:"full_version,omitempty"` - // Build or release date. - Timestamp *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *VersionInfo) Reset() { - *x = VersionInfo{} - mi := &file_server_v1_server_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *VersionInfo) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*VersionInfo) ProtoMessage() {} - -func (x *VersionInfo) ProtoReflect() protoreflect.Message { - mi := &file_server_v1_server_proto_msgTypes[0] - 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 VersionInfo.ProtoReflect.Descriptor instead. -func (*VersionInfo) Descriptor() ([]byte, []int) { - return file_server_v1_server_proto_rawDescGZIP(), []int{0} -} - -func (x *VersionInfo) GetVersion() string { - if x != nil { - return x.Version - } - return "" -} - -func (x *VersionInfo) GetFullVersion() string { - if x != nil { - return x.FullVersion - } - return "" -} - -func (x *VersionInfo) GetTimestamp() *timestamppb.Timestamp { - if x != nil { - return x.Timestamp - } - return nil -} - -type VersionRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Dummy parameter for internal testing. Do not use. - Dummy string `protobuf:"bytes,1,opt,name=dummy,proto3" json:"dummy,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *VersionRequest) Reset() { - *x = VersionRequest{} - mi := &file_server_v1_server_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *VersionRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*VersionRequest) ProtoMessage() {} - -func (x *VersionRequest) ProtoReflect() protoreflect.Message { - mi := &file_server_v1_server_proto_msgTypes[1] - 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 VersionRequest.ProtoReflect.Descriptor instead. -func (*VersionRequest) Descriptor() ([]byte, []int) { - return file_server_v1_server_proto_rawDescGZIP(), []int{1} -} - -func (x *VersionRequest) GetDummy() string { - if x != nil { - return x.Dummy - } - return "" -} - -type VersionResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // PMM Server version. - Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` - // Detailed PMM Server version information. - Server *VersionInfo `protobuf:"bytes,2,opt,name=server,proto3" json:"server,omitempty"` - // pmm-managed version information for debugging. - Managed *VersionInfo `protobuf:"bytes,3,opt,name=managed,proto3" json:"managed,omitempty"` - // PMM Server distribution method. - DistributionMethod DistributionMethod `protobuf:"varint,4,opt,name=distribution_method,json=distributionMethod,proto3,enum=server.v1.DistributionMethod" json:"distribution_method,omitempty"` // TODO Versions and statuses of Grafana, Prometheus, PostgreSQL, qan-api2, ClickHouse, pmm-agent, etc. - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *VersionResponse) Reset() { - *x = VersionResponse{} - mi := &file_server_v1_server_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *VersionResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*VersionResponse) ProtoMessage() {} - -func (x *VersionResponse) ProtoReflect() protoreflect.Message { - mi := &file_server_v1_server_proto_msgTypes[2] - 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 VersionResponse.ProtoReflect.Descriptor instead. -func (*VersionResponse) Descriptor() ([]byte, []int) { - return file_server_v1_server_proto_rawDescGZIP(), []int{2} -} - -func (x *VersionResponse) GetVersion() string { - if x != nil { - return x.Version - } - return "" -} - -func (x *VersionResponse) GetServer() *VersionInfo { - if x != nil { - return x.Server - } - return nil -} - -func (x *VersionResponse) GetManaged() *VersionInfo { - if x != nil { - return x.Managed - } - return nil -} - -func (x *VersionResponse) GetDistributionMethod() DistributionMethod { - if x != nil { - return x.DistributionMethod - } - return DistributionMethod_DISTRIBUTION_METHOD_UNSPECIFIED -} - -type ReadinessRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ReadinessRequest) Reset() { - *x = ReadinessRequest{} - mi := &file_server_v1_server_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ReadinessRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ReadinessRequest) ProtoMessage() {} - -func (x *ReadinessRequest) ProtoReflect() protoreflect.Message { - mi := &file_server_v1_server_proto_msgTypes[3] - 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 ReadinessRequest.ProtoReflect.Descriptor instead. -func (*ReadinessRequest) Descriptor() ([]byte, []int) { - return file_server_v1_server_proto_rawDescGZIP(), []int{3} -} - -type ReadinessResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ReadinessResponse) Reset() { - *x = ReadinessResponse{} - mi := &file_server_v1_server_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ReadinessResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ReadinessResponse) ProtoMessage() {} - -func (x *ReadinessResponse) ProtoReflect() protoreflect.Message { - mi := &file_server_v1_server_proto_msgTypes[4] - 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 ReadinessResponse.ProtoReflect.Descriptor instead. -func (*ReadinessResponse) Descriptor() ([]byte, []int) { - return file_server_v1_server_proto_rawDescGZIP(), []int{4} -} - -type LeaderHealthCheckRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *LeaderHealthCheckRequest) Reset() { - *x = LeaderHealthCheckRequest{} - mi := &file_server_v1_server_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *LeaderHealthCheckRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*LeaderHealthCheckRequest) ProtoMessage() {} - -func (x *LeaderHealthCheckRequest) ProtoReflect() protoreflect.Message { - mi := &file_server_v1_server_proto_msgTypes[5] - 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 LeaderHealthCheckRequest.ProtoReflect.Descriptor instead. -func (*LeaderHealthCheckRequest) Descriptor() ([]byte, []int) { - return file_server_v1_server_proto_rawDescGZIP(), []int{5} -} - -type LeaderHealthCheckResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *LeaderHealthCheckResponse) Reset() { - *x = LeaderHealthCheckResponse{} - mi := &file_server_v1_server_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *LeaderHealthCheckResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*LeaderHealthCheckResponse) ProtoMessage() {} - -func (x *LeaderHealthCheckResponse) ProtoReflect() protoreflect.Message { - mi := &file_server_v1_server_proto_msgTypes[6] - 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 LeaderHealthCheckResponse.ProtoReflect.Descriptor instead. -func (*LeaderHealthCheckResponse) Descriptor() ([]byte, []int) { - return file_server_v1_server_proto_rawDescGZIP(), []int{6} -} - -type CheckUpdatesRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // If false, cached information may be returned. - Force bool `protobuf:"varint,1,opt,name=force,proto3" json:"force,omitempty"` - // If true, only installed version will be in response. - OnlyInstalledVersion bool `protobuf:"varint,2,opt,name=only_installed_version,json=onlyInstalledVersion,proto3" json:"only_installed_version,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CheckUpdatesRequest) Reset() { - *x = CheckUpdatesRequest{} - mi := &file_server_v1_server_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CheckUpdatesRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CheckUpdatesRequest) ProtoMessage() {} - -func (x *CheckUpdatesRequest) ProtoReflect() protoreflect.Message { - mi := &file_server_v1_server_proto_msgTypes[7] - 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 CheckUpdatesRequest.ProtoReflect.Descriptor instead. -func (*CheckUpdatesRequest) Descriptor() ([]byte, []int) { - return file_server_v1_server_proto_rawDescGZIP(), []int{7} -} - -func (x *CheckUpdatesRequest) GetForce() bool { - if x != nil { - return x.Force - } - return false -} - -func (x *CheckUpdatesRequest) GetOnlyInstalledVersion() bool { - if x != nil { - return x.OnlyInstalledVersion - } - return false -} - -type DockerVersionInfo struct { - state protoimpl.MessageState `protogen:"open.v1"` - // PMM Version. - Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` - // Docker image tag. - Tag string `protobuf:"bytes,2,opt,name=tag,proto3" json:"tag,omitempty"` - // Release date. - Timestamp *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - // Release notes URL for the version (if available). - ReleaseNotesUrl string `protobuf:"bytes,4,opt,name=release_notes_url,json=releaseNotesUrl,proto3" json:"release_notes_url,omitempty"` - // Release notes text for the version (if available). - ReleaseNotesText string `protobuf:"bytes,5,opt,name=release_notes_text,json=releaseNotesText,proto3" json:"release_notes_text,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DockerVersionInfo) Reset() { - *x = DockerVersionInfo{} - mi := &file_server_v1_server_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DockerVersionInfo) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DockerVersionInfo) ProtoMessage() {} - -func (x *DockerVersionInfo) ProtoReflect() protoreflect.Message { - mi := &file_server_v1_server_proto_msgTypes[8] - 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 DockerVersionInfo.ProtoReflect.Descriptor instead. -func (*DockerVersionInfo) Descriptor() ([]byte, []int) { - return file_server_v1_server_proto_rawDescGZIP(), []int{8} -} - -func (x *DockerVersionInfo) GetVersion() string { - if x != nil { - return x.Version - } - return "" -} - -func (x *DockerVersionInfo) GetTag() string { - if x != nil { - return x.Tag - } - return "" -} - -func (x *DockerVersionInfo) GetTimestamp() *timestamppb.Timestamp { - if x != nil { - return x.Timestamp - } - return nil -} - -func (x *DockerVersionInfo) GetReleaseNotesUrl() string { - if x != nil { - return x.ReleaseNotesUrl - } - return "" -} - -func (x *DockerVersionInfo) GetReleaseNotesText() string { - if x != nil { - return x.ReleaseNotesText - } - return "" -} - -type CheckUpdatesResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Currently installed PMM Server version. - Installed *VersionInfo `protobuf:"bytes,1,opt,name=installed,proto3" json:"installed,omitempty"` - // Latest available PMM Server version. - Latest *DockerVersionInfo `protobuf:"bytes,2,opt,name=latest,proto3" json:"latest,omitempty"` - // True if there is a PMM Server update available. - UpdateAvailable bool `protobuf:"varint,3,opt,name=update_available,json=updateAvailable,proto3" json:"update_available,omitempty"` - // Latest available PMM Server release announcement URL. - LatestNewsUrl string `protobuf:"bytes,4,opt,name=latest_news_url,json=latestNewsUrl,proto3" json:"latest_news_url,omitempty"` - // Last check time. - LastCheck *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=last_check,json=lastCheck,proto3" json:"last_check,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CheckUpdatesResponse) Reset() { - *x = CheckUpdatesResponse{} - mi := &file_server_v1_server_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CheckUpdatesResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CheckUpdatesResponse) ProtoMessage() {} - -func (x *CheckUpdatesResponse) ProtoReflect() protoreflect.Message { - mi := &file_server_v1_server_proto_msgTypes[9] - 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 CheckUpdatesResponse.ProtoReflect.Descriptor instead. -func (*CheckUpdatesResponse) Descriptor() ([]byte, []int) { - return file_server_v1_server_proto_rawDescGZIP(), []int{9} -} - -func (x *CheckUpdatesResponse) GetInstalled() *VersionInfo { - if x != nil { - return x.Installed - } - return nil -} - -func (x *CheckUpdatesResponse) GetLatest() *DockerVersionInfo { - if x != nil { - return x.Latest - } - return nil -} - -func (x *CheckUpdatesResponse) GetUpdateAvailable() bool { - if x != nil { - return x.UpdateAvailable - } - return false -} - -func (x *CheckUpdatesResponse) GetLatestNewsUrl() string { - if x != nil { - return x.LatestNewsUrl - } - return "" -} - -func (x *CheckUpdatesResponse) GetLastCheck() *timestamppb.Timestamp { - if x != nil { - return x.LastCheck - } - return nil -} - -type ListChangeLogsRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ListChangeLogsRequest) Reset() { - *x = ListChangeLogsRequest{} - mi := &file_server_v1_server_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ListChangeLogsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListChangeLogsRequest) ProtoMessage() {} - -func (x *ListChangeLogsRequest) ProtoReflect() protoreflect.Message { - mi := &file_server_v1_server_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 ListChangeLogsRequest.ProtoReflect.Descriptor instead. -func (*ListChangeLogsRequest) Descriptor() ([]byte, []int) { - return file_server_v1_server_proto_rawDescGZIP(), []int{10} -} - -type ListChangeLogsResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // List of available updates. - Updates []*DockerVersionInfo `protobuf:"bytes,1,rep,name=updates,proto3" json:"updates,omitempty"` - // Last check time. - LastCheck *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=last_check,json=lastCheck,proto3" json:"last_check,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ListChangeLogsResponse) Reset() { - *x = ListChangeLogsResponse{} - mi := &file_server_v1_server_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ListChangeLogsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListChangeLogsResponse) ProtoMessage() {} - -func (x *ListChangeLogsResponse) ProtoReflect() protoreflect.Message { - mi := &file_server_v1_server_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 ListChangeLogsResponse.ProtoReflect.Descriptor instead. -func (*ListChangeLogsResponse) Descriptor() ([]byte, []int) { - return file_server_v1_server_proto_rawDescGZIP(), []int{11} -} - -func (x *ListChangeLogsResponse) GetUpdates() []*DockerVersionInfo { - if x != nil { - return x.Updates - } - return nil -} - -func (x *ListChangeLogsResponse) GetLastCheck() *timestamppb.Timestamp { - if x != nil { - return x.LastCheck - } - return nil -} - -type StartUpdateRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - NewImage string `protobuf:"bytes,1,opt,name=new_image,json=newImage,proto3" json:"new_image,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StartUpdateRequest) Reset() { - *x = StartUpdateRequest{} - mi := &file_server_v1_server_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StartUpdateRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StartUpdateRequest) ProtoMessage() {} - -func (x *StartUpdateRequest) ProtoReflect() protoreflect.Message { - mi := &file_server_v1_server_proto_msgTypes[12] - 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 StartUpdateRequest.ProtoReflect.Descriptor instead. -func (*StartUpdateRequest) Descriptor() ([]byte, []int) { - return file_server_v1_server_proto_rawDescGZIP(), []int{12} -} - -func (x *StartUpdateRequest) GetNewImage() string { - if x != nil { - return x.NewImage - } - return "" -} - -type StartUpdateResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Authentication token for getting update statuses. - AuthToken string `protobuf:"bytes,1,opt,name=auth_token,json=authToken,proto3" json:"auth_token,omitempty"` - // Progress log offset. - LogOffset uint32 `protobuf:"varint,2,opt,name=log_offset,json=logOffset,proto3" json:"log_offset,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StartUpdateResponse) Reset() { - *x = StartUpdateResponse{} - mi := &file_server_v1_server_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StartUpdateResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StartUpdateResponse) ProtoMessage() {} - -func (x *StartUpdateResponse) ProtoReflect() protoreflect.Message { - mi := &file_server_v1_server_proto_msgTypes[13] - 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 StartUpdateResponse.ProtoReflect.Descriptor instead. -func (*StartUpdateResponse) Descriptor() ([]byte, []int) { - return file_server_v1_server_proto_rawDescGZIP(), []int{13} -} - -func (x *StartUpdateResponse) GetAuthToken() string { - if x != nil { - return x.AuthToken - } - return "" -} - -func (x *StartUpdateResponse) GetLogOffset() uint32 { - if x != nil { - return x.LogOffset - } - return 0 -} - -type UpdateStatusRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Authentication token. - AuthToken string `protobuf:"bytes,1,opt,name=auth_token,json=authToken,proto3" json:"auth_token,omitempty"` - // Progress log offset. - LogOffset uint32 `protobuf:"varint,2,opt,name=log_offset,json=logOffset,proto3" json:"log_offset,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *UpdateStatusRequest) Reset() { - *x = UpdateStatusRequest{} - mi := &file_server_v1_server_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *UpdateStatusRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateStatusRequest) ProtoMessage() {} - -func (x *UpdateStatusRequest) ProtoReflect() protoreflect.Message { - mi := &file_server_v1_server_proto_msgTypes[14] - 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 UpdateStatusRequest.ProtoReflect.Descriptor instead. -func (*UpdateStatusRequest) Descriptor() ([]byte, []int) { - return file_server_v1_server_proto_rawDescGZIP(), []int{14} -} - -func (x *UpdateStatusRequest) GetAuthToken() string { - if x != nil { - return x.AuthToken - } - return "" -} - -func (x *UpdateStatusRequest) GetLogOffset() uint32 { - if x != nil { - return x.LogOffset - } - return 0 -} - -type UpdateStatusResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Progress log lines. - LogLines []string `protobuf:"bytes,1,rep,name=log_lines,json=logLines,proto3" json:"log_lines,omitempty"` - // Progress log offset for the next request. - LogOffset uint32 `protobuf:"varint,2,opt,name=log_offset,json=logOffset,proto3" json:"log_offset,omitempty"` - // True when update is done. - Done bool `protobuf:"varint,3,opt,name=done,proto3" json:"done,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *UpdateStatusResponse) Reset() { - *x = UpdateStatusResponse{} - mi := &file_server_v1_server_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *UpdateStatusResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateStatusResponse) ProtoMessage() {} - -func (x *UpdateStatusResponse) ProtoReflect() protoreflect.Message { - mi := &file_server_v1_server_proto_msgTypes[15] - 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 UpdateStatusResponse.ProtoReflect.Descriptor instead. -func (*UpdateStatusResponse) Descriptor() ([]byte, []int) { - return file_server_v1_server_proto_rawDescGZIP(), []int{15} -} - -func (x *UpdateStatusResponse) GetLogLines() []string { - if x != nil { - return x.LogLines - } - return nil -} - -func (x *UpdateStatusResponse) GetLogOffset() uint32 { - if x != nil { - return x.LogOffset - } - return 0 -} - -func (x *UpdateStatusResponse) GetDone() bool { - if x != nil { - return x.Done - } - return false -} - -// MetricsResolutions represents Prometheus exporters metrics resolutions. -type MetricsResolutions struct { - state protoimpl.MessageState `protogen:"open.v1"` - // High resolution. Should have a suffix in JSON: 1s, 1m, 1h. - Hr *durationpb.Duration `protobuf:"bytes,1,opt,name=hr,proto3" json:"hr,omitempty"` - // Medium resolution. Should have a suffix in JSON: 1s, 1m, 1h. - Mr *durationpb.Duration `protobuf:"bytes,2,opt,name=mr,proto3" json:"mr,omitempty"` - // Low resolution. Should have a suffix in JSON: 1s, 1m, 1h. - Lr *durationpb.Duration `protobuf:"bytes,3,opt,name=lr,proto3" json:"lr,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *MetricsResolutions) Reset() { - *x = MetricsResolutions{} - mi := &file_server_v1_server_proto_msgTypes[16] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *MetricsResolutions) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MetricsResolutions) ProtoMessage() {} - -func (x *MetricsResolutions) ProtoReflect() protoreflect.Message { - mi := &file_server_v1_server_proto_msgTypes[16] - 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 MetricsResolutions.ProtoReflect.Descriptor instead. -func (*MetricsResolutions) Descriptor() ([]byte, []int) { - return file_server_v1_server_proto_rawDescGZIP(), []int{16} -} - -func (x *MetricsResolutions) GetHr() *durationpb.Duration { - if x != nil { - return x.Hr - } - return nil -} - -func (x *MetricsResolutions) GetMr() *durationpb.Duration { - if x != nil { - return x.Mr - } - return nil -} - -func (x *MetricsResolutions) GetLr() *durationpb.Duration { - if x != nil { - return x.Lr - } - return nil -} - -// AdvisorRunIntervals represents intervals between each run of Advisor checks. -type AdvisorRunIntervals struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Standard check interval. - StandardInterval *durationpb.Duration `protobuf:"bytes,1,opt,name=standard_interval,json=standardInterval,proto3" json:"standard_interval,omitempty"` - // Interval for rare check runs. - RareInterval *durationpb.Duration `protobuf:"bytes,2,opt,name=rare_interval,json=rareInterval,proto3" json:"rare_interval,omitempty"` - // Interval for frequent check runs. - FrequentInterval *durationpb.Duration `protobuf:"bytes,3,opt,name=frequent_interval,json=frequentInterval,proto3" json:"frequent_interval,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AdvisorRunIntervals) Reset() { - *x = AdvisorRunIntervals{} - mi := &file_server_v1_server_proto_msgTypes[17] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AdvisorRunIntervals) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AdvisorRunIntervals) ProtoMessage() {} - -func (x *AdvisorRunIntervals) ProtoReflect() protoreflect.Message { - mi := &file_server_v1_server_proto_msgTypes[17] - 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 AdvisorRunIntervals.ProtoReflect.Descriptor instead. -func (*AdvisorRunIntervals) Descriptor() ([]byte, []int) { - return file_server_v1_server_proto_rawDescGZIP(), []int{17} -} - -func (x *AdvisorRunIntervals) GetStandardInterval() *durationpb.Duration { - if x != nil { - return x.StandardInterval - } - return nil -} - -func (x *AdvisorRunIntervals) GetRareInterval() *durationpb.Duration { - if x != nil { - return x.RareInterval - } - return nil -} - -func (x *AdvisorRunIntervals) GetFrequentInterval() *durationpb.Duration { - if x != nil { - return x.FrequentInterval - } - return nil -} - -// Settings represents PMM Server settings. -type Settings struct { - state protoimpl.MessageState `protogen:"open.v1"` - // True if updates are enabled. - UpdatesEnabled bool `protobuf:"varint,1,opt,name=updates_enabled,json=updatesEnabled,proto3" json:"updates_enabled,omitempty"` - // True if telemetry is enabled. - TelemetryEnabled bool `protobuf:"varint,2,opt,name=telemetry_enabled,json=telemetryEnabled,proto3" json:"telemetry_enabled,omitempty"` - MetricsResolutions *MetricsResolutions `protobuf:"bytes,3,opt,name=metrics_resolutions,json=metricsResolutions,proto3" json:"metrics_resolutions,omitempty"` - DataRetention *durationpb.Duration `protobuf:"bytes,4,opt,name=data_retention,json=dataRetention,proto3" json:"data_retention,omitempty"` - SshKey string `protobuf:"bytes,5,opt,name=ssh_key,json=sshKey,proto3" json:"ssh_key,omitempty"` - AwsPartitions []string `protobuf:"bytes,6,rep,name=aws_partitions,json=awsPartitions,proto3" json:"aws_partitions,omitempty"` - // True if Advisor is enabled. - AdvisorEnabled bool `protobuf:"varint,7,opt,name=advisor_enabled,json=advisorEnabled,proto3" json:"advisor_enabled,omitempty"` - // Percona Platform user's email, if this PMM instance is linked to the Platform. - PlatformEmail string `protobuf:"bytes,8,opt,name=platform_email,json=platformEmail,proto3" json:"platform_email,omitempty"` - // True if Alerting is enabled. - AlertingEnabled bool `protobuf:"varint,10,opt,name=alerting_enabled,json=alertingEnabled,proto3" json:"alerting_enabled,omitempty"` - // PMM Server public address. - PmmPublicAddress string `protobuf:"bytes,11,opt,name=pmm_public_address,json=pmmPublicAddress,proto3" json:"pmm_public_address,omitempty"` - // Intervals between Advisor runs. - AdvisorRunIntervals *AdvisorRunIntervals `protobuf:"bytes,12,opt,name=advisor_run_intervals,json=advisorRunIntervals,proto3" json:"advisor_run_intervals,omitempty"` - // True if Backup Management is enabled. - BackupManagementEnabled bool `protobuf:"varint,13,opt,name=backup_management_enabled,json=backupManagementEnabled,proto3" json:"backup_management_enabled,omitempty"` - // True if Azure Discover is enabled. - AzurediscoverEnabled bool `protobuf:"varint,14,opt,name=azurediscover_enabled,json=azurediscoverEnabled,proto3" json:"azurediscover_enabled,omitempty"` - // True if the PMM instance is connected to Platform - ConnectedToPlatform bool `protobuf:"varint,15,opt,name=connected_to_platform,json=connectedToPlatform,proto3" json:"connected_to_platform,omitempty"` - // Includes list of collected telemetry - TelemetrySummaries []string `protobuf:"bytes,16,rep,name=telemetry_summaries,json=telemetrySummaries,proto3" json:"telemetry_summaries,omitempty"` - // True if Access Control is enabled. - EnableAccessControl bool `protobuf:"varint,17,opt,name=enable_access_control,json=enableAccessControl,proto3" json:"enable_access_control,omitempty"` - // Default Access Control role ID for new users. - DefaultRoleId uint32 `protobuf:"varint,18,opt,name=default_role_id,json=defaultRoleId,proto3" json:"default_role_id,omitempty"` - // True if Query Analytics for PMM's internal PG database is enabled. - EnableInternalPgQan bool `protobuf:"varint,19,opt,name=enable_internal_pg_qan,json=enableInternalPgQan,proto3" json:"enable_internal_pg_qan,omitempty"` - // Duration for which an update is snoozed - UpdateSnoozeDuration *durationpb.Duration `protobuf:"bytes,20,opt,name=update_snooze_duration,json=updateSnoozeDuration,proto3" json:"update_snooze_duration,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Settings) Reset() { - *x = Settings{} - mi := &file_server_v1_server_proto_msgTypes[18] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Settings) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Settings) ProtoMessage() {} - -func (x *Settings) ProtoReflect() protoreflect.Message { - mi := &file_server_v1_server_proto_msgTypes[18] - 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 Settings.ProtoReflect.Descriptor instead. -func (*Settings) Descriptor() ([]byte, []int) { - return file_server_v1_server_proto_rawDescGZIP(), []int{18} -} - -func (x *Settings) GetUpdatesEnabled() bool { - if x != nil { - return x.UpdatesEnabled - } - return false -} - -func (x *Settings) GetTelemetryEnabled() bool { - if x != nil { - return x.TelemetryEnabled - } - return false -} - -func (x *Settings) GetMetricsResolutions() *MetricsResolutions { - if x != nil { - return x.MetricsResolutions - } - return nil -} - -func (x *Settings) GetDataRetention() *durationpb.Duration { - if x != nil { - return x.DataRetention - } - return nil -} - -func (x *Settings) GetSshKey() string { - if x != nil { - return x.SshKey - } - return "" -} - -func (x *Settings) GetAwsPartitions() []string { - if x != nil { - return x.AwsPartitions - } - return nil -} - -func (x *Settings) GetAdvisorEnabled() bool { - if x != nil { - return x.AdvisorEnabled - } - return false -} - -func (x *Settings) GetPlatformEmail() string { - if x != nil { - return x.PlatformEmail - } - return "" -} - -func (x *Settings) GetAlertingEnabled() bool { - if x != nil { - return x.AlertingEnabled - } - return false -} - -func (x *Settings) GetPmmPublicAddress() string { - if x != nil { - return x.PmmPublicAddress - } - return "" -} - -func (x *Settings) GetAdvisorRunIntervals() *AdvisorRunIntervals { - if x != nil { - return x.AdvisorRunIntervals - } - return nil -} - -func (x *Settings) GetBackupManagementEnabled() bool { - if x != nil { - return x.BackupManagementEnabled - } - return false -} - -func (x *Settings) GetAzurediscoverEnabled() bool { - if x != nil { - return x.AzurediscoverEnabled - } - return false -} - -func (x *Settings) GetConnectedToPlatform() bool { - if x != nil { - return x.ConnectedToPlatform - } - return false -} - -func (x *Settings) GetTelemetrySummaries() []string { - if x != nil { - return x.TelemetrySummaries - } - return nil -} - -func (x *Settings) GetEnableAccessControl() bool { - if x != nil { - return x.EnableAccessControl - } - return false -} - -func (x *Settings) GetDefaultRoleId() uint32 { - if x != nil { - return x.DefaultRoleId - } - return 0 -} - -func (x *Settings) GetEnableInternalPgQan() bool { - if x != nil { - return x.EnableInternalPgQan - } - return false -} - -func (x *Settings) GetUpdateSnoozeDuration() *durationpb.Duration { - if x != nil { - return x.UpdateSnoozeDuration - } - return nil -} - -// ReadOnlySettings represents a stripped-down version of PMM Server settings that can be accessed by users of all roles. -type ReadOnlySettings struct { - state protoimpl.MessageState `protogen:"open.v1"` - // True if updates are enabled. - UpdatesEnabled bool `protobuf:"varint,1,opt,name=updates_enabled,json=updatesEnabled,proto3" json:"updates_enabled,omitempty"` - // True if telemetry is enabled. - TelemetryEnabled bool `protobuf:"varint,2,opt,name=telemetry_enabled,json=telemetryEnabled,proto3" json:"telemetry_enabled,omitempty"` - // True if Advisor is enabled. - AdvisorEnabled bool `protobuf:"varint,3,opt,name=advisor_enabled,json=advisorEnabled,proto3" json:"advisor_enabled,omitempty"` - // True if Alerting is enabled. - AlertingEnabled bool `protobuf:"varint,4,opt,name=alerting_enabled,json=alertingEnabled,proto3" json:"alerting_enabled,omitempty"` - // PMM Server public address. - PmmPublicAddress string `protobuf:"bytes,5,opt,name=pmm_public_address,json=pmmPublicAddress,proto3" json:"pmm_public_address,omitempty"` - // True if Backup Management is enabled. - BackupManagementEnabled bool `protobuf:"varint,6,opt,name=backup_management_enabled,json=backupManagementEnabled,proto3" json:"backup_management_enabled,omitempty"` - // True if Azure Discover is enabled. - AzurediscoverEnabled bool `protobuf:"varint,7,opt,name=azurediscover_enabled,json=azurediscoverEnabled,proto3" json:"azurediscover_enabled,omitempty"` - // True if Access Control is enabled. - EnableAccessControl bool `protobuf:"varint,8,opt,name=enable_access_control,json=enableAccessControl,proto3" json:"enable_access_control,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ReadOnlySettings) Reset() { - *x = ReadOnlySettings{} - mi := &file_server_v1_server_proto_msgTypes[19] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ReadOnlySettings) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ReadOnlySettings) ProtoMessage() {} - -func (x *ReadOnlySettings) ProtoReflect() protoreflect.Message { - mi := &file_server_v1_server_proto_msgTypes[19] - 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 ReadOnlySettings.ProtoReflect.Descriptor instead. -func (*ReadOnlySettings) Descriptor() ([]byte, []int) { - return file_server_v1_server_proto_rawDescGZIP(), []int{19} -} - -func (x *ReadOnlySettings) GetUpdatesEnabled() bool { - if x != nil { - return x.UpdatesEnabled - } - return false -} - -func (x *ReadOnlySettings) GetTelemetryEnabled() bool { - if x != nil { - return x.TelemetryEnabled - } - return false -} - -func (x *ReadOnlySettings) GetAdvisorEnabled() bool { - if x != nil { - return x.AdvisorEnabled - } - return false -} - -func (x *ReadOnlySettings) GetAlertingEnabled() bool { - if x != nil { - return x.AlertingEnabled - } - return false -} - -func (x *ReadOnlySettings) GetPmmPublicAddress() string { - if x != nil { - return x.PmmPublicAddress - } - return "" -} - -func (x *ReadOnlySettings) GetBackupManagementEnabled() bool { - if x != nil { - return x.BackupManagementEnabled - } - return false -} - -func (x *ReadOnlySettings) GetAzurediscoverEnabled() bool { - if x != nil { - return x.AzurediscoverEnabled - } - return false -} - -func (x *ReadOnlySettings) GetEnableAccessControl() bool { - if x != nil { - return x.EnableAccessControl - } - return false -} - -type GetSettingsRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetSettingsRequest) Reset() { - *x = GetSettingsRequest{} - mi := &file_server_v1_server_proto_msgTypes[20] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetSettingsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetSettingsRequest) ProtoMessage() {} - -func (x *GetSettingsRequest) ProtoReflect() protoreflect.Message { - mi := &file_server_v1_server_proto_msgTypes[20] - 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 GetSettingsRequest.ProtoReflect.Descriptor instead. -func (*GetSettingsRequest) Descriptor() ([]byte, []int) { - return file_server_v1_server_proto_rawDescGZIP(), []int{20} -} - -type GetReadOnlySettingsRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetReadOnlySettingsRequest) Reset() { - *x = GetReadOnlySettingsRequest{} - mi := &file_server_v1_server_proto_msgTypes[21] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetReadOnlySettingsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetReadOnlySettingsRequest) ProtoMessage() {} - -func (x *GetReadOnlySettingsRequest) ProtoReflect() protoreflect.Message { - mi := &file_server_v1_server_proto_msgTypes[21] - 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 GetReadOnlySettingsRequest.ProtoReflect.Descriptor instead. -func (*GetReadOnlySettingsRequest) Descriptor() ([]byte, []int) { - return file_server_v1_server_proto_rawDescGZIP(), []int{21} -} - -type GetSettingsResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Settings *Settings `protobuf:"bytes,1,opt,name=settings,proto3" json:"settings,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetSettingsResponse) Reset() { - *x = GetSettingsResponse{} - mi := &file_server_v1_server_proto_msgTypes[22] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetSettingsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetSettingsResponse) ProtoMessage() {} - -func (x *GetSettingsResponse) ProtoReflect() protoreflect.Message { - mi := &file_server_v1_server_proto_msgTypes[22] - 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 GetSettingsResponse.ProtoReflect.Descriptor instead. -func (*GetSettingsResponse) Descriptor() ([]byte, []int) { - return file_server_v1_server_proto_rawDescGZIP(), []int{22} -} - -func (x *GetSettingsResponse) GetSettings() *Settings { - if x != nil { - return x.Settings - } - return nil -} - -type GetReadOnlySettingsResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Settings *ReadOnlySettings `protobuf:"bytes,1,opt,name=settings,proto3" json:"settings,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetReadOnlySettingsResponse) Reset() { - *x = GetReadOnlySettingsResponse{} - mi := &file_server_v1_server_proto_msgTypes[23] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetReadOnlySettingsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetReadOnlySettingsResponse) ProtoMessage() {} - -func (x *GetReadOnlySettingsResponse) ProtoReflect() protoreflect.Message { - mi := &file_server_v1_server_proto_msgTypes[23] - 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 GetReadOnlySettingsResponse.ProtoReflect.Descriptor instead. -func (*GetReadOnlySettingsResponse) Descriptor() ([]byte, []int) { - return file_server_v1_server_proto_rawDescGZIP(), []int{23} -} - -func (x *GetReadOnlySettingsResponse) GetSettings() *ReadOnlySettings { - if x != nil { - return x.Settings - } - return nil -} - -type ChangeSettingsRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - EnableUpdates *bool `protobuf:"varint,1,opt,name=enable_updates,json=enableUpdates,proto3,oneof" json:"enable_updates,omitempty"` - EnableTelemetry *bool `protobuf:"varint,2,opt,name=enable_telemetry,json=enableTelemetry,proto3,oneof" json:"enable_telemetry,omitempty"` - MetricsResolutions *MetricsResolutions `protobuf:"bytes,3,opt,name=metrics_resolutions,json=metricsResolutions,proto3" json:"metrics_resolutions,omitempty"` - // A number of full days for Prometheus and QAN data retention. Should have a suffix in JSON: 2592000s, 43200m, 720h. - DataRetention *durationpb.Duration `protobuf:"bytes,4,opt,name=data_retention,json=dataRetention,proto3" json:"data_retention,omitempty"` - SshKey *string `protobuf:"bytes,5,opt,name=ssh_key,json=sshKey,proto3,oneof" json:"ssh_key,omitempty"` - AwsPartitions *common.StringArray `protobuf:"bytes,6,opt,name=aws_partitions,json=awsPartitions,proto3,oneof" json:"aws_partitions,omitempty"` - // Enable Advisor. - EnableAdvisor *bool `protobuf:"varint,7,opt,name=enable_advisor,json=enableAdvisor,proto3,oneof" json:"enable_advisor,omitempty"` - // Enable Alerting. - EnableAlerting *bool `protobuf:"varint,8,opt,name=enable_alerting,json=enableAlerting,proto3,oneof" json:"enable_alerting,omitempty"` - // PMM Server public address. - PmmPublicAddress *string `protobuf:"bytes,9,opt,name=pmm_public_address,json=pmmPublicAddress,proto3,oneof" json:"pmm_public_address,omitempty"` - // Intervals between Advisor runs. - AdvisorRunIntervals *AdvisorRunIntervals `protobuf:"bytes,10,opt,name=advisor_run_intervals,json=advisorRunIntervals,proto3" json:"advisor_run_intervals,omitempty"` - // Enable Azure Discover. - EnableAzurediscover *bool `protobuf:"varint,11,opt,name=enable_azurediscover,json=enableAzurediscover,proto3,oneof" json:"enable_azurediscover,omitempty"` - // Enable Backup Management. - EnableBackupManagement *bool `protobuf:"varint,12,opt,name=enable_backup_management,json=enableBackupManagement,proto3,oneof" json:"enable_backup_management,omitempty"` - // Enable Access Control - EnableAccessControl *bool `protobuf:"varint,13,opt,name=enable_access_control,json=enableAccessControl,proto3,oneof" json:"enable_access_control,omitempty"` - // Enable Query Analytics for PMM's internal PG database. - EnableInternalPgQan *bool `protobuf:"varint,14,opt,name=enable_internal_pg_qan,json=enableInternalPgQan,proto3,oneof" json:"enable_internal_pg_qan,omitempty"` - // A number of full days for which an update is snoozed, i.e. a multiple of 24h: 2592000s, 43200m, 720h. - UpdateSnoozeDuration *durationpb.Duration `protobuf:"bytes,15,opt,name=update_snooze_duration,json=updateSnoozeDuration,proto3" json:"update_snooze_duration,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ChangeSettingsRequest) Reset() { - *x = ChangeSettingsRequest{} - mi := &file_server_v1_server_proto_msgTypes[24] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ChangeSettingsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ChangeSettingsRequest) ProtoMessage() {} - -func (x *ChangeSettingsRequest) ProtoReflect() protoreflect.Message { - mi := &file_server_v1_server_proto_msgTypes[24] - 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 ChangeSettingsRequest.ProtoReflect.Descriptor instead. -func (*ChangeSettingsRequest) Descriptor() ([]byte, []int) { - return file_server_v1_server_proto_rawDescGZIP(), []int{24} -} - -func (x *ChangeSettingsRequest) GetEnableUpdates() bool { - if x != nil && x.EnableUpdates != nil { - return *x.EnableUpdates - } - return false -} - -func (x *ChangeSettingsRequest) GetEnableTelemetry() bool { - if x != nil && x.EnableTelemetry != nil { - return *x.EnableTelemetry - } - return false -} - -func (x *ChangeSettingsRequest) GetMetricsResolutions() *MetricsResolutions { - if x != nil { - return x.MetricsResolutions - } - return nil -} - -func (x *ChangeSettingsRequest) GetDataRetention() *durationpb.Duration { - if x != nil { - return x.DataRetention - } - return nil -} - -func (x *ChangeSettingsRequest) GetSshKey() string { - if x != nil && x.SshKey != nil { - return *x.SshKey - } - return "" -} - -func (x *ChangeSettingsRequest) GetAwsPartitions() *common.StringArray { - if x != nil { - return x.AwsPartitions - } - return nil -} - -func (x *ChangeSettingsRequest) GetEnableAdvisor() bool { - if x != nil && x.EnableAdvisor != nil { - return *x.EnableAdvisor - } - return false -} - -func (x *ChangeSettingsRequest) GetEnableAlerting() bool { - if x != nil && x.EnableAlerting != nil { - return *x.EnableAlerting - } - return false -} - -func (x *ChangeSettingsRequest) GetPmmPublicAddress() string { - if x != nil && x.PmmPublicAddress != nil { - return *x.PmmPublicAddress - } - return "" -} - -func (x *ChangeSettingsRequest) GetAdvisorRunIntervals() *AdvisorRunIntervals { - if x != nil { - return x.AdvisorRunIntervals - } - return nil -} - -func (x *ChangeSettingsRequest) GetEnableAzurediscover() bool { - if x != nil && x.EnableAzurediscover != nil { - return *x.EnableAzurediscover - } - return false -} - -func (x *ChangeSettingsRequest) GetEnableBackupManagement() bool { - if x != nil && x.EnableBackupManagement != nil { - return *x.EnableBackupManagement - } - return false -} - -func (x *ChangeSettingsRequest) GetEnableAccessControl() bool { - if x != nil && x.EnableAccessControl != nil { - return *x.EnableAccessControl - } - return false -} - -func (x *ChangeSettingsRequest) GetEnableInternalPgQan() bool { - if x != nil && x.EnableInternalPgQan != nil { - return *x.EnableInternalPgQan - } - return false -} - -func (x *ChangeSettingsRequest) GetUpdateSnoozeDuration() *durationpb.Duration { - if x != nil { - return x.UpdateSnoozeDuration - } - return nil -} - -type ChangeSettingsResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Settings *Settings `protobuf:"bytes,1,opt,name=settings,proto3" json:"settings,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ChangeSettingsResponse) Reset() { - *x = ChangeSettingsResponse{} - mi := &file_server_v1_server_proto_msgTypes[25] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ChangeSettingsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ChangeSettingsResponse) ProtoMessage() {} - -func (x *ChangeSettingsResponse) ProtoReflect() protoreflect.Message { - mi := &file_server_v1_server_proto_msgTypes[25] - 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 ChangeSettingsResponse.ProtoReflect.Descriptor instead. -func (*ChangeSettingsResponse) Descriptor() ([]byte, []int) { - return file_server_v1_server_proto_rawDescGZIP(), []int{25} -} - -func (x *ChangeSettingsResponse) GetSettings() *Settings { - if x != nil { - return x.Settings - } - return nil -} - -var File_server_v1_server_proto protoreflect.FileDescriptor - -const file_server_v1_server_proto_rawDesc = "" + - "\n" + - "\x16server/v1/server.proto\x12\tserver.v1\x1a\x13common/common.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a.protoc-gen-openapiv2/options/annotations.proto\"\x84\x01\n" + - "\vVersionInfo\x12\x18\n" + - "\aversion\x18\x01 \x01(\tR\aversion\x12!\n" + - "\ffull_version\x18\x02 \x01(\tR\vfullVersion\x128\n" + - "\ttimestamp\x18\x03 \x01(\v2\x1a.google.protobuf.TimestampR\ttimestamp\"&\n" + - "\x0eVersionRequest\x12\x14\n" + - "\x05dummy\x18\x01 \x01(\tR\x05dummy\"\xdd\x01\n" + - "\x0fVersionResponse\x12\x18\n" + - "\aversion\x18\x01 \x01(\tR\aversion\x12.\n" + - "\x06server\x18\x02 \x01(\v2\x16.server.v1.VersionInfoR\x06server\x120\n" + - "\amanaged\x18\x03 \x01(\v2\x16.server.v1.VersionInfoR\amanaged\x12N\n" + - "\x13distribution_method\x18\x04 \x01(\x0e2\x1d.server.v1.DistributionMethodR\x12distributionMethod\"\x12\n" + - "\x10ReadinessRequest\"\x13\n" + - "\x11ReadinessResponse\"\x1a\n" + - "\x18LeaderHealthCheckRequest\"\x1b\n" + - "\x19LeaderHealthCheckResponse\"a\n" + - "\x13CheckUpdatesRequest\x12\x14\n" + - "\x05force\x18\x01 \x01(\bR\x05force\x124\n" + - "\x16only_installed_version\x18\x02 \x01(\bR\x14onlyInstalledVersion\"\xd3\x01\n" + - "\x11DockerVersionInfo\x12\x18\n" + - "\aversion\x18\x01 \x01(\tR\aversion\x12\x10\n" + - "\x03tag\x18\x02 \x01(\tR\x03tag\x128\n" + - "\ttimestamp\x18\x03 \x01(\v2\x1a.google.protobuf.TimestampR\ttimestamp\x12*\n" + - "\x11release_notes_url\x18\x04 \x01(\tR\x0freleaseNotesUrl\x12,\n" + - "\x12release_notes_text\x18\x05 \x01(\tR\x10releaseNotesText\"\x90\x02\n" + - "\x14CheckUpdatesResponse\x124\n" + - "\tinstalled\x18\x01 \x01(\v2\x16.server.v1.VersionInfoR\tinstalled\x124\n" + - "\x06latest\x18\x02 \x01(\v2\x1c.server.v1.DockerVersionInfoR\x06latest\x12)\n" + - "\x10update_available\x18\x03 \x01(\bR\x0fupdateAvailable\x12&\n" + - "\x0flatest_news_url\x18\x04 \x01(\tR\rlatestNewsUrl\x129\n" + - "\n" + - "last_check\x18\x05 \x01(\v2\x1a.google.protobuf.TimestampR\tlastCheck\"\x17\n" + - "\x15ListChangeLogsRequest\"\x8b\x01\n" + - "\x16ListChangeLogsResponse\x126\n" + - "\aupdates\x18\x01 \x03(\v2\x1c.server.v1.DockerVersionInfoR\aupdates\x129\n" + - "\n" + - "last_check\x18\x02 \x01(\v2\x1a.google.protobuf.TimestampR\tlastCheck\"1\n" + - "\x12StartUpdateRequest\x12\x1b\n" + - "\tnew_image\x18\x01 \x01(\tR\bnewImage\"S\n" + - "\x13StartUpdateResponse\x12\x1d\n" + - "\n" + - "auth_token\x18\x01 \x01(\tR\tauthToken\x12\x1d\n" + - "\n" + - "log_offset\x18\x02 \x01(\rR\tlogOffset\"S\n" + - "\x13UpdateStatusRequest\x12\x1d\n" + - "\n" + - "auth_token\x18\x01 \x01(\tR\tauthToken\x12\x1d\n" + - "\n" + - "log_offset\x18\x02 \x01(\rR\tlogOffset\"f\n" + - "\x14UpdateStatusResponse\x12\x1b\n" + - "\tlog_lines\x18\x01 \x03(\tR\blogLines\x12\x1d\n" + - "\n" + - "log_offset\x18\x02 \x01(\rR\tlogOffset\x12\x12\n" + - "\x04done\x18\x03 \x01(\bR\x04done\"\x95\x01\n" + - "\x12MetricsResolutions\x12)\n" + - "\x02hr\x18\x01 \x01(\v2\x19.google.protobuf.DurationR\x02hr\x12)\n" + - "\x02mr\x18\x02 \x01(\v2\x19.google.protobuf.DurationR\x02mr\x12)\n" + - "\x02lr\x18\x03 \x01(\v2\x19.google.protobuf.DurationR\x02lr\"\xe5\x01\n" + - "\x13AdvisorRunIntervals\x12F\n" + - "\x11standard_interval\x18\x01 \x01(\v2\x19.google.protobuf.DurationR\x10standardInterval\x12>\n" + - "\rrare_interval\x18\x02 \x01(\v2\x19.google.protobuf.DurationR\frareInterval\x12F\n" + - "\x11frequent_interval\x18\x03 \x01(\v2\x19.google.protobuf.DurationR\x10frequentInterval\"\xe7\a\n" + - "\bSettings\x12'\n" + - "\x0fupdates_enabled\x18\x01 \x01(\bR\x0eupdatesEnabled\x12+\n" + - "\x11telemetry_enabled\x18\x02 \x01(\bR\x10telemetryEnabled\x12N\n" + - "\x13metrics_resolutions\x18\x03 \x01(\v2\x1d.server.v1.MetricsResolutionsR\x12metricsResolutions\x12@\n" + - "\x0edata_retention\x18\x04 \x01(\v2\x19.google.protobuf.DurationR\rdataRetention\x12\x17\n" + - "\assh_key\x18\x05 \x01(\tR\x06sshKey\x12%\n" + - "\x0eaws_partitions\x18\x06 \x03(\tR\rawsPartitions\x12'\n" + - "\x0fadvisor_enabled\x18\a \x01(\bR\x0eadvisorEnabled\x12%\n" + - "\x0eplatform_email\x18\b \x01(\tR\rplatformEmail\x12)\n" + - "\x10alerting_enabled\x18\n" + - " \x01(\bR\x0falertingEnabled\x12,\n" + - "\x12pmm_public_address\x18\v \x01(\tR\x10pmmPublicAddress\x12R\n" + - "\x15advisor_run_intervals\x18\f \x01(\v2\x1e.server.v1.AdvisorRunIntervalsR\x13advisorRunIntervals\x12:\n" + - "\x19backup_management_enabled\x18\r \x01(\bR\x17backupManagementEnabled\x123\n" + - "\x15azurediscover_enabled\x18\x0e \x01(\bR\x14azurediscoverEnabled\x122\n" + - "\x15connected_to_platform\x18\x0f \x01(\bR\x13connectedToPlatform\x12/\n" + - "\x13telemetry_summaries\x18\x10 \x03(\tR\x12telemetrySummaries\x122\n" + - "\x15enable_access_control\x18\x11 \x01(\bR\x13enableAccessControl\x12&\n" + - "\x0fdefault_role_id\x18\x12 \x01(\rR\rdefaultRoleId\x123\n" + - "\x16enable_internal_pg_qan\x18\x13 \x01(\bR\x13enableInternalPgQan\x12O\n" + - "\x16update_snooze_duration\x18\x14 \x01(\v2\x19.google.protobuf.DurationR\x14updateSnoozeDuration\"\x8f\x03\n" + - "\x10ReadOnlySettings\x12'\n" + - "\x0fupdates_enabled\x18\x01 \x01(\bR\x0eupdatesEnabled\x12+\n" + - "\x11telemetry_enabled\x18\x02 \x01(\bR\x10telemetryEnabled\x12'\n" + - "\x0fadvisor_enabled\x18\x03 \x01(\bR\x0eadvisorEnabled\x12)\n" + - "\x10alerting_enabled\x18\x04 \x01(\bR\x0falertingEnabled\x12,\n" + - "\x12pmm_public_address\x18\x05 \x01(\tR\x10pmmPublicAddress\x12:\n" + - "\x19backup_management_enabled\x18\x06 \x01(\bR\x17backupManagementEnabled\x123\n" + - "\x15azurediscover_enabled\x18\a \x01(\bR\x14azurediscoverEnabled\x122\n" + - "\x15enable_access_control\x18\b \x01(\bR\x13enableAccessControl\"\x14\n" + - "\x12GetSettingsRequest\"\x1c\n" + - "\x1aGetReadOnlySettingsRequest\"F\n" + - "\x13GetSettingsResponse\x12/\n" + - "\bsettings\x18\x01 \x01(\v2\x13.server.v1.SettingsR\bsettings\"V\n" + - "\x1bGetReadOnlySettingsResponse\x127\n" + - "\bsettings\x18\x01 \x01(\v2\x1b.server.v1.ReadOnlySettingsR\bsettings\"\xf0\b\n" + - "\x15ChangeSettingsRequest\x12*\n" + - "\x0eenable_updates\x18\x01 \x01(\bH\x00R\renableUpdates\x88\x01\x01\x12.\n" + - "\x10enable_telemetry\x18\x02 \x01(\bH\x01R\x0fenableTelemetry\x88\x01\x01\x12N\n" + - "\x13metrics_resolutions\x18\x03 \x01(\v2\x1d.server.v1.MetricsResolutionsR\x12metricsResolutions\x12@\n" + - "\x0edata_retention\x18\x04 \x01(\v2\x19.google.protobuf.DurationR\rdataRetention\x12\x1c\n" + - "\assh_key\x18\x05 \x01(\tH\x02R\x06sshKey\x88\x01\x01\x12?\n" + - "\x0eaws_partitions\x18\x06 \x01(\v2\x13.common.StringArrayH\x03R\rawsPartitions\x88\x01\x01\x12*\n" + - "\x0eenable_advisor\x18\a \x01(\bH\x04R\renableAdvisor\x88\x01\x01\x12,\n" + - "\x0fenable_alerting\x18\b \x01(\bH\x05R\x0eenableAlerting\x88\x01\x01\x121\n" + - "\x12pmm_public_address\x18\t \x01(\tH\x06R\x10pmmPublicAddress\x88\x01\x01\x12R\n" + - "\x15advisor_run_intervals\x18\n" + - " \x01(\v2\x1e.server.v1.AdvisorRunIntervalsR\x13advisorRunIntervals\x126\n" + - "\x14enable_azurediscover\x18\v \x01(\bH\aR\x13enableAzurediscover\x88\x01\x01\x12=\n" + - "\x18enable_backup_management\x18\f \x01(\bH\bR\x16enableBackupManagement\x88\x01\x01\x127\n" + - "\x15enable_access_control\x18\r \x01(\bH\tR\x13enableAccessControl\x88\x01\x01\x128\n" + - "\x16enable_internal_pg_qan\x18\x0e \x01(\bH\n" + - "R\x13enableInternalPgQan\x88\x01\x01\x12O\n" + - "\x16update_snooze_duration\x18\x0f \x01(\v2\x19.google.protobuf.DurationR\x14updateSnoozeDurationB\x11\n" + - "\x0f_enable_updatesB\x13\n" + - "\x11_enable_telemetryB\n" + - "\n" + - "\b_ssh_keyB\x11\n" + - "\x0f_aws_partitionsB\x11\n" + - "\x0f_enable_advisorB\x12\n" + - "\x10_enable_alertingB\x15\n" + - "\x13_pmm_public_addressB\x17\n" + - "\x15_enable_azurediscoverB\x1b\n" + - "\x19_enable_backup_managementB\x18\n" + - "\x16_enable_access_controlB\x19\n" + - "\x17_enable_internal_pg_qan\"I\n" + - "\x16ChangeSettingsResponse\x12/\n" + - "\bsettings\x18\x01 \x01(\v2\x13.server.v1.SettingsR\bsettings*\xce\x01\n" + - "\x12DistributionMethod\x12#\n" + - "\x1fDISTRIBUTION_METHOD_UNSPECIFIED\x10\x00\x12\x1e\n" + - "\x1aDISTRIBUTION_METHOD_DOCKER\x10\x01\x12\x1b\n" + - "\x17DISTRIBUTION_METHOD_OVF\x10\x02\x12\x1b\n" + - "\x17DISTRIBUTION_METHOD_AMI\x10\x03\x12\x1d\n" + - "\x19DISTRIBUTION_METHOD_AZURE\x10\x04\x12\x1a\n" + - "\x16DISTRIBUTION_METHOD_DO\x10\x052\xd9\x0f\n" + - "\rServerService\x12\x86\x01\n" + - "\aVersion\x12\x19.server.v1.VersionRequest\x1a\x1a.server.v1.VersionResponse\"D\x92A'\x12\aVersion\x1a\x1cReturns PMM Server versions.\x82\xd3\xe4\x93\x02\x14\x12\x12/v1/server/version\x12\xab\x02\n" + - "\tReadiness\x12\x1b.server.v1.ReadinessRequest\x1a\x1c.server.v1.ReadinessResponse\"\xe2\x01\x92A\xc5\x01\x12\x16Check server readiness\x1a\xaa\x01Returns 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.\x82\xd3\xe4\x93\x02\x13\x12\x11/v1/server/readyz\x12\x81\x02\n" + - "\x11LeaderHealthCheck\x12#.server.v1.LeaderHealthCheckRequest\x1a$.server.v1.LeaderHealthCheckResponse\"\xa0\x01\x92Ay\x12\x10Check Leadership\x1aeChecks if the instance is the leader in a cluster. Returns an error if the instance isn't the leader.\x82\xd3\xe4\x93\x02\x1e\x12\x1c/v1/server/leaderHealthCheck\x12\xa7\x01\n" + - "\fCheckUpdates\x12\x1e.server.v1.CheckUpdatesRequest\x1a\x1f.server.v1.CheckUpdatesResponse\"V\x92A9\x12\rCheck updates\x1a(Checks for available PMM Server updates.\x82\xd3\xe4\x93\x02\x14\x12\x12/v1/server/updates\x12\xe9\x01\n" + - "\x0eListChangeLogs\x12 .server.v1.ListChangeLogsRequest\x1a!.server.v1.ListChangeLogsResponse\"\x91\x01\x92Ai\x12\x11Get the changelog\x1aTDisplay a changelog comparing the installed version to the latest available version.\x82\xd3\xe4\x93\x02\x1f\x12\x1d/v1/server/updates/changelogs\x12\x9d\x01\n" + - "\vStartUpdate\x12\x1d.server.v1.StartUpdateRequest\x1a\x1e.server.v1.StartUpdateResponse\"O\x92A)\x12\fStart update\x1a\x19Starts PMM Server update.\x82\xd3\xe4\x93\x02\x1d:\x01*\"\x18/v1/server/updates:start\x12\xad\x01\n" + - "\fUpdateStatus\x12\x1e.server.v1.UpdateStatusRequest\x1a\x1f.server.v1.UpdateStatusResponse\"\\\x92A2\x12\rUpdate status\x1a!Returns PMM Server update status.\x82\xd3\xe4\x93\x02!:\x01*\"\x1c/v1/server/updates:getStatus\x12\xa0\x01\n" + - "\vGetSettings\x12\x1d.server.v1.GetSettingsRequest\x1a\x1e.server.v1.GetSettingsResponse\"R\x92A4\x12\fGet settings\x1a$Returns current PMM Server settings.\x82\xd3\xe4\x93\x02\x15\x12\x13/v1/server/settings\x12\xd9\x01\n" + - "\x13GetReadOnlySettings\x12%.server.v1.GetReadOnlySettingsRequest\x1a&.server.v1.GetReadOnlySettingsResponse\"s\x92AL\x12\x16Get read-only settings\x1a2Returns a stripped version of PMM Server settings.\x82\xd3\xe4\x93\x02\x1e\x12\x1c/v1/server/settings/readonly\x12\xa7\x01\n" + - "\x0eChangeSettings\x12 .server.v1.ChangeSettingsRequest\x1a!.server.v1.ChangeSettingsResponse\"P\x92A/\x12\x0fChange settings\x1a\x1cChanges PMM Server settings.\x82\xd3\xe4\x93\x02\x18:\x01*\x1a\x13/v1/server/settingsB\x90\x01\n" + - "\rcom.server.v1B\vServerProtoP\x01Z-github.com/percona/pmm/api/server/v1;serverv1\xa2\x02\x03SXX\xaa\x02\tServer.V1\xca\x02\tServer\\V1\xe2\x02\x15Server\\V1\\GPBMetadata\xea\x02\n" + - "Server::V1b\x06proto3" - -var ( - file_server_v1_server_proto_rawDescOnce sync.Once - file_server_v1_server_proto_rawDescData []byte -) - -func file_server_v1_server_proto_rawDescGZIP() []byte { - file_server_v1_server_proto_rawDescOnce.Do(func() { - file_server_v1_server_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_server_v1_server_proto_rawDesc), len(file_server_v1_server_proto_rawDesc))) - }) - 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_depIdxs = []int32{ - 27, // 0: server.v1.VersionInfo.timestamp:type_name -> google.protobuf.Timestamp - 1, // 1: server.v1.VersionResponse.server:type_name -> server.v1.VersionInfo - 1, // 2: server.v1.VersionResponse.managed:type_name -> server.v1.VersionInfo - 0, // 3: server.v1.VersionResponse.distribution_method:type_name -> server.v1.DistributionMethod - 27, // 4: server.v1.DockerVersionInfo.timestamp:type_name -> google.protobuf.Timestamp - 1, // 5: server.v1.CheckUpdatesResponse.installed:type_name -> server.v1.VersionInfo - 9, // 6: server.v1.CheckUpdatesResponse.latest:type_name -> server.v1.DockerVersionInfo - 27, // 7: server.v1.CheckUpdatesResponse.last_check:type_name -> google.protobuf.Timestamp - 9, // 8: server.v1.ListChangeLogsResponse.updates:type_name -> server.v1.DockerVersionInfo - 27, // 9: server.v1.ListChangeLogsResponse.last_check:type_name -> google.protobuf.Timestamp - 28, // 10: server.v1.MetricsResolutions.hr:type_name -> google.protobuf.Duration - 28, // 11: server.v1.MetricsResolutions.mr:type_name -> google.protobuf.Duration - 28, // 12: server.v1.MetricsResolutions.lr:type_name -> google.protobuf.Duration - 28, // 13: server.v1.AdvisorRunIntervals.standard_interval:type_name -> google.protobuf.Duration - 28, // 14: server.v1.AdvisorRunIntervals.rare_interval:type_name -> google.protobuf.Duration - 28, // 15: server.v1.AdvisorRunIntervals.frequent_interval:type_name -> google.protobuf.Duration - 17, // 16: server.v1.Settings.metrics_resolutions:type_name -> server.v1.MetricsResolutions - 28, // 17: server.v1.Settings.data_retention:type_name -> google.protobuf.Duration - 18, // 18: server.v1.Settings.advisor_run_intervals:type_name -> server.v1.AdvisorRunIntervals - 28, // 19: server.v1.Settings.update_snooze_duration:type_name -> google.protobuf.Duration - 19, // 20: server.v1.GetSettingsResponse.settings:type_name -> server.v1.Settings - 20, // 21: server.v1.GetReadOnlySettingsResponse.settings:type_name -> server.v1.ReadOnlySettings - 17, // 22: server.v1.ChangeSettingsRequest.metrics_resolutions:type_name -> server.v1.MetricsResolutions - 28, // 23: server.v1.ChangeSettingsRequest.data_retention:type_name -> google.protobuf.Duration - 29, // 24: server.v1.ChangeSettingsRequest.aws_partitions:type_name -> common.StringArray - 18, // 25: server.v1.ChangeSettingsRequest.advisor_run_intervals:type_name -> server.v1.AdvisorRunIntervals - 28, // 26: server.v1.ChangeSettingsRequest.update_snooze_duration:type_name -> google.protobuf.Duration - 19, // 27: server.v1.ChangeSettingsResponse.settings:type_name -> server.v1.Settings - 2, // 28: server.v1.ServerService.Version:input_type -> server.v1.VersionRequest - 4, // 29: server.v1.ServerService.Readiness:input_type -> server.v1.ReadinessRequest - 6, // 30: server.v1.ServerService.LeaderHealthCheck:input_type -> server.v1.LeaderHealthCheckRequest - 8, // 31: server.v1.ServerService.CheckUpdates:input_type -> server.v1.CheckUpdatesRequest - 11, // 32: server.v1.ServerService.ListChangeLogs:input_type -> server.v1.ListChangeLogsRequest - 13, // 33: server.v1.ServerService.StartUpdate:input_type -> server.v1.StartUpdateRequest - 15, // 34: server.v1.ServerService.UpdateStatus:input_type -> server.v1.UpdateStatusRequest - 21, // 35: server.v1.ServerService.GetSettings:input_type -> server.v1.GetSettingsRequest - 22, // 36: server.v1.ServerService.GetReadOnlySettings:input_type -> server.v1.GetReadOnlySettingsRequest - 25, // 37: server.v1.ServerService.ChangeSettings:input_type -> server.v1.ChangeSettingsRequest - 3, // 38: server.v1.ServerService.Version:output_type -> server.v1.VersionResponse - 5, // 39: server.v1.ServerService.Readiness:output_type -> server.v1.ReadinessResponse - 7, // 40: server.v1.ServerService.LeaderHealthCheck:output_type -> server.v1.LeaderHealthCheckResponse - 10, // 41: server.v1.ServerService.CheckUpdates:output_type -> server.v1.CheckUpdatesResponse - 12, // 42: server.v1.ServerService.ListChangeLogs:output_type -> server.v1.ListChangeLogsResponse - 14, // 43: server.v1.ServerService.StartUpdate:output_type -> server.v1.StartUpdateResponse - 16, // 44: server.v1.ServerService.UpdateStatus:output_type -> server.v1.UpdateStatusResponse - 23, // 45: server.v1.ServerService.GetSettings:output_type -> server.v1.GetSettingsResponse - 24, // 46: server.v1.ServerService.GetReadOnlySettings:output_type -> server.v1.GetReadOnlySettingsResponse - 26, // 47: server.v1.ServerService.ChangeSettings:output_type -> server.v1.ChangeSettingsResponse - 38, // [38:48] is the sub-list for method output_type - 28, // [28:38] is the sub-list for method input_type - 28, // [28:28] is the sub-list for extension type_name - 28, // [28:28] is the sub-list for extension extendee - 0, // [0:28] is the sub-list for field type_name -} - -func init() { file_server_v1_server_proto_init() } -func file_server_v1_server_proto_init() { - if File_server_v1_server_proto != nil { - return - } - file_server_v1_server_proto_msgTypes[24].OneofWrappers = []any{} - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_server_v1_server_proto_rawDesc), len(file_server_v1_server_proto_rawDesc)), - NumEnums: 1, - NumMessages: 26, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_server_v1_server_proto_goTypes, - DependencyIndexes: file_server_v1_server_proto_depIdxs, - EnumInfos: file_server_v1_server_proto_enumTypes, - MessageInfos: file_server_v1_server_proto_msgTypes, - }.Build() - File_server_v1_server_proto = out.File - file_server_v1_server_proto_goTypes = nil - file_server_v1_server_proto_depIdxs = nil -} diff --git a/api/server/v1/server.pb.gw.go b/api/server/v1/server.pb.gw.go deleted file mode 100644 index 634a7f13671..00000000000 --- a/api/server/v1/server.pb.gw.go +++ /dev/null @@ -1,737 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: server/v1/server.proto - -/* -Package serverv1 is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package serverv1 - -import ( - "context" - "errors" - "io" - "net/http" - - "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" - "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" - "google.golang.org/protobuf/proto" -) - -// Suppress "imported and not used" errors -var ( - _ codes.Code - _ io.Reader - _ status.Status - _ = errors.New - _ = runtime.String - _ = utilities.NewDoubleArray - _ = metadata.Join -) - -var filter_ServerService_Version_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} - -func request_ServerService_Version_0(ctx context.Context, marshaler runtime.Marshaler, client ServerServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq VersionRequest - metadata runtime.ServerMetadata - ) - if req.Body != nil { - _, _ = io.Copy(io.Discard, req.Body) - } - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_ServerService_Version_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - msg, err := client.Version(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_ServerService_Version_0(ctx context.Context, marshaler runtime.Marshaler, server ServerServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq VersionRequest - metadata runtime.ServerMetadata - ) - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_ServerService_Version_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - msg, err := server.Version(ctx, &protoReq) - return msg, metadata, err -} - -func request_ServerService_Readiness_0(ctx context.Context, marshaler runtime.Marshaler, client ServerServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq ReadinessRequest - metadata runtime.ServerMetadata - ) - if req.Body != nil { - _, _ = io.Copy(io.Discard, req.Body) - } - msg, err := client.Readiness(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_ServerService_Readiness_0(ctx context.Context, marshaler runtime.Marshaler, server ServerServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq ReadinessRequest - metadata runtime.ServerMetadata - ) - msg, err := server.Readiness(ctx, &protoReq) - return msg, metadata, err -} - -func request_ServerService_LeaderHealthCheck_0(ctx context.Context, marshaler runtime.Marshaler, client ServerServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq LeaderHealthCheckRequest - metadata runtime.ServerMetadata - ) - if req.Body != nil { - _, _ = io.Copy(io.Discard, req.Body) - } - msg, err := client.LeaderHealthCheck(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_ServerService_LeaderHealthCheck_0(ctx context.Context, marshaler runtime.Marshaler, server ServerServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq LeaderHealthCheckRequest - metadata runtime.ServerMetadata - ) - msg, err := server.LeaderHealthCheck(ctx, &protoReq) - return msg, metadata, err -} - -var filter_ServerService_CheckUpdates_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} - -func request_ServerService_CheckUpdates_0(ctx context.Context, marshaler runtime.Marshaler, client ServerServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq CheckUpdatesRequest - metadata runtime.ServerMetadata - ) - if req.Body != nil { - _, _ = io.Copy(io.Discard, req.Body) - } - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_ServerService_CheckUpdates_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - msg, err := client.CheckUpdates(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_ServerService_CheckUpdates_0(ctx context.Context, marshaler runtime.Marshaler, server ServerServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq CheckUpdatesRequest - metadata runtime.ServerMetadata - ) - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_ServerService_CheckUpdates_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - msg, err := server.CheckUpdates(ctx, &protoReq) - return msg, metadata, err -} - -func request_ServerService_ListChangeLogs_0(ctx context.Context, marshaler runtime.Marshaler, client ServerServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq ListChangeLogsRequest - metadata runtime.ServerMetadata - ) - if req.Body != nil { - _, _ = io.Copy(io.Discard, req.Body) - } - msg, err := client.ListChangeLogs(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_ServerService_ListChangeLogs_0(ctx context.Context, marshaler runtime.Marshaler, server ServerServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq ListChangeLogsRequest - metadata runtime.ServerMetadata - ) - msg, err := server.ListChangeLogs(ctx, &protoReq) - return msg, metadata, err -} - -func request_ServerService_StartUpdate_0(ctx context.Context, marshaler runtime.Marshaler, client ServerServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq StartUpdateRequest - 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.StartUpdate(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_ServerService_StartUpdate_0(ctx context.Context, marshaler runtime.Marshaler, server ServerServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq StartUpdateRequest - 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.StartUpdate(ctx, &protoReq) - return msg, metadata, err -} - -func request_ServerService_UpdateStatus_0(ctx context.Context, marshaler runtime.Marshaler, client ServerServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq UpdateStatusRequest - 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.UpdateStatus(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_ServerService_UpdateStatus_0(ctx context.Context, marshaler runtime.Marshaler, server ServerServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq UpdateStatusRequest - 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.UpdateStatus(ctx, &protoReq) - return msg, metadata, err -} - -func request_ServerService_GetSettings_0(ctx context.Context, marshaler runtime.Marshaler, client ServerServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq GetSettingsRequest - metadata runtime.ServerMetadata - ) - if req.Body != nil { - _, _ = io.Copy(io.Discard, req.Body) - } - msg, err := client.GetSettings(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_ServerService_GetSettings_0(ctx context.Context, marshaler runtime.Marshaler, server ServerServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq GetSettingsRequest - metadata runtime.ServerMetadata - ) - msg, err := server.GetSettings(ctx, &protoReq) - return msg, metadata, err -} - -func request_ServerService_GetReadOnlySettings_0(ctx context.Context, marshaler runtime.Marshaler, client ServerServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq GetReadOnlySettingsRequest - metadata runtime.ServerMetadata - ) - if req.Body != nil { - _, _ = io.Copy(io.Discard, req.Body) - } - msg, err := client.GetReadOnlySettings(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_ServerService_GetReadOnlySettings_0(ctx context.Context, marshaler runtime.Marshaler, server ServerServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq GetReadOnlySettingsRequest - metadata runtime.ServerMetadata - ) - msg, err := server.GetReadOnlySettings(ctx, &protoReq) - return msg, metadata, err -} - -func request_ServerService_ChangeSettings_0(ctx context.Context, marshaler runtime.Marshaler, client ServerServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq ChangeSettingsRequest - 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.ChangeSettings(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_ServerService_ChangeSettings_0(ctx context.Context, marshaler runtime.Marshaler, server ServerServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq ChangeSettingsRequest - 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.ChangeSettings(ctx, &protoReq) - return msg, metadata, err -} - -// RegisterServerServiceHandlerServer registers the http handlers for service ServerService to "mux". -// UnaryRPC :call ServerServiceServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterServerServiceHandlerFromEndpoint instead. -// GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call. -func RegisterServerServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ServerServiceServer) error { - mux.Handle(http.MethodGet, pattern_ServerService_Version_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, "/server.v1.ServerService/Version", runtime.WithHTTPPathPattern("/v1/server/version")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_ServerService_Version_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_ServerService_Version_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodGet, pattern_ServerService_Readiness_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, "/server.v1.ServerService/Readiness", runtime.WithHTTPPathPattern("/v1/server/readyz")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_ServerService_Readiness_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_ServerService_Readiness_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodGet, pattern_ServerService_LeaderHealthCheck_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, "/server.v1.ServerService/LeaderHealthCheck", runtime.WithHTTPPathPattern("/v1/server/leaderHealthCheck")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_ServerService_LeaderHealthCheck_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_ServerService_LeaderHealthCheck_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodGet, pattern_ServerService_CheckUpdates_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, "/server.v1.ServerService/CheckUpdates", runtime.WithHTTPPathPattern("/v1/server/updates")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_ServerService_CheckUpdates_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_ServerService_CheckUpdates_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodGet, pattern_ServerService_ListChangeLogs_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, "/server.v1.ServerService/ListChangeLogs", runtime.WithHTTPPathPattern("/v1/server/updates/changelogs")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_ServerService_ListChangeLogs_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_ServerService_ListChangeLogs_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPost, pattern_ServerService_StartUpdate_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, "/server.v1.ServerService/StartUpdate", runtime.WithHTTPPathPattern("/v1/server/updates:start")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_ServerService_StartUpdate_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_ServerService_StartUpdate_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPost, pattern_ServerService_UpdateStatus_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, "/server.v1.ServerService/UpdateStatus", runtime.WithHTTPPathPattern("/v1/server/updates:getStatus")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_ServerService_UpdateStatus_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_ServerService_UpdateStatus_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodGet, pattern_ServerService_GetSettings_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, "/server.v1.ServerService/GetSettings", runtime.WithHTTPPathPattern("/v1/server/settings")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_ServerService_GetSettings_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_ServerService_GetSettings_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodGet, pattern_ServerService_GetReadOnlySettings_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, "/server.v1.ServerService/GetReadOnlySettings", runtime.WithHTTPPathPattern("/v1/server/settings/readonly")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_ServerService_GetReadOnlySettings_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_ServerService_GetReadOnlySettings_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPut, pattern_ServerService_ChangeSettings_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, "/server.v1.ServerService/ChangeSettings", runtime.WithHTTPPathPattern("/v1/server/settings")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_ServerService_ChangeSettings_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_ServerService_ChangeSettings_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - return nil -} - -// RegisterServerServiceHandlerFromEndpoint is same as RegisterServerServiceHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterServerServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.NewClient(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - return RegisterServerServiceHandler(ctx, mux, conn) -} - -// RegisterServerServiceHandler registers the http handlers for service ServerService to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterServerServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterServerServiceHandlerClient(ctx, mux, NewServerServiceClient(conn)) -} - -// RegisterServerServiceHandlerClient registers the http handlers for service ServerService -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ServerServiceClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ServerServiceClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "ServerServiceClient" to call the correct interceptors. This client ignores the HTTP middlewares. -func RegisterServerServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ServerServiceClient) error { - mux.Handle(http.MethodGet, pattern_ServerService_Version_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, "/server.v1.ServerService/Version", runtime.WithHTTPPathPattern("/v1/server/version")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_ServerService_Version_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_ServerService_Version_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodGet, pattern_ServerService_Readiness_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, "/server.v1.ServerService/Readiness", runtime.WithHTTPPathPattern("/v1/server/readyz")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_ServerService_Readiness_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_ServerService_Readiness_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodGet, pattern_ServerService_LeaderHealthCheck_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, "/server.v1.ServerService/LeaderHealthCheck", runtime.WithHTTPPathPattern("/v1/server/leaderHealthCheck")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_ServerService_LeaderHealthCheck_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_ServerService_LeaderHealthCheck_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodGet, pattern_ServerService_CheckUpdates_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, "/server.v1.ServerService/CheckUpdates", runtime.WithHTTPPathPattern("/v1/server/updates")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_ServerService_CheckUpdates_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_ServerService_CheckUpdates_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodGet, pattern_ServerService_ListChangeLogs_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, "/server.v1.ServerService/ListChangeLogs", runtime.WithHTTPPathPattern("/v1/server/updates/changelogs")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_ServerService_ListChangeLogs_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_ServerService_ListChangeLogs_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPost, pattern_ServerService_StartUpdate_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, "/server.v1.ServerService/StartUpdate", runtime.WithHTTPPathPattern("/v1/server/updates:start")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_ServerService_StartUpdate_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_ServerService_StartUpdate_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPost, pattern_ServerService_UpdateStatus_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, "/server.v1.ServerService/UpdateStatus", runtime.WithHTTPPathPattern("/v1/server/updates:getStatus")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_ServerService_UpdateStatus_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_ServerService_UpdateStatus_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodGet, pattern_ServerService_GetSettings_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, "/server.v1.ServerService/GetSettings", runtime.WithHTTPPathPattern("/v1/server/settings")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_ServerService_GetSettings_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_ServerService_GetSettings_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodGet, pattern_ServerService_GetReadOnlySettings_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, "/server.v1.ServerService/GetReadOnlySettings", runtime.WithHTTPPathPattern("/v1/server/settings/readonly")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_ServerService_GetReadOnlySettings_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_ServerService_GetReadOnlySettings_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPut, pattern_ServerService_ChangeSettings_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, "/server.v1.ServerService/ChangeSettings", runtime.WithHTTPPathPattern("/v1/server/settings")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_ServerService_ChangeSettings_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_ServerService_ChangeSettings_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - return nil -} - -var ( - pattern_ServerService_Version_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "server", "version"}, "")) - pattern_ServerService_Readiness_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "server", "readyz"}, "")) - pattern_ServerService_LeaderHealthCheck_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "server", "leaderHealthCheck"}, "")) - pattern_ServerService_CheckUpdates_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "server", "updates"}, "")) - pattern_ServerService_ListChangeLogs_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "server", "updates", "changelogs"}, "")) - pattern_ServerService_StartUpdate_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "server", "updates"}, "start")) - pattern_ServerService_UpdateStatus_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "server", "updates"}, "getStatus")) - pattern_ServerService_GetSettings_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "server", "settings"}, "")) - pattern_ServerService_GetReadOnlySettings_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "server", "settings", "readonly"}, "")) - pattern_ServerService_ChangeSettings_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "server", "settings"}, "")) -) - -var ( - forward_ServerService_Version_0 = runtime.ForwardResponseMessage - forward_ServerService_Readiness_0 = runtime.ForwardResponseMessage - forward_ServerService_LeaderHealthCheck_0 = runtime.ForwardResponseMessage - forward_ServerService_CheckUpdates_0 = runtime.ForwardResponseMessage - forward_ServerService_ListChangeLogs_0 = runtime.ForwardResponseMessage - forward_ServerService_StartUpdate_0 = runtime.ForwardResponseMessage - forward_ServerService_UpdateStatus_0 = runtime.ForwardResponseMessage - forward_ServerService_GetSettings_0 = runtime.ForwardResponseMessage - forward_ServerService_GetReadOnlySettings_0 = runtime.ForwardResponseMessage - forward_ServerService_ChangeSettings_0 = runtime.ForwardResponseMessage -) diff --git a/api/server/v1/server.pb.validate.go b/api/server/v1/server.pb.validate.go deleted file mode 100644 index f684fea246b..00000000000 --- a/api/server/v1/server.pb.validate.go +++ /dev/null @@ -1,3587 +0,0 @@ -// Code generated by protoc-gen-validate. DO NOT EDIT. -// source: server/v1/server.proto - -package serverv1 - -import ( - "bytes" - "errors" - "fmt" - "net" - "net/mail" - "net/url" - "regexp" - "sort" - "strings" - "time" - "unicode/utf8" - - "google.golang.org/protobuf/types/known/anypb" -) - -// ensure the imports are used -var ( - _ = bytes.MinRead - _ = errors.New("") - _ = fmt.Print - _ = utf8.UTFMax - _ = (*regexp.Regexp)(nil) - _ = (*strings.Reader)(nil) - _ = net.IPv4len - _ = time.Duration(0) - _ = (*url.URL)(nil) - _ = (*mail.Address)(nil) - _ = anypb.Any{} - _ = sort.Sort -) - -// Validate checks the field values on VersionInfo 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 *VersionInfo) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on VersionInfo 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 VersionInfoMultiError, or -// nil if none found. -func (m *VersionInfo) ValidateAll() error { - return m.validate(true) -} - -func (m *VersionInfo) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Version - - // no validation rules for FullVersion - - if all { - switch v := interface{}(m.GetTimestamp()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, VersionInfoValidationError{ - field: "Timestamp", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, VersionInfoValidationError{ - field: "Timestamp", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetTimestamp()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return VersionInfoValidationError{ - field: "Timestamp", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if len(errors) > 0 { - return VersionInfoMultiError(errors) - } - - return nil -} - -// VersionInfoMultiError is an error wrapping multiple validation errors -// returned by VersionInfo.ValidateAll() if the designated constraints aren't met. -type VersionInfoMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m VersionInfoMultiError) 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 VersionInfoMultiError) AllErrors() []error { return m } - -// VersionInfoValidationError is the validation error returned by -// VersionInfo.Validate if the designated constraints aren't met. -type VersionInfoValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e VersionInfoValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e VersionInfoValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e VersionInfoValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e VersionInfoValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e VersionInfoValidationError) ErrorName() string { return "VersionInfoValidationError" } - -// Error satisfies the builtin error interface -func (e VersionInfoValidationError) 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 %sVersionInfo.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = VersionInfoValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = VersionInfoValidationError{} - -// Validate checks the field values on VersionRequest 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 *VersionRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on VersionRequest 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 VersionRequestMultiError, -// or nil if none found. -func (m *VersionRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *VersionRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Dummy - - if len(errors) > 0 { - return VersionRequestMultiError(errors) - } - - return nil -} - -// VersionRequestMultiError is an error wrapping multiple validation errors -// returned by VersionRequest.ValidateAll() if the designated constraints -// aren't met. -type VersionRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m VersionRequestMultiError) 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 VersionRequestMultiError) AllErrors() []error { return m } - -// VersionRequestValidationError is the validation error returned by -// VersionRequest.Validate if the designated constraints aren't met. -type VersionRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e VersionRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e VersionRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e VersionRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e VersionRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e VersionRequestValidationError) ErrorName() string { return "VersionRequestValidationError" } - -// Error satisfies the builtin error interface -func (e VersionRequestValidationError) 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 %sVersionRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = VersionRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = VersionRequestValidationError{} - -// Validate checks the field values on VersionResponse 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 *VersionResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on VersionResponse 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 -// VersionResponseMultiError, or nil if none found. -func (m *VersionResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *VersionResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Version - - if all { - switch v := interface{}(m.GetServer()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, VersionResponseValidationError{ - field: "Server", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, VersionResponseValidationError{ - field: "Server", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetServer()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return VersionResponseValidationError{ - field: "Server", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetManaged()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, VersionResponseValidationError{ - field: "Managed", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, VersionResponseValidationError{ - field: "Managed", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetManaged()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return VersionResponseValidationError{ - field: "Managed", - reason: "embedded message failed validation", - cause: err, - } - } - } - - // no validation rules for DistributionMethod - - if len(errors) > 0 { - return VersionResponseMultiError(errors) - } - - return nil -} - -// VersionResponseMultiError is an error wrapping multiple validation errors -// returned by VersionResponse.ValidateAll() if the designated constraints -// aren't met. -type VersionResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m VersionResponseMultiError) 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 VersionResponseMultiError) AllErrors() []error { return m } - -// VersionResponseValidationError is the validation error returned by -// VersionResponse.Validate if the designated constraints aren't met. -type VersionResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e VersionResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e VersionResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e VersionResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e VersionResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e VersionResponseValidationError) ErrorName() string { return "VersionResponseValidationError" } - -// Error satisfies the builtin error interface -func (e VersionResponseValidationError) 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 %sVersionResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = VersionResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = VersionResponseValidationError{} - -// Validate checks the field values on ReadinessRequest 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 *ReadinessRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ReadinessRequest 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 -// ReadinessRequestMultiError, or nil if none found. -func (m *ReadinessRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *ReadinessRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return ReadinessRequestMultiError(errors) - } - - return nil -} - -// ReadinessRequestMultiError is an error wrapping multiple validation errors -// returned by ReadinessRequest.ValidateAll() if the designated constraints -// aren't met. -type ReadinessRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ReadinessRequestMultiError) 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 ReadinessRequestMultiError) AllErrors() []error { return m } - -// ReadinessRequestValidationError is the validation error returned by -// ReadinessRequest.Validate if the designated constraints aren't met. -type ReadinessRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ReadinessRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ReadinessRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ReadinessRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ReadinessRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ReadinessRequestValidationError) ErrorName() string { return "ReadinessRequestValidationError" } - -// Error satisfies the builtin error interface -func (e ReadinessRequestValidationError) 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 %sReadinessRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ReadinessRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ReadinessRequestValidationError{} - -// Validate checks the field values on ReadinessResponse 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 *ReadinessResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ReadinessResponse 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 -// ReadinessResponseMultiError, or nil if none found. -func (m *ReadinessResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *ReadinessResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return ReadinessResponseMultiError(errors) - } - - return nil -} - -// ReadinessResponseMultiError is an error wrapping multiple validation errors -// returned by ReadinessResponse.ValidateAll() if the designated constraints -// aren't met. -type ReadinessResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ReadinessResponseMultiError) 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 ReadinessResponseMultiError) AllErrors() []error { return m } - -// ReadinessResponseValidationError is the validation error returned by -// ReadinessResponse.Validate if the designated constraints aren't met. -type ReadinessResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ReadinessResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ReadinessResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ReadinessResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ReadinessResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ReadinessResponseValidationError) ErrorName() string { - return "ReadinessResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e ReadinessResponseValidationError) 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 %sReadinessResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ReadinessResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ReadinessResponseValidationError{} - -// Validate checks the field values on LeaderHealthCheckRequest 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 *LeaderHealthCheckRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on LeaderHealthCheckRequest 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 -// LeaderHealthCheckRequestMultiError, or nil if none found. -func (m *LeaderHealthCheckRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *LeaderHealthCheckRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return LeaderHealthCheckRequestMultiError(errors) - } - - return nil -} - -// LeaderHealthCheckRequestMultiError is an error wrapping multiple validation -// errors returned by LeaderHealthCheckRequest.ValidateAll() if the designated -// constraints aren't met. -type LeaderHealthCheckRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m LeaderHealthCheckRequestMultiError) 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 LeaderHealthCheckRequestMultiError) AllErrors() []error { return m } - -// LeaderHealthCheckRequestValidationError is the validation error returned by -// LeaderHealthCheckRequest.Validate if the designated constraints aren't met. -type LeaderHealthCheckRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e LeaderHealthCheckRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e LeaderHealthCheckRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e LeaderHealthCheckRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e LeaderHealthCheckRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e LeaderHealthCheckRequestValidationError) ErrorName() string { - return "LeaderHealthCheckRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e LeaderHealthCheckRequestValidationError) 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 %sLeaderHealthCheckRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = LeaderHealthCheckRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = LeaderHealthCheckRequestValidationError{} - -// Validate checks the field values on LeaderHealthCheckResponse 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 *LeaderHealthCheckResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on LeaderHealthCheckResponse 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 -// LeaderHealthCheckResponseMultiError, or nil if none found. -func (m *LeaderHealthCheckResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *LeaderHealthCheckResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return LeaderHealthCheckResponseMultiError(errors) - } - - return nil -} - -// LeaderHealthCheckResponseMultiError is an error wrapping multiple validation -// errors returned by LeaderHealthCheckResponse.ValidateAll() if the -// designated constraints aren't met. -type LeaderHealthCheckResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m LeaderHealthCheckResponseMultiError) 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 LeaderHealthCheckResponseMultiError) AllErrors() []error { return m } - -// LeaderHealthCheckResponseValidationError is the validation error returned by -// LeaderHealthCheckResponse.Validate if the designated constraints aren't met. -type LeaderHealthCheckResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e LeaderHealthCheckResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e LeaderHealthCheckResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e LeaderHealthCheckResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e LeaderHealthCheckResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e LeaderHealthCheckResponseValidationError) ErrorName() string { - return "LeaderHealthCheckResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e LeaderHealthCheckResponseValidationError) 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 %sLeaderHealthCheckResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = LeaderHealthCheckResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = LeaderHealthCheckResponseValidationError{} - -// Validate checks the field values on CheckUpdatesRequest 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 *CheckUpdatesRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on CheckUpdatesRequest 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 -// CheckUpdatesRequestMultiError, or nil if none found. -func (m *CheckUpdatesRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *CheckUpdatesRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Force - - // no validation rules for OnlyInstalledVersion - - if len(errors) > 0 { - return CheckUpdatesRequestMultiError(errors) - } - - return nil -} - -// CheckUpdatesRequestMultiError is an error wrapping multiple validation -// errors returned by CheckUpdatesRequest.ValidateAll() if the designated -// constraints aren't met. -type CheckUpdatesRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m CheckUpdatesRequestMultiError) 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 CheckUpdatesRequestMultiError) AllErrors() []error { return m } - -// CheckUpdatesRequestValidationError is the validation error returned by -// CheckUpdatesRequest.Validate if the designated constraints aren't met. -type CheckUpdatesRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e CheckUpdatesRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e CheckUpdatesRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e CheckUpdatesRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e CheckUpdatesRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e CheckUpdatesRequestValidationError) ErrorName() string { - return "CheckUpdatesRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e CheckUpdatesRequestValidationError) 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 %sCheckUpdatesRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = CheckUpdatesRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = CheckUpdatesRequestValidationError{} - -// Validate checks the field values on DockerVersionInfo 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 *DockerVersionInfo) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on DockerVersionInfo 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 -// DockerVersionInfoMultiError, or nil if none found. -func (m *DockerVersionInfo) ValidateAll() error { - return m.validate(true) -} - -func (m *DockerVersionInfo) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Version - - // no validation rules for Tag - - if all { - switch v := interface{}(m.GetTimestamp()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, DockerVersionInfoValidationError{ - field: "Timestamp", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, DockerVersionInfoValidationError{ - field: "Timestamp", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetTimestamp()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return DockerVersionInfoValidationError{ - field: "Timestamp", - reason: "embedded message failed validation", - cause: err, - } - } - } - - // no validation rules for ReleaseNotesUrl - - // no validation rules for ReleaseNotesText - - if len(errors) > 0 { - return DockerVersionInfoMultiError(errors) - } - - return nil -} - -// DockerVersionInfoMultiError is an error wrapping multiple validation errors -// returned by DockerVersionInfo.ValidateAll() if the designated constraints -// aren't met. -type DockerVersionInfoMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m DockerVersionInfoMultiError) 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 DockerVersionInfoMultiError) AllErrors() []error { return m } - -// DockerVersionInfoValidationError is the validation error returned by -// DockerVersionInfo.Validate if the designated constraints aren't met. -type DockerVersionInfoValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e DockerVersionInfoValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e DockerVersionInfoValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e DockerVersionInfoValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e DockerVersionInfoValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e DockerVersionInfoValidationError) ErrorName() string { - return "DockerVersionInfoValidationError" -} - -// Error satisfies the builtin error interface -func (e DockerVersionInfoValidationError) 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 %sDockerVersionInfo.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = DockerVersionInfoValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = DockerVersionInfoValidationError{} - -// Validate checks the field values on CheckUpdatesResponse 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 *CheckUpdatesResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on CheckUpdatesResponse 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 -// CheckUpdatesResponseMultiError, or nil if none found. -func (m *CheckUpdatesResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *CheckUpdatesResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if all { - switch v := interface{}(m.GetInstalled()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, CheckUpdatesResponseValidationError{ - field: "Installed", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, CheckUpdatesResponseValidationError{ - field: "Installed", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetInstalled()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return CheckUpdatesResponseValidationError{ - field: "Installed", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetLatest()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, CheckUpdatesResponseValidationError{ - field: "Latest", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, CheckUpdatesResponseValidationError{ - field: "Latest", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetLatest()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return CheckUpdatesResponseValidationError{ - field: "Latest", - reason: "embedded message failed validation", - cause: err, - } - } - } - - // no validation rules for UpdateAvailable - - // no validation rules for LatestNewsUrl - - if all { - switch v := interface{}(m.GetLastCheck()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, CheckUpdatesResponseValidationError{ - field: "LastCheck", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, CheckUpdatesResponseValidationError{ - field: "LastCheck", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetLastCheck()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return CheckUpdatesResponseValidationError{ - field: "LastCheck", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if len(errors) > 0 { - return CheckUpdatesResponseMultiError(errors) - } - - return nil -} - -// CheckUpdatesResponseMultiError is an error wrapping multiple validation -// errors returned by CheckUpdatesResponse.ValidateAll() if the designated -// constraints aren't met. -type CheckUpdatesResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m CheckUpdatesResponseMultiError) 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 CheckUpdatesResponseMultiError) AllErrors() []error { return m } - -// CheckUpdatesResponseValidationError is the validation error returned by -// CheckUpdatesResponse.Validate if the designated constraints aren't met. -type CheckUpdatesResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e CheckUpdatesResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e CheckUpdatesResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e CheckUpdatesResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e CheckUpdatesResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e CheckUpdatesResponseValidationError) ErrorName() string { - return "CheckUpdatesResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e CheckUpdatesResponseValidationError) 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 %sCheckUpdatesResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = CheckUpdatesResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = CheckUpdatesResponseValidationError{} - -// Validate checks the field values on ListChangeLogsRequest 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 *ListChangeLogsRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ListChangeLogsRequest 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 -// ListChangeLogsRequestMultiError, or nil if none found. -func (m *ListChangeLogsRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *ListChangeLogsRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return ListChangeLogsRequestMultiError(errors) - } - - return nil -} - -// ListChangeLogsRequestMultiError is an error wrapping multiple validation -// errors returned by ListChangeLogsRequest.ValidateAll() if the designated -// constraints aren't met. -type ListChangeLogsRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ListChangeLogsRequestMultiError) 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 ListChangeLogsRequestMultiError) AllErrors() []error { return m } - -// ListChangeLogsRequestValidationError is the validation error returned by -// ListChangeLogsRequest.Validate if the designated constraints aren't met. -type ListChangeLogsRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ListChangeLogsRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ListChangeLogsRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ListChangeLogsRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ListChangeLogsRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ListChangeLogsRequestValidationError) ErrorName() string { - return "ListChangeLogsRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e ListChangeLogsRequestValidationError) 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 %sListChangeLogsRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ListChangeLogsRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ListChangeLogsRequestValidationError{} - -// Validate checks the field values on ListChangeLogsResponse 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 *ListChangeLogsResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ListChangeLogsResponse 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 -// ListChangeLogsResponseMultiError, or nil if none found. -func (m *ListChangeLogsResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *ListChangeLogsResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - for idx, item := range m.GetUpdates() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ListChangeLogsResponseValidationError{ - field: fmt.Sprintf("Updates[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ListChangeLogsResponseValidationError{ - field: fmt.Sprintf("Updates[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ListChangeLogsResponseValidationError{ - field: fmt.Sprintf("Updates[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - if all { - switch v := interface{}(m.GetLastCheck()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ListChangeLogsResponseValidationError{ - field: "LastCheck", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ListChangeLogsResponseValidationError{ - field: "LastCheck", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetLastCheck()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ListChangeLogsResponseValidationError{ - field: "LastCheck", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if len(errors) > 0 { - return ListChangeLogsResponseMultiError(errors) - } - - return nil -} - -// ListChangeLogsResponseMultiError is an error wrapping multiple validation -// errors returned by ListChangeLogsResponse.ValidateAll() if the designated -// constraints aren't met. -type ListChangeLogsResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ListChangeLogsResponseMultiError) 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 ListChangeLogsResponseMultiError) AllErrors() []error { return m } - -// ListChangeLogsResponseValidationError is the validation error returned by -// ListChangeLogsResponse.Validate if the designated constraints aren't met. -type ListChangeLogsResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ListChangeLogsResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ListChangeLogsResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ListChangeLogsResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ListChangeLogsResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ListChangeLogsResponseValidationError) ErrorName() string { - return "ListChangeLogsResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e ListChangeLogsResponseValidationError) 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 %sListChangeLogsResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ListChangeLogsResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ListChangeLogsResponseValidationError{} - -// Validate checks the field values on StartUpdateRequest 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 *StartUpdateRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on StartUpdateRequest 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 -// StartUpdateRequestMultiError, or nil if none found. -func (m *StartUpdateRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *StartUpdateRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for NewImage - - if len(errors) > 0 { - return StartUpdateRequestMultiError(errors) - } - - return nil -} - -// StartUpdateRequestMultiError is an error wrapping multiple validation errors -// returned by StartUpdateRequest.ValidateAll() if the designated constraints -// aren't met. -type StartUpdateRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m StartUpdateRequestMultiError) 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 StartUpdateRequestMultiError) AllErrors() []error { return m } - -// StartUpdateRequestValidationError is the validation error returned by -// StartUpdateRequest.Validate if the designated constraints aren't met. -type StartUpdateRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e StartUpdateRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e StartUpdateRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e StartUpdateRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e StartUpdateRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e StartUpdateRequestValidationError) ErrorName() string { - return "StartUpdateRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e StartUpdateRequestValidationError) 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 %sStartUpdateRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = StartUpdateRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = StartUpdateRequestValidationError{} - -// Validate checks the field values on StartUpdateResponse 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 *StartUpdateResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on StartUpdateResponse 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 -// StartUpdateResponseMultiError, or nil if none found. -func (m *StartUpdateResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *StartUpdateResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for AuthToken - - // no validation rules for LogOffset - - if len(errors) > 0 { - return StartUpdateResponseMultiError(errors) - } - - return nil -} - -// StartUpdateResponseMultiError is an error wrapping multiple validation -// errors returned by StartUpdateResponse.ValidateAll() if the designated -// constraints aren't met. -type StartUpdateResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m StartUpdateResponseMultiError) 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 StartUpdateResponseMultiError) AllErrors() []error { return m } - -// StartUpdateResponseValidationError is the validation error returned by -// StartUpdateResponse.Validate if the designated constraints aren't met. -type StartUpdateResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e StartUpdateResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e StartUpdateResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e StartUpdateResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e StartUpdateResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e StartUpdateResponseValidationError) ErrorName() string { - return "StartUpdateResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e StartUpdateResponseValidationError) 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 %sStartUpdateResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = StartUpdateResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = StartUpdateResponseValidationError{} - -// Validate checks the field values on UpdateStatusRequest 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 *UpdateStatusRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on UpdateStatusRequest 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 -// UpdateStatusRequestMultiError, or nil if none found. -func (m *UpdateStatusRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *UpdateStatusRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for AuthToken - - // no validation rules for LogOffset - - if len(errors) > 0 { - return UpdateStatusRequestMultiError(errors) - } - - return nil -} - -// UpdateStatusRequestMultiError is an error wrapping multiple validation -// errors returned by UpdateStatusRequest.ValidateAll() if the designated -// constraints aren't met. -type UpdateStatusRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m UpdateStatusRequestMultiError) 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 UpdateStatusRequestMultiError) AllErrors() []error { return m } - -// UpdateStatusRequestValidationError is the validation error returned by -// UpdateStatusRequest.Validate if the designated constraints aren't met. -type UpdateStatusRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e UpdateStatusRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e UpdateStatusRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e UpdateStatusRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e UpdateStatusRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e UpdateStatusRequestValidationError) ErrorName() string { - return "UpdateStatusRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e UpdateStatusRequestValidationError) 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 %sUpdateStatusRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = UpdateStatusRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = UpdateStatusRequestValidationError{} - -// Validate checks the field values on UpdateStatusResponse 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 *UpdateStatusResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on UpdateStatusResponse 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 -// UpdateStatusResponseMultiError, or nil if none found. -func (m *UpdateStatusResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *UpdateStatusResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for LogOffset - - // no validation rules for Done - - if len(errors) > 0 { - return UpdateStatusResponseMultiError(errors) - } - - return nil -} - -// UpdateStatusResponseMultiError is an error wrapping multiple validation -// errors returned by UpdateStatusResponse.ValidateAll() if the designated -// constraints aren't met. -type UpdateStatusResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m UpdateStatusResponseMultiError) 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 UpdateStatusResponseMultiError) AllErrors() []error { return m } - -// UpdateStatusResponseValidationError is the validation error returned by -// UpdateStatusResponse.Validate if the designated constraints aren't met. -type UpdateStatusResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e UpdateStatusResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e UpdateStatusResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e UpdateStatusResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e UpdateStatusResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e UpdateStatusResponseValidationError) ErrorName() string { - return "UpdateStatusResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e UpdateStatusResponseValidationError) 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 %sUpdateStatusResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = UpdateStatusResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = UpdateStatusResponseValidationError{} - -// Validate checks the field values on MetricsResolutions 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 *MetricsResolutions) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on MetricsResolutions 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 -// MetricsResolutionsMultiError, or nil if none found. -func (m *MetricsResolutions) ValidateAll() error { - return m.validate(true) -} - -func (m *MetricsResolutions) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if all { - switch v := interface{}(m.GetHr()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, MetricsResolutionsValidationError{ - field: "Hr", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, MetricsResolutionsValidationError{ - field: "Hr", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetHr()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return MetricsResolutionsValidationError{ - field: "Hr", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetMr()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, MetricsResolutionsValidationError{ - field: "Mr", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, MetricsResolutionsValidationError{ - field: "Mr", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMr()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return MetricsResolutionsValidationError{ - field: "Mr", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetLr()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, MetricsResolutionsValidationError{ - field: "Lr", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, MetricsResolutionsValidationError{ - field: "Lr", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetLr()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return MetricsResolutionsValidationError{ - field: "Lr", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if len(errors) > 0 { - return MetricsResolutionsMultiError(errors) - } - - return nil -} - -// MetricsResolutionsMultiError is an error wrapping multiple validation errors -// returned by MetricsResolutions.ValidateAll() if the designated constraints -// aren't met. -type MetricsResolutionsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m MetricsResolutionsMultiError) 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 MetricsResolutionsMultiError) AllErrors() []error { return m } - -// MetricsResolutionsValidationError is the validation error returned by -// MetricsResolutions.Validate if the designated constraints aren't met. -type MetricsResolutionsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e MetricsResolutionsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e MetricsResolutionsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e MetricsResolutionsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e MetricsResolutionsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e MetricsResolutionsValidationError) ErrorName() string { - return "MetricsResolutionsValidationError" -} - -// Error satisfies the builtin error interface -func (e MetricsResolutionsValidationError) 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 %sMetricsResolutions.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = MetricsResolutionsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = MetricsResolutionsValidationError{} - -// Validate checks the field values on AdvisorRunIntervals 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 *AdvisorRunIntervals) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on AdvisorRunIntervals 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 -// AdvisorRunIntervalsMultiError, or nil if none found. -func (m *AdvisorRunIntervals) ValidateAll() error { - return m.validate(true) -} - -func (m *AdvisorRunIntervals) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if all { - switch v := interface{}(m.GetStandardInterval()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AdvisorRunIntervalsValidationError{ - field: "StandardInterval", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AdvisorRunIntervalsValidationError{ - field: "StandardInterval", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetStandardInterval()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AdvisorRunIntervalsValidationError{ - field: "StandardInterval", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetRareInterval()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AdvisorRunIntervalsValidationError{ - field: "RareInterval", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AdvisorRunIntervalsValidationError{ - field: "RareInterval", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetRareInterval()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AdvisorRunIntervalsValidationError{ - field: "RareInterval", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetFrequentInterval()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AdvisorRunIntervalsValidationError{ - field: "FrequentInterval", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AdvisorRunIntervalsValidationError{ - field: "FrequentInterval", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetFrequentInterval()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AdvisorRunIntervalsValidationError{ - field: "FrequentInterval", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if len(errors) > 0 { - return AdvisorRunIntervalsMultiError(errors) - } - - return nil -} - -// AdvisorRunIntervalsMultiError is an error wrapping multiple validation -// errors returned by AdvisorRunIntervals.ValidateAll() if the designated -// constraints aren't met. -type AdvisorRunIntervalsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m AdvisorRunIntervalsMultiError) 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 AdvisorRunIntervalsMultiError) AllErrors() []error { return m } - -// AdvisorRunIntervalsValidationError is the validation error returned by -// AdvisorRunIntervals.Validate if the designated constraints aren't met. -type AdvisorRunIntervalsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e AdvisorRunIntervalsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e AdvisorRunIntervalsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e AdvisorRunIntervalsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e AdvisorRunIntervalsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e AdvisorRunIntervalsValidationError) ErrorName() string { - return "AdvisorRunIntervalsValidationError" -} - -// Error satisfies the builtin error interface -func (e AdvisorRunIntervalsValidationError) 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 %sAdvisorRunIntervals.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = AdvisorRunIntervalsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = AdvisorRunIntervalsValidationError{} - -// Validate checks the field values on Settings 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 *Settings) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on Settings 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 SettingsMultiError, or nil -// if none found. -func (m *Settings) ValidateAll() error { - return m.validate(true) -} - -func (m *Settings) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for UpdatesEnabled - - // no validation rules for TelemetryEnabled - - if all { - switch v := interface{}(m.GetMetricsResolutions()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, SettingsValidationError{ - field: "MetricsResolutions", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, SettingsValidationError{ - field: "MetricsResolutions", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMetricsResolutions()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return SettingsValidationError{ - field: "MetricsResolutions", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetDataRetention()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, SettingsValidationError{ - field: "DataRetention", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, SettingsValidationError{ - field: "DataRetention", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetDataRetention()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return SettingsValidationError{ - field: "DataRetention", - reason: "embedded message failed validation", - cause: err, - } - } - } - - // no validation rules for SshKey - - // no validation rules for AdvisorEnabled - - // no validation rules for PlatformEmail - - // no validation rules for AlertingEnabled - - // no validation rules for PmmPublicAddress - - if all { - switch v := interface{}(m.GetAdvisorRunIntervals()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, SettingsValidationError{ - field: "AdvisorRunIntervals", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, SettingsValidationError{ - field: "AdvisorRunIntervals", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetAdvisorRunIntervals()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return SettingsValidationError{ - field: "AdvisorRunIntervals", - reason: "embedded message failed validation", - cause: err, - } - } - } - - // no validation rules for BackupManagementEnabled - - // no validation rules for AzurediscoverEnabled - - // no validation rules for ConnectedToPlatform - - // no validation rules for EnableAccessControl - - // no validation rules for DefaultRoleId - - // no validation rules for EnableInternalPgQan - - if all { - switch v := interface{}(m.GetUpdateSnoozeDuration()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, SettingsValidationError{ - field: "UpdateSnoozeDuration", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, SettingsValidationError{ - field: "UpdateSnoozeDuration", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetUpdateSnoozeDuration()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return SettingsValidationError{ - field: "UpdateSnoozeDuration", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if len(errors) > 0 { - return SettingsMultiError(errors) - } - - return nil -} - -// SettingsMultiError is an error wrapping multiple validation errors returned -// by Settings.ValidateAll() if the designated constraints aren't met. -type SettingsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m SettingsMultiError) 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 SettingsMultiError) AllErrors() []error { return m } - -// SettingsValidationError is the validation error returned by -// Settings.Validate if the designated constraints aren't met. -type SettingsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e SettingsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e SettingsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e SettingsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e SettingsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e SettingsValidationError) ErrorName() string { return "SettingsValidationError" } - -// Error satisfies the builtin error interface -func (e SettingsValidationError) 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 %sSettings.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = SettingsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = SettingsValidationError{} - -// Validate checks the field values on ReadOnlySettings 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 *ReadOnlySettings) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ReadOnlySettings 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 -// ReadOnlySettingsMultiError, or nil if none found. -func (m *ReadOnlySettings) ValidateAll() error { - return m.validate(true) -} - -func (m *ReadOnlySettings) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for UpdatesEnabled - - // no validation rules for TelemetryEnabled - - // no validation rules for AdvisorEnabled - - // no validation rules for AlertingEnabled - - // no validation rules for PmmPublicAddress - - // no validation rules for BackupManagementEnabled - - // no validation rules for AzurediscoverEnabled - - // no validation rules for EnableAccessControl - - if len(errors) > 0 { - return ReadOnlySettingsMultiError(errors) - } - - return nil -} - -// ReadOnlySettingsMultiError is an error wrapping multiple validation errors -// returned by ReadOnlySettings.ValidateAll() if the designated constraints -// aren't met. -type ReadOnlySettingsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ReadOnlySettingsMultiError) 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 ReadOnlySettingsMultiError) AllErrors() []error { return m } - -// ReadOnlySettingsValidationError is the validation error returned by -// ReadOnlySettings.Validate if the designated constraints aren't met. -type ReadOnlySettingsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ReadOnlySettingsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ReadOnlySettingsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ReadOnlySettingsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ReadOnlySettingsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ReadOnlySettingsValidationError) ErrorName() string { return "ReadOnlySettingsValidationError" } - -// Error satisfies the builtin error interface -func (e ReadOnlySettingsValidationError) 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 %sReadOnlySettings.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ReadOnlySettingsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ReadOnlySettingsValidationError{} - -// Validate checks the field values on GetSettingsRequest 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 *GetSettingsRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on GetSettingsRequest 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 -// GetSettingsRequestMultiError, or nil if none found. -func (m *GetSettingsRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *GetSettingsRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return GetSettingsRequestMultiError(errors) - } - - return nil -} - -// GetSettingsRequestMultiError is an error wrapping multiple validation errors -// returned by GetSettingsRequest.ValidateAll() if the designated constraints -// aren't met. -type GetSettingsRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m GetSettingsRequestMultiError) 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 GetSettingsRequestMultiError) AllErrors() []error { return m } - -// GetSettingsRequestValidationError is the validation error returned by -// GetSettingsRequest.Validate if the designated constraints aren't met. -type GetSettingsRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e GetSettingsRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e GetSettingsRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e GetSettingsRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e GetSettingsRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e GetSettingsRequestValidationError) ErrorName() string { - return "GetSettingsRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e GetSettingsRequestValidationError) 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 %sGetSettingsRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = GetSettingsRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = GetSettingsRequestValidationError{} - -// Validate checks the field values on GetReadOnlySettingsRequest 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 *GetReadOnlySettingsRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on GetReadOnlySettingsRequest 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 -// GetReadOnlySettingsRequestMultiError, or nil if none found. -func (m *GetReadOnlySettingsRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *GetReadOnlySettingsRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return GetReadOnlySettingsRequestMultiError(errors) - } - - return nil -} - -// GetReadOnlySettingsRequestMultiError is an error wrapping multiple -// validation errors returned by GetReadOnlySettingsRequest.ValidateAll() if -// the designated constraints aren't met. -type GetReadOnlySettingsRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m GetReadOnlySettingsRequestMultiError) 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 GetReadOnlySettingsRequestMultiError) AllErrors() []error { return m } - -// GetReadOnlySettingsRequestValidationError is the validation error returned -// by GetReadOnlySettingsRequest.Validate if the designated constraints aren't met. -type GetReadOnlySettingsRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e GetReadOnlySettingsRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e GetReadOnlySettingsRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e GetReadOnlySettingsRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e GetReadOnlySettingsRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e GetReadOnlySettingsRequestValidationError) ErrorName() string { - return "GetReadOnlySettingsRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e GetReadOnlySettingsRequestValidationError) 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 %sGetReadOnlySettingsRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = GetReadOnlySettingsRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = GetReadOnlySettingsRequestValidationError{} - -// Validate checks the field values on GetSettingsResponse 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 *GetSettingsResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on GetSettingsResponse 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 -// GetSettingsResponseMultiError, or nil if none found. -func (m *GetSettingsResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *GetSettingsResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if all { - switch v := interface{}(m.GetSettings()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GetSettingsResponseValidationError{ - field: "Settings", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GetSettingsResponseValidationError{ - field: "Settings", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetSettings()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GetSettingsResponseValidationError{ - field: "Settings", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if len(errors) > 0 { - return GetSettingsResponseMultiError(errors) - } - - return nil -} - -// GetSettingsResponseMultiError is an error wrapping multiple validation -// errors returned by GetSettingsResponse.ValidateAll() if the designated -// constraints aren't met. -type GetSettingsResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m GetSettingsResponseMultiError) 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 GetSettingsResponseMultiError) AllErrors() []error { return m } - -// GetSettingsResponseValidationError is the validation error returned by -// GetSettingsResponse.Validate if the designated constraints aren't met. -type GetSettingsResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e GetSettingsResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e GetSettingsResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e GetSettingsResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e GetSettingsResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e GetSettingsResponseValidationError) ErrorName() string { - return "GetSettingsResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e GetSettingsResponseValidationError) 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 %sGetSettingsResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = GetSettingsResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = GetSettingsResponseValidationError{} - -// Validate checks the field values on GetReadOnlySettingsResponse 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 *GetReadOnlySettingsResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on GetReadOnlySettingsResponse 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 -// GetReadOnlySettingsResponseMultiError, or nil if none found. -func (m *GetReadOnlySettingsResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *GetReadOnlySettingsResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if all { - switch v := interface{}(m.GetSettings()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GetReadOnlySettingsResponseValidationError{ - field: "Settings", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GetReadOnlySettingsResponseValidationError{ - field: "Settings", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetSettings()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GetReadOnlySettingsResponseValidationError{ - field: "Settings", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if len(errors) > 0 { - return GetReadOnlySettingsResponseMultiError(errors) - } - - return nil -} - -// GetReadOnlySettingsResponseMultiError is an error wrapping multiple -// validation errors returned by GetReadOnlySettingsResponse.ValidateAll() if -// the designated constraints aren't met. -type GetReadOnlySettingsResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m GetReadOnlySettingsResponseMultiError) 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 GetReadOnlySettingsResponseMultiError) AllErrors() []error { return m } - -// GetReadOnlySettingsResponseValidationError is the validation error returned -// by GetReadOnlySettingsResponse.Validate if the designated constraints -// aren't met. -type GetReadOnlySettingsResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e GetReadOnlySettingsResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e GetReadOnlySettingsResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e GetReadOnlySettingsResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e GetReadOnlySettingsResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e GetReadOnlySettingsResponseValidationError) ErrorName() string { - return "GetReadOnlySettingsResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e GetReadOnlySettingsResponseValidationError) 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 %sGetReadOnlySettingsResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = GetReadOnlySettingsResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = GetReadOnlySettingsResponseValidationError{} - -// Validate checks the field values on ChangeSettingsRequest 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 *ChangeSettingsRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ChangeSettingsRequest 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 -// ChangeSettingsRequestMultiError, or nil if none found. -func (m *ChangeSettingsRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *ChangeSettingsRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if all { - switch v := interface{}(m.GetMetricsResolutions()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeSettingsRequestValidationError{ - field: "MetricsResolutions", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeSettingsRequestValidationError{ - field: "MetricsResolutions", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMetricsResolutions()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeSettingsRequestValidationError{ - field: "MetricsResolutions", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetDataRetention()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeSettingsRequestValidationError{ - field: "DataRetention", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeSettingsRequestValidationError{ - field: "DataRetention", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetDataRetention()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeSettingsRequestValidationError{ - field: "DataRetention", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetAdvisorRunIntervals()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeSettingsRequestValidationError{ - field: "AdvisorRunIntervals", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeSettingsRequestValidationError{ - field: "AdvisorRunIntervals", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetAdvisorRunIntervals()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeSettingsRequestValidationError{ - field: "AdvisorRunIntervals", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetUpdateSnoozeDuration()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeSettingsRequestValidationError{ - field: "UpdateSnoozeDuration", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeSettingsRequestValidationError{ - field: "UpdateSnoozeDuration", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetUpdateSnoozeDuration()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeSettingsRequestValidationError{ - field: "UpdateSnoozeDuration", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if m.EnableUpdates != nil { - // no validation rules for EnableUpdates - } - - if m.EnableTelemetry != nil { - // no validation rules for EnableTelemetry - } - - if m.SshKey != nil { - // no validation rules for SshKey - } - - if m.AwsPartitions != nil { - if all { - switch v := interface{}(m.GetAwsPartitions()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeSettingsRequestValidationError{ - field: "AwsPartitions", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeSettingsRequestValidationError{ - field: "AwsPartitions", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetAwsPartitions()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeSettingsRequestValidationError{ - field: "AwsPartitions", - reason: "embedded message failed validation", - cause: err, - } - } - } - } - - if m.EnableAdvisor != nil { - // no validation rules for EnableAdvisor - } - - if m.EnableAlerting != nil { - // no validation rules for EnableAlerting - } - - if m.PmmPublicAddress != nil { - // no validation rules for PmmPublicAddress - } - - if m.EnableAzurediscover != nil { - // no validation rules for EnableAzurediscover - } - - if m.EnableBackupManagement != nil { - // no validation rules for EnableBackupManagement - } - - if m.EnableAccessControl != nil { - // no validation rules for EnableAccessControl - } - - if m.EnableInternalPgQan != nil { - // no validation rules for EnableInternalPgQan - } - - if len(errors) > 0 { - return ChangeSettingsRequestMultiError(errors) - } - - return nil -} - -// ChangeSettingsRequestMultiError is an error wrapping multiple validation -// errors returned by ChangeSettingsRequest.ValidateAll() if the designated -// constraints aren't met. -type ChangeSettingsRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ChangeSettingsRequestMultiError) 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 ChangeSettingsRequestMultiError) AllErrors() []error { return m } - -// ChangeSettingsRequestValidationError is the validation error returned by -// ChangeSettingsRequest.Validate if the designated constraints aren't met. -type ChangeSettingsRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ChangeSettingsRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ChangeSettingsRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ChangeSettingsRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ChangeSettingsRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ChangeSettingsRequestValidationError) ErrorName() string { - return "ChangeSettingsRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e ChangeSettingsRequestValidationError) 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 %sChangeSettingsRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ChangeSettingsRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ChangeSettingsRequestValidationError{} - -// Validate checks the field values on ChangeSettingsResponse 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 *ChangeSettingsResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ChangeSettingsResponse 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 -// ChangeSettingsResponseMultiError, or nil if none found. -func (m *ChangeSettingsResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *ChangeSettingsResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if all { - switch v := interface{}(m.GetSettings()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeSettingsResponseValidationError{ - field: "Settings", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeSettingsResponseValidationError{ - field: "Settings", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetSettings()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeSettingsResponseValidationError{ - field: "Settings", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if len(errors) > 0 { - return ChangeSettingsResponseMultiError(errors) - } - - return nil -} - -// ChangeSettingsResponseMultiError is an error wrapping multiple validation -// errors returned by ChangeSettingsResponse.ValidateAll() if the designated -// constraints aren't met. -type ChangeSettingsResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ChangeSettingsResponseMultiError) 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 ChangeSettingsResponseMultiError) AllErrors() []error { return m } - -// ChangeSettingsResponseValidationError is the validation error returned by -// ChangeSettingsResponse.Validate if the designated constraints aren't met. -type ChangeSettingsResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ChangeSettingsResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ChangeSettingsResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ChangeSettingsResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ChangeSettingsResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ChangeSettingsResponseValidationError) ErrorName() string { - return "ChangeSettingsResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e ChangeSettingsResponseValidationError) 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 %sChangeSettingsResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ChangeSettingsResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ChangeSettingsResponseValidationError{} diff --git a/api/server/v1/server_grpc.pb.go b/api/server/v1/server_grpc.pb.go deleted file mode 100644 index 29719f730c8..00000000000 --- a/api/server/v1/server_grpc.pb.go +++ /dev/null @@ -1,499 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.6.0 -// - protoc (unknown) -// source: server/v1/server.proto - -package serverv1 - -import ( - context "context" - - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.64.0 or later. -const _ = grpc.SupportPackageIsVersion9 - -const ( - ServerService_Version_FullMethodName = "/server.v1.ServerService/Version" - ServerService_Readiness_FullMethodName = "/server.v1.ServerService/Readiness" - ServerService_LeaderHealthCheck_FullMethodName = "/server.v1.ServerService/LeaderHealthCheck" - ServerService_CheckUpdates_FullMethodName = "/server.v1.ServerService/CheckUpdates" - ServerService_ListChangeLogs_FullMethodName = "/server.v1.ServerService/ListChangeLogs" - ServerService_StartUpdate_FullMethodName = "/server.v1.ServerService/StartUpdate" - ServerService_UpdateStatus_FullMethodName = "/server.v1.ServerService/UpdateStatus" - ServerService_GetSettings_FullMethodName = "/server.v1.ServerService/GetSettings" - ServerService_GetReadOnlySettings_FullMethodName = "/server.v1.ServerService/GetReadOnlySettings" - ServerService_ChangeSettings_FullMethodName = "/server.v1.ServerService/ChangeSettings" -) - -// ServerServiceClient is the client API for ServerService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -// -// Server service provides generic PMM Server public APIs. -type ServerServiceClient interface { - // Version returns PMM Server versions. - Version(ctx context.Context, in *VersionRequest, opts ...grpc.CallOption) (*VersionResponse, error) - // Readiness 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. - Readiness(ctx context.Context, in *ReadinessRequest, opts ...grpc.CallOption) (*ReadinessResponse, error) - // LeaderHealthCheck checks if the instance is the leader in a cluster. - LeaderHealthCheck(ctx context.Context, in *LeaderHealthCheckRequest, opts ...grpc.CallOption) (*LeaderHealthCheckResponse, error) - // CheckUpdates checks for available PMM Server updates. - CheckUpdates(ctx context.Context, in *CheckUpdatesRequest, opts ...grpc.CallOption) (*CheckUpdatesResponse, error) - // ListChangeLogs delivers the changelog. - ListChangeLogs(ctx context.Context, in *ListChangeLogsRequest, opts ...grpc.CallOption) (*ListChangeLogsResponse, error) - // StartUpdate starts PMM Server update. - StartUpdate(ctx context.Context, in *StartUpdateRequest, opts ...grpc.CallOption) (*StartUpdateResponse, error) - // UpdateStatus returns PMM Server update status. - UpdateStatus(ctx context.Context, in *UpdateStatusRequest, opts ...grpc.CallOption) (*UpdateStatusResponse, error) - // GetSettings returns current PMM Server settings. - GetSettings(ctx context.Context, in *GetSettingsRequest, opts ...grpc.CallOption) (*GetSettingsResponse, error) - // GetReadOnlySettings returns a limited number of PMM settings that is opened to authenticated users of all roles. - GetReadOnlySettings(ctx context.Context, in *GetReadOnlySettingsRequest, opts ...grpc.CallOption) (*GetReadOnlySettingsResponse, error) - // ChangeSettings changes PMM Server settings. - ChangeSettings(ctx context.Context, in *ChangeSettingsRequest, opts ...grpc.CallOption) (*ChangeSettingsResponse, error) -} - -type serverServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewServerServiceClient(cc grpc.ClientConnInterface) ServerServiceClient { - return &serverServiceClient{cc} -} - -func (c *serverServiceClient) Version(ctx context.Context, in *VersionRequest, opts ...grpc.CallOption) (*VersionResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(VersionResponse) - err := c.cc.Invoke(ctx, ServerService_Version_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *serverServiceClient) Readiness(ctx context.Context, in *ReadinessRequest, opts ...grpc.CallOption) (*ReadinessResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(ReadinessResponse) - err := c.cc.Invoke(ctx, ServerService_Readiness_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *serverServiceClient) LeaderHealthCheck(ctx context.Context, in *LeaderHealthCheckRequest, opts ...grpc.CallOption) (*LeaderHealthCheckResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(LeaderHealthCheckResponse) - err := c.cc.Invoke(ctx, ServerService_LeaderHealthCheck_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *serverServiceClient) CheckUpdates(ctx context.Context, in *CheckUpdatesRequest, opts ...grpc.CallOption) (*CheckUpdatesResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(CheckUpdatesResponse) - err := c.cc.Invoke(ctx, ServerService_CheckUpdates_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *serverServiceClient) ListChangeLogs(ctx context.Context, in *ListChangeLogsRequest, opts ...grpc.CallOption) (*ListChangeLogsResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(ListChangeLogsResponse) - err := c.cc.Invoke(ctx, ServerService_ListChangeLogs_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *serverServiceClient) StartUpdate(ctx context.Context, in *StartUpdateRequest, opts ...grpc.CallOption) (*StartUpdateResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(StartUpdateResponse) - err := c.cc.Invoke(ctx, ServerService_StartUpdate_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *serverServiceClient) UpdateStatus(ctx context.Context, in *UpdateStatusRequest, opts ...grpc.CallOption) (*UpdateStatusResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(UpdateStatusResponse) - err := c.cc.Invoke(ctx, ServerService_UpdateStatus_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *serverServiceClient) GetSettings(ctx context.Context, in *GetSettingsRequest, opts ...grpc.CallOption) (*GetSettingsResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetSettingsResponse) - err := c.cc.Invoke(ctx, ServerService_GetSettings_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *serverServiceClient) GetReadOnlySettings(ctx context.Context, in *GetReadOnlySettingsRequest, opts ...grpc.CallOption) (*GetReadOnlySettingsResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetReadOnlySettingsResponse) - err := c.cc.Invoke(ctx, ServerService_GetReadOnlySettings_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *serverServiceClient) ChangeSettings(ctx context.Context, in *ChangeSettingsRequest, opts ...grpc.CallOption) (*ChangeSettingsResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(ChangeSettingsResponse) - err := c.cc.Invoke(ctx, ServerService_ChangeSettings_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -// ServerServiceServer is the server API for ServerService service. -// All implementations must embed UnimplementedServerServiceServer -// for forward compatibility. -// -// Server service provides generic PMM Server public APIs. -type ServerServiceServer interface { - // Version returns PMM Server versions. - Version(context.Context, *VersionRequest) (*VersionResponse, error) - // Readiness 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. - Readiness(context.Context, *ReadinessRequest) (*ReadinessResponse, error) - // LeaderHealthCheck checks if the instance is the leader in a cluster. - LeaderHealthCheck(context.Context, *LeaderHealthCheckRequest) (*LeaderHealthCheckResponse, error) - // CheckUpdates checks for available PMM Server updates. - CheckUpdates(context.Context, *CheckUpdatesRequest) (*CheckUpdatesResponse, error) - // ListChangeLogs delivers the changelog. - ListChangeLogs(context.Context, *ListChangeLogsRequest) (*ListChangeLogsResponse, error) - // StartUpdate starts PMM Server update. - StartUpdate(context.Context, *StartUpdateRequest) (*StartUpdateResponse, error) - // UpdateStatus returns PMM Server update status. - UpdateStatus(context.Context, *UpdateStatusRequest) (*UpdateStatusResponse, error) - // GetSettings returns current PMM Server settings. - GetSettings(context.Context, *GetSettingsRequest) (*GetSettingsResponse, error) - // GetReadOnlySettings returns a limited number of PMM settings that is opened to authenticated users of all roles. - GetReadOnlySettings(context.Context, *GetReadOnlySettingsRequest) (*GetReadOnlySettingsResponse, error) - // ChangeSettings changes PMM Server settings. - ChangeSettings(context.Context, *ChangeSettingsRequest) (*ChangeSettingsResponse, error) - mustEmbedUnimplementedServerServiceServer() -} - -// UnimplementedServerServiceServer must be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -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") -} -func (UnimplementedServerServiceServer) mustEmbedUnimplementedServerServiceServer() {} -func (UnimplementedServerServiceServer) testEmbeddedByValue() {} - -// UnsafeServerServiceServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to ServerServiceServer will -// result in compilation errors. -type UnsafeServerServiceServer interface { - mustEmbedUnimplementedServerServiceServer() -} - -func RegisterServerServiceServer(s grpc.ServiceRegistrar, srv ServerServiceServer) { - // If the following call panics, it indicates UnimplementedServerServiceServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } - s.RegisterService(&ServerService_ServiceDesc, srv) -} - -func _ServerService_Version_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(VersionRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ServerServiceServer).Version(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: ServerService_Version_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ServerServiceServer).Version(ctx, req.(*VersionRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ServerService_Readiness_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ReadinessRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ServerServiceServer).Readiness(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: ServerService_Readiness_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ServerServiceServer).Readiness(ctx, req.(*ReadinessRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ServerService_LeaderHealthCheck_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(LeaderHealthCheckRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ServerServiceServer).LeaderHealthCheck(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: ServerService_LeaderHealthCheck_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ServerServiceServer).LeaderHealthCheck(ctx, req.(*LeaderHealthCheckRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ServerService_CheckUpdates_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CheckUpdatesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ServerServiceServer).CheckUpdates(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: ServerService_CheckUpdates_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ServerServiceServer).CheckUpdates(ctx, req.(*CheckUpdatesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ServerService_ListChangeLogs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListChangeLogsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ServerServiceServer).ListChangeLogs(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: ServerService_ListChangeLogs_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ServerServiceServer).ListChangeLogs(ctx, req.(*ListChangeLogsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ServerService_StartUpdate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(StartUpdateRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ServerServiceServer).StartUpdate(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: ServerService_StartUpdate_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ServerServiceServer).StartUpdate(ctx, req.(*StartUpdateRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ServerService_UpdateStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdateStatusRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ServerServiceServer).UpdateStatus(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: ServerService_UpdateStatus_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ServerServiceServer).UpdateStatus(ctx, req.(*UpdateStatusRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ServerService_GetSettings_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetSettingsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ServerServiceServer).GetSettings(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: ServerService_GetSettings_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ServerServiceServer).GetSettings(ctx, req.(*GetSettingsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ServerService_GetReadOnlySettings_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetReadOnlySettingsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ServerServiceServer).GetReadOnlySettings(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: ServerService_GetReadOnlySettings_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ServerServiceServer).GetReadOnlySettings(ctx, req.(*GetReadOnlySettingsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ServerService_ChangeSettings_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ChangeSettingsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ServerServiceServer).ChangeSettings(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: ServerService_ChangeSettings_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ServerServiceServer).ChangeSettings(ctx, req.(*ChangeSettingsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// ServerService_ServiceDesc is the grpc.ServiceDesc for ServerService service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var ServerService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "server.v1.ServerService", - HandlerType: (*ServerServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Version", - Handler: _ServerService_Version_Handler, - }, - { - MethodName: "Readiness", - Handler: _ServerService_Readiness_Handler, - }, - { - MethodName: "LeaderHealthCheck", - Handler: _ServerService_LeaderHealthCheck_Handler, - }, - { - MethodName: "CheckUpdates", - Handler: _ServerService_CheckUpdates_Handler, - }, - { - MethodName: "ListChangeLogs", - Handler: _ServerService_ListChangeLogs_Handler, - }, - { - MethodName: "StartUpdate", - Handler: _ServerService_StartUpdate_Handler, - }, - { - MethodName: "UpdateStatus", - Handler: _ServerService_UpdateStatus_Handler, - }, - { - MethodName: "GetSettings", - Handler: _ServerService_GetSettings_Handler, - }, - { - MethodName: "GetReadOnlySettings", - Handler: _ServerService_GetReadOnlySettings_Handler, - }, - { - MethodName: "ChangeSettings", - Handler: _ServerService_ChangeSettings_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "server/v1/server.proto", -} diff --git a/api/swagger/swagger-dev.json b/api/swagger/swagger-dev.json deleted file mode 100644 index b841eec2030..00000000000 --- a/api/swagger/swagger-dev.json +++ /dev/null @@ -1,31067 +0,0 @@ -{ - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "schemes": [ - "https", - "http" - ], - "swagger": "2.0", - "info": { - "description": "This API is for development and testing purposes.", - "title": "PMM API", - "version": "develop" - }, - "paths": { - "/v1/accesscontrol/roles": { - "get": { - "description": "Lists all roles.", - "tags": [ - "AccessControlService" - ], - "summary": "List Roles", - "operationId": "ListRoles", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "roles": { - "type": "array", - "items": { - "type": "object", - "properties": { - "role_id": { - "type": "integer", - "format": "int64", - "x-order": 0 - }, - "title": { - "type": "string", - "x-order": 1 - }, - "filter": { - "type": "string", - "x-order": 2 - }, - "description": { - "type": "string", - "x-order": 3 - } - } - }, - "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 - } - } - } - } - } - }, - "post": { - "description": "Creates a new role.", - "tags": [ - "AccessControlService" - ], - "summary": "Create a Role", - "operationId": "CreateRole", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "title": { - "type": "string", - "x-order": 0 - }, - "filter": { - "type": "string", - "x-order": 1 - }, - "description": { - "type": "string", - "x-order": 2 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "role_id": { - "type": "integer", - "format": "int64", - "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/accesscontrol/roles/{role_id}": { - "get": { - "description": "Retrieves a role by ID.", - "tags": [ - "AccessControlService" - ], - "summary": "Get a Role", - "operationId": "GetRole", - "parameters": [ - { - "type": "integer", - "format": "int64", - "name": "role_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "role_id": { - "type": "integer", - "format": "int64", - "x-order": 0 - }, - "title": { - "type": "string", - "x-order": 1 - }, - "filter": { - "type": "string", - "x-order": 2 - }, - "description": { - "type": "string", - "x-order": 3 - } - } - } - }, - "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 - } - } - } - } - } - }, - "put": { - "description": "Updates an existing role.", - "tags": [ - "AccessControlService" - ], - "summary": "Update a Role", - "operationId": "UpdateRole", - "parameters": [ - { - "type": "integer", - "format": "int64", - "name": "role_id", - "in": "path", - "required": true - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "title": { - "type": "string", - "x-nullable": true, - "x-order": 0 - }, - "filter": { - "type": "string", - "x-nullable": true, - "x-order": 1 - }, - "description": { - "type": "string", - "x-nullable": true, - "x-order": 2 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - }, - "delete": { - "description": "Deletes a role.", - "tags": [ - "AccessControlService" - ], - "summary": "Delete a Role", - "operationId": "DeleteRole", - "parameters": [ - { - "type": "integer", - "format": "int64", - "name": "role_id", - "in": "path", - "required": true - }, - { - "type": "integer", - "format": "int64", - "description": "Role ID to be used as a replacement for the role. Additional logic applies.", - "name": "replacement_role_id", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/accesscontrol/roles:assign": { - "post": { - "description": "Replaces all existing roles for a user.", - "tags": [ - "AccessControlService" - ], - "summary": "Assign Roles to a User", - "operationId": "AssignRoles", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "role_ids": { - "type": "array", - "items": { - "type": "integer", - "format": "int64" - }, - "x-order": 0 - }, - "user_id": { - "type": "integer", - "format": "int64", - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/accesscontrol/roles:setDefault": { - "post": { - "description": "Configures a default role assigned to users.", - "tags": [ - "AccessControlService" - ], - "summary": "Set a Default Role", - "operationId": "SetDefaultRole", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "role_id": { - "type": "integer", - "format": "int64", - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/actions/{action_id}": { - "get": { - "description": "Gets the result of a given Action.", - "tags": [ - "ActionsService" - ], - "summary": "Get Action", - "operationId": "GetAction", - "parameters": [ - { - "type": "string", - "description": "Unique Action ID.", - "name": "action_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "action_id": { - "description": "Unique Action ID.", - "type": "string", - "x-order": 0 - }, - "pmm_agent_id": { - "description": "pmm-agent ID where this Action is running / was run.", - "type": "string", - "x-order": 1 - }, - "output": { - "description": "Current Action output; may be partial if Action is still running.", - "type": "string", - "x-order": 2 - }, - "done": { - "description": "True if Action is finished.", - "type": "boolean", - "x-order": 3 - }, - "error": { - "description": "Error message if Action failed.", - "type": "string", - "x-order": 4 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/actions:cancelAction": { - "post": { - "description": "Stops an Action.", - "tags": [ - "ActionsService" - ], - "summary": "Cancel an Action", - "operationId": "CancelAction", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "action_id": { - "description": "Unique Action ID. Required.", - "type": "string", - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/actions:startNodeAction": { - "post": { - "description": "Starts 'Percona Toolkit Summary' Action.", - "tags": [ - "ActionsService" - ], - "summary": "Start 'PT Summary' Action", - "operationId": "StartPTSummaryAction", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "pmm_agent_id": { - "description": "pmm-agent ID where to run this Action.", - "type": "string", - "x-order": 0 - }, - "node_id": { - "description": "Node ID for this Action.", - "type": "string", - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "action_id": { - "description": "Unique Action ID.", - "type": "string", - "x-order": 0 - }, - "pmm_agent_id": { - "description": "pmm-agent ID where to this Action was started.", - "type": "string", - "x-order": 1 - } - } - } - }, - "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/actions:startServiceAction": { - "post": { - "description": "Starts a Service Action.", - "tags": [ - "ActionsService" - ], - "summary": "Start a Service Action", - "operationId": "StartServiceAction", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "mysql_explain": { - "type": "object", - "properties": { - "pmm_agent_id": { - "description": "pmm-agent ID where to run this Action.", - "type": "string", - "x-order": 0 - }, - "service_id": { - "description": "Service ID for this Action. Required.", - "type": "string", - "x-order": 1 - }, - "query_id": { - "description": "Query ID of query.", - "type": "string", - "x-order": 2 - }, - "placeholders": { - "type": "array", - "title": "Array of placeholder values", - "items": { - "type": "string" - }, - "x-order": 3 - }, - "database": { - "description": "Database name. Required if it can't be deduced from the query ID.", - "type": "string", - "x-order": 4 - } - }, - "x-order": 0 - }, - "mysql_explain_json": { - "type": "object", - "properties": { - "pmm_agent_id": { - "description": "pmm-agent ID where to run this Action.", - "type": "string", - "x-order": 0 - }, - "service_id": { - "description": "Service ID for this Action. Required.", - "type": "string", - "x-order": 1 - }, - "query_id": { - "description": "Query ID of query.", - "type": "string", - "x-order": 2 - }, - "placeholders": { - "type": "array", - "title": "Array of placeholder values", - "items": { - "type": "string" - }, - "x-order": 3 - }, - "database": { - "description": "Database name. Required if it can't be deduced from the query ID.", - "type": "string", - "x-order": 4 - } - }, - "x-order": 1 - }, - "mysql_explain_traditional_json": { - "type": "object", - "properties": { - "pmm_agent_id": { - "description": "pmm-agent ID where to run this Action.", - "type": "string", - "x-order": 0 - }, - "service_id": { - "description": "Service ID for this Action. Required.", - "type": "string", - "x-order": 1 - }, - "query_id": { - "description": "Query ID of query.", - "type": "string", - "x-order": 2 - }, - "placeholders": { - "type": "array", - "title": "Array of placeholder values", - "items": { - "type": "string" - }, - "x-order": 3 - }, - "database": { - "description": "Database name. Required if it can't be deduced from the query ID.", - "type": "string", - "x-order": 4 - } - }, - "x-order": 2 - }, - "mysql_show_index": { - "type": "object", - "properties": { - "pmm_agent_id": { - "description": "pmm-agent ID where to run this Action.", - "type": "string", - "x-order": 0 - }, - "service_id": { - "description": "Service ID for this Action. Required.", - "type": "string", - "x-order": 1 - }, - "table_name": { - "description": "Table name. Required. May additionally contain a database name.", - "type": "string", - "x-order": 2 - }, - "database": { - "description": "Database name. Required if not given in the table_name field.", - "type": "string", - "x-order": 3 - } - }, - "x-order": 3 - }, - "mysql_show_create_table": { - "type": "object", - "properties": { - "pmm_agent_id": { - "description": "pmm-agent ID where to run this Action.", - "type": "string", - "x-order": 0 - }, - "service_id": { - "description": "Service ID for this Action. Required.", - "type": "string", - "x-order": 1 - }, - "table_name": { - "description": "Table name. Required. May additionally contain a database name.", - "type": "string", - "x-order": 2 - }, - "database": { - "description": "Database name. Required if not given in the table_name field.", - "type": "string", - "x-order": 3 - } - }, - "x-order": 4 - }, - "mysql_show_table_status": { - "type": "object", - "properties": { - "pmm_agent_id": { - "description": "pmm-agent ID where to run this Action.", - "type": "string", - "x-order": 0 - }, - "service_id": { - "description": "Service ID for this Action. Required.", - "type": "string", - "x-order": 1 - }, - "table_name": { - "description": "Table name. Required. May additionally contain a database name.", - "type": "string", - "x-order": 2 - }, - "database": { - "description": "Database name. Required if not given in the table_name field.", - "type": "string", - "x-order": 3 - } - }, - "x-order": 5 - }, - "postgres_show_create_table": { - "type": "object", - "properties": { - "pmm_agent_id": { - "description": "pmm-agent ID where to run this Action.", - "type": "string", - "x-order": 0 - }, - "service_id": { - "description": "Service ID for this Action. Required.", - "type": "string", - "x-order": 1 - }, - "table_name": { - "description": "Table name. Required. May additionally contain a database name.", - "type": "string", - "x-order": 2 - }, - "database": { - "description": "Database name. Required if not given in the table_name field.", - "type": "string", - "x-order": 3 - } - }, - "x-order": 6 - }, - "postgres_show_index": { - "type": "object", - "properties": { - "pmm_agent_id": { - "description": "pmm-agent ID where to run this Action.", - "type": "string", - "x-order": 0 - }, - "service_id": { - "description": "Service ID for this Action. Required.", - "type": "string", - "x-order": 1 - }, - "table_name": { - "description": "Table name. Required. May additionally contain a database name.", - "type": "string", - "x-order": 2 - }, - "database": { - "description": "Database name. Required if not given in the table_name field.", - "type": "string", - "x-order": 3 - } - }, - "x-order": 7 - }, - "mongodb_explain": { - "type": "object", - "properties": { - "pmm_agent_id": { - "description": "pmm-agent ID where to run this Action.", - "type": "string", - "x-order": 0 - }, - "service_id": { - "description": "Service ID for this Action. Required.", - "type": "string", - "x-order": 1 - }, - "query": { - "description": "Query. Required.", - "type": "string", - "x-order": 2 - } - }, - "x-order": 8 - }, - "pt_mongodb_summary": { - "type": "object", - "title": "Message to prepare pt-mongodb-summary data", - "properties": { - "pmm_agent_id": { - "description": "pmm-agent ID where to run this Action.", - "type": "string", - "x-order": 0 - }, - "service_id": { - "description": "Service ID for this Action.", - "type": "string", - "x-order": 1 - } - }, - "x-order": 9 - }, - "pt_mysql_summary": { - "type": "object", - "title": "Message to prepare pt-mysql-summary data", - "properties": { - "pmm_agent_id": { - "description": "pmm-agent ID where to run this Action.", - "type": "string", - "x-order": 0 - }, - "service_id": { - "description": "Service ID for this Action.", - "type": "string", - "x-order": 1 - } - }, - "x-order": 10 - }, - "pt_postgres_summary": { - "type": "object", - "title": "Message to prepare pt-pg-summary data", - "properties": { - "pmm_agent_id": { - "description": "pmm-agent ID where to run this Action.", - "type": "string", - "x-order": 0 - }, - "service_id": { - "description": "Service ID for this Action.", - "type": "string", - "x-order": 1 - } - }, - "x-order": 11 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "mysql_explain": { - "type": "object", - "properties": { - "action_id": { - "description": "Unique Action ID.", - "type": "string", - "x-order": 0 - }, - "pmm_agent_id": { - "description": "pmm-agent ID where to this Action was started.", - "type": "string", - "x-order": 1 - } - }, - "x-order": 0 - }, - "mysql_explain_json": { - "type": "object", - "properties": { - "action_id": { - "description": "Unique Action ID.", - "type": "string", - "x-order": 0 - }, - "pmm_agent_id": { - "description": "pmm-agent ID where to this Action was started.", - "type": "string", - "x-order": 1 - } - }, - "x-order": 1 - }, - "mysql_explain_traditional_json": { - "type": "object", - "properties": { - "action_id": { - "description": "Unique Action ID.", - "type": "string", - "x-order": 0 - }, - "pmm_agent_id": { - "description": "pmm-agent ID where to this Action was started.", - "type": "string", - "x-order": 1 - } - }, - "x-order": 2 - }, - "mysql_show_index": { - "type": "object", - "properties": { - "action_id": { - "description": "Unique Action ID.", - "type": "string", - "x-order": 0 - }, - "pmm_agent_id": { - "description": "pmm-agent ID where to this Action was started.", - "type": "string", - "x-order": 1 - } - }, - "x-order": 3 - }, - "mysql_show_create_table": { - "type": "object", - "properties": { - "action_id": { - "description": "Unique Action ID.", - "type": "string", - "x-order": 0 - }, - "pmm_agent_id": { - "description": "pmm-agent ID where to this Action was started.", - "type": "string", - "x-order": 1 - } - }, - "x-order": 4 - }, - "mysql_show_table_status": { - "type": "object", - "properties": { - "action_id": { - "description": "Unique Action ID.", - "type": "string", - "x-order": 0 - }, - "pmm_agent_id": { - "description": "pmm-agent ID where to this Action was started.", - "type": "string", - "x-order": 1 - } - }, - "x-order": 5 - }, - "postgresql_show_create_table": { - "type": "object", - "properties": { - "action_id": { - "description": "Unique Action ID.", - "type": "string", - "x-order": 0 - }, - "pmm_agent_id": { - "description": "pmm-agent ID where to this Action was started.", - "type": "string", - "x-order": 1 - } - }, - "x-order": 6 - }, - "postgresql_show_index": { - "type": "object", - "properties": { - "action_id": { - "description": "Unique Action ID.", - "type": "string", - "x-order": 0 - }, - "pmm_agent_id": { - "description": "pmm-agent ID where to this Action was started.", - "type": "string", - "x-order": 1 - } - }, - "x-order": 7 - }, - "mongodb_explain": { - "type": "object", - "properties": { - "action_id": { - "description": "Unique Action ID.", - "type": "string", - "x-order": 0 - }, - "pmm_agent_id": { - "description": "pmm-agent ID where to this Action was started.", - "type": "string", - "x-order": 1 - } - }, - "x-order": 8 - }, - "pt_mongodb_summary": { - "type": "object", - "title": "Message to retrieve the prepared pt-mongodb-summary data", - "properties": { - "action_id": { - "description": "Unique Action ID.", - "type": "string", - "x-order": 0 - }, - "pmm_agent_id": { - "description": "pmm-agent ID where to this Action was started.", - "type": "string", - "x-order": 1 - } - }, - "x-order": 9 - }, - "pt_mysql_summary": { - "type": "object", - "title": "Message to retrieve the prepared pt-mysql-summary data", - "properties": { - "action_id": { - "description": "Unique Action ID.", - "type": "string", - "x-order": 0 - }, - "pmm_agent_id": { - "description": "pmm-agent ID where to this Action was started.", - "type": "string", - "x-order": 1 - } - }, - "x-order": 10 - }, - "pt_postgres_summary": { - "type": "object", - "title": "Message to retrieve the prepared pt-pg-summary data", - "properties": { - "action_id": { - "description": "Unique Action ID.", - "type": "string", - "x-order": 0 - }, - "pmm_agent_id": { - "description": "pmm-agent ID where to this Action was started.", - "type": "string", - "x-order": 1 - } - }, - "x-order": 11 - } - } - } - }, - "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/advisors": { - "get": { - "description": "List advisors available to the user.", - "tags": [ - "AdvisorService" - ], - "summary": "List Advisors", - "operationId": "ListAdvisors", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "advisors": { - "type": "array", - "items": { - "type": "object", - "properties": { - "name": { - "description": "Machine-readable name (ID) that is used in expression.", - "type": "string", - "x-order": 0 - }, - "description": { - "description": "Long human-readable description.", - "type": "string", - "x-order": 1 - }, - "summary": { - "description": "Short human-readable summary.", - "type": "string", - "x-order": 2 - }, - "comment": { - "description": "Comment.", - "type": "string", - "x-order": 3 - }, - "category": { - "description": "Category.", - "type": "string", - "x-order": 4 - }, - "checks": { - "description": "Advisor checks.", - "type": "array", - "items": { - "description": "AdvisorCheck contains check name and status.", - "type": "object", - "properties": { - "name": { - "description": "Machine-readable name (ID) that is used in expression.", - "type": "string", - "x-order": 0 - }, - "enabled": { - "description": "True if that check is enabled.", - "type": "boolean", - "x-order": 1 - }, - "description": { - "description": "Long human-readable description.", - "type": "string", - "x-order": 2 - }, - "summary": { - "description": "Short human-readable summary.", - "type": "string", - "x-order": 3 - }, - "interval": { - "description": "AdvisorCheckInterval represents possible execution interval values for checks.", - "type": "string", - "default": "ADVISOR_CHECK_INTERVAL_UNSPECIFIED", - "enum": [ - "ADVISOR_CHECK_INTERVAL_UNSPECIFIED", - "ADVISOR_CHECK_INTERVAL_STANDARD", - "ADVISOR_CHECK_INTERVAL_FREQUENT", - "ADVISOR_CHECK_INTERVAL_RARE" - ], - "x-order": 4 - }, - "family": { - "type": "string", - "default": "ADVISOR_CHECK_FAMILY_UNSPECIFIED", - "enum": [ - "ADVISOR_CHECK_FAMILY_UNSPECIFIED", - "ADVISOR_CHECK_FAMILY_MYSQL", - "ADVISOR_CHECK_FAMILY_POSTGRESQL", - "ADVISOR_CHECK_FAMILY_MONGODB" - ], - "x-order": 5 - } - } - }, - "x-order": 5 - } - } - }, - "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/advisors/checks": { - "get": { - "description": "List advisor checks available to the user.", - "tags": [ - "AdvisorService" - ], - "summary": "List Advisor Checks", - "operationId": "ListAdvisorChecks", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "checks": { - "type": "array", - "items": { - "description": "AdvisorCheck contains check name and status.", - "type": "object", - "properties": { - "name": { - "description": "Machine-readable name (ID) that is used in expression.", - "type": "string", - "x-order": 0 - }, - "enabled": { - "description": "True if that check is enabled.", - "type": "boolean", - "x-order": 1 - }, - "description": { - "description": "Long human-readable description.", - "type": "string", - "x-order": 2 - }, - "summary": { - "description": "Short human-readable summary.", - "type": "string", - "x-order": 3 - }, - "interval": { - "description": "AdvisorCheckInterval represents possible execution interval values for checks.", - "type": "string", - "default": "ADVISOR_CHECK_INTERVAL_UNSPECIFIED", - "enum": [ - "ADVISOR_CHECK_INTERVAL_UNSPECIFIED", - "ADVISOR_CHECK_INTERVAL_STANDARD", - "ADVISOR_CHECK_INTERVAL_FREQUENT", - "ADVISOR_CHECK_INTERVAL_RARE" - ], - "x-order": 4 - }, - "family": { - "type": "string", - "default": "ADVISOR_CHECK_FAMILY_UNSPECIFIED", - "enum": [ - "ADVISOR_CHECK_FAMILY_UNSPECIFIED", - "ADVISOR_CHECK_FAMILY_MYSQL", - "ADVISOR_CHECK_FAMILY_POSTGRESQL", - "ADVISOR_CHECK_FAMILY_MONGODB" - ], - "x-order": 5 - } - } - }, - "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/advisors/checks/failed": { - "get": { - "description": "Returns the latest check results for a given service.", - "tags": [ - "AdvisorService" - ], - "summary": "Get Failed Advisor Checks", - "operationId": "GetFailedChecks", - "parameters": [ - { - "type": "integer", - "format": "int32", - "description": "Maximum number of results per page.", - "name": "page_size", - "in": "query" - }, - { - "type": "integer", - "format": "int32", - "description": "Index of the requested page, starts from 0.", - "name": "page_index", - "in": "query" - }, - { - "type": "string", - "description": "Service ID.", - "name": "service_id", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "total_items": { - "description": "Total number of results.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "total_pages": { - "description": "Total number of pages.", - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "results": { - "type": "array", - "title": "Check results", - "items": { - "description": "CheckResult represents the check results for a given service.", - "type": "object", - "properties": { - "summary": { - "type": "string", - "x-order": 0 - }, - "description": { - "type": "string", - "x-order": 1 - }, - "severity": { - "description": "Severity represents severity level of the check result or alert.", - "type": "string", - "default": "SEVERITY_UNSPECIFIED", - "enum": [ - "SEVERITY_UNSPECIFIED", - "SEVERITY_EMERGENCY", - "SEVERITY_ALERT", - "SEVERITY_CRITICAL", - "SEVERITY_ERROR", - "SEVERITY_WARNING", - "SEVERITY_NOTICE", - "SEVERITY_INFO", - "SEVERITY_DEBUG" - ], - "x-order": 2 - }, - "labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 3 - }, - "read_more_url": { - "description": "URL containing information on how to resolve an issue detected by an Advisor check.", - "type": "string", - "x-order": 4 - }, - "service_name": { - "description": "Name of the monitored service on which the check ran.", - "type": "string", - "x-order": 5 - }, - "service_id": { - "description": "ID of the monitored service on which the check ran.", - "type": "string", - "x-order": 6 - }, - "check_name": { - "type": "string", - "title": "Name of the check that failed", - "x-order": 7 - }, - "silenced": { - "type": "boolean", - "title": "Silence status of the check result", - "x-order": 8 - } - } - }, - "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/advisors/checks:batchChange": { - "post": { - "description": "Enables/disables advisor checks or changes their exec interval.", - "tags": [ - "AdvisorService" - ], - "summary": "Change Advisor Checks", - "operationId": "ChangeAdvisorChecks", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "params": { - "type": "array", - "items": { - "description": "ChangeAdvisorCheckParams specifies a single check parameters.", - "type": "object", - "properties": { - "name": { - "description": "The name of the check to change.", - "type": "string", - "x-order": 0 - }, - "enable": { - "type": "boolean", - "x-nullable": true, - "x-order": 1 - }, - "interval": { - "description": "AdvisorCheckInterval represents possible execution interval values for checks.", - "type": "string", - "default": "ADVISOR_CHECK_INTERVAL_UNSPECIFIED", - "enum": [ - "ADVISOR_CHECK_INTERVAL_UNSPECIFIED", - "ADVISOR_CHECK_INTERVAL_STANDARD", - "ADVISOR_CHECK_INTERVAL_FREQUENT", - "ADVISOR_CHECK_INTERVAL_RARE" - ], - "x-order": 2 - } - } - }, - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/advisors/checks:start": { - "post": { - "description": "Executes Advisor checks and returns when all checks are executed. All available checks will be started if check names aren't specified.", - "tags": [ - "AdvisorService" - ], - "summary": "Start Advisor Checks", - "operationId": "StartAdvisorChecks", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "names": { - "description": "Names of the checks that should be started.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/advisors/failedServices": { - "get": { - "description": "Returns a list of services with failed checks and a summary of check results.", - "tags": [ - "AdvisorService" - ], - "summary": "List Failed Services", - "operationId": "ListFailedServices", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "result": { - "type": "array", - "items": { - "description": "CheckResultSummary is a summary of check results.", - "type": "object", - "properties": { - "service_name": { - "type": "string", - "x-order": 0 - }, - "service_id": { - "type": "string", - "x-order": 1 - }, - "emergency_count": { - "description": "Number of failed checks for this service with severity level \"EMERGENCY\".", - "type": "integer", - "format": "int64", - "x-order": 2 - }, - "alert_count": { - "description": "Number of failed checks for this service with severity level \"ALERT\".", - "type": "integer", - "format": "int64", - "x-order": 3 - }, - "critical_count": { - "description": "Number of failed checks for this service with severity level \"CRITICAL\".", - "type": "integer", - "format": "int64", - "x-order": 4 - }, - "error_count": { - "description": "Number of failed checks for this service with severity level \"ERROR\".", - "type": "integer", - "format": "int64", - "x-order": 5 - }, - "warning_count": { - "description": "Number of failed checks for this service with severity level \"WARNING\".", - "type": "integer", - "format": "int64", - "x-order": 6 - }, - "notice_count": { - "description": "Number of failed checks for this service with severity level \"NOTICE\".", - "type": "integer", - "format": "int64", - "x-order": 7 - }, - "info_count": { - "description": "Number of failed checks for this service with severity level \"INFO\".", - "type": "integer", - "format": "int64", - "x-order": 8 - }, - "debug_count": { - "description": "Number of failed checks for this service with severity level \"DEBUG\".", - "type": "integer", - "format": "int64", - "x-order": 9 - } - } - }, - "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/alerting/rules": { - "post": { - "tags": [ - "AlertingService" - ], - "summary": "CreateRule creates alerting rule from the given template.", - "operationId": "CreateRule", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "template_name": { - "description": "Template name.", - "type": "string", - "x-order": 0 - }, - "name": { - "description": "Rule name.", - "type": "string", - "x-order": 1 - }, - "group": { - "description": "Rule group name.", - "type": "string", - "x-order": 2 - }, - "folder_uid": { - "description": "Folder UID.", - "type": "string", - "x-order": 3 - }, - "params": { - "description": "Rule parameters. All template parameters should be set.", - "type": "array", - "items": { - "description": "ParamValue represents a single rule parameter value.", - "type": "object", - "properties": { - "name": { - "description": "Machine-readable name (ID) that is used in expression.", - "type": "string", - "x-order": 0 - }, - "type": { - "description": "ParamType represents template parameter type.", - "type": "string", - "default": "PARAM_TYPE_UNSPECIFIED", - "enum": [ - "PARAM_TYPE_UNSPECIFIED", - "PARAM_TYPE_BOOL", - "PARAM_TYPE_FLOAT", - "PARAM_TYPE_STRING" - ], - "x-order": 1 - }, - "bool": { - "description": "Bool value.", - "type": "boolean", - "x-order": 2 - }, - "float": { - "description": "Float value.", - "type": "number", - "format": "double", - "x-order": 3 - }, - "string": { - "description": "String value.", - "type": "string", - "x-order": 4 - } - } - }, - "x-order": 4 - }, - "for": { - "description": "Rule duration. Should be set.", - "type": "string", - "x-order": 5 - }, - "severity": { - "description": "Severity represents severity level of the check result or alert.", - "type": "string", - "default": "SEVERITY_UNSPECIFIED", - "enum": [ - "SEVERITY_UNSPECIFIED", - "SEVERITY_EMERGENCY", - "SEVERITY_ALERT", - "SEVERITY_CRITICAL", - "SEVERITY_ERROR", - "SEVERITY_WARNING", - "SEVERITY_NOTICE", - "SEVERITY_INFO", - "SEVERITY_DEBUG" - ], - "x-order": 6 - }, - "custom_labels": { - "description": "All custom labels to add or remove (with empty values) to default labels from template.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 7 - }, - "filters": { - "description": "Filters.", - "type": "array", - "items": { - "description": "Filter represents a single filter condition.", - "type": "object", - "properties": { - "type": { - "description": "FilterType represents filter matching type.", - "type": "string", - "default": "FILTER_TYPE_UNSPECIFIED", - "enum": [ - "FILTER_TYPE_UNSPECIFIED", - "FILTER_TYPE_MATCH", - "FILTER_TYPE_MISMATCH" - ], - "x-order": 0 - }, - "label": { - "type": "string", - "x-order": 1 - }, - "regexp": { - "type": "string", - "x-order": 2 - } - } - }, - "x-order": 8 - }, - "interval": { - "type": "string", - "title": "Evaluation Interval", - "x-order": 9 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/alerting/templates": { - "get": { - "tags": [ - "AlertingService" - ], - "summary": "ListTemplates returns a list of all collected alert rule templates.", - "operationId": "ListTemplates", - "parameters": [ - { - "type": "integer", - "format": "int32", - "description": "Maximum number of results per page.", - "name": "page_size", - "in": "query" - }, - { - "type": "integer", - "format": "int32", - "description": "Index of the requested page, starts from 0.", - "name": "page_index", - "in": "query" - }, - { - "type": "boolean", - "description": "If true, template files will be re-read from disk.", - "name": "reload", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "total_items": { - "description": "Total number of results.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "total_pages": { - "description": "Total number of pages.", - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "templates": { - "description": "Alerting templates.", - "type": "array", - "items": { - "description": "Template represents Alert Template that is used to create Alert Rule.", - "type": "object", - "properties": { - "name": { - "description": "Machine-readable name (ID).", - "type": "string", - "x-order": 0 - }, - "summary": { - "description": "Short human-readable summary.", - "type": "string", - "x-order": 1 - }, - "expr": { - "description": "PromQL query expression with templating parameters.", - "type": "string", - "x-order": 2 - }, - "params": { - "description": "Query parameters definitions.", - "type": "array", - "items": { - "description": "ParamDefinition represents a single query parameter.", - "type": "object", - "properties": { - "name": { - "description": "Machine-readable name (ID) that is used in expression.", - "type": "string", - "x-order": 0 - }, - "summary": { - "description": "Short human-readable parameter summary.", - "type": "string", - "x-order": 1 - }, - "unit": { - "description": "ParamUnit represents template parameter unit.\n\n - PARAM_UNIT_UNSPECIFIED: Invalid, unknown or absent.\n - PARAM_UNIT_PERCENTAGE: %\n - PARAM_UNIT_SECONDS: s", - "type": "string", - "default": "PARAM_UNIT_UNSPECIFIED", - "enum": [ - "PARAM_UNIT_UNSPECIFIED", - "PARAM_UNIT_PERCENTAGE", - "PARAM_UNIT_SECONDS" - ], - "x-order": 2 - }, - "type": { - "description": "ParamType represents template parameter type.", - "type": "string", - "default": "PARAM_TYPE_UNSPECIFIED", - "enum": [ - "PARAM_TYPE_UNSPECIFIED", - "PARAM_TYPE_BOOL", - "PARAM_TYPE_FLOAT", - "PARAM_TYPE_STRING" - ], - "x-order": 3 - }, - "bool": { - "description": "BoolParamDefinition represents boolean parameter's default value.", - "type": "object", - "properties": { - "default": { - "type": "boolean", - "x-nullable": true, - "x-order": 0 - } - }, - "x-order": 4 - }, - "float": { - "description": "FloatParamDefinition represents float parameter's default value and valid range.", - "type": "object", - "properties": { - "default": { - "description": "Default value.", - "type": "number", - "format": "double", - "x-nullable": true, - "x-order": 0 - }, - "min": { - "description": "Minimum valid value (inclusive).", - "type": "number", - "format": "double", - "x-nullable": true, - "x-order": 1 - }, - "max": { - "description": "Maximum valid value (inclusive).", - "type": "number", - "format": "double", - "x-nullable": true, - "x-order": 2 - } - }, - "x-order": 5 - }, - "string": { - "description": "StringParamDefinition represents string parameter's default value.", - "type": "object", - "properties": { - "default": { - "description": "Default value.", - "type": "string", - "x-nullable": true, - "x-order": 0 - } - }, - "x-order": 6 - } - } - }, - "x-order": 3 - }, - "for": { - "description": "Default duration value.", - "type": "string", - "x-order": 4 - }, - "severity": { - "description": "Severity represents severity level of the check result or alert.", - "type": "string", - "default": "SEVERITY_UNSPECIFIED", - "enum": [ - "SEVERITY_UNSPECIFIED", - "SEVERITY_EMERGENCY", - "SEVERITY_ALERT", - "SEVERITY_CRITICAL", - "SEVERITY_ERROR", - "SEVERITY_WARNING", - "SEVERITY_NOTICE", - "SEVERITY_INFO", - "SEVERITY_DEBUG" - ], - "x-order": 5 - }, - "labels": { - "description": "Labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 6 - }, - "annotations": { - "description": "Annotations.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 7 - }, - "source": { - "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.", - "type": "string", - "default": "TEMPLATE_SOURCE_UNSPECIFIED", - "enum": [ - "TEMPLATE_SOURCE_UNSPECIFIED", - "TEMPLATE_SOURCE_BUILT_IN", - "TEMPLATE_SOURCE_SAAS", - "TEMPLATE_SOURCE_USER_FILE", - "TEMPLATE_SOURCE_USER_API" - ], - "x-order": 8 - }, - "created_at": { - "description": "Template creation time. Empty for built-in and SaaS templates.", - "type": "string", - "format": "date-time", - "x-order": 9 - }, - "yaml": { - "description": "YAML template file content. Empty for built-in and SaaS templates.", - "type": "string", - "x-order": 10 - } - } - }, - "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 - } - } - } - } - } - }, - "post": { - "tags": [ - "AlertingService" - ], - "summary": "CreateTemplate creates a new template.", - "operationId": "CreateTemplate", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "yaml": { - "description": "YAML template file content.", - "type": "string", - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/alerting/templates/{name}": { - "put": { - "tags": [ - "AlertingService" - ], - "summary": "UpdateTemplate updates existing template, previously created via API.", - "operationId": "UpdateTemplate", - "parameters": [ - { - "type": "string", - "description": "Machine-readable name (ID).", - "name": "name", - "in": "path", - "required": true - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "yaml": { - "description": "YAML template file content.", - "type": "string", - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - }, - "delete": { - "tags": [ - "AlertingService" - ], - "summary": "DeleteTemplate deletes existing, previously created via API.", - "operationId": "DeleteTemplate", - "parameters": [ - { - "type": "string", - "name": "name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/backups/artifacts": { - "get": { - "description": "Return a list of backup artifacts.", - "tags": [ - "BackupService" - ], - "summary": "List artifacts", - "operationId": "ListArtifacts", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "artifacts": { - "type": "array", - "items": { - "description": "Artifact represents single backup artifact.", - "type": "object", - "properties": { - "artifact_id": { - "description": "Machine-readable artifact ID.", - "type": "string", - "x-order": 0 - }, - "name": { - "type": "string", - "title": "Artifact name", - "x-order": 1 - }, - "vendor": { - "description": "Database vendor e.g. PostgreSQL, MongoDB, MySQL.", - "type": "string", - "x-order": 2 - }, - "location_id": { - "description": "Machine-readable location ID.", - "type": "string", - "x-order": 3 - }, - "location_name": { - "description": "Location name.", - "type": "string", - "x-order": 4 - }, - "service_id": { - "description": "Machine-readable service ID.", - "type": "string", - "x-order": 5 - }, - "service_name": { - "description": "Service name.", - "type": "string", - "x-order": 6 - }, - "data_model": { - "description": "DataModel is a model used for performing a backup.", - "type": "string", - "default": "DATA_MODEL_UNSPECIFIED", - "enum": [ - "DATA_MODEL_UNSPECIFIED", - "DATA_MODEL_PHYSICAL", - "DATA_MODEL_LOGICAL" - ], - "x-order": 7 - }, - "status": { - "description": "BackupStatus shows the current status of execution of backup.", - "type": "string", - "default": "BACKUP_STATUS_UNSPECIFIED", - "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" - ], - "x-order": 8 - }, - "created_at": { - "description": "Artifact creation time.", - "type": "string", - "format": "date-time", - "x-order": 9 - }, - "mode": { - "description": "BackupMode specifies backup mode.", - "type": "string", - "default": "BACKUP_MODE_UNSPECIFIED", - "enum": [ - "BACKUP_MODE_UNSPECIFIED", - "BACKUP_MODE_SNAPSHOT", - "BACKUP_MODE_INCREMENTAL", - "BACKUP_MODE_PITR" - ], - "x-order": 10 - }, - "is_sharded_cluster": { - "description": "Source database setup type.", - "type": "boolean", - "x-order": 11 - }, - "folder": { - "description": "Folder to store artifact on a storage.", - "type": "string", - "x-order": 12 - }, - "metadata_list": { - "description": "List of artifact metadata.", - "type": "array", - "items": { - "description": "Metadata contains extra artifact data like files it consists of, tool specific data, etc.", - "type": "object", - "properties": { - "file_list": { - "description": "List of files backup consists of.", - "type": "array", - "items": { - "description": "File represents file or folder on a storage.", - "type": "object", - "properties": { - "name": { - "type": "string", - "x-order": 0 - }, - "is_directory": { - "type": "boolean", - "x-order": 1 - } - } - }, - "x-order": 0 - }, - "restore_to": { - "description": "Exact time DB can be restored to.", - "type": "string", - "format": "date-time", - "x-order": 1 - }, - "pbm_metadata": { - "description": "PbmMetadata contains additional data for pbm cli tools.", - "type": "object", - "properties": { - "name": { - "description": "Name of backup in backup tool representation.", - "type": "string", - "x-order": 0 - } - }, - "x-order": 2 - } - } - }, - "x-order": 13 - } - } - }, - "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/backups/artifacts/{artifact_id}": { - "delete": { - "description": "Deletes an artifact.", - "tags": [ - "BackupService" - ], - "summary": "Delete Artifact", - "operationId": "DeleteArtifact", - "parameters": [ - { - "type": "string", - "description": "Machine-readable artifact ID.", - "name": "artifact_id", - "in": "path", - "required": true - }, - { - "type": "boolean", - "description": "Removes all the backup files associated with artifact if flag is set.", - "name": "remove_files", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/backups/artifacts/{artifact_id}/pitr-timeranges": { - "get": { - "description": "Return a list of available MongoDB point-in-time-recovery timeranges.", - "tags": [ - "BackupService" - ], - "summary": "List PITR Timeranges", - "operationId": "ListPitrTimeranges", - "parameters": [ - { - "type": "string", - "description": "Artifact ID represents artifact whose location has PITR timeranges to be retrieved.", - "name": "artifact_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "timeranges": { - "type": "array", - "items": { - "type": "object", - "properties": { - "start_timestamp": { - "description": "start_timestamp is the time of the first event in the PITR chunk.", - "type": "string", - "format": "date-time", - "x-order": 0 - }, - "end_timestamp": { - "description": "end_timestamp is the time of the last event in the PITR chunk.", - "type": "string", - "format": "date-time", - "x-order": 1 - } - } - }, - "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/backups/locations": { - "get": { - "description": "List backup locations.", - "tags": [ - "LocationsService" - ], - "summary": "List Backup Locations", - "operationId": "ListLocations", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "locations": { - "type": "array", - "items": { - "description": "Location represents single Backup Location.", - "type": "object", - "properties": { - "location_id": { - "description": "Machine-readable ID.", - "type": "string", - "x-order": 0 - }, - "name": { - "type": "string", - "title": "Location name", - "x-order": 1 - }, - "description": { - "type": "string", - "title": "Short description", - "x-order": 2 - }, - "filesystem_config": { - "description": "FilesystemLocationConfig represents file system location config.", - "type": "object", - "properties": { - "path": { - "type": "string", - "x-order": 0 - } - }, - "x-order": 3 - }, - "s3_config": { - "description": "S3LocationConfig represents S3 bucket configuration.", - "type": "object", - "properties": { - "endpoint": { - "type": "string", - "x-order": 0 - }, - "access_key": { - "type": "string", - "x-order": 1 - }, - "secret_key": { - "type": "string", - "x-order": 2 - }, - "bucket_name": { - "type": "string", - "x-order": 3 - } - }, - "x-order": 4 - } - } - }, - "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 - } - } - } - } - } - }, - "post": { - "description": "Add a backup location.", - "tags": [ - "LocationsService" - ], - "summary": "Add a Backup Location", - "operationId": "AddLocation", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "name": { - "type": "string", - "title": "Location name", - "x-order": 0 - }, - "description": { - "type": "string", - "x-order": 1 - }, - "filesystem_config": { - "description": "FilesystemLocationConfig represents file system location config.", - "type": "object", - "properties": { - "path": { - "type": "string", - "x-order": 0 - } - }, - "x-order": 2 - }, - "s3_config": { - "description": "S3LocationConfig represents S3 bucket configuration.", - "type": "object", - "properties": { - "endpoint": { - "type": "string", - "x-order": 0 - }, - "access_key": { - "type": "string", - "x-order": 1 - }, - "secret_key": { - "type": "string", - "x-order": 2 - }, - "bucket_name": { - "type": "string", - "x-order": 3 - } - }, - "x-order": 3 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "location_id": { - "description": "Machine-readable ID.", - "type": "string", - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/backups/locations/{location_id}": { - "put": { - "description": "Change a backup location.", - "tags": [ - "LocationsService" - ], - "summary": "Change a Backup Location", - "operationId": "ChangeLocation", - "parameters": [ - { - "type": "string", - "description": "Machine-readable ID.", - "name": "location_id", - "in": "path", - "required": true - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "name": { - "type": "string", - "title": "Location name", - "x-order": 0 - }, - "description": { - "type": "string", - "x-order": 1 - }, - "filesystem_config": { - "description": "FilesystemLocationConfig represents file system location config.", - "type": "object", - "properties": { - "path": { - "type": "string", - "x-order": 0 - } - }, - "x-order": 2 - }, - "s3_config": { - "description": "S3LocationConfig represents S3 bucket configuration.", - "type": "object", - "properties": { - "endpoint": { - "type": "string", - "x-order": 0 - }, - "access_key": { - "type": "string", - "x-order": 1 - }, - "secret_key": { - "type": "string", - "x-order": 2 - }, - "bucket_name": { - "type": "string", - "x-order": 3 - } - }, - "x-order": 3 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - }, - "delete": { - "description": "Remove a backup location.", - "tags": [ - "LocationsService" - ], - "summary": "Remove a Scheduled Backup", - "operationId": "RemoveLocation", - "parameters": [ - { - "type": "string", - "description": "Machine-readable ID.", - "name": "location_id", - "in": "path", - "required": true - }, - { - "type": "boolean", - "description": "Force mode", - "name": "force", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/backups/locations:testConfig": { - "post": { - "description": "Test a backup location and credentials.", - "tags": [ - "LocationsService" - ], - "summary": "Test a Backup Location and Credentials", - "operationId": "TestLocationConfig", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "filesystem_config": { - "description": "FilesystemLocationConfig represents file system location config.", - "type": "object", - "properties": { - "path": { - "type": "string", - "x-order": 0 - } - }, - "x-order": 0 - }, - "s3_config": { - "description": "S3LocationConfig represents S3 bucket configuration.", - "type": "object", - "properties": { - "endpoint": { - "type": "string", - "x-order": 0 - }, - "access_key": { - "type": "string", - "x-order": 1 - }, - "secret_key": { - "type": "string", - "x-order": 2 - }, - "bucket_name": { - "type": "string", - "x-order": 3 - } - }, - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/backups/restores": { - "get": { - "description": "List all backup restore history items", - "tags": [ - "RestoreService" - ], - "summary": "List Restore History", - "operationId": "ListRestores", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "items": { - "type": "array", - "items": { - "description": "RestoreHistoryItem represents single backup restore item.", - "type": "object", - "properties": { - "restore_id": { - "description": "Machine-readable restore id.", - "type": "string", - "x-order": 0 - }, - "artifact_id": { - "description": "ID of the artifact used for restore.", - "type": "string", - "x-order": 1 - }, - "name": { - "description": "Artifact name used for restore.", - "type": "string", - "x-order": 2 - }, - "vendor": { - "description": "Database vendor e.g. PostgreSQL, MongoDB, MySQL.", - "type": "string", - "x-order": 3 - }, - "location_id": { - "description": "Machine-readable location ID.", - "type": "string", - "x-order": 4 - }, - "location_name": { - "description": "Location name.", - "type": "string", - "x-order": 5 - }, - "service_id": { - "description": "Machine-readable service ID.", - "type": "string", - "x-order": 6 - }, - "service_name": { - "description": "Service name.", - "type": "string", - "x-order": 7 - }, - "data_model": { - "description": "DataModel is a model used for performing a backup.", - "type": "string", - "default": "DATA_MODEL_UNSPECIFIED", - "enum": [ - "DATA_MODEL_UNSPECIFIED", - "DATA_MODEL_PHYSICAL", - "DATA_MODEL_LOGICAL" - ], - "x-order": 8 - }, - "status": { - "description": "RestoreStatus shows the current status of execution of restore.", - "type": "string", - "default": "RESTORE_STATUS_UNSPECIFIED", - "enum": [ - "RESTORE_STATUS_UNSPECIFIED", - "RESTORE_STATUS_IN_PROGRESS", - "RESTORE_STATUS_SUCCESS", - "RESTORE_STATUS_ERROR" - ], - "x-order": 9 - }, - "started_at": { - "description": "Restore start time.", - "type": "string", - "format": "date-time", - "x-order": 10 - }, - "finished_at": { - "description": "Restore finish time.", - "type": "string", - "format": "date-time", - "x-order": 11 - }, - "pitr_timestamp": { - "description": "PITR timestamp is filled for PITR restores, empty otherwise.", - "type": "string", - "format": "date-time", - "x-order": 12 - } - } - }, - "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/backups/restores/{restore_id}/logs": { - "get": { - "description": "Get logs from the underlying tools for a restore job", - "tags": [ - "RestoreService" - ], - "summary": "Get Logs", - "operationId": "GetLogsMixin5", - "parameters": [ - { - "type": "string", - "name": "restore_id", - "in": "path", - "required": true - }, - { - "type": "integer", - "format": "int64", - "name": "offset", - "in": "query" - }, - { - "type": "integer", - "format": "int64", - "name": "limit", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "logs": { - "type": "array", - "items": { - "description": "LogChunk represent one chunk of logs.", - "type": "object", - "properties": { - "chunk_id": { - "type": "integer", - "format": "int64", - "x-order": 0 - }, - "data": { - "type": "string", - "x-order": 1 - } - } - }, - "x-order": 0 - }, - "end": { - "type": "boolean", - "x-order": 1 - } - } - } - }, - "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/backups/restores:start": { - "post": { - "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", - "tags": [ - "RestoreService" - ], - "summary": "Restore from a Backup", - "operationId": "RestoreBackup", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "service_id": { - "description": "Service identifier where backup should be restored.", - "type": "string", - "x-order": 0 - }, - "artifact_id": { - "description": "Artifact id to restore.", - "type": "string", - "x-order": 1 - }, - "pitr_timestamp": { - "type": "string", - "format": "date-time", - "title": "Timestamp of PITR to restore to", - "x-order": 2 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "restore_id": { - "description": "Unique restore identifier.", - "type": "string", - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/backups/scheduled": { - "get": { - "description": "List all scheduled backups.", - "tags": [ - "BackupService" - ], - "summary": "List Scheduled Backups", - "operationId": "ListScheduledBackups", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "scheduled_backups": { - "type": "array", - "items": { - "description": "ScheduledBackup represents scheduled task for backup.", - "type": "object", - "properties": { - "scheduled_backup_id": { - "description": "Machine-readable ID.", - "type": "string", - "x-order": 0 - }, - "service_id": { - "description": "Machine-readable service ID.", - "type": "string", - "x-order": 1 - }, - "service_name": { - "description": "Service name.", - "type": "string", - "x-order": 2 - }, - "location_id": { - "description": "Machine-readable location ID.", - "type": "string", - "x-order": 3 - }, - "location_name": { - "description": "Location name.", - "type": "string", - "x-order": 4 - }, - "folder": { - "description": "Folder on storage for artifact.", - "type": "string", - "x-order": 5 - }, - "cron_expression": { - "description": "How often backup will be run in cron format.", - "type": "string", - "x-order": 6 - }, - "start_time": { - "description": "First backup wouldn't happen before this time.", - "type": "string", - "format": "date-time", - "x-order": 7 - }, - "name": { - "description": "Artifact name.", - "type": "string", - "x-order": 8 - }, - "description": { - "description": "Description.", - "type": "string", - "x-order": 9 - }, - "enabled": { - "description": "If scheduling is enabled.", - "type": "boolean", - "x-order": 10 - }, - "retries": { - "description": "How many times to retry a failed backup before giving up.", - "type": "integer", - "format": "int64", - "x-order": 11 - }, - "retry_interval": { - "description": "Delay between each retry. Should have a suffix in JSON: 2s, 1m, 1h.", - "type": "string", - "x-order": 12 - }, - "data_model": { - "description": "DataModel is a model used for performing a backup.", - "type": "string", - "default": "DATA_MODEL_UNSPECIFIED", - "enum": [ - "DATA_MODEL_UNSPECIFIED", - "DATA_MODEL_PHYSICAL", - "DATA_MODEL_LOGICAL" - ], - "x-order": 13 - }, - "mode": { - "description": "BackupMode specifies backup mode.", - "type": "string", - "default": "BACKUP_MODE_UNSPECIFIED", - "enum": [ - "BACKUP_MODE_UNSPECIFIED", - "BACKUP_MODE_SNAPSHOT", - "BACKUP_MODE_INCREMENTAL", - "BACKUP_MODE_PITR" - ], - "x-order": 14 - }, - "vendor": { - "description": "Database vendor e.g. PostgreSQL, MongoDB, MySQL.", - "type": "string", - "x-order": 15 - }, - "last_run": { - "description": "Last run.", - "type": "string", - "format": "date-time", - "x-order": 16 - }, - "next_run": { - "description": "Next run.", - "type": "string", - "format": "date-time", - "x-order": 17 - }, - "retention": { - "description": "How many artifacts keep. 0 - unlimited.", - "type": "integer", - "format": "int64", - "x-order": 18 - } - } - }, - "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/backups/{artifact_id}/compatible-services": { - "get": { - "description": "List services that are compatible with the backup artifact.", - "tags": [ - "BackupService" - ], - "summary": "List Compatible Services", - "operationId": "ListArtifactCompatibleServices", - "parameters": [ - { - "type": "string", - "description": "Artifact id used to determine restore compatibility.", - "name": "artifact_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "mysql": { - "type": "array", - "items": { - "description": "MySQLService represents a generic MySQL 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": "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 - }, - "mongodb": { - "type": "array", - "items": { - "description": "MongoDBService represents a generic MongoDB 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": "MongoDB version.", - "type": "string", - "x-order": 10 - } - } - }, - "x-order": 1 - } - } - } - }, - "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/backups/{artifact_id}/logs": { - "get": { - "description": "Get logs from the underlying tools for a backup/restore job.", - "tags": [ - "BackupService" - ], - "summary": "Get Logs", - "operationId": "GetLogs", - "parameters": [ - { - "type": "string", - "name": "artifact_id", - "in": "path", - "required": true - }, - { - "type": "integer", - "format": "int64", - "name": "offset", - "in": "query" - }, - { - "type": "integer", - "format": "int64", - "name": "limit", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "logs": { - "type": "array", - "items": { - "description": "LogChunk represent one chunk of logs.", - "type": "object", - "properties": { - "chunk_id": { - "type": "integer", - "format": "int64", - "x-order": 0 - }, - "data": { - "type": "string", - "x-order": 1 - } - } - }, - "x-order": 0 - }, - "end": { - "type": "boolean", - "x-order": 1 - } - } - } - }, - "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/backups/{scheduled_backup_id}": { - "delete": { - "description": "Remove a scheduled backup.", - "tags": [ - "BackupService" - ], - "summary": "Remove a Scheduled Backup", - "operationId": "RemoveScheduledBackup", - "parameters": [ - { - "type": "string", - "name": "scheduled_backup_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/backups:changeScheduled": { - "put": { - "description": "Change a scheduled backup.", - "tags": [ - "BackupService" - ], - "summary": "Change a Scheduled Backup", - "operationId": "ChangeScheduledBackup", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "scheduled_backup_id": { - "type": "string", - "x-order": 0 - }, - "enabled": { - "type": "boolean", - "x-nullable": true, - "x-order": 1 - }, - "cron_expression": { - "description": "How often backup should be run in cron format.", - "type": "string", - "x-nullable": true, - "x-order": 2 - }, - "start_time": { - "description": "First backup wouldn't happen before this time.", - "type": "string", - "format": "date-time", - "x-order": 3 - }, - "name": { - "description": "Name of backup.", - "type": "string", - "x-nullable": true, - "x-order": 4 - }, - "description": { - "description": "Human-readable description.", - "type": "string", - "x-nullable": true, - "x-order": 5 - }, - "retries": { - "description": "How many times to retry a failed backup before giving up.", - "type": "integer", - "format": "int64", - "x-nullable": true, - "x-order": 6 - }, - "retry_interval": { - "description": "Delay between each retry. Should have a suffix in JSON: 1s, 1m, 1h.", - "type": "string", - "x-order": 7 - }, - "retention": { - "description": "How many artifacts keep. 0 - unlimited.", - "type": "integer", - "format": "int64", - "x-nullable": true, - "x-order": 8 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/backups:schedule": { - "post": { - "description": "Schedule a backup to run at a specified time.", - "tags": [ - "BackupService" - ], - "summary": "Schedule a Backup", - "operationId": "ScheduleBackup", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "service_id": { - "description": "Service identifier where backup should be performed.", - "type": "string", - "x-order": 0 - }, - "location_id": { - "description": "Machine-readable location ID.", - "type": "string", - "x-order": 1 - }, - "folder": { - "description": "How often backup should be run in cron format.\nFolder on storage for artifact.", - "type": "string", - "x-order": 2 - }, - "cron_expression": { - "type": "string", - "x-order": 3 - }, - "start_time": { - "description": "First backup wouldn't happen before this time.", - "type": "string", - "format": "date-time", - "x-order": 4 - }, - "name": { - "description": "Name of backup.", - "type": "string", - "x-order": 5 - }, - "description": { - "description": "Human-readable description.", - "type": "string", - "x-order": 6 - }, - "enabled": { - "description": "If scheduling is enabled.", - "type": "boolean", - "x-order": 7 - }, - "retries": { - "description": "How many times to retry a failed backup before giving up.", - "type": "integer", - "format": "int64", - "x-order": 8 - }, - "retry_interval": { - "description": "Delay between each retry. Should have a suffix in JSON: 1s, 1m, 1h.", - "type": "string", - "x-order": 9 - }, - "mode": { - "description": "BackupMode specifies backup mode.", - "type": "string", - "default": "BACKUP_MODE_UNSPECIFIED", - "enum": [ - "BACKUP_MODE_UNSPECIFIED", - "BACKUP_MODE_SNAPSHOT", - "BACKUP_MODE_INCREMENTAL", - "BACKUP_MODE_PITR" - ], - "x-order": 10 - }, - "data_model": { - "description": "DataModel is a model used for performing a backup.", - "type": "string", - "default": "DATA_MODEL_UNSPECIFIED", - "enum": [ - "DATA_MODEL_UNSPECIFIED", - "DATA_MODEL_PHYSICAL", - "DATA_MODEL_LOGICAL" - ], - "x-order": 11 - }, - "retention": { - "description": "How many artifacts keep. 0 - unlimited.", - "type": "integer", - "format": "int64", - "x-order": 12 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "scheduled_backup_id": { - "type": "string", - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/backups:start": { - "post": { - "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", - "tags": [ - "BackupService" - ], - "summary": "Start a Backup", - "operationId": "StartBackup", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "service_id": { - "description": "Service identifier.", - "type": "string", - "x-order": 0 - }, - "location_id": { - "description": "Machine-readable location ID.", - "type": "string", - "x-order": 1 - }, - "name": { - "description": "If empty then name is auto-generated.", - "type": "string", - "x-order": 2 - }, - "description": { - "description": "Human-readable description.", - "type": "string", - "x-order": 3 - }, - "retry_interval": { - "description": "Delay between each retry. Should have a suffix in JSON: 1s, 1m, 1h.", - "type": "string", - "x-order": 4 - }, - "retries": { - "description": "How many times to retry a failed backup before giving up.", - "type": "integer", - "format": "int64", - "x-order": 5 - }, - "data_model": { - "description": "DataModel is a model used for performing a backup.", - "type": "string", - "default": "DATA_MODEL_UNSPECIFIED", - "enum": [ - "DATA_MODEL_UNSPECIFIED", - "DATA_MODEL_PHYSICAL", - "DATA_MODEL_LOGICAL" - ], - "x-order": 6 - }, - "folder": { - "description": "Folder on storage for artifact.", - "type": "string", - "x-order": 7 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "artifact_id": { - "description": "Unique identifier.", - "type": "string", - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/dumps": { - "get": { - "description": "List all dumps", - "tags": [ - "DumpService" - ], - "summary": "List All Dumps", - "operationId": "ListDumps", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "dumps": { - "type": "array", - "items": { - "type": "object", - "properties": { - "dump_id": { - "type": "string", - "x-order": 0 - }, - "status": { - "type": "string", - "default": "DUMP_STATUS_UNSPECIFIED", - "enum": [ - "DUMP_STATUS_UNSPECIFIED", - "DUMP_STATUS_IN_PROGRESS", - "DUMP_STATUS_SUCCESS", - "DUMP_STATUS_ERROR" - ], - "x-order": 1 - }, - "service_names": { - "type": "array", - "items": { - "type": "string" - }, - "x-order": 2 - }, - "start_time": { - "type": "string", - "format": "date-time", - "x-order": 3 - }, - "end_time": { - "type": "string", - "format": "date-time", - "x-order": 4 - }, - "created_at": { - "type": "string", - "format": "date-time", - "x-order": 5 - } - } - }, - "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/dumps/{dump_id}/logs": { - "get": { - "description": "Get logs of a selected dump.", - "tags": [ - "DumpService" - ], - "summary": "Get Dump Logs", - "operationId": "GetDumpLogs", - "parameters": [ - { - "type": "string", - "name": "dump_id", - "in": "path", - "required": true - }, - { - "type": "integer", - "format": "int64", - "name": "offset", - "in": "query" - }, - { - "type": "integer", - "format": "int64", - "name": "limit", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "logs": { - "type": "array", - "items": { - "description": "LogChunk represent one chunk of logs.", - "type": "object", - "properties": { - "chunk_id": { - "type": "integer", - "format": "int64", - "x-order": 0 - }, - "data": { - "type": "string", - "x-order": 1 - } - } - }, - "x-order": 0 - }, - "end": { - "type": "boolean", - "x-order": 1 - } - } - } - }, - "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/dumps:batchDelete": { - "post": { - "description": "Delete selected dumps.", - "tags": [ - "DumpService" - ], - "summary": "Delete Dumps", - "operationId": "DeleteDump", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "dump_ids": { - "type": "array", - "items": { - "type": "string" - }, - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/dumps:start": { - "post": { - "description": "Start a new dump.", - "tags": [ - "DumpService" - ], - "summary": "Start a New Dump", - "operationId": "StartDump", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "service_names": { - "type": "array", - "items": { - "type": "string" - }, - "x-order": 0 - }, - "start_time": { - "type": "string", - "format": "date-time", - "x-order": 1 - }, - "end_time": { - "type": "string", - "format": "date-time", - "x-order": 2 - }, - "export_qan": { - "type": "boolean", - "x-order": 3 - }, - "ignore_load": { - "type": "boolean", - "x-order": 4 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "dump_id": { - "type": "string", - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/dumps:upload": { - "post": { - "description": "Upload selected dumps to a remote server.", - "tags": [ - "DumpService" - ], - "summary": "Upload Dumps", - "operationId": "UploadDump", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "dump_ids": { - "type": "array", - "items": { - "type": "string" - }, - "x-order": 0 - }, - "sftp_parameters": { - "type": "object", - "properties": { - "address": { - "type": "string", - "x-order": 0 - }, - "user": { - "type": "string", - "x-order": 1 - }, - "password": { - "type": "string", - "x-order": 2 - }, - "directory": { - "type": "string", - "x-order": 3 - } - }, - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/inventory/agents": { - "get": { - "description": "Returns a list of all Agents.", - "tags": [ - "AgentsService" - ], - "summary": "List Agents", - "operationId": "ListAgents", - "parameters": [ - { - "type": "string", - "description": "Return only Agents started by this pmm-agent.\nExactly one of these parameters should be present: pmm_agent_id, node_id, service_id.", - "name": "pmm_agent_id", - "in": "query" - }, - { - "type": "string", - "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.", - "name": "node_id", - "in": "query" - }, - { - "type": "string", - "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.", - "name": "service_id", - "in": "query" - }, - { - "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" - ], - "type": "string", - "default": "AGENT_TYPE_UNSPECIFIED", - "description": "Return only agents of a particular type.", - "name": "agent_type", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "pmm_agent": { - "type": "array", - "items": { - "description": "PMMAgent runs on Generic or Container Node.", - "type": "object", - "properties": { - "agent_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "runs_on_node_id": { - "description": "Node identifier where this instance runs.", - "type": "string", - "x-order": 1 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 2 - }, - "connected": { - "description": "True if Agent is running and connected to pmm-managed.", - "type": "boolean", - "x-order": 3 - }, - "process_exec_path": { - "description": "Path to exec process.", - "type": "string", - "x-order": 4 - } - } - }, - "x-order": 0 - }, - "vm_agent": { - "type": "array", - "items": { - "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.", - "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 - }, - "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 - }, - "process_exec_path": { - "description": "Path to exec process.", - "type": "string", - "x-order": 3 - }, - "listen_port": { - "description": "Listen port for scraping metrics.", - "type": "integer", - "format": "int64", - "x-order": 4 - } - } - }, - "x-order": 1 - }, - "node_exporter": { - "type": "array", - "items": { - "description": "NodeExporter runs on Generic or Container Node and exposes its 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 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 3 - }, - "push_metrics_enabled": { - "description": "True if exporter uses push metrics mode.", - "type": "boolean", - "x-order": 4 - }, - "disabled_collectors": { - "description": "List of disabled collector names.", - "type": "array", - "items": { - "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.", - "type": "integer", - "format": "int64", - "x-order": 7 - }, - "process_exec_path": { - "description": "Path to exec process.", - "type": "string", - "x-order": 8 - }, - "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": 9 - }, - "expose_exporter": { - "type": "boolean", - "title": "Optionally expose the exporter process on all public interfaces", - "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 - } - } - }, - "x-order": 2 - }, - "mysqld_exporter": { - "type": "array", - "items": { - "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", - "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 - }, - "mongodb_exporter": { - "type": "array", - "items": { - "description": "MongoDBExporter runs on Generic or Container Node and exposes MongoDB 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": "MongoDB 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": 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 - }, - "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": 11 - }, - "stats_collections": { - "type": "array", - "title": "List of colletions to get stats from. Can use *", - "items": { - "type": "string" - }, - "x-order": 12 - }, - "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", - "x-order": 13 - }, - "enable_all_collectors": { - "description": "Enable All collectors.", - "type": "boolean", - "x-order": 14 - }, - "process_exec_path": { - "description": "Path to exec process.", - "type": "string", - "x-order": 15 - }, - "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 - }, - "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.", - "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": 18 - } - } - }, - "x-order": 4 - }, - "postgres_exporter": { - "type": "array", - "items": { - "description": "PostgresExporter runs on Generic or Container Node and exposes PostgreSQL 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": "PostgreSQL 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. Uses sslmode=required instead of verify-full.", - "type": "boolean", - "x-order": 6 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "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 - }, - "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": 11 - }, - "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" - ], - "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 - } - } - }, - "x-order": 5 - }, - "proxysql_exporter": { - "type": "array", - "items": { - "description": "ProxySQLExporter runs on Generic or Container Node and exposes ProxySQL 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": "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": 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 - }, - "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": 11 - }, - "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" - ], - "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.", - "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": 6 - }, - "qan_mysql_perfschema_agent": { - "type": "array", - "items": { - "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.", - "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", - "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 - } - } - }, - "x-order": 7 - }, - "qan_mysql_slowlog_agent": { - "type": "array", - "items": { - "description": "QANMySQLSlowlogAgent 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": { - "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 - }, - "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 - }, - "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": 8 - }, - "qan_mongodb_profiler_agent": { - "type": "array", - "items": { - "description": "QANMongoDBProfilerAgent runs within pmm-agent and sends MongoDB 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": "MongoDB username for getting profiler 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 - }, - "max_query_length": { - "description": "Limit query length in QAN (default: server-defined; -1: no limit).", - "type": "integer", - "format": "int32", - "x-order": 7 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "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", - "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": 9 - }, - "qan_mongodb_mongolog_agent": { - "type": "array", - "items": { - "description": "QANMongoDBMongologAgent runs within pmm-agent and sends MongoDB 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": "MongoDB username for getting profiler 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 - }, - "max_query_length": { - "description": "Limit query length in QAN (default: server-defined; -1: no limit).", - "type": "integer", - "format": "int32", - "x-order": 7 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "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", - "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": 10 - }, - "qan_postgresql_pgstatements_agent": { - "type": "array", - "items": { - "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.", - "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 - }, - "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": 11 - }, - "qan_postgresql_pgstatmonitor_agent": { - "type": "array", - "items": { - "description": "QANPostgreSQLPgStatMonitorAgent 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 monitor 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 - }, - "disable_comments_parsing": { - "description": "Disable parsing comments from queries and showing them in QAN.", - "type": "boolean", - "x-order": 7 - }, - "max_query_length": { - "description": "Limit query length in QAN (default: server-defined; -1: no limit).", - "type": "integer", - "format": "int32", - "x-order": 8 - }, - "query_examples_disabled": { - "description": "True if query examples are disabled.", - "type": "boolean", - "x-order": 9 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "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 - }, - "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" - ], - "x-order": 13 - } - } - }, - "x-order": 12 - }, - "external_exporter": { - "type": "array", - "items": { - "description": "ExternalExporter runs on any Node type, including Remote Node.", - "type": "object", - "properties": { - "agent_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "runs_on_node_id": { - "description": "Node identifier where this instance runs.", - "type": "string", - "x-order": 1 - }, - "disabled": { - "description": "If disabled, metrics from this exporter will not be collected.", - "type": "boolean", - "x-order": 2 - }, - "service_id": { - "description": "Service identifier.", - "type": "string", - "x-order": 3 - }, - "username": { - "description": "HTTP basic auth username for collecting metrics.", - "type": "string", - "x-order": 4 - }, - "scheme": { - "description": "Scheme to generate URI to exporter metrics endpoints.", - "type": "string", - "x-order": 5 - }, - "metrics_path": { - "description": "Path under which metrics are exposed, used to generate URI.", - "type": "string", - "x-order": 6 - }, - "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 - } - } - }, - "x-order": 13 - }, - "rds_exporter": { - "type": "array", - "items": { - "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 - }, - "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.", - "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": { - "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 - }, - "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.", - "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 - } - } - }, - "x-order": 14 - }, - "azure_database_exporter": { - "type": "array", - "items": { - "description": "AzureDatabaseExporter runs on Generic or Container Node and exposes RemoteAzure 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 - }, - "azure_database_subscription_id": { - "description": "Azure database subscription ID.", - "type": "string", - "x-order": 4 - }, - "azure_database_resource_type": { - "type": "string", - "title": "Azure database resource type (mysql, maria, postgres)", - "x-order": 5 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 6 - }, - "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 - }, - "listen_port": { - "description": "Listen port for scraping metrics (the same for several configurations).", - "type": "integer", - "format": "int64", - "x-order": 8 - }, - "push_metrics_enabled": { - "description": "True if the exporter operates in push metrics mode.", - "type": "boolean", - "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 - }, - "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": 12 - } - } - }, - "x-order": 15 - }, - "nomad_agent": { - "type": "array", - "items": { - "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 - }, - "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 - }, - "process_exec_path": { - "description": "Path to exec process.", - "type": "string", - "x-order": 4 - }, - "listen_port": { - "description": "Listen port for scraping metrics.", - "type": "integer", - "format": "int64", - "x-order": 5 - } - } - }, - "x-order": 16 - }, - "valkey_exporter": { - "type": "array", - "items": { - "description": "ValkeyExporter runs on Generic or Container Node and exposes Valkey 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": "Valkey 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 verification.", - "type": "boolean", - "x-order": 6 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "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 - }, - "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": 11 - }, - "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": 13 - }, - "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 - } - } - }, - "x-order": 17 - } - } - } - }, - "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 - } - } - } - } - } - }, - "post": { - "description": "Adds an Agent to Inventory. Only one agent at a time can be passed.", - "tags": [ - "AgentsService" - ], - "summary": "Add an Agent to Inventory", - "operationId": "AddAgent", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "pmm_agent": { - "type": "object", - "properties": { - "runs_on_node_id": { - "description": "Node identifier where this instance runs.", - "type": "string", - "x-order": 0 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 1 - } - }, - "x-order": 0 - }, - "node_exporter": { - "type": "object", - "properties": { - "pmm_agent_id": { - "description": "The pmm-agent identifier which runs this instance.", - "type": "string", - "x-order": 0 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 1 - }, - "push_metrics": { - "description": "Enables push metrics mode for exporter.", - "type": "boolean", - "x-order": 2 - }, - "disable_collectors": { - "description": "List of collector names to disable in this exporter.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 3 - }, - "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": 4 - }, - "expose_exporter": { - "type": "boolean", - "title": "Expose the node_exporter process on all public interfaces", - "x-order": 5 - } - }, - "x-order": 1 - }, - "mysqld_exporter": { - "type": "object", - "properties": { - "pmm_agent_id": { - "description": "The pmm-agent identifier which runs this instance.", - "type": "string", - "x-order": 0 - }, - "service_id": { - "description": "Service identifier.", - "type": "string", - "x-order": 1 - }, - "username": { - "description": "MySQL username for scraping metrics.", - "type": "string", - "x-order": 2 - }, - "password": { - "description": "MySQL password for scraping metrics.", - "type": "string", - "x-order": 3 - }, - "tls": { - "description": "Use TLS for database connections.", - "type": "boolean", - "x-order": 4 - }, - "tls_skip_verify": { - "description": "Skip TLS certificate and hostname validation.", - "type": "boolean", - "x-order": 5 - }, - "tls_ca": { - "description": "Certificate Authority certificate chain.", - "type": "string", - "x-order": 6 - }, - "tls_cert": { - "description": "Client certificate.", - "type": "string", - "x-order": 7 - }, - "tls_key": { - "description": "Password for decrypting tls_cert.", - "type": "string", - "x-order": 8 - }, - "tablestats_group_table_limit": { - "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.", - "type": "integer", - "format": "int32", - "x-order": 9 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 10 - }, - "skip_connection_check": { - "description": "Skip connection check.", - "type": "boolean", - "x-order": 11 - }, - "push_metrics": { - "description": "Enables push metrics mode for exporter.", - "type": "boolean", - "x-order": 12 - }, - "disable_collectors": { - "description": "List of collector names to disable in this exporter.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 13 - }, - "agent_password": { - "description": "Custom password for exporter endpoint /metrics.", - "type": "string", - "x-order": 14 - }, - "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": 15 - }, - "expose_exporter": { - "type": "boolean", - "title": "Optionally expose the exporter process on all public interfaces", - "x-order": 16 - }, - "extra_dsn_params": { - "description": "Extra DSN parameters for MySQL connection.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 17 - } - }, - "x-order": 2 - }, - "mongodb_exporter": { - "type": "object", - "properties": { - "pmm_agent_id": { - "description": "The pmm-agent identifier which runs this instance.", - "type": "string", - "x-order": 0 - }, - "service_id": { - "description": "Service identifier.", - "type": "string", - "x-order": 1 - }, - "username": { - "description": "MongoDB username for scraping metrics.", - "type": "string", - "x-order": 2 - }, - "password": { - "description": "MongoDB password for scraping metrics.", - "type": "string", - "x-order": 3 - }, - "tls": { - "description": "Use TLS for database connections.", - "type": "boolean", - "x-order": 4 - }, - "tls_skip_verify": { - "description": "Skip TLS certificate and hostname validation.", - "type": "boolean", - "x-order": 5 - }, - "tls_certificate_key": { - "description": "Client certificate and key.", - "type": "string", - "x-order": 6 - }, - "tls_certificate_key_file_password": { - "description": "Password for decrypting tls_certificate_key.", - "type": "string", - "x-order": 7 - }, - "tls_ca": { - "description": "Certificate Authority certificate chain.", - "type": "string", - "x-order": 8 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 9 - }, - "skip_connection_check": { - "description": "Skip connection check.", - "type": "boolean", - "x-order": 10 - }, - "push_metrics": { - "description": "Enables push metrics mode for exporter.", - "type": "boolean", - "x-order": 11 - }, - "disable_collectors": { - "description": "List of collector names to disable in this exporter.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 12 - }, - "authentication_mechanism": { - "description": "Authentication mechanism.\nSee https://docs.mongodb.com/manual/reference/connection-string/#mongodb-urioption-urioption.authMechanism\nfor details.", - "type": "string", - "x-order": 13 - }, - "authentication_database": { - "description": "Authentication database.", - "type": "string", - "x-order": 14 - }, - "agent_password": { - "description": "Custom password for exporter endpoint /metrics.", - "type": "string", - "x-order": 15 - }, - "stats_collections": { - "type": "array", - "title": "List of colletions to get stats from. Can use *", - "items": { - "type": "string" - }, - "x-order": 16 - }, - "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", - "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", - "x-order": 19 - } - }, - "x-order": 3 - }, - "postgres_exporter": { - "type": "object", - "properties": { - "pmm_agent_id": { - "description": "The pmm-agent identifier which runs this instance.", - "type": "string", - "x-order": 0 - }, - "service_id": { - "description": "Service identifier.", - "type": "string", - "x-order": 1 - }, - "username": { - "description": "PostgreSQL username for scraping metrics.", - "type": "string", - "x-order": 2 - }, - "password": { - "description": "PostgreSQL password for scraping metrics.", - "type": "string", - "x-order": 3 - }, - "tls": { - "description": "Use TLS for database connections.", - "type": "boolean", - "x-order": 4 - }, - "tls_skip_verify": { - "description": "Skip TLS certificate and hostname validation. Uses sslmode=required instead of verify-full.", - "type": "boolean", - "x-order": 5 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 6 - }, - "skip_connection_check": { - "description": "Skip connection check.", - "type": "boolean", - "x-order": 7 - }, - "push_metrics": { - "description": "Enables push metrics mode for exporter.", - "type": "boolean", - "x-order": 8 - }, - "disable_collectors": { - "description": "List of collector names to disable in this exporter.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 9 - }, - "tls_ca": { - "description": "TLS CA certificate.", - "type": "string", - "x-order": 10 - }, - "tls_cert": { - "description": "TLS Certifcate.", - "type": "string", - "x-order": 11 - }, - "tls_key": { - "description": "TLS Certificate Key.", - "type": "string", - "x-order": 12 - }, - "agent_password": { - "description": "Custom password for exporter endpoint /metrics.", - "type": "string", - "x-order": 13 - }, - "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": 14 - }, - "auto_discovery_limit": { - "description": "Limit of databases for auto-discovery.", - "type": "integer", - "format": "int32", - "x-order": 15 - }, - "expose_exporter": { - "type": "boolean", - "title": "Optionally expose the exporter process on all public interfaces", - "x-order": 16 - }, - "max_exporter_connections": { - "description": "Maximum number of connections that exporter can open to the database instance.", - "type": "integer", - "format": "int32", - "x-order": 17 - } - }, - "x-order": 4 - }, - "proxysql_exporter": { - "type": "object", - "properties": { - "pmm_agent_id": { - "description": "The pmm-agent identifier which runs this instance.", - "type": "string", - "x-order": 0 - }, - "service_id": { - "description": "Service identifier.", - "type": "string", - "x-order": 1 - }, - "username": { - "description": "ProxySQL username for scraping metrics.", - "type": "string", - "x-order": 2 - }, - "password": { - "description": "ProxySQL password for scraping metrics.", - "type": "string", - "x-order": 3 - }, - "tls": { - "description": "Use TLS for database connections.", - "type": "boolean", - "x-order": 4 - }, - "tls_skip_verify": { - "description": "Skip TLS certificate and hostname validation.", - "type": "boolean", - "x-order": 5 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 6 - }, - "skip_connection_check": { - "description": "Skip connection check.", - "type": "boolean", - "x-order": 7 - }, - "push_metrics": { - "description": "Enables push metrics mode for exporter.", - "type": "boolean", - "x-order": 8 - }, - "disable_collectors": { - "description": "List of collector names to disable in this exporter.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 9 - }, - "agent_password": { - "description": "Custom password for exporter endpoint /metrics.", - "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 - }, - "expose_exporter": { - "type": "boolean", - "title": "Optionally expose the exporter process on all public interfaces", - "x-order": 12 - } - }, - "x-order": 5 - }, - "external_exporter": { - "type": "object", - "properties": { - "runs_on_node_id": { - "description": "The node identifier where this instance is run.", - "type": "string", - "x-order": 0 - }, - "service_id": { - "description": "Service identifier.", - "type": "string", - "x-order": 1 - }, - "username": { - "description": "HTTP basic auth username for collecting metrics.", - "type": "string", - "x-order": 2 - }, - "password": { - "description": "HTTP basic auth password for collecting metrics.", - "type": "string", - "x-order": 3 - }, - "scheme": { - "description": "Scheme to generate URI to exporter metrics endpoints(default: http).", - "type": "string", - "x-order": 4 - }, - "metrics_path": { - "description": "Path under which metrics are exposed, used to generate URI(default: /metrics).", - "type": "string", - "x-order": 5 - }, - "listen_port": { - "description": "Listen port for scraping metrics.", - "type": "integer", - "format": "int64", - "x-order": 6 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 7 - }, - "push_metrics": { - "description": "Enables push metrics mode for exporter.", - "type": "boolean", - "x-order": 8 - }, - "tls_skip_verify": { - "description": "Skip TLS certificate and hostname verification.", - "type": "boolean", - "x-order": 9 - } - }, - "x-order": 6 - }, - "rds_exporter": { - "type": "object", - "properties": { - "pmm_agent_id": { - "description": "The pmm-agent identifier which runs this instance.", - "type": "string", - "x-order": 0 - }, - "node_id": { - "description": "Node identifier.", - "type": "string", - "x-order": 1 - }, - "aws_access_key": { - "description": "AWS Access Key.", - "type": "string", - "x-order": 2 - }, - "aws_secret_key": { - "description": "AWS Secret Key.", - "type": "string", - "x-order": 3 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 4 - }, - "skip_connection_check": { - "description": "Skip connection check.", - "type": "boolean", - "x-order": 5 - }, - "disable_basic_metrics": { - "description": "Disable basic metrics.", - "type": "boolean", - "x-order": 6 - }, - "disable_enhanced_metrics": { - "description": "Disable enhanced metrics.", - "type": "boolean", - "x-order": 7 - }, - "push_metrics": { - "description": "Enables push metrics mode for exporter.", - "type": "boolean", - "x-order": 8 - }, - "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": 9 - } - }, - "x-order": 7 - }, - "azure_database_exporter": { - "type": "object", - "properties": { - "pmm_agent_id": { - "description": "The pmm-agent identifier which runs this instance.", - "type": "string", - "x-order": 0 - }, - "node_id": { - "description": "Node identifier.", - "type": "string", - "x-order": 1 - }, - "azure_client_id": { - "type": "string", - "title": "Azure client ID", - "x-order": 2 - }, - "azure_client_secret": { - "type": "string", - "title": "Azure client secret", - "x-order": 3 - }, - "azure_tenant_id": { - "type": "string", - "title": "Azure tanant ID", - "x-order": 4 - }, - "azure_subscription_id": { - "type": "string", - "title": "Azure subscription ID", - "x-order": 5 - }, - "azure_resource_group": { - "description": "Azure resource group.", - "type": "string", - "x-order": 6 - }, - "azure_database_resource_type": { - "type": "string", - "title": "Azure resource type (mysql, maria, postgres)", - "x-order": 7 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 8 - }, - "skip_connection_check": { - "description": "Skip connection check.", - "type": "boolean", - "x-order": 9 - }, - "push_metrics": { - "description": "Enables push metrics mode for exporter.", - "type": "boolean", - "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": 8 - }, - "qan_mysql_perfschema_agent": { - "type": "object", - "properties": { - "pmm_agent_id": { - "description": "The pmm-agent identifier which runs this instance.", - "type": "string", - "x-order": 0 - }, - "service_id": { - "description": "Service identifier.", - "type": "string", - "x-order": 1 - }, - "username": { - "description": "MySQL username for getting performance data.", - "type": "string", - "x-order": 2 - }, - "password": { - "description": "MySQL password for getting performance data.", - "type": "string", - "x-order": 3 - }, - "tls": { - "description": "Use TLS for database connections.", - "type": "boolean", - "x-order": 4 - }, - "tls_skip_verify": { - "description": "Skip TLS certificate and hostname validation.", - "type": "boolean", - "x-order": 5 - }, - "tls_ca": { - "description": "Certificate Authority certificate chain.", - "type": "string", - "x-order": 6 - }, - "tls_cert": { - "description": "Client certificate.", - "type": "string", - "x-order": 7 - }, - "tls_key": { - "description": "Password for decrypting tls_cert.", - "type": "string", - "x-order": 8 - }, - "max_query_length": { - "type": "integer", - "format": "int32", - "title": "Limit query length in QAN (default: server-defined; -1: no limit)", - "x-order": 9 - }, - "disable_query_examples": { - "description": "Disable query examples.", - "type": "boolean", - "x-order": 10 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 11 - }, - "skip_connection_check": { - "description": "Skip connection check.", - "type": "boolean", - "x-order": 12 - }, - "disable_comments_parsing": { - "description": "Disable parsing comments from queries and showing them in QAN.", - "type": "boolean", - "x-order": 13 - }, - "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": 14 - }, - "extra_dsn_params": { - "description": "Extra DSN parameters for MySQL connection.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 15 - } - }, - "x-order": 9 - }, - "qan_mysql_slowlog_agent": { - "type": "object", - "properties": { - "pmm_agent_id": { - "description": "The pmm-agent identifier which runs this instance.", - "type": "string", - "x-order": 0 - }, - "service_id": { - "description": "Service identifier.", - "type": "string", - "x-order": 1 - }, - "username": { - "description": "MySQL username for getting slowlog data.", - "type": "string", - "x-order": 2 - }, - "password": { - "description": "MySQL password for getting slowlog data.", - "type": "string", - "x-order": 3 - }, - "tls": { - "description": "Use TLS for database connections.", - "type": "boolean", - "x-order": 4 - }, - "tls_skip_verify": { - "description": "Skip TLS certificate and hostname validation.", - "type": "boolean", - "x-order": 5 - }, - "tls_ca": { - "description": "Certificate Authority certificate chain.", - "type": "string", - "x-order": 6 - }, - "tls_cert": { - "description": "Client certificate.", - "type": "string", - "x-order": 7 - }, - "tls_key": { - "description": "Password for decrypting tls_cert.", - "type": "string", - "x-order": 8 - }, - "max_query_length": { - "description": "Limit query length in QAN (default: server-defined; -1: no limit).", - "type": "integer", - "format": "int32", - "x-order": 9 - }, - "disable_query_examples": { - "description": "Disable query examples.", - "type": "boolean", - "x-order": 10 - }, - "max_slowlog_file_size": { - "description": "Rotate slowlog file at this size if \u003e 0.\nUse zero or negative value to disable rotation.", - "type": "string", - "format": "int64", - "x-order": 11 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 12 - }, - "skip_connection_check": { - "description": "Skip connection check.", - "type": "boolean", - "x-order": 13 - }, - "disable_comments_parsing": { - "description": "Disable parsing comments from queries and showing them in QAN.", - "type": "boolean", - "x-order": 14 - }, - "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": 15 - }, - "extra_dsn_params": { - "description": "Extra DSN parameters for MySQL connection.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 16 - } - }, - "x-order": 10 - }, - "qan_mongodb_profiler_agent": { - "type": "object", - "properties": { - "pmm_agent_id": { - "description": "The pmm-agent identifier which runs this instance.", - "type": "string", - "x-order": 0 - }, - "service_id": { - "description": "Service identifier.", - "type": "string", - "x-order": 1 - }, - "username": { - "description": "MongoDB username for getting profile data.", - "type": "string", - "x-order": 2 - }, - "password": { - "description": "MongoDB password for getting profile data.", - "type": "string", - "x-order": 3 - }, - "tls": { - "description": "Use TLS for database connections.", - "type": "boolean", - "x-order": 4 - }, - "tls_skip_verify": { - "description": "Skip TLS certificate and hostname validation.", - "type": "boolean", - "x-order": 5 - }, - "tls_certificate_key": { - "description": "Client certificate and key.", - "type": "string", - "x-order": 6 - }, - "tls_certificate_key_file_password": { - "description": "Password for decrypting tls_certificate_key.", - "type": "string", - "x-order": 7 - }, - "tls_ca": { - "description": "Certificate Authority certificate chain.", - "type": "string", - "x-order": 8 - }, - "max_query_length": { - "description": "Limit query length in QAN (default: server-defined; -1: no limit).", - "type": "integer", - "format": "int32", - "x-order": 9 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 10 - }, - "skip_connection_check": { - "description": "Skip connection check.", - "type": "boolean", - "x-order": 11 - }, - "authentication_mechanism": { - "description": "Authentication mechanism.\nSee https://docs.mongodb.com/manual/reference/connection-string/#mongodb-urioption-urioption.authMechanism\nfor details.", - "type": "string", - "x-order": 12 - }, - "authentication_database": { - "description": "Authentication database.", - "type": "string", - "x-order": 13 - }, - "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": 14 - } - }, - "x-order": 11 - }, - "qan_mongodb_mongolog_agent": { - "type": "object", - "properties": { - "pmm_agent_id": { - "description": "The pmm-agent identifier which runs this instance.", - "type": "string", - "x-order": 0 - }, - "service_id": { - "description": "Service identifier.", - "type": "string", - "x-order": 1 - }, - "username": { - "description": "MongoDB username for getting profile data.", - "type": "string", - "x-order": 2 - }, - "password": { - "description": "MongoDB password for getting profile data.", - "type": "string", - "x-order": 3 - }, - "tls": { - "description": "Use TLS for database connections.", - "type": "boolean", - "x-order": 4 - }, - "tls_skip_verify": { - "description": "Skip TLS certificate and hostname validation.", - "type": "boolean", - "x-order": 5 - }, - "tls_certificate_key": { - "description": "Client certificate and key.", - "type": "string", - "x-order": 6 - }, - "tls_certificate_key_file_password": { - "description": "Password for decrypting tls_certificate_key.", - "type": "string", - "x-order": 7 - }, - "tls_ca": { - "description": "Certificate Authority certificate chain.", - "type": "string", - "x-order": 8 - }, - "max_query_length": { - "description": "Limit query length in QAN (default: server-defined; -1: no limit).", - "type": "integer", - "format": "int32", - "x-order": 9 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 10 - }, - "skip_connection_check": { - "description": "Skip connection check.", - "type": "boolean", - "x-order": 11 - }, - "authentication_mechanism": { - "description": "Authentication mechanism.\nSee https://docs.mongodb.com/manual/reference/connection-string/#mongodb-urioption-urioption.authMechanism\nfor details.", - "type": "string", - "x-order": 12 - }, - "authentication_database": { - "description": "Authentication database.", - "type": "string", - "x-order": 13 - }, - "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": 14 - } - }, - "x-order": 12 - }, - "qan_postgresql_pgstatements_agent": { - "type": "object", - "properties": { - "pmm_agent_id": { - "description": "The pmm-agent identifier which runs this instance.", - "type": "string", - "x-order": 0 - }, - "service_id": { - "description": "Service identifier.", - "type": "string", - "x-order": 1 - }, - "username": { - "description": "PostgreSQL username for getting pg stat statements data.", - "type": "string", - "x-order": 2 - }, - "password": { - "description": "PostgreSQL password for getting pg stat statements data.", - "type": "string", - "x-order": 3 - }, - "tls": { - "description": "Use TLS for database connections.", - "type": "boolean", - "x-order": 4 - }, - "tls_skip_verify": { - "description": "Skip TLS certificate and hostname validation.", - "type": "boolean", - "x-order": 5 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 6 - }, - "skip_connection_check": { - "description": "Skip connection check.", - "type": "boolean", - "x-order": 7 - }, - "disable_comments_parsing": { - "description": "Disable parsing comments from queries and showing them in QAN.", - "type": "boolean", - "x-order": 8 - }, - "max_query_length": { - "description": "Limit query length in QAN (default: server-defined; -1: no limit).", - "type": "integer", - "format": "int32", - "x-order": 9 - }, - "tls_ca": { - "description": "TLS CA certificate.", - "type": "string", - "x-order": 10 - }, - "tls_cert": { - "description": "TLS Certifcate.", - "type": "string", - "x-order": 11 - }, - "tls_key": { - "description": "TLS Certificate Key.", - "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" - ], - "x-order": 13 - } - }, - "x-order": 13 - }, - "qan_postgresql_pgstatmonitor_agent": { - "type": "object", - "properties": { - "pmm_agent_id": { - "description": "The pmm-agent identifier which runs this instance.", - "type": "string", - "x-order": 0 - }, - "service_id": { - "description": "Service identifier.", - "type": "string", - "x-order": 1 - }, - "username": { - "description": "PostgreSQL username for getting pg stat monitor data.", - "type": "string", - "x-order": 2 - }, - "password": { - "description": "PostgreSQL password for getting pg stat monitor data.", - "type": "string", - "x-order": 3 - }, - "tls": { - "description": "Use TLS for database connections.", - "type": "boolean", - "x-order": 4 - }, - "tls_skip_verify": { - "description": "Skip TLS certificate and hostname validation.", - "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 - }, - "disable_query_examples": { - "description": "Disable query examples.", - "type": "boolean", - "x-order": 7 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 8 - }, - "skip_connection_check": { - "description": "Skip connection check.", - "type": "boolean", - "x-order": 9 - }, - "disable_comments_parsing": { - "description": "Disable parsing comments from queries and showing them in QAN.", - "type": "boolean", - "x-order": 10 - }, - "tls_ca": { - "description": "TLS CA certificate.", - "type": "string", - "x-order": 11 - }, - "tls_cert": { - "description": "TLS Certifcate.", - "type": "string", - "x-order": 12 - }, - "tls_key": { - "description": "TLS Certificate Key.", - "type": "string", - "x-order": 13 - }, - "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": 14 - } - }, - "x-order": 14 - }, - "valkey_exporter": { - "type": "object", - "properties": { - "pmm_agent_id": { - "description": "The pmm-agent identifier which runs this instance.", - "type": "string", - "x-order": 0 - }, - "service_id": { - "description": "Service identifier.", - "type": "string", - "x-order": 1 - }, - "username": { - "description": "Valkey username for scraping metrics.", - "type": "string", - "x-order": 2 - }, - "password": { - "description": "Valkey password for scraping metrics.", - "type": "string", - "x-order": 3 - }, - "tls": { - "description": "Use TLS for database connections.", - "type": "boolean", - "x-order": 4 - }, - "tls_skip_verify": { - "description": "Skip TLS certificate and hostname validation.", - "type": "boolean", - "x-order": 5 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 6 - }, - "skip_connection_check": { - "description": "Skip connection check.", - "type": "boolean", - "x-order": 7 - }, - "push_metrics": { - "description": "Enables push metrics mode for exporter.", - "type": "boolean", - "x-order": 8 - }, - "disable_collectors": { - "description": "List of collector names to disable in this exporter.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 9 - }, - "tls_ca": { - "description": "TLS CA certificate.", - "type": "string", - "x-order": 10 - }, - "tls_cert": { - "description": "TLS Certifcate.", - "type": "string", - "x-order": 11 - }, - "tls_key": { - "description": "TLS Certificate Key.", - "type": "string", - "x-order": 12 - }, - "agent_password": { - "description": "Custom password for exporter endpoint /metrics.", - "type": "string", - "x-order": 13 - }, - "expose_exporter": { - "type": "boolean", - "title": "Optionally expose the exporter process on all public interfaces", - "x-order": 14 - } - }, - "x-order": 15 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "pmm_agent": { - "description": "PMMAgent runs on Generic or Container Node.", - "type": "object", - "properties": { - "agent_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "runs_on_node_id": { - "description": "Node identifier where this instance runs.", - "type": "string", - "x-order": 1 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 2 - }, - "connected": { - "description": "True if Agent is running and connected to pmm-managed.", - "type": "boolean", - "x-order": 3 - }, - "process_exec_path": { - "description": "Path to exec process.", - "type": "string", - "x-order": 4 - } - }, - "x-order": 0 - }, - "node_exporter": { - "description": "NodeExporter runs on Generic or Container Node and exposes its 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 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 3 - }, - "push_metrics_enabled": { - "description": "True if exporter uses push metrics mode.", - "type": "boolean", - "x-order": 4 - }, - "disabled_collectors": { - "description": "List of disabled collector names.", - "type": "array", - "items": { - "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.", - "type": "integer", - "format": "int64", - "x-order": 7 - }, - "process_exec_path": { - "description": "Path to exec process.", - "type": "string", - "x-order": 8 - }, - "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": 9 - }, - "expose_exporter": { - "type": "boolean", - "title": "Optionally expose the exporter process on all public interfaces", - "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 - } - }, - "x-order": 1 - }, - "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", - "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": 2 - }, - "mongodb_exporter": { - "description": "MongoDBExporter runs on Generic or Container Node and exposes MongoDB 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": "MongoDB 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": 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 - }, - "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": 11 - }, - "stats_collections": { - "type": "array", - "title": "List of colletions to get stats from. Can use *", - "items": { - "type": "string" - }, - "x-order": 12 - }, - "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", - "x-order": 13 - }, - "enable_all_collectors": { - "description": "Enable All collectors.", - "type": "boolean", - "x-order": 14 - }, - "process_exec_path": { - "description": "Path to exec process.", - "type": "string", - "x-order": 15 - }, - "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 - }, - "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.", - "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": 18 - } - }, - "x-order": 3 - }, - "postgres_exporter": { - "description": "PostgresExporter runs on Generic or Container Node and exposes PostgreSQL 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": "PostgreSQL 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. Uses sslmode=required instead of verify-full.", - "type": "boolean", - "x-order": 6 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "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 - }, - "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": 11 - }, - "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" - ], - "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 - } - }, - "x-order": 4 - }, - "proxysql_exporter": { - "description": "ProxySQLExporter runs on Generic or Container Node and exposes ProxySQL 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": "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": 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 - }, - "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": 11 - }, - "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" - ], - "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.", - "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": 5 - }, - "external_exporter": { - "description": "ExternalExporter runs on any Node type, including Remote Node.", - "type": "object", - "properties": { - "agent_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "runs_on_node_id": { - "description": "Node identifier where this instance runs.", - "type": "string", - "x-order": 1 - }, - "disabled": { - "description": "If disabled, metrics from this exporter will not be collected.", - "type": "boolean", - "x-order": 2 - }, - "service_id": { - "description": "Service identifier.", - "type": "string", - "x-order": 3 - }, - "username": { - "description": "HTTP basic auth username for collecting metrics.", - "type": "string", - "x-order": 4 - }, - "scheme": { - "description": "Scheme to generate URI to exporter metrics endpoints.", - "type": "string", - "x-order": 5 - }, - "metrics_path": { - "description": "Path under which metrics are exposed, used to generate URI.", - "type": "string", - "x-order": 6 - }, - "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 - } - }, - "x-order": 6 - }, - "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 - }, - "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.", - "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": { - "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 - }, - "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.", - "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 - } - }, - "x-order": 7 - }, - "azure_database_exporter": { - "description": "AzureDatabaseExporter runs on Generic or Container Node and exposes RemoteAzure 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 - }, - "azure_database_subscription_id": { - "description": "Azure database subscription ID.", - "type": "string", - "x-order": 4 - }, - "azure_database_resource_type": { - "type": "string", - "title": "Azure database resource type (mysql, maria, postgres)", - "x-order": 5 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 6 - }, - "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 - }, - "listen_port": { - "description": "Listen port for scraping metrics (the same for several configurations).", - "type": "integer", - "format": "int64", - "x-order": 8 - }, - "push_metrics_enabled": { - "description": "True if the exporter operates in push metrics mode.", - "type": "boolean", - "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 - }, - "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": 12 - } - }, - "x-order": 8 - }, - "qan_mysql_perfschema_agent": { - "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.", - "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", - "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 - } - }, - "x-order": 9 - }, - "qan_mysql_slowlog_agent": { - "description": "QANMySQLSlowlogAgent 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": { - "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 - }, - "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 - }, - "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": 10 - }, - "qan_mongodb_profiler_agent": { - "description": "QANMongoDBProfilerAgent runs within pmm-agent and sends MongoDB 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": "MongoDB username for getting profiler 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 - }, - "max_query_length": { - "description": "Limit query length in QAN (default: server-defined; -1: no limit).", - "type": "integer", - "format": "int32", - "x-order": 7 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "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", - "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": 11 - }, - "qan_mongodb_mongolog_agent": { - "description": "QANMongoDBMongologAgent runs within pmm-agent and sends MongoDB 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": "MongoDB username for getting profiler 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 - }, - "max_query_length": { - "description": "Limit query length in QAN (default: server-defined; -1: no limit).", - "type": "integer", - "format": "int32", - "x-order": 7 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "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", - "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": 12 - }, - "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.", - "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 - }, - "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": 13 - }, - "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": { - "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 monitor 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 - }, - "disable_comments_parsing": { - "description": "Disable parsing comments from queries and showing them in QAN.", - "type": "boolean", - "x-order": 7 - }, - "max_query_length": { - "description": "Limit query length in QAN (default: server-defined; -1: no limit).", - "type": "integer", - "format": "int32", - "x-order": 8 - }, - "query_examples_disabled": { - "description": "True if query examples are disabled.", - "type": "boolean", - "x-order": 9 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "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 - }, - "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" - ], - "x-order": 13 - } - }, - "x-order": 14 - }, - "valkey_exporter": { - "description": "ValkeyExporter runs on Generic or Container Node and exposes Valkey 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": "Valkey 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 verification.", - "type": "boolean", - "x-order": 6 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "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 - }, - "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": 11 - }, - "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": 13 - }, - "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 - } - }, - "x-order": 15 - } - } - } - }, - "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/inventory/agents/{agent_id}": { - "get": { - "description": "Returns a single Agent by ID.", - "tags": [ - "AgentsService" - ], - "summary": "Get Agent", - "operationId": "GetAgent", - "parameters": [ - { - "type": "string", - "description": "Unique randomly generated instance identifier.", - "name": "agent_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "pmm_agent": { - "description": "PMMAgent runs on Generic or Container Node.", - "type": "object", - "properties": { - "agent_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "runs_on_node_id": { - "description": "Node identifier where this instance runs.", - "type": "string", - "x-order": 1 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 2 - }, - "connected": { - "description": "True if Agent is running and connected to pmm-managed.", - "type": "boolean", - "x-order": 3 - }, - "process_exec_path": { - "description": "Path to exec process.", - "type": "string", - "x-order": 4 - } - }, - "x-order": 0 - }, - "vmagent": { - "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.", - "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 - }, - "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 - }, - "process_exec_path": { - "description": "Path to exec process.", - "type": "string", - "x-order": 3 - }, - "listen_port": { - "description": "Listen port for scraping metrics.", - "type": "integer", - "format": "int64", - "x-order": 4 - } - }, - "x-order": 1 - }, - "node_exporter": { - "description": "NodeExporter runs on Generic or Container Node and exposes its 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 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 3 - }, - "push_metrics_enabled": { - "description": "True if exporter uses push metrics mode.", - "type": "boolean", - "x-order": 4 - }, - "disabled_collectors": { - "description": "List of disabled collector names.", - "type": "array", - "items": { - "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.", - "type": "integer", - "format": "int64", - "x-order": 7 - }, - "process_exec_path": { - "description": "Path to exec process.", - "type": "string", - "x-order": 8 - }, - "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": 9 - }, - "expose_exporter": { - "type": "boolean", - "title": "Optionally expose the exporter process on all public interfaces", - "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 - } - }, - "x-order": 2 - }, - "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", - "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 - }, - "mongodb_exporter": { - "description": "MongoDBExporter runs on Generic or Container Node and exposes MongoDB 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": "MongoDB 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": 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 - }, - "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": 11 - }, - "stats_collections": { - "type": "array", - "title": "List of colletions to get stats from. Can use *", - "items": { - "type": "string" - }, - "x-order": 12 - }, - "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", - "x-order": 13 - }, - "enable_all_collectors": { - "description": "Enable All collectors.", - "type": "boolean", - "x-order": 14 - }, - "process_exec_path": { - "description": "Path to exec process.", - "type": "string", - "x-order": 15 - }, - "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 - }, - "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.", - "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": 18 - } - }, - "x-order": 4 - }, - "postgres_exporter": { - "description": "PostgresExporter runs on Generic or Container Node and exposes PostgreSQL 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": "PostgreSQL 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. Uses sslmode=required instead of verify-full.", - "type": "boolean", - "x-order": 6 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "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 - }, - "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": 11 - }, - "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" - ], - "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 - } - }, - "x-order": 5 - }, - "proxysql_exporter": { - "description": "ProxySQLExporter runs on Generic or Container Node and exposes ProxySQL 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": "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": 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 - }, - "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": 11 - }, - "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" - ], - "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.", - "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": 6 - }, - "qan_mysql_perfschema_agent": { - "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.", - "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", - "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 - } - }, - "x-order": 7 - }, - "qan_mysql_slowlog_agent": { - "description": "QANMySQLSlowlogAgent 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": { - "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 - }, - "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 - }, - "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": 8 - }, - "qan_mongodb_profiler_agent": { - "description": "QANMongoDBProfilerAgent runs within pmm-agent and sends MongoDB 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": "MongoDB username for getting profiler 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 - }, - "max_query_length": { - "description": "Limit query length in QAN (default: server-defined; -1: no limit).", - "type": "integer", - "format": "int32", - "x-order": 7 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "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", - "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": 9 - }, - "qan_mongodb_mongolog_agent": { - "description": "QANMongoDBMongologAgent runs within pmm-agent and sends MongoDB 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": "MongoDB username for getting profiler 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 - }, - "max_query_length": { - "description": "Limit query length in QAN (default: server-defined; -1: no limit).", - "type": "integer", - "format": "int32", - "x-order": 7 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "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", - "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": 10 - }, - "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.", - "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 - }, - "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": 11 - }, - "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": { - "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 monitor 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 - }, - "disable_comments_parsing": { - "description": "Disable parsing comments from queries and showing them in QAN.", - "type": "boolean", - "x-order": 7 - }, - "max_query_length": { - "description": "Limit query length in QAN (default: server-defined; -1: no limit).", - "type": "integer", - "format": "int32", - "x-order": 8 - }, - "query_examples_disabled": { - "description": "True if query examples are disabled.", - "type": "boolean", - "x-order": 9 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "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 - }, - "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" - ], - "x-order": 13 - } - }, - "x-order": 12 - }, - "external_exporter": { - "description": "ExternalExporter runs on any Node type, including Remote Node.", - "type": "object", - "properties": { - "agent_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "runs_on_node_id": { - "description": "Node identifier where this instance runs.", - "type": "string", - "x-order": 1 - }, - "disabled": { - "description": "If disabled, metrics from this exporter will not be collected.", - "type": "boolean", - "x-order": 2 - }, - "service_id": { - "description": "Service identifier.", - "type": "string", - "x-order": 3 - }, - "username": { - "description": "HTTP basic auth username for collecting metrics.", - "type": "string", - "x-order": 4 - }, - "scheme": { - "description": "Scheme to generate URI to exporter metrics endpoints.", - "type": "string", - "x-order": 5 - }, - "metrics_path": { - "description": "Path under which metrics are exposed, used to generate URI.", - "type": "string", - "x-order": 6 - }, - "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 - } - }, - "x-order": 13 - }, - "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 - }, - "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.", - "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": { - "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 - }, - "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.", - "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 - } - }, - "x-order": 14 - }, - "azure_database_exporter": { - "description": "AzureDatabaseExporter runs on Generic or Container Node and exposes RemoteAzure 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 - }, - "azure_database_subscription_id": { - "description": "Azure database subscription ID.", - "type": "string", - "x-order": 4 - }, - "azure_database_resource_type": { - "type": "string", - "title": "Azure database resource type (mysql, maria, postgres)", - "x-order": 5 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 6 - }, - "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 - }, - "listen_port": { - "description": "Listen port for scraping metrics (the same for several configurations).", - "type": "integer", - "format": "int64", - "x-order": 8 - }, - "push_metrics_enabled": { - "description": "True if the exporter operates in push metrics mode.", - "type": "boolean", - "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 - }, - "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": 12 - } - }, - "x-order": 15 - }, - "nomad_agent": { - "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 - }, - "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 - }, - "process_exec_path": { - "description": "Path to exec process.", - "type": "string", - "x-order": 4 - }, - "listen_port": { - "description": "Listen port for scraping metrics.", - "type": "integer", - "format": "int64", - "x-order": 5 - } - }, - "x-order": 16 - }, - "valkey_exporter": { - "description": "ValkeyExporter runs on Generic or Container Node and exposes Valkey 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": "Valkey 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 verification.", - "type": "boolean", - "x-order": 6 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "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 - }, - "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": 11 - }, - "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": 13 - }, - "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 - } - }, - "x-order": 17 - } - } - } - }, - "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 - } - } - } - } - } - }, - "put": { - "description": "Updates an Agent in Inventory. Only one agent at a time can be passed.", - "tags": [ - "AgentsService" - ], - "summary": "Update an Agent in Inventory", - "operationId": "ChangeAgent", - "parameters": [ - { - "type": "string", - "name": "agent_id", - "in": "path", - "required": true - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "node_exporter": { - "type": "object", - "properties": { - "enable": { - "description": "Enable this Agent. Agents are enabled by default when they get added.", - "type": "boolean", - "x-nullable": true, - "x-order": 0 - }, - "custom_labels": { - "description": "A wrapper for map[string]string. This type allows to distinguish between an empty map and a null value.", - "type": "object", - "properties": { - "values": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 0 - } - }, - "x-nullable": true, - "x-order": 1 - }, - "enable_push_metrics": { - "description": "Enables push metrics with vmagent.", - "type": "boolean", - "x-nullable": true, - "x-order": 2 - }, - "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": 3 - } - }, - "x-order": 0 - }, - "mysqld_exporter": { - "type": "object", - "properties": { - "enable": { - "description": "Enable this Agent. Agents are enabled by default when they get added.", - "type": "boolean", - "x-nullable": true, - "x-order": 0 - }, - "custom_labels": { - "description": "A wrapper for map[string]string. This type allows to distinguish between an empty map and a null value.", - "type": "object", - "properties": { - "values": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 0 - } - }, - "x-nullable": true, - "x-order": 1 - }, - "enable_push_metrics": { - "description": "Enables push metrics with vmagent.", - "type": "boolean", - "x-nullable": true, - "x-order": 2 - }, - "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": 3 - } - }, - "x-order": 1 - }, - "mongodb_exporter": { - "type": "object", - "properties": { - "enable": { - "description": "Enable this Agent. Agents are enabled by default when they get added.", - "type": "boolean", - "x-nullable": true, - "x-order": 0 - }, - "custom_labels": { - "description": "A wrapper for map[string]string. This type allows to distinguish between an empty map and a null value.", - "type": "object", - "properties": { - "values": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 0 - } - }, - "x-nullable": true, - "x-order": 1 - }, - "enable_push_metrics": { - "description": "Enables push metrics with vmagent.", - "type": "boolean", - "x-nullable": true, - "x-order": 2 - }, - "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": 3 - } - }, - "x-order": 2 - }, - "postgres_exporter": { - "type": "object", - "properties": { - "enable": { - "description": "Enable this Agent. Agents are enabled by default when they get added.", - "type": "boolean", - "x-nullable": true, - "x-order": 0 - }, - "custom_labels": { - "description": "A wrapper for map[string]string. This type allows to distinguish between an empty map and a null value.", - "type": "object", - "properties": { - "values": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 0 - } - }, - "x-nullable": true, - "x-order": 1 - }, - "enable_push_metrics": { - "description": "Enables push metrics with vmagent.", - "type": "boolean", - "x-nullable": true, - "x-order": 2 - }, - "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": 3 - } - }, - "x-order": 3 - }, - "proxysql_exporter": { - "type": "object", - "properties": { - "enable": { - "description": "Enable this Agent. Agents are enabled by default when they get added.", - "type": "boolean", - "x-nullable": true, - "x-order": 0 - }, - "custom_labels": { - "description": "A wrapper for map[string]string. This type allows to distinguish between an empty map and a null value.", - "type": "object", - "properties": { - "values": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 0 - } - }, - "x-nullable": true, - "x-order": 1 - }, - "enable_push_metrics": { - "description": "Enables push metrics with vmagent.", - "type": "boolean", - "x-nullable": true, - "x-order": 2 - }, - "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": 3 - } - }, - "x-order": 4 - }, - "external_exporter": { - "type": "object", - "properties": { - "enable": { - "description": "Enable this Agent. Agents are enabled by default when they get added.", - "type": "boolean", - "x-nullable": true, - "x-order": 0 - }, - "custom_labels": { - "description": "A wrapper for map[string]string. This type allows to distinguish between an empty map and a null value.", - "type": "object", - "properties": { - "values": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 0 - } - }, - "x-nullable": true, - "x-order": 1 - }, - "enable_push_metrics": { - "description": "Enables push metrics with vmagent.", - "type": "boolean", - "x-nullable": true, - "x-order": 2 - }, - "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": 3 - } - }, - "x-order": 5 - }, - "rds_exporter": { - "type": "object", - "properties": { - "enable": { - "description": "Enable this Agent. Agents are enabled by default when they get added.", - "type": "boolean", - "x-nullable": true, - "x-order": 0 - }, - "custom_labels": { - "description": "A wrapper for map[string]string. This type allows to distinguish between an empty map and a null value.", - "type": "object", - "properties": { - "values": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 0 - } - }, - "x-nullable": true, - "x-order": 1 - }, - "enable_push_metrics": { - "description": "Enables push metrics with vmagent.", - "type": "boolean", - "x-nullable": true, - "x-order": 2 - }, - "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": 3 - } - }, - "x-order": 6 - }, - "azure_database_exporter": { - "type": "object", - "properties": { - "enable": { - "description": "Enable this Agent. Agents are enabled by default when they get added.", - "type": "boolean", - "x-nullable": true, - "x-order": 0 - }, - "custom_labels": { - "description": "A wrapper for map[string]string. This type allows to distinguish between an empty map and a null value.", - "type": "object", - "properties": { - "values": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 0 - } - }, - "x-nullable": true, - "x-order": 1 - }, - "enable_push_metrics": { - "description": "Enables push metrics with vmagent.", - "type": "boolean", - "x-nullable": true, - "x-order": 2 - }, - "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": 3 - } - }, - "x-order": 7 - }, - "qan_mysql_perfschema_agent": { - "type": "object", - "properties": { - "enable": { - "description": "Enable this Agent. Agents are enabled by default when they get added.", - "type": "boolean", - "x-nullable": true, - "x-order": 0 - }, - "custom_labels": { - "description": "A wrapper for map[string]string. This type allows to distinguish between an empty map and a null value.", - "type": "object", - "properties": { - "values": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 0 - } - }, - "x-nullable": true, - "x-order": 1 - }, - "enable_push_metrics": { - "description": "Enables push metrics with vmagent.", - "type": "boolean", - "x-nullable": true, - "x-order": 2 - }, - "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": 3 - } - }, - "x-order": 8 - }, - "qan_mysql_slowlog_agent": { - "type": "object", - "properties": { - "enable": { - "description": "Enable this Agent. Agents are enabled by default when they get added.", - "type": "boolean", - "x-nullable": true, - "x-order": 0 - }, - "custom_labels": { - "description": "A wrapper for map[string]string. This type allows to distinguish between an empty map and a null value.", - "type": "object", - "properties": { - "values": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 0 - } - }, - "x-nullable": true, - "x-order": 1 - }, - "enable_push_metrics": { - "description": "Enables push metrics with vmagent.", - "type": "boolean", - "x-nullable": true, - "x-order": 2 - }, - "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": 3 - } - }, - "x-order": 9 - }, - "qan_mongodb_profiler_agent": { - "type": "object", - "properties": { - "enable": { - "description": "Enable this Agent. Agents are enabled by default when they get added.", - "type": "boolean", - "x-nullable": true, - "x-order": 0 - }, - "custom_labels": { - "description": "A wrapper for map[string]string. This type allows to distinguish between an empty map and a null value.", - "type": "object", - "properties": { - "values": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 0 - } - }, - "x-nullable": true, - "x-order": 1 - }, - "enable_push_metrics": { - "description": "Enables push metrics with vmagent.", - "type": "boolean", - "x-nullable": true, - "x-order": 2 - }, - "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": 3 - } - }, - "x-order": 10 - }, - "qan_mongodb_mongolog_agent": { - "type": "object", - "properties": { - "enable": { - "description": "Enable this Agent. Agents are enabled by default when they get added.", - "type": "boolean", - "x-nullable": true, - "x-order": 0 - }, - "custom_labels": { - "description": "A wrapper for map[string]string. This type allows to distinguish between an empty map and a null value.", - "type": "object", - "properties": { - "values": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 0 - } - }, - "x-nullable": true, - "x-order": 1 - }, - "enable_push_metrics": { - "description": "Enables push metrics with vmagent.", - "type": "boolean", - "x-nullable": true, - "x-order": 2 - }, - "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": 3 - } - }, - "x-order": 11 - }, - "qan_postgresql_pgstatements_agent": { - "type": "object", - "properties": { - "enable": { - "description": "Enable this Agent. Agents are enabled by default when they get added.", - "type": "boolean", - "x-nullable": true, - "x-order": 0 - }, - "custom_labels": { - "description": "A wrapper for map[string]string. This type allows to distinguish between an empty map and a null value.", - "type": "object", - "properties": { - "values": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 0 - } - }, - "x-nullable": true, - "x-order": 1 - }, - "enable_push_metrics": { - "description": "Enables push metrics with vmagent.", - "type": "boolean", - "x-nullable": true, - "x-order": 2 - }, - "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": 3 - } - }, - "x-order": 12 - }, - "qan_postgresql_pgstatmonitor_agent": { - "type": "object", - "properties": { - "enable": { - "description": "Enable this Agent. Agents are enabled by default when they get added.", - "type": "boolean", - "x-nullable": true, - "x-order": 0 - }, - "custom_labels": { - "description": "A wrapper for map[string]string. This type allows to distinguish between an empty map and a null value.", - "type": "object", - "properties": { - "values": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 0 - } - }, - "x-nullable": true, - "x-order": 1 - }, - "enable_push_metrics": { - "description": "Enables push metrics with vmagent.", - "type": "boolean", - "x-nullable": true, - "x-order": 2 - }, - "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": 3 - } - }, - "x-order": 13 - }, - "nomad_agent": { - "type": "object", - "properties": { - "enable": { - "description": "Enable this Agent. Agents are enabled by default when they get added.", - "type": "boolean", - "x-nullable": true, - "x-order": 0 - } - }, - "x-order": 14 - }, - "valkey_exporter": { - "type": "object", - "properties": { - "enable": { - "description": "Enable this Agent. Agents are enabled by default when they get added.", - "type": "boolean", - "x-nullable": true, - "x-order": 0 - }, - "custom_labels": { - "description": "A wrapper for map[string]string. This type allows to distinguish between an empty map and a null value.", - "type": "object", - "properties": { - "values": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 0 - } - }, - "x-nullable": true, - "x-order": 1 - }, - "enable_push_metrics": { - "description": "Enables push metrics with vmagent.", - "type": "boolean", - "x-nullable": true, - "x-order": 2 - }, - "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": 3 - } - }, - "x-order": 15 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "node_exporter": { - "description": "NodeExporter runs on Generic or Container Node and exposes its 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 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 3 - }, - "push_metrics_enabled": { - "description": "True if exporter uses push metrics mode.", - "type": "boolean", - "x-order": 4 - }, - "disabled_collectors": { - "description": "List of disabled collector names.", - "type": "array", - "items": { - "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.", - "type": "integer", - "format": "int64", - "x-order": 7 - }, - "process_exec_path": { - "description": "Path to exec process.", - "type": "string", - "x-order": 8 - }, - "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": 9 - }, - "expose_exporter": { - "type": "boolean", - "title": "Optionally expose the exporter process on all public interfaces", - "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 - } - }, - "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", - "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": 1 - }, - "mongodb_exporter": { - "description": "MongoDBExporter runs on Generic or Container Node and exposes MongoDB 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": "MongoDB 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": 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 - }, - "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": 11 - }, - "stats_collections": { - "type": "array", - "title": "List of colletions to get stats from. Can use *", - "items": { - "type": "string" - }, - "x-order": 12 - }, - "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", - "x-order": 13 - }, - "enable_all_collectors": { - "description": "Enable All collectors.", - "type": "boolean", - "x-order": 14 - }, - "process_exec_path": { - "description": "Path to exec process.", - "type": "string", - "x-order": 15 - }, - "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 - }, - "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.", - "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": 18 - } - }, - "x-order": 2 - }, - "postgres_exporter": { - "description": "PostgresExporter runs on Generic or Container Node and exposes PostgreSQL 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": "PostgreSQL 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. Uses sslmode=required instead of verify-full.", - "type": "boolean", - "x-order": 6 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "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 - }, - "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": 11 - }, - "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" - ], - "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 - } - }, - "x-order": 3 - }, - "proxysql_exporter": { - "description": "ProxySQLExporter runs on Generic or Container Node and exposes ProxySQL 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": "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": 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 - }, - "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": 11 - }, - "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" - ], - "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.", - "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": 4 - }, - "external_exporter": { - "description": "ExternalExporter runs on any Node type, including Remote Node.", - "type": "object", - "properties": { - "agent_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "runs_on_node_id": { - "description": "Node identifier where this instance runs.", - "type": "string", - "x-order": 1 - }, - "disabled": { - "description": "If disabled, metrics from this exporter will not be collected.", - "type": "boolean", - "x-order": 2 - }, - "service_id": { - "description": "Service identifier.", - "type": "string", - "x-order": 3 - }, - "username": { - "description": "HTTP basic auth username for collecting metrics.", - "type": "string", - "x-order": 4 - }, - "scheme": { - "description": "Scheme to generate URI to exporter metrics endpoints.", - "type": "string", - "x-order": 5 - }, - "metrics_path": { - "description": "Path under which metrics are exposed, used to generate URI.", - "type": "string", - "x-order": 6 - }, - "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 - } - }, - "x-order": 5 - }, - "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 - }, - "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.", - "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": { - "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 - }, - "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.", - "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 - } - }, - "x-order": 6 - }, - "azure_database_exporter": { - "description": "AzureDatabaseExporter runs on Generic or Container Node and exposes RemoteAzure 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 - }, - "azure_database_subscription_id": { - "description": "Azure database subscription ID.", - "type": "string", - "x-order": 4 - }, - "azure_database_resource_type": { - "type": "string", - "title": "Azure database resource type (mysql, maria, postgres)", - "x-order": 5 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 6 - }, - "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 - }, - "listen_port": { - "description": "Listen port for scraping metrics (the same for several configurations).", - "type": "integer", - "format": "int64", - "x-order": 8 - }, - "push_metrics_enabled": { - "description": "True if the exporter operates in push metrics mode.", - "type": "boolean", - "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 - }, - "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": 12 - } - }, - "x-order": 7 - }, - "qan_mysql_perfschema_agent": { - "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.", - "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", - "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 - } - }, - "x-order": 8 - }, - "qan_mysql_slowlog_agent": { - "description": "QANMySQLSlowlogAgent 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": { - "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 - }, - "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 - }, - "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": 9 - }, - "qan_mongodb_profiler_agent": { - "description": "QANMongoDBProfilerAgent runs within pmm-agent and sends MongoDB 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": "MongoDB username for getting profiler 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 - }, - "max_query_length": { - "description": "Limit query length in QAN (default: server-defined; -1: no limit).", - "type": "integer", - "format": "int32", - "x-order": 7 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "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", - "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": 10 - }, - "qan_mongodb_mongolog_agent": { - "description": "QANMongoDBMongologAgent runs within pmm-agent and sends MongoDB 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": "MongoDB username for getting profiler 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 - }, - "max_query_length": { - "description": "Limit query length in QAN (default: server-defined; -1: no limit).", - "type": "integer", - "format": "int32", - "x-order": 7 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "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", - "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": 11 - }, - "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.", - "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 - }, - "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": 12 - }, - "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": { - "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 monitor 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 - }, - "disable_comments_parsing": { - "description": "Disable parsing comments from queries and showing them in QAN.", - "type": "boolean", - "x-order": 7 - }, - "max_query_length": { - "description": "Limit query length in QAN (default: server-defined; -1: no limit).", - "type": "integer", - "format": "int32", - "x-order": 8 - }, - "query_examples_disabled": { - "description": "True if query examples are disabled.", - "type": "boolean", - "x-order": 9 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "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 - }, - "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" - ], - "x-order": 13 - } - }, - "x-order": 13 - }, - "nomad_agent": { - "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 - }, - "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 - }, - "process_exec_path": { - "description": "Path to exec process.", - "type": "string", - "x-order": 4 - }, - "listen_port": { - "description": "Listen port for scraping metrics.", - "type": "integer", - "format": "int64", - "x-order": 5 - } - }, - "x-order": 14 - }, - "valkey_exporter": { - "description": "ValkeyExporter runs on Generic or Container Node and exposes Valkey 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": "Valkey 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 verification.", - "type": "boolean", - "x-order": 6 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "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 - }, - "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": 11 - }, - "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": 13 - }, - "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 - } - }, - "x-order": 15 - } - } - } - }, - "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 - } - } - } - } - } - }, - "delete": { - "description": "Removes an Agent from Inventory.", - "tags": [ - "AgentsService" - ], - "summary": "Remove an Agent from Inventory", - "operationId": "RemoveAgent", - "parameters": [ - { - "type": "string", - "name": "agent_id", - "in": "path", - "required": true - }, - { - "type": "boolean", - "description": "Remove agent with all dependencies.", - "name": "force", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/inventory/agents/{agent_id}/logs": { - "get": { - "description": "Returns Agent logs by ID.", - "tags": [ - "AgentsService" - ], - "summary": "Get Agent logs", - "operationId": "GetAgentLogs", - "parameters": [ - { - "type": "string", - "description": "Unique randomly generated instance identifier.", - "name": "agent_id", - "in": "path", - "required": true - }, - { - "type": "integer", - "format": "int64", - "description": "Limit the number of log lines to this value. Pass 0 for no limit.", - "name": "limit", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "logs": { - "type": "array", - "items": { - "type": "string" - }, - "x-order": 0 - }, - "agent_config_log_lines_count": { - "type": "integer", - "format": "int64", - "x-order": 1 - } - } - } - }, - "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/inventory/nodes": { - "get": { - "description": "Returns a list of all Nodes.", - "tags": [ - "NodesService" - ], - "summary": "List Nodes", - "operationId": "ListNodes", - "parameters": [ - { - "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" - ], - "type": "string", - "default": "NODE_TYPE_UNSPECIFIED", - "description": "Return only Nodes with matching Node type.", - "name": "node_type", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "generic": { - "type": "array", - "items": { - "description": "GenericNode represents a bare metal server or virtual machine.", - "type": "object", - "properties": { - "node_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "node_name": { - "description": "Unique across all Nodes user-defined name.", - "type": "string", - "x-order": 1 - }, - "address": { - "description": "Node address (DNS name or IP).", - "type": "string", - "x-order": 2 - }, - "machine_id": { - "description": "Linux machine-id.", - "type": "string", - "x-order": 3 - }, - "distro": { - "description": "Linux distribution name and version.", - "type": "string", - "x-order": 4 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 5 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 6 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 7 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 8 - } - } - }, - "x-order": 0 - }, - "container": { - "type": "array", - "items": { - "description": "ContainerNode represents a Docker container.", - "type": "object", - "properties": { - "node_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "node_name": { - "description": "Unique across all Nodes user-defined name.", - "type": "string", - "x-order": 1 - }, - "address": { - "description": "Node address (DNS name or IP).", - "type": "string", - "x-order": 2 - }, - "machine_id": { - "description": "Linux machine-id of the Generic Node where this Container Node runs.", - "type": "string", - "x-order": 3 - }, - "container_id": { - "description": "Container identifier. If specified, must be a unique Docker container identifier.", - "type": "string", - "x-order": 4 - }, - "container_name": { - "description": "Container name.", - "type": "string", - "x-order": 5 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 6 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 7 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 8 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 9 - } - } - }, - "x-order": 1 - }, - "remote": { - "type": "array", - "items": { - "description": "RemoteNode represents generic remote Node. It's a node where we don't run pmm-agents. Only external exporters can run on Remote Nodes.", - "type": "object", - "properties": { - "node_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "node_name": { - "description": "Unique across all Nodes user-defined name.", - "type": "string", - "x-order": 1 - }, - "address": { - "description": "Node address (DNS name or IP).", - "type": "string", - "x-order": 2 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 3 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 4 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 5 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 6 - } - } - }, - "x-order": 2 - }, - "remote_rds": { - "type": "array", - "items": { - "description": "RemoteRDSNode represents remote RDS Node. Agents can't run on Remote RDS Nodes.", - "type": "object", - "properties": { - "node_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "node_name": { - "description": "Unique across all Nodes user-defined name.", - "type": "string", - "x-order": 1 - }, - "address": { - "description": "DB instance identifier.", - "type": "string", - "x-order": 2 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 3 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 4 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 5 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 6 - }, - "instance_id": { - "description": "AWS instance ID.", - "type": "string", - "x-order": 7 - } - } - }, - "x-order": 3 - }, - "remote_azure_database": { - "type": "array", - "items": { - "description": "RemoteAzureDatabaseNode represents remote AzureDatabase Node. Agents can't run on Remote AzureDatabase Nodes.", - "type": "object", - "properties": { - "node_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "node_name": { - "description": "Unique across all Nodes user-defined name.", - "type": "string", - "x-order": 1 - }, - "address": { - "description": "DB instance identifier.", - "type": "string", - "x-order": 2 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 3 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 4 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 5 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 6 - } - } - }, - "x-order": 4 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - }, - "post": { - "description": "Adds a Node.", - "tags": [ - "NodesService" - ], - "summary": "Add a Node", - "operationId": "AddNode", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "generic": { - "type": "object", - "properties": { - "node_name": { - "description": "Unique across all Nodes user-defined name.", - "type": "string", - "x-order": 0 - }, - "address": { - "description": "Node address (DNS name or IP).", - "type": "string", - "x-order": 1 - }, - "machine_id": { - "description": "Linux machine-id.", - "type": "string", - "x-order": 2 - }, - "distro": { - "description": "Linux distribution name and version.", - "type": "string", - "x-order": 3 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 4 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 5 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 6 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 7 - } - }, - "x-order": 0 - }, - "container": { - "type": "object", - "properties": { - "node_name": { - "description": "Unique across all Nodes user-defined name.", - "type": "string", - "x-order": 0 - }, - "address": { - "description": "Node address (DNS name or IP).", - "type": "string", - "x-order": 1 - }, - "machine_id": { - "description": "Linux machine-id of the Generic Node where this Container Node runs.", - "type": "string", - "x-order": 2 - }, - "container_id": { - "description": "Container identifier. If specified, must be a unique Docker container identifier.", - "type": "string", - "x-order": 3 - }, - "container_name": { - "description": "Container name.", - "type": "string", - "x-order": 4 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 5 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 6 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 7 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 8 - } - }, - "x-order": 1 - }, - "remote": { - "type": "object", - "properties": { - "node_name": { - "description": "Unique across all Nodes user-defined name.", - "type": "string", - "x-order": 0 - }, - "address": { - "description": "Node address (DNS name or IP).", - "type": "string", - "x-order": 1 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 2 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 3 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 4 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 5 - } - }, - "x-order": 2 - }, - "remote_rds": { - "type": "object", - "properties": { - "node_name": { - "description": "Unique across all Nodes user-defined name.", - "type": "string", - "x-order": 0 - }, - "address": { - "description": "DB instance identifier.", - "type": "string", - "x-order": 1 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 2 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 3 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 4 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 5 - } - }, - "x-order": 3 - }, - "remote_azure": { - "type": "object", - "properties": { - "node_name": { - "description": "Unique across all Nodes user-defined name.", - "type": "string", - "x-order": 0 - }, - "address": { - "description": "DB instance identifier.", - "type": "string", - "x-order": 1 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 2 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 3 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 4 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 5 - } - }, - "x-order": 4 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "generic": { - "description": "GenericNode represents a bare metal server or virtual machine.", - "type": "object", - "properties": { - "node_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "node_name": { - "description": "Unique across all Nodes user-defined name.", - "type": "string", - "x-order": 1 - }, - "address": { - "description": "Node address (DNS name or IP).", - "type": "string", - "x-order": 2 - }, - "machine_id": { - "description": "Linux machine-id.", - "type": "string", - "x-order": 3 - }, - "distro": { - "description": "Linux distribution name and version.", - "type": "string", - "x-order": 4 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 5 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 6 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 7 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 8 - } - }, - "x-order": 0 - }, - "container": { - "description": "ContainerNode represents a Docker container.", - "type": "object", - "properties": { - "node_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "node_name": { - "description": "Unique across all Nodes user-defined name.", - "type": "string", - "x-order": 1 - }, - "address": { - "description": "Node address (DNS name or IP).", - "type": "string", - "x-order": 2 - }, - "machine_id": { - "description": "Linux machine-id of the Generic Node where this Container Node runs.", - "type": "string", - "x-order": 3 - }, - "container_id": { - "description": "Container identifier. If specified, must be a unique Docker container identifier.", - "type": "string", - "x-order": 4 - }, - "container_name": { - "description": "Container name.", - "type": "string", - "x-order": 5 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 6 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 7 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 8 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 9 - } - }, - "x-order": 1 - }, - "remote": { - "description": "RemoteNode represents generic remote Node. It's a node where we don't run pmm-agents. Only external exporters can run on Remote Nodes.", - "type": "object", - "properties": { - "node_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "node_name": { - "description": "Unique across all Nodes user-defined name.", - "type": "string", - "x-order": 1 - }, - "address": { - "description": "Node address (DNS name or IP).", - "type": "string", - "x-order": 2 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 3 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 4 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 5 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 6 - } - }, - "x-order": 2 - }, - "remote_rds": { - "description": "RemoteRDSNode represents remote RDS Node. Agents can't run on Remote RDS Nodes.", - "type": "object", - "properties": { - "node_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "node_name": { - "description": "Unique across all Nodes user-defined name.", - "type": "string", - "x-order": 1 - }, - "address": { - "description": "DB instance identifier.", - "type": "string", - "x-order": 2 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 3 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 4 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 5 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 6 - }, - "instance_id": { - "description": "AWS instance ID.", - "type": "string", - "x-order": 7 - } - }, - "x-order": 3 - }, - "remote_azure_database": { - "description": "RemoteAzureDatabaseNode represents remote AzureDatabase Node. Agents can't run on Remote AzureDatabase Nodes.", - "type": "object", - "properties": { - "node_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "node_name": { - "description": "Unique across all Nodes user-defined name.", - "type": "string", - "x-order": 1 - }, - "address": { - "description": "DB instance identifier.", - "type": "string", - "x-order": 2 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 3 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 4 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 5 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 6 - } - }, - "x-order": 4 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/inventory/nodes/{node_id}": { - "get": { - "description": "Returns a single Node by ID.", - "tags": [ - "NodesService" - ], - "summary": "Get a Node", - "operationId": "GetNode", - "parameters": [ - { - "type": "string", - "description": "Unique randomly generated instance identifier.", - "name": "node_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "generic": { - "description": "GenericNode represents a bare metal server or virtual machine.", - "type": "object", - "properties": { - "node_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "node_name": { - "description": "Unique across all Nodes user-defined name.", - "type": "string", - "x-order": 1 - }, - "address": { - "description": "Node address (DNS name or IP).", - "type": "string", - "x-order": 2 - }, - "machine_id": { - "description": "Linux machine-id.", - "type": "string", - "x-order": 3 - }, - "distro": { - "description": "Linux distribution name and version.", - "type": "string", - "x-order": 4 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 5 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 6 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 7 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 8 - } - }, - "x-order": 0 - }, - "container": { - "description": "ContainerNode represents a Docker container.", - "type": "object", - "properties": { - "node_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "node_name": { - "description": "Unique across all Nodes user-defined name.", - "type": "string", - "x-order": 1 - }, - "address": { - "description": "Node address (DNS name or IP).", - "type": "string", - "x-order": 2 - }, - "machine_id": { - "description": "Linux machine-id of the Generic Node where this Container Node runs.", - "type": "string", - "x-order": 3 - }, - "container_id": { - "description": "Container identifier. If specified, must be a unique Docker container identifier.", - "type": "string", - "x-order": 4 - }, - "container_name": { - "description": "Container name.", - "type": "string", - "x-order": 5 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 6 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 7 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 8 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 9 - } - }, - "x-order": 1 - }, - "remote": { - "description": "RemoteNode represents generic remote Node. It's a node where we don't run pmm-agents. Only external exporters can run on Remote Nodes.", - "type": "object", - "properties": { - "node_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "node_name": { - "description": "Unique across all Nodes user-defined name.", - "type": "string", - "x-order": 1 - }, - "address": { - "description": "Node address (DNS name or IP).", - "type": "string", - "x-order": 2 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 3 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 4 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 5 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 6 - } - }, - "x-order": 2 - }, - "remote_rds": { - "description": "RemoteRDSNode represents remote RDS Node. Agents can't run on Remote RDS Nodes.", - "type": "object", - "properties": { - "node_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "node_name": { - "description": "Unique across all Nodes user-defined name.", - "type": "string", - "x-order": 1 - }, - "address": { - "description": "DB instance identifier.", - "type": "string", - "x-order": 2 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 3 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 4 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 5 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 6 - }, - "instance_id": { - "description": "AWS instance ID.", - "type": "string", - "x-order": 7 - } - }, - "x-order": 3 - }, - "remote_azure_database": { - "description": "RemoteAzureDatabaseNode represents remote AzureDatabase Node. Agents can't run on Remote AzureDatabase Nodes.", - "type": "object", - "properties": { - "node_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "node_name": { - "description": "Unique across all Nodes user-defined name.", - "type": "string", - "x-order": 1 - }, - "address": { - "description": "DB instance identifier.", - "type": "string", - "x-order": 2 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 3 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 4 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 5 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 6 - } - }, - "x-order": 4 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - }, - "delete": { - "description": "Removes a Node.", - "tags": [ - "NodesService" - ], - "summary": "Remove a Node", - "operationId": "RemoveNode", - "parameters": [ - { - "type": "string", - "description": "Unique randomly generated instance identifier.", - "name": "node_id", - "in": "path", - "required": true - }, - { - "type": "boolean", - "description": "Remove node with all dependencies.", - "name": "force", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/inventory/services": { - "get": { - "description": "Returns a list of Services filtered by type.", - "tags": [ - "ServicesService" - ], - "summary": "List Services", - "operationId": "ListServices", - "parameters": [ - { - "type": "string", - "description": "Return only Services running on that Node.", - "name": "node_id", - "in": "query" - }, - { - "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" - ], - "type": "string", - "default": "SERVICE_TYPE_UNSPECIFIED", - "description": "Return only services filtered by service type.", - "name": "service_type", - "in": "query" - }, - { - "type": "string", - "description": "Return only services in this external group.", - "name": "external_group", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "mysql": { - "type": "array", - "items": { - "description": "MySQLService represents a generic MySQL 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": "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 - }, - "mongodb": { - "type": "array", - "items": { - "description": "MongoDBService represents a generic MongoDB 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": "MongoDB version.", - "type": "string", - "x-order": 10 - } - } - }, - "x-order": 1 - }, - "postgresql": { - "type": "array", - "items": { - "description": "PostgreSQLService represents a generic PostgreSQL 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 - }, - "database_name": { - "description": "Database name.", - "type": "string", - "x-order": 2 - }, - "node_id": { - "description": "Node identifier where this instance runs.", - "type": "string", - "x-order": 3 - }, - "address": { - "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required.", - "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.", - "type": "string", - "x-order": 9 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 10 - }, - "version": { - "description": "PostgreSQL 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": 2 - }, - "proxysql": { - "type": "array", - "items": { - "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": 3 - }, - "haproxy": { - "type": "array", - "items": { - "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.", - "type": "string", - "x-order": 5 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 6 - } - } - }, - "x-order": 4 - }, - "external": { - "type": "array", - "items": { - "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.", - "type": "string", - "x-order": 7 - } - } - }, - "x-order": 5 - }, - "valkey": { - "type": "array", - "items": { - "description": "ValkeyService represents a generic Valkey 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": "Valkey version.", - "type": "string", - "x-order": 10 - } - } - }, - "x-order": 6 - } - } - } - }, - "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 - } - } - } - } - } - }, - "post": { - "description": "Adds a Service.", - "tags": [ - "ServicesService" - ], - "summary": "Add a Service", - "operationId": "AddService", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "mysql": { - "type": "object", - "properties": { - "service_name": { - "description": "Unique across all Services user-defined name. Required.", - "type": "string", - "x-order": 0 - }, - "node_id": { - "description": "Node identifier where this instance runs. Required.", - "type": "string", - "x-order": 1 - }, - "address": { - "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required.", - "type": "string", - "x-order": 2 - }, - "port": { - "description": "Access port.\nPort is required when the address present.", - "type": "integer", - "format": "int64", - "x-order": 3 - }, - "socket": { - "description": "Access unix socket.\nAddress (and port) or socket is required.", - "type": "string", - "x-order": 4 - }, - "environment": { - "description": "Environment name.", - "type": "string", - "x-order": 5 - }, - "cluster": { - "description": "Cluster name.", - "type": "string", - "x-order": 6 - }, - "replication_set": { - "description": "Replication set name.", - "type": "string", - "x-order": 7 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 8 - }, - "extra_dsn_params": { - "description": "Extra parameters to be added to the DSN.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 9 - } - }, - "x-order": 0 - }, - "mongodb": { - "type": "object", - "properties": { - "service_name": { - "description": "Unique across all Services user-defined name. Required.", - "type": "string", - "x-order": 0 - }, - "node_id": { - "description": "Node identifier where this instance runs. Required.", - "type": "string", - "x-order": 1 - }, - "address": { - "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required.", - "type": "string", - "x-order": 2 - }, - "port": { - "description": "Access port.\nPort is required when the address present.", - "type": "integer", - "format": "int64", - "x-order": 3 - }, - "socket": { - "description": "Access unix socket.\nAddress (and port) or socket is required.", - "type": "string", - "x-order": 4 - }, - "environment": { - "description": "Environment name.", - "type": "string", - "x-order": 5 - }, - "cluster": { - "description": "Cluster name.", - "type": "string", - "x-order": 6 - }, - "replication_set": { - "description": "Replication set name.", - "type": "string", - "x-order": 7 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 8 - } - }, - "x-order": 1 - }, - "postgresql": { - "type": "object", - "properties": { - "service_name": { - "description": "Unique across all Services user-defined name. Required.", - "type": "string", - "x-order": 0 - }, - "node_id": { - "description": "Node identifier where this instance runs. Required.", - "type": "string", - "x-order": 1 - }, - "address": { - "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required.", - "type": "string", - "x-order": 2 - }, - "port": { - "description": "Access port.\nPort is required when the address present.", - "type": "integer", - "format": "int64", - "x-order": 3 - }, - "socket": { - "description": "Access unix socket.\nAddress (and port) or socket is required.", - "type": "string", - "x-order": 4 - }, - "environment": { - "description": "Environment name.", - "type": "string", - "x-order": 5 - }, - "cluster": { - "description": "Cluster name.", - "type": "string", - "x-order": 6 - }, - "replication_set": { - "description": "Replication set name.", - "type": "string", - "x-order": 7 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 8 - }, - "auto_discovery_limit": { - "description": "Limit of databases for auto-discovery.", - "type": "integer", - "format": "int32", - "x-order": 9 - } - }, - "x-order": 2 - }, - "proxysql": { - "type": "object", - "properties": { - "service_name": { - "description": "Unique across all Services user-defined name. Required.", - "type": "string", - "x-order": 0 - }, - "node_id": { - "description": "Node identifier where this instance runs. Required.", - "type": "string", - "x-order": 1 - }, - "address": { - "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required.", - "type": "string", - "x-order": 2 - }, - "port": { - "description": "Access port.\nPort is required when the address present.", - "type": "integer", - "format": "int64", - "x-order": 3 - }, - "socket": { - "description": "Access unix socket.\nAddress (and port) or socket is required.", - "type": "string", - "x-order": 4 - }, - "environment": { - "description": "Environment name.", - "type": "string", - "x-order": 5 - }, - "cluster": { - "description": "Cluster name.", - "type": "string", - "x-order": 6 - }, - "replication_set": { - "description": "Replication set name.", - "type": "string", - "x-order": 7 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 8 - } - }, - "x-order": 3 - }, - "haproxy": { - "type": "object", - "properties": { - "service_name": { - "description": "Unique across all Services user-defined name. Required.", - "type": "string", - "x-order": 0 - }, - "node_id": { - "description": "Node identifier where this instance runs. Required.", - "type": "string", - "x-order": 1 - }, - "environment": { - "description": "Environment name.", - "type": "string", - "x-order": 2 - }, - "cluster": { - "description": "Cluster name.", - "type": "string", - "x-order": 3 - }, - "replication_set": { - "description": "Replication set name.", - "type": "string", - "x-order": 4 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 5 - } - }, - "x-order": 4 - }, - "external": { - "type": "object", - "properties": { - "service_name": { - "description": "Unique across all Services user-defined name. Required.", - "type": "string", - "x-order": 0 - }, - "node_id": { - "description": "Node identifier where this instance runs. Required.", - "type": "string", - "x-order": 1 - }, - "environment": { - "description": "Environment name.", - "type": "string", - "x-order": 2 - }, - "cluster": { - "description": "Cluster name.", - "type": "string", - "x-order": 3 - }, - "replication_set": { - "description": "Replication set name.", - "type": "string", - "x-order": 4 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 5 - }, - "group": { - "description": "Group name of external service.", - "type": "string", - "x-order": 6 - } - }, - "x-order": 5 - }, - "valkey": { - "type": "object", - "properties": { - "service_name": { - "description": "Unique across all Services user-defined name. Required.", - "type": "string", - "x-order": 0 - }, - "node_id": { - "description": "Node identifier where this instance runs. Required.", - "type": "string", - "x-order": 1 - }, - "address": { - "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required.", - "type": "string", - "x-order": 2 - }, - "port": { - "description": "Access port.\nPort is required when the address present.", - "type": "integer", - "format": "int64", - "x-order": 3 - }, - "socket": { - "description": "Access unix socket.\nAddress (and port) or socket is required.", - "type": "string", - "x-order": 4 - }, - "environment": { - "description": "Environment name.", - "type": "string", - "x-order": 5 - }, - "cluster": { - "description": "Cluster name.", - "type": "string", - "x-order": 6 - }, - "replication_set": { - "description": "Replication set name.", - "type": "string", - "x-order": 7 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 8 - } - }, - "x-order": 6 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "mysql": { - "description": "MySQLService represents a generic MySQL 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": "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 - }, - "mongodb": { - "description": "MongoDBService represents a generic MongoDB 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": "MongoDB version.", - "type": "string", - "x-order": 10 - } - }, - "x-order": 1 - }, - "postgresql": { - "description": "PostgreSQLService represents a generic PostgreSQL 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 - }, - "database_name": { - "description": "Database name.", - "type": "string", - "x-order": 2 - }, - "node_id": { - "description": "Node identifier where this instance runs.", - "type": "string", - "x-order": 3 - }, - "address": { - "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required.", - "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.", - "type": "string", - "x-order": 9 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 10 - }, - "version": { - "description": "PostgreSQL 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": 2 - }, - "proxysql": { - "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": 3 - }, - "haproxy": { - "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.", - "type": "string", - "x-order": 5 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 6 - } - }, - "x-order": 4 - }, - "external": { - "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.", - "type": "string", - "x-order": 7 - } - }, - "x-order": 5 - }, - "valkey": { - "description": "ValkeyService represents a generic Valkey 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": "Valkey version.", - "type": "string", - "x-order": 10 - } - }, - "x-order": 6 - } - } - } - }, - "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/inventory/services/{service_id}": { - "get": { - "description": "Returns a single Service by ID.", - "tags": [ - "ServicesService" - ], - "summary": "Get a Service", - "operationId": "GetService", - "parameters": [ - { - "type": "string", - "description": "Unique randomly generated instance identifier.", - "name": "service_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "mysql": { - "description": "MySQLService represents a generic MySQL 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": "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 - }, - "mongodb": { - "description": "MongoDBService represents a generic MongoDB 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": "MongoDB version.", - "type": "string", - "x-order": 10 - } - }, - "x-order": 1 - }, - "postgresql": { - "description": "PostgreSQLService represents a generic PostgreSQL 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 - }, - "database_name": { - "description": "Database name.", - "type": "string", - "x-order": 2 - }, - "node_id": { - "description": "Node identifier where this instance runs.", - "type": "string", - "x-order": 3 - }, - "address": { - "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required.", - "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.", - "type": "string", - "x-order": 9 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 10 - }, - "version": { - "description": "PostgreSQL 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": 2 - }, - "proxysql": { - "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": 3 - }, - "haproxy": { - "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.", - "type": "string", - "x-order": 5 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 6 - } - }, - "x-order": 4 - }, - "external": { - "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.", - "type": "string", - "x-order": 7 - } - }, - "x-order": 5 - }, - "valkey": { - "description": "ValkeyService represents a generic Valkey 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": "Valkey version.", - "type": "string", - "x-order": 10 - } - }, - "x-order": 6 - } - } - } - }, - "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 - } - } - } - } - } - }, - "put": { - "description": "Changes service configuration. If a new cluster label is specified, it removes all backup/restore tasks scheduled for the related services. Fails if there are running backup/restore tasks.", - "tags": [ - "ServicesService" - ], - "summary": "Change service", - "operationId": "ChangeService", - "parameters": [ - { - "type": "string", - "name": "service_id", - "in": "path", - "required": true - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "environment": { - "type": "string", - "x-nullable": true, - "x-order": 0 - }, - "cluster": { - "type": "string", - "x-nullable": true, - "x-order": 1 - }, - "replication_set": { - "type": "string", - "x-nullable": true, - "x-order": 2 - }, - "external_group": { - "type": "string", - "x-nullable": true, - "x-order": 3 - }, - "custom_labels": { - "description": "A wrapper for map[string]string. This type allows to distinguish between an empty map and a null value.", - "type": "object", - "properties": { - "values": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 0 - } - }, - "x-nullable": true, - "x-order": 4 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "mysql": { - "description": "MySQLService represents a generic MySQL 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": "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 - }, - "mongodb": { - "description": "MongoDBService represents a generic MongoDB 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": "MongoDB version.", - "type": "string", - "x-order": 10 - } - }, - "x-order": 1 - }, - "postgresql": { - "description": "PostgreSQLService represents a generic PostgreSQL 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 - }, - "database_name": { - "description": "Database name.", - "type": "string", - "x-order": 2 - }, - "node_id": { - "description": "Node identifier where this instance runs.", - "type": "string", - "x-order": 3 - }, - "address": { - "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required.", - "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.", - "type": "string", - "x-order": 9 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 10 - }, - "version": { - "description": "PostgreSQL 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": 2 - }, - "proxysql": { - "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": 3 - }, - "haproxy": { - "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.", - "type": "string", - "x-order": 5 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 6 - } - }, - "x-order": 4 - }, - "external": { - "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.", - "type": "string", - "x-order": 7 - } - }, - "x-order": 5 - }, - "valkey": { - "description": "ValkeyService represents a generic Valkey 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": "Valkey version.", - "type": "string", - "x-order": 10 - } - }, - "x-order": 6 - } - } - } - }, - "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 - } - } - } - } - } - }, - "delete": { - "description": "Removes Service.", - "tags": [ - "ServicesService" - ], - "summary": "Remove Service", - "operationId": "RemoveService", - "parameters": [ - { - "type": "string", - "description": "Unique randomly generated instance identifier. Required.", - "name": "service_id", - "in": "path", - "required": true - }, - { - "type": "boolean", - "description": "Remove service with all dependencies.", - "name": "force", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/inventory/services:getTypes": { - "post": { - "description": "Returns a list of active Service types.", - "tags": [ - "ServicesService" - ], - "summary": "List Active Service Types", - "operationId": "ListActiveServiceTypes", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object" - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "service_types": { - "type": "array", - "items": { - "description": "ServiceType describes supported Service types.", - "type": "string", - "default": "SERVICE_TYPE_UNSPECIFIED", - "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" - ] - }, - "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": { - "get": { - "description": "Lists Agents with filter.", - "tags": [ - "ManagementService" - ], - "summary": "List Agents", - "operationId": "ListAgentsMixin3", - "parameters": [ - { - "type": "string", - "description": "Return only Agents that relate to a specific ServiceID.", - "name": "service_id", - "in": "query" - }, - { - "type": "string", - "description": "Return only Agents that relate to a specific NodeID.", - "name": "node_id", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "agents": { - "description": "List of Agents.", - "type": "array", - "items": { - "type": "object", - "properties": { - "agent_id": { - "description": "Unique agent identifier.", - "type": "string", - "x-order": 0 - }, - "is_agent_password_set": { - "description": "True if the agent password is set.", - "type": "boolean", - "x-order": 1 - }, - "agent_type": { - "description": "Agent type.", - "type": "string", - "x-order": 2 - }, - "aws_access_key": { - "description": "AWS Access Key.", - "type": "string", - "x-order": 3 - }, - "is_aws_secret_key_set": { - "description": "True if AWS Secret Key is set.", - "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", - "format": "date-time", - "x-order": 6 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 7 - }, - "disabled": { - "description": "Desired Agent status: enabled (false) or disabled (true).", - "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": 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", - "format": "int32", - "x-order": 12 - }, - "max_query_log_size": { - "description": "Limit query log size in QAN.", - "type": "string", - "format": "int64", - "x-order": 13 - }, - "metrics_path": { - "description": "Path under which metrics are exposed, used to generate URI.", - "type": "string", - "x-order": 14 - }, - "metrics_scheme": { - "description": "Scheme to generate URI to exporter metrics endpoints.", - "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", - "x-order": 18 - }, - "is_password_set": { - "description": "True if password for connecting the agent to the database is set.", - "type": "boolean", - "x-order": 19 - }, - "pmm_agent_id": { - "description": "The pmm-agent identifier.", - "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", - "x-order": 22 - }, - "push_metrics": { - "description": "True if exporter uses push metrics mode.", - "type": "boolean", - "x-order": 23 - }, - "query_examples_disabled": { - "description": "True if query examples are disabled.", - "type": "boolean", - "x-order": 24 - }, - "comments_parsing_disabled": { - "description": "True if query comments parsing is disabled.", - "type": "boolean", - "x-order": 25 - }, - "rds_basic_metrics_disabled": { - "description": "True if RDS basic metrics are disdabled.", - "type": "boolean", - "x-order": 26 - }, - "rds_enhanced_metrics_disabled": { - "description": "True if RDS enhanced metrics are disdabled.", - "type": "boolean", - "x-order": 27 - }, - "runs_on_node_id": { - "description": "Node identifier where this instance runs.", - "type": "string", - "x-order": 28 - }, - "service_id": { - "description": "Service identifier.", - "type": "string", - "x-order": 29 - }, - "status": { - "description": "Actual Agent status.", - "type": "string", - "x-order": 30 - }, - "table_count": { - "description": "Last known table count.", - "type": "integer", - "format": "int32", - "x-order": 31 - }, - "table_count_tablestats_group_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": 32 - }, - "tls": { - "description": "Use TLS for database connections.", - "type": "boolean", - "x-order": 33 - }, - "tls_skip_verify": { - "description": "Skip TLS certificate and hostname validation.", - "type": "boolean", - "x-order": 34 - }, - "username": { - "description": "HTTP basic auth username for collecting metrics.", - "type": "string", - "x-order": 35 - }, - "updated_at": { - "description": "Last update timestamp.", - "type": "string", - "format": "date-time", - "x-order": 36 - }, - "version": { - "description": "Agent version.", - "type": "string", - "x-order": 37 - }, - "is_connected": { - "description": "True if Agent is running and connected to pmm-managed.", - "type": "boolean", - "x-order": 38 - }, - "expose_exporter": { - "description": "True if an exporter agent is exposed on all host addresses.", - "type": "boolean", - "x-order": 39 - }, - "valkey_options": { - "type": "object", - "x-order": 40 - } - } - }, - "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": 3 - } - } - }, - "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/annotations": { - "post": { - "description": "Adds an annotation.", - "tags": [ - "ManagementService" - ], - "summary": "Add an Annotation", - "operationId": "AddAnnotation", - "parameters": [ - { - "description": "AddAnnotationRequest is a params to add new annotation.", - "name": "body", - "in": "body", - "required": true, - "schema": { - "description": "AddAnnotationRequest is a params to add new annotation.", - "type": "object", - "properties": { - "text": { - "description": "An annotation description. Required.", - "type": "string", - "x-order": 0 - }, - "tags": { - "description": "Tags are used to filter annotations.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 1 - }, - "node_name": { - "description": "Used for annotating a node.", - "type": "string", - "x-order": 2 - }, - "service_names": { - "description": "Used for annotating services.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 3 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/management/nodes": { - "get": { - "description": "Lists Nodes with filter.", - "tags": [ - "ManagementService" - ], - "summary": "List Nodes", - "operationId": "ListNodesMixin3", - "parameters": [ - { - "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" - ], - "type": "string", - "default": "NODE_TYPE_UNSPECIFIED", - "description": "Node type to be filtered out.", - "name": "node_type", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "nodes": { - "type": "array", - "items": { - "type": "object", - "properties": { - "node_id": { - "description": "Unique Node identifier.", - "type": "string", - "x-order": 0 - }, - "node_type": { - "description": "Node type.", - "type": "string", - "x-order": 1 - }, - "node_name": { - "description": "User-defined node name.", - "type": "string", - "x-order": 2 - }, - "machine_id": { - "description": "Linux machine-id.", - "type": "string", - "x-order": 3 - }, - "distro": { - "description": "Linux distribution name and version.", - "type": "string", - "x-order": 4 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 5 - }, - "container_id": { - "description": "A node's unique docker container identifier.", - "type": "string", - "x-order": 6 - }, - "container_name": { - "description": "Container name.", - "type": "string", - "x-order": 7 - }, - "address": { - "description": "Node address (DNS name or IP).", - "type": "string", - "x-order": 8 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 9 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 10 - }, - "custom_labels": { - "description": "Custom user-assigned labels for Node.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 11 - }, - "created_at": { - "description": "Creation timestamp.", - "type": "string", - "format": "date-time", - "x-order": 12 - }, - "updated_at": { - "description": "Last update timestamp.", - "type": "string", - "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", - "items": { - "type": "object", - "properties": { - "agent_id": { - "description": "Unique Agent identifier.", - "type": "string", - "x-order": 0 - }, - "agent_type": { - "description": "Agent type.", - "type": "string", - "x-order": 1 - }, - "status": { - "description": "Actual Agent status.", - "type": "string", - "x-order": 2 - }, - "is_connected": { - "description": "True if Agent is running and connected to pmm-managed.", - "type": "boolean", - "x-order": 3 - } - } - }, - "x-order": 15 - }, - "services": { - "description": "List of services running on this node.", - "type": "array", - "items": { - "description": "Service represents a service running on a node.", - "type": "object", - "properties": { - "service_id": { - "description": "Unique Service identifier.", - "type": "string", - "x-order": 0 - }, - "service_type": { - "description": "Service type.", - "type": "string", - "x-order": 1 - }, - "service_name": { - "description": "Service name.", - "type": "string", - "x-order": 2 - } - } - }, - "x-order": 16 - }, - "instance_id": { - "description": "Instance ID for cloud providers (e.g. AWS RDS).", - "type": "string", - "x-order": 17 - } - } - }, - "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 - } - } - } - } - } - }, - "post": { - "description": "Registers a new Node and a pmm-agent.", - "tags": [ - "ManagementService" - ], - "summary": "Register a Node", - "operationId": "RegisterNode", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "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", - "x-order": 1 - }, - "address": { - "description": "Node address (DNS name or IP).", - "type": "string", - "x-order": 2 - }, - "machine_id": { - "description": "Linux machine-id.", - "type": "string", - "x-order": 3 - }, - "distro": { - "description": "Linux distribution name and version.", - "type": "string", - "x-order": 4 - }, - "container_id": { - "description": "Container identifier. If specified, must be a unique Docker container identifier.", - "type": "string", - "x-order": 5 - }, - "container_name": { - "description": "Container name.", - "type": "string", - "x-order": 6 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 7 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 8 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 9 - }, - "custom_labels": { - "description": "Custom user-assigned labels for Node.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 10 - }, - "reregister": { - "description": "If true, and Node with that name already exist, it will be removed with all dependent Services and Agents.", - "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", - "items": { - "type": "string" - }, - "x-order": 13 - }, - "agent_password": { - "description": "Custom password for exporter endpoint /metrics.", - "type": "string", - "x-order": 14 - }, - "expose_exporter": { - "type": "boolean", - "title": "Optionally expose the exporter process on all public interfaces", - "x-order": 15 - }, - "instance_id": { - "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", - "x-order": 0 - }, - "node_name": { - "description": "Unique across all Nodes user-defined name.", - "type": "string", - "x-order": 1 - }, - "address": { - "description": "Node address (DNS name or IP).", - "type": "string", - "x-order": 2 - }, - "machine_id": { - "description": "Linux machine-id.", - "type": "string", - "x-order": 3 - }, - "distro": { - "description": "Linux distribution name and version.", - "type": "string", - "x-order": 4 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 5 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 6 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 7 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 8 - } - }, - "x-order": 0 - }, - "container_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": { - "description": "Unique across all Nodes user-defined name.", - "type": "string", - "x-order": 1 - }, - "address": { - "description": "Node address (DNS name or IP).", - "type": "string", - "x-order": 2 - }, - "machine_id": { - "description": "Linux machine-id of the Generic Node where this Container Node runs.", - "type": "string", - "x-order": 3 - }, - "container_id": { - "description": "Container identifier. If specified, must be a unique Docker container identifier.", - "type": "string", - "x-order": 4 - }, - "container_name": { - "description": "Container name.", - "type": "string", - "x-order": 5 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 6 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 7 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 8 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 9 - } - }, - "x-order": 1 - }, - "pmm_agent": { - "description": "PMMAgent runs on Generic or Container Node.", - "type": "object", - "properties": { - "agent_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "runs_on_node_id": { - "description": "Node identifier where this instance runs.", - "type": "string", - "x-order": 1 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 2 - }, - "connected": { - "description": "True if Agent is running and connected to pmm-managed.", - "type": "boolean", - "x-order": 3 - }, - "process_exec_path": { - "description": "Path to exec process.", - "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 - } - } - } - }, - "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/nodes/{node_id}": { - "get": { - "description": "Gets a single Node by ID.", - "tags": [ - "ManagementService" - ], - "summary": "Get Node", - "operationId": "GetNodeMixin3", - "parameters": [ - { - "type": "string", - "description": "Unique Node identifier.", - "name": "node_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "node": { - "type": "object", - "properties": { - "node_id": { - "description": "Unique Node identifier.", - "type": "string", - "x-order": 0 - }, - "node_type": { - "description": "Node type.", - "type": "string", - "x-order": 1 - }, - "node_name": { - "description": "User-defined node name.", - "type": "string", - "x-order": 2 - }, - "machine_id": { - "description": "Linux machine-id.", - "type": "string", - "x-order": 3 - }, - "distro": { - "description": "Linux distribution name and version.", - "type": "string", - "x-order": 4 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 5 - }, - "container_id": { - "description": "A node's unique docker container identifier.", - "type": "string", - "x-order": 6 - }, - "container_name": { - "description": "Container name.", - "type": "string", - "x-order": 7 - }, - "address": { - "description": "Node address (DNS name or IP).", - "type": "string", - "x-order": 8 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 9 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 10 - }, - "custom_labels": { - "description": "Custom user-assigned labels for Node.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 11 - }, - "created_at": { - "description": "Creation timestamp.", - "type": "string", - "format": "date-time", - "x-order": 12 - }, - "updated_at": { - "description": "Last update timestamp.", - "type": "string", - "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", - "items": { - "type": "object", - "properties": { - "agent_id": { - "description": "Unique Agent identifier.", - "type": "string", - "x-order": 0 - }, - "agent_type": { - "description": "Agent type.", - "type": "string", - "x-order": 1 - }, - "status": { - "description": "Actual Agent status.", - "type": "string", - "x-order": 2 - }, - "is_connected": { - "description": "True if Agent is running and connected to pmm-managed.", - "type": "boolean", - "x-order": 3 - } - } - }, - "x-order": 15 - }, - "services": { - "description": "List of services running on this node.", - "type": "array", - "items": { - "description": "Service represents a service running on a node.", - "type": "object", - "properties": { - "service_id": { - "description": "Unique Service identifier.", - "type": "string", - "x-order": 0 - }, - "service_type": { - "description": "Service type.", - "type": "string", - "x-order": 1 - }, - "service_name": { - "description": "Service name.", - "type": "string", - "x-order": 2 - } - } - }, - "x-order": 16 - }, - "instance_id": { - "description": "Instance ID for cloud providers (e.g. AWS RDS).", - "type": "string", - "x-order": 17 - } - }, - "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 - } - } - } - } - } - }, - "delete": { - "description": "Unregisters a Node and pmm-agent", - "tags": [ - "ManagementService" - ], - "summary": "Unregister a Node", - "operationId": "UnregisterNode", - "parameters": [ - { - "type": "string", - "description": "Node_id to be unregistered.", - "name": "node_id", - "in": "path", - "required": true - }, - { - "type": "boolean", - "description": "Force delete node, related service account, even if it has more service tokens attached.", - "name": "force", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "warning": { - "description": "Warning message if there are more service tokens attached to service account.", - "type": "string", - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/management/services": { - "get": { - "description": "Returns a filtered list of Services.", - "tags": [ - "ManagementService" - ], - "summary": "List Services", - "operationId": "ListServicesMixin3", - "parameters": [ - { - "type": "string", - "description": "Return only Services running on that Node.", - "name": "node_id", - "in": "query" - }, - { - "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" - ], - "type": "string", - "default": "SERVICE_TYPE_UNSPECIFIED", - "description": "Return only services filtered by service type.", - "name": "service_type", - "in": "query" - }, - { - "type": "string", - "description": "Return only services in this external group.", - "name": "external_group", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "services": { - "description": "List of Services.", - "type": "array", - "items": { - "type": "object", - "properties": { - "service_id": { - "description": "Unique service identifier.", - "type": "string", - "x-order": 0 - }, - "service_type": { - "description": "Service type.", - "type": "string", - "x-order": 1 - }, - "service_name": { - "description": "User-defined name unique across all Services.", - "type": "string", - "x-order": 2 - }, - "database_name": { - "description": "Database name.", - "type": "string", - "x-order": 3 - }, - "node_id": { - "description": "Node identifier where this instance runs.", - "type": "string", - "x-order": 4 - }, - "node_name": { - "description": "Node name where this instance runs.", - "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 for Service.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 9 - }, - "external_group": { - "description": "External group name.", - "type": "string", - "x-order": 10 - }, - "address": { - "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required.", - "type": "string", - "x-order": 11 - }, - "port": { - "description": "Access port.\nPort is required when the address present.", - "type": "integer", - "format": "int64", - "x-order": 12 - }, - "socket": { - "description": "Access unix socket.\nAddress (and port) or socket is required.", - "type": "string", - "x-order": 13 - }, - "created_at": { - "description": "Creation timestamp.", - "type": "string", - "format": "date-time", - "x-order": 14 - }, - "updated_at": { - "description": "Last update timestamp.", - "type": "string", - "format": "date-time", - "x-order": 15 - }, - "agents": { - "description": "List of agents related to this service.", - "type": "array", - "items": { - "type": "object", - "properties": { - "agent_id": { - "description": "Unique agent identifier.", - "type": "string", - "x-order": 0 - }, - "is_agent_password_set": { - "description": "True if the agent password is set.", - "type": "boolean", - "x-order": 1 - }, - "agent_type": { - "description": "Agent type.", - "type": "string", - "x-order": 2 - }, - "aws_access_key": { - "description": "AWS Access Key.", - "type": "string", - "x-order": 3 - }, - "is_aws_secret_key_set": { - "description": "True if AWS Secret Key is set.", - "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", - "format": "date-time", - "x-order": 6 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 7 - }, - "disabled": { - "description": "Desired Agent status: enabled (false) or disabled (true).", - "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": 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", - "format": "int32", - "x-order": 12 - }, - "max_query_log_size": { - "description": "Limit query log size in QAN.", - "type": "string", - "format": "int64", - "x-order": 13 - }, - "metrics_path": { - "description": "Path under which metrics are exposed, used to generate URI.", - "type": "string", - "x-order": 14 - }, - "metrics_scheme": { - "description": "Scheme to generate URI to exporter metrics endpoints.", - "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", - "x-order": 18 - }, - "is_password_set": { - "description": "True if password for connecting the agent to the database is set.", - "type": "boolean", - "x-order": 19 - }, - "pmm_agent_id": { - "description": "The pmm-agent identifier.", - "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", - "x-order": 22 - }, - "push_metrics": { - "description": "True if exporter uses push metrics mode.", - "type": "boolean", - "x-order": 23 - }, - "query_examples_disabled": { - "description": "True if query examples are disabled.", - "type": "boolean", - "x-order": 24 - }, - "comments_parsing_disabled": { - "description": "True if query comments parsing is disabled.", - "type": "boolean", - "x-order": 25 - }, - "rds_basic_metrics_disabled": { - "description": "True if RDS basic metrics are disdabled.", - "type": "boolean", - "x-order": 26 - }, - "rds_enhanced_metrics_disabled": { - "description": "True if RDS enhanced metrics are disdabled.", - "type": "boolean", - "x-order": 27 - }, - "runs_on_node_id": { - "description": "Node identifier where this instance runs.", - "type": "string", - "x-order": 28 - }, - "service_id": { - "description": "Service identifier.", - "type": "string", - "x-order": 29 - }, - "status": { - "description": "Actual Agent status.", - "type": "string", - "x-order": 30 - }, - "table_count": { - "description": "Last known table count.", - "type": "integer", - "format": "int32", - "x-order": 31 - }, - "table_count_tablestats_group_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": 32 - }, - "tls": { - "description": "Use TLS for database connections.", - "type": "boolean", - "x-order": 33 - }, - "tls_skip_verify": { - "description": "Skip TLS certificate and hostname validation.", - "type": "boolean", - "x-order": 34 - }, - "username": { - "description": "HTTP basic auth username for collecting metrics.", - "type": "string", - "x-order": 35 - }, - "updated_at": { - "description": "Last update timestamp.", - "type": "string", - "format": "date-time", - "x-order": 36 - }, - "version": { - "description": "Agent version.", - "type": "string", - "x-order": 37 - }, - "is_connected": { - "description": "True if Agent is running and connected to pmm-managed.", - "type": "boolean", - "x-order": 38 - }, - "expose_exporter": { - "description": "True if an exporter agent is exposed on all host addresses.", - "type": "boolean", - "x-order": 39 - }, - "valkey_options": { - "type": "object", - "x-order": 40 - } - } - }, - "x-order": 16 - }, - "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", - "default": "STATUS_UNSPECIFIED", - "enum": [ - "STATUS_UNSPECIFIED", - "STATUS_UP", - "STATUS_DOWN", - "STATUS_UNKNOWN" - ], - "x-order": 17 - }, - "version": { - "description": "The service/database version.", - "type": "string", - "x-order": 18 - } - } - }, - "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 - } - } - } - } - } - }, - "post": { - "description": "Adds a service and starts several agents.", - "tags": [ - "ManagementService" - ], - "summary": "Add a Service", - "operationId": "AddServiceMixin3", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "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 - }, - "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.", - "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", - "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 - }, - "environment": { - "description": "Environment name.", - "type": "string", - "x-order": 8 - }, - "cluster": { - "description": "Cluster name.", - "type": "string", - "x-order": 9 - }, - "replication_set": { - "description": "Replication set name.", - "type": "string", - "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.", - "type": "object", - "additionalProperties": { - "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 - }, - "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.", - "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", - "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 - }, - "environment": { - "description": "Environment name.", - "type": "string", - "x-order": 8 - }, - "cluster": { - "description": "Cluster name.", - "type": "string", - "x-order": 9 - }, - "replication_set": { - "description": "Replication set name.", - "type": "string", - "x-order": 10 - }, - "username": { - "description": "MongoDB username for exporter and QAN agent access.", - "type": "string", - "x-order": 11 - }, - "password": { - "description": "MongoDB password for exporter and QAN agent access.", - "type": "string", - "x-order": 12 - }, - "qan_mongodb_profiler": { - "description": "If true, adds qan-mongodb-profiler-agent for provided service.", - "type": "boolean", - "x-order": 13 - }, - "qan_mongodb_mongolog": { - "description": "If true, adds qan-mongodb-mongolog-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": 15 - }, - "skip_connection_check": { - "description": "Skip connection check.", - "type": "boolean", - "x-order": 16 - }, - "tls": { - "description": "Use TLS for database connections.", - "type": "boolean", - "x-order": 17 - }, - "tls_skip_verify": { - "description": "Skip TLS certificate and hostname validation.", - "type": "boolean", - "x-order": 18 - }, - "tls_certificate_key": { - "description": "Client certificate and key.", - "type": "string", - "x-order": 19 - }, - "tls_certificate_key_file_password": { - "description": "Password for decrypting tls_certificate_key.", - "type": "string", - "x-order": 20 - }, - "tls_ca": { - "description": "Certificate Authority certificate chain.", - "type": "string", - "x-order": 21 - }, - "max_query_length": { - "description": "Limit query length in QAN (default: server-defined; -1: no limit).", - "type": "integer", - "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", - "items": { - "type": "string" - }, - "x-order": 24 - }, - "authentication_mechanism": { - "description": "Authentication mechanism.\nSee https://docs.mongodb.com/manual/reference/connection-string/#mongodb-urioption-urioption.authMechanism\nfor details.", - "type": "string", - "x-order": 25 - }, - "authentication_database": { - "description": "Authentication database.", - "type": "string", - "x-order": 26 - }, - "agent_password": { - "description": "Custom password for exporter endpoint /metrics.", - "type": "string", - "x-order": 27 - }, - "stats_collections": { - "description": "List of collections to get stats from. Can use * .", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 28 - }, - "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", - "x-order": 29 - }, - "enable_all_collectors": { - "type": "boolean", - "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", - "x-order": 32 - } - }, - "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", - "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.", - "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", - "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 - }, - "pmm_agent_id": { - "description": "The \"pmm-agent\" identifier which should run agents. Required.", - "type": "string", - "x-order": 8 - }, - "environment": { - "description": "Environment name.", - "type": "string", - "x-order": 9 - }, - "cluster": { - "description": "Cluster name.", - "type": "string", - "x-order": 10 - }, - "replication_set": { - "description": "Replication set name.", - "type": "string", - "x-order": 11 - }, - "username": { - "description": "PostgreSQL username for scraping metrics.", - "type": "string", - "x-order": 12 - }, - "password": { - "description": "PostgreSQL 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 - }, - "custom_labels": { - "description": "Custom user-assigned labels for Service.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 18 - }, - "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 - }, - "tls": { - "description": "Use TLS for database connections.", - "type": "boolean", - "x-order": 21 - }, - "tls_skip_verify": { - "description": "Skip TLS certificate and hostname validation. Uses sslmode=required instead of verify-full.", - "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", - "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" - }, - "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": 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", - "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", - "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.", - "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", - "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 - }, - "environment": { - "description": "Environment name.", - "type": "string", - "x-order": 8 - }, - "cluster": { - "description": "Cluster name.", - "type": "string", - "x-order": 9 - }, - "replication_set": { - "description": "Replication set name.", - "type": "string", - "x-order": 10 - }, - "username": { - "description": "ProxySQL username for scraping metrics.", - "type": "string", - "x-order": 11 - }, - "password": { - "description": "ProxySQL password for scraping metrics.", - "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 database connections.", - "type": "boolean", - "x-order": 15 - }, - "tls_skip_verify": { - "description": "Skip TLS certificate and hostname validation.", - "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 - }, - "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": 19 - }, - "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": 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 - }, - "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", - "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 - }, - "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 - }, - "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 - }, - "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.", - "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 - }, - "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 - }, - "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": 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", - "properties": { - "region": { - "description": "AWS region.", - "type": "string", - "x-order": 0 - }, - "az": { - "description": "AWS availability zone.", - "type": "string", - "x-order": 1 - }, - "instance_id": { - "description": "AWS instance ID.", - "type": "string", - "x-order": 2 - }, - "node_model": { - "description": "AWS instance class.", - "type": "string", - "x-order": 3 - }, - "address": { - "description": "Address used to connect to it.", - "type": "string", - "x-order": 4 - }, - "port": { - "description": "Access port.", - "type": "integer", - "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", - "x-order": 7 - }, - "node_name": { - "description": "Unique across all Nodes user-defined name. Defaults to AWS instance ID.", - "type": "string", - "x-order": 8 - }, - "service_name": { - "description": "Unique across all Services user-defined name. Defaults to AWS instance ID.", - "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 - }, - "username": { - "description": "Username for scraping metrics.", - "type": "string", - "x-order": 13 - }, - "password": { - "description": "Password for scraping metrics.", - "type": "string", - "x-order": 14 - }, - "aws_access_key": { - "description": "AWS Access key.", - "type": "string", - "x-order": 15 - }, - "aws_secret_key": { - "description": "AWS Secret key.", - "type": "string", - "x-order": 16 - }, - "rds_exporter": { - "description": "If true, adds rds_exporter.", - "type": "boolean", - "x-order": 17 - }, - "qan_mysql_perfschema": { - "description": "If true, adds qan-mysql-perfschema-agent.", - "type": "boolean", - "x-order": 18 - }, - "custom_labels": { - "description": "Custom user-assigned labels for Node and Service.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 19 - }, - "skip_connection_check": { - "description": "Skip connection check.", - "type": "boolean", - "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 - }, - "disable_query_examples": { - "description": "Disable query examples.", - "type": "boolean", - "x-order": 23 - }, - "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": 24 - }, - "disable_basic_metrics": { - "description": "Disable basic metrics.", - "type": "boolean", - "x-order": 25 - }, - "disable_enhanced_metrics": { - "description": "Disable enhanced metrics.", - "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", - "x-order": 28 - }, - "agent_password": { - "description": "Custom password for exporter endpoint /metrics.", - "type": "string", - "x-order": 29 - }, - "database": { - "description": "Database name.", - "type": "string", - "x-order": 30 - }, - "auto_discovery_limit": { - "description": "Limit of databases for auto-discovery.", - "type": "integer", - "format": "int32", - "x-order": 31 - }, - "disable_comments_parsing": { - "description": "Disable parsing comments from queries and showing them in QAN.", - "type": "boolean", - "x-order": 32 - }, - "max_postgresql_exporter_connections": { - "description": "Maximum number of exporter connections to PostgreSQL instance.", - "type": "integer", - "format": "int32", - "x-order": 33 - } - }, - "x-order": 6 - }, - "valkey": { - "type": "object", - "properties": { - "node_id": { - "description": "Node identifier on which the service is running.\nOnly 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 running.\nOnly 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": "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", - "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", - "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 - } - }, - "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.", - "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": "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 - }, - "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", - "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": 1 - }, - "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.", - "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", - "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 - } - }, - "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": { - "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": { - "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 - }, - "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 - }, - "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.", - "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": "MongoDB version.", - "type": "string", - "x-order": 10 - } - }, - "x-order": 0 - }, - "mongodb_exporter": { - "description": "MongoDBExporter runs on Generic or Container Node and exposes MongoDB 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": "MongoDB 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": 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 - }, - "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": 11 - }, - "stats_collections": { - "type": "array", - "title": "List of colletions to get stats from. Can use *", - "items": { - "type": "string" - }, - "x-order": 12 - }, - "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", - "x-order": 13 - }, - "enable_all_collectors": { - "description": "Enable All collectors.", - "type": "boolean", - "x-order": 14 - }, - "process_exec_path": { - "description": "Path to exec process.", - "type": "string", - "x-order": 15 - }, - "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 - }, - "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.", - "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": 18 - } - }, - "x-order": 1 - }, - "qan_mongodb_profiler": { - "description": "QANMongoDBProfilerAgent runs within pmm-agent and sends MongoDB 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": "MongoDB username for getting profiler 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 - }, - "max_query_length": { - "description": "Limit query length in QAN (default: server-defined; -1: no limit).", - "type": "integer", - "format": "int32", - "x-order": 7 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "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", - "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": 2 - }, - "qan_mongodb_mongolog": { - "description": "QANMongoDBMongologAgent runs within pmm-agent and sends MongoDB 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": "MongoDB username for getting profiler 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 - }, - "max_query_length": { - "description": "Limit query length in QAN (default: server-defined; -1: no limit).", - "type": "integer", - "format": "int32", - "x-order": 7 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "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", - "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 - } - }, - "x-order": 1 - }, - "postgresql": { - "type": "object", - "properties": { - "service": { - "description": "PostgreSQLService represents a generic PostgreSQL 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 - }, - "database_name": { - "description": "Database name.", - "type": "string", - "x-order": 2 - }, - "node_id": { - "description": "Node identifier where this instance runs.", - "type": "string", - "x-order": 3 - }, - "address": { - "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required.", - "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.", - "type": "string", - "x-order": 9 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 10 - }, - "version": { - "description": "PostgreSQL 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": 0 - }, - "postgres_exporter": { - "description": "PostgresExporter runs on Generic or Container Node and exposes PostgreSQL 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": "PostgreSQL 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. Uses sslmode=required instead of verify-full.", - "type": "boolean", - "x-order": 6 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "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 - }, - "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": 11 - }, - "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" - ], - "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 - } - }, - "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.", - "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 - }, - "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_postgresql_pgstatmonitor_agent": { - "description": "QANPostgreSQLPgStatMonitorAgent 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 monitor 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 - }, - "disable_comments_parsing": { - "description": "Disable parsing comments from queries and showing them in QAN.", - "type": "boolean", - "x-order": 7 - }, - "max_query_length": { - "description": "Limit query length in QAN (default: server-defined; -1: no limit).", - "type": "integer", - "format": "int32", - "x-order": 8 - }, - "query_examples_disabled": { - "description": "True if query examples are disabled.", - "type": "boolean", - "x-order": 9 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "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 - }, - "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" - ], - "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 - }, - "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": 0 - }, - "proxysql_exporter": { - "description": "ProxySQLExporter runs on Generic or Container Node and exposes ProxySQL 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": "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": 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 - }, - "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": 11 - }, - "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" - ], - "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.", - "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": "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.", - "type": "string", - "x-order": 5 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 6 - } - }, - "x-order": 0 - }, - "external_exporter": { - "description": "ExternalExporter runs on any Node type, including Remote Node.", - "type": "object", - "properties": { - "agent_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "runs_on_node_id": { - "description": "Node identifier where this instance runs.", - "type": "string", - "x-order": 1 - }, - "disabled": { - "description": "If disabled, metrics from this exporter will not be collected.", - "type": "boolean", - "x-order": 2 - }, - "service_id": { - "description": "Service identifier.", - "type": "string", - "x-order": 3 - }, - "username": { - "description": "HTTP basic auth username for collecting metrics.", - "type": "string", - "x-order": 4 - }, - "scheme": { - "description": "Scheme to generate URI to exporter metrics endpoints.", - "type": "string", - "x-order": 5 - }, - "metrics_path": { - "description": "Path under which metrics are exposed, used to generate URI.", - "type": "string", - "x-order": 6 - }, - "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 - } - }, - "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.", - "type": "string", - "x-order": 7 - } - }, - "x-order": 0 - }, - "external_exporter": { - "description": "ExternalExporter runs on any Node type, including Remote Node.", - "type": "object", - "properties": { - "agent_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "runs_on_node_id": { - "description": "Node identifier where this instance runs.", - "type": "string", - "x-order": 1 - }, - "disabled": { - "description": "If disabled, metrics from this exporter will not be collected.", - "type": "boolean", - "x-order": 2 - }, - "service_id": { - "description": "Service identifier.", - "type": "string", - "x-order": 3 - }, - "username": { - "description": "HTTP basic auth username for collecting metrics.", - "type": "string", - "x-order": 4 - }, - "scheme": { - "description": "Scheme to generate URI to exporter metrics endpoints.", - "type": "string", - "x-order": 5 - }, - "metrics_path": { - "description": "Path under which metrics are exposed, used to generate URI.", - "type": "string", - "x-order": 6 - }, - "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 - } - }, - "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": { - "node_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "node_name": { - "description": "Unique across all Nodes user-defined name.", - "type": "string", - "x-order": 1 - }, - "address": { - "description": "DB instance identifier.", - "type": "string", - "x-order": 2 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 3 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 4 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 5 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 6 - }, - "instance_id": { - "description": "AWS instance ID.", - "type": "string", - "x-order": 7 - } - }, - "x-order": 0 - }, - "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 - }, - "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.", - "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": { - "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 - }, - "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.", - "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 - } - }, - "x-order": 1 - }, - "mysql": { - "description": "MySQLService represents a generic MySQL 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": "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": 2 - }, - "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", - "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 - }, - "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", - "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 - } - }, - "x-order": 4 - }, - "postgresql": { - "description": "PostgreSQLService represents a generic PostgreSQL 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 - }, - "database_name": { - "description": "Database name.", - "type": "string", - "x-order": 2 - }, - "node_id": { - "description": "Node identifier where this instance runs.", - "type": "string", - "x-order": 3 - }, - "address": { - "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required.", - "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.", - "type": "string", - "x-order": 9 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 10 - }, - "version": { - "description": "PostgreSQL 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": 5 - }, - "postgresql_exporter": { - "description": "PostgresExporter runs on Generic or Container Node and exposes PostgreSQL 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": "PostgreSQL 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. Uses sslmode=required instead of verify-full.", - "type": "boolean", - "x-order": 6 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "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 - }, - "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": 11 - }, - "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" - ], - "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 - } - }, - "x-order": 6 - }, - "qan_postgresql_pgstatements": { - "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.", - "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 - }, - "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": 7 - } - }, - "x-order": 6 - }, - "valkey": { - "type": "object", - "properties": { - "service": { - "description": "ValkeyService represents a generic Valkey 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": "Valkey version.", - "type": "string", - "x-order": 10 - } - }, - "x-order": 0 - }, - "valkey_exporter": { - "description": "ValkeyExporter runs on Generic or Container Node and exposes Valkey 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": "Valkey 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 verification.", - "type": "boolean", - "x-order": 6 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "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 - }, - "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": 11 - }, - "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": 13 - }, - "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 - } - }, - "x-order": 1 - } - }, - "x-order": 7 - } - } - } - }, - "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/azure": { - "post": { - "description": "Adds an Azure Database instance.", - "tags": [ - "ManagementService" - ], - "summary": "Add Azure Database", - "operationId": "AddAzureDatabase", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "region": { - "description": "Azure database location.", - "type": "string", - "x-order": 0 - }, - "az": { - "description": "Azure database availability zone.", - "type": "string", - "x-order": 1 - }, - "instance_id": { - "description": "Azure database instance ID.", - "type": "string", - "x-order": 2 - }, - "node_model": { - "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": 3 - }, - "address": { - "description": "Address used to connect to it.", - "type": "string", - "x-order": 4 - }, - "port": { - "description": "Access port.", - "type": "integer", - "format": "int64", - "x-order": 5 - }, - "node_name": { - "description": "Unique across all Nodes user-defined name. Defaults to Azure Database instance ID.", - "type": "string", - "x-order": 6 - }, - "service_name": { - "description": "Unique across all Services user-defined name. Defaults to Azure Database instance ID.", - "type": "string", - "x-order": 7 - }, - "environment": { - "description": "Environment name.", - "type": "string", - "x-order": 8 - }, - "username": { - "description": "Username for scraping metrics.", - "type": "string", - "x-order": 9 - }, - "password": { - "description": "Password for scraping metrics.", - "type": "string", - "x-order": 10 - }, - "azure_client_id": { - "description": "Azure client ID.", - "type": "string", - "x-order": 11 - }, - "azure_client_secret": { - "description": "Azure client secret.", - "type": "string", - "x-order": 12 - }, - "azure_tenant_id": { - "description": "Azure tanant ID.", - "type": "string", - "x-order": 13 - }, - "azure_subscription_id": { - "description": "Azure subscription ID.", - "type": "string", - "x-order": 14 - }, - "azure_resource_group": { - "description": "Azure resource group.", - "type": "string", - "x-order": 15 - }, - "azure_database_exporter": { - "description": "If true, adds azure_database_exporter.", - "type": "boolean", - "x-order": 16 - }, - "qan": { - "description": "If true, adds qan-mysql-perfschema-agent or qan-postgresql-pgstatements-agent.", - "type": "boolean", - "x-order": 17 - }, - "custom_labels": { - "description": "Custom user-assigned labels for Node and Service.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 18 - }, - "skip_connection_check": { - "description": "Skip connection check.", - "type": "boolean", - "x-order": 19 - }, - "tls": { - "description": "Use TLS for database connections.", - "type": "boolean", - "x-order": 20 - }, - "tls_skip_verify": { - "description": "Skip TLS certificate and hostname validation.", - "type": "boolean", - "x-order": 21 - }, - "disable_query_examples": { - "description": "Disable query examples.", - "type": "boolean", - "x-order": 22 - }, - "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": 23 - }, - "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": 24 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/management/services/{service_id}": { - "delete": { - "description": "Removes a Service along with its Agents.", - "tags": [ - "ManagementService" - ], - "summary": "Remove a Service", - "operationId": "RemoveServiceMixin3", - "parameters": [ - { - "type": "string", - "description": "Either a Service ID or a Service Name.", - "name": "service_id", - "in": "path", - "required": true - }, - { - "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" - ], - "type": "string", - "default": "SERVICE_TYPE_UNSPECIFIED", - "description": "Service type.", - "name": "service_type", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/management/services:discoverAzure": { - "post": { - "description": "Discovers Azure Database for MySQL, MariaDB and PostgreSQL Server instances.", - "tags": [ - "ManagementService" - ], - "summary": "Discover Azure Database", - "operationId": "DiscoverAzureDatabase", - "parameters": [ - { - "description": "DiscoverAzureDatabaseRequest discover azure databases request.", - "name": "body", - "in": "body", - "required": true, - "schema": { - "description": "DiscoverAzureDatabaseRequest discover azure databases request.", - "type": "object", - "properties": { - "azure_client_id": { - "description": "Azure client ID.", - "type": "string", - "x-order": 0 - }, - "azure_client_secret": { - "description": "Azure client secret.", - "type": "string", - "x-order": 1 - }, - "azure_tenant_id": { - "description": "Azure tanant ID.", - "type": "string", - "x-order": 2 - }, - "azure_subscription_id": { - "description": "Azure subscription ID.", - "type": "string", - "x-order": 3 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "description": "DiscoverAzureDatabaseResponse discover azure databases response.", - "type": "object", - "properties": { - "azure_database_instance": { - "type": "array", - "items": { - "description": "DiscoverAzureDatabaseInstance models an unique Azure Database instance for the list of instances returned by Discovery.", - "type": "object", - "properties": { - "instance_id": { - "description": "Azure database instance ID.", - "type": "string", - "x-order": 0 - }, - "region": { - "description": "Azure database location.", - "type": "string", - "x-order": 1 - }, - "service_name": { - "description": "Azure database server name.", - "type": "string", - "x-order": 2 - }, - "username": { - "description": "Database username.", - "type": "string", - "x-order": 3 - }, - "address": { - "description": "Address used to connect to it.", - "type": "string", - "x-order": 4 - }, - "azure_resource_group": { - "description": "Azure Resource group.", - "type": "string", - "x-order": 5 - }, - "environment": { - "description": "Environment tag.", - "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", - "x-order": 8 - }, - "node_model": { - "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 - } - } - }, - "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/services:discoverRDS": { - "post": { - "description": "Discovers RDS instances.", - "tags": [ - "ManagementService" - ], - "summary": "Discover RDS", - "operationId": "DiscoverRDS", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "aws_access_key": { - "description": "AWS Access key. Optional.", - "type": "string", - "x-order": 0 - }, - "aws_secret_key": { - "description": "AWS Secret key. Optional.", - "type": "string", - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "rds_instances": { - "type": "array", - "items": { - "description": "DiscoverRDSInstance models an unique RDS instance for the list of instances returned by Discovery.", - "type": "object", - "properties": { - "region": { - "description": "AWS region.", - "type": "string", - "x-order": 0 - }, - "az": { - "description": "AWS availability zone.", - "type": "string", - "x-order": 1 - }, - "instance_id": { - "description": "AWS instance ID.", - "type": "string", - "x-order": 2 - }, - "node_model": { - "description": "AWS instance class.", - "type": "string", - "x-order": 3 - }, - "address": { - "description": "Address used to connect to it.", - "type": "string", - "x-order": 4 - }, - "port": { - "description": "Access port.", - "type": "integer", - "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 - }, - "engine_version": { - "description": "Engine version.", - "type": "string", - "x-order": 7 - } - } - }, - "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/platform/contact": { - "get": { - "description": "Fetch the contact details of the customer success employee handling the Percona customer account.", - "tags": [ - "PlatformService" - ], - "summary": "Get Contact Information", - "operationId": "GetContactInformation", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "customer_success": { - "description": "CustomerSuccess contains the contanct details of the customer success employee assigned to a customer's account.", - "type": "object", - "properties": { - "name": { - "type": "string", - "x-order": 0 - }, - "email": { - "type": "string", - "x-order": 1 - } - }, - "x-order": 0 - }, - "new_ticket_url": { - "description": "URL to open a new support ticket.", - "type": "string", - "x-order": 1 - } - } - } - }, - "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/platform/organization/entitlements": { - "get": { - "description": "Fetch entitlements available to the Portal organization that the PMM server is connected to.", - "tags": [ - "PlatformService" - ], - "summary": "Search Organization Entitlements", - "operationId": "SearchOrganizationEntitlements", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "entitlements": { - "type": "array", - "items": { - "description": "OrganizationEntitlement contains information about Organization entitlement.", - "type": "object", - "properties": { - "number": { - "description": "Entitlement number.", - "type": "string", - "x-order": 0 - }, - "name": { - "description": "Entitlement name.", - "type": "string", - "x-order": 1 - }, - "summary": { - "description": "Entitlement short summary.", - "type": "string", - "x-order": 2 - }, - "tier": { - "description": "Entitlement tier.", - "type": "string", - "x-nullable": true, - "x-order": 3 - }, - "total_units": { - "description": "Total units covered by this entitlement.", - "type": "string", - "x-nullable": true, - "x-order": 4 - }, - "unlimited_units": { - "description": "Flag indicates that unlimited units are covered.", - "type": "boolean", - "x-nullable": true, - "x-order": 5 - }, - "support_level": { - "description": "Support level covered by this entitlement.", - "type": "string", - "x-nullable": true, - "x-order": 6 - }, - "software_families": { - "description": "Percona product families covered by this entitlement.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 7 - }, - "start_date": { - "description": "Entitlement start data.\nNote: only date is used here but not time.", - "type": "string", - "format": "date-time", - "x-order": 8 - }, - "end_date": { - "description": "Entitlement end date.\nNote: only date is used here but not time.", - "type": "string", - "format": "date-time", - "x-order": 9 - }, - "platform": { - "description": "Platform indicates platform specific entitlements.", - "type": "object", - "properties": { - "security_advisor": { - "description": "Flag indicates that security advisors are covered by this entitlement.", - "type": "string", - "x-nullable": true, - "x-order": 0 - }, - "config_advisor": { - "description": "Flag indicates that config advisors are covered by this entitlement.", - "type": "string", - "x-nullable": true, - "x-order": 1 - } - }, - "x-order": 10 - } - } - }, - "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/platform/organization/tickets": { - "get": { - "description": "Fetch support tickets belonging to the Percona Portal Organization that the PMM server is connected to.", - "tags": [ - "PlatformService" - ], - "summary": "Search Organization Tickets", - "operationId": "SearchOrganizationTickets", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "tickets": { - "description": "Support tickets belonging to the Percona Portal Organization.", - "type": "array", - "items": { - "description": "OrganizationTicket contains information about the support ticket.", - "type": "object", - "properties": { - "number": { - "description": "Ticket number.", - "type": "string", - "x-order": 0 - }, - "short_description": { - "description": "Ticket short description.", - "type": "string", - "x-order": 1 - }, - "priority": { - "description": "Ticket priority.", - "type": "string", - "x-order": 2 - }, - "state": { - "description": "Ticket state.", - "type": "string", - "x-order": 3 - }, - "create_time": { - "description": "Ticket creation time.", - "type": "string", - "format": "date-time", - "x-order": 4 - }, - "department": { - "description": "Department.", - "type": "string", - "x-order": 5 - }, - "requester": { - "description": "Ticket requester.", - "type": "string", - "x-order": 6 - }, - "task_type": { - "description": "Task type.", - "type": "string", - "x-order": 7 - }, - "url": { - "description": "Ticket url.", - "type": "string", - "x-order": 8 - } - } - }, - "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/platform/server": { - "get": { - "description": "Return PMM server ID and name.", - "tags": [ - "PlatformService" - ], - "summary": "Get Server Info", - "operationId": "ServerInfo", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "pmm_server_name": { - "type": "string", - "x-order": 0 - }, - "pmm_server_id": { - "type": "string", - "x-order": 1 - }, - "pmm_server_telemetry_id": { - "type": "string", - "x-order": 2 - }, - "connected_to_portal": { - "type": "boolean", - "x-order": 3 - } - } - } - }, - "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/platform/user": { - "get": { - "description": "Check if the current user is logged in with their Percona Account.", - "tags": [ - "PlatformService" - ], - "summary": "Get User Status", - "operationId": "UserStatus", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "is_platform_user": { - "type": "boolean", - "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/platform:connect": { - "post": { - "description": "Connect a PMM server to the organization created on Percona Portal. That allows the user to sign in to the PMM server with their Percona Account.", - "tags": [ - "PlatformService" - ], - "summary": "Connect PMM Server", - "operationId": "Connect", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "server_name": { - "description": "User defined human readable PMM Server Name.", - "type": "string", - "x-order": 0 - }, - "personal_access_token": { - "description": "Personal Access Token that the user obtains from Percona Portal.", - "type": "string", - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/platform:disconnect": { - "post": { - "description": "Disconnect a PMM server from the organization created on Percona Portal.", - "tags": [ - "PlatformService" - ], - "summary": "Disconnect PMM Server", - "operationId": "Disconnect", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "force": { - "type": "boolean", - "title": "Forces the cleanup process for connected PMM instances regardless of the Portal API response", - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/qan/metrics:getFilters": { - "post": { - "description": "Provides a filtered map of metrics names.", - "tags": [ - "QANService" - ], - "summary": "Get Filters", - "operationId": "GetFilteredMetricsNames", - "parameters": [ - { - "description": "GetFilteredMetricsNamesRequest contains period for which we need filters.", - "name": "body", - "in": "body", - "required": true, - "schema": { - "description": "GetFilteredMetricsNamesRequest contains period for which we need filters.", - "type": "object", - "properties": { - "period_start_from": { - "type": "string", - "format": "date-time", - "x-order": 0 - }, - "period_start_to": { - "type": "string", - "format": "date-time", - "x-order": 1 - }, - "main_metric_name": { - "type": "string", - "x-order": 2 - }, - "labels": { - "type": "array", - "items": { - "description": "MapFieldEntry allows to pass labels/dimensions in form like {\"server\": [\"db1\", \"db2\"...]}.", - "type": "object", - "properties": { - "key": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "array", - "items": { - "type": "string" - }, - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "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.", - "type": "object", - "properties": { - "labels": { - "type": "object", - "additionalProperties": { - "description": "ListLabels is list of label's values: duplicates are impossible.", - "type": "object", - "properties": { - "name": { - "type": "array", - "items": { - "description": "Values is label values and main metric percent and per second.", - "type": "object", - "properties": { - "value": { - "type": "string", - "x-order": 0 - }, - "main_metric_percent": { - "type": "number", - "format": "float", - "x-order": 1 - }, - "main_metric_per_sec": { - "type": "number", - "format": "float", - "x-order": 2 - } - } - }, - "x-order": 0 - } - } - }, - "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/qan/metrics:getNames": { - "post": { - "description": "Provides a map of all metrics names.", - "tags": [ - "QANService" - ], - "summary": "Get Metrics Names", - "operationId": "GetMetricsNames", - "parameters": [ - { - "description": "MetricsNamesRequest is empty.", - "name": "body", - "in": "body", - "required": true, - "schema": { - "description": "MetricsNamesRequest is empty.", - "type": "object" - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "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.", - "type": "object", - "properties": { - "data": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/qan/metrics:getReport": { - "post": { - "description": "Returns a list of metrics grouped by queryid or other dimensions.", - "tags": [ - "QANService" - ], - "summary": "Get Report", - "operationId": "GetReport", - "parameters": [ - { - "description": "ReportRequest defines filtering of metrics report for db server or other dimentions.", - "name": "body", - "in": "body", - "required": true, - "schema": { - "description": "ReportRequest defines filtering of metrics report for db server or other dimentions.", - "type": "object", - "properties": { - "period_start_from": { - "type": "string", - "format": "date-time", - "x-order": 0 - }, - "period_start_to": { - "type": "string", - "format": "date-time", - "x-order": 1 - }, - "group_by": { - "type": "string", - "x-order": 2 - }, - "labels": { - "type": "array", - "items": { - "description": "ReportMapFieldEntry allows to pass labels/dimentions in form like {\"server\": [\"db1\", \"db2\"...]}.", - "type": "object", - "properties": { - "key": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "array", - "items": { - "type": "string" - }, - "x-order": 1 - } - } - }, - "x-order": 3 - }, - "columns": { - "type": "array", - "items": { - "type": "string" - }, - "x-order": 4 - }, - "order_by": { - "type": "string", - "x-order": 5 - }, - "offset": { - "type": "integer", - "format": "int64", - "x-order": 6 - }, - "limit": { - "type": "integer", - "format": "int64", - "x-order": 7 - }, - "main_metric": { - "type": "string", - "x-order": 8 - }, - "search": { - "type": "string", - "x-order": 9 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "description": "ReportReply is list of reports per quieryids, hosts etc.", - "type": "object", - "properties": { - "total_rows": { - "type": "integer", - "format": "int64", - "x-order": 0 - }, - "offset": { - "type": "integer", - "format": "int64", - "x-order": 1 - }, - "limit": { - "type": "integer", - "format": "int64", - "x-order": 2 - }, - "rows": { - "type": "array", - "items": { - "description": "Row define metrics for selected dimention.", - "type": "object", - "properties": { - "rank": { - "type": "integer", - "format": "int64", - "x-order": 0 - }, - "dimension": { - "type": "string", - "x-order": 1 - }, - "database": { - "type": "string", - "x-order": 2 - }, - "metrics": { - "type": "object", - "additionalProperties": { - "description": "Metric cell.", - "type": "object", - "properties": { - "stats": { - "description": "Stat is statistics of specific metric.", - "type": "object", - "properties": { - "rate": { - "type": "number", - "format": "float", - "x-order": 0 - }, - "cnt": { - "type": "number", - "format": "float", - "x-order": 1 - }, - "sum": { - "type": "number", - "format": "float", - "x-order": 2 - }, - "min": { - "type": "number", - "format": "float", - "x-order": 3 - }, - "max": { - "type": "number", - "format": "float", - "x-order": 4 - }, - "p99": { - "type": "number", - "format": "float", - "x-order": 5 - }, - "avg": { - "type": "number", - "format": "float", - "x-order": 6 - }, - "sum_per_sec": { - "type": "number", - "format": "float", - "x-order": 7 - } - }, - "x-order": 0 - } - } - }, - "x-order": 3 - }, - "sparkline": { - "type": "array", - "items": { - "description": "Point contains values that represents abscissa (time) and ordinate (volume etc.)\nof every point in a coordinate system of Sparklines.", - "type": "object", - "properties": { - "point": { - "description": "The serial number of the chart point from the largest time in the time interval to the lowest time in the time range.", - "type": "integer", - "format": "int64", - "x-order": 0 - }, - "time_frame": { - "description": "Duration beetween two points.", - "type": "integer", - "format": "int64", - "x-order": 1 - }, - "timestamp": { - "description": "Time of point in format RFC3339.", - "type": "string", - "x-order": 2 - }, - "load": { - "description": "load is query_time / time_range.", - "type": "number", - "format": "float", - "x-order": 3 - }, - "num_queries_per_sec": { - "description": "number of queries in bucket.", - "type": "number", - "format": "float", - "x-order": 4 - }, - "num_queries_with_errors_per_sec": { - "description": "number of queries with errors.", - "type": "number", - "format": "float", - "x-order": 5 - }, - "num_queries_with_warnings_per_sec": { - "description": "number of queries with warnings.", - "type": "number", - "format": "float", - "x-order": 6 - }, - "m_query_time_sum_per_sec": { - "description": "The statement execution time in seconds.", - "type": "number", - "format": "float", - "x-order": 7 - }, - "m_lock_time_sum_per_sec": { - "description": "The time to acquire locks in seconds.", - "type": "number", - "format": "float", - "x-order": 8 - }, - "m_rows_sent_sum_per_sec": { - "description": "The number of rows sent to the client.", - "type": "number", - "format": "float", - "x-order": 9 - }, - "m_rows_examined_sum_per_sec": { - "description": "Number of rows scanned - SELECT.", - "type": "number", - "format": "float", - "x-order": 10 - }, - "m_rows_affected_sum_per_sec": { - "description": "Number of rows changed - UPDATE, DELETE, INSERT.", - "type": "number", - "format": "float", - "x-order": 11 - }, - "m_rows_read_sum_per_sec": { - "description": "The number of rows read from tables.", - "type": "number", - "format": "float", - "x-order": 12 - }, - "m_merge_passes_sum_per_sec": { - "description": "The number of merge passes that the sort algorithm has had to do.", - "type": "number", - "format": "float", - "x-order": 13 - }, - "m_innodb_io_r_ops_sum_per_sec": { - "description": "Counts the number of page read operations scheduled.", - "type": "number", - "format": "float", - "x-order": 14 - }, - "m_innodb_io_r_bytes_sum_per_sec": { - "description": "Similar to innodb_IO_r_ops, but the unit is bytes.", - "type": "number", - "format": "float", - "x-order": 15 - }, - "m_innodb_io_r_wait_sum_per_sec": { - "description": "Shows how long (in seconds) it took InnoDB to actually read the data from storage.", - "type": "number", - "format": "float", - "x-order": 16 - }, - "m_innodb_rec_lock_wait_sum_per_sec": { - "description": "Shows how long (in seconds) the query waited for row locks.", - "type": "number", - "format": "float", - "x-order": 17 - }, - "m_innodb_queue_wait_sum_per_sec": { - "description": "Shows how long (in seconds) the query spent either waiting to enter the InnoDB queue or inside that queue waiting for execution.", - "type": "number", - "format": "float", - "x-order": 18 - }, - "m_innodb_pages_distinct_sum_per_sec": { - "description": "Counts approximately the number of unique pages the query accessed.", - "type": "number", - "format": "float", - "x-order": 19 - }, - "m_query_length_sum_per_sec": { - "description": "Shows how long the query is.", - "type": "number", - "format": "float", - "x-order": 20 - }, - "m_bytes_sent_sum_per_sec": { - "description": "The number of bytes sent to all clients.", - "type": "number", - "format": "float", - "x-order": 21 - }, - "m_tmp_tables_sum_per_sec": { - "description": "Number of temporary tables created on memory for the query.", - "type": "number", - "format": "float", - "x-order": 22 - }, - "m_tmp_disk_tables_sum_per_sec": { - "description": "Number of temporary tables created on disk for the query.", - "type": "number", - "format": "float", - "x-order": 23 - }, - "m_tmp_table_sizes_sum_per_sec": { - "description": "Total Size in bytes for all temporary tables used in the query.", - "type": "number", - "format": "float", - "x-order": 24 - }, - "m_qc_hit_sum_per_sec": { - "description": "Query Cache hits.", - "type": "number", - "format": "float", - "x-order": 25 - }, - "m_full_scan_sum_per_sec": { - "description": "The query performed a full table scan.", - "type": "number", - "format": "float", - "x-order": 26 - }, - "m_full_join_sum_per_sec": { - "description": "The query performed a full join (a join without indexes).", - "type": "number", - "format": "float", - "x-order": 27 - }, - "m_tmp_table_sum_per_sec": { - "description": "The query created an implicit internal temporary table.", - "type": "number", - "format": "float", - "x-order": 28 - }, - "m_tmp_table_on_disk_sum_per_sec": { - "description": "The querys temporary table was stored on disk.", - "type": "number", - "format": "float", - "x-order": 29 - }, - "m_filesort_sum_per_sec": { - "description": "The query used a filesort.", - "type": "number", - "format": "float", - "x-order": 30 - }, - "m_filesort_on_disk_sum_per_sec": { - "description": "The filesort was performed on disk.", - "type": "number", - "format": "float", - "x-order": 31 - }, - "m_select_full_range_join_sum_per_sec": { - "description": "The number of joins that used a range search on a reference table.", - "type": "number", - "format": "float", - "x-order": 32 - }, - "m_select_range_sum_per_sec": { - "description": "The number of joins that used ranges on the first table.", - "type": "number", - "format": "float", - "x-order": 33 - }, - "m_select_range_check_sum_per_sec": { - "description": "The number of joins without keys that check for key usage after each row.", - "type": "number", - "format": "float", - "x-order": 34 - }, - "m_sort_range_sum_per_sec": { - "description": "The number of sorts that were done using ranges.", - "type": "number", - "format": "float", - "x-order": 35 - }, - "m_sort_rows_sum_per_sec": { - "description": "The number of sorted rows.", - "type": "number", - "format": "float", - "x-order": 36 - }, - "m_sort_scan_sum_per_sec": { - "description": "The number of sorts that were done by scanning the table.", - "type": "number", - "format": "float", - "x-order": 37 - }, - "m_no_index_used_sum_per_sec": { - "description": "The number of queries without index.", - "type": "number", - "format": "float", - "x-order": 38 - }, - "m_no_good_index_used_sum_per_sec": { - "description": "The number of queries without good index.", - "type": "number", - "format": "float", - "x-order": 39 - }, - "m_docs_returned_sum_per_sec": { - "description": "The number of returned documents.", - "type": "number", - "format": "float", - "x-order": 40 - }, - "m_response_length_sum_per_sec": { - "description": "The response length of the query result in bytes.", - "type": "number", - "format": "float", - "x-order": 41 - }, - "m_docs_scanned_sum_per_sec": { - "description": "The number of scanned documents.", - "type": "number", - "format": "float", - "x-order": 42 - }, - "m_docs_examined_sum_per_sec": { - "description": "Total number of documents scanned during query execution.", - "type": "number", - "format": "float", - "x-order": 43 - }, - "m_keys_examined_sum_per_sec": { - "description": "Total number of index keys scanned during query execution.", - "type": "number", - "format": "float", - "x-order": 44 - }, - "m_locks_global_acquire_count_read_shared_sum_per_sec": { - "description": "Number of times a global read lock was acquired during query execution.", - "type": "number", - "format": "float", - "x-order": 45 - }, - "m_locks_global_acquire_count_write_shared_sum_per_sec": { - "description": "Number of times a global write lock was acquired during query execution.", - "type": "number", - "format": "float", - "x-order": 46 - }, - "m_locks_database_acquire_count_read_shared_sum_per_sec": { - "description": "Number of times a read lock was acquired at the database level during query execution.", - "type": "number", - "format": "float", - "x-order": 47 - }, - "m_locks_database_acquire_wait_count_read_shared_sum_per_sec": { - "description": "Number of times a read lock at the database level was requested but had to wait before being granted.", - "type": "number", - "format": "float", - "x-order": 48 - }, - "m_locks_database_time_acquiring_micros_read_shared_sum_per_sec": { - "description": "Indicates the time, spent acquiring a read lock at the database level during an operation.", - "type": "number", - "format": "float", - "x-order": 49 - }, - "m_locks_collection_acquire_count_read_shared_sum_per_sec": { - "description": "Number of times a read lock was acquired on a specific collection during operations.", - "type": "number", - "format": "float", - "x-order": 50 - }, - "m_storage_bytes_read_sum_per_sec": { - "description": "Total number of bytes read from storage during a specific operation.", - "type": "number", - "format": "float", - "x-order": 51 - }, - "m_storage_time_reading_micros_sum_per_sec": { - "description": "Indicates the time, spent reading data from storage during an operation.", - "type": "number", - "format": "float", - "x-order": 52 - }, - "m_shared_blks_hit_sum_per_sec": { - "description": "Total number of shared block cache hits by the statement.", - "type": "number", - "format": "float", - "x-order": 53 - }, - "m_shared_blks_read_sum_per_sec": { - "description": "Total number of shared blocks read by the statement.", - "type": "number", - "format": "float", - "x-order": 54 - }, - "m_shared_blks_dirtied_sum_per_sec": { - "description": "Total number of shared blocks dirtied by the statement.", - "type": "number", - "format": "float", - "x-order": 55 - }, - "m_shared_blks_written_sum_per_sec": { - "description": "Total number of shared blocks written by the statement.", - "type": "number", - "format": "float", - "x-order": 56 - }, - "m_shared_blk_read_time_sum_per_sec": { - "description": "Total time the statement spent reading shared blocks, in milliseconds (if track_io_timing is enabled, otherwise zero).", - "type": "number", - "format": "float", - "x-order": 57 - }, - "m_shared_blk_write_time_sum_per_sec": { - "description": "Total time the statement spent writing shared blocks, in milliseconds (if track_io_timing is enabled, otherwise zero).", - "type": "number", - "format": "float", - "x-order": 58 - }, - "m_local_blk_read_time_sum_per_sec": { - "description": "Total time the statement spent reading shared blocks, in milliseconds (if track_io_timing is enabled, otherwise zero).", - "type": "number", - "format": "float", - "x-order": 59 - }, - "m_local_blk_write_time_sum_per_sec": { - "description": "Total time the statement spent writing shared blocks, in milliseconds (if track_io_timing is enabled, otherwise zero).", - "type": "number", - "format": "float", - "x-order": 60 - }, - "m_local_blks_hit_sum_per_sec": { - "description": "Total number of local block cache hits by the statement.", - "type": "number", - "format": "float", - "x-order": 61 - }, - "m_local_blks_read_sum_per_sec": { - "description": "Total number of local blocks read by the statement.", - "type": "number", - "format": "float", - "x-order": 62 - }, - "m_local_blks_dirtied_sum_per_sec": { - "description": "Total number of local blocks dirtied by the statement.", - "type": "number", - "format": "float", - "x-order": 63 - }, - "m_local_blks_written_sum_per_sec": { - "description": "Total number of local blocks written by the statement.", - "type": "number", - "format": "float", - "x-order": 64 - }, - "m_temp_blks_read_sum_per_sec": { - "description": "Total number of temp blocks read by the statement.", - "type": "number", - "format": "float", - "x-order": 65 - }, - "m_temp_blks_written_sum_per_sec": { - "description": "Total number of temp blocks written by the statement.", - "type": "number", - "format": "float", - "x-order": 66 - }, - "m_blk_read_time_sum_per_sec": { - "description": "Total time the statement spent reading blocks, in milliseconds (if track_io_timing is enabled, otherwise zero).", - "type": "number", - "format": "float", - "x-order": 67 - }, - "m_blk_write_time_sum_per_sec": { - "description": "Total time the statement spent writing blocks, in milliseconds (if track_io_timing is enabled, otherwise zero).", - "type": "number", - "format": "float", - "x-order": 68 - }, - "m_cpu_user_time_sum_per_sec": { - "description": "Total time user spent in query.", - "type": "number", - "format": "float", - "x-order": 69 - }, - "m_cpu_sys_time_sum_per_sec": { - "description": "Total time system spent in query.", - "type": "number", - "format": "float", - "x-order": 70 - }, - "m_plans_calls_sum_per_sec": { - "description": "Total number of planned calls.", - "type": "number", - "format": "float", - "x-order": 71 - }, - "m_wal_records_sum_per_sec": { - "description": "Total number of WAL (Write-ahead logging) records.", - "type": "number", - "format": "float", - "x-order": 72 - }, - "m_wal_fpi_sum_per_sec": { - "description": "Total number of FPI (full page images) in WAL (Write-ahead logging) records.", - "type": "number", - "format": "float", - "x-order": 73 - }, - "m_wal_bytes_sum_per_sec": { - "description": "Total bytes of WAL (Write-ahead logging) records.", - "type": "number", - "format": "float", - "x-order": 74 - }, - "m_plan_time_sum_per_sec": { - "description": "Plan time in per seconds.", - "type": "number", - "format": "float", - "x-order": 75 - } - } - }, - "x-order": 4 - }, - "fingerprint": { - "type": "string", - "x-order": 5 - }, - "num_queries": { - "type": "integer", - "format": "int64", - "x-order": 6 - }, - "qps": { - "type": "number", - "format": "float", - "x-order": 7 - }, - "load": { - "type": "number", - "format": "float", - "x-order": 8 - } - } - }, - "x-order": 3 - } - } - } - }, - "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/qan/query/{queryid}/plan": { - "get": { - "description": "Provides a query plan and plan id for specific filtering.", - "tags": [ - "QANService" - ], - "summary": "Get Query Plan", - "operationId": "GetQueryPlan", - "parameters": [ - { - "type": "string", - "name": "queryid", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "description": "GetQueryPlanResponse contains planid and query_plan.", - "type": "object", - "properties": { - "planid": { - "type": "string", - "x-order": 0 - }, - "query_plan": { - "type": "string", - "x-order": 1 - } - } - } - }, - "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/qan/query:exists": { - "post": { - "description": "Checks if query exists in clickhouse.", - "tags": [ - "QANService" - ], - "summary": "Check Query Existence", - "operationId": "QueryExists", - "parameters": [ - { - "description": "QueryExistsRequest check if provided query exists or not.", - "name": "body", - "in": "body", - "required": true, - "schema": { - "description": "QueryExistsRequest check if provided query exists or not.", - "type": "object", - "properties": { - "serviceid": { - "type": "string", - "x-order": 0 - }, - "query": { - "type": "string", - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "description": "QueryExistsResponse returns true if query exists.", - "type": "object", - "properties": { - "exists": { - "type": "boolean", - "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/qan/query:getExample": { - "post": { - "description": "Provides a list of query examples.", - "tags": [ - "QANService" - ], - "summary": "Get Query Example", - "operationId": "GetQueryExample", - "parameters": [ - { - "description": "GetQueryExampleRequest defines filtering of query examples for specific value of\ndimension (ex.: host=hostname1 or queryid=1D410B4BE5060972.", - "name": "body", - "in": "body", - "required": true, - "schema": { - "description": "GetQueryExampleRequest defines filtering of query examples for specific value of\ndimension (ex.: host=hostname1 or queryid=1D410B4BE5060972.", - "type": "object", - "properties": { - "period_start_from": { - "type": "string", - "format": "date-time", - "x-order": 0 - }, - "period_start_to": { - "type": "string", - "format": "date-time", - "x-order": 1 - }, - "filter_by": { - "description": "dimension value: ex: queryid - 1D410B4BE5060972.", - "type": "string", - "x-order": 2 - }, - "group_by": { - "description": "one of dimension: queryid | host ...", - "type": "string", - "x-order": 3 - }, - "labels": { - "type": "array", - "items": { - "description": "MapFieldEntry allows to pass labels/dimensions in form like {\"server\": [\"db1\", \"db2\"...]}.", - "type": "object", - "properties": { - "key": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "array", - "items": { - "type": "string" - }, - "x-order": 1 - } - } - }, - "x-order": 4 - }, - "limit": { - "type": "integer", - "format": "int64", - "x-order": 5 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "description": "GetQueryExampleResponse list of query examples.", - "type": "object", - "properties": { - "query_examples": { - "type": "array", - "items": { - "description": "QueryExample shows query examples and their metrics.", - "type": "object", - "properties": { - "example": { - "type": "string", - "x-order": 0 - }, - "example_type": { - "description": "ExampleType is a type of query example selected for this query class in given period of time.", - "type": "string", - "default": "EXAMPLE_TYPE_UNSPECIFIED", - "enum": [ - "EXAMPLE_TYPE_UNSPECIFIED", - "EXAMPLE_TYPE_RANDOM", - "EXAMPLE_TYPE_SLOWEST", - "EXAMPLE_TYPE_FASTEST", - "EXAMPLE_TYPE_WITH_ERROR" - ], - "x-order": 1 - }, - "is_truncated": { - "type": "integer", - "format": "int64", - "x-order": 2 - }, - "placeholders_count": { - "type": "integer", - "format": "int64", - "x-order": 3 - }, - "explain_fingerprint": { - "type": "string", - "x-order": 4 - }, - "query_id": { - "type": "string", - "x-order": 5 - }, - "example_metrics": { - "type": "string", - "x-order": 6 - }, - "service_id": { - "type": "string", - "x-order": 7 - }, - "service_type": { - "type": "string", - "x-order": 8 - }, - "schema": { - "type": "string", - "x-order": 9 - }, - "tables": { - "type": "array", - "items": { - "type": "string" - }, - "x-order": 10 - } - } - }, - "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/qan/query:getSchema": { - "post": { - "description": "Provides the schema for a given queryID and serviceID.", - "tags": [ - "QANService" - ], - "summary": "Get Schema", - "operationId": "SchemaByQueryID", - "parameters": [ - { - "description": "SchemaByQueryIDRequest returns schema for given query ID and service ID.", - "name": "body", - "in": "body", - "required": true, - "schema": { - "description": "SchemaByQueryIDRequest returns schema for given query ID and service ID.", - "type": "object", - "properties": { - "service_id": { - "type": "string", - "x-order": 0 - }, - "query_id": { - "type": "string", - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "description": "SchemaByQueryIDResponse is schema for given query ID and service ID.", - "type": "object", - "properties": { - "schema": { - "type": "string", - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/qan:explainFingerprint": { - "post": { - "description": "Provides an explain fingerprint for given query ID.", - "tags": [ - "QANService" - ], - "summary": "Get Explain Fingerprint", - "operationId": "ExplainFingerprintByQueryID", - "parameters": [ - { - "description": "ExplainFingerprintByQueryIDRequest get explain fingerprint for given query ID.", - "name": "body", - "in": "body", - "required": true, - "schema": { - "description": "ExplainFingerprintByQueryIDRequest get explain fingerprint for given query ID.", - "type": "object", - "properties": { - "serviceid": { - "type": "string", - "x-order": 0 - }, - "query_id": { - "type": "string", - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "description": "ExplainFingerprintByQueryIDResponse is explain fingerprint and placeholders count for given query ID.", - "type": "object", - "properties": { - "explain_fingerprint": { - "type": "string", - "x-order": 0 - }, - "placeholders_count": { - "type": "integer", - "format": "int64", - "x-order": 1 - } - } - } - }, - "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/qan:getHistogram": { - "post": { - "description": "Provides histogram items for specific filtering.", - "tags": [ - "QANService" - ], - "summary": "Get Histogram", - "operationId": "GetHistogram", - "parameters": [ - { - "description": "GetHistogramRequest defines filtering by time range, labels and queryid.", - "name": "body", - "in": "body", - "required": true, - "schema": { - "description": "GetHistogramRequest defines filtering by time range, labels and queryid.", - "type": "object", - "properties": { - "period_start_from": { - "type": "string", - "format": "date-time", - "x-order": 0 - }, - "period_start_to": { - "type": "string", - "format": "date-time", - "x-order": 1 - }, - "labels": { - "type": "array", - "items": { - "description": "MapFieldEntry allows to pass labels/dimensions in form like {\"server\": [\"db1\", \"db2\"...]}.", - "type": "object", - "properties": { - "key": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "array", - "items": { - "type": "string" - }, - "x-order": 1 - } - } - }, - "x-order": 2 - }, - "queryid": { - "type": "string", - "x-order": 3 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "description": "GetHistogramResponse is histogram items as a list.", - "type": "object", - "properties": { - "histogram_items": { - "type": "array", - "items": { - "description": "HistogramItem represents one item in histogram.", - "type": "object", - "properties": { - "range": { - "type": "string", - "x-order": 0 - }, - "frequency": { - "type": "integer", - "format": "int64", - "x-order": 1 - } - } - }, - "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/qan:getLabels": { - "post": { - "description": "Provides a list of labels for object details.", - "tags": [ - "QANService" - ], - "summary": "Get Labels", - "operationId": "GetLabels", - "parameters": [ - { - "description": "GetLabelsRequest defines filtering of object detail's labels for specific value of\ndimension (ex.: host=hostname1 or queryid=1D410B4BE5060972.", - "name": "body", - "in": "body", - "required": true, - "schema": { - "description": "GetLabelsRequest defines filtering of object detail's labels for specific value of\ndimension (ex.: host=hostname1 or queryid=1D410B4BE5060972.", - "type": "object", - "properties": { - "period_start_from": { - "type": "string", - "format": "date-time", - "x-order": 0 - }, - "period_start_to": { - "type": "string", - "format": "date-time", - "x-order": 1 - }, - "filter_by": { - "description": "dimension value: ex: queryid - 1D410B4BE5060972.", - "type": "string", - "x-order": 2 - }, - "group_by": { - "description": "one of dimension: queryid | host ...", - "type": "string", - "x-order": 3 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "description": "GetLabelsResponse is a map of labels names as keys and labels values as a list.", - "type": "object", - "properties": { - "labels": { - "type": "object", - "additionalProperties": { - "description": "ListLabelValues is list of label's values.", - "type": "object", - "properties": { - "values": { - "type": "array", - "items": { - "type": "string" - }, - "x-order": 0 - } - } - }, - "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/qan:getMetrics": { - "post": { - "description": "Provides a map of metrics for specific filtering.", - "tags": [ - "QANService" - ], - "summary": "Get Metrics", - "operationId": "GetMetrics", - "parameters": [ - { - "description": "GetMetricsRequest defines filtering of metrics for specific value of dimension (ex.: host=hostname1 or queryid=1D410B4BE5060972.", - "name": "body", - "in": "body", - "required": true, - "schema": { - "description": "GetMetricsRequest defines filtering of metrics for specific value of dimension (ex.: host=hostname1 or queryid=1D410B4BE5060972.", - "type": "object", - "properties": { - "period_start_from": { - "type": "string", - "format": "date-time", - "x-order": 0 - }, - "period_start_to": { - "type": "string", - "format": "date-time", - "x-order": 1 - }, - "filter_by": { - "description": "dimension value: ex: queryid - 1D410B4BE5060972.", - "type": "string", - "x-order": 2 - }, - "group_by": { - "description": "one of dimension: queryid | host ...", - "type": "string", - "x-order": 3 - }, - "labels": { - "type": "array", - "items": { - "description": "MapFieldEntry allows to pass labels/dimensions in form like {\"server\": [\"db1\", \"db2\"...]}.", - "type": "object", - "properties": { - "key": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "array", - "items": { - "type": "string" - }, - "x-order": 1 - } - } - }, - "x-order": 4 - }, - "include_only_fields": { - "type": "array", - "items": { - "type": "string" - }, - "x-order": 5 - }, - "totals": { - "type": "boolean", - "title": "retrieve only values for totals, excluding N/A values", - "x-order": 6 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "description": "GetMetricsResponse defines metrics for specific value of dimension (ex.: host=hostname1 or queryid=1D410B4BE5060972.", - "type": "object", - "properties": { - "metrics": { - "type": "object", - "additionalProperties": { - "description": "MetricValues is statistics of specific metric.", - "type": "object", - "properties": { - "rate": { - "type": "number", - "format": "float", - "x-order": 0 - }, - "cnt": { - "type": "number", - "format": "float", - "x-order": 1 - }, - "sum": { - "type": "number", - "format": "float", - "x-order": 2 - }, - "min": { - "type": "number", - "format": "float", - "x-order": 3 - }, - "max": { - "type": "number", - "format": "float", - "x-order": 4 - }, - "avg": { - "type": "number", - "format": "float", - "x-order": 5 - }, - "p99": { - "type": "number", - "format": "float", - "x-order": 6 - }, - "percent_of_total": { - "type": "number", - "format": "float", - "x-order": 7 - } - } - }, - "x-order": 0 - }, - "text_metrics": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 1 - }, - "sparkline": { - "type": "array", - "items": { - "description": "Point contains values that represents abscissa (time) and ordinate (volume etc.)\nof every point in a coordinate system of Sparklines.", - "type": "object", - "properties": { - "point": { - "description": "The serial number of the chart point from the largest time in the time interval to the lowest time in the time range.", - "type": "integer", - "format": "int64", - "x-order": 0 - }, - "time_frame": { - "description": "Duration beetween two points.", - "type": "integer", - "format": "int64", - "x-order": 1 - }, - "timestamp": { - "description": "Time of point in format RFC3339.", - "type": "string", - "x-order": 2 - }, - "load": { - "description": "load is query_time / time_range.", - "type": "number", - "format": "float", - "x-order": 3 - }, - "num_queries_per_sec": { - "description": "number of queries in bucket.", - "type": "number", - "format": "float", - "x-order": 4 - }, - "num_queries_with_errors_per_sec": { - "description": "number of queries with errors.", - "type": "number", - "format": "float", - "x-order": 5 - }, - "num_queries_with_warnings_per_sec": { - "description": "number of queries with warnings.", - "type": "number", - "format": "float", - "x-order": 6 - }, - "m_query_time_sum_per_sec": { - "description": "The statement execution time in seconds.", - "type": "number", - "format": "float", - "x-order": 7 - }, - "m_lock_time_sum_per_sec": { - "description": "The time to acquire locks in seconds.", - "type": "number", - "format": "float", - "x-order": 8 - }, - "m_rows_sent_sum_per_sec": { - "description": "The number of rows sent to the client.", - "type": "number", - "format": "float", - "x-order": 9 - }, - "m_rows_examined_sum_per_sec": { - "description": "Number of rows scanned - SELECT.", - "type": "number", - "format": "float", - "x-order": 10 - }, - "m_rows_affected_sum_per_sec": { - "description": "Number of rows changed - UPDATE, DELETE, INSERT.", - "type": "number", - "format": "float", - "x-order": 11 - }, - "m_rows_read_sum_per_sec": { - "description": "The number of rows read from tables.", - "type": "number", - "format": "float", - "x-order": 12 - }, - "m_merge_passes_sum_per_sec": { - "description": "The number of merge passes that the sort algorithm has had to do.", - "type": "number", - "format": "float", - "x-order": 13 - }, - "m_innodb_io_r_ops_sum_per_sec": { - "description": "Counts the number of page read operations scheduled.", - "type": "number", - "format": "float", - "x-order": 14 - }, - "m_innodb_io_r_bytes_sum_per_sec": { - "description": "Similar to innodb_IO_r_ops, but the unit is bytes.", - "type": "number", - "format": "float", - "x-order": 15 - }, - "m_innodb_io_r_wait_sum_per_sec": { - "description": "Shows how long (in seconds) it took InnoDB to actually read the data from storage.", - "type": "number", - "format": "float", - "x-order": 16 - }, - "m_innodb_rec_lock_wait_sum_per_sec": { - "description": "Shows how long (in seconds) the query waited for row locks.", - "type": "number", - "format": "float", - "x-order": 17 - }, - "m_innodb_queue_wait_sum_per_sec": { - "description": "Shows how long (in seconds) the query spent either waiting to enter the InnoDB queue or inside that queue waiting for execution.", - "type": "number", - "format": "float", - "x-order": 18 - }, - "m_innodb_pages_distinct_sum_per_sec": { - "description": "Counts approximately the number of unique pages the query accessed.", - "type": "number", - "format": "float", - "x-order": 19 - }, - "m_query_length_sum_per_sec": { - "description": "Shows how long the query is.", - "type": "number", - "format": "float", - "x-order": 20 - }, - "m_bytes_sent_sum_per_sec": { - "description": "The number of bytes sent to all clients.", - "type": "number", - "format": "float", - "x-order": 21 - }, - "m_tmp_tables_sum_per_sec": { - "description": "Number of temporary tables created on memory for the query.", - "type": "number", - "format": "float", - "x-order": 22 - }, - "m_tmp_disk_tables_sum_per_sec": { - "description": "Number of temporary tables created on disk for the query.", - "type": "number", - "format": "float", - "x-order": 23 - }, - "m_tmp_table_sizes_sum_per_sec": { - "description": "Total Size in bytes for all temporary tables used in the query.", - "type": "number", - "format": "float", - "x-order": 24 - }, - "m_qc_hit_sum_per_sec": { - "description": "Query Cache hits.", - "type": "number", - "format": "float", - "x-order": 25 - }, - "m_full_scan_sum_per_sec": { - "description": "The query performed a full table scan.", - "type": "number", - "format": "float", - "x-order": 26 - }, - "m_full_join_sum_per_sec": { - "description": "The query performed a full join (a join without indexes).", - "type": "number", - "format": "float", - "x-order": 27 - }, - "m_tmp_table_sum_per_sec": { - "description": "The query created an implicit internal temporary table.", - "type": "number", - "format": "float", - "x-order": 28 - }, - "m_tmp_table_on_disk_sum_per_sec": { - "description": "The querys temporary table was stored on disk.", - "type": "number", - "format": "float", - "x-order": 29 - }, - "m_filesort_sum_per_sec": { - "description": "The query used a filesort.", - "type": "number", - "format": "float", - "x-order": 30 - }, - "m_filesort_on_disk_sum_per_sec": { - "description": "The filesort was performed on disk.", - "type": "number", - "format": "float", - "x-order": 31 - }, - "m_select_full_range_join_sum_per_sec": { - "description": "The number of joins that used a range search on a reference table.", - "type": "number", - "format": "float", - "x-order": 32 - }, - "m_select_range_sum_per_sec": { - "description": "The number of joins that used ranges on the first table.", - "type": "number", - "format": "float", - "x-order": 33 - }, - "m_select_range_check_sum_per_sec": { - "description": "The number of joins without keys that check for key usage after each row.", - "type": "number", - "format": "float", - "x-order": 34 - }, - "m_sort_range_sum_per_sec": { - "description": "The number of sorts that were done using ranges.", - "type": "number", - "format": "float", - "x-order": 35 - }, - "m_sort_rows_sum_per_sec": { - "description": "The number of sorted rows.", - "type": "number", - "format": "float", - "x-order": 36 - }, - "m_sort_scan_sum_per_sec": { - "description": "The number of sorts that were done by scanning the table.", - "type": "number", - "format": "float", - "x-order": 37 - }, - "m_no_index_used_sum_per_sec": { - "description": "The number of queries without index.", - "type": "number", - "format": "float", - "x-order": 38 - }, - "m_no_good_index_used_sum_per_sec": { - "description": "The number of queries without good index.", - "type": "number", - "format": "float", - "x-order": 39 - }, - "m_docs_returned_sum_per_sec": { - "description": "The number of returned documents.", - "type": "number", - "format": "float", - "x-order": 40 - }, - "m_response_length_sum_per_sec": { - "description": "The response length of the query result in bytes.", - "type": "number", - "format": "float", - "x-order": 41 - }, - "m_docs_scanned_sum_per_sec": { - "description": "The number of scanned documents.", - "type": "number", - "format": "float", - "x-order": 42 - }, - "m_docs_examined_sum_per_sec": { - "description": "Total number of documents scanned during query execution.", - "type": "number", - "format": "float", - "x-order": 43 - }, - "m_keys_examined_sum_per_sec": { - "description": "Total number of index keys scanned during query execution.", - "type": "number", - "format": "float", - "x-order": 44 - }, - "m_locks_global_acquire_count_read_shared_sum_per_sec": { - "description": "Number of times a global read lock was acquired during query execution.", - "type": "number", - "format": "float", - "x-order": 45 - }, - "m_locks_global_acquire_count_write_shared_sum_per_sec": { - "description": "Number of times a global write lock was acquired during query execution.", - "type": "number", - "format": "float", - "x-order": 46 - }, - "m_locks_database_acquire_count_read_shared_sum_per_sec": { - "description": "Number of times a read lock was acquired at the database level during query execution.", - "type": "number", - "format": "float", - "x-order": 47 - }, - "m_locks_database_acquire_wait_count_read_shared_sum_per_sec": { - "description": "Number of times a read lock at the database level was requested but had to wait before being granted.", - "type": "number", - "format": "float", - "x-order": 48 - }, - "m_locks_database_time_acquiring_micros_read_shared_sum_per_sec": { - "description": "Indicates the time, spent acquiring a read lock at the database level during an operation.", - "type": "number", - "format": "float", - "x-order": 49 - }, - "m_locks_collection_acquire_count_read_shared_sum_per_sec": { - "description": "Number of times a read lock was acquired on a specific collection during operations.", - "type": "number", - "format": "float", - "x-order": 50 - }, - "m_storage_bytes_read_sum_per_sec": { - "description": "Total number of bytes read from storage during a specific operation.", - "type": "number", - "format": "float", - "x-order": 51 - }, - "m_storage_time_reading_micros_sum_per_sec": { - "description": "Indicates the time, spent reading data from storage during an operation.", - "type": "number", - "format": "float", - "x-order": 52 - }, - "m_shared_blks_hit_sum_per_sec": { - "description": "Total number of shared block cache hits by the statement.", - "type": "number", - "format": "float", - "x-order": 53 - }, - "m_shared_blks_read_sum_per_sec": { - "description": "Total number of shared blocks read by the statement.", - "type": "number", - "format": "float", - "x-order": 54 - }, - "m_shared_blks_dirtied_sum_per_sec": { - "description": "Total number of shared blocks dirtied by the statement.", - "type": "number", - "format": "float", - "x-order": 55 - }, - "m_shared_blks_written_sum_per_sec": { - "description": "Total number of shared blocks written by the statement.", - "type": "number", - "format": "float", - "x-order": 56 - }, - "m_shared_blk_read_time_sum_per_sec": { - "description": "Total time the statement spent reading shared blocks, in milliseconds (if track_io_timing is enabled, otherwise zero).", - "type": "number", - "format": "float", - "x-order": 57 - }, - "m_shared_blk_write_time_sum_per_sec": { - "description": "Total time the statement spent writing shared blocks, in milliseconds (if track_io_timing is enabled, otherwise zero).", - "type": "number", - "format": "float", - "x-order": 58 - }, - "m_local_blk_read_time_sum_per_sec": { - "description": "Total time the statement spent reading shared blocks, in milliseconds (if track_io_timing is enabled, otherwise zero).", - "type": "number", - "format": "float", - "x-order": 59 - }, - "m_local_blk_write_time_sum_per_sec": { - "description": "Total time the statement spent writing shared blocks, in milliseconds (if track_io_timing is enabled, otherwise zero).", - "type": "number", - "format": "float", - "x-order": 60 - }, - "m_local_blks_hit_sum_per_sec": { - "description": "Total number of local block cache hits by the statement.", - "type": "number", - "format": "float", - "x-order": 61 - }, - "m_local_blks_read_sum_per_sec": { - "description": "Total number of local blocks read by the statement.", - "type": "number", - "format": "float", - "x-order": 62 - }, - "m_local_blks_dirtied_sum_per_sec": { - "description": "Total number of local blocks dirtied by the statement.", - "type": "number", - "format": "float", - "x-order": 63 - }, - "m_local_blks_written_sum_per_sec": { - "description": "Total number of local blocks written by the statement.", - "type": "number", - "format": "float", - "x-order": 64 - }, - "m_temp_blks_read_sum_per_sec": { - "description": "Total number of temp blocks read by the statement.", - "type": "number", - "format": "float", - "x-order": 65 - }, - "m_temp_blks_written_sum_per_sec": { - "description": "Total number of temp blocks written by the statement.", - "type": "number", - "format": "float", - "x-order": 66 - }, - "m_blk_read_time_sum_per_sec": { - "description": "Total time the statement spent reading blocks, in milliseconds (if track_io_timing is enabled, otherwise zero).", - "type": "number", - "format": "float", - "x-order": 67 - }, - "m_blk_write_time_sum_per_sec": { - "description": "Total time the statement spent writing blocks, in milliseconds (if track_io_timing is enabled, otherwise zero).", - "type": "number", - "format": "float", - "x-order": 68 - }, - "m_cpu_user_time_sum_per_sec": { - "description": "Total time user spent in query.", - "type": "number", - "format": "float", - "x-order": 69 - }, - "m_cpu_sys_time_sum_per_sec": { - "description": "Total time system spent in query.", - "type": "number", - "format": "float", - "x-order": 70 - }, - "m_plans_calls_sum_per_sec": { - "description": "Total number of planned calls.", - "type": "number", - "format": "float", - "x-order": 71 - }, - "m_wal_records_sum_per_sec": { - "description": "Total number of WAL (Write-ahead logging) records.", - "type": "number", - "format": "float", - "x-order": 72 - }, - "m_wal_fpi_sum_per_sec": { - "description": "Total number of FPI (full page images) in WAL (Write-ahead logging) records.", - "type": "number", - "format": "float", - "x-order": 73 - }, - "m_wal_bytes_sum_per_sec": { - "description": "Total bytes of WAL (Write-ahead logging) records.", - "type": "number", - "format": "float", - "x-order": 74 - }, - "m_plan_time_sum_per_sec": { - "description": "Plan time in per seconds.", - "type": "number", - "format": "float", - "x-order": 75 - } - } - }, - "x-order": 2 - }, - "totals": { - "type": "object", - "additionalProperties": { - "description": "MetricValues is statistics of specific metric.", - "type": "object", - "properties": { - "rate": { - "type": "number", - "format": "float", - "x-order": 0 - }, - "cnt": { - "type": "number", - "format": "float", - "x-order": 1 - }, - "sum": { - "type": "number", - "format": "float", - "x-order": 2 - }, - "min": { - "type": "number", - "format": "float", - "x-order": 3 - }, - "max": { - "type": "number", - "format": "float", - "x-order": 4 - }, - "avg": { - "type": "number", - "format": "float", - "x-order": 5 - }, - "p99": { - "type": "number", - "format": "float", - "x-order": 6 - }, - "percent_of_total": { - "type": "number", - "format": "float", - "x-order": 7 - } - } - }, - "x-order": 3 - }, - "fingerprint": { - "type": "string", - "x-order": 4 - }, - "metadata": { - "description": "GetSlecetedQueryMetadataResponse consists selected query metadata to show in details for given query ID.", - "type": "object", - "properties": { - "service_name": { - "type": "string", - "x-order": 0 - }, - "database": { - "type": "string", - "x-order": 1 - }, - "schema": { - "type": "string", - "x-order": 2 - }, - "username": { - "type": "string", - "x-order": 3 - }, - "replication_set": { - "type": "string", - "x-order": 4 - }, - "cluster": { - "type": "string", - "x-order": 5 - }, - "service_type": { - "type": "string", - "x-order": 6 - }, - "service_id": { - "type": "string", - "x-order": 7 - }, - "environment": { - "type": "string", - "x-order": 8 - }, - "node_id": { - "type": "string", - "x-order": 9 - }, - "node_name": { - "type": "string", - "x-order": 10 - }, - "node_type": { - "type": "string", - "x-order": 11 - } - }, - "x-order": 5 - } - } - } - }, - "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/server/leaderHealthCheck": { - "get": { - "description": "Checks if the instance is the leader in a cluster. Returns an error if the instance isn't the leader.", - "tags": [ - "ServerService" - ], - "summary": "Check Leadership", - "operationId": "LeaderHealthCheck", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "description": "This probe is available without authentication, so it should not contain any data.", - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "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 }", - "type": "object", - "properties": { - "@type": { - "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.", - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/server/logs.zip": { - "get": { - "description": "Returns the PMM Server logs.", - "produces": [ - "application/zip" - ], - "tags": [ - "ServerService" - ], - "summary": "Logs", - "operationId": "Logs", - "parameters": [ - { - "type": "boolean", - "description": "Include performance profiling data,", - "name": "pprof", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "file" - } - }, - "default": { - "description": "An error response.", - "schema": { - "description": "ErrorResponse is a message returned on HTTP error.", - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32" - }, - "error": { - "type": "string" - }, - "message": { - "type": "string" - } - } - } - } - } - } - }, - "/v1/server/readyz": { - "get": { - "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.", - "tags": [ - "ServerService" - ], - "summary": "Check server readiness", - "operationId": "Readiness", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "description": "This probe is available without authentication, so it should not contain any data.", - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "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 }", - "type": "object", - "properties": { - "@type": { - "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.", - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/server/settings": { - "get": { - "description": "Returns current PMM Server settings.", - "tags": [ - "ServerService" - ], - "summary": "Get settings", - "operationId": "GetSettings", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "settings": { - "description": "Settings represents PMM Server settings.", - "type": "object", - "properties": { - "updates_enabled": { - "description": "True if updates are enabled.", - "type": "boolean", - "x-order": 0 - }, - "telemetry_enabled": { - "description": "True if telemetry is enabled.", - "type": "boolean", - "x-order": 1 - }, - "metrics_resolutions": { - "description": "MetricsResolutions represents Prometheus exporters metrics resolutions.", - "type": "object", - "properties": { - "hr": { - "description": "High resolution. Should have a suffix in JSON: 1s, 1m, 1h.", - "type": "string", - "x-order": 0 - }, - "mr": { - "description": "Medium resolution. Should have a suffix in JSON: 1s, 1m, 1h.", - "type": "string", - "x-order": 1 - }, - "lr": { - "description": "Low resolution. Should have a suffix in JSON: 1s, 1m, 1h.", - "type": "string", - "x-order": 2 - } - }, - "x-order": 2 - }, - "data_retention": { - "type": "string", - "x-order": 3 - }, - "ssh_key": { - "type": "string", - "x-order": 4 - }, - "aws_partitions": { - "type": "array", - "items": { - "type": "string" - }, - "x-order": 5 - }, - "advisor_enabled": { - "description": "True if Advisor is enabled.", - "type": "boolean", - "x-order": 6 - }, - "platform_email": { - "description": "Percona Platform user's email, if this PMM instance is linked to the Platform.", - "type": "string", - "x-order": 7 - }, - "alerting_enabled": { - "description": "True if Alerting is enabled.", - "type": "boolean", - "x-order": 8 - }, - "pmm_public_address": { - "description": "PMM Server public address.", - "type": "string", - "x-order": 9 - }, - "advisor_run_intervals": { - "description": "AdvisorRunIntervals represents intervals between each run of Advisor checks.", - "type": "object", - "properties": { - "standard_interval": { - "description": "Standard check interval.", - "type": "string", - "x-order": 0 - }, - "rare_interval": { - "description": "Interval for rare check runs.", - "type": "string", - "x-order": 1 - }, - "frequent_interval": { - "description": "Interval for frequent check runs.", - "type": "string", - "x-order": 2 - } - }, - "x-order": 10 - }, - "backup_management_enabled": { - "description": "True if Backup Management is enabled.", - "type": "boolean", - "x-order": 11 - }, - "azurediscover_enabled": { - "description": "True if Azure Discover is enabled.", - "type": "boolean", - "x-order": 12 - }, - "connected_to_platform": { - "type": "boolean", - "title": "True if the PMM instance is connected to Platform", - "x-order": 13 - }, - "telemetry_summaries": { - "type": "array", - "title": "Includes list of collected telemetry", - "items": { - "type": "string" - }, - "x-order": 14 - }, - "enable_access_control": { - "description": "True if Access Control is enabled.", - "type": "boolean", - "x-order": 15 - }, - "default_role_id": { - "description": "Default Access Control role ID for new users.", - "type": "integer", - "format": "int64", - "x-order": 16 - }, - "enable_internal_pg_qan": { - "description": "True if Query Analytics for PMM's internal PG database is enabled.", - "type": "boolean", - "x-order": 17 - }, - "update_snooze_duration": { - "type": "string", - "title": "Duration for which an update is snoozed", - "x-order": 18 - } - }, - "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": { - "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 }", - "type": "object", - "properties": { - "@type": { - "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.", - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - }, - "put": { - "description": "Changes PMM Server settings.", - "tags": [ - "ServerService" - ], - "summary": "Change settings", - "operationId": "ChangeSettings", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "enable_updates": { - "type": "boolean", - "x-nullable": true, - "x-order": 0 - }, - "enable_telemetry": { - "type": "boolean", - "x-nullable": true, - "x-order": 1 - }, - "metrics_resolutions": { - "description": "MetricsResolutions represents Prometheus exporters metrics resolutions.", - "type": "object", - "properties": { - "hr": { - "description": "High resolution. Should have a suffix in JSON: 1s, 1m, 1h.", - "type": "string", - "x-order": 0 - }, - "mr": { - "description": "Medium resolution. Should have a suffix in JSON: 1s, 1m, 1h.", - "type": "string", - "x-order": 1 - }, - "lr": { - "description": "Low resolution. Should have a suffix in JSON: 1s, 1m, 1h.", - "type": "string", - "x-order": 2 - } - }, - "x-order": 2 - }, - "data_retention": { - "description": "A number of full days for Prometheus and QAN data retention. Should have a suffix in JSON: 2592000s, 43200m, 720h.", - "type": "string", - "x-order": 3 - }, - "ssh_key": { - "type": "string", - "x-nullable": true, - "x-order": 4 - }, - "aws_partitions": { - "description": "A wrapper for a string array. This type allows to distinguish between an empty array and a null value.", - "type": "object", - "properties": { - "values": { - "type": "array", - "items": { - "type": "string" - }, - "x-order": 0 - } - }, - "x-nullable": true, - "x-order": 5 - }, - "enable_advisor": { - "description": "Enable Advisor.", - "type": "boolean", - "x-nullable": true, - "x-order": 6 - }, - "enable_alerting": { - "description": "Enable Alerting.", - "type": "boolean", - "x-nullable": true, - "x-order": 7 - }, - "pmm_public_address": { - "description": "PMM Server public address.", - "type": "string", - "x-nullable": true, - "x-order": 8 - }, - "advisor_run_intervals": { - "description": "AdvisorRunIntervals represents intervals between each run of Advisor checks.", - "type": "object", - "properties": { - "standard_interval": { - "description": "Standard check interval.", - "type": "string", - "x-order": 0 - }, - "rare_interval": { - "description": "Interval for rare check runs.", - "type": "string", - "x-order": 1 - }, - "frequent_interval": { - "description": "Interval for frequent check runs.", - "type": "string", - "x-order": 2 - } - }, - "x-order": 9 - }, - "enable_azurediscover": { - "description": "Enable Azure Discover.", - "type": "boolean", - "x-nullable": true, - "x-order": 10 - }, - "enable_backup_management": { - "description": "Enable Backup Management.", - "type": "boolean", - "x-nullable": true, - "x-order": 11 - }, - "enable_access_control": { - "type": "boolean", - "title": "Enable Access Control", - "x-nullable": true, - "x-order": 12 - }, - "enable_internal_pg_qan": { - "description": "Enable Query Analytics for PMM's internal PG database.", - "type": "boolean", - "x-nullable": true, - "x-order": 13 - }, - "update_snooze_duration": { - "description": "A number of full days for which an update is snoozed, i.e. a multiple of 24h: 2592000s, 43200m, 720h.", - "type": "string", - "x-order": 14 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "settings": { - "description": "Settings represents PMM Server settings.", - "type": "object", - "properties": { - "updates_enabled": { - "description": "True if updates are enabled.", - "type": "boolean", - "x-order": 0 - }, - "telemetry_enabled": { - "description": "True if telemetry is enabled.", - "type": "boolean", - "x-order": 1 - }, - "metrics_resolutions": { - "description": "MetricsResolutions represents Prometheus exporters metrics resolutions.", - "type": "object", - "properties": { - "hr": { - "description": "High resolution. Should have a suffix in JSON: 1s, 1m, 1h.", - "type": "string", - "x-order": 0 - }, - "mr": { - "description": "Medium resolution. Should have a suffix in JSON: 1s, 1m, 1h.", - "type": "string", - "x-order": 1 - }, - "lr": { - "description": "Low resolution. Should have a suffix in JSON: 1s, 1m, 1h.", - "type": "string", - "x-order": 2 - } - }, - "x-order": 2 - }, - "data_retention": { - "type": "string", - "x-order": 3 - }, - "ssh_key": { - "type": "string", - "x-order": 4 - }, - "aws_partitions": { - "type": "array", - "items": { - "type": "string" - }, - "x-order": 5 - }, - "advisor_enabled": { - "description": "True if Advisor is enabled.", - "type": "boolean", - "x-order": 6 - }, - "platform_email": { - "description": "Percona Platform user's email, if this PMM instance is linked to the Platform.", - "type": "string", - "x-order": 7 - }, - "alerting_enabled": { - "description": "True if Alerting is enabled.", - "type": "boolean", - "x-order": 8 - }, - "pmm_public_address": { - "description": "PMM Server public address.", - "type": "string", - "x-order": 9 - }, - "advisor_run_intervals": { - "description": "AdvisorRunIntervals represents intervals between each run of Advisor checks.", - "type": "object", - "properties": { - "standard_interval": { - "description": "Standard check interval.", - "type": "string", - "x-order": 0 - }, - "rare_interval": { - "description": "Interval for rare check runs.", - "type": "string", - "x-order": 1 - }, - "frequent_interval": { - "description": "Interval for frequent check runs.", - "type": "string", - "x-order": 2 - } - }, - "x-order": 10 - }, - "backup_management_enabled": { - "description": "True if Backup Management is enabled.", - "type": "boolean", - "x-order": 11 - }, - "azurediscover_enabled": { - "description": "True if Azure Discover is enabled.", - "type": "boolean", - "x-order": 12 - }, - "connected_to_platform": { - "type": "boolean", - "title": "True if the PMM instance is connected to Platform", - "x-order": 13 - }, - "telemetry_summaries": { - "type": "array", - "title": "Includes list of collected telemetry", - "items": { - "type": "string" - }, - "x-order": 14 - }, - "enable_access_control": { - "description": "True if Access Control is enabled.", - "type": "boolean", - "x-order": 15 - }, - "default_role_id": { - "description": "Default Access Control role ID for new users.", - "type": "integer", - "format": "int64", - "x-order": 16 - }, - "enable_internal_pg_qan": { - "description": "True if Query Analytics for PMM's internal PG database is enabled.", - "type": "boolean", - "x-order": 17 - }, - "update_snooze_duration": { - "type": "string", - "title": "Duration for which an update is snoozed", - "x-order": 18 - } - }, - "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": { - "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 }", - "type": "object", - "properties": { - "@type": { - "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.", - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/server/settings/readonly": { - "get": { - "description": "Returns a stripped version of PMM Server settings.", - "tags": [ - "ServerService" - ], - "summary": "Get read-only settings", - "operationId": "GetReadOnlySettings", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "settings": { - "description": "ReadOnlySettings represents a stripped-down version of PMM Server settings that can be accessed by users of all roles.", - "type": "object", - "properties": { - "updates_enabled": { - "description": "True if updates are enabled.", - "type": "boolean", - "x-order": 0 - }, - "telemetry_enabled": { - "description": "True if telemetry is enabled.", - "type": "boolean", - "x-order": 1 - }, - "advisor_enabled": { - "description": "True if Advisor is enabled.", - "type": "boolean", - "x-order": 2 - }, - "alerting_enabled": { - "description": "True if Alerting is enabled.", - "type": "boolean", - "x-order": 3 - }, - "pmm_public_address": { - "description": "PMM Server public address.", - "type": "string", - "x-order": 4 - }, - "backup_management_enabled": { - "description": "True if Backup Management is enabled.", - "type": "boolean", - "x-order": 5 - }, - "azurediscover_enabled": { - "description": "True if Azure Discover is enabled.", - "type": "boolean", - "x-order": 6 - }, - "enable_access_control": { - "description": "True if Access Control is enabled.", - "type": "boolean", - "x-order": 7 - } - }, - "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": { - "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 }", - "type": "object", - "properties": { - "@type": { - "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.", - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/server/updates": { - "get": { - "description": "Checks for available PMM Server updates.", - "tags": [ - "ServerService" - ], - "summary": "Check updates", - "operationId": "CheckUpdates", - "parameters": [ - { - "type": "boolean", - "description": "If false, cached information may be returned.", - "name": "force", - "in": "query" - }, - { - "type": "boolean", - "description": "If true, only installed version will be in response.", - "name": "only_installed_version", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "installed": { - "description": "VersionInfo describes component version, or PMM Server as a whole.", - "type": "object", - "properties": { - "version": { - "description": "User-visible version.", - "type": "string", - "x-order": 0 - }, - "full_version": { - "description": "Full version for debugging.", - "type": "string", - "x-order": 1 - }, - "timestamp": { - "description": "Build or release date.", - "type": "string", - "format": "date-time", - "x-order": 2 - } - }, - "x-order": 0 - }, - "latest": { - "type": "object", - "properties": { - "version": { - "description": "PMM Version.", - "type": "string", - "x-order": 0 - }, - "tag": { - "description": "Docker image tag.", - "type": "string", - "x-order": 1 - }, - "timestamp": { - "description": "Release date.", - "type": "string", - "format": "date-time", - "x-order": 2 - }, - "release_notes_url": { - "description": "Release notes URL for the version (if available).", - "type": "string", - "x-order": 3 - }, - "release_notes_text": { - "description": "Release notes text for the version (if available).", - "type": "string", - "x-order": 4 - } - }, - "x-order": 1 - }, - "update_available": { - "description": "True if there is a PMM Server update available.", - "type": "boolean", - "x-order": 2 - }, - "latest_news_url": { - "description": "Latest available PMM Server release announcement URL.", - "type": "string", - "x-order": 3 - }, - "last_check": { - "description": "Last check time.", - "type": "string", - "format": "date-time", - "x-order": 4 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "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 }", - "type": "object", - "properties": { - "@type": { - "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.", - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/server/updates/changelogs": { - "get": { - "description": "Display a changelog comparing the installed version to the latest available version.", - "tags": [ - "ServerService" - ], - "summary": "Get the changelog", - "operationId": "ListChangeLogs", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "updates": { - "description": "List of available updates.", - "type": "array", - "items": { - "type": "object", - "properties": { - "version": { - "description": "PMM Version.", - "type": "string", - "x-order": 0 - }, - "tag": { - "description": "Docker image tag.", - "type": "string", - "x-order": 1 - }, - "timestamp": { - "description": "Release date.", - "type": "string", - "format": "date-time", - "x-order": 2 - }, - "release_notes_url": { - "description": "Release notes URL for the version (if available).", - "type": "string", - "x-order": 3 - }, - "release_notes_text": { - "description": "Release notes text for the version (if available).", - "type": "string", - "x-order": 4 - } - } - }, - "x-order": 0 - }, - "last_check": { - "description": "Last check time.", - "type": "string", - "format": "date-time", - "x-order": 1 - } - } - } - }, - "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": { - "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 }", - "type": "object", - "properties": { - "@type": { - "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.", - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/server/updates:getStatus": { - "post": { - "description": "Returns PMM Server update status.", - "tags": [ - "ServerService" - ], - "summary": "Update status", - "operationId": "UpdateStatus", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "auth_token": { - "description": "Authentication token.", - "type": "string", - "x-order": 0 - }, - "log_offset": { - "description": "Progress log offset.", - "type": "integer", - "format": "int64", - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "log_lines": { - "description": "Progress log lines.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 0 - }, - "log_offset": { - "description": "Progress log offset for the next request.", - "type": "integer", - "format": "int64", - "x-order": 1 - }, - "done": { - "description": "True when update is done.", - "type": "boolean", - "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": { - "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 }", - "type": "object", - "properties": { - "@type": { - "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.", - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/server/updates:start": { - "post": { - "description": "Starts PMM Server update.", - "tags": [ - "ServerService" - ], - "summary": "Start update", - "operationId": "StartUpdate", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "new_image": { - "type": "string", - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "auth_token": { - "description": "Authentication token for getting update statuses.", - "type": "string", - "x-order": 0 - }, - "log_offset": { - "description": "Progress log offset.", - "type": "integer", - "format": "int64", - "x-order": 1 - } - } - } - }, - "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": { - "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 }", - "type": "object", - "properties": { - "@type": { - "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.", - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/server/version": { - "get": { - "description": "Returns PMM Server versions.", - "tags": [ - "ServerService" - ], - "summary": "Version", - "operationId": "Version", - "parameters": [ - { - "type": "string", - "description": "Dummy parameter for internal testing. Do not use.", - "name": "dummy", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "version": { - "description": "PMM Server version.", - "type": "string", - "x-order": 0 - }, - "server": { - "description": "VersionInfo describes component version, or PMM Server as a whole.", - "type": "object", - "properties": { - "version": { - "description": "User-visible version.", - "type": "string", - "x-order": 0 - }, - "full_version": { - "description": "Full version for debugging.", - "type": "string", - "x-order": 1 - }, - "timestamp": { - "description": "Build or release date.", - "type": "string", - "format": "date-time", - "x-order": 2 - } - }, - "x-order": 1 - }, - "managed": { - "description": "VersionInfo describes component version, or PMM Server as a whole.", - "type": "object", - "properties": { - "version": { - "description": "User-visible version.", - "type": "string", - "x-order": 0 - }, - "full_version": { - "description": "Full version for debugging.", - "type": "string", - "x-order": 1 - }, - "timestamp": { - "description": "Build or release date.", - "type": "string", - "format": "date-time", - "x-order": 2 - } - }, - "x-order": 2 - }, - "distribution_method": { - "description": "DistributionMethod defines PMM Server distribution method: Docker image, OVF/OVA, or AMI.", - "type": "string", - "default": "DISTRIBUTION_METHOD_UNSPECIFIED", - "enum": [ - "DISTRIBUTION_METHOD_UNSPECIFIED", - "DISTRIBUTION_METHOD_DOCKER", - "DISTRIBUTION_METHOD_OVF", - "DISTRIBUTION_METHOD_AMI", - "DISTRIBUTION_METHOD_AZURE", - "DISTRIBUTION_METHOD_DO" - ], - "x-order": 3 - } - } - } - }, - "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": { - "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 }", - "type": "object", - "properties": { - "@type": { - "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.", - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/users": { - "get": { - "description": "Retrieve user details for all users from PMM server", - "tags": [ - "UserService" - ], - "summary": "List all users", - "operationId": "ListUsers", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "users": { - "type": "array", - "items": { - "type": "object", - "properties": { - "user_id": { - "type": "integer", - "format": "int64", - "x-order": 0 - }, - "role_ids": { - "description": "List of role IDs assigned to the user.", - "type": "array", - "items": { - "type": "integer", - "format": "int64" - }, - "x-order": 1 - } - } - }, - "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/users/me": { - "get": { - "description": "Retrieve user details from PMM server", - "tags": [ - "UserService" - ], - "summary": "Get user details", - "operationId": "GetUser", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "user_id": { - "type": "integer", - "format": "int64", - "title": "User ID", - "x-order": 0 - }, - "product_tour_completed": { - "type": "boolean", - "title": "Product Tour", - "x-order": 1 - }, - "alerting_tour_completed": { - "type": "boolean", - "title": "Alerting Tour", - "x-order": 2 - }, - "snoozed_pmm_version": { - "type": "string", - "title": "Snoozed PMM version update", - "x-order": 3 - }, - "snoozed_at": { - "type": "string", - "format": "date-time", - "title": "Timestamp of last snooze", - "x-order": 4 - }, - "snooze_count": { - "type": "integer", - "format": "int64", - "title": "Number of times the update was snoozed", - "x-order": 5 - } - } - } - }, - "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 - } - } - } - } - } - }, - "put": { - "description": "Update user details in PMM server", - "tags": [ - "UserService" - ], - "summary": "Update a user", - "operationId": "UpdateUser", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "product_tour_completed": { - "type": "boolean", - "title": "Product Tour", - "x-nullable": true, - "x-order": 0 - }, - "alerting_tour_completed": { - "type": "boolean", - "title": "Alerting Tour", - "x-nullable": true, - "x-order": 1 - }, - "snoozed_pmm_version": { - "type": "string", - "title": "Snooze update alert for a PMM version", - "x-nullable": true, - "x-order": 2 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "user_id": { - "type": "integer", - "format": "int64", - "title": "User ID", - "x-order": 0 - }, - "product_tour_completed": { - "type": "boolean", - "title": "Product Tour", - "x-order": 1 - }, - "alerting_tour_completed": { - "type": "boolean", - "title": "Alerting Tour", - "x-order": 2 - }, - "snoozed_pmm_version": { - "type": "string", - "title": "Snooze update alert for a PMM version", - "x-order": 3 - }, - "snoozed_at": { - "type": "string", - "format": "date-time", - "title": "Timestamp of last snooze", - "x-order": 4 - }, - "snooze_count": { - "type": "integer", - "format": "int64", - "title": "Number of times the update was snoozed", - "x-order": 5 - } - } - } - }, - "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 - } - } - } - } - } - } - } - }, - "securityDefinitions": { - "basicAuth": { - "type": "basic" - } - }, - "security": [ - { - "basicAuth": [] - } - ], - "tags": [ - { - "name": "ServerService" - }, - { - "name": "UserService" - }, - { - "name": "AgentsService" - }, - { - "name": "NodesService" - }, - { - "name": "ServicesService" - }, - { - "name": "ManagementService" - }, - { - "name": "ActionsService" - }, - { - "name": "AlertingService" - }, - { - "name": "AdvisorService" - }, - { - "name": "BackupService" - }, - { - "name": "LocationsService" - }, - { - "name": "RestoreService" - }, - { - "name": "DumpService" - }, - { - "name": "AccessControlService" - }, - { - "name": "QANService" - }, - { - "name": "PlatformService" - } - ], - "x-readme": { - "samples-languages": [ - "curl", - "go", - "node", - "python" - ] - } -} \ No newline at end of file diff --git a/api/swagger/swagger.json b/api/swagger/swagger.json deleted file mode 100644 index 1dd281af272..00000000000 --- a/api/swagger/swagger.json +++ /dev/null @@ -1,30104 +0,0 @@ -{ - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "schemes": [ - "https", - "http" - ], - "swagger": "2.0", - "info": { - "title": "PMM API", - "version": "v3" - }, - "paths": { - "/v1/actions/{action_id}": { - "get": { - "description": "Gets the result of a given Action.", - "tags": [ - "ActionsService" - ], - "summary": "Get Action", - "operationId": "GetAction", - "parameters": [ - { - "type": "string", - "description": "Unique Action ID.", - "name": "action_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "action_id": { - "description": "Unique Action ID.", - "type": "string", - "x-order": 0 - }, - "pmm_agent_id": { - "description": "pmm-agent ID where this Action is running / was run.", - "type": "string", - "x-order": 1 - }, - "output": { - "description": "Current Action output; may be partial if Action is still running.", - "type": "string", - "x-order": 2 - }, - "done": { - "description": "True if Action is finished.", - "type": "boolean", - "x-order": 3 - }, - "error": { - "description": "Error message if Action failed.", - "type": "string", - "x-order": 4 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/actions:cancelAction": { - "post": { - "description": "Stops an Action.", - "tags": [ - "ActionsService" - ], - "summary": "Cancel an Action", - "operationId": "CancelAction", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "action_id": { - "description": "Unique Action ID. Required.", - "type": "string", - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/actions:startNodeAction": { - "post": { - "description": "Starts 'Percona Toolkit Summary' Action.", - "tags": [ - "ActionsService" - ], - "summary": "Start 'PT Summary' Action", - "operationId": "StartPTSummaryAction", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "pmm_agent_id": { - "description": "pmm-agent ID where to run this Action.", - "type": "string", - "x-order": 0 - }, - "node_id": { - "description": "Node ID for this Action.", - "type": "string", - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "action_id": { - "description": "Unique Action ID.", - "type": "string", - "x-order": 0 - }, - "pmm_agent_id": { - "description": "pmm-agent ID where to this Action was started.", - "type": "string", - "x-order": 1 - } - } - } - }, - "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/actions:startServiceAction": { - "post": { - "description": "Starts a Service Action.", - "tags": [ - "ActionsService" - ], - "summary": "Start a Service Action", - "operationId": "StartServiceAction", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "mysql_explain": { - "type": "object", - "properties": { - "pmm_agent_id": { - "description": "pmm-agent ID where to run this Action.", - "type": "string", - "x-order": 0 - }, - "service_id": { - "description": "Service ID for this Action. Required.", - "type": "string", - "x-order": 1 - }, - "query_id": { - "description": "Query ID of query.", - "type": "string", - "x-order": 2 - }, - "placeholders": { - "type": "array", - "title": "Array of placeholder values", - "items": { - "type": "string" - }, - "x-order": 3 - }, - "database": { - "description": "Database name. Required if it can't be deduced from the query ID.", - "type": "string", - "x-order": 4 - } - }, - "x-order": 0 - }, - "mysql_explain_json": { - "type": "object", - "properties": { - "pmm_agent_id": { - "description": "pmm-agent ID where to run this Action.", - "type": "string", - "x-order": 0 - }, - "service_id": { - "description": "Service ID for this Action. Required.", - "type": "string", - "x-order": 1 - }, - "query_id": { - "description": "Query ID of query.", - "type": "string", - "x-order": 2 - }, - "placeholders": { - "type": "array", - "title": "Array of placeholder values", - "items": { - "type": "string" - }, - "x-order": 3 - }, - "database": { - "description": "Database name. Required if it can't be deduced from the query ID.", - "type": "string", - "x-order": 4 - } - }, - "x-order": 1 - }, - "mysql_explain_traditional_json": { - "type": "object", - "properties": { - "pmm_agent_id": { - "description": "pmm-agent ID where to run this Action.", - "type": "string", - "x-order": 0 - }, - "service_id": { - "description": "Service ID for this Action. Required.", - "type": "string", - "x-order": 1 - }, - "query_id": { - "description": "Query ID of query.", - "type": "string", - "x-order": 2 - }, - "placeholders": { - "type": "array", - "title": "Array of placeholder values", - "items": { - "type": "string" - }, - "x-order": 3 - }, - "database": { - "description": "Database name. Required if it can't be deduced from the query ID.", - "type": "string", - "x-order": 4 - } - }, - "x-order": 2 - }, - "mysql_show_index": { - "type": "object", - "properties": { - "pmm_agent_id": { - "description": "pmm-agent ID where to run this Action.", - "type": "string", - "x-order": 0 - }, - "service_id": { - "description": "Service ID for this Action. Required.", - "type": "string", - "x-order": 1 - }, - "table_name": { - "description": "Table name. Required. May additionally contain a database name.", - "type": "string", - "x-order": 2 - }, - "database": { - "description": "Database name. Required if not given in the table_name field.", - "type": "string", - "x-order": 3 - } - }, - "x-order": 3 - }, - "mysql_show_create_table": { - "type": "object", - "properties": { - "pmm_agent_id": { - "description": "pmm-agent ID where to run this Action.", - "type": "string", - "x-order": 0 - }, - "service_id": { - "description": "Service ID for this Action. Required.", - "type": "string", - "x-order": 1 - }, - "table_name": { - "description": "Table name. Required. May additionally contain a database name.", - "type": "string", - "x-order": 2 - }, - "database": { - "description": "Database name. Required if not given in the table_name field.", - "type": "string", - "x-order": 3 - } - }, - "x-order": 4 - }, - "mysql_show_table_status": { - "type": "object", - "properties": { - "pmm_agent_id": { - "description": "pmm-agent ID where to run this Action.", - "type": "string", - "x-order": 0 - }, - "service_id": { - "description": "Service ID for this Action. Required.", - "type": "string", - "x-order": 1 - }, - "table_name": { - "description": "Table name. Required. May additionally contain a database name.", - "type": "string", - "x-order": 2 - }, - "database": { - "description": "Database name. Required if not given in the table_name field.", - "type": "string", - "x-order": 3 - } - }, - "x-order": 5 - }, - "postgres_show_create_table": { - "type": "object", - "properties": { - "pmm_agent_id": { - "description": "pmm-agent ID where to run this Action.", - "type": "string", - "x-order": 0 - }, - "service_id": { - "description": "Service ID for this Action. Required.", - "type": "string", - "x-order": 1 - }, - "table_name": { - "description": "Table name. Required. May additionally contain a database name.", - "type": "string", - "x-order": 2 - }, - "database": { - "description": "Database name. Required if not given in the table_name field.", - "type": "string", - "x-order": 3 - } - }, - "x-order": 6 - }, - "postgres_show_index": { - "type": "object", - "properties": { - "pmm_agent_id": { - "description": "pmm-agent ID where to run this Action.", - "type": "string", - "x-order": 0 - }, - "service_id": { - "description": "Service ID for this Action. Required.", - "type": "string", - "x-order": 1 - }, - "table_name": { - "description": "Table name. Required. May additionally contain a database name.", - "type": "string", - "x-order": 2 - }, - "database": { - "description": "Database name. Required if not given in the table_name field.", - "type": "string", - "x-order": 3 - } - }, - "x-order": 7 - }, - "mongodb_explain": { - "type": "object", - "properties": { - "pmm_agent_id": { - "description": "pmm-agent ID where to run this Action.", - "type": "string", - "x-order": 0 - }, - "service_id": { - "description": "Service ID for this Action. Required.", - "type": "string", - "x-order": 1 - }, - "query": { - "description": "Query. Required.", - "type": "string", - "x-order": 2 - } - }, - "x-order": 8 - }, - "pt_mongodb_summary": { - "type": "object", - "title": "Message to prepare pt-mongodb-summary data", - "properties": { - "pmm_agent_id": { - "description": "pmm-agent ID where to run this Action.", - "type": "string", - "x-order": 0 - }, - "service_id": { - "description": "Service ID for this Action.", - "type": "string", - "x-order": 1 - } - }, - "x-order": 9 - }, - "pt_mysql_summary": { - "type": "object", - "title": "Message to prepare pt-mysql-summary data", - "properties": { - "pmm_agent_id": { - "description": "pmm-agent ID where to run this Action.", - "type": "string", - "x-order": 0 - }, - "service_id": { - "description": "Service ID for this Action.", - "type": "string", - "x-order": 1 - } - }, - "x-order": 10 - }, - "pt_postgres_summary": { - "type": "object", - "title": "Message to prepare pt-pg-summary data", - "properties": { - "pmm_agent_id": { - "description": "pmm-agent ID where to run this Action.", - "type": "string", - "x-order": 0 - }, - "service_id": { - "description": "Service ID for this Action.", - "type": "string", - "x-order": 1 - } - }, - "x-order": 11 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "mysql_explain": { - "type": "object", - "properties": { - "action_id": { - "description": "Unique Action ID.", - "type": "string", - "x-order": 0 - }, - "pmm_agent_id": { - "description": "pmm-agent ID where to this Action was started.", - "type": "string", - "x-order": 1 - } - }, - "x-order": 0 - }, - "mysql_explain_json": { - "type": "object", - "properties": { - "action_id": { - "description": "Unique Action ID.", - "type": "string", - "x-order": 0 - }, - "pmm_agent_id": { - "description": "pmm-agent ID where to this Action was started.", - "type": "string", - "x-order": 1 - } - }, - "x-order": 1 - }, - "mysql_explain_traditional_json": { - "type": "object", - "properties": { - "action_id": { - "description": "Unique Action ID.", - "type": "string", - "x-order": 0 - }, - "pmm_agent_id": { - "description": "pmm-agent ID where to this Action was started.", - "type": "string", - "x-order": 1 - } - }, - "x-order": 2 - }, - "mysql_show_index": { - "type": "object", - "properties": { - "action_id": { - "description": "Unique Action ID.", - "type": "string", - "x-order": 0 - }, - "pmm_agent_id": { - "description": "pmm-agent ID where to this Action was started.", - "type": "string", - "x-order": 1 - } - }, - "x-order": 3 - }, - "mysql_show_create_table": { - "type": "object", - "properties": { - "action_id": { - "description": "Unique Action ID.", - "type": "string", - "x-order": 0 - }, - "pmm_agent_id": { - "description": "pmm-agent ID where to this Action was started.", - "type": "string", - "x-order": 1 - } - }, - "x-order": 4 - }, - "mysql_show_table_status": { - "type": "object", - "properties": { - "action_id": { - "description": "Unique Action ID.", - "type": "string", - "x-order": 0 - }, - "pmm_agent_id": { - "description": "pmm-agent ID where to this Action was started.", - "type": "string", - "x-order": 1 - } - }, - "x-order": 5 - }, - "postgresql_show_create_table": { - "type": "object", - "properties": { - "action_id": { - "description": "Unique Action ID.", - "type": "string", - "x-order": 0 - }, - "pmm_agent_id": { - "description": "pmm-agent ID where to this Action was started.", - "type": "string", - "x-order": 1 - } - }, - "x-order": 6 - }, - "postgresql_show_index": { - "type": "object", - "properties": { - "action_id": { - "description": "Unique Action ID.", - "type": "string", - "x-order": 0 - }, - "pmm_agent_id": { - "description": "pmm-agent ID where to this Action was started.", - "type": "string", - "x-order": 1 - } - }, - "x-order": 7 - }, - "mongodb_explain": { - "type": "object", - "properties": { - "action_id": { - "description": "Unique Action ID.", - "type": "string", - "x-order": 0 - }, - "pmm_agent_id": { - "description": "pmm-agent ID where to this Action was started.", - "type": "string", - "x-order": 1 - } - }, - "x-order": 8 - }, - "pt_mongodb_summary": { - "type": "object", - "title": "Message to retrieve the prepared pt-mongodb-summary data", - "properties": { - "action_id": { - "description": "Unique Action ID.", - "type": "string", - "x-order": 0 - }, - "pmm_agent_id": { - "description": "pmm-agent ID where to this Action was started.", - "type": "string", - "x-order": 1 - } - }, - "x-order": 9 - }, - "pt_mysql_summary": { - "type": "object", - "title": "Message to retrieve the prepared pt-mysql-summary data", - "properties": { - "action_id": { - "description": "Unique Action ID.", - "type": "string", - "x-order": 0 - }, - "pmm_agent_id": { - "description": "pmm-agent ID where to this Action was started.", - "type": "string", - "x-order": 1 - } - }, - "x-order": 10 - }, - "pt_postgres_summary": { - "type": "object", - "title": "Message to retrieve the prepared pt-pg-summary data", - "properties": { - "action_id": { - "description": "Unique Action ID.", - "type": "string", - "x-order": 0 - }, - "pmm_agent_id": { - "description": "pmm-agent ID where to this Action was started.", - "type": "string", - "x-order": 1 - } - }, - "x-order": 11 - } - } - } - }, - "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/advisors": { - "get": { - "description": "List advisors available to the user.", - "tags": [ - "AdvisorService" - ], - "summary": "List Advisors", - "operationId": "ListAdvisors", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "advisors": { - "type": "array", - "items": { - "type": "object", - "properties": { - "name": { - "description": "Machine-readable name (ID) that is used in expression.", - "type": "string", - "x-order": 0 - }, - "description": { - "description": "Long human-readable description.", - "type": "string", - "x-order": 1 - }, - "summary": { - "description": "Short human-readable summary.", - "type": "string", - "x-order": 2 - }, - "comment": { - "description": "Comment.", - "type": "string", - "x-order": 3 - }, - "category": { - "description": "Category.", - "type": "string", - "x-order": 4 - }, - "checks": { - "description": "Advisor checks.", - "type": "array", - "items": { - "description": "AdvisorCheck contains check name and status.", - "type": "object", - "properties": { - "name": { - "description": "Machine-readable name (ID) that is used in expression.", - "type": "string", - "x-order": 0 - }, - "enabled": { - "description": "True if that check is enabled.", - "type": "boolean", - "x-order": 1 - }, - "description": { - "description": "Long human-readable description.", - "type": "string", - "x-order": 2 - }, - "summary": { - "description": "Short human-readable summary.", - "type": "string", - "x-order": 3 - }, - "interval": { - "description": "AdvisorCheckInterval represents possible execution interval values for checks.", - "type": "string", - "default": "ADVISOR_CHECK_INTERVAL_UNSPECIFIED", - "enum": [ - "ADVISOR_CHECK_INTERVAL_UNSPECIFIED", - "ADVISOR_CHECK_INTERVAL_STANDARD", - "ADVISOR_CHECK_INTERVAL_FREQUENT", - "ADVISOR_CHECK_INTERVAL_RARE" - ], - "x-order": 4 - }, - "family": { - "type": "string", - "default": "ADVISOR_CHECK_FAMILY_UNSPECIFIED", - "enum": [ - "ADVISOR_CHECK_FAMILY_UNSPECIFIED", - "ADVISOR_CHECK_FAMILY_MYSQL", - "ADVISOR_CHECK_FAMILY_POSTGRESQL", - "ADVISOR_CHECK_FAMILY_MONGODB" - ], - "x-order": 5 - } - } - }, - "x-order": 5 - } - } - }, - "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/advisors/checks": { - "get": { - "description": "List advisor checks available to the user.", - "tags": [ - "AdvisorService" - ], - "summary": "List Advisor Checks", - "operationId": "ListAdvisorChecks", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "checks": { - "type": "array", - "items": { - "description": "AdvisorCheck contains check name and status.", - "type": "object", - "properties": { - "name": { - "description": "Machine-readable name (ID) that is used in expression.", - "type": "string", - "x-order": 0 - }, - "enabled": { - "description": "True if that check is enabled.", - "type": "boolean", - "x-order": 1 - }, - "description": { - "description": "Long human-readable description.", - "type": "string", - "x-order": 2 - }, - "summary": { - "description": "Short human-readable summary.", - "type": "string", - "x-order": 3 - }, - "interval": { - "description": "AdvisorCheckInterval represents possible execution interval values for checks.", - "type": "string", - "default": "ADVISOR_CHECK_INTERVAL_UNSPECIFIED", - "enum": [ - "ADVISOR_CHECK_INTERVAL_UNSPECIFIED", - "ADVISOR_CHECK_INTERVAL_STANDARD", - "ADVISOR_CHECK_INTERVAL_FREQUENT", - "ADVISOR_CHECK_INTERVAL_RARE" - ], - "x-order": 4 - }, - "family": { - "type": "string", - "default": "ADVISOR_CHECK_FAMILY_UNSPECIFIED", - "enum": [ - "ADVISOR_CHECK_FAMILY_UNSPECIFIED", - "ADVISOR_CHECK_FAMILY_MYSQL", - "ADVISOR_CHECK_FAMILY_POSTGRESQL", - "ADVISOR_CHECK_FAMILY_MONGODB" - ], - "x-order": 5 - } - } - }, - "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/advisors/checks/failed": { - "get": { - "description": "Returns the latest check results for a given service.", - "tags": [ - "AdvisorService" - ], - "summary": "Get Failed Advisor Checks", - "operationId": "GetFailedChecks", - "parameters": [ - { - "type": "integer", - "format": "int32", - "description": "Maximum number of results per page.", - "name": "page_size", - "in": "query" - }, - { - "type": "integer", - "format": "int32", - "description": "Index of the requested page, starts from 0.", - "name": "page_index", - "in": "query" - }, - { - "type": "string", - "description": "Service ID.", - "name": "service_id", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "total_items": { - "description": "Total number of results.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "total_pages": { - "description": "Total number of pages.", - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "results": { - "type": "array", - "title": "Check results", - "items": { - "description": "CheckResult represents the check results for a given service.", - "type": "object", - "properties": { - "summary": { - "type": "string", - "x-order": 0 - }, - "description": { - "type": "string", - "x-order": 1 - }, - "severity": { - "description": "Severity represents severity level of the check result or alert.", - "type": "string", - "default": "SEVERITY_UNSPECIFIED", - "enum": [ - "SEVERITY_UNSPECIFIED", - "SEVERITY_EMERGENCY", - "SEVERITY_ALERT", - "SEVERITY_CRITICAL", - "SEVERITY_ERROR", - "SEVERITY_WARNING", - "SEVERITY_NOTICE", - "SEVERITY_INFO", - "SEVERITY_DEBUG" - ], - "x-order": 2 - }, - "labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 3 - }, - "read_more_url": { - "description": "URL containing information on how to resolve an issue detected by an Advisor check.", - "type": "string", - "x-order": 4 - }, - "service_name": { - "description": "Name of the monitored service on which the check ran.", - "type": "string", - "x-order": 5 - }, - "service_id": { - "description": "ID of the monitored service on which the check ran.", - "type": "string", - "x-order": 6 - }, - "check_name": { - "type": "string", - "title": "Name of the check that failed", - "x-order": 7 - }, - "silenced": { - "type": "boolean", - "title": "Silence status of the check result", - "x-order": 8 - } - } - }, - "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/advisors/checks:batchChange": { - "post": { - "description": "Enables/disables advisor checks or changes their exec interval.", - "tags": [ - "AdvisorService" - ], - "summary": "Change Advisor Checks", - "operationId": "ChangeAdvisorChecks", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "params": { - "type": "array", - "items": { - "description": "ChangeAdvisorCheckParams specifies a single check parameters.", - "type": "object", - "properties": { - "name": { - "description": "The name of the check to change.", - "type": "string", - "x-order": 0 - }, - "enable": { - "type": "boolean", - "x-nullable": true, - "x-order": 1 - }, - "interval": { - "description": "AdvisorCheckInterval represents possible execution interval values for checks.", - "type": "string", - "default": "ADVISOR_CHECK_INTERVAL_UNSPECIFIED", - "enum": [ - "ADVISOR_CHECK_INTERVAL_UNSPECIFIED", - "ADVISOR_CHECK_INTERVAL_STANDARD", - "ADVISOR_CHECK_INTERVAL_FREQUENT", - "ADVISOR_CHECK_INTERVAL_RARE" - ], - "x-order": 2 - } - } - }, - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/advisors/checks:start": { - "post": { - "description": "Executes Advisor checks and returns when all checks are executed. All available checks will be started if check names aren't specified.", - "tags": [ - "AdvisorService" - ], - "summary": "Start Advisor Checks", - "operationId": "StartAdvisorChecks", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "names": { - "description": "Names of the checks that should be started.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/advisors/failedServices": { - "get": { - "description": "Returns a list of services with failed checks and a summary of check results.", - "tags": [ - "AdvisorService" - ], - "summary": "List Failed Services", - "operationId": "ListFailedServices", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "result": { - "type": "array", - "items": { - "description": "CheckResultSummary is a summary of check results.", - "type": "object", - "properties": { - "service_name": { - "type": "string", - "x-order": 0 - }, - "service_id": { - "type": "string", - "x-order": 1 - }, - "emergency_count": { - "description": "Number of failed checks for this service with severity level \"EMERGENCY\".", - "type": "integer", - "format": "int64", - "x-order": 2 - }, - "alert_count": { - "description": "Number of failed checks for this service with severity level \"ALERT\".", - "type": "integer", - "format": "int64", - "x-order": 3 - }, - "critical_count": { - "description": "Number of failed checks for this service with severity level \"CRITICAL\".", - "type": "integer", - "format": "int64", - "x-order": 4 - }, - "error_count": { - "description": "Number of failed checks for this service with severity level \"ERROR\".", - "type": "integer", - "format": "int64", - "x-order": 5 - }, - "warning_count": { - "description": "Number of failed checks for this service with severity level \"WARNING\".", - "type": "integer", - "format": "int64", - "x-order": 6 - }, - "notice_count": { - "description": "Number of failed checks for this service with severity level \"NOTICE\".", - "type": "integer", - "format": "int64", - "x-order": 7 - }, - "info_count": { - "description": "Number of failed checks for this service with severity level \"INFO\".", - "type": "integer", - "format": "int64", - "x-order": 8 - }, - "debug_count": { - "description": "Number of failed checks for this service with severity level \"DEBUG\".", - "type": "integer", - "format": "int64", - "x-order": 9 - } - } - }, - "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/alerting/rules": { - "post": { - "tags": [ - "AlertingService" - ], - "summary": "CreateRule creates alerting rule from the given template.", - "operationId": "CreateRule", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "template_name": { - "description": "Template name.", - "type": "string", - "x-order": 0 - }, - "name": { - "description": "Rule name.", - "type": "string", - "x-order": 1 - }, - "group": { - "description": "Rule group name.", - "type": "string", - "x-order": 2 - }, - "folder_uid": { - "description": "Folder UID.", - "type": "string", - "x-order": 3 - }, - "params": { - "description": "Rule parameters. All template parameters should be set.", - "type": "array", - "items": { - "description": "ParamValue represents a single rule parameter value.", - "type": "object", - "properties": { - "name": { - "description": "Machine-readable name (ID) that is used in expression.", - "type": "string", - "x-order": 0 - }, - "type": { - "description": "ParamType represents template parameter type.", - "type": "string", - "default": "PARAM_TYPE_UNSPECIFIED", - "enum": [ - "PARAM_TYPE_UNSPECIFIED", - "PARAM_TYPE_BOOL", - "PARAM_TYPE_FLOAT", - "PARAM_TYPE_STRING" - ], - "x-order": 1 - }, - "bool": { - "description": "Bool value.", - "type": "boolean", - "x-order": 2 - }, - "float": { - "description": "Float value.", - "type": "number", - "format": "double", - "x-order": 3 - }, - "string": { - "description": "String value.", - "type": "string", - "x-order": 4 - } - } - }, - "x-order": 4 - }, - "for": { - "description": "Rule duration. Should be set.", - "type": "string", - "x-order": 5 - }, - "severity": { - "description": "Severity represents severity level of the check result or alert.", - "type": "string", - "default": "SEVERITY_UNSPECIFIED", - "enum": [ - "SEVERITY_UNSPECIFIED", - "SEVERITY_EMERGENCY", - "SEVERITY_ALERT", - "SEVERITY_CRITICAL", - "SEVERITY_ERROR", - "SEVERITY_WARNING", - "SEVERITY_NOTICE", - "SEVERITY_INFO", - "SEVERITY_DEBUG" - ], - "x-order": 6 - }, - "custom_labels": { - "description": "All custom labels to add or remove (with empty values) to default labels from template.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 7 - }, - "filters": { - "description": "Filters.", - "type": "array", - "items": { - "description": "Filter represents a single filter condition.", - "type": "object", - "properties": { - "type": { - "description": "FilterType represents filter matching type.", - "type": "string", - "default": "FILTER_TYPE_UNSPECIFIED", - "enum": [ - "FILTER_TYPE_UNSPECIFIED", - "FILTER_TYPE_MATCH", - "FILTER_TYPE_MISMATCH" - ], - "x-order": 0 - }, - "label": { - "type": "string", - "x-order": 1 - }, - "regexp": { - "type": "string", - "x-order": 2 - } - } - }, - "x-order": 8 - }, - "interval": { - "type": "string", - "title": "Evaluation Interval", - "x-order": 9 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/alerting/templates": { - "get": { - "tags": [ - "AlertingService" - ], - "summary": "ListTemplates returns a list of all collected alert rule templates.", - "operationId": "ListTemplates", - "parameters": [ - { - "type": "integer", - "format": "int32", - "description": "Maximum number of results per page.", - "name": "page_size", - "in": "query" - }, - { - "type": "integer", - "format": "int32", - "description": "Index of the requested page, starts from 0.", - "name": "page_index", - "in": "query" - }, - { - "type": "boolean", - "description": "If true, template files will be re-read from disk.", - "name": "reload", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "total_items": { - "description": "Total number of results.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "total_pages": { - "description": "Total number of pages.", - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "templates": { - "description": "Alerting templates.", - "type": "array", - "items": { - "description": "Template represents Alert Template that is used to create Alert Rule.", - "type": "object", - "properties": { - "name": { - "description": "Machine-readable name (ID).", - "type": "string", - "x-order": 0 - }, - "summary": { - "description": "Short human-readable summary.", - "type": "string", - "x-order": 1 - }, - "expr": { - "description": "PromQL query expression with templating parameters.", - "type": "string", - "x-order": 2 - }, - "params": { - "description": "Query parameters definitions.", - "type": "array", - "items": { - "description": "ParamDefinition represents a single query parameter.", - "type": "object", - "properties": { - "name": { - "description": "Machine-readable name (ID) that is used in expression.", - "type": "string", - "x-order": 0 - }, - "summary": { - "description": "Short human-readable parameter summary.", - "type": "string", - "x-order": 1 - }, - "unit": { - "description": "ParamUnit represents template parameter unit.\n\n - PARAM_UNIT_UNSPECIFIED: Invalid, unknown or absent.\n - PARAM_UNIT_PERCENTAGE: %\n - PARAM_UNIT_SECONDS: s", - "type": "string", - "default": "PARAM_UNIT_UNSPECIFIED", - "enum": [ - "PARAM_UNIT_UNSPECIFIED", - "PARAM_UNIT_PERCENTAGE", - "PARAM_UNIT_SECONDS" - ], - "x-order": 2 - }, - "type": { - "description": "ParamType represents template parameter type.", - "type": "string", - "default": "PARAM_TYPE_UNSPECIFIED", - "enum": [ - "PARAM_TYPE_UNSPECIFIED", - "PARAM_TYPE_BOOL", - "PARAM_TYPE_FLOAT", - "PARAM_TYPE_STRING" - ], - "x-order": 3 - }, - "bool": { - "description": "BoolParamDefinition represents boolean parameter's default value.", - "type": "object", - "properties": { - "default": { - "type": "boolean", - "x-nullable": true, - "x-order": 0 - } - }, - "x-order": 4 - }, - "float": { - "description": "FloatParamDefinition represents float parameter's default value and valid range.", - "type": "object", - "properties": { - "default": { - "description": "Default value.", - "type": "number", - "format": "double", - "x-nullable": true, - "x-order": 0 - }, - "min": { - "description": "Minimum valid value (inclusive).", - "type": "number", - "format": "double", - "x-nullable": true, - "x-order": 1 - }, - "max": { - "description": "Maximum valid value (inclusive).", - "type": "number", - "format": "double", - "x-nullable": true, - "x-order": 2 - } - }, - "x-order": 5 - }, - "string": { - "description": "StringParamDefinition represents string parameter's default value.", - "type": "object", - "properties": { - "default": { - "description": "Default value.", - "type": "string", - "x-nullable": true, - "x-order": 0 - } - }, - "x-order": 6 - } - } - }, - "x-order": 3 - }, - "for": { - "description": "Default duration value.", - "type": "string", - "x-order": 4 - }, - "severity": { - "description": "Severity represents severity level of the check result or alert.", - "type": "string", - "default": "SEVERITY_UNSPECIFIED", - "enum": [ - "SEVERITY_UNSPECIFIED", - "SEVERITY_EMERGENCY", - "SEVERITY_ALERT", - "SEVERITY_CRITICAL", - "SEVERITY_ERROR", - "SEVERITY_WARNING", - "SEVERITY_NOTICE", - "SEVERITY_INFO", - "SEVERITY_DEBUG" - ], - "x-order": 5 - }, - "labels": { - "description": "Labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 6 - }, - "annotations": { - "description": "Annotations.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 7 - }, - "source": { - "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.", - "type": "string", - "default": "TEMPLATE_SOURCE_UNSPECIFIED", - "enum": [ - "TEMPLATE_SOURCE_UNSPECIFIED", - "TEMPLATE_SOURCE_BUILT_IN", - "TEMPLATE_SOURCE_SAAS", - "TEMPLATE_SOURCE_USER_FILE", - "TEMPLATE_SOURCE_USER_API" - ], - "x-order": 8 - }, - "created_at": { - "description": "Template creation time. Empty for built-in and SaaS templates.", - "type": "string", - "format": "date-time", - "x-order": 9 - }, - "yaml": { - "description": "YAML template file content. Empty for built-in and SaaS templates.", - "type": "string", - "x-order": 10 - } - } - }, - "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 - } - } - } - } - } - }, - "post": { - "tags": [ - "AlertingService" - ], - "summary": "CreateTemplate creates a new template.", - "operationId": "CreateTemplate", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "yaml": { - "description": "YAML template file content.", - "type": "string", - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/alerting/templates/{name}": { - "put": { - "tags": [ - "AlertingService" - ], - "summary": "UpdateTemplate updates existing template, previously created via API.", - "operationId": "UpdateTemplate", - "parameters": [ - { - "type": "string", - "description": "Machine-readable name (ID).", - "name": "name", - "in": "path", - "required": true - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "yaml": { - "description": "YAML template file content.", - "type": "string", - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - }, - "delete": { - "tags": [ - "AlertingService" - ], - "summary": "DeleteTemplate deletes existing, previously created via API.", - "operationId": "DeleteTemplate", - "parameters": [ - { - "type": "string", - "name": "name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/backups/artifacts": { - "get": { - "description": "Return a list of backup artifacts.", - "tags": [ - "BackupService" - ], - "summary": "List artifacts", - "operationId": "ListArtifacts", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "artifacts": { - "type": "array", - "items": { - "description": "Artifact represents single backup artifact.", - "type": "object", - "properties": { - "artifact_id": { - "description": "Machine-readable artifact ID.", - "type": "string", - "x-order": 0 - }, - "name": { - "type": "string", - "title": "Artifact name", - "x-order": 1 - }, - "vendor": { - "description": "Database vendor e.g. PostgreSQL, MongoDB, MySQL.", - "type": "string", - "x-order": 2 - }, - "location_id": { - "description": "Machine-readable location ID.", - "type": "string", - "x-order": 3 - }, - "location_name": { - "description": "Location name.", - "type": "string", - "x-order": 4 - }, - "service_id": { - "description": "Machine-readable service ID.", - "type": "string", - "x-order": 5 - }, - "service_name": { - "description": "Service name.", - "type": "string", - "x-order": 6 - }, - "data_model": { - "description": "DataModel is a model used for performing a backup.", - "type": "string", - "default": "DATA_MODEL_UNSPECIFIED", - "enum": [ - "DATA_MODEL_UNSPECIFIED", - "DATA_MODEL_PHYSICAL", - "DATA_MODEL_LOGICAL" - ], - "x-order": 7 - }, - "status": { - "description": "BackupStatus shows the current status of execution of backup.", - "type": "string", - "default": "BACKUP_STATUS_UNSPECIFIED", - "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" - ], - "x-order": 8 - }, - "created_at": { - "description": "Artifact creation time.", - "type": "string", - "format": "date-time", - "x-order": 9 - }, - "mode": { - "description": "BackupMode specifies backup mode.", - "type": "string", - "default": "BACKUP_MODE_UNSPECIFIED", - "enum": [ - "BACKUP_MODE_UNSPECIFIED", - "BACKUP_MODE_SNAPSHOT", - "BACKUP_MODE_INCREMENTAL", - "BACKUP_MODE_PITR" - ], - "x-order": 10 - }, - "is_sharded_cluster": { - "description": "Source database setup type.", - "type": "boolean", - "x-order": 11 - }, - "folder": { - "description": "Folder to store artifact on a storage.", - "type": "string", - "x-order": 12 - }, - "metadata_list": { - "description": "List of artifact metadata.", - "type": "array", - "items": { - "description": "Metadata contains extra artifact data like files it consists of, tool specific data, etc.", - "type": "object", - "properties": { - "file_list": { - "description": "List of files backup consists of.", - "type": "array", - "items": { - "description": "File represents file or folder on a storage.", - "type": "object", - "properties": { - "name": { - "type": "string", - "x-order": 0 - }, - "is_directory": { - "type": "boolean", - "x-order": 1 - } - } - }, - "x-order": 0 - }, - "restore_to": { - "description": "Exact time DB can be restored to.", - "type": "string", - "format": "date-time", - "x-order": 1 - }, - "pbm_metadata": { - "description": "PbmMetadata contains additional data for pbm cli tools.", - "type": "object", - "properties": { - "name": { - "description": "Name of backup in backup tool representation.", - "type": "string", - "x-order": 0 - } - }, - "x-order": 2 - } - } - }, - "x-order": 13 - } - } - }, - "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/backups/artifacts/{artifact_id}": { - "delete": { - "description": "Deletes an artifact.", - "tags": [ - "BackupService" - ], - "summary": "Delete Artifact", - "operationId": "DeleteArtifact", - "parameters": [ - { - "type": "string", - "description": "Machine-readable artifact ID.", - "name": "artifact_id", - "in": "path", - "required": true - }, - { - "type": "boolean", - "description": "Removes all the backup files associated with artifact if flag is set.", - "name": "remove_files", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/backups/artifacts/{artifact_id}/pitr-timeranges": { - "get": { - "description": "Return a list of available MongoDB point-in-time-recovery timeranges.", - "tags": [ - "BackupService" - ], - "summary": "List PITR Timeranges", - "operationId": "ListPitrTimeranges", - "parameters": [ - { - "type": "string", - "description": "Artifact ID represents artifact whose location has PITR timeranges to be retrieved.", - "name": "artifact_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "timeranges": { - "type": "array", - "items": { - "type": "object", - "properties": { - "start_timestamp": { - "description": "start_timestamp is the time of the first event in the PITR chunk.", - "type": "string", - "format": "date-time", - "x-order": 0 - }, - "end_timestamp": { - "description": "end_timestamp is the time of the last event in the PITR chunk.", - "type": "string", - "format": "date-time", - "x-order": 1 - } - } - }, - "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/backups/locations": { - "get": { - "description": "List backup locations.", - "tags": [ - "LocationsService" - ], - "summary": "List Backup Locations", - "operationId": "ListLocations", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "locations": { - "type": "array", - "items": { - "description": "Location represents single Backup Location.", - "type": "object", - "properties": { - "location_id": { - "description": "Machine-readable ID.", - "type": "string", - "x-order": 0 - }, - "name": { - "type": "string", - "title": "Location name", - "x-order": 1 - }, - "description": { - "type": "string", - "title": "Short description", - "x-order": 2 - }, - "filesystem_config": { - "description": "FilesystemLocationConfig represents file system location config.", - "type": "object", - "properties": { - "path": { - "type": "string", - "x-order": 0 - } - }, - "x-order": 3 - }, - "s3_config": { - "description": "S3LocationConfig represents S3 bucket configuration.", - "type": "object", - "properties": { - "endpoint": { - "type": "string", - "x-order": 0 - }, - "access_key": { - "type": "string", - "x-order": 1 - }, - "secret_key": { - "type": "string", - "x-order": 2 - }, - "bucket_name": { - "type": "string", - "x-order": 3 - } - }, - "x-order": 4 - } - } - }, - "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 - } - } - } - } - } - }, - "post": { - "description": "Add a backup location.", - "tags": [ - "LocationsService" - ], - "summary": "Add a Backup Location", - "operationId": "AddLocation", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "name": { - "type": "string", - "title": "Location name", - "x-order": 0 - }, - "description": { - "type": "string", - "x-order": 1 - }, - "filesystem_config": { - "description": "FilesystemLocationConfig represents file system location config.", - "type": "object", - "properties": { - "path": { - "type": "string", - "x-order": 0 - } - }, - "x-order": 2 - }, - "s3_config": { - "description": "S3LocationConfig represents S3 bucket configuration.", - "type": "object", - "properties": { - "endpoint": { - "type": "string", - "x-order": 0 - }, - "access_key": { - "type": "string", - "x-order": 1 - }, - "secret_key": { - "type": "string", - "x-order": 2 - }, - "bucket_name": { - "type": "string", - "x-order": 3 - } - }, - "x-order": 3 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "location_id": { - "description": "Machine-readable ID.", - "type": "string", - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/backups/locations/{location_id}": { - "put": { - "description": "Change a backup location.", - "tags": [ - "LocationsService" - ], - "summary": "Change a Backup Location", - "operationId": "ChangeLocation", - "parameters": [ - { - "type": "string", - "description": "Machine-readable ID.", - "name": "location_id", - "in": "path", - "required": true - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "name": { - "type": "string", - "title": "Location name", - "x-order": 0 - }, - "description": { - "type": "string", - "x-order": 1 - }, - "filesystem_config": { - "description": "FilesystemLocationConfig represents file system location config.", - "type": "object", - "properties": { - "path": { - "type": "string", - "x-order": 0 - } - }, - "x-order": 2 - }, - "s3_config": { - "description": "S3LocationConfig represents S3 bucket configuration.", - "type": "object", - "properties": { - "endpoint": { - "type": "string", - "x-order": 0 - }, - "access_key": { - "type": "string", - "x-order": 1 - }, - "secret_key": { - "type": "string", - "x-order": 2 - }, - "bucket_name": { - "type": "string", - "x-order": 3 - } - }, - "x-order": 3 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - }, - "delete": { - "description": "Remove a backup location.", - "tags": [ - "LocationsService" - ], - "summary": "Remove a Scheduled Backup", - "operationId": "RemoveLocation", - "parameters": [ - { - "type": "string", - "description": "Machine-readable ID.", - "name": "location_id", - "in": "path", - "required": true - }, - { - "type": "boolean", - "description": "Force mode", - "name": "force", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/backups/locations:testConfig": { - "post": { - "description": "Test a backup location and credentials.", - "tags": [ - "LocationsService" - ], - "summary": "Test a Backup Location and Credentials", - "operationId": "TestLocationConfig", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "filesystem_config": { - "description": "FilesystemLocationConfig represents file system location config.", - "type": "object", - "properties": { - "path": { - "type": "string", - "x-order": 0 - } - }, - "x-order": 0 - }, - "s3_config": { - "description": "S3LocationConfig represents S3 bucket configuration.", - "type": "object", - "properties": { - "endpoint": { - "type": "string", - "x-order": 0 - }, - "access_key": { - "type": "string", - "x-order": 1 - }, - "secret_key": { - "type": "string", - "x-order": 2 - }, - "bucket_name": { - "type": "string", - "x-order": 3 - } - }, - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/backups/restores": { - "get": { - "description": "List all backup restore history items", - "tags": [ - "RestoreService" - ], - "summary": "List Restore History", - "operationId": "ListRestores", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "items": { - "type": "array", - "items": { - "description": "RestoreHistoryItem represents single backup restore item.", - "type": "object", - "properties": { - "restore_id": { - "description": "Machine-readable restore id.", - "type": "string", - "x-order": 0 - }, - "artifact_id": { - "description": "ID of the artifact used for restore.", - "type": "string", - "x-order": 1 - }, - "name": { - "description": "Artifact name used for restore.", - "type": "string", - "x-order": 2 - }, - "vendor": { - "description": "Database vendor e.g. PostgreSQL, MongoDB, MySQL.", - "type": "string", - "x-order": 3 - }, - "location_id": { - "description": "Machine-readable location ID.", - "type": "string", - "x-order": 4 - }, - "location_name": { - "description": "Location name.", - "type": "string", - "x-order": 5 - }, - "service_id": { - "description": "Machine-readable service ID.", - "type": "string", - "x-order": 6 - }, - "service_name": { - "description": "Service name.", - "type": "string", - "x-order": 7 - }, - "data_model": { - "description": "DataModel is a model used for performing a backup.", - "type": "string", - "default": "DATA_MODEL_UNSPECIFIED", - "enum": [ - "DATA_MODEL_UNSPECIFIED", - "DATA_MODEL_PHYSICAL", - "DATA_MODEL_LOGICAL" - ], - "x-order": 8 - }, - "status": { - "description": "RestoreStatus shows the current status of execution of restore.", - "type": "string", - "default": "RESTORE_STATUS_UNSPECIFIED", - "enum": [ - "RESTORE_STATUS_UNSPECIFIED", - "RESTORE_STATUS_IN_PROGRESS", - "RESTORE_STATUS_SUCCESS", - "RESTORE_STATUS_ERROR" - ], - "x-order": 9 - }, - "started_at": { - "description": "Restore start time.", - "type": "string", - "format": "date-time", - "x-order": 10 - }, - "finished_at": { - "description": "Restore finish time.", - "type": "string", - "format": "date-time", - "x-order": 11 - }, - "pitr_timestamp": { - "description": "PITR timestamp is filled for PITR restores, empty otherwise.", - "type": "string", - "format": "date-time", - "x-order": 12 - } - } - }, - "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/backups/restores/{restore_id}/logs": { - "get": { - "description": "Get logs from the underlying tools for a restore job", - "tags": [ - "RestoreService" - ], - "summary": "Get Logs", - "operationId": "GetLogsMixin5", - "parameters": [ - { - "type": "string", - "name": "restore_id", - "in": "path", - "required": true - }, - { - "type": "integer", - "format": "int64", - "name": "offset", - "in": "query" - }, - { - "type": "integer", - "format": "int64", - "name": "limit", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "logs": { - "type": "array", - "items": { - "description": "LogChunk represent one chunk of logs.", - "type": "object", - "properties": { - "chunk_id": { - "type": "integer", - "format": "int64", - "x-order": 0 - }, - "data": { - "type": "string", - "x-order": 1 - } - } - }, - "x-order": 0 - }, - "end": { - "type": "boolean", - "x-order": 1 - } - } - } - }, - "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/backups/restores:start": { - "post": { - "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", - "tags": [ - "RestoreService" - ], - "summary": "Restore from a Backup", - "operationId": "RestoreBackup", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "service_id": { - "description": "Service identifier where backup should be restored.", - "type": "string", - "x-order": 0 - }, - "artifact_id": { - "description": "Artifact id to restore.", - "type": "string", - "x-order": 1 - }, - "pitr_timestamp": { - "type": "string", - "format": "date-time", - "title": "Timestamp of PITR to restore to", - "x-order": 2 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "restore_id": { - "description": "Unique restore identifier.", - "type": "string", - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/backups/scheduled": { - "get": { - "description": "List all scheduled backups.", - "tags": [ - "BackupService" - ], - "summary": "List Scheduled Backups", - "operationId": "ListScheduledBackups", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "scheduled_backups": { - "type": "array", - "items": { - "description": "ScheduledBackup represents scheduled task for backup.", - "type": "object", - "properties": { - "scheduled_backup_id": { - "description": "Machine-readable ID.", - "type": "string", - "x-order": 0 - }, - "service_id": { - "description": "Machine-readable service ID.", - "type": "string", - "x-order": 1 - }, - "service_name": { - "description": "Service name.", - "type": "string", - "x-order": 2 - }, - "location_id": { - "description": "Machine-readable location ID.", - "type": "string", - "x-order": 3 - }, - "location_name": { - "description": "Location name.", - "type": "string", - "x-order": 4 - }, - "folder": { - "description": "Folder on storage for artifact.", - "type": "string", - "x-order": 5 - }, - "cron_expression": { - "description": "How often backup will be run in cron format.", - "type": "string", - "x-order": 6 - }, - "start_time": { - "description": "First backup wouldn't happen before this time.", - "type": "string", - "format": "date-time", - "x-order": 7 - }, - "name": { - "description": "Artifact name.", - "type": "string", - "x-order": 8 - }, - "description": { - "description": "Description.", - "type": "string", - "x-order": 9 - }, - "enabled": { - "description": "If scheduling is enabled.", - "type": "boolean", - "x-order": 10 - }, - "retries": { - "description": "How many times to retry a failed backup before giving up.", - "type": "integer", - "format": "int64", - "x-order": 11 - }, - "retry_interval": { - "description": "Delay between each retry. Should have a suffix in JSON: 2s, 1m, 1h.", - "type": "string", - "x-order": 12 - }, - "data_model": { - "description": "DataModel is a model used for performing a backup.", - "type": "string", - "default": "DATA_MODEL_UNSPECIFIED", - "enum": [ - "DATA_MODEL_UNSPECIFIED", - "DATA_MODEL_PHYSICAL", - "DATA_MODEL_LOGICAL" - ], - "x-order": 13 - }, - "mode": { - "description": "BackupMode specifies backup mode.", - "type": "string", - "default": "BACKUP_MODE_UNSPECIFIED", - "enum": [ - "BACKUP_MODE_UNSPECIFIED", - "BACKUP_MODE_SNAPSHOT", - "BACKUP_MODE_INCREMENTAL", - "BACKUP_MODE_PITR" - ], - "x-order": 14 - }, - "vendor": { - "description": "Database vendor e.g. PostgreSQL, MongoDB, MySQL.", - "type": "string", - "x-order": 15 - }, - "last_run": { - "description": "Last run.", - "type": "string", - "format": "date-time", - "x-order": 16 - }, - "next_run": { - "description": "Next run.", - "type": "string", - "format": "date-time", - "x-order": 17 - }, - "retention": { - "description": "How many artifacts keep. 0 - unlimited.", - "type": "integer", - "format": "int64", - "x-order": 18 - } - } - }, - "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/backups/{artifact_id}/compatible-services": { - "get": { - "description": "List services that are compatible with the backup artifact.", - "tags": [ - "BackupService" - ], - "summary": "List Compatible Services", - "operationId": "ListArtifactCompatibleServices", - "parameters": [ - { - "type": "string", - "description": "Artifact id used to determine restore compatibility.", - "name": "artifact_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "mysql": { - "type": "array", - "items": { - "description": "MySQLService represents a generic MySQL 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": "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 - }, - "mongodb": { - "type": "array", - "items": { - "description": "MongoDBService represents a generic MongoDB 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": "MongoDB version.", - "type": "string", - "x-order": 10 - } - } - }, - "x-order": 1 - } - } - } - }, - "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/backups/{artifact_id}/logs": { - "get": { - "description": "Get logs from the underlying tools for a backup/restore job.", - "tags": [ - "BackupService" - ], - "summary": "Get Logs", - "operationId": "GetLogs", - "parameters": [ - { - "type": "string", - "name": "artifact_id", - "in": "path", - "required": true - }, - { - "type": "integer", - "format": "int64", - "name": "offset", - "in": "query" - }, - { - "type": "integer", - "format": "int64", - "name": "limit", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "logs": { - "type": "array", - "items": { - "description": "LogChunk represent one chunk of logs.", - "type": "object", - "properties": { - "chunk_id": { - "type": "integer", - "format": "int64", - "x-order": 0 - }, - "data": { - "type": "string", - "x-order": 1 - } - } - }, - "x-order": 0 - }, - "end": { - "type": "boolean", - "x-order": 1 - } - } - } - }, - "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/backups/{scheduled_backup_id}": { - "delete": { - "description": "Remove a scheduled backup.", - "tags": [ - "BackupService" - ], - "summary": "Remove a Scheduled Backup", - "operationId": "RemoveScheduledBackup", - "parameters": [ - { - "type": "string", - "name": "scheduled_backup_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/backups:changeScheduled": { - "put": { - "description": "Change a scheduled backup.", - "tags": [ - "BackupService" - ], - "summary": "Change a Scheduled Backup", - "operationId": "ChangeScheduledBackup", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "scheduled_backup_id": { - "type": "string", - "x-order": 0 - }, - "enabled": { - "type": "boolean", - "x-nullable": true, - "x-order": 1 - }, - "cron_expression": { - "description": "How often backup should be run in cron format.", - "type": "string", - "x-nullable": true, - "x-order": 2 - }, - "start_time": { - "description": "First backup wouldn't happen before this time.", - "type": "string", - "format": "date-time", - "x-order": 3 - }, - "name": { - "description": "Name of backup.", - "type": "string", - "x-nullable": true, - "x-order": 4 - }, - "description": { - "description": "Human-readable description.", - "type": "string", - "x-nullable": true, - "x-order": 5 - }, - "retries": { - "description": "How many times to retry a failed backup before giving up.", - "type": "integer", - "format": "int64", - "x-nullable": true, - "x-order": 6 - }, - "retry_interval": { - "description": "Delay between each retry. Should have a suffix in JSON: 1s, 1m, 1h.", - "type": "string", - "x-order": 7 - }, - "retention": { - "description": "How many artifacts keep. 0 - unlimited.", - "type": "integer", - "format": "int64", - "x-nullable": true, - "x-order": 8 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/backups:schedule": { - "post": { - "description": "Schedule a backup to run at a specified time.", - "tags": [ - "BackupService" - ], - "summary": "Schedule a Backup", - "operationId": "ScheduleBackup", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "service_id": { - "description": "Service identifier where backup should be performed.", - "type": "string", - "x-order": 0 - }, - "location_id": { - "description": "Machine-readable location ID.", - "type": "string", - "x-order": 1 - }, - "folder": { - "description": "How often backup should be run in cron format.\nFolder on storage for artifact.", - "type": "string", - "x-order": 2 - }, - "cron_expression": { - "type": "string", - "x-order": 3 - }, - "start_time": { - "description": "First backup wouldn't happen before this time.", - "type": "string", - "format": "date-time", - "x-order": 4 - }, - "name": { - "description": "Name of backup.", - "type": "string", - "x-order": 5 - }, - "description": { - "description": "Human-readable description.", - "type": "string", - "x-order": 6 - }, - "enabled": { - "description": "If scheduling is enabled.", - "type": "boolean", - "x-order": 7 - }, - "retries": { - "description": "How many times to retry a failed backup before giving up.", - "type": "integer", - "format": "int64", - "x-order": 8 - }, - "retry_interval": { - "description": "Delay between each retry. Should have a suffix in JSON: 1s, 1m, 1h.", - "type": "string", - "x-order": 9 - }, - "mode": { - "description": "BackupMode specifies backup mode.", - "type": "string", - "default": "BACKUP_MODE_UNSPECIFIED", - "enum": [ - "BACKUP_MODE_UNSPECIFIED", - "BACKUP_MODE_SNAPSHOT", - "BACKUP_MODE_INCREMENTAL", - "BACKUP_MODE_PITR" - ], - "x-order": 10 - }, - "data_model": { - "description": "DataModel is a model used for performing a backup.", - "type": "string", - "default": "DATA_MODEL_UNSPECIFIED", - "enum": [ - "DATA_MODEL_UNSPECIFIED", - "DATA_MODEL_PHYSICAL", - "DATA_MODEL_LOGICAL" - ], - "x-order": 11 - }, - "retention": { - "description": "How many artifacts keep. 0 - unlimited.", - "type": "integer", - "format": "int64", - "x-order": 12 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "scheduled_backup_id": { - "type": "string", - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/backups:start": { - "post": { - "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", - "tags": [ - "BackupService" - ], - "summary": "Start a Backup", - "operationId": "StartBackup", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "service_id": { - "description": "Service identifier.", - "type": "string", - "x-order": 0 - }, - "location_id": { - "description": "Machine-readable location ID.", - "type": "string", - "x-order": 1 - }, - "name": { - "description": "If empty then name is auto-generated.", - "type": "string", - "x-order": 2 - }, - "description": { - "description": "Human-readable description.", - "type": "string", - "x-order": 3 - }, - "retry_interval": { - "description": "Delay between each retry. Should have a suffix in JSON: 1s, 1m, 1h.", - "type": "string", - "x-order": 4 - }, - "retries": { - "description": "How many times to retry a failed backup before giving up.", - "type": "integer", - "format": "int64", - "x-order": 5 - }, - "data_model": { - "description": "DataModel is a model used for performing a backup.", - "type": "string", - "default": "DATA_MODEL_UNSPECIFIED", - "enum": [ - "DATA_MODEL_UNSPECIFIED", - "DATA_MODEL_PHYSICAL", - "DATA_MODEL_LOGICAL" - ], - "x-order": 6 - }, - "folder": { - "description": "Folder on storage for artifact.", - "type": "string", - "x-order": 7 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "artifact_id": { - "description": "Unique identifier.", - "type": "string", - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/inventory/agents": { - "get": { - "description": "Returns a list of all Agents.", - "tags": [ - "AgentsService" - ], - "summary": "List Agents", - "operationId": "ListAgents", - "parameters": [ - { - "type": "string", - "description": "Return only Agents started by this pmm-agent.\nExactly one of these parameters should be present: pmm_agent_id, node_id, service_id.", - "name": "pmm_agent_id", - "in": "query" - }, - { - "type": "string", - "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.", - "name": "node_id", - "in": "query" - }, - { - "type": "string", - "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.", - "name": "service_id", - "in": "query" - }, - { - "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" - ], - "type": "string", - "default": "AGENT_TYPE_UNSPECIFIED", - "description": "Return only agents of a particular type.", - "name": "agent_type", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "pmm_agent": { - "type": "array", - "items": { - "description": "PMMAgent runs on Generic or Container Node.", - "type": "object", - "properties": { - "agent_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "runs_on_node_id": { - "description": "Node identifier where this instance runs.", - "type": "string", - "x-order": 1 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 2 - }, - "connected": { - "description": "True if Agent is running and connected to pmm-managed.", - "type": "boolean", - "x-order": 3 - }, - "process_exec_path": { - "description": "Path to exec process.", - "type": "string", - "x-order": 4 - } - } - }, - "x-order": 0 - }, - "vm_agent": { - "type": "array", - "items": { - "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.", - "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 - }, - "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 - }, - "process_exec_path": { - "description": "Path to exec process.", - "type": "string", - "x-order": 3 - }, - "listen_port": { - "description": "Listen port for scraping metrics.", - "type": "integer", - "format": "int64", - "x-order": 4 - } - } - }, - "x-order": 1 - }, - "node_exporter": { - "type": "array", - "items": { - "description": "NodeExporter runs on Generic or Container Node and exposes its 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 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 3 - }, - "push_metrics_enabled": { - "description": "True if exporter uses push metrics mode.", - "type": "boolean", - "x-order": 4 - }, - "disabled_collectors": { - "description": "List of disabled collector names.", - "type": "array", - "items": { - "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.", - "type": "integer", - "format": "int64", - "x-order": 7 - }, - "process_exec_path": { - "description": "Path to exec process.", - "type": "string", - "x-order": 8 - }, - "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": 9 - }, - "expose_exporter": { - "type": "boolean", - "title": "Optionally expose the exporter process on all public interfaces", - "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 - } - } - }, - "x-order": 2 - }, - "mysqld_exporter": { - "type": "array", - "items": { - "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", - "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 - }, - "mongodb_exporter": { - "type": "array", - "items": { - "description": "MongoDBExporter runs on Generic or Container Node and exposes MongoDB 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": "MongoDB 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": 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 - }, - "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": 11 - }, - "stats_collections": { - "type": "array", - "title": "List of colletions to get stats from. Can use *", - "items": { - "type": "string" - }, - "x-order": 12 - }, - "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", - "x-order": 13 - }, - "enable_all_collectors": { - "description": "Enable All collectors.", - "type": "boolean", - "x-order": 14 - }, - "process_exec_path": { - "description": "Path to exec process.", - "type": "string", - "x-order": 15 - }, - "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 - }, - "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.", - "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": 18 - } - } - }, - "x-order": 4 - }, - "postgres_exporter": { - "type": "array", - "items": { - "description": "PostgresExporter runs on Generic or Container Node and exposes PostgreSQL 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": "PostgreSQL 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. Uses sslmode=required instead of verify-full.", - "type": "boolean", - "x-order": 6 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "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 - }, - "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": 11 - }, - "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" - ], - "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 - } - } - }, - "x-order": 5 - }, - "proxysql_exporter": { - "type": "array", - "items": { - "description": "ProxySQLExporter runs on Generic or Container Node and exposes ProxySQL 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": "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": 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 - }, - "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": 11 - }, - "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" - ], - "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.", - "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": 6 - }, - "qan_mysql_perfschema_agent": { - "type": "array", - "items": { - "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.", - "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", - "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 - } - } - }, - "x-order": 7 - }, - "qan_mysql_slowlog_agent": { - "type": "array", - "items": { - "description": "QANMySQLSlowlogAgent 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": { - "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 - }, - "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 - }, - "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": 8 - }, - "qan_mongodb_profiler_agent": { - "type": "array", - "items": { - "description": "QANMongoDBProfilerAgent runs within pmm-agent and sends MongoDB 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": "MongoDB username for getting profiler 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 - }, - "max_query_length": { - "description": "Limit query length in QAN (default: server-defined; -1: no limit).", - "type": "integer", - "format": "int32", - "x-order": 7 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "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", - "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": 9 - }, - "qan_mongodb_mongolog_agent": { - "type": "array", - "items": { - "description": "QANMongoDBMongologAgent runs within pmm-agent and sends MongoDB 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": "MongoDB username for getting profiler 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 - }, - "max_query_length": { - "description": "Limit query length in QAN (default: server-defined; -1: no limit).", - "type": "integer", - "format": "int32", - "x-order": 7 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "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", - "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": 10 - }, - "qan_postgresql_pgstatements_agent": { - "type": "array", - "items": { - "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.", - "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 - }, - "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": 11 - }, - "qan_postgresql_pgstatmonitor_agent": { - "type": "array", - "items": { - "description": "QANPostgreSQLPgStatMonitorAgent 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 monitor 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 - }, - "disable_comments_parsing": { - "description": "Disable parsing comments from queries and showing them in QAN.", - "type": "boolean", - "x-order": 7 - }, - "max_query_length": { - "description": "Limit query length in QAN (default: server-defined; -1: no limit).", - "type": "integer", - "format": "int32", - "x-order": 8 - }, - "query_examples_disabled": { - "description": "True if query examples are disabled.", - "type": "boolean", - "x-order": 9 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "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 - }, - "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" - ], - "x-order": 13 - } - } - }, - "x-order": 12 - }, - "external_exporter": { - "type": "array", - "items": { - "description": "ExternalExporter runs on any Node type, including Remote Node.", - "type": "object", - "properties": { - "agent_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "runs_on_node_id": { - "description": "Node identifier where this instance runs.", - "type": "string", - "x-order": 1 - }, - "disabled": { - "description": "If disabled, metrics from this exporter will not be collected.", - "type": "boolean", - "x-order": 2 - }, - "service_id": { - "description": "Service identifier.", - "type": "string", - "x-order": 3 - }, - "username": { - "description": "HTTP basic auth username for collecting metrics.", - "type": "string", - "x-order": 4 - }, - "scheme": { - "description": "Scheme to generate URI to exporter metrics endpoints.", - "type": "string", - "x-order": 5 - }, - "metrics_path": { - "description": "Path under which metrics are exposed, used to generate URI.", - "type": "string", - "x-order": 6 - }, - "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 - } - } - }, - "x-order": 13 - }, - "rds_exporter": { - "type": "array", - "items": { - "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 - }, - "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.", - "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": { - "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 - }, - "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.", - "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 - } - } - }, - "x-order": 14 - }, - "azure_database_exporter": { - "type": "array", - "items": { - "description": "AzureDatabaseExporter runs on Generic or Container Node and exposes RemoteAzure 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 - }, - "azure_database_subscription_id": { - "description": "Azure database subscription ID.", - "type": "string", - "x-order": 4 - }, - "azure_database_resource_type": { - "type": "string", - "title": "Azure database resource type (mysql, maria, postgres)", - "x-order": 5 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 6 - }, - "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 - }, - "listen_port": { - "description": "Listen port for scraping metrics (the same for several configurations).", - "type": "integer", - "format": "int64", - "x-order": 8 - }, - "push_metrics_enabled": { - "description": "True if the exporter operates in push metrics mode.", - "type": "boolean", - "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 - }, - "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": 12 - } - } - }, - "x-order": 15 - }, - "nomad_agent": { - "type": "array", - "items": { - "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 - }, - "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 - }, - "process_exec_path": { - "description": "Path to exec process.", - "type": "string", - "x-order": 4 - }, - "listen_port": { - "description": "Listen port for scraping metrics.", - "type": "integer", - "format": "int64", - "x-order": 5 - } - } - }, - "x-order": 16 - }, - "valkey_exporter": { - "type": "array", - "items": { - "description": "ValkeyExporter runs on Generic or Container Node and exposes Valkey 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": "Valkey 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 verification.", - "type": "boolean", - "x-order": 6 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "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 - }, - "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": 11 - }, - "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": 13 - }, - "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 - } - } - }, - "x-order": 17 - } - } - } - }, - "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 - } - } - } - } - } - }, - "post": { - "description": "Adds an Agent to Inventory. Only one agent at a time can be passed.", - "tags": [ - "AgentsService" - ], - "summary": "Add an Agent to Inventory", - "operationId": "AddAgent", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "pmm_agent": { - "type": "object", - "properties": { - "runs_on_node_id": { - "description": "Node identifier where this instance runs.", - "type": "string", - "x-order": 0 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 1 - } - }, - "x-order": 0 - }, - "node_exporter": { - "type": "object", - "properties": { - "pmm_agent_id": { - "description": "The pmm-agent identifier which runs this instance.", - "type": "string", - "x-order": 0 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 1 - }, - "push_metrics": { - "description": "Enables push metrics mode for exporter.", - "type": "boolean", - "x-order": 2 - }, - "disable_collectors": { - "description": "List of collector names to disable in this exporter.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 3 - }, - "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": 4 - }, - "expose_exporter": { - "type": "boolean", - "title": "Expose the node_exporter process on all public interfaces", - "x-order": 5 - } - }, - "x-order": 1 - }, - "mysqld_exporter": { - "type": "object", - "properties": { - "pmm_agent_id": { - "description": "The pmm-agent identifier which runs this instance.", - "type": "string", - "x-order": 0 - }, - "service_id": { - "description": "Service identifier.", - "type": "string", - "x-order": 1 - }, - "username": { - "description": "MySQL username for scraping metrics.", - "type": "string", - "x-order": 2 - }, - "password": { - "description": "MySQL password for scraping metrics.", - "type": "string", - "x-order": 3 - }, - "tls": { - "description": "Use TLS for database connections.", - "type": "boolean", - "x-order": 4 - }, - "tls_skip_verify": { - "description": "Skip TLS certificate and hostname validation.", - "type": "boolean", - "x-order": 5 - }, - "tls_ca": { - "description": "Certificate Authority certificate chain.", - "type": "string", - "x-order": 6 - }, - "tls_cert": { - "description": "Client certificate.", - "type": "string", - "x-order": 7 - }, - "tls_key": { - "description": "Password for decrypting tls_cert.", - "type": "string", - "x-order": 8 - }, - "tablestats_group_table_limit": { - "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.", - "type": "integer", - "format": "int32", - "x-order": 9 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 10 - }, - "skip_connection_check": { - "description": "Skip connection check.", - "type": "boolean", - "x-order": 11 - }, - "push_metrics": { - "description": "Enables push metrics mode for exporter.", - "type": "boolean", - "x-order": 12 - }, - "disable_collectors": { - "description": "List of collector names to disable in this exporter.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 13 - }, - "agent_password": { - "description": "Custom password for exporter endpoint /metrics.", - "type": "string", - "x-order": 14 - }, - "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": 15 - }, - "expose_exporter": { - "type": "boolean", - "title": "Optionally expose the exporter process on all public interfaces", - "x-order": 16 - }, - "extra_dsn_params": { - "description": "Extra DSN parameters for MySQL connection.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 17 - } - }, - "x-order": 2 - }, - "mongodb_exporter": { - "type": "object", - "properties": { - "pmm_agent_id": { - "description": "The pmm-agent identifier which runs this instance.", - "type": "string", - "x-order": 0 - }, - "service_id": { - "description": "Service identifier.", - "type": "string", - "x-order": 1 - }, - "username": { - "description": "MongoDB username for scraping metrics.", - "type": "string", - "x-order": 2 - }, - "password": { - "description": "MongoDB password for scraping metrics.", - "type": "string", - "x-order": 3 - }, - "tls": { - "description": "Use TLS for database connections.", - "type": "boolean", - "x-order": 4 - }, - "tls_skip_verify": { - "description": "Skip TLS certificate and hostname validation.", - "type": "boolean", - "x-order": 5 - }, - "tls_certificate_key": { - "description": "Client certificate and key.", - "type": "string", - "x-order": 6 - }, - "tls_certificate_key_file_password": { - "description": "Password for decrypting tls_certificate_key.", - "type": "string", - "x-order": 7 - }, - "tls_ca": { - "description": "Certificate Authority certificate chain.", - "type": "string", - "x-order": 8 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 9 - }, - "skip_connection_check": { - "description": "Skip connection check.", - "type": "boolean", - "x-order": 10 - }, - "push_metrics": { - "description": "Enables push metrics mode for exporter.", - "type": "boolean", - "x-order": 11 - }, - "disable_collectors": { - "description": "List of collector names to disable in this exporter.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 12 - }, - "authentication_mechanism": { - "description": "Authentication mechanism.\nSee https://docs.mongodb.com/manual/reference/connection-string/#mongodb-urioption-urioption.authMechanism\nfor details.", - "type": "string", - "x-order": 13 - }, - "authentication_database": { - "description": "Authentication database.", - "type": "string", - "x-order": 14 - }, - "agent_password": { - "description": "Custom password for exporter endpoint /metrics.", - "type": "string", - "x-order": 15 - }, - "stats_collections": { - "type": "array", - "title": "List of colletions to get stats from. Can use *", - "items": { - "type": "string" - }, - "x-order": 16 - }, - "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", - "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", - "x-order": 19 - } - }, - "x-order": 3 - }, - "postgres_exporter": { - "type": "object", - "properties": { - "pmm_agent_id": { - "description": "The pmm-agent identifier which runs this instance.", - "type": "string", - "x-order": 0 - }, - "service_id": { - "description": "Service identifier.", - "type": "string", - "x-order": 1 - }, - "username": { - "description": "PostgreSQL username for scraping metrics.", - "type": "string", - "x-order": 2 - }, - "password": { - "description": "PostgreSQL password for scraping metrics.", - "type": "string", - "x-order": 3 - }, - "tls": { - "description": "Use TLS for database connections.", - "type": "boolean", - "x-order": 4 - }, - "tls_skip_verify": { - "description": "Skip TLS certificate and hostname validation. Uses sslmode=required instead of verify-full.", - "type": "boolean", - "x-order": 5 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 6 - }, - "skip_connection_check": { - "description": "Skip connection check.", - "type": "boolean", - "x-order": 7 - }, - "push_metrics": { - "description": "Enables push metrics mode for exporter.", - "type": "boolean", - "x-order": 8 - }, - "disable_collectors": { - "description": "List of collector names to disable in this exporter.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 9 - }, - "tls_ca": { - "description": "TLS CA certificate.", - "type": "string", - "x-order": 10 - }, - "tls_cert": { - "description": "TLS Certifcate.", - "type": "string", - "x-order": 11 - }, - "tls_key": { - "description": "TLS Certificate Key.", - "type": "string", - "x-order": 12 - }, - "agent_password": { - "description": "Custom password for exporter endpoint /metrics.", - "type": "string", - "x-order": 13 - }, - "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": 14 - }, - "auto_discovery_limit": { - "description": "Limit of databases for auto-discovery.", - "type": "integer", - "format": "int32", - "x-order": 15 - }, - "expose_exporter": { - "type": "boolean", - "title": "Optionally expose the exporter process on all public interfaces", - "x-order": 16 - }, - "max_exporter_connections": { - "description": "Maximum number of connections that exporter can open to the database instance.", - "type": "integer", - "format": "int32", - "x-order": 17 - } - }, - "x-order": 4 - }, - "proxysql_exporter": { - "type": "object", - "properties": { - "pmm_agent_id": { - "description": "The pmm-agent identifier which runs this instance.", - "type": "string", - "x-order": 0 - }, - "service_id": { - "description": "Service identifier.", - "type": "string", - "x-order": 1 - }, - "username": { - "description": "ProxySQL username for scraping metrics.", - "type": "string", - "x-order": 2 - }, - "password": { - "description": "ProxySQL password for scraping metrics.", - "type": "string", - "x-order": 3 - }, - "tls": { - "description": "Use TLS for database connections.", - "type": "boolean", - "x-order": 4 - }, - "tls_skip_verify": { - "description": "Skip TLS certificate and hostname validation.", - "type": "boolean", - "x-order": 5 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 6 - }, - "skip_connection_check": { - "description": "Skip connection check.", - "type": "boolean", - "x-order": 7 - }, - "push_metrics": { - "description": "Enables push metrics mode for exporter.", - "type": "boolean", - "x-order": 8 - }, - "disable_collectors": { - "description": "List of collector names to disable in this exporter.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 9 - }, - "agent_password": { - "description": "Custom password for exporter endpoint /metrics.", - "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 - }, - "expose_exporter": { - "type": "boolean", - "title": "Optionally expose the exporter process on all public interfaces", - "x-order": 12 - } - }, - "x-order": 5 - }, - "external_exporter": { - "type": "object", - "properties": { - "runs_on_node_id": { - "description": "The node identifier where this instance is run.", - "type": "string", - "x-order": 0 - }, - "service_id": { - "description": "Service identifier.", - "type": "string", - "x-order": 1 - }, - "username": { - "description": "HTTP basic auth username for collecting metrics.", - "type": "string", - "x-order": 2 - }, - "password": { - "description": "HTTP basic auth password for collecting metrics.", - "type": "string", - "x-order": 3 - }, - "scheme": { - "description": "Scheme to generate URI to exporter metrics endpoints(default: http).", - "type": "string", - "x-order": 4 - }, - "metrics_path": { - "description": "Path under which metrics are exposed, used to generate URI(default: /metrics).", - "type": "string", - "x-order": 5 - }, - "listen_port": { - "description": "Listen port for scraping metrics.", - "type": "integer", - "format": "int64", - "x-order": 6 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 7 - }, - "push_metrics": { - "description": "Enables push metrics mode for exporter.", - "type": "boolean", - "x-order": 8 - }, - "tls_skip_verify": { - "description": "Skip TLS certificate and hostname verification.", - "type": "boolean", - "x-order": 9 - } - }, - "x-order": 6 - }, - "rds_exporter": { - "type": "object", - "properties": { - "pmm_agent_id": { - "description": "The pmm-agent identifier which runs this instance.", - "type": "string", - "x-order": 0 - }, - "node_id": { - "description": "Node identifier.", - "type": "string", - "x-order": 1 - }, - "aws_access_key": { - "description": "AWS Access Key.", - "type": "string", - "x-order": 2 - }, - "aws_secret_key": { - "description": "AWS Secret Key.", - "type": "string", - "x-order": 3 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 4 - }, - "skip_connection_check": { - "description": "Skip connection check.", - "type": "boolean", - "x-order": 5 - }, - "disable_basic_metrics": { - "description": "Disable basic metrics.", - "type": "boolean", - "x-order": 6 - }, - "disable_enhanced_metrics": { - "description": "Disable enhanced metrics.", - "type": "boolean", - "x-order": 7 - }, - "push_metrics": { - "description": "Enables push metrics mode for exporter.", - "type": "boolean", - "x-order": 8 - }, - "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": 9 - } - }, - "x-order": 7 - }, - "azure_database_exporter": { - "type": "object", - "properties": { - "pmm_agent_id": { - "description": "The pmm-agent identifier which runs this instance.", - "type": "string", - "x-order": 0 - }, - "node_id": { - "description": "Node identifier.", - "type": "string", - "x-order": 1 - }, - "azure_client_id": { - "type": "string", - "title": "Azure client ID", - "x-order": 2 - }, - "azure_client_secret": { - "type": "string", - "title": "Azure client secret", - "x-order": 3 - }, - "azure_tenant_id": { - "type": "string", - "title": "Azure tanant ID", - "x-order": 4 - }, - "azure_subscription_id": { - "type": "string", - "title": "Azure subscription ID", - "x-order": 5 - }, - "azure_resource_group": { - "description": "Azure resource group.", - "type": "string", - "x-order": 6 - }, - "azure_database_resource_type": { - "type": "string", - "title": "Azure resource type (mysql, maria, postgres)", - "x-order": 7 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 8 - }, - "skip_connection_check": { - "description": "Skip connection check.", - "type": "boolean", - "x-order": 9 - }, - "push_metrics": { - "description": "Enables push metrics mode for exporter.", - "type": "boolean", - "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": 8 - }, - "qan_mysql_perfschema_agent": { - "type": "object", - "properties": { - "pmm_agent_id": { - "description": "The pmm-agent identifier which runs this instance.", - "type": "string", - "x-order": 0 - }, - "service_id": { - "description": "Service identifier.", - "type": "string", - "x-order": 1 - }, - "username": { - "description": "MySQL username for getting performance data.", - "type": "string", - "x-order": 2 - }, - "password": { - "description": "MySQL password for getting performance data.", - "type": "string", - "x-order": 3 - }, - "tls": { - "description": "Use TLS for database connections.", - "type": "boolean", - "x-order": 4 - }, - "tls_skip_verify": { - "description": "Skip TLS certificate and hostname validation.", - "type": "boolean", - "x-order": 5 - }, - "tls_ca": { - "description": "Certificate Authority certificate chain.", - "type": "string", - "x-order": 6 - }, - "tls_cert": { - "description": "Client certificate.", - "type": "string", - "x-order": 7 - }, - "tls_key": { - "description": "Password for decrypting tls_cert.", - "type": "string", - "x-order": 8 - }, - "max_query_length": { - "type": "integer", - "format": "int32", - "title": "Limit query length in QAN (default: server-defined; -1: no limit)", - "x-order": 9 - }, - "disable_query_examples": { - "description": "Disable query examples.", - "type": "boolean", - "x-order": 10 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 11 - }, - "skip_connection_check": { - "description": "Skip connection check.", - "type": "boolean", - "x-order": 12 - }, - "disable_comments_parsing": { - "description": "Disable parsing comments from queries and showing them in QAN.", - "type": "boolean", - "x-order": 13 - }, - "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": 14 - }, - "extra_dsn_params": { - "description": "Extra DSN parameters for MySQL connection.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 15 - } - }, - "x-order": 9 - }, - "qan_mysql_slowlog_agent": { - "type": "object", - "properties": { - "pmm_agent_id": { - "description": "The pmm-agent identifier which runs this instance.", - "type": "string", - "x-order": 0 - }, - "service_id": { - "description": "Service identifier.", - "type": "string", - "x-order": 1 - }, - "username": { - "description": "MySQL username for getting slowlog data.", - "type": "string", - "x-order": 2 - }, - "password": { - "description": "MySQL password for getting slowlog data.", - "type": "string", - "x-order": 3 - }, - "tls": { - "description": "Use TLS for database connections.", - "type": "boolean", - "x-order": 4 - }, - "tls_skip_verify": { - "description": "Skip TLS certificate and hostname validation.", - "type": "boolean", - "x-order": 5 - }, - "tls_ca": { - "description": "Certificate Authority certificate chain.", - "type": "string", - "x-order": 6 - }, - "tls_cert": { - "description": "Client certificate.", - "type": "string", - "x-order": 7 - }, - "tls_key": { - "description": "Password for decrypting tls_cert.", - "type": "string", - "x-order": 8 - }, - "max_query_length": { - "description": "Limit query length in QAN (default: server-defined; -1: no limit).", - "type": "integer", - "format": "int32", - "x-order": 9 - }, - "disable_query_examples": { - "description": "Disable query examples.", - "type": "boolean", - "x-order": 10 - }, - "max_slowlog_file_size": { - "description": "Rotate slowlog file at this size if \u003e 0.\nUse zero or negative value to disable rotation.", - "type": "string", - "format": "int64", - "x-order": 11 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 12 - }, - "skip_connection_check": { - "description": "Skip connection check.", - "type": "boolean", - "x-order": 13 - }, - "disable_comments_parsing": { - "description": "Disable parsing comments from queries and showing them in QAN.", - "type": "boolean", - "x-order": 14 - }, - "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": 15 - }, - "extra_dsn_params": { - "description": "Extra DSN parameters for MySQL connection.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 16 - } - }, - "x-order": 10 - }, - "qan_mongodb_profiler_agent": { - "type": "object", - "properties": { - "pmm_agent_id": { - "description": "The pmm-agent identifier which runs this instance.", - "type": "string", - "x-order": 0 - }, - "service_id": { - "description": "Service identifier.", - "type": "string", - "x-order": 1 - }, - "username": { - "description": "MongoDB username for getting profile data.", - "type": "string", - "x-order": 2 - }, - "password": { - "description": "MongoDB password for getting profile data.", - "type": "string", - "x-order": 3 - }, - "tls": { - "description": "Use TLS for database connections.", - "type": "boolean", - "x-order": 4 - }, - "tls_skip_verify": { - "description": "Skip TLS certificate and hostname validation.", - "type": "boolean", - "x-order": 5 - }, - "tls_certificate_key": { - "description": "Client certificate and key.", - "type": "string", - "x-order": 6 - }, - "tls_certificate_key_file_password": { - "description": "Password for decrypting tls_certificate_key.", - "type": "string", - "x-order": 7 - }, - "tls_ca": { - "description": "Certificate Authority certificate chain.", - "type": "string", - "x-order": 8 - }, - "max_query_length": { - "description": "Limit query length in QAN (default: server-defined; -1: no limit).", - "type": "integer", - "format": "int32", - "x-order": 9 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 10 - }, - "skip_connection_check": { - "description": "Skip connection check.", - "type": "boolean", - "x-order": 11 - }, - "authentication_mechanism": { - "description": "Authentication mechanism.\nSee https://docs.mongodb.com/manual/reference/connection-string/#mongodb-urioption-urioption.authMechanism\nfor details.", - "type": "string", - "x-order": 12 - }, - "authentication_database": { - "description": "Authentication database.", - "type": "string", - "x-order": 13 - }, - "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": 14 - } - }, - "x-order": 11 - }, - "qan_mongodb_mongolog_agent": { - "type": "object", - "properties": { - "pmm_agent_id": { - "description": "The pmm-agent identifier which runs this instance.", - "type": "string", - "x-order": 0 - }, - "service_id": { - "description": "Service identifier.", - "type": "string", - "x-order": 1 - }, - "username": { - "description": "MongoDB username for getting profile data.", - "type": "string", - "x-order": 2 - }, - "password": { - "description": "MongoDB password for getting profile data.", - "type": "string", - "x-order": 3 - }, - "tls": { - "description": "Use TLS for database connections.", - "type": "boolean", - "x-order": 4 - }, - "tls_skip_verify": { - "description": "Skip TLS certificate and hostname validation.", - "type": "boolean", - "x-order": 5 - }, - "tls_certificate_key": { - "description": "Client certificate and key.", - "type": "string", - "x-order": 6 - }, - "tls_certificate_key_file_password": { - "description": "Password for decrypting tls_certificate_key.", - "type": "string", - "x-order": 7 - }, - "tls_ca": { - "description": "Certificate Authority certificate chain.", - "type": "string", - "x-order": 8 - }, - "max_query_length": { - "description": "Limit query length in QAN (default: server-defined; -1: no limit).", - "type": "integer", - "format": "int32", - "x-order": 9 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 10 - }, - "skip_connection_check": { - "description": "Skip connection check.", - "type": "boolean", - "x-order": 11 - }, - "authentication_mechanism": { - "description": "Authentication mechanism.\nSee https://docs.mongodb.com/manual/reference/connection-string/#mongodb-urioption-urioption.authMechanism\nfor details.", - "type": "string", - "x-order": 12 - }, - "authentication_database": { - "description": "Authentication database.", - "type": "string", - "x-order": 13 - }, - "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": 14 - } - }, - "x-order": 12 - }, - "qan_postgresql_pgstatements_agent": { - "type": "object", - "properties": { - "pmm_agent_id": { - "description": "The pmm-agent identifier which runs this instance.", - "type": "string", - "x-order": 0 - }, - "service_id": { - "description": "Service identifier.", - "type": "string", - "x-order": 1 - }, - "username": { - "description": "PostgreSQL username for getting pg stat statements data.", - "type": "string", - "x-order": 2 - }, - "password": { - "description": "PostgreSQL password for getting pg stat statements data.", - "type": "string", - "x-order": 3 - }, - "tls": { - "description": "Use TLS for database connections.", - "type": "boolean", - "x-order": 4 - }, - "tls_skip_verify": { - "description": "Skip TLS certificate and hostname validation.", - "type": "boolean", - "x-order": 5 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 6 - }, - "skip_connection_check": { - "description": "Skip connection check.", - "type": "boolean", - "x-order": 7 - }, - "disable_comments_parsing": { - "description": "Disable parsing comments from queries and showing them in QAN.", - "type": "boolean", - "x-order": 8 - }, - "max_query_length": { - "description": "Limit query length in QAN (default: server-defined; -1: no limit).", - "type": "integer", - "format": "int32", - "x-order": 9 - }, - "tls_ca": { - "description": "TLS CA certificate.", - "type": "string", - "x-order": 10 - }, - "tls_cert": { - "description": "TLS Certifcate.", - "type": "string", - "x-order": 11 - }, - "tls_key": { - "description": "TLS Certificate Key.", - "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" - ], - "x-order": 13 - } - }, - "x-order": 13 - }, - "qan_postgresql_pgstatmonitor_agent": { - "type": "object", - "properties": { - "pmm_agent_id": { - "description": "The pmm-agent identifier which runs this instance.", - "type": "string", - "x-order": 0 - }, - "service_id": { - "description": "Service identifier.", - "type": "string", - "x-order": 1 - }, - "username": { - "description": "PostgreSQL username for getting pg stat monitor data.", - "type": "string", - "x-order": 2 - }, - "password": { - "description": "PostgreSQL password for getting pg stat monitor data.", - "type": "string", - "x-order": 3 - }, - "tls": { - "description": "Use TLS for database connections.", - "type": "boolean", - "x-order": 4 - }, - "tls_skip_verify": { - "description": "Skip TLS certificate and hostname validation.", - "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 - }, - "disable_query_examples": { - "description": "Disable query examples.", - "type": "boolean", - "x-order": 7 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 8 - }, - "skip_connection_check": { - "description": "Skip connection check.", - "type": "boolean", - "x-order": 9 - }, - "disable_comments_parsing": { - "description": "Disable parsing comments from queries and showing them in QAN.", - "type": "boolean", - "x-order": 10 - }, - "tls_ca": { - "description": "TLS CA certificate.", - "type": "string", - "x-order": 11 - }, - "tls_cert": { - "description": "TLS Certifcate.", - "type": "string", - "x-order": 12 - }, - "tls_key": { - "description": "TLS Certificate Key.", - "type": "string", - "x-order": 13 - }, - "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": 14 - } - }, - "x-order": 14 - }, - "valkey_exporter": { - "type": "object", - "properties": { - "pmm_agent_id": { - "description": "The pmm-agent identifier which runs this instance.", - "type": "string", - "x-order": 0 - }, - "service_id": { - "description": "Service identifier.", - "type": "string", - "x-order": 1 - }, - "username": { - "description": "Valkey username for scraping metrics.", - "type": "string", - "x-order": 2 - }, - "password": { - "description": "Valkey password for scraping metrics.", - "type": "string", - "x-order": 3 - }, - "tls": { - "description": "Use TLS for database connections.", - "type": "boolean", - "x-order": 4 - }, - "tls_skip_verify": { - "description": "Skip TLS certificate and hostname validation.", - "type": "boolean", - "x-order": 5 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 6 - }, - "skip_connection_check": { - "description": "Skip connection check.", - "type": "boolean", - "x-order": 7 - }, - "push_metrics": { - "description": "Enables push metrics mode for exporter.", - "type": "boolean", - "x-order": 8 - }, - "disable_collectors": { - "description": "List of collector names to disable in this exporter.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 9 - }, - "tls_ca": { - "description": "TLS CA certificate.", - "type": "string", - "x-order": 10 - }, - "tls_cert": { - "description": "TLS Certifcate.", - "type": "string", - "x-order": 11 - }, - "tls_key": { - "description": "TLS Certificate Key.", - "type": "string", - "x-order": 12 - }, - "agent_password": { - "description": "Custom password for exporter endpoint /metrics.", - "type": "string", - "x-order": 13 - }, - "expose_exporter": { - "type": "boolean", - "title": "Optionally expose the exporter process on all public interfaces", - "x-order": 14 - } - }, - "x-order": 15 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "pmm_agent": { - "description": "PMMAgent runs on Generic or Container Node.", - "type": "object", - "properties": { - "agent_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "runs_on_node_id": { - "description": "Node identifier where this instance runs.", - "type": "string", - "x-order": 1 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 2 - }, - "connected": { - "description": "True if Agent is running and connected to pmm-managed.", - "type": "boolean", - "x-order": 3 - }, - "process_exec_path": { - "description": "Path to exec process.", - "type": "string", - "x-order": 4 - } - }, - "x-order": 0 - }, - "node_exporter": { - "description": "NodeExporter runs on Generic or Container Node and exposes its 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 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 3 - }, - "push_metrics_enabled": { - "description": "True if exporter uses push metrics mode.", - "type": "boolean", - "x-order": 4 - }, - "disabled_collectors": { - "description": "List of disabled collector names.", - "type": "array", - "items": { - "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.", - "type": "integer", - "format": "int64", - "x-order": 7 - }, - "process_exec_path": { - "description": "Path to exec process.", - "type": "string", - "x-order": 8 - }, - "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": 9 - }, - "expose_exporter": { - "type": "boolean", - "title": "Optionally expose the exporter process on all public interfaces", - "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 - } - }, - "x-order": 1 - }, - "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", - "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": 2 - }, - "mongodb_exporter": { - "description": "MongoDBExporter runs on Generic or Container Node and exposes MongoDB 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": "MongoDB 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": 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 - }, - "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": 11 - }, - "stats_collections": { - "type": "array", - "title": "List of colletions to get stats from. Can use *", - "items": { - "type": "string" - }, - "x-order": 12 - }, - "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", - "x-order": 13 - }, - "enable_all_collectors": { - "description": "Enable All collectors.", - "type": "boolean", - "x-order": 14 - }, - "process_exec_path": { - "description": "Path to exec process.", - "type": "string", - "x-order": 15 - }, - "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 - }, - "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.", - "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": 18 - } - }, - "x-order": 3 - }, - "postgres_exporter": { - "description": "PostgresExporter runs on Generic or Container Node and exposes PostgreSQL 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": "PostgreSQL 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. Uses sslmode=required instead of verify-full.", - "type": "boolean", - "x-order": 6 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "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 - }, - "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": 11 - }, - "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" - ], - "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 - } - }, - "x-order": 4 - }, - "proxysql_exporter": { - "description": "ProxySQLExporter runs on Generic or Container Node and exposes ProxySQL 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": "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": 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 - }, - "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": 11 - }, - "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" - ], - "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.", - "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": 5 - }, - "external_exporter": { - "description": "ExternalExporter runs on any Node type, including Remote Node.", - "type": "object", - "properties": { - "agent_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "runs_on_node_id": { - "description": "Node identifier where this instance runs.", - "type": "string", - "x-order": 1 - }, - "disabled": { - "description": "If disabled, metrics from this exporter will not be collected.", - "type": "boolean", - "x-order": 2 - }, - "service_id": { - "description": "Service identifier.", - "type": "string", - "x-order": 3 - }, - "username": { - "description": "HTTP basic auth username for collecting metrics.", - "type": "string", - "x-order": 4 - }, - "scheme": { - "description": "Scheme to generate URI to exporter metrics endpoints.", - "type": "string", - "x-order": 5 - }, - "metrics_path": { - "description": "Path under which metrics are exposed, used to generate URI.", - "type": "string", - "x-order": 6 - }, - "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 - } - }, - "x-order": 6 - }, - "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 - }, - "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.", - "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": { - "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 - }, - "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.", - "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 - } - }, - "x-order": 7 - }, - "azure_database_exporter": { - "description": "AzureDatabaseExporter runs on Generic or Container Node and exposes RemoteAzure 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 - }, - "azure_database_subscription_id": { - "description": "Azure database subscription ID.", - "type": "string", - "x-order": 4 - }, - "azure_database_resource_type": { - "type": "string", - "title": "Azure database resource type (mysql, maria, postgres)", - "x-order": 5 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 6 - }, - "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 - }, - "listen_port": { - "description": "Listen port for scraping metrics (the same for several configurations).", - "type": "integer", - "format": "int64", - "x-order": 8 - }, - "push_metrics_enabled": { - "description": "True if the exporter operates in push metrics mode.", - "type": "boolean", - "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 - }, - "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": 12 - } - }, - "x-order": 8 - }, - "qan_mysql_perfschema_agent": { - "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.", - "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", - "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 - } - }, - "x-order": 9 - }, - "qan_mysql_slowlog_agent": { - "description": "QANMySQLSlowlogAgent 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": { - "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 - }, - "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 - }, - "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": 10 - }, - "qan_mongodb_profiler_agent": { - "description": "QANMongoDBProfilerAgent runs within pmm-agent and sends MongoDB 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": "MongoDB username for getting profiler 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 - }, - "max_query_length": { - "description": "Limit query length in QAN (default: server-defined; -1: no limit).", - "type": "integer", - "format": "int32", - "x-order": 7 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "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", - "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": 11 - }, - "qan_mongodb_mongolog_agent": { - "description": "QANMongoDBMongologAgent runs within pmm-agent and sends MongoDB 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": "MongoDB username for getting profiler 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 - }, - "max_query_length": { - "description": "Limit query length in QAN (default: server-defined; -1: no limit).", - "type": "integer", - "format": "int32", - "x-order": 7 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "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", - "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": 12 - }, - "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.", - "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 - }, - "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": 13 - }, - "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": { - "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 monitor 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 - }, - "disable_comments_parsing": { - "description": "Disable parsing comments from queries and showing them in QAN.", - "type": "boolean", - "x-order": 7 - }, - "max_query_length": { - "description": "Limit query length in QAN (default: server-defined; -1: no limit).", - "type": "integer", - "format": "int32", - "x-order": 8 - }, - "query_examples_disabled": { - "description": "True if query examples are disabled.", - "type": "boolean", - "x-order": 9 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "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 - }, - "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" - ], - "x-order": 13 - } - }, - "x-order": 14 - }, - "valkey_exporter": { - "description": "ValkeyExporter runs on Generic or Container Node and exposes Valkey 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": "Valkey 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 verification.", - "type": "boolean", - "x-order": 6 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "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 - }, - "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": 11 - }, - "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": 13 - }, - "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 - } - }, - "x-order": 15 - } - } - } - }, - "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/inventory/agents/{agent_id}": { - "get": { - "description": "Returns a single Agent by ID.", - "tags": [ - "AgentsService" - ], - "summary": "Get Agent", - "operationId": "GetAgent", - "parameters": [ - { - "type": "string", - "description": "Unique randomly generated instance identifier.", - "name": "agent_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "pmm_agent": { - "description": "PMMAgent runs on Generic or Container Node.", - "type": "object", - "properties": { - "agent_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "runs_on_node_id": { - "description": "Node identifier where this instance runs.", - "type": "string", - "x-order": 1 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 2 - }, - "connected": { - "description": "True if Agent is running and connected to pmm-managed.", - "type": "boolean", - "x-order": 3 - }, - "process_exec_path": { - "description": "Path to exec process.", - "type": "string", - "x-order": 4 - } - }, - "x-order": 0 - }, - "vmagent": { - "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.", - "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 - }, - "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 - }, - "process_exec_path": { - "description": "Path to exec process.", - "type": "string", - "x-order": 3 - }, - "listen_port": { - "description": "Listen port for scraping metrics.", - "type": "integer", - "format": "int64", - "x-order": 4 - } - }, - "x-order": 1 - }, - "node_exporter": { - "description": "NodeExporter runs on Generic or Container Node and exposes its 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 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 3 - }, - "push_metrics_enabled": { - "description": "True if exporter uses push metrics mode.", - "type": "boolean", - "x-order": 4 - }, - "disabled_collectors": { - "description": "List of disabled collector names.", - "type": "array", - "items": { - "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.", - "type": "integer", - "format": "int64", - "x-order": 7 - }, - "process_exec_path": { - "description": "Path to exec process.", - "type": "string", - "x-order": 8 - }, - "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": 9 - }, - "expose_exporter": { - "type": "boolean", - "title": "Optionally expose the exporter process on all public interfaces", - "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 - } - }, - "x-order": 2 - }, - "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", - "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 - }, - "mongodb_exporter": { - "description": "MongoDBExporter runs on Generic or Container Node and exposes MongoDB 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": "MongoDB 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": 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 - }, - "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": 11 - }, - "stats_collections": { - "type": "array", - "title": "List of colletions to get stats from. Can use *", - "items": { - "type": "string" - }, - "x-order": 12 - }, - "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", - "x-order": 13 - }, - "enable_all_collectors": { - "description": "Enable All collectors.", - "type": "boolean", - "x-order": 14 - }, - "process_exec_path": { - "description": "Path to exec process.", - "type": "string", - "x-order": 15 - }, - "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 - }, - "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.", - "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": 18 - } - }, - "x-order": 4 - }, - "postgres_exporter": { - "description": "PostgresExporter runs on Generic or Container Node and exposes PostgreSQL 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": "PostgreSQL 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. Uses sslmode=required instead of verify-full.", - "type": "boolean", - "x-order": 6 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "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 - }, - "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": 11 - }, - "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" - ], - "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 - } - }, - "x-order": 5 - }, - "proxysql_exporter": { - "description": "ProxySQLExporter runs on Generic or Container Node and exposes ProxySQL 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": "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": 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 - }, - "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": 11 - }, - "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" - ], - "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.", - "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": 6 - }, - "qan_mysql_perfschema_agent": { - "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.", - "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", - "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 - } - }, - "x-order": 7 - }, - "qan_mysql_slowlog_agent": { - "description": "QANMySQLSlowlogAgent 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": { - "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 - }, - "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 - }, - "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": 8 - }, - "qan_mongodb_profiler_agent": { - "description": "QANMongoDBProfilerAgent runs within pmm-agent and sends MongoDB 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": "MongoDB username for getting profiler 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 - }, - "max_query_length": { - "description": "Limit query length in QAN (default: server-defined; -1: no limit).", - "type": "integer", - "format": "int32", - "x-order": 7 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "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", - "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": 9 - }, - "qan_mongodb_mongolog_agent": { - "description": "QANMongoDBMongologAgent runs within pmm-agent and sends MongoDB 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": "MongoDB username for getting profiler 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 - }, - "max_query_length": { - "description": "Limit query length in QAN (default: server-defined; -1: no limit).", - "type": "integer", - "format": "int32", - "x-order": 7 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "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", - "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": 10 - }, - "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.", - "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 - }, - "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": 11 - }, - "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": { - "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 monitor 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 - }, - "disable_comments_parsing": { - "description": "Disable parsing comments from queries and showing them in QAN.", - "type": "boolean", - "x-order": 7 - }, - "max_query_length": { - "description": "Limit query length in QAN (default: server-defined; -1: no limit).", - "type": "integer", - "format": "int32", - "x-order": 8 - }, - "query_examples_disabled": { - "description": "True if query examples are disabled.", - "type": "boolean", - "x-order": 9 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "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 - }, - "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" - ], - "x-order": 13 - } - }, - "x-order": 12 - }, - "external_exporter": { - "description": "ExternalExporter runs on any Node type, including Remote Node.", - "type": "object", - "properties": { - "agent_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "runs_on_node_id": { - "description": "Node identifier where this instance runs.", - "type": "string", - "x-order": 1 - }, - "disabled": { - "description": "If disabled, metrics from this exporter will not be collected.", - "type": "boolean", - "x-order": 2 - }, - "service_id": { - "description": "Service identifier.", - "type": "string", - "x-order": 3 - }, - "username": { - "description": "HTTP basic auth username for collecting metrics.", - "type": "string", - "x-order": 4 - }, - "scheme": { - "description": "Scheme to generate URI to exporter metrics endpoints.", - "type": "string", - "x-order": 5 - }, - "metrics_path": { - "description": "Path under which metrics are exposed, used to generate URI.", - "type": "string", - "x-order": 6 - }, - "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 - } - }, - "x-order": 13 - }, - "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 - }, - "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.", - "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": { - "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 - }, - "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.", - "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 - } - }, - "x-order": 14 - }, - "azure_database_exporter": { - "description": "AzureDatabaseExporter runs on Generic or Container Node and exposes RemoteAzure 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 - }, - "azure_database_subscription_id": { - "description": "Azure database subscription ID.", - "type": "string", - "x-order": 4 - }, - "azure_database_resource_type": { - "type": "string", - "title": "Azure database resource type (mysql, maria, postgres)", - "x-order": 5 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 6 - }, - "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 - }, - "listen_port": { - "description": "Listen port for scraping metrics (the same for several configurations).", - "type": "integer", - "format": "int64", - "x-order": 8 - }, - "push_metrics_enabled": { - "description": "True if the exporter operates in push metrics mode.", - "type": "boolean", - "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 - }, - "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": 12 - } - }, - "x-order": 15 - }, - "nomad_agent": { - "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 - }, - "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 - }, - "process_exec_path": { - "description": "Path to exec process.", - "type": "string", - "x-order": 4 - }, - "listen_port": { - "description": "Listen port for scraping metrics.", - "type": "integer", - "format": "int64", - "x-order": 5 - } - }, - "x-order": 16 - }, - "valkey_exporter": { - "description": "ValkeyExporter runs on Generic or Container Node and exposes Valkey 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": "Valkey 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 verification.", - "type": "boolean", - "x-order": 6 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "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 - }, - "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": 11 - }, - "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": 13 - }, - "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 - } - }, - "x-order": 17 - } - } - } - }, - "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 - } - } - } - } - } - }, - "put": { - "description": "Updates an Agent in Inventory. Only one agent at a time can be passed.", - "tags": [ - "AgentsService" - ], - "summary": "Update an Agent in Inventory", - "operationId": "ChangeAgent", - "parameters": [ - { - "type": "string", - "name": "agent_id", - "in": "path", - "required": true - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "node_exporter": { - "type": "object", - "properties": { - "enable": { - "description": "Enable this Agent. Agents are enabled by default when they get added.", - "type": "boolean", - "x-nullable": true, - "x-order": 0 - }, - "custom_labels": { - "description": "A wrapper for map[string]string. This type allows to distinguish between an empty map and a null value.", - "type": "object", - "properties": { - "values": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 0 - } - }, - "x-nullable": true, - "x-order": 1 - }, - "enable_push_metrics": { - "description": "Enables push metrics with vmagent.", - "type": "boolean", - "x-nullable": true, - "x-order": 2 - }, - "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": 3 - } - }, - "x-order": 0 - }, - "mysqld_exporter": { - "type": "object", - "properties": { - "enable": { - "description": "Enable this Agent. Agents are enabled by default when they get added.", - "type": "boolean", - "x-nullable": true, - "x-order": 0 - }, - "custom_labels": { - "description": "A wrapper for map[string]string. This type allows to distinguish between an empty map and a null value.", - "type": "object", - "properties": { - "values": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 0 - } - }, - "x-nullable": true, - "x-order": 1 - }, - "enable_push_metrics": { - "description": "Enables push metrics with vmagent.", - "type": "boolean", - "x-nullable": true, - "x-order": 2 - }, - "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": 3 - } - }, - "x-order": 1 - }, - "mongodb_exporter": { - "type": "object", - "properties": { - "enable": { - "description": "Enable this Agent. Agents are enabled by default when they get added.", - "type": "boolean", - "x-nullable": true, - "x-order": 0 - }, - "custom_labels": { - "description": "A wrapper for map[string]string. This type allows to distinguish between an empty map and a null value.", - "type": "object", - "properties": { - "values": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 0 - } - }, - "x-nullable": true, - "x-order": 1 - }, - "enable_push_metrics": { - "description": "Enables push metrics with vmagent.", - "type": "boolean", - "x-nullable": true, - "x-order": 2 - }, - "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": 3 - } - }, - "x-order": 2 - }, - "postgres_exporter": { - "type": "object", - "properties": { - "enable": { - "description": "Enable this Agent. Agents are enabled by default when they get added.", - "type": "boolean", - "x-nullable": true, - "x-order": 0 - }, - "custom_labels": { - "description": "A wrapper for map[string]string. This type allows to distinguish between an empty map and a null value.", - "type": "object", - "properties": { - "values": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 0 - } - }, - "x-nullable": true, - "x-order": 1 - }, - "enable_push_metrics": { - "description": "Enables push metrics with vmagent.", - "type": "boolean", - "x-nullable": true, - "x-order": 2 - }, - "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": 3 - } - }, - "x-order": 3 - }, - "proxysql_exporter": { - "type": "object", - "properties": { - "enable": { - "description": "Enable this Agent. Agents are enabled by default when they get added.", - "type": "boolean", - "x-nullable": true, - "x-order": 0 - }, - "custom_labels": { - "description": "A wrapper for map[string]string. This type allows to distinguish between an empty map and a null value.", - "type": "object", - "properties": { - "values": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 0 - } - }, - "x-nullable": true, - "x-order": 1 - }, - "enable_push_metrics": { - "description": "Enables push metrics with vmagent.", - "type": "boolean", - "x-nullable": true, - "x-order": 2 - }, - "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": 3 - } - }, - "x-order": 4 - }, - "external_exporter": { - "type": "object", - "properties": { - "enable": { - "description": "Enable this Agent. Agents are enabled by default when they get added.", - "type": "boolean", - "x-nullable": true, - "x-order": 0 - }, - "custom_labels": { - "description": "A wrapper for map[string]string. This type allows to distinguish between an empty map and a null value.", - "type": "object", - "properties": { - "values": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 0 - } - }, - "x-nullable": true, - "x-order": 1 - }, - "enable_push_metrics": { - "description": "Enables push metrics with vmagent.", - "type": "boolean", - "x-nullable": true, - "x-order": 2 - }, - "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": 3 - } - }, - "x-order": 5 - }, - "rds_exporter": { - "type": "object", - "properties": { - "enable": { - "description": "Enable this Agent. Agents are enabled by default when they get added.", - "type": "boolean", - "x-nullable": true, - "x-order": 0 - }, - "custom_labels": { - "description": "A wrapper for map[string]string. This type allows to distinguish between an empty map and a null value.", - "type": "object", - "properties": { - "values": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 0 - } - }, - "x-nullable": true, - "x-order": 1 - }, - "enable_push_metrics": { - "description": "Enables push metrics with vmagent.", - "type": "boolean", - "x-nullable": true, - "x-order": 2 - }, - "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": 3 - } - }, - "x-order": 6 - }, - "azure_database_exporter": { - "type": "object", - "properties": { - "enable": { - "description": "Enable this Agent. Agents are enabled by default when they get added.", - "type": "boolean", - "x-nullable": true, - "x-order": 0 - }, - "custom_labels": { - "description": "A wrapper for map[string]string. This type allows to distinguish between an empty map and a null value.", - "type": "object", - "properties": { - "values": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 0 - } - }, - "x-nullable": true, - "x-order": 1 - }, - "enable_push_metrics": { - "description": "Enables push metrics with vmagent.", - "type": "boolean", - "x-nullable": true, - "x-order": 2 - }, - "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": 3 - } - }, - "x-order": 7 - }, - "qan_mysql_perfschema_agent": { - "type": "object", - "properties": { - "enable": { - "description": "Enable this Agent. Agents are enabled by default when they get added.", - "type": "boolean", - "x-nullable": true, - "x-order": 0 - }, - "custom_labels": { - "description": "A wrapper for map[string]string. This type allows to distinguish between an empty map and a null value.", - "type": "object", - "properties": { - "values": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 0 - } - }, - "x-nullable": true, - "x-order": 1 - }, - "enable_push_metrics": { - "description": "Enables push metrics with vmagent.", - "type": "boolean", - "x-nullable": true, - "x-order": 2 - }, - "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": 3 - } - }, - "x-order": 8 - }, - "qan_mysql_slowlog_agent": { - "type": "object", - "properties": { - "enable": { - "description": "Enable this Agent. Agents are enabled by default when they get added.", - "type": "boolean", - "x-nullable": true, - "x-order": 0 - }, - "custom_labels": { - "description": "A wrapper for map[string]string. This type allows to distinguish between an empty map and a null value.", - "type": "object", - "properties": { - "values": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 0 - } - }, - "x-nullable": true, - "x-order": 1 - }, - "enable_push_metrics": { - "description": "Enables push metrics with vmagent.", - "type": "boolean", - "x-nullable": true, - "x-order": 2 - }, - "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": 3 - } - }, - "x-order": 9 - }, - "qan_mongodb_profiler_agent": { - "type": "object", - "properties": { - "enable": { - "description": "Enable this Agent. Agents are enabled by default when they get added.", - "type": "boolean", - "x-nullable": true, - "x-order": 0 - }, - "custom_labels": { - "description": "A wrapper for map[string]string. This type allows to distinguish between an empty map and a null value.", - "type": "object", - "properties": { - "values": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 0 - } - }, - "x-nullable": true, - "x-order": 1 - }, - "enable_push_metrics": { - "description": "Enables push metrics with vmagent.", - "type": "boolean", - "x-nullable": true, - "x-order": 2 - }, - "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": 3 - } - }, - "x-order": 10 - }, - "qan_mongodb_mongolog_agent": { - "type": "object", - "properties": { - "enable": { - "description": "Enable this Agent. Agents are enabled by default when they get added.", - "type": "boolean", - "x-nullable": true, - "x-order": 0 - }, - "custom_labels": { - "description": "A wrapper for map[string]string. This type allows to distinguish between an empty map and a null value.", - "type": "object", - "properties": { - "values": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 0 - } - }, - "x-nullable": true, - "x-order": 1 - }, - "enable_push_metrics": { - "description": "Enables push metrics with vmagent.", - "type": "boolean", - "x-nullable": true, - "x-order": 2 - }, - "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": 3 - } - }, - "x-order": 11 - }, - "qan_postgresql_pgstatements_agent": { - "type": "object", - "properties": { - "enable": { - "description": "Enable this Agent. Agents are enabled by default when they get added.", - "type": "boolean", - "x-nullable": true, - "x-order": 0 - }, - "custom_labels": { - "description": "A wrapper for map[string]string. This type allows to distinguish between an empty map and a null value.", - "type": "object", - "properties": { - "values": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 0 - } - }, - "x-nullable": true, - "x-order": 1 - }, - "enable_push_metrics": { - "description": "Enables push metrics with vmagent.", - "type": "boolean", - "x-nullable": true, - "x-order": 2 - }, - "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": 3 - } - }, - "x-order": 12 - }, - "qan_postgresql_pgstatmonitor_agent": { - "type": "object", - "properties": { - "enable": { - "description": "Enable this Agent. Agents are enabled by default when they get added.", - "type": "boolean", - "x-nullable": true, - "x-order": 0 - }, - "custom_labels": { - "description": "A wrapper for map[string]string. This type allows to distinguish between an empty map and a null value.", - "type": "object", - "properties": { - "values": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 0 - } - }, - "x-nullable": true, - "x-order": 1 - }, - "enable_push_metrics": { - "description": "Enables push metrics with vmagent.", - "type": "boolean", - "x-nullable": true, - "x-order": 2 - }, - "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": 3 - } - }, - "x-order": 13 - }, - "nomad_agent": { - "type": "object", - "properties": { - "enable": { - "description": "Enable this Agent. Agents are enabled by default when they get added.", - "type": "boolean", - "x-nullable": true, - "x-order": 0 - } - }, - "x-order": 14 - }, - "valkey_exporter": { - "type": "object", - "properties": { - "enable": { - "description": "Enable this Agent. Agents are enabled by default when they get added.", - "type": "boolean", - "x-nullable": true, - "x-order": 0 - }, - "custom_labels": { - "description": "A wrapper for map[string]string. This type allows to distinguish between an empty map and a null value.", - "type": "object", - "properties": { - "values": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 0 - } - }, - "x-nullable": true, - "x-order": 1 - }, - "enable_push_metrics": { - "description": "Enables push metrics with vmagent.", - "type": "boolean", - "x-nullable": true, - "x-order": 2 - }, - "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": 3 - } - }, - "x-order": 15 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "node_exporter": { - "description": "NodeExporter runs on Generic or Container Node and exposes its 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 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 3 - }, - "push_metrics_enabled": { - "description": "True if exporter uses push metrics mode.", - "type": "boolean", - "x-order": 4 - }, - "disabled_collectors": { - "description": "List of disabled collector names.", - "type": "array", - "items": { - "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.", - "type": "integer", - "format": "int64", - "x-order": 7 - }, - "process_exec_path": { - "description": "Path to exec process.", - "type": "string", - "x-order": 8 - }, - "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": 9 - }, - "expose_exporter": { - "type": "boolean", - "title": "Optionally expose the exporter process on all public interfaces", - "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 - } - }, - "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", - "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": 1 - }, - "mongodb_exporter": { - "description": "MongoDBExporter runs on Generic or Container Node and exposes MongoDB 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": "MongoDB 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": 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 - }, - "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": 11 - }, - "stats_collections": { - "type": "array", - "title": "List of colletions to get stats from. Can use *", - "items": { - "type": "string" - }, - "x-order": 12 - }, - "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", - "x-order": 13 - }, - "enable_all_collectors": { - "description": "Enable All collectors.", - "type": "boolean", - "x-order": 14 - }, - "process_exec_path": { - "description": "Path to exec process.", - "type": "string", - "x-order": 15 - }, - "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 - }, - "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.", - "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": 18 - } - }, - "x-order": 2 - }, - "postgres_exporter": { - "description": "PostgresExporter runs on Generic or Container Node and exposes PostgreSQL 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": "PostgreSQL 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. Uses sslmode=required instead of verify-full.", - "type": "boolean", - "x-order": 6 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "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 - }, - "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": 11 - }, - "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" - ], - "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 - } - }, - "x-order": 3 - }, - "proxysql_exporter": { - "description": "ProxySQLExporter runs on Generic or Container Node and exposes ProxySQL 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": "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": 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 - }, - "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": 11 - }, - "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" - ], - "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.", - "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": 4 - }, - "external_exporter": { - "description": "ExternalExporter runs on any Node type, including Remote Node.", - "type": "object", - "properties": { - "agent_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "runs_on_node_id": { - "description": "Node identifier where this instance runs.", - "type": "string", - "x-order": 1 - }, - "disabled": { - "description": "If disabled, metrics from this exporter will not be collected.", - "type": "boolean", - "x-order": 2 - }, - "service_id": { - "description": "Service identifier.", - "type": "string", - "x-order": 3 - }, - "username": { - "description": "HTTP basic auth username for collecting metrics.", - "type": "string", - "x-order": 4 - }, - "scheme": { - "description": "Scheme to generate URI to exporter metrics endpoints.", - "type": "string", - "x-order": 5 - }, - "metrics_path": { - "description": "Path under which metrics are exposed, used to generate URI.", - "type": "string", - "x-order": 6 - }, - "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 - } - }, - "x-order": 5 - }, - "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 - }, - "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.", - "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": { - "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 - }, - "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.", - "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 - } - }, - "x-order": 6 - }, - "azure_database_exporter": { - "description": "AzureDatabaseExporter runs on Generic or Container Node and exposes RemoteAzure 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 - }, - "azure_database_subscription_id": { - "description": "Azure database subscription ID.", - "type": "string", - "x-order": 4 - }, - "azure_database_resource_type": { - "type": "string", - "title": "Azure database resource type (mysql, maria, postgres)", - "x-order": 5 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 6 - }, - "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 - }, - "listen_port": { - "description": "Listen port for scraping metrics (the same for several configurations).", - "type": "integer", - "format": "int64", - "x-order": 8 - }, - "push_metrics_enabled": { - "description": "True if the exporter operates in push metrics mode.", - "type": "boolean", - "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 - }, - "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": 12 - } - }, - "x-order": 7 - }, - "qan_mysql_perfschema_agent": { - "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.", - "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", - "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 - } - }, - "x-order": 8 - }, - "qan_mysql_slowlog_agent": { - "description": "QANMySQLSlowlogAgent 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": { - "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 - }, - "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 - }, - "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": 9 - }, - "qan_mongodb_profiler_agent": { - "description": "QANMongoDBProfilerAgent runs within pmm-agent and sends MongoDB 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": "MongoDB username for getting profiler 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 - }, - "max_query_length": { - "description": "Limit query length in QAN (default: server-defined; -1: no limit).", - "type": "integer", - "format": "int32", - "x-order": 7 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "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", - "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": 10 - }, - "qan_mongodb_mongolog_agent": { - "description": "QANMongoDBMongologAgent runs within pmm-agent and sends MongoDB 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": "MongoDB username for getting profiler 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 - }, - "max_query_length": { - "description": "Limit query length in QAN (default: server-defined; -1: no limit).", - "type": "integer", - "format": "int32", - "x-order": 7 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "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", - "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": 11 - }, - "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.", - "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 - }, - "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": 12 - }, - "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": { - "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 monitor 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 - }, - "disable_comments_parsing": { - "description": "Disable parsing comments from queries and showing them in QAN.", - "type": "boolean", - "x-order": 7 - }, - "max_query_length": { - "description": "Limit query length in QAN (default: server-defined; -1: no limit).", - "type": "integer", - "format": "int32", - "x-order": 8 - }, - "query_examples_disabled": { - "description": "True if query examples are disabled.", - "type": "boolean", - "x-order": 9 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "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 - }, - "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" - ], - "x-order": 13 - } - }, - "x-order": 13 - }, - "nomad_agent": { - "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 - }, - "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 - }, - "process_exec_path": { - "description": "Path to exec process.", - "type": "string", - "x-order": 4 - }, - "listen_port": { - "description": "Listen port for scraping metrics.", - "type": "integer", - "format": "int64", - "x-order": 5 - } - }, - "x-order": 14 - }, - "valkey_exporter": { - "description": "ValkeyExporter runs on Generic or Container Node and exposes Valkey 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": "Valkey 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 verification.", - "type": "boolean", - "x-order": 6 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "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 - }, - "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": 11 - }, - "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": 13 - }, - "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 - } - }, - "x-order": 15 - } - } - } - }, - "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 - } - } - } - } - } - }, - "delete": { - "description": "Removes an Agent from Inventory.", - "tags": [ - "AgentsService" - ], - "summary": "Remove an Agent from Inventory", - "operationId": "RemoveAgent", - "parameters": [ - { - "type": "string", - "name": "agent_id", - "in": "path", - "required": true - }, - { - "type": "boolean", - "description": "Remove agent with all dependencies.", - "name": "force", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/inventory/agents/{agent_id}/logs": { - "get": { - "description": "Returns Agent logs by ID.", - "tags": [ - "AgentsService" - ], - "summary": "Get Agent logs", - "operationId": "GetAgentLogs", - "parameters": [ - { - "type": "string", - "description": "Unique randomly generated instance identifier.", - "name": "agent_id", - "in": "path", - "required": true - }, - { - "type": "integer", - "format": "int64", - "description": "Limit the number of log lines to this value. Pass 0 for no limit.", - "name": "limit", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "logs": { - "type": "array", - "items": { - "type": "string" - }, - "x-order": 0 - }, - "agent_config_log_lines_count": { - "type": "integer", - "format": "int64", - "x-order": 1 - } - } - } - }, - "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/inventory/nodes": { - "get": { - "description": "Returns a list of all Nodes.", - "tags": [ - "NodesService" - ], - "summary": "List Nodes", - "operationId": "ListNodes", - "parameters": [ - { - "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" - ], - "type": "string", - "default": "NODE_TYPE_UNSPECIFIED", - "description": "Return only Nodes with matching Node type.", - "name": "node_type", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "generic": { - "type": "array", - "items": { - "description": "GenericNode represents a bare metal server or virtual machine.", - "type": "object", - "properties": { - "node_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "node_name": { - "description": "Unique across all Nodes user-defined name.", - "type": "string", - "x-order": 1 - }, - "address": { - "description": "Node address (DNS name or IP).", - "type": "string", - "x-order": 2 - }, - "machine_id": { - "description": "Linux machine-id.", - "type": "string", - "x-order": 3 - }, - "distro": { - "description": "Linux distribution name and version.", - "type": "string", - "x-order": 4 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 5 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 6 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 7 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 8 - } - } - }, - "x-order": 0 - }, - "container": { - "type": "array", - "items": { - "description": "ContainerNode represents a Docker container.", - "type": "object", - "properties": { - "node_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "node_name": { - "description": "Unique across all Nodes user-defined name.", - "type": "string", - "x-order": 1 - }, - "address": { - "description": "Node address (DNS name or IP).", - "type": "string", - "x-order": 2 - }, - "machine_id": { - "description": "Linux machine-id of the Generic Node where this Container Node runs.", - "type": "string", - "x-order": 3 - }, - "container_id": { - "description": "Container identifier. If specified, must be a unique Docker container identifier.", - "type": "string", - "x-order": 4 - }, - "container_name": { - "description": "Container name.", - "type": "string", - "x-order": 5 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 6 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 7 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 8 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 9 - } - } - }, - "x-order": 1 - }, - "remote": { - "type": "array", - "items": { - "description": "RemoteNode represents generic remote Node. It's a node where we don't run pmm-agents. Only external exporters can run on Remote Nodes.", - "type": "object", - "properties": { - "node_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "node_name": { - "description": "Unique across all Nodes user-defined name.", - "type": "string", - "x-order": 1 - }, - "address": { - "description": "Node address (DNS name or IP).", - "type": "string", - "x-order": 2 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 3 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 4 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 5 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 6 - } - } - }, - "x-order": 2 - }, - "remote_rds": { - "type": "array", - "items": { - "description": "RemoteRDSNode represents remote RDS Node. Agents can't run on Remote RDS Nodes.", - "type": "object", - "properties": { - "node_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "node_name": { - "description": "Unique across all Nodes user-defined name.", - "type": "string", - "x-order": 1 - }, - "address": { - "description": "DB instance identifier.", - "type": "string", - "x-order": 2 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 3 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 4 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 5 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 6 - }, - "instance_id": { - "description": "AWS instance ID.", - "type": "string", - "x-order": 7 - } - } - }, - "x-order": 3 - }, - "remote_azure_database": { - "type": "array", - "items": { - "description": "RemoteAzureDatabaseNode represents remote AzureDatabase Node. Agents can't run on Remote AzureDatabase Nodes.", - "type": "object", - "properties": { - "node_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "node_name": { - "description": "Unique across all Nodes user-defined name.", - "type": "string", - "x-order": 1 - }, - "address": { - "description": "DB instance identifier.", - "type": "string", - "x-order": 2 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 3 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 4 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 5 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 6 - } - } - }, - "x-order": 4 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - }, - "post": { - "description": "Adds a Node.", - "tags": [ - "NodesService" - ], - "summary": "Add a Node", - "operationId": "AddNode", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "generic": { - "type": "object", - "properties": { - "node_name": { - "description": "Unique across all Nodes user-defined name.", - "type": "string", - "x-order": 0 - }, - "address": { - "description": "Node address (DNS name or IP).", - "type": "string", - "x-order": 1 - }, - "machine_id": { - "description": "Linux machine-id.", - "type": "string", - "x-order": 2 - }, - "distro": { - "description": "Linux distribution name and version.", - "type": "string", - "x-order": 3 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 4 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 5 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 6 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 7 - } - }, - "x-order": 0 - }, - "container": { - "type": "object", - "properties": { - "node_name": { - "description": "Unique across all Nodes user-defined name.", - "type": "string", - "x-order": 0 - }, - "address": { - "description": "Node address (DNS name or IP).", - "type": "string", - "x-order": 1 - }, - "machine_id": { - "description": "Linux machine-id of the Generic Node where this Container Node runs.", - "type": "string", - "x-order": 2 - }, - "container_id": { - "description": "Container identifier. If specified, must be a unique Docker container identifier.", - "type": "string", - "x-order": 3 - }, - "container_name": { - "description": "Container name.", - "type": "string", - "x-order": 4 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 5 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 6 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 7 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 8 - } - }, - "x-order": 1 - }, - "remote": { - "type": "object", - "properties": { - "node_name": { - "description": "Unique across all Nodes user-defined name.", - "type": "string", - "x-order": 0 - }, - "address": { - "description": "Node address (DNS name or IP).", - "type": "string", - "x-order": 1 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 2 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 3 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 4 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 5 - } - }, - "x-order": 2 - }, - "remote_rds": { - "type": "object", - "properties": { - "node_name": { - "description": "Unique across all Nodes user-defined name.", - "type": "string", - "x-order": 0 - }, - "address": { - "description": "DB instance identifier.", - "type": "string", - "x-order": 1 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 2 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 3 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 4 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 5 - } - }, - "x-order": 3 - }, - "remote_azure": { - "type": "object", - "properties": { - "node_name": { - "description": "Unique across all Nodes user-defined name.", - "type": "string", - "x-order": 0 - }, - "address": { - "description": "DB instance identifier.", - "type": "string", - "x-order": 1 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 2 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 3 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 4 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 5 - } - }, - "x-order": 4 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "generic": { - "description": "GenericNode represents a bare metal server or virtual machine.", - "type": "object", - "properties": { - "node_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "node_name": { - "description": "Unique across all Nodes user-defined name.", - "type": "string", - "x-order": 1 - }, - "address": { - "description": "Node address (DNS name or IP).", - "type": "string", - "x-order": 2 - }, - "machine_id": { - "description": "Linux machine-id.", - "type": "string", - "x-order": 3 - }, - "distro": { - "description": "Linux distribution name and version.", - "type": "string", - "x-order": 4 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 5 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 6 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 7 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 8 - } - }, - "x-order": 0 - }, - "container": { - "description": "ContainerNode represents a Docker container.", - "type": "object", - "properties": { - "node_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "node_name": { - "description": "Unique across all Nodes user-defined name.", - "type": "string", - "x-order": 1 - }, - "address": { - "description": "Node address (DNS name or IP).", - "type": "string", - "x-order": 2 - }, - "machine_id": { - "description": "Linux machine-id of the Generic Node where this Container Node runs.", - "type": "string", - "x-order": 3 - }, - "container_id": { - "description": "Container identifier. If specified, must be a unique Docker container identifier.", - "type": "string", - "x-order": 4 - }, - "container_name": { - "description": "Container name.", - "type": "string", - "x-order": 5 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 6 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 7 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 8 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 9 - } - }, - "x-order": 1 - }, - "remote": { - "description": "RemoteNode represents generic remote Node. It's a node where we don't run pmm-agents. Only external exporters can run on Remote Nodes.", - "type": "object", - "properties": { - "node_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "node_name": { - "description": "Unique across all Nodes user-defined name.", - "type": "string", - "x-order": 1 - }, - "address": { - "description": "Node address (DNS name or IP).", - "type": "string", - "x-order": 2 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 3 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 4 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 5 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 6 - } - }, - "x-order": 2 - }, - "remote_rds": { - "description": "RemoteRDSNode represents remote RDS Node. Agents can't run on Remote RDS Nodes.", - "type": "object", - "properties": { - "node_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "node_name": { - "description": "Unique across all Nodes user-defined name.", - "type": "string", - "x-order": 1 - }, - "address": { - "description": "DB instance identifier.", - "type": "string", - "x-order": 2 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 3 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 4 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 5 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 6 - }, - "instance_id": { - "description": "AWS instance ID.", - "type": "string", - "x-order": 7 - } - }, - "x-order": 3 - }, - "remote_azure_database": { - "description": "RemoteAzureDatabaseNode represents remote AzureDatabase Node. Agents can't run on Remote AzureDatabase Nodes.", - "type": "object", - "properties": { - "node_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "node_name": { - "description": "Unique across all Nodes user-defined name.", - "type": "string", - "x-order": 1 - }, - "address": { - "description": "DB instance identifier.", - "type": "string", - "x-order": 2 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 3 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 4 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 5 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 6 - } - }, - "x-order": 4 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/inventory/nodes/{node_id}": { - "get": { - "description": "Returns a single Node by ID.", - "tags": [ - "NodesService" - ], - "summary": "Get a Node", - "operationId": "GetNode", - "parameters": [ - { - "type": "string", - "description": "Unique randomly generated instance identifier.", - "name": "node_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "generic": { - "description": "GenericNode represents a bare metal server or virtual machine.", - "type": "object", - "properties": { - "node_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "node_name": { - "description": "Unique across all Nodes user-defined name.", - "type": "string", - "x-order": 1 - }, - "address": { - "description": "Node address (DNS name or IP).", - "type": "string", - "x-order": 2 - }, - "machine_id": { - "description": "Linux machine-id.", - "type": "string", - "x-order": 3 - }, - "distro": { - "description": "Linux distribution name and version.", - "type": "string", - "x-order": 4 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 5 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 6 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 7 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 8 - } - }, - "x-order": 0 - }, - "container": { - "description": "ContainerNode represents a Docker container.", - "type": "object", - "properties": { - "node_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "node_name": { - "description": "Unique across all Nodes user-defined name.", - "type": "string", - "x-order": 1 - }, - "address": { - "description": "Node address (DNS name or IP).", - "type": "string", - "x-order": 2 - }, - "machine_id": { - "description": "Linux machine-id of the Generic Node where this Container Node runs.", - "type": "string", - "x-order": 3 - }, - "container_id": { - "description": "Container identifier. If specified, must be a unique Docker container identifier.", - "type": "string", - "x-order": 4 - }, - "container_name": { - "description": "Container name.", - "type": "string", - "x-order": 5 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 6 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 7 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 8 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 9 - } - }, - "x-order": 1 - }, - "remote": { - "description": "RemoteNode represents generic remote Node. It's a node where we don't run pmm-agents. Only external exporters can run on Remote Nodes.", - "type": "object", - "properties": { - "node_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "node_name": { - "description": "Unique across all Nodes user-defined name.", - "type": "string", - "x-order": 1 - }, - "address": { - "description": "Node address (DNS name or IP).", - "type": "string", - "x-order": 2 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 3 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 4 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 5 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 6 - } - }, - "x-order": 2 - }, - "remote_rds": { - "description": "RemoteRDSNode represents remote RDS Node. Agents can't run on Remote RDS Nodes.", - "type": "object", - "properties": { - "node_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "node_name": { - "description": "Unique across all Nodes user-defined name.", - "type": "string", - "x-order": 1 - }, - "address": { - "description": "DB instance identifier.", - "type": "string", - "x-order": 2 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 3 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 4 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 5 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 6 - }, - "instance_id": { - "description": "AWS instance ID.", - "type": "string", - "x-order": 7 - } - }, - "x-order": 3 - }, - "remote_azure_database": { - "description": "RemoteAzureDatabaseNode represents remote AzureDatabase Node. Agents can't run on Remote AzureDatabase Nodes.", - "type": "object", - "properties": { - "node_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "node_name": { - "description": "Unique across all Nodes user-defined name.", - "type": "string", - "x-order": 1 - }, - "address": { - "description": "DB instance identifier.", - "type": "string", - "x-order": 2 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 3 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 4 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 5 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 6 - } - }, - "x-order": 4 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - }, - "delete": { - "description": "Removes a Node.", - "tags": [ - "NodesService" - ], - "summary": "Remove a Node", - "operationId": "RemoveNode", - "parameters": [ - { - "type": "string", - "description": "Unique randomly generated instance identifier.", - "name": "node_id", - "in": "path", - "required": true - }, - { - "type": "boolean", - "description": "Remove node with all dependencies.", - "name": "force", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/inventory/services": { - "get": { - "description": "Returns a list of Services filtered by type.", - "tags": [ - "ServicesService" - ], - "summary": "List Services", - "operationId": "ListServices", - "parameters": [ - { - "type": "string", - "description": "Return only Services running on that Node.", - "name": "node_id", - "in": "query" - }, - { - "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" - ], - "type": "string", - "default": "SERVICE_TYPE_UNSPECIFIED", - "description": "Return only services filtered by service type.", - "name": "service_type", - "in": "query" - }, - { - "type": "string", - "description": "Return only services in this external group.", - "name": "external_group", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "mysql": { - "type": "array", - "items": { - "description": "MySQLService represents a generic MySQL 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": "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 - }, - "mongodb": { - "type": "array", - "items": { - "description": "MongoDBService represents a generic MongoDB 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": "MongoDB version.", - "type": "string", - "x-order": 10 - } - } - }, - "x-order": 1 - }, - "postgresql": { - "type": "array", - "items": { - "description": "PostgreSQLService represents a generic PostgreSQL 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 - }, - "database_name": { - "description": "Database name.", - "type": "string", - "x-order": 2 - }, - "node_id": { - "description": "Node identifier where this instance runs.", - "type": "string", - "x-order": 3 - }, - "address": { - "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required.", - "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.", - "type": "string", - "x-order": 9 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 10 - }, - "version": { - "description": "PostgreSQL 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": 2 - }, - "proxysql": { - "type": "array", - "items": { - "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": 3 - }, - "haproxy": { - "type": "array", - "items": { - "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.", - "type": "string", - "x-order": 5 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 6 - } - } - }, - "x-order": 4 - }, - "external": { - "type": "array", - "items": { - "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.", - "type": "string", - "x-order": 7 - } - } - }, - "x-order": 5 - }, - "valkey": { - "type": "array", - "items": { - "description": "ValkeyService represents a generic Valkey 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": "Valkey version.", - "type": "string", - "x-order": 10 - } - } - }, - "x-order": 6 - } - } - } - }, - "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 - } - } - } - } - } - }, - "post": { - "description": "Adds a Service.", - "tags": [ - "ServicesService" - ], - "summary": "Add a Service", - "operationId": "AddService", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "mysql": { - "type": "object", - "properties": { - "service_name": { - "description": "Unique across all Services user-defined name. Required.", - "type": "string", - "x-order": 0 - }, - "node_id": { - "description": "Node identifier where this instance runs. Required.", - "type": "string", - "x-order": 1 - }, - "address": { - "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required.", - "type": "string", - "x-order": 2 - }, - "port": { - "description": "Access port.\nPort is required when the address present.", - "type": "integer", - "format": "int64", - "x-order": 3 - }, - "socket": { - "description": "Access unix socket.\nAddress (and port) or socket is required.", - "type": "string", - "x-order": 4 - }, - "environment": { - "description": "Environment name.", - "type": "string", - "x-order": 5 - }, - "cluster": { - "description": "Cluster name.", - "type": "string", - "x-order": 6 - }, - "replication_set": { - "description": "Replication set name.", - "type": "string", - "x-order": 7 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 8 - }, - "extra_dsn_params": { - "description": "Extra parameters to be added to the DSN.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 9 - } - }, - "x-order": 0 - }, - "mongodb": { - "type": "object", - "properties": { - "service_name": { - "description": "Unique across all Services user-defined name. Required.", - "type": "string", - "x-order": 0 - }, - "node_id": { - "description": "Node identifier where this instance runs. Required.", - "type": "string", - "x-order": 1 - }, - "address": { - "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required.", - "type": "string", - "x-order": 2 - }, - "port": { - "description": "Access port.\nPort is required when the address present.", - "type": "integer", - "format": "int64", - "x-order": 3 - }, - "socket": { - "description": "Access unix socket.\nAddress (and port) or socket is required.", - "type": "string", - "x-order": 4 - }, - "environment": { - "description": "Environment name.", - "type": "string", - "x-order": 5 - }, - "cluster": { - "description": "Cluster name.", - "type": "string", - "x-order": 6 - }, - "replication_set": { - "description": "Replication set name.", - "type": "string", - "x-order": 7 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 8 - } - }, - "x-order": 1 - }, - "postgresql": { - "type": "object", - "properties": { - "service_name": { - "description": "Unique across all Services user-defined name. Required.", - "type": "string", - "x-order": 0 - }, - "node_id": { - "description": "Node identifier where this instance runs. Required.", - "type": "string", - "x-order": 1 - }, - "address": { - "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required.", - "type": "string", - "x-order": 2 - }, - "port": { - "description": "Access port.\nPort is required when the address present.", - "type": "integer", - "format": "int64", - "x-order": 3 - }, - "socket": { - "description": "Access unix socket.\nAddress (and port) or socket is required.", - "type": "string", - "x-order": 4 - }, - "environment": { - "description": "Environment name.", - "type": "string", - "x-order": 5 - }, - "cluster": { - "description": "Cluster name.", - "type": "string", - "x-order": 6 - }, - "replication_set": { - "description": "Replication set name.", - "type": "string", - "x-order": 7 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 8 - }, - "auto_discovery_limit": { - "description": "Limit of databases for auto-discovery.", - "type": "integer", - "format": "int32", - "x-order": 9 - } - }, - "x-order": 2 - }, - "proxysql": { - "type": "object", - "properties": { - "service_name": { - "description": "Unique across all Services user-defined name. Required.", - "type": "string", - "x-order": 0 - }, - "node_id": { - "description": "Node identifier where this instance runs. Required.", - "type": "string", - "x-order": 1 - }, - "address": { - "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required.", - "type": "string", - "x-order": 2 - }, - "port": { - "description": "Access port.\nPort is required when the address present.", - "type": "integer", - "format": "int64", - "x-order": 3 - }, - "socket": { - "description": "Access unix socket.\nAddress (and port) or socket is required.", - "type": "string", - "x-order": 4 - }, - "environment": { - "description": "Environment name.", - "type": "string", - "x-order": 5 - }, - "cluster": { - "description": "Cluster name.", - "type": "string", - "x-order": 6 - }, - "replication_set": { - "description": "Replication set name.", - "type": "string", - "x-order": 7 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 8 - } - }, - "x-order": 3 - }, - "haproxy": { - "type": "object", - "properties": { - "service_name": { - "description": "Unique across all Services user-defined name. Required.", - "type": "string", - "x-order": 0 - }, - "node_id": { - "description": "Node identifier where this instance runs. Required.", - "type": "string", - "x-order": 1 - }, - "environment": { - "description": "Environment name.", - "type": "string", - "x-order": 2 - }, - "cluster": { - "description": "Cluster name.", - "type": "string", - "x-order": 3 - }, - "replication_set": { - "description": "Replication set name.", - "type": "string", - "x-order": 4 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 5 - } - }, - "x-order": 4 - }, - "external": { - "type": "object", - "properties": { - "service_name": { - "description": "Unique across all Services user-defined name. Required.", - "type": "string", - "x-order": 0 - }, - "node_id": { - "description": "Node identifier where this instance runs. Required.", - "type": "string", - "x-order": 1 - }, - "environment": { - "description": "Environment name.", - "type": "string", - "x-order": 2 - }, - "cluster": { - "description": "Cluster name.", - "type": "string", - "x-order": 3 - }, - "replication_set": { - "description": "Replication set name.", - "type": "string", - "x-order": 4 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 5 - }, - "group": { - "description": "Group name of external service.", - "type": "string", - "x-order": 6 - } - }, - "x-order": 5 - }, - "valkey": { - "type": "object", - "properties": { - "service_name": { - "description": "Unique across all Services user-defined name. Required.", - "type": "string", - "x-order": 0 - }, - "node_id": { - "description": "Node identifier where this instance runs. Required.", - "type": "string", - "x-order": 1 - }, - "address": { - "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required.", - "type": "string", - "x-order": 2 - }, - "port": { - "description": "Access port.\nPort is required when the address present.", - "type": "integer", - "format": "int64", - "x-order": 3 - }, - "socket": { - "description": "Access unix socket.\nAddress (and port) or socket is required.", - "type": "string", - "x-order": 4 - }, - "environment": { - "description": "Environment name.", - "type": "string", - "x-order": 5 - }, - "cluster": { - "description": "Cluster name.", - "type": "string", - "x-order": 6 - }, - "replication_set": { - "description": "Replication set name.", - "type": "string", - "x-order": 7 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 8 - } - }, - "x-order": 6 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "mysql": { - "description": "MySQLService represents a generic MySQL 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": "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 - }, - "mongodb": { - "description": "MongoDBService represents a generic MongoDB 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": "MongoDB version.", - "type": "string", - "x-order": 10 - } - }, - "x-order": 1 - }, - "postgresql": { - "description": "PostgreSQLService represents a generic PostgreSQL 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 - }, - "database_name": { - "description": "Database name.", - "type": "string", - "x-order": 2 - }, - "node_id": { - "description": "Node identifier where this instance runs.", - "type": "string", - "x-order": 3 - }, - "address": { - "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required.", - "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.", - "type": "string", - "x-order": 9 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 10 - }, - "version": { - "description": "PostgreSQL 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": 2 - }, - "proxysql": { - "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": 3 - }, - "haproxy": { - "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.", - "type": "string", - "x-order": 5 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 6 - } - }, - "x-order": 4 - }, - "external": { - "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.", - "type": "string", - "x-order": 7 - } - }, - "x-order": 5 - }, - "valkey": { - "description": "ValkeyService represents a generic Valkey 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": "Valkey version.", - "type": "string", - "x-order": 10 - } - }, - "x-order": 6 - } - } - } - }, - "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/inventory/services/{service_id}": { - "get": { - "description": "Returns a single Service by ID.", - "tags": [ - "ServicesService" - ], - "summary": "Get a Service", - "operationId": "GetService", - "parameters": [ - { - "type": "string", - "description": "Unique randomly generated instance identifier.", - "name": "service_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "mysql": { - "description": "MySQLService represents a generic MySQL 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": "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 - }, - "mongodb": { - "description": "MongoDBService represents a generic MongoDB 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": "MongoDB version.", - "type": "string", - "x-order": 10 - } - }, - "x-order": 1 - }, - "postgresql": { - "description": "PostgreSQLService represents a generic PostgreSQL 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 - }, - "database_name": { - "description": "Database name.", - "type": "string", - "x-order": 2 - }, - "node_id": { - "description": "Node identifier where this instance runs.", - "type": "string", - "x-order": 3 - }, - "address": { - "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required.", - "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.", - "type": "string", - "x-order": 9 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 10 - }, - "version": { - "description": "PostgreSQL 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": 2 - }, - "proxysql": { - "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": 3 - }, - "haproxy": { - "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.", - "type": "string", - "x-order": 5 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 6 - } - }, - "x-order": 4 - }, - "external": { - "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.", - "type": "string", - "x-order": 7 - } - }, - "x-order": 5 - }, - "valkey": { - "description": "ValkeyService represents a generic Valkey 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": "Valkey version.", - "type": "string", - "x-order": 10 - } - }, - "x-order": 6 - } - } - } - }, - "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 - } - } - } - } - } - }, - "put": { - "description": "Changes service configuration. If a new cluster label is specified, it removes all backup/restore tasks scheduled for the related services. Fails if there are running backup/restore tasks.", - "tags": [ - "ServicesService" - ], - "summary": "Change service", - "operationId": "ChangeService", - "parameters": [ - { - "type": "string", - "name": "service_id", - "in": "path", - "required": true - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "environment": { - "type": "string", - "x-nullable": true, - "x-order": 0 - }, - "cluster": { - "type": "string", - "x-nullable": true, - "x-order": 1 - }, - "replication_set": { - "type": "string", - "x-nullable": true, - "x-order": 2 - }, - "external_group": { - "type": "string", - "x-nullable": true, - "x-order": 3 - }, - "custom_labels": { - "description": "A wrapper for map[string]string. This type allows to distinguish between an empty map and a null value.", - "type": "object", - "properties": { - "values": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 0 - } - }, - "x-nullable": true, - "x-order": 4 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "mysql": { - "description": "MySQLService represents a generic MySQL 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": "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 - }, - "mongodb": { - "description": "MongoDBService represents a generic MongoDB 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": "MongoDB version.", - "type": "string", - "x-order": 10 - } - }, - "x-order": 1 - }, - "postgresql": { - "description": "PostgreSQLService represents a generic PostgreSQL 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 - }, - "database_name": { - "description": "Database name.", - "type": "string", - "x-order": 2 - }, - "node_id": { - "description": "Node identifier where this instance runs.", - "type": "string", - "x-order": 3 - }, - "address": { - "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required.", - "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.", - "type": "string", - "x-order": 9 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 10 - }, - "version": { - "description": "PostgreSQL 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": 2 - }, - "proxysql": { - "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": 3 - }, - "haproxy": { - "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.", - "type": "string", - "x-order": 5 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 6 - } - }, - "x-order": 4 - }, - "external": { - "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.", - "type": "string", - "x-order": 7 - } - }, - "x-order": 5 - }, - "valkey": { - "description": "ValkeyService represents a generic Valkey 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": "Valkey version.", - "type": "string", - "x-order": 10 - } - }, - "x-order": 6 - } - } - } - }, - "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 - } - } - } - } - } - }, - "delete": { - "description": "Removes Service.", - "tags": [ - "ServicesService" - ], - "summary": "Remove Service", - "operationId": "RemoveService", - "parameters": [ - { - "type": "string", - "description": "Unique randomly generated instance identifier. Required.", - "name": "service_id", - "in": "path", - "required": true - }, - { - "type": "boolean", - "description": "Remove service with all dependencies.", - "name": "force", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/inventory/services:getTypes": { - "post": { - "description": "Returns a list of active Service types.", - "tags": [ - "ServicesService" - ], - "summary": "List Active Service Types", - "operationId": "ListActiveServiceTypes", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object" - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "service_types": { - "type": "array", - "items": { - "description": "ServiceType describes supported Service types.", - "type": "string", - "default": "SERVICE_TYPE_UNSPECIFIED", - "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" - ] - }, - "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": { - "get": { - "description": "Lists Agents with filter.", - "tags": [ - "ManagementService" - ], - "summary": "List Agents", - "operationId": "ListAgentsMixin3", - "parameters": [ - { - "type": "string", - "description": "Return only Agents that relate to a specific ServiceID.", - "name": "service_id", - "in": "query" - }, - { - "type": "string", - "description": "Return only Agents that relate to a specific NodeID.", - "name": "node_id", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "agents": { - "description": "List of Agents.", - "type": "array", - "items": { - "type": "object", - "properties": { - "agent_id": { - "description": "Unique agent identifier.", - "type": "string", - "x-order": 0 - }, - "is_agent_password_set": { - "description": "True if the agent password is set.", - "type": "boolean", - "x-order": 1 - }, - "agent_type": { - "description": "Agent type.", - "type": "string", - "x-order": 2 - }, - "aws_access_key": { - "description": "AWS Access Key.", - "type": "string", - "x-order": 3 - }, - "is_aws_secret_key_set": { - "description": "True if AWS Secret Key is set.", - "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", - "format": "date-time", - "x-order": 6 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 7 - }, - "disabled": { - "description": "Desired Agent status: enabled (false) or disabled (true).", - "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": 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", - "format": "int32", - "x-order": 12 - }, - "max_query_log_size": { - "description": "Limit query log size in QAN.", - "type": "string", - "format": "int64", - "x-order": 13 - }, - "metrics_path": { - "description": "Path under which metrics are exposed, used to generate URI.", - "type": "string", - "x-order": 14 - }, - "metrics_scheme": { - "description": "Scheme to generate URI to exporter metrics endpoints.", - "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", - "x-order": 18 - }, - "is_password_set": { - "description": "True if password for connecting the agent to the database is set.", - "type": "boolean", - "x-order": 19 - }, - "pmm_agent_id": { - "description": "The pmm-agent identifier.", - "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", - "x-order": 22 - }, - "push_metrics": { - "description": "True if exporter uses push metrics mode.", - "type": "boolean", - "x-order": 23 - }, - "query_examples_disabled": { - "description": "True if query examples are disabled.", - "type": "boolean", - "x-order": 24 - }, - "comments_parsing_disabled": { - "description": "True if query comments parsing is disabled.", - "type": "boolean", - "x-order": 25 - }, - "rds_basic_metrics_disabled": { - "description": "True if RDS basic metrics are disdabled.", - "type": "boolean", - "x-order": 26 - }, - "rds_enhanced_metrics_disabled": { - "description": "True if RDS enhanced metrics are disdabled.", - "type": "boolean", - "x-order": 27 - }, - "runs_on_node_id": { - "description": "Node identifier where this instance runs.", - "type": "string", - "x-order": 28 - }, - "service_id": { - "description": "Service identifier.", - "type": "string", - "x-order": 29 - }, - "status": { - "description": "Actual Agent status.", - "type": "string", - "x-order": 30 - }, - "table_count": { - "description": "Last known table count.", - "type": "integer", - "format": "int32", - "x-order": 31 - }, - "table_count_tablestats_group_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": 32 - }, - "tls": { - "description": "Use TLS for database connections.", - "type": "boolean", - "x-order": 33 - }, - "tls_skip_verify": { - "description": "Skip TLS certificate and hostname validation.", - "type": "boolean", - "x-order": 34 - }, - "username": { - "description": "HTTP basic auth username for collecting metrics.", - "type": "string", - "x-order": 35 - }, - "updated_at": { - "description": "Last update timestamp.", - "type": "string", - "format": "date-time", - "x-order": 36 - }, - "version": { - "description": "Agent version.", - "type": "string", - "x-order": 37 - }, - "is_connected": { - "description": "True if Agent is running and connected to pmm-managed.", - "type": "boolean", - "x-order": 38 - }, - "expose_exporter": { - "description": "True if an exporter agent is exposed on all host addresses.", - "type": "boolean", - "x-order": 39 - }, - "valkey_options": { - "type": "object", - "x-order": 40 - } - } - }, - "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": 3 - } - } - }, - "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/annotations": { - "post": { - "description": "Adds an annotation.", - "tags": [ - "ManagementService" - ], - "summary": "Add an Annotation", - "operationId": "AddAnnotation", - "parameters": [ - { - "description": "AddAnnotationRequest is a params to add new annotation.", - "name": "body", - "in": "body", - "required": true, - "schema": { - "description": "AddAnnotationRequest is a params to add new annotation.", - "type": "object", - "properties": { - "text": { - "description": "An annotation description. Required.", - "type": "string", - "x-order": 0 - }, - "tags": { - "description": "Tags are used to filter annotations.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 1 - }, - "node_name": { - "description": "Used for annotating a node.", - "type": "string", - "x-order": 2 - }, - "service_names": { - "description": "Used for annotating services.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 3 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/management/nodes": { - "get": { - "description": "Lists Nodes with filter.", - "tags": [ - "ManagementService" - ], - "summary": "List Nodes", - "operationId": "ListNodesMixin3", - "parameters": [ - { - "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" - ], - "type": "string", - "default": "NODE_TYPE_UNSPECIFIED", - "description": "Node type to be filtered out.", - "name": "node_type", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "nodes": { - "type": "array", - "items": { - "type": "object", - "properties": { - "node_id": { - "description": "Unique Node identifier.", - "type": "string", - "x-order": 0 - }, - "node_type": { - "description": "Node type.", - "type": "string", - "x-order": 1 - }, - "node_name": { - "description": "User-defined node name.", - "type": "string", - "x-order": 2 - }, - "machine_id": { - "description": "Linux machine-id.", - "type": "string", - "x-order": 3 - }, - "distro": { - "description": "Linux distribution name and version.", - "type": "string", - "x-order": 4 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 5 - }, - "container_id": { - "description": "A node's unique docker container identifier.", - "type": "string", - "x-order": 6 - }, - "container_name": { - "description": "Container name.", - "type": "string", - "x-order": 7 - }, - "address": { - "description": "Node address (DNS name or IP).", - "type": "string", - "x-order": 8 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 9 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 10 - }, - "custom_labels": { - "description": "Custom user-assigned labels for Node.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 11 - }, - "created_at": { - "description": "Creation timestamp.", - "type": "string", - "format": "date-time", - "x-order": 12 - }, - "updated_at": { - "description": "Last update timestamp.", - "type": "string", - "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", - "items": { - "type": "object", - "properties": { - "agent_id": { - "description": "Unique Agent identifier.", - "type": "string", - "x-order": 0 - }, - "agent_type": { - "description": "Agent type.", - "type": "string", - "x-order": 1 - }, - "status": { - "description": "Actual Agent status.", - "type": "string", - "x-order": 2 - }, - "is_connected": { - "description": "True if Agent is running and connected to pmm-managed.", - "type": "boolean", - "x-order": 3 - } - } - }, - "x-order": 15 - }, - "services": { - "description": "List of services running on this node.", - "type": "array", - "items": { - "description": "Service represents a service running on a node.", - "type": "object", - "properties": { - "service_id": { - "description": "Unique Service identifier.", - "type": "string", - "x-order": 0 - }, - "service_type": { - "description": "Service type.", - "type": "string", - "x-order": 1 - }, - "service_name": { - "description": "Service name.", - "type": "string", - "x-order": 2 - } - } - }, - "x-order": 16 - }, - "instance_id": { - "description": "Instance ID for cloud providers (e.g. AWS RDS).", - "type": "string", - "x-order": 17 - } - } - }, - "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 - } - } - } - } - } - }, - "post": { - "description": "Registers a new Node and a pmm-agent.", - "tags": [ - "ManagementService" - ], - "summary": "Register a Node", - "operationId": "RegisterNode", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "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", - "x-order": 1 - }, - "address": { - "description": "Node address (DNS name or IP).", - "type": "string", - "x-order": 2 - }, - "machine_id": { - "description": "Linux machine-id.", - "type": "string", - "x-order": 3 - }, - "distro": { - "description": "Linux distribution name and version.", - "type": "string", - "x-order": 4 - }, - "container_id": { - "description": "Container identifier. If specified, must be a unique Docker container identifier.", - "type": "string", - "x-order": 5 - }, - "container_name": { - "description": "Container name.", - "type": "string", - "x-order": 6 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 7 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 8 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 9 - }, - "custom_labels": { - "description": "Custom user-assigned labels for Node.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 10 - }, - "reregister": { - "description": "If true, and Node with that name already exist, it will be removed with all dependent Services and Agents.", - "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", - "items": { - "type": "string" - }, - "x-order": 13 - }, - "agent_password": { - "description": "Custom password for exporter endpoint /metrics.", - "type": "string", - "x-order": 14 - }, - "expose_exporter": { - "type": "boolean", - "title": "Optionally expose the exporter process on all public interfaces", - "x-order": 15 - }, - "instance_id": { - "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", - "x-order": 0 - }, - "node_name": { - "description": "Unique across all Nodes user-defined name.", - "type": "string", - "x-order": 1 - }, - "address": { - "description": "Node address (DNS name or IP).", - "type": "string", - "x-order": 2 - }, - "machine_id": { - "description": "Linux machine-id.", - "type": "string", - "x-order": 3 - }, - "distro": { - "description": "Linux distribution name and version.", - "type": "string", - "x-order": 4 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 5 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 6 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 7 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 8 - } - }, - "x-order": 0 - }, - "container_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": { - "description": "Unique across all Nodes user-defined name.", - "type": "string", - "x-order": 1 - }, - "address": { - "description": "Node address (DNS name or IP).", - "type": "string", - "x-order": 2 - }, - "machine_id": { - "description": "Linux machine-id of the Generic Node where this Container Node runs.", - "type": "string", - "x-order": 3 - }, - "container_id": { - "description": "Container identifier. If specified, must be a unique Docker container identifier.", - "type": "string", - "x-order": 4 - }, - "container_name": { - "description": "Container name.", - "type": "string", - "x-order": 5 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 6 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 7 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 8 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 9 - } - }, - "x-order": 1 - }, - "pmm_agent": { - "description": "PMMAgent runs on Generic or Container Node.", - "type": "object", - "properties": { - "agent_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "runs_on_node_id": { - "description": "Node identifier where this instance runs.", - "type": "string", - "x-order": 1 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 2 - }, - "connected": { - "description": "True if Agent is running and connected to pmm-managed.", - "type": "boolean", - "x-order": 3 - }, - "process_exec_path": { - "description": "Path to exec process.", - "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 - } - } - } - }, - "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/nodes/{node_id}": { - "get": { - "description": "Gets a single Node by ID.", - "tags": [ - "ManagementService" - ], - "summary": "Get Node", - "operationId": "GetNodeMixin3", - "parameters": [ - { - "type": "string", - "description": "Unique Node identifier.", - "name": "node_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "node": { - "type": "object", - "properties": { - "node_id": { - "description": "Unique Node identifier.", - "type": "string", - "x-order": 0 - }, - "node_type": { - "description": "Node type.", - "type": "string", - "x-order": 1 - }, - "node_name": { - "description": "User-defined node name.", - "type": "string", - "x-order": 2 - }, - "machine_id": { - "description": "Linux machine-id.", - "type": "string", - "x-order": 3 - }, - "distro": { - "description": "Linux distribution name and version.", - "type": "string", - "x-order": 4 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 5 - }, - "container_id": { - "description": "A node's unique docker container identifier.", - "type": "string", - "x-order": 6 - }, - "container_name": { - "description": "Container name.", - "type": "string", - "x-order": 7 - }, - "address": { - "description": "Node address (DNS name or IP).", - "type": "string", - "x-order": 8 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 9 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 10 - }, - "custom_labels": { - "description": "Custom user-assigned labels for Node.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 11 - }, - "created_at": { - "description": "Creation timestamp.", - "type": "string", - "format": "date-time", - "x-order": 12 - }, - "updated_at": { - "description": "Last update timestamp.", - "type": "string", - "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", - "items": { - "type": "object", - "properties": { - "agent_id": { - "description": "Unique Agent identifier.", - "type": "string", - "x-order": 0 - }, - "agent_type": { - "description": "Agent type.", - "type": "string", - "x-order": 1 - }, - "status": { - "description": "Actual Agent status.", - "type": "string", - "x-order": 2 - }, - "is_connected": { - "description": "True if Agent is running and connected to pmm-managed.", - "type": "boolean", - "x-order": 3 - } - } - }, - "x-order": 15 - }, - "services": { - "description": "List of services running on this node.", - "type": "array", - "items": { - "description": "Service represents a service running on a node.", - "type": "object", - "properties": { - "service_id": { - "description": "Unique Service identifier.", - "type": "string", - "x-order": 0 - }, - "service_type": { - "description": "Service type.", - "type": "string", - "x-order": 1 - }, - "service_name": { - "description": "Service name.", - "type": "string", - "x-order": 2 - } - } - }, - "x-order": 16 - }, - "instance_id": { - "description": "Instance ID for cloud providers (e.g. AWS RDS).", - "type": "string", - "x-order": 17 - } - }, - "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 - } - } - } - } - } - }, - "delete": { - "description": "Unregisters a Node and pmm-agent", - "tags": [ - "ManagementService" - ], - "summary": "Unregister a Node", - "operationId": "UnregisterNode", - "parameters": [ - { - "type": "string", - "description": "Node_id to be unregistered.", - "name": "node_id", - "in": "path", - "required": true - }, - { - "type": "boolean", - "description": "Force delete node, related service account, even if it has more service tokens attached.", - "name": "force", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "warning": { - "description": "Warning message if there are more service tokens attached to service account.", - "type": "string", - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/management/services": { - "get": { - "description": "Returns a filtered list of Services.", - "tags": [ - "ManagementService" - ], - "summary": "List Services", - "operationId": "ListServicesMixin3", - "parameters": [ - { - "type": "string", - "description": "Return only Services running on that Node.", - "name": "node_id", - "in": "query" - }, - { - "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" - ], - "type": "string", - "default": "SERVICE_TYPE_UNSPECIFIED", - "description": "Return only services filtered by service type.", - "name": "service_type", - "in": "query" - }, - { - "type": "string", - "description": "Return only services in this external group.", - "name": "external_group", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "services": { - "description": "List of Services.", - "type": "array", - "items": { - "type": "object", - "properties": { - "service_id": { - "description": "Unique service identifier.", - "type": "string", - "x-order": 0 - }, - "service_type": { - "description": "Service type.", - "type": "string", - "x-order": 1 - }, - "service_name": { - "description": "User-defined name unique across all Services.", - "type": "string", - "x-order": 2 - }, - "database_name": { - "description": "Database name.", - "type": "string", - "x-order": 3 - }, - "node_id": { - "description": "Node identifier where this instance runs.", - "type": "string", - "x-order": 4 - }, - "node_name": { - "description": "Node name where this instance runs.", - "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 for Service.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 9 - }, - "external_group": { - "description": "External group name.", - "type": "string", - "x-order": 10 - }, - "address": { - "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required.", - "type": "string", - "x-order": 11 - }, - "port": { - "description": "Access port.\nPort is required when the address present.", - "type": "integer", - "format": "int64", - "x-order": 12 - }, - "socket": { - "description": "Access unix socket.\nAddress (and port) or socket is required.", - "type": "string", - "x-order": 13 - }, - "created_at": { - "description": "Creation timestamp.", - "type": "string", - "format": "date-time", - "x-order": 14 - }, - "updated_at": { - "description": "Last update timestamp.", - "type": "string", - "format": "date-time", - "x-order": 15 - }, - "agents": { - "description": "List of agents related to this service.", - "type": "array", - "items": { - "type": "object", - "properties": { - "agent_id": { - "description": "Unique agent identifier.", - "type": "string", - "x-order": 0 - }, - "is_agent_password_set": { - "description": "True if the agent password is set.", - "type": "boolean", - "x-order": 1 - }, - "agent_type": { - "description": "Agent type.", - "type": "string", - "x-order": 2 - }, - "aws_access_key": { - "description": "AWS Access Key.", - "type": "string", - "x-order": 3 - }, - "is_aws_secret_key_set": { - "description": "True if AWS Secret Key is set.", - "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", - "format": "date-time", - "x-order": 6 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 7 - }, - "disabled": { - "description": "Desired Agent status: enabled (false) or disabled (true).", - "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": 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", - "format": "int32", - "x-order": 12 - }, - "max_query_log_size": { - "description": "Limit query log size in QAN.", - "type": "string", - "format": "int64", - "x-order": 13 - }, - "metrics_path": { - "description": "Path under which metrics are exposed, used to generate URI.", - "type": "string", - "x-order": 14 - }, - "metrics_scheme": { - "description": "Scheme to generate URI to exporter metrics endpoints.", - "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", - "x-order": 18 - }, - "is_password_set": { - "description": "True if password for connecting the agent to the database is set.", - "type": "boolean", - "x-order": 19 - }, - "pmm_agent_id": { - "description": "The pmm-agent identifier.", - "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", - "x-order": 22 - }, - "push_metrics": { - "description": "True if exporter uses push metrics mode.", - "type": "boolean", - "x-order": 23 - }, - "query_examples_disabled": { - "description": "True if query examples are disabled.", - "type": "boolean", - "x-order": 24 - }, - "comments_parsing_disabled": { - "description": "True if query comments parsing is disabled.", - "type": "boolean", - "x-order": 25 - }, - "rds_basic_metrics_disabled": { - "description": "True if RDS basic metrics are disdabled.", - "type": "boolean", - "x-order": 26 - }, - "rds_enhanced_metrics_disabled": { - "description": "True if RDS enhanced metrics are disdabled.", - "type": "boolean", - "x-order": 27 - }, - "runs_on_node_id": { - "description": "Node identifier where this instance runs.", - "type": "string", - "x-order": 28 - }, - "service_id": { - "description": "Service identifier.", - "type": "string", - "x-order": 29 - }, - "status": { - "description": "Actual Agent status.", - "type": "string", - "x-order": 30 - }, - "table_count": { - "description": "Last known table count.", - "type": "integer", - "format": "int32", - "x-order": 31 - }, - "table_count_tablestats_group_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": 32 - }, - "tls": { - "description": "Use TLS for database connections.", - "type": "boolean", - "x-order": 33 - }, - "tls_skip_verify": { - "description": "Skip TLS certificate and hostname validation.", - "type": "boolean", - "x-order": 34 - }, - "username": { - "description": "HTTP basic auth username for collecting metrics.", - "type": "string", - "x-order": 35 - }, - "updated_at": { - "description": "Last update timestamp.", - "type": "string", - "format": "date-time", - "x-order": 36 - }, - "version": { - "description": "Agent version.", - "type": "string", - "x-order": 37 - }, - "is_connected": { - "description": "True if Agent is running and connected to pmm-managed.", - "type": "boolean", - "x-order": 38 - }, - "expose_exporter": { - "description": "True if an exporter agent is exposed on all host addresses.", - "type": "boolean", - "x-order": 39 - }, - "valkey_options": { - "type": "object", - "x-order": 40 - } - } - }, - "x-order": 16 - }, - "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", - "default": "STATUS_UNSPECIFIED", - "enum": [ - "STATUS_UNSPECIFIED", - "STATUS_UP", - "STATUS_DOWN", - "STATUS_UNKNOWN" - ], - "x-order": 17 - }, - "version": { - "description": "The service/database version.", - "type": "string", - "x-order": 18 - } - } - }, - "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 - } - } - } - } - } - }, - "post": { - "description": "Adds a service and starts several agents.", - "tags": [ - "ManagementService" - ], - "summary": "Add a Service", - "operationId": "AddServiceMixin3", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "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 - }, - "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.", - "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", - "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 - }, - "environment": { - "description": "Environment name.", - "type": "string", - "x-order": 8 - }, - "cluster": { - "description": "Cluster name.", - "type": "string", - "x-order": 9 - }, - "replication_set": { - "description": "Replication set name.", - "type": "string", - "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.", - "type": "object", - "additionalProperties": { - "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 - }, - "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.", - "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", - "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 - }, - "environment": { - "description": "Environment name.", - "type": "string", - "x-order": 8 - }, - "cluster": { - "description": "Cluster name.", - "type": "string", - "x-order": 9 - }, - "replication_set": { - "description": "Replication set name.", - "type": "string", - "x-order": 10 - }, - "username": { - "description": "MongoDB username for exporter and QAN agent access.", - "type": "string", - "x-order": 11 - }, - "password": { - "description": "MongoDB password for exporter and QAN agent access.", - "type": "string", - "x-order": 12 - }, - "qan_mongodb_profiler": { - "description": "If true, adds qan-mongodb-profiler-agent for provided service.", - "type": "boolean", - "x-order": 13 - }, - "qan_mongodb_mongolog": { - "description": "If true, adds qan-mongodb-mongolog-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": 15 - }, - "skip_connection_check": { - "description": "Skip connection check.", - "type": "boolean", - "x-order": 16 - }, - "tls": { - "description": "Use TLS for database connections.", - "type": "boolean", - "x-order": 17 - }, - "tls_skip_verify": { - "description": "Skip TLS certificate and hostname validation.", - "type": "boolean", - "x-order": 18 - }, - "tls_certificate_key": { - "description": "Client certificate and key.", - "type": "string", - "x-order": 19 - }, - "tls_certificate_key_file_password": { - "description": "Password for decrypting tls_certificate_key.", - "type": "string", - "x-order": 20 - }, - "tls_ca": { - "description": "Certificate Authority certificate chain.", - "type": "string", - "x-order": 21 - }, - "max_query_length": { - "description": "Limit query length in QAN (default: server-defined; -1: no limit).", - "type": "integer", - "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", - "items": { - "type": "string" - }, - "x-order": 24 - }, - "authentication_mechanism": { - "description": "Authentication mechanism.\nSee https://docs.mongodb.com/manual/reference/connection-string/#mongodb-urioption-urioption.authMechanism\nfor details.", - "type": "string", - "x-order": 25 - }, - "authentication_database": { - "description": "Authentication database.", - "type": "string", - "x-order": 26 - }, - "agent_password": { - "description": "Custom password for exporter endpoint /metrics.", - "type": "string", - "x-order": 27 - }, - "stats_collections": { - "description": "List of collections to get stats from. Can use * .", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 28 - }, - "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", - "x-order": 29 - }, - "enable_all_collectors": { - "type": "boolean", - "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", - "x-order": 32 - } - }, - "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", - "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.", - "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", - "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 - }, - "pmm_agent_id": { - "description": "The \"pmm-agent\" identifier which should run agents. Required.", - "type": "string", - "x-order": 8 - }, - "environment": { - "description": "Environment name.", - "type": "string", - "x-order": 9 - }, - "cluster": { - "description": "Cluster name.", - "type": "string", - "x-order": 10 - }, - "replication_set": { - "description": "Replication set name.", - "type": "string", - "x-order": 11 - }, - "username": { - "description": "PostgreSQL username for scraping metrics.", - "type": "string", - "x-order": 12 - }, - "password": { - "description": "PostgreSQL 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 - }, - "custom_labels": { - "description": "Custom user-assigned labels for Service.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 18 - }, - "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 - }, - "tls": { - "description": "Use TLS for database connections.", - "type": "boolean", - "x-order": 21 - }, - "tls_skip_verify": { - "description": "Skip TLS certificate and hostname validation. Uses sslmode=required instead of verify-full.", - "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", - "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" - }, - "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": 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", - "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", - "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.", - "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", - "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 - }, - "environment": { - "description": "Environment name.", - "type": "string", - "x-order": 8 - }, - "cluster": { - "description": "Cluster name.", - "type": "string", - "x-order": 9 - }, - "replication_set": { - "description": "Replication set name.", - "type": "string", - "x-order": 10 - }, - "username": { - "description": "ProxySQL username for scraping metrics.", - "type": "string", - "x-order": 11 - }, - "password": { - "description": "ProxySQL password for scraping metrics.", - "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 database connections.", - "type": "boolean", - "x-order": 15 - }, - "tls_skip_verify": { - "description": "Skip TLS certificate and hostname validation.", - "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 - }, - "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": 19 - }, - "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": 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 - }, - "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", - "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 - }, - "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 - }, - "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 - }, - "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.", - "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 - }, - "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 - }, - "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": 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", - "properties": { - "region": { - "description": "AWS region.", - "type": "string", - "x-order": 0 - }, - "az": { - "description": "AWS availability zone.", - "type": "string", - "x-order": 1 - }, - "instance_id": { - "description": "AWS instance ID.", - "type": "string", - "x-order": 2 - }, - "node_model": { - "description": "AWS instance class.", - "type": "string", - "x-order": 3 - }, - "address": { - "description": "Address used to connect to it.", - "type": "string", - "x-order": 4 - }, - "port": { - "description": "Access port.", - "type": "integer", - "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", - "x-order": 7 - }, - "node_name": { - "description": "Unique across all Nodes user-defined name. Defaults to AWS instance ID.", - "type": "string", - "x-order": 8 - }, - "service_name": { - "description": "Unique across all Services user-defined name. Defaults to AWS instance ID.", - "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 - }, - "username": { - "description": "Username for scraping metrics.", - "type": "string", - "x-order": 13 - }, - "password": { - "description": "Password for scraping metrics.", - "type": "string", - "x-order": 14 - }, - "aws_access_key": { - "description": "AWS Access key.", - "type": "string", - "x-order": 15 - }, - "aws_secret_key": { - "description": "AWS Secret key.", - "type": "string", - "x-order": 16 - }, - "rds_exporter": { - "description": "If true, adds rds_exporter.", - "type": "boolean", - "x-order": 17 - }, - "qan_mysql_perfschema": { - "description": "If true, adds qan-mysql-perfschema-agent.", - "type": "boolean", - "x-order": 18 - }, - "custom_labels": { - "description": "Custom user-assigned labels for Node and Service.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 19 - }, - "skip_connection_check": { - "description": "Skip connection check.", - "type": "boolean", - "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 - }, - "disable_query_examples": { - "description": "Disable query examples.", - "type": "boolean", - "x-order": 23 - }, - "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": 24 - }, - "disable_basic_metrics": { - "description": "Disable basic metrics.", - "type": "boolean", - "x-order": 25 - }, - "disable_enhanced_metrics": { - "description": "Disable enhanced metrics.", - "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", - "x-order": 28 - }, - "agent_password": { - "description": "Custom password for exporter endpoint /metrics.", - "type": "string", - "x-order": 29 - }, - "database": { - "description": "Database name.", - "type": "string", - "x-order": 30 - }, - "auto_discovery_limit": { - "description": "Limit of databases for auto-discovery.", - "type": "integer", - "format": "int32", - "x-order": 31 - }, - "disable_comments_parsing": { - "description": "Disable parsing comments from queries and showing them in QAN.", - "type": "boolean", - "x-order": 32 - }, - "max_postgresql_exporter_connections": { - "description": "Maximum number of exporter connections to PostgreSQL instance.", - "type": "integer", - "format": "int32", - "x-order": 33 - } - }, - "x-order": 6 - }, - "valkey": { - "type": "object", - "properties": { - "node_id": { - "description": "Node identifier on which the service is running.\nOnly 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 running.\nOnly 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": "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", - "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", - "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 - } - }, - "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.", - "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": "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 - }, - "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", - "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": 1 - }, - "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.", - "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", - "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 - } - }, - "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": { - "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": { - "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 - }, - "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 - }, - "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.", - "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": "MongoDB version.", - "type": "string", - "x-order": 10 - } - }, - "x-order": 0 - }, - "mongodb_exporter": { - "description": "MongoDBExporter runs on Generic or Container Node and exposes MongoDB 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": "MongoDB 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": 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 - }, - "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": 11 - }, - "stats_collections": { - "type": "array", - "title": "List of colletions to get stats from. Can use *", - "items": { - "type": "string" - }, - "x-order": 12 - }, - "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", - "x-order": 13 - }, - "enable_all_collectors": { - "description": "Enable All collectors.", - "type": "boolean", - "x-order": 14 - }, - "process_exec_path": { - "description": "Path to exec process.", - "type": "string", - "x-order": 15 - }, - "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 - }, - "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.", - "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": 18 - } - }, - "x-order": 1 - }, - "qan_mongodb_profiler": { - "description": "QANMongoDBProfilerAgent runs within pmm-agent and sends MongoDB 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": "MongoDB username for getting profiler 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 - }, - "max_query_length": { - "description": "Limit query length in QAN (default: server-defined; -1: no limit).", - "type": "integer", - "format": "int32", - "x-order": 7 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "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", - "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": 2 - }, - "qan_mongodb_mongolog": { - "description": "QANMongoDBMongologAgent runs within pmm-agent and sends MongoDB 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": "MongoDB username for getting profiler 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 - }, - "max_query_length": { - "description": "Limit query length in QAN (default: server-defined; -1: no limit).", - "type": "integer", - "format": "int32", - "x-order": 7 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "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", - "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 - } - }, - "x-order": 1 - }, - "postgresql": { - "type": "object", - "properties": { - "service": { - "description": "PostgreSQLService represents a generic PostgreSQL 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 - }, - "database_name": { - "description": "Database name.", - "type": "string", - "x-order": 2 - }, - "node_id": { - "description": "Node identifier where this instance runs.", - "type": "string", - "x-order": 3 - }, - "address": { - "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required.", - "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.", - "type": "string", - "x-order": 9 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 10 - }, - "version": { - "description": "PostgreSQL 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": 0 - }, - "postgres_exporter": { - "description": "PostgresExporter runs on Generic or Container Node and exposes PostgreSQL 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": "PostgreSQL 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. Uses sslmode=required instead of verify-full.", - "type": "boolean", - "x-order": 6 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "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 - }, - "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": 11 - }, - "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" - ], - "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 - } - }, - "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.", - "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 - }, - "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_postgresql_pgstatmonitor_agent": { - "description": "QANPostgreSQLPgStatMonitorAgent 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 monitor 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 - }, - "disable_comments_parsing": { - "description": "Disable parsing comments from queries and showing them in QAN.", - "type": "boolean", - "x-order": 7 - }, - "max_query_length": { - "description": "Limit query length in QAN (default: server-defined; -1: no limit).", - "type": "integer", - "format": "int32", - "x-order": 8 - }, - "query_examples_disabled": { - "description": "True if query examples are disabled.", - "type": "boolean", - "x-order": 9 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "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 - }, - "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" - ], - "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 - }, - "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": 0 - }, - "proxysql_exporter": { - "description": "ProxySQLExporter runs on Generic or Container Node and exposes ProxySQL 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": "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": 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 - }, - "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": 11 - }, - "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" - ], - "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.", - "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": "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.", - "type": "string", - "x-order": 5 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 6 - } - }, - "x-order": 0 - }, - "external_exporter": { - "description": "ExternalExporter runs on any Node type, including Remote Node.", - "type": "object", - "properties": { - "agent_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "runs_on_node_id": { - "description": "Node identifier where this instance runs.", - "type": "string", - "x-order": 1 - }, - "disabled": { - "description": "If disabled, metrics from this exporter will not be collected.", - "type": "boolean", - "x-order": 2 - }, - "service_id": { - "description": "Service identifier.", - "type": "string", - "x-order": 3 - }, - "username": { - "description": "HTTP basic auth username for collecting metrics.", - "type": "string", - "x-order": 4 - }, - "scheme": { - "description": "Scheme to generate URI to exporter metrics endpoints.", - "type": "string", - "x-order": 5 - }, - "metrics_path": { - "description": "Path under which metrics are exposed, used to generate URI.", - "type": "string", - "x-order": 6 - }, - "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 - } - }, - "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.", - "type": "string", - "x-order": 7 - } - }, - "x-order": 0 - }, - "external_exporter": { - "description": "ExternalExporter runs on any Node type, including Remote Node.", - "type": "object", - "properties": { - "agent_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "runs_on_node_id": { - "description": "Node identifier where this instance runs.", - "type": "string", - "x-order": 1 - }, - "disabled": { - "description": "If disabled, metrics from this exporter will not be collected.", - "type": "boolean", - "x-order": 2 - }, - "service_id": { - "description": "Service identifier.", - "type": "string", - "x-order": 3 - }, - "username": { - "description": "HTTP basic auth username for collecting metrics.", - "type": "string", - "x-order": 4 - }, - "scheme": { - "description": "Scheme to generate URI to exporter metrics endpoints.", - "type": "string", - "x-order": 5 - }, - "metrics_path": { - "description": "Path under which metrics are exposed, used to generate URI.", - "type": "string", - "x-order": 6 - }, - "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 - } - }, - "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": { - "node_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "node_name": { - "description": "Unique across all Nodes user-defined name.", - "type": "string", - "x-order": 1 - }, - "address": { - "description": "DB instance identifier.", - "type": "string", - "x-order": 2 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 3 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 4 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 5 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 6 - }, - "instance_id": { - "description": "AWS instance ID.", - "type": "string", - "x-order": 7 - } - }, - "x-order": 0 - }, - "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 - }, - "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.", - "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": { - "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 - }, - "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.", - "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 - } - }, - "x-order": 1 - }, - "mysql": { - "description": "MySQLService represents a generic MySQL 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": "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": 2 - }, - "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", - "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 - }, - "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", - "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 - } - }, - "x-order": 4 - }, - "postgresql": { - "description": "PostgreSQLService represents a generic PostgreSQL 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 - }, - "database_name": { - "description": "Database name.", - "type": "string", - "x-order": 2 - }, - "node_id": { - "description": "Node identifier where this instance runs.", - "type": "string", - "x-order": 3 - }, - "address": { - "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required.", - "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.", - "type": "string", - "x-order": 9 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 10 - }, - "version": { - "description": "PostgreSQL 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": 5 - }, - "postgresql_exporter": { - "description": "PostgresExporter runs on Generic or Container Node and exposes PostgreSQL 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": "PostgreSQL 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. Uses sslmode=required instead of verify-full.", - "type": "boolean", - "x-order": 6 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "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 - }, - "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": 11 - }, - "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" - ], - "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 - } - }, - "x-order": 6 - }, - "qan_postgresql_pgstatements": { - "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.", - "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 - }, - "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": 7 - } - }, - "x-order": 6 - }, - "valkey": { - "type": "object", - "properties": { - "service": { - "description": "ValkeyService represents a generic Valkey 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": "Valkey version.", - "type": "string", - "x-order": 10 - } - }, - "x-order": 0 - }, - "valkey_exporter": { - "description": "ValkeyExporter runs on Generic or Container Node and exposes Valkey 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": "Valkey 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 verification.", - "type": "boolean", - "x-order": 6 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "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 - }, - "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": 11 - }, - "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": 13 - }, - "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 - } - }, - "x-order": 1 - } - }, - "x-order": 7 - } - } - } - }, - "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/azure": { - "post": { - "description": "Adds an Azure Database instance.", - "tags": [ - "ManagementService" - ], - "summary": "Add Azure Database", - "operationId": "AddAzureDatabase", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "region": { - "description": "Azure database location.", - "type": "string", - "x-order": 0 - }, - "az": { - "description": "Azure database availability zone.", - "type": "string", - "x-order": 1 - }, - "instance_id": { - "description": "Azure database instance ID.", - "type": "string", - "x-order": 2 - }, - "node_model": { - "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": 3 - }, - "address": { - "description": "Address used to connect to it.", - "type": "string", - "x-order": 4 - }, - "port": { - "description": "Access port.", - "type": "integer", - "format": "int64", - "x-order": 5 - }, - "node_name": { - "description": "Unique across all Nodes user-defined name. Defaults to Azure Database instance ID.", - "type": "string", - "x-order": 6 - }, - "service_name": { - "description": "Unique across all Services user-defined name. Defaults to Azure Database instance ID.", - "type": "string", - "x-order": 7 - }, - "environment": { - "description": "Environment name.", - "type": "string", - "x-order": 8 - }, - "username": { - "description": "Username for scraping metrics.", - "type": "string", - "x-order": 9 - }, - "password": { - "description": "Password for scraping metrics.", - "type": "string", - "x-order": 10 - }, - "azure_client_id": { - "description": "Azure client ID.", - "type": "string", - "x-order": 11 - }, - "azure_client_secret": { - "description": "Azure client secret.", - "type": "string", - "x-order": 12 - }, - "azure_tenant_id": { - "description": "Azure tanant ID.", - "type": "string", - "x-order": 13 - }, - "azure_subscription_id": { - "description": "Azure subscription ID.", - "type": "string", - "x-order": 14 - }, - "azure_resource_group": { - "description": "Azure resource group.", - "type": "string", - "x-order": 15 - }, - "azure_database_exporter": { - "description": "If true, adds azure_database_exporter.", - "type": "boolean", - "x-order": 16 - }, - "qan": { - "description": "If true, adds qan-mysql-perfschema-agent or qan-postgresql-pgstatements-agent.", - "type": "boolean", - "x-order": 17 - }, - "custom_labels": { - "description": "Custom user-assigned labels for Node and Service.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 18 - }, - "skip_connection_check": { - "description": "Skip connection check.", - "type": "boolean", - "x-order": 19 - }, - "tls": { - "description": "Use TLS for database connections.", - "type": "boolean", - "x-order": 20 - }, - "tls_skip_verify": { - "description": "Skip TLS certificate and hostname validation.", - "type": "boolean", - "x-order": 21 - }, - "disable_query_examples": { - "description": "Disable query examples.", - "type": "boolean", - "x-order": 22 - }, - "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": 23 - }, - "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": 24 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/management/services/{service_id}": { - "delete": { - "description": "Removes a Service along with its Agents.", - "tags": [ - "ManagementService" - ], - "summary": "Remove a Service", - "operationId": "RemoveServiceMixin3", - "parameters": [ - { - "type": "string", - "description": "Either a Service ID or a Service Name.", - "name": "service_id", - "in": "path", - "required": true - }, - { - "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" - ], - "type": "string", - "default": "SERVICE_TYPE_UNSPECIFIED", - "description": "Service type.", - "name": "service_type", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/management/services:discoverAzure": { - "post": { - "description": "Discovers Azure Database for MySQL, MariaDB and PostgreSQL Server instances.", - "tags": [ - "ManagementService" - ], - "summary": "Discover Azure Database", - "operationId": "DiscoverAzureDatabase", - "parameters": [ - { - "description": "DiscoverAzureDatabaseRequest discover azure databases request.", - "name": "body", - "in": "body", - "required": true, - "schema": { - "description": "DiscoverAzureDatabaseRequest discover azure databases request.", - "type": "object", - "properties": { - "azure_client_id": { - "description": "Azure client ID.", - "type": "string", - "x-order": 0 - }, - "azure_client_secret": { - "description": "Azure client secret.", - "type": "string", - "x-order": 1 - }, - "azure_tenant_id": { - "description": "Azure tanant ID.", - "type": "string", - "x-order": 2 - }, - "azure_subscription_id": { - "description": "Azure subscription ID.", - "type": "string", - "x-order": 3 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "description": "DiscoverAzureDatabaseResponse discover azure databases response.", - "type": "object", - "properties": { - "azure_database_instance": { - "type": "array", - "items": { - "description": "DiscoverAzureDatabaseInstance models an unique Azure Database instance for the list of instances returned by Discovery.", - "type": "object", - "properties": { - "instance_id": { - "description": "Azure database instance ID.", - "type": "string", - "x-order": 0 - }, - "region": { - "description": "Azure database location.", - "type": "string", - "x-order": 1 - }, - "service_name": { - "description": "Azure database server name.", - "type": "string", - "x-order": 2 - }, - "username": { - "description": "Database username.", - "type": "string", - "x-order": 3 - }, - "address": { - "description": "Address used to connect to it.", - "type": "string", - "x-order": 4 - }, - "azure_resource_group": { - "description": "Azure Resource group.", - "type": "string", - "x-order": 5 - }, - "environment": { - "description": "Environment tag.", - "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", - "x-order": 8 - }, - "node_model": { - "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 - } - } - }, - "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/services:discoverRDS": { - "post": { - "description": "Discovers RDS instances.", - "tags": [ - "ManagementService" - ], - "summary": "Discover RDS", - "operationId": "DiscoverRDS", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "aws_access_key": { - "description": "AWS Access key. Optional.", - "type": "string", - "x-order": 0 - }, - "aws_secret_key": { - "description": "AWS Secret key. Optional.", - "type": "string", - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "rds_instances": { - "type": "array", - "items": { - "description": "DiscoverRDSInstance models an unique RDS instance for the list of instances returned by Discovery.", - "type": "object", - "properties": { - "region": { - "description": "AWS region.", - "type": "string", - "x-order": 0 - }, - "az": { - "description": "AWS availability zone.", - "type": "string", - "x-order": 1 - }, - "instance_id": { - "description": "AWS instance ID.", - "type": "string", - "x-order": 2 - }, - "node_model": { - "description": "AWS instance class.", - "type": "string", - "x-order": 3 - }, - "address": { - "description": "Address used to connect to it.", - "type": "string", - "x-order": 4 - }, - "port": { - "description": "Access port.", - "type": "integer", - "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 - }, - "engine_version": { - "description": "Engine version.", - "type": "string", - "x-order": 7 - } - } - }, - "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/platform/contact": { - "get": { - "description": "Fetch the contact details of the customer success employee handling the Percona customer account.", - "tags": [ - "PlatformService" - ], - "summary": "Get Contact Information", - "operationId": "GetContactInformation", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "customer_success": { - "description": "CustomerSuccess contains the contanct details of the customer success employee assigned to a customer's account.", - "type": "object", - "properties": { - "name": { - "type": "string", - "x-order": 0 - }, - "email": { - "type": "string", - "x-order": 1 - } - }, - "x-order": 0 - }, - "new_ticket_url": { - "description": "URL to open a new support ticket.", - "type": "string", - "x-order": 1 - } - } - } - }, - "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/platform/organization/entitlements": { - "get": { - "description": "Fetch entitlements available to the Portal organization that the PMM server is connected to.", - "tags": [ - "PlatformService" - ], - "summary": "Search Organization Entitlements", - "operationId": "SearchOrganizationEntitlements", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "entitlements": { - "type": "array", - "items": { - "description": "OrganizationEntitlement contains information about Organization entitlement.", - "type": "object", - "properties": { - "number": { - "description": "Entitlement number.", - "type": "string", - "x-order": 0 - }, - "name": { - "description": "Entitlement name.", - "type": "string", - "x-order": 1 - }, - "summary": { - "description": "Entitlement short summary.", - "type": "string", - "x-order": 2 - }, - "tier": { - "description": "Entitlement tier.", - "type": "string", - "x-nullable": true, - "x-order": 3 - }, - "total_units": { - "description": "Total units covered by this entitlement.", - "type": "string", - "x-nullable": true, - "x-order": 4 - }, - "unlimited_units": { - "description": "Flag indicates that unlimited units are covered.", - "type": "boolean", - "x-nullable": true, - "x-order": 5 - }, - "support_level": { - "description": "Support level covered by this entitlement.", - "type": "string", - "x-nullable": true, - "x-order": 6 - }, - "software_families": { - "description": "Percona product families covered by this entitlement.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 7 - }, - "start_date": { - "description": "Entitlement start data.\nNote: only date is used here but not time.", - "type": "string", - "format": "date-time", - "x-order": 8 - }, - "end_date": { - "description": "Entitlement end date.\nNote: only date is used here but not time.", - "type": "string", - "format": "date-time", - "x-order": 9 - }, - "platform": { - "description": "Platform indicates platform specific entitlements.", - "type": "object", - "properties": { - "security_advisor": { - "description": "Flag indicates that security advisors are covered by this entitlement.", - "type": "string", - "x-nullable": true, - "x-order": 0 - }, - "config_advisor": { - "description": "Flag indicates that config advisors are covered by this entitlement.", - "type": "string", - "x-nullable": true, - "x-order": 1 - } - }, - "x-order": 10 - } - } - }, - "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/platform/organization/tickets": { - "get": { - "description": "Fetch support tickets belonging to the Percona Portal Organization that the PMM server is connected to.", - "tags": [ - "PlatformService" - ], - "summary": "Search Organization Tickets", - "operationId": "SearchOrganizationTickets", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "tickets": { - "description": "Support tickets belonging to the Percona Portal Organization.", - "type": "array", - "items": { - "description": "OrganizationTicket contains information about the support ticket.", - "type": "object", - "properties": { - "number": { - "description": "Ticket number.", - "type": "string", - "x-order": 0 - }, - "short_description": { - "description": "Ticket short description.", - "type": "string", - "x-order": 1 - }, - "priority": { - "description": "Ticket priority.", - "type": "string", - "x-order": 2 - }, - "state": { - "description": "Ticket state.", - "type": "string", - "x-order": 3 - }, - "create_time": { - "description": "Ticket creation time.", - "type": "string", - "format": "date-time", - "x-order": 4 - }, - "department": { - "description": "Department.", - "type": "string", - "x-order": 5 - }, - "requester": { - "description": "Ticket requester.", - "type": "string", - "x-order": 6 - }, - "task_type": { - "description": "Task type.", - "type": "string", - "x-order": 7 - }, - "url": { - "description": "Ticket url.", - "type": "string", - "x-order": 8 - } - } - }, - "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/platform/server": { - "get": { - "description": "Return PMM server ID and name.", - "tags": [ - "PlatformService" - ], - "summary": "Get Server Info", - "operationId": "ServerInfo", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "pmm_server_name": { - "type": "string", - "x-order": 0 - }, - "pmm_server_id": { - "type": "string", - "x-order": 1 - }, - "pmm_server_telemetry_id": { - "type": "string", - "x-order": 2 - }, - "connected_to_portal": { - "type": "boolean", - "x-order": 3 - } - } - } - }, - "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/platform/user": { - "get": { - "description": "Check if the current user is logged in with their Percona Account.", - "tags": [ - "PlatformService" - ], - "summary": "Get User Status", - "operationId": "UserStatus", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "is_platform_user": { - "type": "boolean", - "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/platform:connect": { - "post": { - "description": "Connect a PMM server to the organization created on Percona Portal. That allows the user to sign in to the PMM server with their Percona Account.", - "tags": [ - "PlatformService" - ], - "summary": "Connect PMM Server", - "operationId": "Connect", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "server_name": { - "description": "User defined human readable PMM Server Name.", - "type": "string", - "x-order": 0 - }, - "personal_access_token": { - "description": "Personal Access Token that the user obtains from Percona Portal.", - "type": "string", - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/platform:disconnect": { - "post": { - "description": "Disconnect a PMM server from the organization created on Percona Portal.", - "tags": [ - "PlatformService" - ], - "summary": "Disconnect PMM Server", - "operationId": "Disconnect", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "force": { - "type": "boolean", - "title": "Forces the cleanup process for connected PMM instances regardless of the Portal API response", - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/qan/metrics:getFilters": { - "post": { - "description": "Provides a filtered map of metrics names.", - "tags": [ - "QANService" - ], - "summary": "Get Filters", - "operationId": "GetFilteredMetricsNames", - "parameters": [ - { - "description": "GetFilteredMetricsNamesRequest contains period for which we need filters.", - "name": "body", - "in": "body", - "required": true, - "schema": { - "description": "GetFilteredMetricsNamesRequest contains period for which we need filters.", - "type": "object", - "properties": { - "period_start_from": { - "type": "string", - "format": "date-time", - "x-order": 0 - }, - "period_start_to": { - "type": "string", - "format": "date-time", - "x-order": 1 - }, - "main_metric_name": { - "type": "string", - "x-order": 2 - }, - "labels": { - "type": "array", - "items": { - "description": "MapFieldEntry allows to pass labels/dimensions in form like {\"server\": [\"db1\", \"db2\"...]}.", - "type": "object", - "properties": { - "key": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "array", - "items": { - "type": "string" - }, - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "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.", - "type": "object", - "properties": { - "labels": { - "type": "object", - "additionalProperties": { - "description": "ListLabels is list of label's values: duplicates are impossible.", - "type": "object", - "properties": { - "name": { - "type": "array", - "items": { - "description": "Values is label values and main metric percent and per second.", - "type": "object", - "properties": { - "value": { - "type": "string", - "x-order": 0 - }, - "main_metric_percent": { - "type": "number", - "format": "float", - "x-order": 1 - }, - "main_metric_per_sec": { - "type": "number", - "format": "float", - "x-order": 2 - } - } - }, - "x-order": 0 - } - } - }, - "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/qan/metrics:getNames": { - "post": { - "description": "Provides a map of all metrics names.", - "tags": [ - "QANService" - ], - "summary": "Get Metrics Names", - "operationId": "GetMetricsNames", - "parameters": [ - { - "description": "MetricsNamesRequest is empty.", - "name": "body", - "in": "body", - "required": true, - "schema": { - "description": "MetricsNamesRequest is empty.", - "type": "object" - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "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.", - "type": "object", - "properties": { - "data": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/qan/metrics:getReport": { - "post": { - "description": "Returns a list of metrics grouped by queryid or other dimensions.", - "tags": [ - "QANService" - ], - "summary": "Get Report", - "operationId": "GetReport", - "parameters": [ - { - "description": "ReportRequest defines filtering of metrics report for db server or other dimentions.", - "name": "body", - "in": "body", - "required": true, - "schema": { - "description": "ReportRequest defines filtering of metrics report for db server or other dimentions.", - "type": "object", - "properties": { - "period_start_from": { - "type": "string", - "format": "date-time", - "x-order": 0 - }, - "period_start_to": { - "type": "string", - "format": "date-time", - "x-order": 1 - }, - "group_by": { - "type": "string", - "x-order": 2 - }, - "labels": { - "type": "array", - "items": { - "description": "ReportMapFieldEntry allows to pass labels/dimentions in form like {\"server\": [\"db1\", \"db2\"...]}.", - "type": "object", - "properties": { - "key": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "array", - "items": { - "type": "string" - }, - "x-order": 1 - } - } - }, - "x-order": 3 - }, - "columns": { - "type": "array", - "items": { - "type": "string" - }, - "x-order": 4 - }, - "order_by": { - "type": "string", - "x-order": 5 - }, - "offset": { - "type": "integer", - "format": "int64", - "x-order": 6 - }, - "limit": { - "type": "integer", - "format": "int64", - "x-order": 7 - }, - "main_metric": { - "type": "string", - "x-order": 8 - }, - "search": { - "type": "string", - "x-order": 9 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "description": "ReportReply is list of reports per quieryids, hosts etc.", - "type": "object", - "properties": { - "total_rows": { - "type": "integer", - "format": "int64", - "x-order": 0 - }, - "offset": { - "type": "integer", - "format": "int64", - "x-order": 1 - }, - "limit": { - "type": "integer", - "format": "int64", - "x-order": 2 - }, - "rows": { - "type": "array", - "items": { - "description": "Row define metrics for selected dimention.", - "type": "object", - "properties": { - "rank": { - "type": "integer", - "format": "int64", - "x-order": 0 - }, - "dimension": { - "type": "string", - "x-order": 1 - }, - "database": { - "type": "string", - "x-order": 2 - }, - "metrics": { - "type": "object", - "additionalProperties": { - "description": "Metric cell.", - "type": "object", - "properties": { - "stats": { - "description": "Stat is statistics of specific metric.", - "type": "object", - "properties": { - "rate": { - "type": "number", - "format": "float", - "x-order": 0 - }, - "cnt": { - "type": "number", - "format": "float", - "x-order": 1 - }, - "sum": { - "type": "number", - "format": "float", - "x-order": 2 - }, - "min": { - "type": "number", - "format": "float", - "x-order": 3 - }, - "max": { - "type": "number", - "format": "float", - "x-order": 4 - }, - "p99": { - "type": "number", - "format": "float", - "x-order": 5 - }, - "avg": { - "type": "number", - "format": "float", - "x-order": 6 - }, - "sum_per_sec": { - "type": "number", - "format": "float", - "x-order": 7 - } - }, - "x-order": 0 - } - } - }, - "x-order": 3 - }, - "sparkline": { - "type": "array", - "items": { - "description": "Point contains values that represents abscissa (time) and ordinate (volume etc.)\nof every point in a coordinate system of Sparklines.", - "type": "object", - "properties": { - "point": { - "description": "The serial number of the chart point from the largest time in the time interval to the lowest time in the time range.", - "type": "integer", - "format": "int64", - "x-order": 0 - }, - "time_frame": { - "description": "Duration beetween two points.", - "type": "integer", - "format": "int64", - "x-order": 1 - }, - "timestamp": { - "description": "Time of point in format RFC3339.", - "type": "string", - "x-order": 2 - }, - "load": { - "description": "load is query_time / time_range.", - "type": "number", - "format": "float", - "x-order": 3 - }, - "num_queries_per_sec": { - "description": "number of queries in bucket.", - "type": "number", - "format": "float", - "x-order": 4 - }, - "num_queries_with_errors_per_sec": { - "description": "number of queries with errors.", - "type": "number", - "format": "float", - "x-order": 5 - }, - "num_queries_with_warnings_per_sec": { - "description": "number of queries with warnings.", - "type": "number", - "format": "float", - "x-order": 6 - }, - "m_query_time_sum_per_sec": { - "description": "The statement execution time in seconds.", - "type": "number", - "format": "float", - "x-order": 7 - }, - "m_lock_time_sum_per_sec": { - "description": "The time to acquire locks in seconds.", - "type": "number", - "format": "float", - "x-order": 8 - }, - "m_rows_sent_sum_per_sec": { - "description": "The number of rows sent to the client.", - "type": "number", - "format": "float", - "x-order": 9 - }, - "m_rows_examined_sum_per_sec": { - "description": "Number of rows scanned - SELECT.", - "type": "number", - "format": "float", - "x-order": 10 - }, - "m_rows_affected_sum_per_sec": { - "description": "Number of rows changed - UPDATE, DELETE, INSERT.", - "type": "number", - "format": "float", - "x-order": 11 - }, - "m_rows_read_sum_per_sec": { - "description": "The number of rows read from tables.", - "type": "number", - "format": "float", - "x-order": 12 - }, - "m_merge_passes_sum_per_sec": { - "description": "The number of merge passes that the sort algorithm has had to do.", - "type": "number", - "format": "float", - "x-order": 13 - }, - "m_innodb_io_r_ops_sum_per_sec": { - "description": "Counts the number of page read operations scheduled.", - "type": "number", - "format": "float", - "x-order": 14 - }, - "m_innodb_io_r_bytes_sum_per_sec": { - "description": "Similar to innodb_IO_r_ops, but the unit is bytes.", - "type": "number", - "format": "float", - "x-order": 15 - }, - "m_innodb_io_r_wait_sum_per_sec": { - "description": "Shows how long (in seconds) it took InnoDB to actually read the data from storage.", - "type": "number", - "format": "float", - "x-order": 16 - }, - "m_innodb_rec_lock_wait_sum_per_sec": { - "description": "Shows how long (in seconds) the query waited for row locks.", - "type": "number", - "format": "float", - "x-order": 17 - }, - "m_innodb_queue_wait_sum_per_sec": { - "description": "Shows how long (in seconds) the query spent either waiting to enter the InnoDB queue or inside that queue waiting for execution.", - "type": "number", - "format": "float", - "x-order": 18 - }, - "m_innodb_pages_distinct_sum_per_sec": { - "description": "Counts approximately the number of unique pages the query accessed.", - "type": "number", - "format": "float", - "x-order": 19 - }, - "m_query_length_sum_per_sec": { - "description": "Shows how long the query is.", - "type": "number", - "format": "float", - "x-order": 20 - }, - "m_bytes_sent_sum_per_sec": { - "description": "The number of bytes sent to all clients.", - "type": "number", - "format": "float", - "x-order": 21 - }, - "m_tmp_tables_sum_per_sec": { - "description": "Number of temporary tables created on memory for the query.", - "type": "number", - "format": "float", - "x-order": 22 - }, - "m_tmp_disk_tables_sum_per_sec": { - "description": "Number of temporary tables created on disk for the query.", - "type": "number", - "format": "float", - "x-order": 23 - }, - "m_tmp_table_sizes_sum_per_sec": { - "description": "Total Size in bytes for all temporary tables used in the query.", - "type": "number", - "format": "float", - "x-order": 24 - }, - "m_qc_hit_sum_per_sec": { - "description": "Query Cache hits.", - "type": "number", - "format": "float", - "x-order": 25 - }, - "m_full_scan_sum_per_sec": { - "description": "The query performed a full table scan.", - "type": "number", - "format": "float", - "x-order": 26 - }, - "m_full_join_sum_per_sec": { - "description": "The query performed a full join (a join without indexes).", - "type": "number", - "format": "float", - "x-order": 27 - }, - "m_tmp_table_sum_per_sec": { - "description": "The query created an implicit internal temporary table.", - "type": "number", - "format": "float", - "x-order": 28 - }, - "m_tmp_table_on_disk_sum_per_sec": { - "description": "The querys temporary table was stored on disk.", - "type": "number", - "format": "float", - "x-order": 29 - }, - "m_filesort_sum_per_sec": { - "description": "The query used a filesort.", - "type": "number", - "format": "float", - "x-order": 30 - }, - "m_filesort_on_disk_sum_per_sec": { - "description": "The filesort was performed on disk.", - "type": "number", - "format": "float", - "x-order": 31 - }, - "m_select_full_range_join_sum_per_sec": { - "description": "The number of joins that used a range search on a reference table.", - "type": "number", - "format": "float", - "x-order": 32 - }, - "m_select_range_sum_per_sec": { - "description": "The number of joins that used ranges on the first table.", - "type": "number", - "format": "float", - "x-order": 33 - }, - "m_select_range_check_sum_per_sec": { - "description": "The number of joins without keys that check for key usage after each row.", - "type": "number", - "format": "float", - "x-order": 34 - }, - "m_sort_range_sum_per_sec": { - "description": "The number of sorts that were done using ranges.", - "type": "number", - "format": "float", - "x-order": 35 - }, - "m_sort_rows_sum_per_sec": { - "description": "The number of sorted rows.", - "type": "number", - "format": "float", - "x-order": 36 - }, - "m_sort_scan_sum_per_sec": { - "description": "The number of sorts that were done by scanning the table.", - "type": "number", - "format": "float", - "x-order": 37 - }, - "m_no_index_used_sum_per_sec": { - "description": "The number of queries without index.", - "type": "number", - "format": "float", - "x-order": 38 - }, - "m_no_good_index_used_sum_per_sec": { - "description": "The number of queries without good index.", - "type": "number", - "format": "float", - "x-order": 39 - }, - "m_docs_returned_sum_per_sec": { - "description": "The number of returned documents.", - "type": "number", - "format": "float", - "x-order": 40 - }, - "m_response_length_sum_per_sec": { - "description": "The response length of the query result in bytes.", - "type": "number", - "format": "float", - "x-order": 41 - }, - "m_docs_scanned_sum_per_sec": { - "description": "The number of scanned documents.", - "type": "number", - "format": "float", - "x-order": 42 - }, - "m_docs_examined_sum_per_sec": { - "description": "Total number of documents scanned during query execution.", - "type": "number", - "format": "float", - "x-order": 43 - }, - "m_keys_examined_sum_per_sec": { - "description": "Total number of index keys scanned during query execution.", - "type": "number", - "format": "float", - "x-order": 44 - }, - "m_locks_global_acquire_count_read_shared_sum_per_sec": { - "description": "Number of times a global read lock was acquired during query execution.", - "type": "number", - "format": "float", - "x-order": 45 - }, - "m_locks_global_acquire_count_write_shared_sum_per_sec": { - "description": "Number of times a global write lock was acquired during query execution.", - "type": "number", - "format": "float", - "x-order": 46 - }, - "m_locks_database_acquire_count_read_shared_sum_per_sec": { - "description": "Number of times a read lock was acquired at the database level during query execution.", - "type": "number", - "format": "float", - "x-order": 47 - }, - "m_locks_database_acquire_wait_count_read_shared_sum_per_sec": { - "description": "Number of times a read lock at the database level was requested but had to wait before being granted.", - "type": "number", - "format": "float", - "x-order": 48 - }, - "m_locks_database_time_acquiring_micros_read_shared_sum_per_sec": { - "description": "Indicates the time, spent acquiring a read lock at the database level during an operation.", - "type": "number", - "format": "float", - "x-order": 49 - }, - "m_locks_collection_acquire_count_read_shared_sum_per_sec": { - "description": "Number of times a read lock was acquired on a specific collection during operations.", - "type": "number", - "format": "float", - "x-order": 50 - }, - "m_storage_bytes_read_sum_per_sec": { - "description": "Total number of bytes read from storage during a specific operation.", - "type": "number", - "format": "float", - "x-order": 51 - }, - "m_storage_time_reading_micros_sum_per_sec": { - "description": "Indicates the time, spent reading data from storage during an operation.", - "type": "number", - "format": "float", - "x-order": 52 - }, - "m_shared_blks_hit_sum_per_sec": { - "description": "Total number of shared block cache hits by the statement.", - "type": "number", - "format": "float", - "x-order": 53 - }, - "m_shared_blks_read_sum_per_sec": { - "description": "Total number of shared blocks read by the statement.", - "type": "number", - "format": "float", - "x-order": 54 - }, - "m_shared_blks_dirtied_sum_per_sec": { - "description": "Total number of shared blocks dirtied by the statement.", - "type": "number", - "format": "float", - "x-order": 55 - }, - "m_shared_blks_written_sum_per_sec": { - "description": "Total number of shared blocks written by the statement.", - "type": "number", - "format": "float", - "x-order": 56 - }, - "m_shared_blk_read_time_sum_per_sec": { - "description": "Total time the statement spent reading shared blocks, in milliseconds (if track_io_timing is enabled, otherwise zero).", - "type": "number", - "format": "float", - "x-order": 57 - }, - "m_shared_blk_write_time_sum_per_sec": { - "description": "Total time the statement spent writing shared blocks, in milliseconds (if track_io_timing is enabled, otherwise zero).", - "type": "number", - "format": "float", - "x-order": 58 - }, - "m_local_blk_read_time_sum_per_sec": { - "description": "Total time the statement spent reading shared blocks, in milliseconds (if track_io_timing is enabled, otherwise zero).", - "type": "number", - "format": "float", - "x-order": 59 - }, - "m_local_blk_write_time_sum_per_sec": { - "description": "Total time the statement spent writing shared blocks, in milliseconds (if track_io_timing is enabled, otherwise zero).", - "type": "number", - "format": "float", - "x-order": 60 - }, - "m_local_blks_hit_sum_per_sec": { - "description": "Total number of local block cache hits by the statement.", - "type": "number", - "format": "float", - "x-order": 61 - }, - "m_local_blks_read_sum_per_sec": { - "description": "Total number of local blocks read by the statement.", - "type": "number", - "format": "float", - "x-order": 62 - }, - "m_local_blks_dirtied_sum_per_sec": { - "description": "Total number of local blocks dirtied by the statement.", - "type": "number", - "format": "float", - "x-order": 63 - }, - "m_local_blks_written_sum_per_sec": { - "description": "Total number of local blocks written by the statement.", - "type": "number", - "format": "float", - "x-order": 64 - }, - "m_temp_blks_read_sum_per_sec": { - "description": "Total number of temp blocks read by the statement.", - "type": "number", - "format": "float", - "x-order": 65 - }, - "m_temp_blks_written_sum_per_sec": { - "description": "Total number of temp blocks written by the statement.", - "type": "number", - "format": "float", - "x-order": 66 - }, - "m_blk_read_time_sum_per_sec": { - "description": "Total time the statement spent reading blocks, in milliseconds (if track_io_timing is enabled, otherwise zero).", - "type": "number", - "format": "float", - "x-order": 67 - }, - "m_blk_write_time_sum_per_sec": { - "description": "Total time the statement spent writing blocks, in milliseconds (if track_io_timing is enabled, otherwise zero).", - "type": "number", - "format": "float", - "x-order": 68 - }, - "m_cpu_user_time_sum_per_sec": { - "description": "Total time user spent in query.", - "type": "number", - "format": "float", - "x-order": 69 - }, - "m_cpu_sys_time_sum_per_sec": { - "description": "Total time system spent in query.", - "type": "number", - "format": "float", - "x-order": 70 - }, - "m_plans_calls_sum_per_sec": { - "description": "Total number of planned calls.", - "type": "number", - "format": "float", - "x-order": 71 - }, - "m_wal_records_sum_per_sec": { - "description": "Total number of WAL (Write-ahead logging) records.", - "type": "number", - "format": "float", - "x-order": 72 - }, - "m_wal_fpi_sum_per_sec": { - "description": "Total number of FPI (full page images) in WAL (Write-ahead logging) records.", - "type": "number", - "format": "float", - "x-order": 73 - }, - "m_wal_bytes_sum_per_sec": { - "description": "Total bytes of WAL (Write-ahead logging) records.", - "type": "number", - "format": "float", - "x-order": 74 - }, - "m_plan_time_sum_per_sec": { - "description": "Plan time in per seconds.", - "type": "number", - "format": "float", - "x-order": 75 - } - } - }, - "x-order": 4 - }, - "fingerprint": { - "type": "string", - "x-order": 5 - }, - "num_queries": { - "type": "integer", - "format": "int64", - "x-order": 6 - }, - "qps": { - "type": "number", - "format": "float", - "x-order": 7 - }, - "load": { - "type": "number", - "format": "float", - "x-order": 8 - } - } - }, - "x-order": 3 - } - } - } - }, - "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/qan/query/{queryid}/plan": { - "get": { - "description": "Provides a query plan and plan id for specific filtering.", - "tags": [ - "QANService" - ], - "summary": "Get Query Plan", - "operationId": "GetQueryPlan", - "parameters": [ - { - "type": "string", - "name": "queryid", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "description": "GetQueryPlanResponse contains planid and query_plan.", - "type": "object", - "properties": { - "planid": { - "type": "string", - "x-order": 0 - }, - "query_plan": { - "type": "string", - "x-order": 1 - } - } - } - }, - "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/qan/query:exists": { - "post": { - "description": "Checks if query exists in clickhouse.", - "tags": [ - "QANService" - ], - "summary": "Check Query Existence", - "operationId": "QueryExists", - "parameters": [ - { - "description": "QueryExistsRequest check if provided query exists or not.", - "name": "body", - "in": "body", - "required": true, - "schema": { - "description": "QueryExistsRequest check if provided query exists or not.", - "type": "object", - "properties": { - "serviceid": { - "type": "string", - "x-order": 0 - }, - "query": { - "type": "string", - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "description": "QueryExistsResponse returns true if query exists.", - "type": "object", - "properties": { - "exists": { - "type": "boolean", - "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/qan/query:getExample": { - "post": { - "description": "Provides a list of query examples.", - "tags": [ - "QANService" - ], - "summary": "Get Query Example", - "operationId": "GetQueryExample", - "parameters": [ - { - "description": "GetQueryExampleRequest defines filtering of query examples for specific value of\ndimension (ex.: host=hostname1 or queryid=1D410B4BE5060972.", - "name": "body", - "in": "body", - "required": true, - "schema": { - "description": "GetQueryExampleRequest defines filtering of query examples for specific value of\ndimension (ex.: host=hostname1 or queryid=1D410B4BE5060972.", - "type": "object", - "properties": { - "period_start_from": { - "type": "string", - "format": "date-time", - "x-order": 0 - }, - "period_start_to": { - "type": "string", - "format": "date-time", - "x-order": 1 - }, - "filter_by": { - "description": "dimension value: ex: queryid - 1D410B4BE5060972.", - "type": "string", - "x-order": 2 - }, - "group_by": { - "description": "one of dimension: queryid | host ...", - "type": "string", - "x-order": 3 - }, - "labels": { - "type": "array", - "items": { - "description": "MapFieldEntry allows to pass labels/dimensions in form like {\"server\": [\"db1\", \"db2\"...]}.", - "type": "object", - "properties": { - "key": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "array", - "items": { - "type": "string" - }, - "x-order": 1 - } - } - }, - "x-order": 4 - }, - "limit": { - "type": "integer", - "format": "int64", - "x-order": 5 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "description": "GetQueryExampleResponse list of query examples.", - "type": "object", - "properties": { - "query_examples": { - "type": "array", - "items": { - "description": "QueryExample shows query examples and their metrics.", - "type": "object", - "properties": { - "example": { - "type": "string", - "x-order": 0 - }, - "example_type": { - "description": "ExampleType is a type of query example selected for this query class in given period of time.", - "type": "string", - "default": "EXAMPLE_TYPE_UNSPECIFIED", - "enum": [ - "EXAMPLE_TYPE_UNSPECIFIED", - "EXAMPLE_TYPE_RANDOM", - "EXAMPLE_TYPE_SLOWEST", - "EXAMPLE_TYPE_FASTEST", - "EXAMPLE_TYPE_WITH_ERROR" - ], - "x-order": 1 - }, - "is_truncated": { - "type": "integer", - "format": "int64", - "x-order": 2 - }, - "placeholders_count": { - "type": "integer", - "format": "int64", - "x-order": 3 - }, - "explain_fingerprint": { - "type": "string", - "x-order": 4 - }, - "query_id": { - "type": "string", - "x-order": 5 - }, - "example_metrics": { - "type": "string", - "x-order": 6 - }, - "service_id": { - "type": "string", - "x-order": 7 - }, - "service_type": { - "type": "string", - "x-order": 8 - }, - "schema": { - "type": "string", - "x-order": 9 - }, - "tables": { - "type": "array", - "items": { - "type": "string" - }, - "x-order": 10 - } - } - }, - "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/qan/query:getSchema": { - "post": { - "description": "Provides the schema for a given queryID and serviceID.", - "tags": [ - "QANService" - ], - "summary": "Get Schema", - "operationId": "SchemaByQueryID", - "parameters": [ - { - "description": "SchemaByQueryIDRequest returns schema for given query ID and service ID.", - "name": "body", - "in": "body", - "required": true, - "schema": { - "description": "SchemaByQueryIDRequest returns schema for given query ID and service ID.", - "type": "object", - "properties": { - "service_id": { - "type": "string", - "x-order": 0 - }, - "query_id": { - "type": "string", - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "description": "SchemaByQueryIDResponse is schema for given query ID and service ID.", - "type": "object", - "properties": { - "schema": { - "type": "string", - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/qan:explainFingerprint": { - "post": { - "description": "Provides an explain fingerprint for given query ID.", - "tags": [ - "QANService" - ], - "summary": "Get Explain Fingerprint", - "operationId": "ExplainFingerprintByQueryID", - "parameters": [ - { - "description": "ExplainFingerprintByQueryIDRequest get explain fingerprint for given query ID.", - "name": "body", - "in": "body", - "required": true, - "schema": { - "description": "ExplainFingerprintByQueryIDRequest get explain fingerprint for given query ID.", - "type": "object", - "properties": { - "serviceid": { - "type": "string", - "x-order": 0 - }, - "query_id": { - "type": "string", - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "description": "ExplainFingerprintByQueryIDResponse is explain fingerprint and placeholders count for given query ID.", - "type": "object", - "properties": { - "explain_fingerprint": { - "type": "string", - "x-order": 0 - }, - "placeholders_count": { - "type": "integer", - "format": "int64", - "x-order": 1 - } - } - } - }, - "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/qan:getHistogram": { - "post": { - "description": "Provides histogram items for specific filtering.", - "tags": [ - "QANService" - ], - "summary": "Get Histogram", - "operationId": "GetHistogram", - "parameters": [ - { - "description": "GetHistogramRequest defines filtering by time range, labels and queryid.", - "name": "body", - "in": "body", - "required": true, - "schema": { - "description": "GetHistogramRequest defines filtering by time range, labels and queryid.", - "type": "object", - "properties": { - "period_start_from": { - "type": "string", - "format": "date-time", - "x-order": 0 - }, - "period_start_to": { - "type": "string", - "format": "date-time", - "x-order": 1 - }, - "labels": { - "type": "array", - "items": { - "description": "MapFieldEntry allows to pass labels/dimensions in form like {\"server\": [\"db1\", \"db2\"...]}.", - "type": "object", - "properties": { - "key": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "array", - "items": { - "type": "string" - }, - "x-order": 1 - } - } - }, - "x-order": 2 - }, - "queryid": { - "type": "string", - "x-order": 3 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "description": "GetHistogramResponse is histogram items as a list.", - "type": "object", - "properties": { - "histogram_items": { - "type": "array", - "items": { - "description": "HistogramItem represents one item in histogram.", - "type": "object", - "properties": { - "range": { - "type": "string", - "x-order": 0 - }, - "frequency": { - "type": "integer", - "format": "int64", - "x-order": 1 - } - } - }, - "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/qan:getLabels": { - "post": { - "description": "Provides a list of labels for object details.", - "tags": [ - "QANService" - ], - "summary": "Get Labels", - "operationId": "GetLabels", - "parameters": [ - { - "description": "GetLabelsRequest defines filtering of object detail's labels for specific value of\ndimension (ex.: host=hostname1 or queryid=1D410B4BE5060972.", - "name": "body", - "in": "body", - "required": true, - "schema": { - "description": "GetLabelsRequest defines filtering of object detail's labels for specific value of\ndimension (ex.: host=hostname1 or queryid=1D410B4BE5060972.", - "type": "object", - "properties": { - "period_start_from": { - "type": "string", - "format": "date-time", - "x-order": 0 - }, - "period_start_to": { - "type": "string", - "format": "date-time", - "x-order": 1 - }, - "filter_by": { - "description": "dimension value: ex: queryid - 1D410B4BE5060972.", - "type": "string", - "x-order": 2 - }, - "group_by": { - "description": "one of dimension: queryid | host ...", - "type": "string", - "x-order": 3 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "description": "GetLabelsResponse is a map of labels names as keys and labels values as a list.", - "type": "object", - "properties": { - "labels": { - "type": "object", - "additionalProperties": { - "description": "ListLabelValues is list of label's values.", - "type": "object", - "properties": { - "values": { - "type": "array", - "items": { - "type": "string" - }, - "x-order": 0 - } - } - }, - "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/qan:getMetrics": { - "post": { - "description": "Provides a map of metrics for specific filtering.", - "tags": [ - "QANService" - ], - "summary": "Get Metrics", - "operationId": "GetMetrics", - "parameters": [ - { - "description": "GetMetricsRequest defines filtering of metrics for specific value of dimension (ex.: host=hostname1 or queryid=1D410B4BE5060972.", - "name": "body", - "in": "body", - "required": true, - "schema": { - "description": "GetMetricsRequest defines filtering of metrics for specific value of dimension (ex.: host=hostname1 or queryid=1D410B4BE5060972.", - "type": "object", - "properties": { - "period_start_from": { - "type": "string", - "format": "date-time", - "x-order": 0 - }, - "period_start_to": { - "type": "string", - "format": "date-time", - "x-order": 1 - }, - "filter_by": { - "description": "dimension value: ex: queryid - 1D410B4BE5060972.", - "type": "string", - "x-order": 2 - }, - "group_by": { - "description": "one of dimension: queryid | host ...", - "type": "string", - "x-order": 3 - }, - "labels": { - "type": "array", - "items": { - "description": "MapFieldEntry allows to pass labels/dimensions in form like {\"server\": [\"db1\", \"db2\"...]}.", - "type": "object", - "properties": { - "key": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "array", - "items": { - "type": "string" - }, - "x-order": 1 - } - } - }, - "x-order": 4 - }, - "include_only_fields": { - "type": "array", - "items": { - "type": "string" - }, - "x-order": 5 - }, - "totals": { - "type": "boolean", - "title": "retrieve only values for totals, excluding N/A values", - "x-order": 6 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "description": "GetMetricsResponse defines metrics for specific value of dimension (ex.: host=hostname1 or queryid=1D410B4BE5060972.", - "type": "object", - "properties": { - "metrics": { - "type": "object", - "additionalProperties": { - "description": "MetricValues is statistics of specific metric.", - "type": "object", - "properties": { - "rate": { - "type": "number", - "format": "float", - "x-order": 0 - }, - "cnt": { - "type": "number", - "format": "float", - "x-order": 1 - }, - "sum": { - "type": "number", - "format": "float", - "x-order": 2 - }, - "min": { - "type": "number", - "format": "float", - "x-order": 3 - }, - "max": { - "type": "number", - "format": "float", - "x-order": 4 - }, - "avg": { - "type": "number", - "format": "float", - "x-order": 5 - }, - "p99": { - "type": "number", - "format": "float", - "x-order": 6 - }, - "percent_of_total": { - "type": "number", - "format": "float", - "x-order": 7 - } - } - }, - "x-order": 0 - }, - "text_metrics": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 1 - }, - "sparkline": { - "type": "array", - "items": { - "description": "Point contains values that represents abscissa (time) and ordinate (volume etc.)\nof every point in a coordinate system of Sparklines.", - "type": "object", - "properties": { - "point": { - "description": "The serial number of the chart point from the largest time in the time interval to the lowest time in the time range.", - "type": "integer", - "format": "int64", - "x-order": 0 - }, - "time_frame": { - "description": "Duration beetween two points.", - "type": "integer", - "format": "int64", - "x-order": 1 - }, - "timestamp": { - "description": "Time of point in format RFC3339.", - "type": "string", - "x-order": 2 - }, - "load": { - "description": "load is query_time / time_range.", - "type": "number", - "format": "float", - "x-order": 3 - }, - "num_queries_per_sec": { - "description": "number of queries in bucket.", - "type": "number", - "format": "float", - "x-order": 4 - }, - "num_queries_with_errors_per_sec": { - "description": "number of queries with errors.", - "type": "number", - "format": "float", - "x-order": 5 - }, - "num_queries_with_warnings_per_sec": { - "description": "number of queries with warnings.", - "type": "number", - "format": "float", - "x-order": 6 - }, - "m_query_time_sum_per_sec": { - "description": "The statement execution time in seconds.", - "type": "number", - "format": "float", - "x-order": 7 - }, - "m_lock_time_sum_per_sec": { - "description": "The time to acquire locks in seconds.", - "type": "number", - "format": "float", - "x-order": 8 - }, - "m_rows_sent_sum_per_sec": { - "description": "The number of rows sent to the client.", - "type": "number", - "format": "float", - "x-order": 9 - }, - "m_rows_examined_sum_per_sec": { - "description": "Number of rows scanned - SELECT.", - "type": "number", - "format": "float", - "x-order": 10 - }, - "m_rows_affected_sum_per_sec": { - "description": "Number of rows changed - UPDATE, DELETE, INSERT.", - "type": "number", - "format": "float", - "x-order": 11 - }, - "m_rows_read_sum_per_sec": { - "description": "The number of rows read from tables.", - "type": "number", - "format": "float", - "x-order": 12 - }, - "m_merge_passes_sum_per_sec": { - "description": "The number of merge passes that the sort algorithm has had to do.", - "type": "number", - "format": "float", - "x-order": 13 - }, - "m_innodb_io_r_ops_sum_per_sec": { - "description": "Counts the number of page read operations scheduled.", - "type": "number", - "format": "float", - "x-order": 14 - }, - "m_innodb_io_r_bytes_sum_per_sec": { - "description": "Similar to innodb_IO_r_ops, but the unit is bytes.", - "type": "number", - "format": "float", - "x-order": 15 - }, - "m_innodb_io_r_wait_sum_per_sec": { - "description": "Shows how long (in seconds) it took InnoDB to actually read the data from storage.", - "type": "number", - "format": "float", - "x-order": 16 - }, - "m_innodb_rec_lock_wait_sum_per_sec": { - "description": "Shows how long (in seconds) the query waited for row locks.", - "type": "number", - "format": "float", - "x-order": 17 - }, - "m_innodb_queue_wait_sum_per_sec": { - "description": "Shows how long (in seconds) the query spent either waiting to enter the InnoDB queue or inside that queue waiting for execution.", - "type": "number", - "format": "float", - "x-order": 18 - }, - "m_innodb_pages_distinct_sum_per_sec": { - "description": "Counts approximately the number of unique pages the query accessed.", - "type": "number", - "format": "float", - "x-order": 19 - }, - "m_query_length_sum_per_sec": { - "description": "Shows how long the query is.", - "type": "number", - "format": "float", - "x-order": 20 - }, - "m_bytes_sent_sum_per_sec": { - "description": "The number of bytes sent to all clients.", - "type": "number", - "format": "float", - "x-order": 21 - }, - "m_tmp_tables_sum_per_sec": { - "description": "Number of temporary tables created on memory for the query.", - "type": "number", - "format": "float", - "x-order": 22 - }, - "m_tmp_disk_tables_sum_per_sec": { - "description": "Number of temporary tables created on disk for the query.", - "type": "number", - "format": "float", - "x-order": 23 - }, - "m_tmp_table_sizes_sum_per_sec": { - "description": "Total Size in bytes for all temporary tables used in the query.", - "type": "number", - "format": "float", - "x-order": 24 - }, - "m_qc_hit_sum_per_sec": { - "description": "Query Cache hits.", - "type": "number", - "format": "float", - "x-order": 25 - }, - "m_full_scan_sum_per_sec": { - "description": "The query performed a full table scan.", - "type": "number", - "format": "float", - "x-order": 26 - }, - "m_full_join_sum_per_sec": { - "description": "The query performed a full join (a join without indexes).", - "type": "number", - "format": "float", - "x-order": 27 - }, - "m_tmp_table_sum_per_sec": { - "description": "The query created an implicit internal temporary table.", - "type": "number", - "format": "float", - "x-order": 28 - }, - "m_tmp_table_on_disk_sum_per_sec": { - "description": "The querys temporary table was stored on disk.", - "type": "number", - "format": "float", - "x-order": 29 - }, - "m_filesort_sum_per_sec": { - "description": "The query used a filesort.", - "type": "number", - "format": "float", - "x-order": 30 - }, - "m_filesort_on_disk_sum_per_sec": { - "description": "The filesort was performed on disk.", - "type": "number", - "format": "float", - "x-order": 31 - }, - "m_select_full_range_join_sum_per_sec": { - "description": "The number of joins that used a range search on a reference table.", - "type": "number", - "format": "float", - "x-order": 32 - }, - "m_select_range_sum_per_sec": { - "description": "The number of joins that used ranges on the first table.", - "type": "number", - "format": "float", - "x-order": 33 - }, - "m_select_range_check_sum_per_sec": { - "description": "The number of joins without keys that check for key usage after each row.", - "type": "number", - "format": "float", - "x-order": 34 - }, - "m_sort_range_sum_per_sec": { - "description": "The number of sorts that were done using ranges.", - "type": "number", - "format": "float", - "x-order": 35 - }, - "m_sort_rows_sum_per_sec": { - "description": "The number of sorted rows.", - "type": "number", - "format": "float", - "x-order": 36 - }, - "m_sort_scan_sum_per_sec": { - "description": "The number of sorts that were done by scanning the table.", - "type": "number", - "format": "float", - "x-order": 37 - }, - "m_no_index_used_sum_per_sec": { - "description": "The number of queries without index.", - "type": "number", - "format": "float", - "x-order": 38 - }, - "m_no_good_index_used_sum_per_sec": { - "description": "The number of queries without good index.", - "type": "number", - "format": "float", - "x-order": 39 - }, - "m_docs_returned_sum_per_sec": { - "description": "The number of returned documents.", - "type": "number", - "format": "float", - "x-order": 40 - }, - "m_response_length_sum_per_sec": { - "description": "The response length of the query result in bytes.", - "type": "number", - "format": "float", - "x-order": 41 - }, - "m_docs_scanned_sum_per_sec": { - "description": "The number of scanned documents.", - "type": "number", - "format": "float", - "x-order": 42 - }, - "m_docs_examined_sum_per_sec": { - "description": "Total number of documents scanned during query execution.", - "type": "number", - "format": "float", - "x-order": 43 - }, - "m_keys_examined_sum_per_sec": { - "description": "Total number of index keys scanned during query execution.", - "type": "number", - "format": "float", - "x-order": 44 - }, - "m_locks_global_acquire_count_read_shared_sum_per_sec": { - "description": "Number of times a global read lock was acquired during query execution.", - "type": "number", - "format": "float", - "x-order": 45 - }, - "m_locks_global_acquire_count_write_shared_sum_per_sec": { - "description": "Number of times a global write lock was acquired during query execution.", - "type": "number", - "format": "float", - "x-order": 46 - }, - "m_locks_database_acquire_count_read_shared_sum_per_sec": { - "description": "Number of times a read lock was acquired at the database level during query execution.", - "type": "number", - "format": "float", - "x-order": 47 - }, - "m_locks_database_acquire_wait_count_read_shared_sum_per_sec": { - "description": "Number of times a read lock at the database level was requested but had to wait before being granted.", - "type": "number", - "format": "float", - "x-order": 48 - }, - "m_locks_database_time_acquiring_micros_read_shared_sum_per_sec": { - "description": "Indicates the time, spent acquiring a read lock at the database level during an operation.", - "type": "number", - "format": "float", - "x-order": 49 - }, - "m_locks_collection_acquire_count_read_shared_sum_per_sec": { - "description": "Number of times a read lock was acquired on a specific collection during operations.", - "type": "number", - "format": "float", - "x-order": 50 - }, - "m_storage_bytes_read_sum_per_sec": { - "description": "Total number of bytes read from storage during a specific operation.", - "type": "number", - "format": "float", - "x-order": 51 - }, - "m_storage_time_reading_micros_sum_per_sec": { - "description": "Indicates the time, spent reading data from storage during an operation.", - "type": "number", - "format": "float", - "x-order": 52 - }, - "m_shared_blks_hit_sum_per_sec": { - "description": "Total number of shared block cache hits by the statement.", - "type": "number", - "format": "float", - "x-order": 53 - }, - "m_shared_blks_read_sum_per_sec": { - "description": "Total number of shared blocks read by the statement.", - "type": "number", - "format": "float", - "x-order": 54 - }, - "m_shared_blks_dirtied_sum_per_sec": { - "description": "Total number of shared blocks dirtied by the statement.", - "type": "number", - "format": "float", - "x-order": 55 - }, - "m_shared_blks_written_sum_per_sec": { - "description": "Total number of shared blocks written by the statement.", - "type": "number", - "format": "float", - "x-order": 56 - }, - "m_shared_blk_read_time_sum_per_sec": { - "description": "Total time the statement spent reading shared blocks, in milliseconds (if track_io_timing is enabled, otherwise zero).", - "type": "number", - "format": "float", - "x-order": 57 - }, - "m_shared_blk_write_time_sum_per_sec": { - "description": "Total time the statement spent writing shared blocks, in milliseconds (if track_io_timing is enabled, otherwise zero).", - "type": "number", - "format": "float", - "x-order": 58 - }, - "m_local_blk_read_time_sum_per_sec": { - "description": "Total time the statement spent reading shared blocks, in milliseconds (if track_io_timing is enabled, otherwise zero).", - "type": "number", - "format": "float", - "x-order": 59 - }, - "m_local_blk_write_time_sum_per_sec": { - "description": "Total time the statement spent writing shared blocks, in milliseconds (if track_io_timing is enabled, otherwise zero).", - "type": "number", - "format": "float", - "x-order": 60 - }, - "m_local_blks_hit_sum_per_sec": { - "description": "Total number of local block cache hits by the statement.", - "type": "number", - "format": "float", - "x-order": 61 - }, - "m_local_blks_read_sum_per_sec": { - "description": "Total number of local blocks read by the statement.", - "type": "number", - "format": "float", - "x-order": 62 - }, - "m_local_blks_dirtied_sum_per_sec": { - "description": "Total number of local blocks dirtied by the statement.", - "type": "number", - "format": "float", - "x-order": 63 - }, - "m_local_blks_written_sum_per_sec": { - "description": "Total number of local blocks written by the statement.", - "type": "number", - "format": "float", - "x-order": 64 - }, - "m_temp_blks_read_sum_per_sec": { - "description": "Total number of temp blocks read by the statement.", - "type": "number", - "format": "float", - "x-order": 65 - }, - "m_temp_blks_written_sum_per_sec": { - "description": "Total number of temp blocks written by the statement.", - "type": "number", - "format": "float", - "x-order": 66 - }, - "m_blk_read_time_sum_per_sec": { - "description": "Total time the statement spent reading blocks, in milliseconds (if track_io_timing is enabled, otherwise zero).", - "type": "number", - "format": "float", - "x-order": 67 - }, - "m_blk_write_time_sum_per_sec": { - "description": "Total time the statement spent writing blocks, in milliseconds (if track_io_timing is enabled, otherwise zero).", - "type": "number", - "format": "float", - "x-order": 68 - }, - "m_cpu_user_time_sum_per_sec": { - "description": "Total time user spent in query.", - "type": "number", - "format": "float", - "x-order": 69 - }, - "m_cpu_sys_time_sum_per_sec": { - "description": "Total time system spent in query.", - "type": "number", - "format": "float", - "x-order": 70 - }, - "m_plans_calls_sum_per_sec": { - "description": "Total number of planned calls.", - "type": "number", - "format": "float", - "x-order": 71 - }, - "m_wal_records_sum_per_sec": { - "description": "Total number of WAL (Write-ahead logging) records.", - "type": "number", - "format": "float", - "x-order": 72 - }, - "m_wal_fpi_sum_per_sec": { - "description": "Total number of FPI (full page images) in WAL (Write-ahead logging) records.", - "type": "number", - "format": "float", - "x-order": 73 - }, - "m_wal_bytes_sum_per_sec": { - "description": "Total bytes of WAL (Write-ahead logging) records.", - "type": "number", - "format": "float", - "x-order": 74 - }, - "m_plan_time_sum_per_sec": { - "description": "Plan time in per seconds.", - "type": "number", - "format": "float", - "x-order": 75 - } - } - }, - "x-order": 2 - }, - "totals": { - "type": "object", - "additionalProperties": { - "description": "MetricValues is statistics of specific metric.", - "type": "object", - "properties": { - "rate": { - "type": "number", - "format": "float", - "x-order": 0 - }, - "cnt": { - "type": "number", - "format": "float", - "x-order": 1 - }, - "sum": { - "type": "number", - "format": "float", - "x-order": 2 - }, - "min": { - "type": "number", - "format": "float", - "x-order": 3 - }, - "max": { - "type": "number", - "format": "float", - "x-order": 4 - }, - "avg": { - "type": "number", - "format": "float", - "x-order": 5 - }, - "p99": { - "type": "number", - "format": "float", - "x-order": 6 - }, - "percent_of_total": { - "type": "number", - "format": "float", - "x-order": 7 - } - } - }, - "x-order": 3 - }, - "fingerprint": { - "type": "string", - "x-order": 4 - }, - "metadata": { - "description": "GetSlecetedQueryMetadataResponse consists selected query metadata to show in details for given query ID.", - "type": "object", - "properties": { - "service_name": { - "type": "string", - "x-order": 0 - }, - "database": { - "type": "string", - "x-order": 1 - }, - "schema": { - "type": "string", - "x-order": 2 - }, - "username": { - "type": "string", - "x-order": 3 - }, - "replication_set": { - "type": "string", - "x-order": 4 - }, - "cluster": { - "type": "string", - "x-order": 5 - }, - "service_type": { - "type": "string", - "x-order": 6 - }, - "service_id": { - "type": "string", - "x-order": 7 - }, - "environment": { - "type": "string", - "x-order": 8 - }, - "node_id": { - "type": "string", - "x-order": 9 - }, - "node_name": { - "type": "string", - "x-order": 10 - }, - "node_type": { - "type": "string", - "x-order": 11 - } - }, - "x-order": 5 - } - } - } - }, - "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/server/leaderHealthCheck": { - "get": { - "description": "Checks if the instance is the leader in a cluster. Returns an error if the instance isn't the leader.", - "tags": [ - "ServerService" - ], - "summary": "Check Leadership", - "operationId": "LeaderHealthCheck", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "description": "This probe is available without authentication, so it should not contain any data.", - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "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 }", - "type": "object", - "properties": { - "@type": { - "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.", - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/server/logs.zip": { - "get": { - "description": "Returns the PMM Server logs.", - "produces": [ - "application/zip" - ], - "tags": [ - "ServerService" - ], - "summary": "Logs", - "operationId": "Logs", - "parameters": [ - { - "type": "boolean", - "description": "Include performance profiling data,", - "name": "pprof", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "file" - } - }, - "default": { - "description": "An error response.", - "schema": { - "description": "ErrorResponse is a message returned on HTTP error.", - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32" - }, - "error": { - "type": "string" - }, - "message": { - "type": "string" - } - } - } - } - } - } - }, - "/v1/server/readyz": { - "get": { - "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.", - "tags": [ - "ServerService" - ], - "summary": "Check server readiness", - "operationId": "Readiness", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "description": "This probe is available without authentication, so it should not contain any data.", - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "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 }", - "type": "object", - "properties": { - "@type": { - "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.", - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/server/settings": { - "get": { - "description": "Returns current PMM Server settings.", - "tags": [ - "ServerService" - ], - "summary": "Get settings", - "operationId": "GetSettings", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "settings": { - "description": "Settings represents PMM Server settings.", - "type": "object", - "properties": { - "updates_enabled": { - "description": "True if updates are enabled.", - "type": "boolean", - "x-order": 0 - }, - "telemetry_enabled": { - "description": "True if telemetry is enabled.", - "type": "boolean", - "x-order": 1 - }, - "metrics_resolutions": { - "description": "MetricsResolutions represents Prometheus exporters metrics resolutions.", - "type": "object", - "properties": { - "hr": { - "description": "High resolution. Should have a suffix in JSON: 1s, 1m, 1h.", - "type": "string", - "x-order": 0 - }, - "mr": { - "description": "Medium resolution. Should have a suffix in JSON: 1s, 1m, 1h.", - "type": "string", - "x-order": 1 - }, - "lr": { - "description": "Low resolution. Should have a suffix in JSON: 1s, 1m, 1h.", - "type": "string", - "x-order": 2 - } - }, - "x-order": 2 - }, - "data_retention": { - "type": "string", - "x-order": 3 - }, - "ssh_key": { - "type": "string", - "x-order": 4 - }, - "aws_partitions": { - "type": "array", - "items": { - "type": "string" - }, - "x-order": 5 - }, - "advisor_enabled": { - "description": "True if Advisor is enabled.", - "type": "boolean", - "x-order": 6 - }, - "platform_email": { - "description": "Percona Platform user's email, if this PMM instance is linked to the Platform.", - "type": "string", - "x-order": 7 - }, - "alerting_enabled": { - "description": "True if Alerting is enabled.", - "type": "boolean", - "x-order": 8 - }, - "pmm_public_address": { - "description": "PMM Server public address.", - "type": "string", - "x-order": 9 - }, - "advisor_run_intervals": { - "description": "AdvisorRunIntervals represents intervals between each run of Advisor checks.", - "type": "object", - "properties": { - "standard_interval": { - "description": "Standard check interval.", - "type": "string", - "x-order": 0 - }, - "rare_interval": { - "description": "Interval for rare check runs.", - "type": "string", - "x-order": 1 - }, - "frequent_interval": { - "description": "Interval for frequent check runs.", - "type": "string", - "x-order": 2 - } - }, - "x-order": 10 - }, - "backup_management_enabled": { - "description": "True if Backup Management is enabled.", - "type": "boolean", - "x-order": 11 - }, - "azurediscover_enabled": { - "description": "True if Azure Discover is enabled.", - "type": "boolean", - "x-order": 12 - }, - "connected_to_platform": { - "type": "boolean", - "title": "True if the PMM instance is connected to Platform", - "x-order": 13 - }, - "telemetry_summaries": { - "type": "array", - "title": "Includes list of collected telemetry", - "items": { - "type": "string" - }, - "x-order": 14 - }, - "enable_access_control": { - "description": "True if Access Control is enabled.", - "type": "boolean", - "x-order": 15 - }, - "default_role_id": { - "description": "Default Access Control role ID for new users.", - "type": "integer", - "format": "int64", - "x-order": 16 - }, - "enable_internal_pg_qan": { - "description": "True if Query Analytics for PMM's internal PG database is enabled.", - "type": "boolean", - "x-order": 17 - }, - "update_snooze_duration": { - "type": "string", - "title": "Duration for which an update is snoozed", - "x-order": 18 - } - }, - "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": { - "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 }", - "type": "object", - "properties": { - "@type": { - "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.", - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - }, - "put": { - "description": "Changes PMM Server settings.", - "tags": [ - "ServerService" - ], - "summary": "Change settings", - "operationId": "ChangeSettings", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "enable_updates": { - "type": "boolean", - "x-nullable": true, - "x-order": 0 - }, - "enable_telemetry": { - "type": "boolean", - "x-nullable": true, - "x-order": 1 - }, - "metrics_resolutions": { - "description": "MetricsResolutions represents Prometheus exporters metrics resolutions.", - "type": "object", - "properties": { - "hr": { - "description": "High resolution. Should have a suffix in JSON: 1s, 1m, 1h.", - "type": "string", - "x-order": 0 - }, - "mr": { - "description": "Medium resolution. Should have a suffix in JSON: 1s, 1m, 1h.", - "type": "string", - "x-order": 1 - }, - "lr": { - "description": "Low resolution. Should have a suffix in JSON: 1s, 1m, 1h.", - "type": "string", - "x-order": 2 - } - }, - "x-order": 2 - }, - "data_retention": { - "description": "A number of full days for Prometheus and QAN data retention. Should have a suffix in JSON: 2592000s, 43200m, 720h.", - "type": "string", - "x-order": 3 - }, - "ssh_key": { - "type": "string", - "x-nullable": true, - "x-order": 4 - }, - "aws_partitions": { - "description": "A wrapper for a string array. This type allows to distinguish between an empty array and a null value.", - "type": "object", - "properties": { - "values": { - "type": "array", - "items": { - "type": "string" - }, - "x-order": 0 - } - }, - "x-nullable": true, - "x-order": 5 - }, - "enable_advisor": { - "description": "Enable Advisor.", - "type": "boolean", - "x-nullable": true, - "x-order": 6 - }, - "enable_alerting": { - "description": "Enable Alerting.", - "type": "boolean", - "x-nullable": true, - "x-order": 7 - }, - "pmm_public_address": { - "description": "PMM Server public address.", - "type": "string", - "x-nullable": true, - "x-order": 8 - }, - "advisor_run_intervals": { - "description": "AdvisorRunIntervals represents intervals between each run of Advisor checks.", - "type": "object", - "properties": { - "standard_interval": { - "description": "Standard check interval.", - "type": "string", - "x-order": 0 - }, - "rare_interval": { - "description": "Interval for rare check runs.", - "type": "string", - "x-order": 1 - }, - "frequent_interval": { - "description": "Interval for frequent check runs.", - "type": "string", - "x-order": 2 - } - }, - "x-order": 9 - }, - "enable_azurediscover": { - "description": "Enable Azure Discover.", - "type": "boolean", - "x-nullable": true, - "x-order": 10 - }, - "enable_backup_management": { - "description": "Enable Backup Management.", - "type": "boolean", - "x-nullable": true, - "x-order": 11 - }, - "enable_access_control": { - "type": "boolean", - "title": "Enable Access Control", - "x-nullable": true, - "x-order": 12 - }, - "enable_internal_pg_qan": { - "description": "Enable Query Analytics for PMM's internal PG database.", - "type": "boolean", - "x-nullable": true, - "x-order": 13 - }, - "update_snooze_duration": { - "description": "A number of full days for which an update is snoozed, i.e. a multiple of 24h: 2592000s, 43200m, 720h.", - "type": "string", - "x-order": 14 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "settings": { - "description": "Settings represents PMM Server settings.", - "type": "object", - "properties": { - "updates_enabled": { - "description": "True if updates are enabled.", - "type": "boolean", - "x-order": 0 - }, - "telemetry_enabled": { - "description": "True if telemetry is enabled.", - "type": "boolean", - "x-order": 1 - }, - "metrics_resolutions": { - "description": "MetricsResolutions represents Prometheus exporters metrics resolutions.", - "type": "object", - "properties": { - "hr": { - "description": "High resolution. Should have a suffix in JSON: 1s, 1m, 1h.", - "type": "string", - "x-order": 0 - }, - "mr": { - "description": "Medium resolution. Should have a suffix in JSON: 1s, 1m, 1h.", - "type": "string", - "x-order": 1 - }, - "lr": { - "description": "Low resolution. Should have a suffix in JSON: 1s, 1m, 1h.", - "type": "string", - "x-order": 2 - } - }, - "x-order": 2 - }, - "data_retention": { - "type": "string", - "x-order": 3 - }, - "ssh_key": { - "type": "string", - "x-order": 4 - }, - "aws_partitions": { - "type": "array", - "items": { - "type": "string" - }, - "x-order": 5 - }, - "advisor_enabled": { - "description": "True if Advisor is enabled.", - "type": "boolean", - "x-order": 6 - }, - "platform_email": { - "description": "Percona Platform user's email, if this PMM instance is linked to the Platform.", - "type": "string", - "x-order": 7 - }, - "alerting_enabled": { - "description": "True if Alerting is enabled.", - "type": "boolean", - "x-order": 8 - }, - "pmm_public_address": { - "description": "PMM Server public address.", - "type": "string", - "x-order": 9 - }, - "advisor_run_intervals": { - "description": "AdvisorRunIntervals represents intervals between each run of Advisor checks.", - "type": "object", - "properties": { - "standard_interval": { - "description": "Standard check interval.", - "type": "string", - "x-order": 0 - }, - "rare_interval": { - "description": "Interval for rare check runs.", - "type": "string", - "x-order": 1 - }, - "frequent_interval": { - "description": "Interval for frequent check runs.", - "type": "string", - "x-order": 2 - } - }, - "x-order": 10 - }, - "backup_management_enabled": { - "description": "True if Backup Management is enabled.", - "type": "boolean", - "x-order": 11 - }, - "azurediscover_enabled": { - "description": "True if Azure Discover is enabled.", - "type": "boolean", - "x-order": 12 - }, - "connected_to_platform": { - "type": "boolean", - "title": "True if the PMM instance is connected to Platform", - "x-order": 13 - }, - "telemetry_summaries": { - "type": "array", - "title": "Includes list of collected telemetry", - "items": { - "type": "string" - }, - "x-order": 14 - }, - "enable_access_control": { - "description": "True if Access Control is enabled.", - "type": "boolean", - "x-order": 15 - }, - "default_role_id": { - "description": "Default Access Control role ID for new users.", - "type": "integer", - "format": "int64", - "x-order": 16 - }, - "enable_internal_pg_qan": { - "description": "True if Query Analytics for PMM's internal PG database is enabled.", - "type": "boolean", - "x-order": 17 - }, - "update_snooze_duration": { - "type": "string", - "title": "Duration for which an update is snoozed", - "x-order": 18 - } - }, - "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": { - "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 }", - "type": "object", - "properties": { - "@type": { - "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.", - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/server/settings/readonly": { - "get": { - "description": "Returns a stripped version of PMM Server settings.", - "tags": [ - "ServerService" - ], - "summary": "Get read-only settings", - "operationId": "GetReadOnlySettings", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "settings": { - "description": "ReadOnlySettings represents a stripped-down version of PMM Server settings that can be accessed by users of all roles.", - "type": "object", - "properties": { - "updates_enabled": { - "description": "True if updates are enabled.", - "type": "boolean", - "x-order": 0 - }, - "telemetry_enabled": { - "description": "True if telemetry is enabled.", - "type": "boolean", - "x-order": 1 - }, - "advisor_enabled": { - "description": "True if Advisor is enabled.", - "type": "boolean", - "x-order": 2 - }, - "alerting_enabled": { - "description": "True if Alerting is enabled.", - "type": "boolean", - "x-order": 3 - }, - "pmm_public_address": { - "description": "PMM Server public address.", - "type": "string", - "x-order": 4 - }, - "backup_management_enabled": { - "description": "True if Backup Management is enabled.", - "type": "boolean", - "x-order": 5 - }, - "azurediscover_enabled": { - "description": "True if Azure Discover is enabled.", - "type": "boolean", - "x-order": 6 - }, - "enable_access_control": { - "description": "True if Access Control is enabled.", - "type": "boolean", - "x-order": 7 - } - }, - "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": { - "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 }", - "type": "object", - "properties": { - "@type": { - "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.", - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/server/updates": { - "get": { - "description": "Checks for available PMM Server updates.", - "tags": [ - "ServerService" - ], - "summary": "Check updates", - "operationId": "CheckUpdates", - "parameters": [ - { - "type": "boolean", - "description": "If false, cached information may be returned.", - "name": "force", - "in": "query" - }, - { - "type": "boolean", - "description": "If true, only installed version will be in response.", - "name": "only_installed_version", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "installed": { - "description": "VersionInfo describes component version, or PMM Server as a whole.", - "type": "object", - "properties": { - "version": { - "description": "User-visible version.", - "type": "string", - "x-order": 0 - }, - "full_version": { - "description": "Full version for debugging.", - "type": "string", - "x-order": 1 - }, - "timestamp": { - "description": "Build or release date.", - "type": "string", - "format": "date-time", - "x-order": 2 - } - }, - "x-order": 0 - }, - "latest": { - "type": "object", - "properties": { - "version": { - "description": "PMM Version.", - "type": "string", - "x-order": 0 - }, - "tag": { - "description": "Docker image tag.", - "type": "string", - "x-order": 1 - }, - "timestamp": { - "description": "Release date.", - "type": "string", - "format": "date-time", - "x-order": 2 - }, - "release_notes_url": { - "description": "Release notes URL for the version (if available).", - "type": "string", - "x-order": 3 - }, - "release_notes_text": { - "description": "Release notes text for the version (if available).", - "type": "string", - "x-order": 4 - } - }, - "x-order": 1 - }, - "update_available": { - "description": "True if there is a PMM Server update available.", - "type": "boolean", - "x-order": 2 - }, - "latest_news_url": { - "description": "Latest available PMM Server release announcement URL.", - "type": "string", - "x-order": 3 - }, - "last_check": { - "description": "Last check time.", - "type": "string", - "format": "date-time", - "x-order": 4 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "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 }", - "type": "object", - "properties": { - "@type": { - "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.", - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/server/updates/changelogs": { - "get": { - "description": "Display a changelog comparing the installed version to the latest available version.", - "tags": [ - "ServerService" - ], - "summary": "Get the changelog", - "operationId": "ListChangeLogs", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "updates": { - "description": "List of available updates.", - "type": "array", - "items": { - "type": "object", - "properties": { - "version": { - "description": "PMM Version.", - "type": "string", - "x-order": 0 - }, - "tag": { - "description": "Docker image tag.", - "type": "string", - "x-order": 1 - }, - "timestamp": { - "description": "Release date.", - "type": "string", - "format": "date-time", - "x-order": 2 - }, - "release_notes_url": { - "description": "Release notes URL for the version (if available).", - "type": "string", - "x-order": 3 - }, - "release_notes_text": { - "description": "Release notes text for the version (if available).", - "type": "string", - "x-order": 4 - } - } - }, - "x-order": 0 - }, - "last_check": { - "description": "Last check time.", - "type": "string", - "format": "date-time", - "x-order": 1 - } - } - } - }, - "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": { - "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 }", - "type": "object", - "properties": { - "@type": { - "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.", - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/server/updates:getStatus": { - "post": { - "description": "Returns PMM Server update status.", - "tags": [ - "ServerService" - ], - "summary": "Update status", - "operationId": "UpdateStatus", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "auth_token": { - "description": "Authentication token.", - "type": "string", - "x-order": 0 - }, - "log_offset": { - "description": "Progress log offset.", - "type": "integer", - "format": "int64", - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "log_lines": { - "description": "Progress log lines.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 0 - }, - "log_offset": { - "description": "Progress log offset for the next request.", - "type": "integer", - "format": "int64", - "x-order": 1 - }, - "done": { - "description": "True when update is done.", - "type": "boolean", - "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": { - "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 }", - "type": "object", - "properties": { - "@type": { - "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.", - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/server/updates:start": { - "post": { - "description": "Starts PMM Server update.", - "tags": [ - "ServerService" - ], - "summary": "Start update", - "operationId": "StartUpdate", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "new_image": { - "type": "string", - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "auth_token": { - "description": "Authentication token for getting update statuses.", - "type": "string", - "x-order": 0 - }, - "log_offset": { - "description": "Progress log offset.", - "type": "integer", - "format": "int64", - "x-order": 1 - } - } - } - }, - "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": { - "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 }", - "type": "object", - "properties": { - "@type": { - "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.", - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/server/version": { - "get": { - "description": "Returns PMM Server versions.", - "tags": [ - "ServerService" - ], - "summary": "Version", - "operationId": "Version", - "parameters": [ - { - "type": "string", - "description": "Dummy parameter for internal testing. Do not use.", - "name": "dummy", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "version": { - "description": "PMM Server version.", - "type": "string", - "x-order": 0 - }, - "server": { - "description": "VersionInfo describes component version, or PMM Server as a whole.", - "type": "object", - "properties": { - "version": { - "description": "User-visible version.", - "type": "string", - "x-order": 0 - }, - "full_version": { - "description": "Full version for debugging.", - "type": "string", - "x-order": 1 - }, - "timestamp": { - "description": "Build or release date.", - "type": "string", - "format": "date-time", - "x-order": 2 - } - }, - "x-order": 1 - }, - "managed": { - "description": "VersionInfo describes component version, or PMM Server as a whole.", - "type": "object", - "properties": { - "version": { - "description": "User-visible version.", - "type": "string", - "x-order": 0 - }, - "full_version": { - "description": "Full version for debugging.", - "type": "string", - "x-order": 1 - }, - "timestamp": { - "description": "Build or release date.", - "type": "string", - "format": "date-time", - "x-order": 2 - } - }, - "x-order": 2 - }, - "distribution_method": { - "description": "DistributionMethod defines PMM Server distribution method: Docker image, OVF/OVA, or AMI.", - "type": "string", - "default": "DISTRIBUTION_METHOD_UNSPECIFIED", - "enum": [ - "DISTRIBUTION_METHOD_UNSPECIFIED", - "DISTRIBUTION_METHOD_DOCKER", - "DISTRIBUTION_METHOD_OVF", - "DISTRIBUTION_METHOD_AMI", - "DISTRIBUTION_METHOD_AZURE", - "DISTRIBUTION_METHOD_DO" - ], - "x-order": 3 - } - } - } - }, - "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": { - "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 }", - "type": "object", - "properties": { - "@type": { - "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.", - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": {} - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/users": { - "get": { - "description": "Retrieve user details for all users from PMM server", - "tags": [ - "UserService" - ], - "summary": "List all users", - "operationId": "ListUsers", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "users": { - "type": "array", - "items": { - "type": "object", - "properties": { - "user_id": { - "type": "integer", - "format": "int64", - "x-order": 0 - }, - "role_ids": { - "description": "List of role IDs assigned to the user.", - "type": "array", - "items": { - "type": "integer", - "format": "int64" - }, - "x-order": 1 - } - } - }, - "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/users/me": { - "get": { - "description": "Retrieve user details from PMM server", - "tags": [ - "UserService" - ], - "summary": "Get user details", - "operationId": "GetUser", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "user_id": { - "type": "integer", - "format": "int64", - "title": "User ID", - "x-order": 0 - }, - "product_tour_completed": { - "type": "boolean", - "title": "Product Tour", - "x-order": 1 - }, - "alerting_tour_completed": { - "type": "boolean", - "title": "Alerting Tour", - "x-order": 2 - }, - "snoozed_pmm_version": { - "type": "string", - "title": "Snoozed PMM version update", - "x-order": 3 - }, - "snoozed_at": { - "type": "string", - "format": "date-time", - "title": "Timestamp of last snooze", - "x-order": 4 - }, - "snooze_count": { - "type": "integer", - "format": "int64", - "title": "Number of times the update was snoozed", - "x-order": 5 - } - } - } - }, - "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 - } - } - } - } - } - }, - "put": { - "description": "Update user details in PMM server", - "tags": [ - "UserService" - ], - "summary": "Update a user", - "operationId": "UpdateUser", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "product_tour_completed": { - "type": "boolean", - "title": "Product Tour", - "x-nullable": true, - "x-order": 0 - }, - "alerting_tour_completed": { - "type": "boolean", - "title": "Alerting Tour", - "x-nullable": true, - "x-order": 1 - }, - "snoozed_pmm_version": { - "type": "string", - "title": "Snooze update alert for a PMM version", - "x-nullable": true, - "x-order": 2 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "user_id": { - "type": "integer", - "format": "int64", - "title": "User ID", - "x-order": 0 - }, - "product_tour_completed": { - "type": "boolean", - "title": "Product Tour", - "x-order": 1 - }, - "alerting_tour_completed": { - "type": "boolean", - "title": "Alerting Tour", - "x-order": 2 - }, - "snoozed_pmm_version": { - "type": "string", - "title": "Snooze update alert for a PMM version", - "x-order": 3 - }, - "snoozed_at": { - "type": "string", - "format": "date-time", - "title": "Timestamp of last snooze", - "x-order": 4 - }, - "snooze_count": { - "type": "integer", - "format": "int64", - "title": "Number of times the update was snoozed", - "x-order": 5 - } - } - } - }, - "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 - } - } - } - } - } - } - } - }, - "securityDefinitions": { - "basicAuth": { - "type": "basic" - } - }, - "security": [ - { - "basicAuth": [] - } - ], - "tags": [ - { - "name": "ServerService" - }, - { - "name": "UserService" - }, - { - "name": "AgentsService" - }, - { - "name": "NodesService" - }, - { - "name": "ServicesService" - }, - { - "name": "ManagementService" - }, - { - "name": "ActionsService" - }, - { - "name": "AlertingService" - }, - { - "name": "AdvisorService" - }, - { - "name": "BackupService" - }, - { - "name": "LocationsService" - }, - { - "name": "RestoreService" - }, - { - "name": "QANService" - }, - { - "name": "PlatformService" - } - ], - "x-readme": { - "samples-languages": [ - "curl", - "go", - "node", - "python" - ] - }, - "x-readme-id": "622892a957a7410330bc6184" -} \ No newline at end of file diff --git a/api/uievents/v1/server.pb.go b/api/uievents/v1/server.pb.go deleted file mode 100644 index 6d1c8340cad..00000000000 --- a/api/uievents/v1/server.pb.go +++ /dev/null @@ -1,521 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.10 -// protoc (unknown) -// source: uievents/v1/server.proto - -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" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type NotificationEvent struct { - state protoimpl.MessageState `protogen:"open.v1"` - Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` - Text string `protobuf:"bytes,2,opt,name=text,proto3" json:"text,omitempty"` - Location string `protobuf:"bytes,3,opt,name=location,proto3" json:"location,omitempty"` - LocationParams string `protobuf:"bytes,4,opt,name=location_params,json=locationParams,proto3" json:"location_params,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *NotificationEvent) Reset() { - *x = NotificationEvent{} - mi := &file_uievents_v1_server_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *NotificationEvent) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*NotificationEvent) ProtoMessage() {} - -func (x *NotificationEvent) ProtoReflect() protoreflect.Message { - mi := &file_uievents_v1_server_proto_msgTypes[0] - 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 NotificationEvent.ProtoReflect.Descriptor instead. -func (*NotificationEvent) Descriptor() ([]byte, []int) { - return file_uievents_v1_server_proto_rawDescGZIP(), []int{0} -} - -func (x *NotificationEvent) GetTitle() string { - if x != nil { - return x.Title - } - return "" -} - -func (x *NotificationEvent) GetText() string { - if x != nil { - return x.Text - } - return "" -} - -func (x *NotificationEvent) GetLocation() string { - if x != nil { - return x.Location - } - return "" -} - -func (x *NotificationEvent) GetLocationParams() string { - if x != nil { - return x.LocationParams - } - return "" -} - -type FetchingEvent struct { - state protoimpl.MessageState `protogen:"open.v1"` - Component string `protobuf:"bytes,1,opt,name=component,proto3" json:"component,omitempty"` - LoadTime int32 `protobuf:"varint,2,opt,name=load_time,json=loadTime,proto3" json:"load_time,omitempty"` - Location string `protobuf:"bytes,3,opt,name=location,proto3" json:"location,omitempty"` - LocationParams string `protobuf:"bytes,4,opt,name=location_params,json=locationParams,proto3" json:"location_params,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *FetchingEvent) Reset() { - *x = FetchingEvent{} - mi := &file_uievents_v1_server_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *FetchingEvent) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FetchingEvent) ProtoMessage() {} - -func (x *FetchingEvent) ProtoReflect() protoreflect.Message { - mi := &file_uievents_v1_server_proto_msgTypes[1] - 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 FetchingEvent.ProtoReflect.Descriptor instead. -func (*FetchingEvent) Descriptor() ([]byte, []int) { - return file_uievents_v1_server_proto_rawDescGZIP(), []int{1} -} - -func (x *FetchingEvent) GetComponent() string { - if x != nil { - return x.Component - } - return "" -} - -func (x *FetchingEvent) GetLoadTime() int32 { - if x != nil { - return x.LoadTime - } - return 0 -} - -func (x *FetchingEvent) GetLocation() string { - if x != nil { - return x.Location - } - return "" -} - -func (x *FetchingEvent) GetLocationParams() string { - if x != nil { - return x.LocationParams - } - return "" -} - -type DashboardUsageEvent struct { - state protoimpl.MessageState `protogen:"open.v1"` - Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid,omitempty"` - Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` - Tags []string `protobuf:"bytes,3,rep,name=tags,proto3" json:"tags,omitempty"` - LoadTime int32 `protobuf:"varint,4,opt,name=load_time,json=loadTime,proto3" json:"load_time,omitempty"` - Location string `protobuf:"bytes,5,opt,name=location,proto3" json:"location,omitempty"` - LocationParams string `protobuf:"bytes,6,opt,name=location_params,json=locationParams,proto3" json:"location_params,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DashboardUsageEvent) Reset() { - *x = DashboardUsageEvent{} - mi := &file_uievents_v1_server_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DashboardUsageEvent) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DashboardUsageEvent) ProtoMessage() {} - -func (x *DashboardUsageEvent) ProtoReflect() protoreflect.Message { - mi := &file_uievents_v1_server_proto_msgTypes[2] - 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 DashboardUsageEvent.ProtoReflect.Descriptor instead. -func (*DashboardUsageEvent) Descriptor() ([]byte, []int) { - return file_uievents_v1_server_proto_rawDescGZIP(), []int{2} -} - -func (x *DashboardUsageEvent) GetUid() string { - if x != nil { - return x.Uid - } - return "" -} - -func (x *DashboardUsageEvent) GetTitle() string { - if x != nil { - return x.Title - } - return "" -} - -func (x *DashboardUsageEvent) GetTags() []string { - if x != nil { - return x.Tags - } - return nil -} - -func (x *DashboardUsageEvent) GetLoadTime() int32 { - if x != nil { - return x.LoadTime - } - return 0 -} - -func (x *DashboardUsageEvent) GetLocation() string { - if x != nil { - return x.Location - } - return "" -} - -func (x *DashboardUsageEvent) GetLocationParams() string { - if x != nil { - return x.LocationParams - } - return "" -} - -type UserFlowEvent struct { - state protoimpl.MessageState `protogen:"open.v1"` - FlowId string `protobuf:"bytes,1,opt,name=flow_id,json=flowId,proto3" json:"flow_id,omitempty"` - StoryId string `protobuf:"bytes,2,opt,name=story_id,json=storyId,proto3" json:"story_id,omitempty"` - Event string `protobuf:"bytes,3,opt,name=event,proto3" json:"event,omitempty"` - Params map[string]string `protobuf:"bytes,4,rep,name=params,proto3" json:"params,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *UserFlowEvent) Reset() { - *x = UserFlowEvent{} - mi := &file_uievents_v1_server_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *UserFlowEvent) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UserFlowEvent) ProtoMessage() {} - -func (x *UserFlowEvent) ProtoReflect() protoreflect.Message { - mi := &file_uievents_v1_server_proto_msgTypes[3] - 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 UserFlowEvent.ProtoReflect.Descriptor instead. -func (*UserFlowEvent) Descriptor() ([]byte, []int) { - return file_uievents_v1_server_proto_rawDescGZIP(), []int{3} -} - -func (x *UserFlowEvent) GetFlowId() string { - if x != nil { - return x.FlowId - } - return "" -} - -func (x *UserFlowEvent) GetStoryId() string { - if x != nil { - return x.StoryId - } - return "" -} - -func (x *UserFlowEvent) GetEvent() string { - if x != nil { - return x.Event - } - return "" -} - -func (x *UserFlowEvent) GetParams() map[string]string { - if x != nil { - return x.Params - } - return nil -} - -type StoreRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - Notifications []*NotificationEvent `protobuf:"bytes,1,rep,name=notifications,proto3" json:"notifications,omitempty"` - Fetching []*FetchingEvent `protobuf:"bytes,2,rep,name=fetching,proto3" json:"fetching,omitempty"` - DashboardUsage []*DashboardUsageEvent `protobuf:"bytes,3,rep,name=dashboard_usage,json=dashboardUsage,proto3" json:"dashboard_usage,omitempty"` - UserFlowEvents []*UserFlowEvent `protobuf:"bytes,4,rep,name=user_flow_events,json=userFlowEvents,proto3" json:"user_flow_events,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StoreRequest) Reset() { - *x = StoreRequest{} - mi := &file_uievents_v1_server_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StoreRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StoreRequest) ProtoMessage() {} - -func (x *StoreRequest) ProtoReflect() protoreflect.Message { - mi := &file_uievents_v1_server_proto_msgTypes[4] - 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 StoreRequest.ProtoReflect.Descriptor instead. -func (*StoreRequest) Descriptor() ([]byte, []int) { - return file_uievents_v1_server_proto_rawDescGZIP(), []int{4} -} - -func (x *StoreRequest) GetNotifications() []*NotificationEvent { - if x != nil { - return x.Notifications - } - return nil -} - -func (x *StoreRequest) GetFetching() []*FetchingEvent { - if x != nil { - return x.Fetching - } - return nil -} - -func (x *StoreRequest) GetDashboardUsage() []*DashboardUsageEvent { - if x != nil { - return x.DashboardUsage - } - return nil -} - -func (x *StoreRequest) GetUserFlowEvents() []*UserFlowEvent { - if x != nil { - return x.UserFlowEvents - } - return nil -} - -type StoreResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StoreResponse) Reset() { - *x = StoreResponse{} - mi := &file_uievents_v1_server_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StoreResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StoreResponse) ProtoMessage() {} - -func (x *StoreResponse) ProtoReflect() protoreflect.Message { - mi := &file_uievents_v1_server_proto_msgTypes[5] - 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 StoreResponse.ProtoReflect.Descriptor instead. -func (*StoreResponse) Descriptor() ([]byte, []int) { - return file_uievents_v1_server_proto_rawDescGZIP(), []int{5} -} - -var File_uievents_v1_server_proto protoreflect.FileDescriptor - -const file_uievents_v1_server_proto_rawDesc = "" + - "\n" + - "\x18uievents/v1/server.proto\x12\vuievents.v1\x1a\x1cgoogle/api/annotations.proto\x1a.protoc-gen-openapiv2/options/annotations.proto\"\x82\x01\n" + - "\x11NotificationEvent\x12\x14\n" + - "\x05title\x18\x01 \x01(\tR\x05title\x12\x12\n" + - "\x04text\x18\x02 \x01(\tR\x04text\x12\x1a\n" + - "\blocation\x18\x03 \x01(\tR\blocation\x12'\n" + - "\x0flocation_params\x18\x04 \x01(\tR\x0elocationParams\"\x8f\x01\n" + - "\rFetchingEvent\x12\x1c\n" + - "\tcomponent\x18\x01 \x01(\tR\tcomponent\x12\x1b\n" + - "\tload_time\x18\x02 \x01(\x05R\bloadTime\x12\x1a\n" + - "\blocation\x18\x03 \x01(\tR\blocation\x12'\n" + - "\x0flocation_params\x18\x04 \x01(\tR\x0elocationParams\"\xb3\x01\n" + - "\x13DashboardUsageEvent\x12\x10\n" + - "\x03uid\x18\x01 \x01(\tR\x03uid\x12\x14\n" + - "\x05title\x18\x02 \x01(\tR\x05title\x12\x12\n" + - "\x04tags\x18\x03 \x03(\tR\x04tags\x12\x1b\n" + - "\tload_time\x18\x04 \x01(\x05R\bloadTime\x12\x1a\n" + - "\blocation\x18\x05 \x01(\tR\blocation\x12'\n" + - "\x0flocation_params\x18\x06 \x01(\tR\x0elocationParams\"\xd4\x01\n" + - "\rUserFlowEvent\x12\x17\n" + - "\aflow_id\x18\x01 \x01(\tR\x06flowId\x12\x19\n" + - "\bstory_id\x18\x02 \x01(\tR\astoryId\x12\x14\n" + - "\x05event\x18\x03 \x01(\tR\x05event\x12>\n" + - "\x06params\x18\x04 \x03(\v2&.uievents.v1.UserFlowEvent.ParamsEntryR\x06params\x1a9\n" + - "\vParamsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\x9d\x02\n" + - "\fStoreRequest\x12D\n" + - "\rnotifications\x18\x01 \x03(\v2\x1e.uievents.v1.NotificationEventR\rnotifications\x126\n" + - "\bfetching\x18\x02 \x03(\v2\x1a.uievents.v1.FetchingEventR\bfetching\x12I\n" + - "\x0fdashboard_usage\x18\x03 \x03(\v2 .uievents.v1.DashboardUsageEventR\x0edashboardUsage\x12D\n" + - "\x10user_flow_events\x18\x04 \x03(\v2\x1a.uievents.v1.UserFlowEventR\x0euserFlowEvents\"\x0f\n" + - "\rStoreResponse2\xbd\x01\n" + - "\x0fUIEventsService\x12\xa9\x01\n" + - "\x05Store\x12\x19.uievents.v1.StoreRequest\x1a\x1a.uievents.v1.StoreResponse\"i\x92AH\x12\x11Persist UI events\x1a3Persists received UI events for further processing.\x82\xd3\xe4\x93\x02\x18:\x01*\"\x13/v1/ui-events/StoreB\x9e\x01\n" + - "\x0fcom.uievents.v1B\vServerProtoP\x01Z1github.com/percona/pmm/api/uievents/v1;uieventsv1\xa2\x02\x03UXX\xaa\x02\vUievents.V1\xca\x02\vUievents\\V1\xe2\x02\x17Uievents\\V1\\GPBMetadata\xea\x02\fUievents::V1b\x06proto3" - -var ( - file_uievents_v1_server_proto_rawDescOnce sync.Once - file_uievents_v1_server_proto_rawDescData []byte -) - -func file_uievents_v1_server_proto_rawDescGZIP() []byte { - file_uievents_v1_server_proto_rawDescOnce.Do(func() { - file_uievents_v1_server_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_uievents_v1_server_proto_rawDesc), len(file_uievents_v1_server_proto_rawDesc))) - }) - 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_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 - 1, // 2: uievents.v1.StoreRequest.fetching:type_name -> uievents.v1.FetchingEvent - 2, // 3: uievents.v1.StoreRequest.dashboard_usage:type_name -> uievents.v1.DashboardUsageEvent - 3, // 4: uievents.v1.StoreRequest.user_flow_events:type_name -> uievents.v1.UserFlowEvent - 4, // 5: uievents.v1.UIEventsService.Store:input_type -> uievents.v1.StoreRequest - 5, // 6: uievents.v1.UIEventsService.Store:output_type -> uievents.v1.StoreResponse - 6, // [6:7] is the sub-list for method output_type - 5, // [5:6] is the sub-list for method input_type - 5, // [5:5] is the sub-list for extension type_name - 5, // [5:5] is the sub-list for extension extendee - 0, // [0:5] is the sub-list for field type_name -} - -func init() { file_uievents_v1_server_proto_init() } -func file_uievents_v1_server_proto_init() { - if File_uievents_v1_server_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_uievents_v1_server_proto_rawDesc), len(file_uievents_v1_server_proto_rawDesc)), - NumEnums: 0, - NumMessages: 7, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_uievents_v1_server_proto_goTypes, - DependencyIndexes: file_uievents_v1_server_proto_depIdxs, - MessageInfos: file_uievents_v1_server_proto_msgTypes, - }.Build() - File_uievents_v1_server_proto = out.File - file_uievents_v1_server_proto_goTypes = nil - file_uievents_v1_server_proto_depIdxs = nil -} diff --git a/api/uievents/v1/server.pb.gw.go b/api/uievents/v1/server.pb.gw.go deleted file mode 100644 index 7a044e6b3ba..00000000000 --- a/api/uievents/v1/server.pb.gw.go +++ /dev/null @@ -1,153 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: uievents/v1/server.proto - -/* -Package uieventsv1 is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package uieventsv1 - -import ( - "context" - "errors" - "io" - "net/http" - - "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" - "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" - "google.golang.org/protobuf/proto" -) - -// Suppress "imported and not used" errors -var ( - _ codes.Code - _ io.Reader - _ status.Status - _ = errors.New - _ = runtime.String - _ = utilities.NewDoubleArray - _ = metadata.Join -) - -func request_UIEventsService_Store_0(ctx context.Context, marshaler runtime.Marshaler, client UIEventsServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq StoreRequest - 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.Store(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_UIEventsService_Store_0(ctx context.Context, marshaler runtime.Marshaler, server UIEventsServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq StoreRequest - 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.Store(ctx, &protoReq) - return msg, metadata, err -} - -// RegisterUIEventsServiceHandlerServer registers the http handlers for service UIEventsService to "mux". -// UnaryRPC :call UIEventsServiceServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterUIEventsServiceHandlerFromEndpoint instead. -// GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call. -func RegisterUIEventsServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server UIEventsServiceServer) error { - mux.Handle(http.MethodPost, pattern_UIEventsService_Store_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, "/uievents.v1.UIEventsService/Store", runtime.WithHTTPPathPattern("/v1/ui-events/Store")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_UIEventsService_Store_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_UIEventsService_Store_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - return nil -} - -// RegisterUIEventsServiceHandlerFromEndpoint is same as RegisterUIEventsServiceHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterUIEventsServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.NewClient(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - return RegisterUIEventsServiceHandler(ctx, mux, conn) -} - -// RegisterUIEventsServiceHandler registers the http handlers for service UIEventsService to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterUIEventsServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterUIEventsServiceHandlerClient(ctx, mux, NewUIEventsServiceClient(conn)) -} - -// RegisterUIEventsServiceHandlerClient registers the http handlers for service UIEventsService -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "UIEventsServiceClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "UIEventsServiceClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "UIEventsServiceClient" to call the correct interceptors. This client ignores the HTTP middlewares. -func RegisterUIEventsServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client UIEventsServiceClient) error { - mux.Handle(http.MethodPost, pattern_UIEventsService_Store_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, "/uievents.v1.UIEventsService/Store", runtime.WithHTTPPathPattern("/v1/ui-events/Store")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_UIEventsService_Store_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_UIEventsService_Store_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - 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 forward_UIEventsService_Store_0 = runtime.ForwardResponseMessage diff --git a/api/uievents/v1/server.pb.validate.go b/api/uievents/v1/server.pb.validate.go deleted file mode 100644 index 5996e04b712..00000000000 --- a/api/uievents/v1/server.pb.validate.go +++ /dev/null @@ -1,809 +0,0 @@ -// Code generated by protoc-gen-validate. DO NOT EDIT. -// source: uievents/v1/server.proto - -package uieventsv1 - -import ( - "bytes" - "errors" - "fmt" - "net" - "net/mail" - "net/url" - "regexp" - "sort" - "strings" - "time" - "unicode/utf8" - - "google.golang.org/protobuf/types/known/anypb" -) - -// ensure the imports are used -var ( - _ = bytes.MinRead - _ = errors.New("") - _ = fmt.Print - _ = utf8.UTFMax - _ = (*regexp.Regexp)(nil) - _ = (*strings.Reader)(nil) - _ = net.IPv4len - _ = time.Duration(0) - _ = (*url.URL)(nil) - _ = (*mail.Address)(nil) - _ = anypb.Any{} - _ = sort.Sort -) - -// Validate checks the field values on NotificationEvent 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 *NotificationEvent) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on NotificationEvent 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 -// NotificationEventMultiError, or nil if none found. -func (m *NotificationEvent) ValidateAll() error { - return m.validate(true) -} - -func (m *NotificationEvent) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Title - - // no validation rules for Text - - // no validation rules for Location - - // no validation rules for LocationParams - - if len(errors) > 0 { - return NotificationEventMultiError(errors) - } - - return nil -} - -// NotificationEventMultiError is an error wrapping multiple validation errors -// returned by NotificationEvent.ValidateAll() if the designated constraints -// aren't met. -type NotificationEventMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m NotificationEventMultiError) 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 NotificationEventMultiError) AllErrors() []error { return m } - -// NotificationEventValidationError is the validation error returned by -// NotificationEvent.Validate if the designated constraints aren't met. -type NotificationEventValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e NotificationEventValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e NotificationEventValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e NotificationEventValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e NotificationEventValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e NotificationEventValidationError) ErrorName() string { - return "NotificationEventValidationError" -} - -// Error satisfies the builtin error interface -func (e NotificationEventValidationError) 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 %sNotificationEvent.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = NotificationEventValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = NotificationEventValidationError{} - -// Validate checks the field values on FetchingEvent 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 *FetchingEvent) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on FetchingEvent 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 FetchingEventMultiError, or -// nil if none found. -func (m *FetchingEvent) ValidateAll() error { - return m.validate(true) -} - -func (m *FetchingEvent) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Component - - // no validation rules for LoadTime - - // no validation rules for Location - - // no validation rules for LocationParams - - if len(errors) > 0 { - return FetchingEventMultiError(errors) - } - - return nil -} - -// FetchingEventMultiError is an error wrapping multiple validation errors -// returned by FetchingEvent.ValidateAll() if the designated constraints -// aren't met. -type FetchingEventMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m FetchingEventMultiError) 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 FetchingEventMultiError) AllErrors() []error { return m } - -// FetchingEventValidationError is the validation error returned by -// FetchingEvent.Validate if the designated constraints aren't met. -type FetchingEventValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e FetchingEventValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e FetchingEventValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e FetchingEventValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e FetchingEventValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e FetchingEventValidationError) ErrorName() string { return "FetchingEventValidationError" } - -// Error satisfies the builtin error interface -func (e FetchingEventValidationError) 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 %sFetchingEvent.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = FetchingEventValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = FetchingEventValidationError{} - -// Validate checks the field values on DashboardUsageEvent 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 *DashboardUsageEvent) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on DashboardUsageEvent 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 -// DashboardUsageEventMultiError, or nil if none found. -func (m *DashboardUsageEvent) ValidateAll() error { - return m.validate(true) -} - -func (m *DashboardUsageEvent) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Uid - - // no validation rules for Title - - // no validation rules for LoadTime - - // no validation rules for Location - - // no validation rules for LocationParams - - if len(errors) > 0 { - return DashboardUsageEventMultiError(errors) - } - - return nil -} - -// DashboardUsageEventMultiError is an error wrapping multiple validation -// errors returned by DashboardUsageEvent.ValidateAll() if the designated -// constraints aren't met. -type DashboardUsageEventMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m DashboardUsageEventMultiError) 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 DashboardUsageEventMultiError) AllErrors() []error { return m } - -// DashboardUsageEventValidationError is the validation error returned by -// DashboardUsageEvent.Validate if the designated constraints aren't met. -type DashboardUsageEventValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e DashboardUsageEventValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e DashboardUsageEventValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e DashboardUsageEventValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e DashboardUsageEventValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e DashboardUsageEventValidationError) ErrorName() string { - return "DashboardUsageEventValidationError" -} - -// Error satisfies the builtin error interface -func (e DashboardUsageEventValidationError) 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 %sDashboardUsageEvent.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = DashboardUsageEventValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = DashboardUsageEventValidationError{} - -// Validate checks the field values on UserFlowEvent 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 *UserFlowEvent) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on UserFlowEvent 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 UserFlowEventMultiError, or -// nil if none found. -func (m *UserFlowEvent) ValidateAll() error { - return m.validate(true) -} - -func (m *UserFlowEvent) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for FlowId - - // no validation rules for StoryId - - // no validation rules for Event - - // no validation rules for Params - - if len(errors) > 0 { - return UserFlowEventMultiError(errors) - } - - return nil -} - -// UserFlowEventMultiError is an error wrapping multiple validation errors -// returned by UserFlowEvent.ValidateAll() if the designated constraints -// aren't met. -type UserFlowEventMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m UserFlowEventMultiError) 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 UserFlowEventMultiError) AllErrors() []error { return m } - -// UserFlowEventValidationError is the validation error returned by -// UserFlowEvent.Validate if the designated constraints aren't met. -type UserFlowEventValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e UserFlowEventValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e UserFlowEventValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e UserFlowEventValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e UserFlowEventValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e UserFlowEventValidationError) ErrorName() string { return "UserFlowEventValidationError" } - -// Error satisfies the builtin error interface -func (e UserFlowEventValidationError) 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 %sUserFlowEvent.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = UserFlowEventValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = UserFlowEventValidationError{} - -// Validate checks the field values on StoreRequest 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 *StoreRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on StoreRequest 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 StoreRequestMultiError, or -// nil if none found. -func (m *StoreRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *StoreRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - for idx, item := range m.GetNotifications() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, StoreRequestValidationError{ - field: fmt.Sprintf("Notifications[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, StoreRequestValidationError{ - field: fmt.Sprintf("Notifications[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return StoreRequestValidationError{ - field: fmt.Sprintf("Notifications[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - for idx, item := range m.GetFetching() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, StoreRequestValidationError{ - field: fmt.Sprintf("Fetching[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, StoreRequestValidationError{ - field: fmt.Sprintf("Fetching[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return StoreRequestValidationError{ - field: fmt.Sprintf("Fetching[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - for idx, item := range m.GetDashboardUsage() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, StoreRequestValidationError{ - field: fmt.Sprintf("DashboardUsage[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, StoreRequestValidationError{ - field: fmt.Sprintf("DashboardUsage[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return StoreRequestValidationError{ - field: fmt.Sprintf("DashboardUsage[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - for idx, item := range m.GetUserFlowEvents() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, StoreRequestValidationError{ - field: fmt.Sprintf("UserFlowEvents[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, StoreRequestValidationError{ - field: fmt.Sprintf("UserFlowEvents[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return StoreRequestValidationError{ - field: fmt.Sprintf("UserFlowEvents[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - if len(errors) > 0 { - return StoreRequestMultiError(errors) - } - - return nil -} - -// StoreRequestMultiError is an error wrapping multiple validation errors -// returned by StoreRequest.ValidateAll() if the designated constraints aren't met. -type StoreRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m StoreRequestMultiError) 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 StoreRequestMultiError) AllErrors() []error { return m } - -// StoreRequestValidationError is the validation error returned by -// StoreRequest.Validate if the designated constraints aren't met. -type StoreRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e StoreRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e StoreRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e StoreRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e StoreRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e StoreRequestValidationError) ErrorName() string { return "StoreRequestValidationError" } - -// Error satisfies the builtin error interface -func (e StoreRequestValidationError) 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 %sStoreRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = StoreRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = StoreRequestValidationError{} - -// Validate checks the field values on StoreResponse 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 *StoreResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on StoreResponse 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 StoreResponseMultiError, or -// nil if none found. -func (m *StoreResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *StoreResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return StoreResponseMultiError(errors) - } - - return nil -} - -// StoreResponseMultiError is an error wrapping multiple validation errors -// returned by StoreResponse.ValidateAll() if the designated constraints -// aren't met. -type StoreResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m StoreResponseMultiError) 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 StoreResponseMultiError) AllErrors() []error { return m } - -// StoreResponseValidationError is the validation error returned by -// StoreResponse.Validate if the designated constraints aren't met. -type StoreResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e StoreResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e StoreResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e StoreResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e StoreResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e StoreResponseValidationError) ErrorName() string { return "StoreResponseValidationError" } - -// Error satisfies the builtin error interface -func (e StoreResponseValidationError) 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 %sStoreResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = StoreResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = StoreResponseValidationError{} diff --git a/api/uievents/v1/server_grpc.pb.go b/api/uievents/v1/server_grpc.pb.go deleted file mode 100644 index f4343f61ac3..00000000000 --- a/api/uievents/v1/server_grpc.pb.go +++ /dev/null @@ -1,128 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.6.0 -// - protoc (unknown) -// source: uievents/v1/server.proto - -package uieventsv1 - -import ( - context "context" - - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.64.0 or later. -const _ = grpc.SupportPackageIsVersion9 - -const ( - UIEventsService_Store_FullMethodName = "/uievents.v1.UIEventsService/Store" -) - -// UIEventsServiceClient is the client API for UIEventsService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -// -// UIEvents collects UI related events. -type UIEventsServiceClient interface { - // Store persists received UI events for further processing. - Store(ctx context.Context, in *StoreRequest, opts ...grpc.CallOption) (*StoreResponse, error) -} - -type uIEventsServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewUIEventsServiceClient(cc grpc.ClientConnInterface) UIEventsServiceClient { - return &uIEventsServiceClient{cc} -} - -func (c *uIEventsServiceClient) Store(ctx context.Context, in *StoreRequest, opts ...grpc.CallOption) (*StoreResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(StoreResponse) - err := c.cc.Invoke(ctx, UIEventsService_Store_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -// UIEventsServiceServer is the server API for UIEventsService service. -// All implementations must embed UnimplementedUIEventsServiceServer -// for forward compatibility. -// -// UIEvents collects UI related events. -type UIEventsServiceServer interface { - // Store persists received UI events for further processing. - Store(context.Context, *StoreRequest) (*StoreResponse, error) - mustEmbedUnimplementedUIEventsServiceServer() -} - -// UnimplementedUIEventsServiceServer must be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -type UnimplementedUIEventsServiceServer struct{} - -func (UnimplementedUIEventsServiceServer) Store(context.Context, *StoreRequest) (*StoreResponse, error) { - return nil, status.Error(codes.Unimplemented, "method Store not implemented") -} -func (UnimplementedUIEventsServiceServer) mustEmbedUnimplementedUIEventsServiceServer() {} -func (UnimplementedUIEventsServiceServer) testEmbeddedByValue() {} - -// UnsafeUIEventsServiceServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to UIEventsServiceServer will -// result in compilation errors. -type UnsafeUIEventsServiceServer interface { - mustEmbedUnimplementedUIEventsServiceServer() -} - -func RegisterUIEventsServiceServer(s grpc.ServiceRegistrar, srv UIEventsServiceServer) { - // If the following call panics, it indicates UnimplementedUIEventsServiceServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } - s.RegisterService(&UIEventsService_ServiceDesc, srv) -} - -func _UIEventsService_Store_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(StoreRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(UIEventsServiceServer).Store(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: UIEventsService_Store_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(UIEventsServiceServer).Store(ctx, req.(*StoreRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// UIEventsService_ServiceDesc is the grpc.ServiceDesc for UIEventsService service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var UIEventsService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "uievents.v1.UIEventsService", - HandlerType: (*UIEventsServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Store", - Handler: _UIEventsService_Store_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "uievents/v1/server.proto", -} diff --git a/api/user/v1/json/client/pmm_user_api_client.go b/api/user/v1/json/client/pmm_user_api_client.go deleted file mode 100644 index 531d5e2de43..00000000000 --- a/api/user/v1/json/client/pmm_user_api_client.go +++ /dev/null @@ -1,112 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package client - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/percona/pmm/api/user/v1/json/client/user_service" -) - -// Default PMM user API HTTP client. -var Default = NewHTTPClient(nil) - -const ( - // DefaultHost is the default Host - // found in Meta (info) section of spec file - DefaultHost string = "localhost" - // DefaultBasePath is the default BasePath - // found in Meta (info) section of spec file - DefaultBasePath string = "/" -) - -// DefaultSchemes are the default schemes found in Meta (info) section of spec file -var DefaultSchemes = []string{"http", "https"} - -// NewHTTPClient creates a new PMM user API HTTP client. -func NewHTTPClient(formats strfmt.Registry) *PMMUserAPI { - return NewHTTPClientWithConfig(formats, nil) -} - -// NewHTTPClientWithConfig creates a new PMM user API HTTP client, -// using a customizable transport config. -func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *PMMUserAPI { - // ensure nullable parameters have default - if cfg == nil { - cfg = DefaultTransportConfig() - } - - // create transport and client - transport := httptransport.New(cfg.Host, cfg.BasePath, cfg.Schemes) - return New(transport, formats) -} - -// New creates a new PMM user API client -func New(transport runtime.ClientTransport, formats strfmt.Registry) *PMMUserAPI { - // ensure nullable parameters have default - if formats == nil { - formats = strfmt.Default - } - - cli := new(PMMUserAPI) - cli.Transport = transport - cli.UserService = user_service.New(transport, formats) - return cli -} - -// DefaultTransportConfig creates a TransportConfig with the -// default settings taken from the meta section of the spec file. -func DefaultTransportConfig() *TransportConfig { - return &TransportConfig{ - Host: DefaultHost, - BasePath: DefaultBasePath, - Schemes: DefaultSchemes, - } -} - -// TransportConfig contains the transport related info, -// found in the meta section of the spec file. -type TransportConfig struct { - Host string - BasePath string - Schemes []string -} - -// WithHost overrides the default host, -// provided by the meta section of the spec file. -func (cfg *TransportConfig) WithHost(host string) *TransportConfig { - cfg.Host = host - return cfg -} - -// WithBasePath overrides the default basePath, -// provided by the meta section of the spec file. -func (cfg *TransportConfig) WithBasePath(basePath string) *TransportConfig { - cfg.BasePath = basePath - return cfg -} - -// WithSchemes overrides the default schemes, -// provided by the meta section of the spec file. -func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig { - cfg.Schemes = schemes - return cfg -} - -// PMMUserAPI is a client for PMM user API -type PMMUserAPI struct { - UserService user_service.ClientService - - Transport runtime.ClientTransport -} - -// SetTransport changes the transport on the client and all its subresources -func (c *PMMUserAPI) SetTransport(transport runtime.ClientTransport) { - c.Transport = transport - c.UserService.SetTransport(transport) -} diff --git a/api/user/v1/json/client/user_service/get_user_parameters.go b/api/user/v1/json/client/user_service/get_user_parameters.go deleted file mode 100644 index 9d7ebe5ff7d..00000000000 --- a/api/user/v1/json/client/user_service/get_user_parameters.go +++ /dev/null @@ -1,127 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package user_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" -) - -// NewGetUserParams creates a new GetUserParams 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 NewGetUserParams() *GetUserParams { - return &GetUserParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetUserParamsWithTimeout creates a new GetUserParams object -// with the ability to set a timeout on a request. -func NewGetUserParamsWithTimeout(timeout time.Duration) *GetUserParams { - return &GetUserParams{ - timeout: timeout, - } -} - -// NewGetUserParamsWithContext creates a new GetUserParams object -// with the ability to set a context for a request. -func NewGetUserParamsWithContext(ctx context.Context) *GetUserParams { - return &GetUserParams{ - Context: ctx, - } -} - -// NewGetUserParamsWithHTTPClient creates a new GetUserParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetUserParamsWithHTTPClient(client *http.Client) *GetUserParams { - return &GetUserParams{ - HTTPClient: client, - } -} - -/* -GetUserParams contains all the parameters to send to the API endpoint - - for the get user operation. - - Typically these are written to a http.Request. -*/ -type GetUserParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get user params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetUserParams) WithDefaults() *GetUserParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get user params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetUserParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the get user params -func (o *GetUserParams) WithTimeout(timeout time.Duration) *GetUserParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get user params -func (o *GetUserParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get user params -func (o *GetUserParams) WithContext(ctx context.Context) *GetUserParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get user params -func (o *GetUserParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get user params -func (o *GetUserParams) WithHTTPClient(client *http.Client) *GetUserParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get user params -func (o *GetUserParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *GetUserParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/api/user/v1/json/client/user_service/get_user_responses.go b/api/user/v1/json/client/user_service/get_user_responses.go deleted file mode 100644 index 44687c0b774..00000000000 --- a/api/user/v1/json/client/user_service/get_user_responses.go +++ /dev/null @@ -1,491 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package user_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" -) - -// GetUserReader is a Reader for the GetUser structure. -type GetUserReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetUserReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewGetUserOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewGetUserDefault(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 - } -} - -// NewGetUserOK creates a GetUserOK with default headers values -func NewGetUserOK() *GetUserOK { - return &GetUserOK{} -} - -/* -GetUserOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type GetUserOK struct { - Payload *GetUserOKBody -} - -// IsSuccess returns true when this get user Ok response has a 2xx status code -func (o *GetUserOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this get user Ok response has a 3xx status code -func (o *GetUserOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this get user Ok response has a 4xx status code -func (o *GetUserOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this get user Ok response has a 5xx status code -func (o *GetUserOK) IsServerError() bool { - return false -} - -// IsCode returns true when this get user Ok response a status code equal to that given -func (o *GetUserOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the get user Ok response -func (o *GetUserOK) Code() int { - return 200 -} - -func (o *GetUserOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/users/me][%d] getUserOk %s", 200, payload) -} - -func (o *GetUserOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/users/me][%d] getUserOk %s", 200, payload) -} - -func (o *GetUserOK) GetPayload() *GetUserOKBody { - return o.Payload -} - -func (o *GetUserOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(GetUserOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -// NewGetUserDefault creates a GetUserDefault with default headers values -func NewGetUserDefault(code int) *GetUserDefault { - return &GetUserDefault{ - _statusCode: code, - } -} - -/* -GetUserDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type GetUserDefault struct { - _statusCode int - - Payload *GetUserDefaultBody -} - -// IsSuccess returns true when this get user default response has a 2xx status code -func (o *GetUserDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this get user default response has a 3xx status code -func (o *GetUserDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this get user default response has a 4xx status code -func (o *GetUserDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this get user default response has a 5xx status code -func (o *GetUserDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this get user default response a status code equal to that given -func (o *GetUserDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the get user default response -func (o *GetUserDefault) Code() int { - return o._statusCode -} - -func (o *GetUserDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/users/me][%d] GetUser default %s", o._statusCode, payload) -} - -func (o *GetUserDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/users/me][%d] GetUser default %s", o._statusCode, payload) -} - -func (o *GetUserDefault) GetPayload() *GetUserDefaultBody { - return o.Payload -} - -func (o *GetUserDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(GetUserDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -GetUserDefaultBody get user default body -swagger:model GetUserDefaultBody -*/ -type GetUserDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*GetUserDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this get user default body -func (o *GetUserDefaultBody) 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 *GetUserDefaultBody) 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("GetUser default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("GetUser default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this get user default body based on the context it is used -func (o *GetUserDefaultBody) 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 *GetUserDefaultBody) 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("GetUser default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("GetUser default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetUserDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetUserDefaultBody) UnmarshalBinary(b []byte) error { - var res GetUserDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetUserDefaultBodyDetailsItems0 get user default body details items0 -swagger:model GetUserDefaultBodyDetailsItems0 -*/ -type GetUserDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` - - // get user default body details items0 - GetUserDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *GetUserDefaultBodyDetailsItems0) 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 GetUserDefaultBodyDetailsItems0 - - 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.GetUserDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o GetUserDefaultBodyDetailsItems0) 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.GetUserDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.GetUserDefaultBodyDetailsItems0) - 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 get user default body details items0 -func (o *GetUserDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get user default body details items0 based on context it is used -func (o *GetUserDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetUserDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetUserDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res GetUserDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetUserOKBody get user OK body -swagger:model GetUserOKBody -*/ -type GetUserOKBody struct { - // User ID - UserID int64 `json:"user_id,omitempty"` - - // Product Tour - ProductTourCompleted bool `json:"product_tour_completed,omitempty"` - - // Alerting Tour - AlertingTourCompleted bool `json:"alerting_tour_completed,omitempty"` - - // Snoozed PMM version update - SnoozedPMMVersion string `json:"snoozed_pmm_version,omitempty"` - - // Timestamp of last snooze - // Format: date-time - SnoozedAt strfmt.DateTime `json:"snoozed_at,omitempty"` - - // Number of times the update was snoozed - SnoozeCount int64 `json:"snooze_count,omitempty"` -} - -// Validate validates this get user OK body -func (o *GetUserOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateSnoozedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetUserOKBody) validateSnoozedAt(formats strfmt.Registry) error { - if swag.IsZero(o.SnoozedAt) { // not required - return nil - } - - if err := validate.FormatOf("getUserOk"+"."+"snoozed_at", "body", "date-time", o.SnoozedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this get user OK body based on context it is used -func (o *GetUserOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetUserOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetUserOKBody) UnmarshalBinary(b []byte) error { - var res GetUserOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/user/v1/json/client/user_service/list_users_parameters.go b/api/user/v1/json/client/user_service/list_users_parameters.go deleted file mode 100644 index 1d3c35510b7..00000000000 --- a/api/user/v1/json/client/user_service/list_users_parameters.go +++ /dev/null @@ -1,127 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package user_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" -) - -// NewListUsersParams creates a new ListUsersParams 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 NewListUsersParams() *ListUsersParams { - return &ListUsersParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListUsersParamsWithTimeout creates a new ListUsersParams object -// with the ability to set a timeout on a request. -func NewListUsersParamsWithTimeout(timeout time.Duration) *ListUsersParams { - return &ListUsersParams{ - timeout: timeout, - } -} - -// NewListUsersParamsWithContext creates a new ListUsersParams object -// with the ability to set a context for a request. -func NewListUsersParamsWithContext(ctx context.Context) *ListUsersParams { - return &ListUsersParams{ - Context: ctx, - } -} - -// NewListUsersParamsWithHTTPClient creates a new ListUsersParams object -// with the ability to set a custom HTTPClient for a request. -func NewListUsersParamsWithHTTPClient(client *http.Client) *ListUsersParams { - return &ListUsersParams{ - HTTPClient: client, - } -} - -/* -ListUsersParams contains all the parameters to send to the API endpoint - - for the list users operation. - - Typically these are written to a http.Request. -*/ -type ListUsersParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list users params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListUsersParams) WithDefaults() *ListUsersParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list users params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListUsersParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list users params -func (o *ListUsersParams) WithTimeout(timeout time.Duration) *ListUsersParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list users params -func (o *ListUsersParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list users params -func (o *ListUsersParams) WithContext(ctx context.Context) *ListUsersParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list users params -func (o *ListUsersParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list users params -func (o *ListUsersParams) WithHTTPClient(client *http.Client) *ListUsersParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list users params -func (o *ListUsersParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *ListUsersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/api/user/v1/json/client/user_service/list_users_responses.go b/api/user/v1/json/client/user_service/list_users_responses.go deleted file mode 100644 index ae9f445a45b..00000000000 --- a/api/user/v1/json/client/user_service/list_users_responses.go +++ /dev/null @@ -1,567 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package user_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" -) - -// ListUsersReader is a Reader for the ListUsers structure. -type ListUsersReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListUsersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewListUsersOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewListUsersDefault(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 - } -} - -// NewListUsersOK creates a ListUsersOK with default headers values -func NewListUsersOK() *ListUsersOK { - return &ListUsersOK{} -} - -/* -ListUsersOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type ListUsersOK struct { - Payload *ListUsersOKBody -} - -// IsSuccess returns true when this list users Ok response has a 2xx status code -func (o *ListUsersOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this list users Ok response has a 3xx status code -func (o *ListUsersOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this list users Ok response has a 4xx status code -func (o *ListUsersOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this list users Ok response has a 5xx status code -func (o *ListUsersOK) IsServerError() bool { - return false -} - -// IsCode returns true when this list users Ok response a status code equal to that given -func (o *ListUsersOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the list users Ok response -func (o *ListUsersOK) Code() int { - return 200 -} - -func (o *ListUsersOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/users][%d] listUsersOk %s", 200, payload) -} - -func (o *ListUsersOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/users][%d] listUsersOk %s", 200, payload) -} - -func (o *ListUsersOK) GetPayload() *ListUsersOKBody { - return o.Payload -} - -func (o *ListUsersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(ListUsersOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -// NewListUsersDefault creates a ListUsersDefault with default headers values -func NewListUsersDefault(code int) *ListUsersDefault { - return &ListUsersDefault{ - _statusCode: code, - } -} - -/* -ListUsersDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type ListUsersDefault struct { - _statusCode int - - Payload *ListUsersDefaultBody -} - -// IsSuccess returns true when this list users default response has a 2xx status code -func (o *ListUsersDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this list users default response has a 3xx status code -func (o *ListUsersDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this list users default response has a 4xx status code -func (o *ListUsersDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this list users default response has a 5xx status code -func (o *ListUsersDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this list users default response a status code equal to that given -func (o *ListUsersDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the list users default response -func (o *ListUsersDefault) Code() int { - return o._statusCode -} - -func (o *ListUsersDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/users][%d] ListUsers default %s", o._statusCode, payload) -} - -func (o *ListUsersDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/users][%d] ListUsers default %s", o._statusCode, payload) -} - -func (o *ListUsersDefault) GetPayload() *ListUsersDefaultBody { - return o.Payload -} - -func (o *ListUsersDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(ListUsersDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -ListUsersDefaultBody list users default body -swagger:model ListUsersDefaultBody -*/ -type ListUsersDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*ListUsersDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this list users default body -func (o *ListUsersDefaultBody) 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 *ListUsersDefaultBody) 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("ListUsers default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("ListUsers default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this list users default body based on the context it is used -func (o *ListUsersDefaultBody) 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 *ListUsersDefaultBody) 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("ListUsers default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("ListUsers default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListUsersDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListUsersDefaultBody) UnmarshalBinary(b []byte) error { - var res ListUsersDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListUsersDefaultBodyDetailsItems0 list users default body details items0 -swagger:model ListUsersDefaultBodyDetailsItems0 -*/ -type ListUsersDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` - - // list users default body details items0 - ListUsersDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *ListUsersDefaultBodyDetailsItems0) 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 ListUsersDefaultBodyDetailsItems0 - - 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.ListUsersDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o ListUsersDefaultBodyDetailsItems0) 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.ListUsersDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.ListUsersDefaultBodyDetailsItems0) - 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 list users default body details items0 -func (o *ListUsersDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list users default body details items0 based on context it is used -func (o *ListUsersDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListUsersDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListUsersDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res ListUsersDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListUsersOKBody list users OK body -swagger:model ListUsersOKBody -*/ -type ListUsersOKBody struct { - // users - Users []*ListUsersOKBodyUsersItems0 `json:"users"` -} - -// Validate validates this list users OK body -func (o *ListUsersOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateUsers(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListUsersOKBody) validateUsers(formats strfmt.Registry) error { - if swag.IsZero(o.Users) { // not required - return nil - } - - for i := 0; i < len(o.Users); i++ { - if swag.IsZero(o.Users[i]) { // not required - continue - } - - if o.Users[i] != nil { - if err := o.Users[i].Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listUsersOk" + "." + "users" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listUsersOk" + "." + "users" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this list users OK body based on the context it is used -func (o *ListUsersOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateUsers(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListUsersOKBody) contextValidateUsers(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Users); i++ { - if o.Users[i] != nil { - - if swag.IsZero(o.Users[i]) { // not required - return nil - } - - if err := o.Users[i].ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("listUsersOk" + "." + "users" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("listUsersOk" + "." + "users" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListUsersOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListUsersOKBody) UnmarshalBinary(b []byte) error { - var res ListUsersOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListUsersOKBodyUsersItems0 list users OK body users items0 -swagger:model ListUsersOKBodyUsersItems0 -*/ -type ListUsersOKBodyUsersItems0 struct { - // user id - UserID int64 `json:"user_id,omitempty"` - - // List of role IDs assigned to the user. - RoleIds []int64 `json:"role_ids"` -} - -// Validate validates this list users OK body users items0 -func (o *ListUsersOKBodyUsersItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list users OK body users items0 based on context it is used -func (o *ListUsersOKBodyUsersItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListUsersOKBodyUsersItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListUsersOKBodyUsersItems0) UnmarshalBinary(b []byte) error { - var res ListUsersOKBodyUsersItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/user/v1/json/client/user_service/update_user_parameters.go b/api/user/v1/json/client/user_service/update_user_parameters.go deleted file mode 100644 index c1e0a19fa5d..00000000000 --- a/api/user/v1/json/client/user_service/update_user_parameters.go +++ /dev/null @@ -1,144 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package user_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" -) - -// NewUpdateUserParams creates a new UpdateUserParams 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 NewUpdateUserParams() *UpdateUserParams { - return &UpdateUserParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewUpdateUserParamsWithTimeout creates a new UpdateUserParams object -// with the ability to set a timeout on a request. -func NewUpdateUserParamsWithTimeout(timeout time.Duration) *UpdateUserParams { - return &UpdateUserParams{ - timeout: timeout, - } -} - -// NewUpdateUserParamsWithContext creates a new UpdateUserParams object -// with the ability to set a context for a request. -func NewUpdateUserParamsWithContext(ctx context.Context) *UpdateUserParams { - return &UpdateUserParams{ - Context: ctx, - } -} - -// NewUpdateUserParamsWithHTTPClient creates a new UpdateUserParams object -// with the ability to set a custom HTTPClient for a request. -func NewUpdateUserParamsWithHTTPClient(client *http.Client) *UpdateUserParams { - return &UpdateUserParams{ - HTTPClient: client, - } -} - -/* -UpdateUserParams contains all the parameters to send to the API endpoint - - for the update user operation. - - Typically these are written to a http.Request. -*/ -type UpdateUserParams struct { - // Body. - Body UpdateUserBody - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the update user params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateUserParams) WithDefaults() *UpdateUserParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the update user params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateUserParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the update user params -func (o *UpdateUserParams) WithTimeout(timeout time.Duration) *UpdateUserParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the update user params -func (o *UpdateUserParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the update user params -func (o *UpdateUserParams) WithContext(ctx context.Context) *UpdateUserParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the update user params -func (o *UpdateUserParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the update user params -func (o *UpdateUserParams) WithHTTPClient(client *http.Client) *UpdateUserParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the update user params -func (o *UpdateUserParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the update user params -func (o *UpdateUserParams) WithBody(body UpdateUserBody) *UpdateUserParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the update user params -func (o *UpdateUserParams) SetBody(body UpdateUserBody) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *UpdateUserParams) 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/user/v1/json/client/user_service/update_user_responses.go b/api/user/v1/json/client/user_service/update_user_responses.go deleted file mode 100644 index f169cbad858..00000000000 --- a/api/user/v1/json/client/user_service/update_user_responses.go +++ /dev/null @@ -1,534 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package user_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" -) - -// UpdateUserReader is a Reader for the UpdateUser structure. -type UpdateUserReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *UpdateUserReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { - switch response.Code() { - case 200: - result := NewUpdateUserOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewUpdateUserDefault(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 - } -} - -// NewUpdateUserOK creates a UpdateUserOK with default headers values -func NewUpdateUserOK() *UpdateUserOK { - return &UpdateUserOK{} -} - -/* -UpdateUserOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type UpdateUserOK struct { - Payload *UpdateUserOKBody -} - -// IsSuccess returns true when this update user Ok response has a 2xx status code -func (o *UpdateUserOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this update user Ok response has a 3xx status code -func (o *UpdateUserOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update user Ok response has a 4xx status code -func (o *UpdateUserOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this update user Ok response has a 5xx status code -func (o *UpdateUserOK) IsServerError() bool { - return false -} - -// IsCode returns true when this update user Ok response a status code equal to that given -func (o *UpdateUserOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the update user Ok response -func (o *UpdateUserOK) Code() int { - return 200 -} - -func (o *UpdateUserOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/users/me][%d] updateUserOk %s", 200, payload) -} - -func (o *UpdateUserOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/users/me][%d] updateUserOk %s", 200, payload) -} - -func (o *UpdateUserOK) GetPayload() *UpdateUserOKBody { - return o.Payload -} - -func (o *UpdateUserOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(UpdateUserOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -// NewUpdateUserDefault creates a UpdateUserDefault with default headers values -func NewUpdateUserDefault(code int) *UpdateUserDefault { - return &UpdateUserDefault{ - _statusCode: code, - } -} - -/* -UpdateUserDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type UpdateUserDefault struct { - _statusCode int - - Payload *UpdateUserDefaultBody -} - -// IsSuccess returns true when this update user default response has a 2xx status code -func (o *UpdateUserDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this update user default response has a 3xx status code -func (o *UpdateUserDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this update user default response has a 4xx status code -func (o *UpdateUserDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this update user default response has a 5xx status code -func (o *UpdateUserDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this update user default response a status code equal to that given -func (o *UpdateUserDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the update user default response -func (o *UpdateUserDefault) Code() int { - return o._statusCode -} - -func (o *UpdateUserDefault) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/users/me][%d] UpdateUser default %s", o._statusCode, payload) -} - -func (o *UpdateUserDefault) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/users/me][%d] UpdateUser default %s", o._statusCode, payload) -} - -func (o *UpdateUserDefault) GetPayload() *UpdateUserDefaultBody { - return o.Payload -} - -func (o *UpdateUserDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(UpdateUserDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - return nil -} - -/* -UpdateUserBody update user body -swagger:model UpdateUserBody -*/ -type UpdateUserBody struct { - // Product Tour - ProductTourCompleted *bool `json:"product_tour_completed,omitempty"` - - // Alerting Tour - AlertingTourCompleted *bool `json:"alerting_tour_completed,omitempty"` - - // Snooze update alert for a PMM version - SnoozedPMMVersion *string `json:"snoozed_pmm_version,omitempty"` -} - -// Validate validates this update user body -func (o *UpdateUserBody) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this update user body based on context it is used -func (o *UpdateUserBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *UpdateUserBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *UpdateUserBody) UnmarshalBinary(b []byte) error { - var res UpdateUserBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -UpdateUserDefaultBody update user default body -swagger:model UpdateUserDefaultBody -*/ -type UpdateUserDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*UpdateUserDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this update user default body -func (o *UpdateUserDefaultBody) 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 *UpdateUserDefaultBody) 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("UpdateUser default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("UpdateUser default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - - } - - return nil -} - -// ContextValidate validate this update user default body based on the context it is used -func (o *UpdateUserDefaultBody) 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 *UpdateUserDefaultBody) 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("UpdateUser default" + "." + "details" + "." + strconv.Itoa(i)) - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("UpdateUser default" + "." + "details" + "." + strconv.Itoa(i)) - } - - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *UpdateUserDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *UpdateUserDefaultBody) UnmarshalBinary(b []byte) error { - var res UpdateUserDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -UpdateUserDefaultBodyDetailsItems0 update user default body details items0 -swagger:model UpdateUserDefaultBodyDetailsItems0 -*/ -type UpdateUserDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` - - // update user default body details items0 - UpdateUserDefaultBodyDetailsItems0 map[string]any `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (o *UpdateUserDefaultBodyDetailsItems0) 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 UpdateUserDefaultBodyDetailsItems0 - - 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.UpdateUserDefaultBodyDetailsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (o UpdateUserDefaultBodyDetailsItems0) 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.UpdateUserDefaultBodyDetailsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(o.UpdateUserDefaultBodyDetailsItems0) - 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 update user default body details items0 -func (o *UpdateUserDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this update user default body details items0 based on context it is used -func (o *UpdateUserDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *UpdateUserDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *UpdateUserDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res UpdateUserDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -UpdateUserOKBody update user OK body -swagger:model UpdateUserOKBody -*/ -type UpdateUserOKBody struct { - // User ID - UserID int64 `json:"user_id,omitempty"` - - // Product Tour - ProductTourCompleted bool `json:"product_tour_completed,omitempty"` - - // Alerting Tour - AlertingTourCompleted bool `json:"alerting_tour_completed,omitempty"` - - // Snooze update alert for a PMM version - SnoozedPMMVersion string `json:"snoozed_pmm_version,omitempty"` - - // Timestamp of last snooze - // Format: date-time - SnoozedAt strfmt.DateTime `json:"snoozed_at,omitempty"` - - // Number of times the update was snoozed - SnoozeCount int64 `json:"snooze_count,omitempty"` -} - -// Validate validates this update user OK body -func (o *UpdateUserOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateSnoozedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *UpdateUserOKBody) validateSnoozedAt(formats strfmt.Registry) error { - if swag.IsZero(o.SnoozedAt) { // not required - return nil - } - - if err := validate.FormatOf("updateUserOk"+"."+"snoozed_at", "body", "date-time", o.SnoozedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this update user OK body based on context it is used -func (o *UpdateUserOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *UpdateUserOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *UpdateUserOKBody) UnmarshalBinary(b []byte) error { - var res UpdateUserOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/user/v1/json/client/user_service/user_service_client.go b/api/user/v1/json/client/user_service/user_service_client.go deleted file mode 100644 index 864d6f46f30..00000000000 --- a/api/user/v1/json/client/user_service/user_service_client.go +++ /dev/null @@ -1,201 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package user_service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// New creates a new user service API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -// New creates a new user service API client with basic auth credentials. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - user: user for basic authentication header. -// - password: password for basic authentication header. -func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BasicAuth(user, password) - return &Client{transport: transport, formats: strfmt.Default} -} - -// New creates a new user service API client with a bearer token for authentication. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - bearerToken: bearer token for Bearer authentication header. -func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BearerToken(bearerToken) - return &Client{transport: transport, formats: strfmt.Default} -} - -/* -Client for user service API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption may be used to customize the behavior of Client methods. -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - GetUser(params *GetUserParams, opts ...ClientOption) (*GetUserOK, error) - - ListUsers(params *ListUsersParams, opts ...ClientOption) (*ListUsersOK, error) - - UpdateUser(params *UpdateUserParams, opts ...ClientOption) (*UpdateUserOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -GetUser gets user details - -Retrieve user details from PMM server -*/ -func (a *Client) GetUser(params *GetUserParams, opts ...ClientOption) (*GetUserOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewGetUserParams() - } - op := &runtime.ClientOperation{ - ID: "GetUser", - Method: "GET", - PathPattern: "/v1/users/me", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &GetUserReader{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.(*GetUserOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*GetUserDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -ListUsers lists all users - -Retrieve user details for all users from PMM server -*/ -func (a *Client) ListUsers(params *ListUsersParams, opts ...ClientOption) (*ListUsersOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewListUsersParams() - } - op := &runtime.ClientOperation{ - ID: "ListUsers", - Method: "GET", - PathPattern: "/v1/users", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &ListUsersReader{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.(*ListUsersOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*ListUsersDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -UpdateUser updates a user - -Update user details in PMM server -*/ -func (a *Client) UpdateUser(params *UpdateUserParams, opts ...ClientOption) (*UpdateUserOK, error) { - // NOTE: parameters are not validated before sending - if params == nil { - params = NewUpdateUserParams() - } - op := &runtime.ClientOperation{ - ID: "UpdateUser", - Method: "PUT", - PathPattern: "/v1/users/me", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &UpdateUserReader{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.(*UpdateUserOK) - if ok { - return success, nil - } - - // unexpected success response. - // - // a default response is provided: fill this and return an error - unexpectedSuccess := result.(*UpdateUserDefault) - - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/api/user/v1/json/v1.json b/api/user/v1/json/v1.json deleted file mode 100644 index d657c9e0254..00000000000 --- a/api/user/v1/json/v1.json +++ /dev/null @@ -1,294 +0,0 @@ -{ - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "schemes": [ - "https", - "http" - ], - "swagger": "2.0", - "info": { - "title": "PMM User API", - "version": "v1" - }, - "paths": { - "/v1/users": { - "get": { - "description": "Retrieve user details for all users from PMM server", - "tags": [ - "UserService" - ], - "summary": "List all users", - "operationId": "ListUsers", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "users": { - "type": "array", - "items": { - "type": "object", - "properties": { - "user_id": { - "type": "integer", - "format": "int64", - "x-order": 0 - }, - "role_ids": { - "description": "List of role IDs assigned to the user.", - "type": "array", - "items": { - "type": "integer", - "format": "int64" - }, - "x-order": 1 - } - } - }, - "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/users/me": { - "get": { - "description": "Retrieve user details from PMM server", - "tags": [ - "UserService" - ], - "summary": "Get user details", - "operationId": "GetUser", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "user_id": { - "type": "integer", - "format": "int64", - "title": "User ID", - "x-order": 0 - }, - "product_tour_completed": { - "type": "boolean", - "title": "Product Tour", - "x-order": 1 - }, - "alerting_tour_completed": { - "type": "boolean", - "title": "Alerting Tour", - "x-order": 2 - }, - "snoozed_pmm_version": { - "type": "string", - "title": "Snoozed PMM version update", - "x-order": 3 - }, - "snoozed_at": { - "type": "string", - "format": "date-time", - "title": "Timestamp of last snooze", - "x-order": 4 - }, - "snooze_count": { - "type": "integer", - "format": "int64", - "title": "Number of times the update was snoozed", - "x-order": 5 - } - } - } - }, - "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 - } - } - } - } - } - }, - "put": { - "description": "Update user details in PMM server", - "tags": [ - "UserService" - ], - "summary": "Update a user", - "operationId": "UpdateUser", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "product_tour_completed": { - "type": "boolean", - "title": "Product Tour", - "x-nullable": true, - "x-order": 0 - }, - "alerting_tour_completed": { - "type": "boolean", - "title": "Alerting Tour", - "x-nullable": true, - "x-order": 1 - }, - "snoozed_pmm_version": { - "type": "string", - "title": "Snooze update alert for a PMM version", - "x-nullable": true, - "x-order": 2 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "user_id": { - "type": "integer", - "format": "int64", - "title": "User ID", - "x-order": 0 - }, - "product_tour_completed": { - "type": "boolean", - "title": "Product Tour", - "x-order": 1 - }, - "alerting_tour_completed": { - "type": "boolean", - "title": "Alerting Tour", - "x-order": 2 - }, - "snoozed_pmm_version": { - "type": "string", - "title": "Snooze update alert for a PMM version", - "x-order": 3 - }, - "snoozed_at": { - "type": "string", - "format": "date-time", - "title": "Timestamp of last snooze", - "x-order": 4 - }, - "snooze_count": { - "type": "integer", - "format": "int64", - "title": "Number of times the update was snoozed", - "x-order": 5 - } - } - } - }, - "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 - } - } - } - } - } - } - } - }, - "tags": [ - { - "name": "UserService" - } - ] -} \ No newline at end of file diff --git a/api/user/v1/user.pb.go b/api/user/v1/user.pb.go deleted file mode 100644 index 0d089d84436..00000000000 --- a/api/user/v1/user.pb.go +++ /dev/null @@ -1,551 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.10 -// protoc (unknown) -// source: user/v1/user.proto - -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" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type GetUserRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetUserRequest) Reset() { - *x = GetUserRequest{} - mi := &file_user_v1_user_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetUserRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetUserRequest) ProtoMessage() {} - -func (x *GetUserRequest) ProtoReflect() protoreflect.Message { - mi := &file_user_v1_user_proto_msgTypes[0] - 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 GetUserRequest.ProtoReflect.Descriptor instead. -func (*GetUserRequest) Descriptor() ([]byte, []int) { - return file_user_v1_user_proto_rawDescGZIP(), []int{0} -} - -type GetUserResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // User ID - UserId uint32 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - // Product Tour - ProductTourCompleted bool `protobuf:"varint,2,opt,name=product_tour_completed,json=productTourCompleted,proto3" json:"product_tour_completed,omitempty"` - // Alerting Tour - AlertingTourCompleted bool `protobuf:"varint,3,opt,name=alerting_tour_completed,json=alertingTourCompleted,proto3" json:"alerting_tour_completed,omitempty"` - // Snoozed PMM version update - SnoozedPmmVersion string `protobuf:"bytes,4,opt,name=snoozed_pmm_version,json=snoozedPmmVersion,proto3" json:"snoozed_pmm_version,omitempty"` - // Timestamp of last snooze - SnoozedAt *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=snoozed_at,json=snoozedAt,proto3" json:"snoozed_at,omitempty"` - // Number of times the update was snoozed - SnoozeCount uint32 `protobuf:"varint,7,opt,name=snooze_count,json=snoozeCount,proto3" json:"snooze_count,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetUserResponse) Reset() { - *x = GetUserResponse{} - mi := &file_user_v1_user_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetUserResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetUserResponse) ProtoMessage() {} - -func (x *GetUserResponse) ProtoReflect() protoreflect.Message { - mi := &file_user_v1_user_proto_msgTypes[1] - 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 GetUserResponse.ProtoReflect.Descriptor instead. -func (*GetUserResponse) Descriptor() ([]byte, []int) { - return file_user_v1_user_proto_rawDescGZIP(), []int{1} -} - -func (x *GetUserResponse) GetUserId() uint32 { - if x != nil { - return x.UserId - } - return 0 -} - -func (x *GetUserResponse) GetProductTourCompleted() bool { - if x != nil { - return x.ProductTourCompleted - } - return false -} - -func (x *GetUserResponse) GetAlertingTourCompleted() bool { - if x != nil { - return x.AlertingTourCompleted - } - return false -} - -func (x *GetUserResponse) GetSnoozedPmmVersion() string { - if x != nil { - return x.SnoozedPmmVersion - } - return "" -} - -func (x *GetUserResponse) GetSnoozedAt() *timestamppb.Timestamp { - if x != nil { - return x.SnoozedAt - } - return nil -} - -func (x *GetUserResponse) GetSnoozeCount() uint32 { - if x != nil { - return x.SnoozeCount - } - return 0 -} - -type UpdateUserRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Product Tour - ProductTourCompleted *bool `protobuf:"varint,2,opt,name=product_tour_completed,json=productTourCompleted,proto3,oneof" json:"product_tour_completed,omitempty"` - // Alerting Tour - AlertingTourCompleted *bool `protobuf:"varint,3,opt,name=alerting_tour_completed,json=alertingTourCompleted,proto3,oneof" json:"alerting_tour_completed,omitempty"` - // Snooze update alert for a PMM version - SnoozedPmmVersion *string `protobuf:"bytes,4,opt,name=snoozed_pmm_version,json=snoozedPmmVersion,proto3,oneof" json:"snoozed_pmm_version,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *UpdateUserRequest) Reset() { - *x = UpdateUserRequest{} - mi := &file_user_v1_user_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *UpdateUserRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateUserRequest) ProtoMessage() {} - -func (x *UpdateUserRequest) ProtoReflect() protoreflect.Message { - mi := &file_user_v1_user_proto_msgTypes[2] - 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 UpdateUserRequest.ProtoReflect.Descriptor instead. -func (*UpdateUserRequest) Descriptor() ([]byte, []int) { - return file_user_v1_user_proto_rawDescGZIP(), []int{2} -} - -func (x *UpdateUserRequest) GetProductTourCompleted() bool { - if x != nil && x.ProductTourCompleted != nil { - return *x.ProductTourCompleted - } - return false -} - -func (x *UpdateUserRequest) GetAlertingTourCompleted() bool { - if x != nil && x.AlertingTourCompleted != nil { - return *x.AlertingTourCompleted - } - return false -} - -func (x *UpdateUserRequest) GetSnoozedPmmVersion() string { - if x != nil && x.SnoozedPmmVersion != nil { - return *x.SnoozedPmmVersion - } - return "" -} - -type UpdateUserResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // User ID - UserId uint32 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - // Product Tour - ProductTourCompleted bool `protobuf:"varint,2,opt,name=product_tour_completed,json=productTourCompleted,proto3" json:"product_tour_completed,omitempty"` - // Alerting Tour - AlertingTourCompleted bool `protobuf:"varint,3,opt,name=alerting_tour_completed,json=alertingTourCompleted,proto3" json:"alerting_tour_completed,omitempty"` - // Snooze update alert for a PMM version - SnoozedPmmVersion string `protobuf:"bytes,4,opt,name=snoozed_pmm_version,json=snoozedPmmVersion,proto3" json:"snoozed_pmm_version,omitempty"` - // Timestamp of last snooze - SnoozedAt *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=snoozed_at,json=snoozedAt,proto3" json:"snoozed_at,omitempty"` - // Number of times the update was snoozed - SnoozeCount uint32 `protobuf:"varint,7,opt,name=snooze_count,json=snoozeCount,proto3" json:"snooze_count,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *UpdateUserResponse) Reset() { - *x = UpdateUserResponse{} - mi := &file_user_v1_user_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *UpdateUserResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateUserResponse) ProtoMessage() {} - -func (x *UpdateUserResponse) ProtoReflect() protoreflect.Message { - mi := &file_user_v1_user_proto_msgTypes[3] - 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 UpdateUserResponse.ProtoReflect.Descriptor instead. -func (*UpdateUserResponse) Descriptor() ([]byte, []int) { - return file_user_v1_user_proto_rawDescGZIP(), []int{3} -} - -func (x *UpdateUserResponse) GetUserId() uint32 { - if x != nil { - return x.UserId - } - return 0 -} - -func (x *UpdateUserResponse) GetProductTourCompleted() bool { - if x != nil { - return x.ProductTourCompleted - } - return false -} - -func (x *UpdateUserResponse) GetAlertingTourCompleted() bool { - if x != nil { - return x.AlertingTourCompleted - } - return false -} - -func (x *UpdateUserResponse) GetSnoozedPmmVersion() string { - if x != nil { - return x.SnoozedPmmVersion - } - return "" -} - -func (x *UpdateUserResponse) GetSnoozedAt() *timestamppb.Timestamp { - if x != nil { - return x.SnoozedAt - } - return nil -} - -func (x *UpdateUserResponse) GetSnoozeCount() uint32 { - if x != nil { - return x.SnoozeCount - } - return 0 -} - -type ListUsersRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ListUsersRequest) Reset() { - *x = ListUsersRequest{} - mi := &file_user_v1_user_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ListUsersRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListUsersRequest) ProtoMessage() {} - -func (x *ListUsersRequest) ProtoReflect() protoreflect.Message { - mi := &file_user_v1_user_proto_msgTypes[4] - 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 ListUsersRequest.ProtoReflect.Descriptor instead. -func (*ListUsersRequest) Descriptor() ([]byte, []int) { - return file_user_v1_user_proto_rawDescGZIP(), []int{4} -} - -type ListUsersResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Users []*ListUsersResponse_UserDetail `protobuf:"bytes,1,rep,name=users,proto3" json:"users,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ListUsersResponse) Reset() { - *x = ListUsersResponse{} - mi := &file_user_v1_user_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ListUsersResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListUsersResponse) ProtoMessage() {} - -func (x *ListUsersResponse) ProtoReflect() protoreflect.Message { - mi := &file_user_v1_user_proto_msgTypes[5] - 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 ListUsersResponse.ProtoReflect.Descriptor instead. -func (*ListUsersResponse) Descriptor() ([]byte, []int) { - return file_user_v1_user_proto_rawDescGZIP(), []int{5} -} - -func (x *ListUsersResponse) GetUsers() []*ListUsersResponse_UserDetail { - if x != nil { - return x.Users - } - return nil -} - -type ListUsersResponse_UserDetail struct { - state protoimpl.MessageState `protogen:"open.v1"` - UserId uint32 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - // List of role IDs assigned to the user. - RoleIds []uint32 `protobuf:"varint,2,rep,packed,name=role_ids,json=roleIds,proto3" json:"role_ids,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ListUsersResponse_UserDetail) Reset() { - *x = ListUsersResponse_UserDetail{} - mi := &file_user_v1_user_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ListUsersResponse_UserDetail) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListUsersResponse_UserDetail) ProtoMessage() {} - -func (x *ListUsersResponse_UserDetail) ProtoReflect() protoreflect.Message { - mi := &file_user_v1_user_proto_msgTypes[6] - 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 ListUsersResponse_UserDetail.ProtoReflect.Descriptor instead. -func (*ListUsersResponse_UserDetail) Descriptor() ([]byte, []int) { - return file_user_v1_user_proto_rawDescGZIP(), []int{5, 0} -} - -func (x *ListUsersResponse_UserDetail) GetUserId() uint32 { - if x != nil { - return x.UserId - } - return 0 -} - -func (x *ListUsersResponse_UserDetail) GetRoleIds() []uint32 { - if x != nil { - return x.RoleIds - } - return nil -} - -var File_user_v1_user_proto protoreflect.FileDescriptor - -const file_user_v1_user_proto_rawDesc = "" + - "\n" + - "\x12user/v1/user.proto\x12\auser.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a.protoc-gen-openapiv2/options/annotations.proto\"\x10\n" + - "\x0eGetUserRequest\"\xac\x02\n" + - "\x0fGetUserResponse\x12\x17\n" + - "\auser_id\x18\x01 \x01(\rR\x06userId\x124\n" + - "\x16product_tour_completed\x18\x02 \x01(\bR\x14productTourCompleted\x126\n" + - "\x17alerting_tour_completed\x18\x03 \x01(\bR\x15alertingTourCompleted\x12.\n" + - "\x13snoozed_pmm_version\x18\x04 \x01(\tR\x11snoozedPmmVersion\x129\n" + - "\n" + - "snoozed_at\x18\x06 \x01(\v2\x1a.google.protobuf.TimestampR\tsnoozedAt\x12!\n" + - "\fsnooze_count\x18\a \x01(\rR\vsnoozeCountJ\x04\b\x05\x10\x06\"\x95\x02\n" + - "\x11UpdateUserRequest\x129\n" + - "\x16product_tour_completed\x18\x02 \x01(\bH\x00R\x14productTourCompleted\x88\x01\x01\x12;\n" + - "\x17alerting_tour_completed\x18\x03 \x01(\bH\x01R\x15alertingTourCompleted\x88\x01\x01\x123\n" + - "\x13snoozed_pmm_version\x18\x04 \x01(\tH\x02R\x11snoozedPmmVersion\x88\x01\x01B\x19\n" + - "\x17_product_tour_completedB\x1a\n" + - "\x18_alerting_tour_completedB\x16\n" + - "\x14_snoozed_pmm_versionJ\x04\b\x05\x10\x06\"\xaf\x02\n" + - "\x12UpdateUserResponse\x12\x17\n" + - "\auser_id\x18\x01 \x01(\rR\x06userId\x124\n" + - "\x16product_tour_completed\x18\x02 \x01(\bR\x14productTourCompleted\x126\n" + - "\x17alerting_tour_completed\x18\x03 \x01(\bR\x15alertingTourCompleted\x12.\n" + - "\x13snoozed_pmm_version\x18\x04 \x01(\tR\x11snoozedPmmVersion\x129\n" + - "\n" + - "snoozed_at\x18\x06 \x01(\v2\x1a.google.protobuf.TimestampR\tsnoozedAt\x12!\n" + - "\fsnooze_count\x18\a \x01(\rR\vsnoozeCountJ\x04\b\x05\x10\x06\"\x12\n" + - "\x10ListUsersRequest\"\x92\x01\n" + - "\x11ListUsersResponse\x12;\n" + - "\x05users\x18\x01 \x03(\v2%.user.v1.ListUsersResponse.UserDetailR\x05users\x1a@\n" + - "\n" + - "UserDetail\x12\x17\n" + - "\auser_id\x18\x01 \x01(\rR\x06userId\x12\x19\n" + - "\brole_ids\x18\x02 \x03(\rR\aroleIds2\xd4\x03\n" + - "\vUserService\x12\x8e\x01\n" + - "\aGetUser\x12\x17.user.v1.GetUserRequest\x1a\x18.user.v1.GetUserResponse\"P\x92A9\x12\x10Get user details\x1a%Retrieve user details from PMM server\x82\xd3\xe4\x93\x02\x0e\x12\f/v1/users/me\x12\x93\x01\n" + - "\n" + - "UpdateUser\x12\x1a.user.v1.UpdateUserRequest\x1a\x1b.user.v1.UpdateUserResponse\"L\x92A2\x12\rUpdate a user\x1a!Update user details in PMM server\x82\xd3\xe4\x93\x02\x11:\x01*\x1a\f/v1/users/me\x12\x9d\x01\n" + - "\tListUsers\x12\x19.user.v1.ListUsersRequest\x1a\x1a.user.v1.ListUsersResponse\"Y\x92AE\x12\x0eList all users\x1a3Retrieve user details for all users from PMM server\x82\xd3\xe4\x93\x02\v\x12\t/v1/usersB\x8f\x01\x92A\f\x12\n" + - "\n" + - "\bUser API\n" + - "\vcom.user.v1B\tUserProtoP\x01Z)github.com/percona/pmm/api/user/v1;userv1\xa2\x02\x03UXX\xaa\x02\aUser.V1\xca\x02\aUser\\V1\xe2\x02\x13User\\V1\\GPBMetadata\xea\x02\bUser::V1b\x06proto3" - -var ( - file_user_v1_user_proto_rawDescOnce sync.Once - file_user_v1_user_proto_rawDescData []byte -) - -func file_user_v1_user_proto_rawDescGZIP() []byte { - file_user_v1_user_proto_rawDescOnce.Do(func() { - file_user_v1_user_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_user_v1_user_proto_rawDesc), len(file_user_v1_user_proto_rawDesc))) - }) - 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_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 - 6, // 2: user.v1.ListUsersResponse.users:type_name -> user.v1.ListUsersResponse.UserDetail - 0, // 3: user.v1.UserService.GetUser:input_type -> user.v1.GetUserRequest - 2, // 4: user.v1.UserService.UpdateUser:input_type -> user.v1.UpdateUserRequest - 4, // 5: user.v1.UserService.ListUsers:input_type -> user.v1.ListUsersRequest - 1, // 6: user.v1.UserService.GetUser:output_type -> user.v1.GetUserResponse - 3, // 7: user.v1.UserService.UpdateUser:output_type -> user.v1.UpdateUserResponse - 5, // 8: user.v1.UserService.ListUsers:output_type -> user.v1.ListUsersResponse - 6, // [6:9] is the sub-list for method output_type - 3, // [3:6] is the sub-list for method input_type - 3, // [3:3] is the sub-list for extension type_name - 3, // [3:3] is the sub-list for extension extendee - 0, // [0:3] is the sub-list for field type_name -} - -func init() { file_user_v1_user_proto_init() } -func file_user_v1_user_proto_init() { - if File_user_v1_user_proto != nil { - return - } - file_user_v1_user_proto_msgTypes[2].OneofWrappers = []any{} - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_user_v1_user_proto_rawDesc), len(file_user_v1_user_proto_rawDesc)), - NumEnums: 0, - NumMessages: 7, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_user_v1_user_proto_goTypes, - DependencyIndexes: file_user_v1_user_proto_depIdxs, - MessageInfos: file_user_v1_user_proto_msgTypes, - }.Build() - File_user_v1_user_proto = out.File - file_user_v1_user_proto_goTypes = nil - file_user_v1_user_proto_depIdxs = nil -} diff --git a/api/user/v1/user.pb.gw.go b/api/user/v1/user.pb.gw.go deleted file mode 100644 index 52268099c70..00000000000 --- a/api/user/v1/user.pb.gw.go +++ /dev/null @@ -1,277 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: user/v1/user.proto - -/* -Package userv1 is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package userv1 - -import ( - "context" - "errors" - "io" - "net/http" - - "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" - "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" - "google.golang.org/protobuf/proto" -) - -// Suppress "imported and not used" errors -var ( - _ codes.Code - _ io.Reader - _ status.Status - _ = errors.New - _ = runtime.String - _ = utilities.NewDoubleArray - _ = metadata.Join -) - -func request_UserService_GetUser_0(ctx context.Context, marshaler runtime.Marshaler, client UserServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq GetUserRequest - metadata runtime.ServerMetadata - ) - if req.Body != nil { - _, _ = io.Copy(io.Discard, req.Body) - } - msg, err := client.GetUser(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_UserService_GetUser_0(ctx context.Context, marshaler runtime.Marshaler, server UserServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq GetUserRequest - metadata runtime.ServerMetadata - ) - msg, err := server.GetUser(ctx, &protoReq) - return msg, metadata, err -} - -func request_UserService_UpdateUser_0(ctx context.Context, marshaler runtime.Marshaler, client UserServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq UpdateUserRequest - 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.UpdateUser(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_UserService_UpdateUser_0(ctx context.Context, marshaler runtime.Marshaler, server UserServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq UpdateUserRequest - 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.UpdateUser(ctx, &protoReq) - return msg, metadata, err -} - -func request_UserService_ListUsers_0(ctx context.Context, marshaler runtime.Marshaler, client UserServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq ListUsersRequest - metadata runtime.ServerMetadata - ) - if req.Body != nil { - _, _ = io.Copy(io.Discard, req.Body) - } - msg, err := client.ListUsers(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_UserService_ListUsers_0(ctx context.Context, marshaler runtime.Marshaler, server UserServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq ListUsersRequest - metadata runtime.ServerMetadata - ) - msg, err := server.ListUsers(ctx, &protoReq) - return msg, metadata, err -} - -// RegisterUserServiceHandlerServer registers the http handlers for service UserService to "mux". -// UnaryRPC :call UserServiceServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterUserServiceHandlerFromEndpoint instead. -// GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call. -func RegisterUserServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server UserServiceServer) error { - mux.Handle(http.MethodGet, pattern_UserService_GetUser_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, "/user.v1.UserService/GetUser", runtime.WithHTTPPathPattern("/v1/users/me")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_UserService_GetUser_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_UserService_GetUser_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPut, pattern_UserService_UpdateUser_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, "/user.v1.UserService/UpdateUser", runtime.WithHTTPPathPattern("/v1/users/me")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_UserService_UpdateUser_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_UserService_UpdateUser_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodGet, pattern_UserService_ListUsers_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, "/user.v1.UserService/ListUsers", runtime.WithHTTPPathPattern("/v1/users")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_UserService_ListUsers_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_UserService_ListUsers_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - return nil -} - -// RegisterUserServiceHandlerFromEndpoint is same as RegisterUserServiceHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterUserServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.NewClient(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - return RegisterUserServiceHandler(ctx, mux, conn) -} - -// RegisterUserServiceHandler registers the http handlers for service UserService to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterUserServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterUserServiceHandlerClient(ctx, mux, NewUserServiceClient(conn)) -} - -// RegisterUserServiceHandlerClient registers the http handlers for service UserService -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "UserServiceClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "UserServiceClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "UserServiceClient" to call the correct interceptors. This client ignores the HTTP middlewares. -func RegisterUserServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client UserServiceClient) error { - mux.Handle(http.MethodGet, pattern_UserService_GetUser_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, "/user.v1.UserService/GetUser", runtime.WithHTTPPathPattern("/v1/users/me")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_UserService_GetUser_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_UserService_GetUser_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPut, pattern_UserService_UpdateUser_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, "/user.v1.UserService/UpdateUser", runtime.WithHTTPPathPattern("/v1/users/me")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_UserService_UpdateUser_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_UserService_UpdateUser_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodGet, pattern_UserService_ListUsers_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, "/user.v1.UserService/ListUsers", runtime.WithHTTPPathPattern("/v1/users")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_UserService_ListUsers_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_UserService_ListUsers_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - return nil -} - -var ( - pattern_UserService_GetUser_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "users", "me"}, "")) - pattern_UserService_UpdateUser_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "users", "me"}, "")) - pattern_UserService_ListUsers_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "users"}, "")) -) - -var ( - forward_UserService_GetUser_0 = runtime.ForwardResponseMessage - forward_UserService_UpdateUser_0 = runtime.ForwardResponseMessage - forward_UserService_ListUsers_0 = runtime.ForwardResponseMessage -) diff --git a/api/user/v1/user.pb.validate.go b/api/user/v1/user.pb.validate.go deleted file mode 100644 index a6c5de6f159..00000000000 --- a/api/user/v1/user.pb.validate.go +++ /dev/null @@ -1,871 +0,0 @@ -// Code generated by protoc-gen-validate. DO NOT EDIT. -// source: user/v1/user.proto - -package userv1 - -import ( - "bytes" - "errors" - "fmt" - "net" - "net/mail" - "net/url" - "regexp" - "sort" - "strings" - "time" - "unicode/utf8" - - "google.golang.org/protobuf/types/known/anypb" -) - -// ensure the imports are used -var ( - _ = bytes.MinRead - _ = errors.New("") - _ = fmt.Print - _ = utf8.UTFMax - _ = (*regexp.Regexp)(nil) - _ = (*strings.Reader)(nil) - _ = net.IPv4len - _ = time.Duration(0) - _ = (*url.URL)(nil) - _ = (*mail.Address)(nil) - _ = anypb.Any{} - _ = sort.Sort -) - -// Validate checks the field values on GetUserRequest 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 *GetUserRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on GetUserRequest 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 GetUserRequestMultiError, -// or nil if none found. -func (m *GetUserRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *GetUserRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return GetUserRequestMultiError(errors) - } - - return nil -} - -// GetUserRequestMultiError is an error wrapping multiple validation errors -// returned by GetUserRequest.ValidateAll() if the designated constraints -// aren't met. -type GetUserRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m GetUserRequestMultiError) 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 GetUserRequestMultiError) AllErrors() []error { return m } - -// GetUserRequestValidationError is the validation error returned by -// GetUserRequest.Validate if the designated constraints aren't met. -type GetUserRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e GetUserRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e GetUserRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e GetUserRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e GetUserRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e GetUserRequestValidationError) ErrorName() string { return "GetUserRequestValidationError" } - -// Error satisfies the builtin error interface -func (e GetUserRequestValidationError) 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 %sGetUserRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = GetUserRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = GetUserRequestValidationError{} - -// Validate checks the field values on GetUserResponse 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 *GetUserResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on GetUserResponse 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 -// GetUserResponseMultiError, or nil if none found. -func (m *GetUserResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *GetUserResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for UserId - - // no validation rules for ProductTourCompleted - - // no validation rules for AlertingTourCompleted - - // no validation rules for SnoozedPmmVersion - - if all { - switch v := interface{}(m.GetSnoozedAt()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GetUserResponseValidationError{ - field: "SnoozedAt", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GetUserResponseValidationError{ - field: "SnoozedAt", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetSnoozedAt()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GetUserResponseValidationError{ - field: "SnoozedAt", - reason: "embedded message failed validation", - cause: err, - } - } - } - - // no validation rules for SnoozeCount - - if len(errors) > 0 { - return GetUserResponseMultiError(errors) - } - - return nil -} - -// GetUserResponseMultiError is an error wrapping multiple validation errors -// returned by GetUserResponse.ValidateAll() if the designated constraints -// aren't met. -type GetUserResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m GetUserResponseMultiError) 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 GetUserResponseMultiError) AllErrors() []error { return m } - -// GetUserResponseValidationError is the validation error returned by -// GetUserResponse.Validate if the designated constraints aren't met. -type GetUserResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e GetUserResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e GetUserResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e GetUserResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e GetUserResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e GetUserResponseValidationError) ErrorName() string { return "GetUserResponseValidationError" } - -// Error satisfies the builtin error interface -func (e GetUserResponseValidationError) 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 %sGetUserResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = GetUserResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = GetUserResponseValidationError{} - -// Validate checks the field values on UpdateUserRequest 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 *UpdateUserRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on UpdateUserRequest 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 -// UpdateUserRequestMultiError, or nil if none found. -func (m *UpdateUserRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *UpdateUserRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if m.ProductTourCompleted != nil { - // no validation rules for ProductTourCompleted - } - - if m.AlertingTourCompleted != nil { - // no validation rules for AlertingTourCompleted - } - - if m.SnoozedPmmVersion != nil { - // no validation rules for SnoozedPmmVersion - } - - if len(errors) > 0 { - return UpdateUserRequestMultiError(errors) - } - - return nil -} - -// UpdateUserRequestMultiError is an error wrapping multiple validation errors -// returned by UpdateUserRequest.ValidateAll() if the designated constraints -// aren't met. -type UpdateUserRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m UpdateUserRequestMultiError) 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 UpdateUserRequestMultiError) AllErrors() []error { return m } - -// UpdateUserRequestValidationError is the validation error returned by -// UpdateUserRequest.Validate if the designated constraints aren't met. -type UpdateUserRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e UpdateUserRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e UpdateUserRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e UpdateUserRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e UpdateUserRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e UpdateUserRequestValidationError) ErrorName() string { - return "UpdateUserRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e UpdateUserRequestValidationError) 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 %sUpdateUserRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = UpdateUserRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = UpdateUserRequestValidationError{} - -// Validate checks the field values on UpdateUserResponse 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 *UpdateUserResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on UpdateUserResponse 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 -// UpdateUserResponseMultiError, or nil if none found. -func (m *UpdateUserResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *UpdateUserResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for UserId - - // no validation rules for ProductTourCompleted - - // no validation rules for AlertingTourCompleted - - // no validation rules for SnoozedPmmVersion - - if all { - switch v := interface{}(m.GetSnoozedAt()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, UpdateUserResponseValidationError{ - field: "SnoozedAt", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, UpdateUserResponseValidationError{ - field: "SnoozedAt", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetSnoozedAt()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return UpdateUserResponseValidationError{ - field: "SnoozedAt", - reason: "embedded message failed validation", - cause: err, - } - } - } - - // no validation rules for SnoozeCount - - if len(errors) > 0 { - return UpdateUserResponseMultiError(errors) - } - - return nil -} - -// UpdateUserResponseMultiError is an error wrapping multiple validation errors -// returned by UpdateUserResponse.ValidateAll() if the designated constraints -// aren't met. -type UpdateUserResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m UpdateUserResponseMultiError) 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 UpdateUserResponseMultiError) AllErrors() []error { return m } - -// UpdateUserResponseValidationError is the validation error returned by -// UpdateUserResponse.Validate if the designated constraints aren't met. -type UpdateUserResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e UpdateUserResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e UpdateUserResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e UpdateUserResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e UpdateUserResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e UpdateUserResponseValidationError) ErrorName() string { - return "UpdateUserResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e UpdateUserResponseValidationError) 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 %sUpdateUserResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = UpdateUserResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = UpdateUserResponseValidationError{} - -// Validate checks the field values on ListUsersRequest 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 *ListUsersRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ListUsersRequest 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 -// ListUsersRequestMultiError, or nil if none found. -func (m *ListUsersRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *ListUsersRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return ListUsersRequestMultiError(errors) - } - - return nil -} - -// ListUsersRequestMultiError is an error wrapping multiple validation errors -// returned by ListUsersRequest.ValidateAll() if the designated constraints -// aren't met. -type ListUsersRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ListUsersRequestMultiError) 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 ListUsersRequestMultiError) AllErrors() []error { return m } - -// ListUsersRequestValidationError is the validation error returned by -// ListUsersRequest.Validate if the designated constraints aren't met. -type ListUsersRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ListUsersRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ListUsersRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ListUsersRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ListUsersRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ListUsersRequestValidationError) ErrorName() string { return "ListUsersRequestValidationError" } - -// Error satisfies the builtin error interface -func (e ListUsersRequestValidationError) 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 %sListUsersRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ListUsersRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ListUsersRequestValidationError{} - -// Validate checks the field values on ListUsersResponse 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 *ListUsersResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ListUsersResponse 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 -// ListUsersResponseMultiError, or nil if none found. -func (m *ListUsersResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *ListUsersResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - for idx, item := range m.GetUsers() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ListUsersResponseValidationError{ - field: fmt.Sprintf("Users[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ListUsersResponseValidationError{ - field: fmt.Sprintf("Users[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ListUsersResponseValidationError{ - field: fmt.Sprintf("Users[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - if len(errors) > 0 { - return ListUsersResponseMultiError(errors) - } - - return nil -} - -// ListUsersResponseMultiError is an error wrapping multiple validation errors -// returned by ListUsersResponse.ValidateAll() if the designated constraints -// aren't met. -type ListUsersResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ListUsersResponseMultiError) 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 ListUsersResponseMultiError) AllErrors() []error { return m } - -// ListUsersResponseValidationError is the validation error returned by -// ListUsersResponse.Validate if the designated constraints aren't met. -type ListUsersResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ListUsersResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ListUsersResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ListUsersResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ListUsersResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ListUsersResponseValidationError) ErrorName() string { - return "ListUsersResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e ListUsersResponseValidationError) 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 %sListUsersResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ListUsersResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ListUsersResponseValidationError{} - -// Validate checks the field values on ListUsersResponse_UserDetail 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 *ListUsersResponse_UserDetail) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ListUsersResponse_UserDetail 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 -// ListUsersResponse_UserDetailMultiError, or nil if none found. -func (m *ListUsersResponse_UserDetail) ValidateAll() error { - return m.validate(true) -} - -func (m *ListUsersResponse_UserDetail) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for UserId - - if len(errors) > 0 { - return ListUsersResponse_UserDetailMultiError(errors) - } - - return nil -} - -// ListUsersResponse_UserDetailMultiError is an error wrapping multiple -// validation errors returned by ListUsersResponse_UserDetail.ValidateAll() if -// the designated constraints aren't met. -type ListUsersResponse_UserDetailMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ListUsersResponse_UserDetailMultiError) 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 ListUsersResponse_UserDetailMultiError) AllErrors() []error { return m } - -// ListUsersResponse_UserDetailValidationError is the validation error returned -// by ListUsersResponse_UserDetail.Validate if the designated constraints -// aren't met. -type ListUsersResponse_UserDetailValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ListUsersResponse_UserDetailValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ListUsersResponse_UserDetailValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ListUsersResponse_UserDetailValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ListUsersResponse_UserDetailValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ListUsersResponse_UserDetailValidationError) ErrorName() string { - return "ListUsersResponse_UserDetailValidationError" -} - -// Error satisfies the builtin error interface -func (e ListUsersResponse_UserDetailValidationError) 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 %sListUsersResponse_UserDetail.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ListUsersResponse_UserDetailValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ListUsersResponse_UserDetailValidationError{} diff --git a/api/user/v1/user_grpc.pb.go b/api/user/v1/user_grpc.pb.go deleted file mode 100644 index 4201de2b381..00000000000 --- a/api/user/v1/user_grpc.pb.go +++ /dev/null @@ -1,204 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.6.0 -// - protoc (unknown) -// source: user/v1/user.proto - -package userv1 - -import ( - context "context" - - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.64.0 or later. -const _ = grpc.SupportPackageIsVersion9 - -const ( - UserService_GetUser_FullMethodName = "/user.v1.UserService/GetUser" - UserService_UpdateUser_FullMethodName = "/user.v1.UserService/UpdateUser" - UserService_ListUsers_FullMethodName = "/user.v1.UserService/ListUsers" -) - -// UserServiceClient is the client API for UserService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -// -// UserService contains rpcs related to user data -type UserServiceClient interface { - GetUser(ctx context.Context, in *GetUserRequest, opts ...grpc.CallOption) (*GetUserResponse, error) - UpdateUser(ctx context.Context, in *UpdateUserRequest, opts ...grpc.CallOption) (*UpdateUserResponse, error) - ListUsers(ctx context.Context, in *ListUsersRequest, opts ...grpc.CallOption) (*ListUsersResponse, error) -} - -type userServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewUserServiceClient(cc grpc.ClientConnInterface) UserServiceClient { - return &userServiceClient{cc} -} - -func (c *userServiceClient) GetUser(ctx context.Context, in *GetUserRequest, opts ...grpc.CallOption) (*GetUserResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetUserResponse) - err := c.cc.Invoke(ctx, UserService_GetUser_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *userServiceClient) UpdateUser(ctx context.Context, in *UpdateUserRequest, opts ...grpc.CallOption) (*UpdateUserResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(UpdateUserResponse) - err := c.cc.Invoke(ctx, UserService_UpdateUser_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *userServiceClient) ListUsers(ctx context.Context, in *ListUsersRequest, opts ...grpc.CallOption) (*ListUsersResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(ListUsersResponse) - err := c.cc.Invoke(ctx, UserService_ListUsers_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -// UserServiceServer is the server API for UserService service. -// All implementations must embed UnimplementedUserServiceServer -// for forward compatibility. -// -// UserService contains rpcs related to user data -type UserServiceServer interface { - GetUser(context.Context, *GetUserRequest) (*GetUserResponse, error) - UpdateUser(context.Context, *UpdateUserRequest) (*UpdateUserResponse, error) - ListUsers(context.Context, *ListUsersRequest) (*ListUsersResponse, error) - mustEmbedUnimplementedUserServiceServer() -} - -// UnimplementedUserServiceServer must be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -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") -} -func (UnimplementedUserServiceServer) mustEmbedUnimplementedUserServiceServer() {} -func (UnimplementedUserServiceServer) testEmbeddedByValue() {} - -// UnsafeUserServiceServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to UserServiceServer will -// result in compilation errors. -type UnsafeUserServiceServer interface { - mustEmbedUnimplementedUserServiceServer() -} - -func RegisterUserServiceServer(s grpc.ServiceRegistrar, srv UserServiceServer) { - // If the following call panics, it indicates UnimplementedUserServiceServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } - s.RegisterService(&UserService_ServiceDesc, srv) -} - -func _UserService_GetUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetUserRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(UserServiceServer).GetUser(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: UserService_GetUser_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(UserServiceServer).GetUser(ctx, req.(*GetUserRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _UserService_UpdateUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdateUserRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(UserServiceServer).UpdateUser(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: UserService_UpdateUser_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(UserServiceServer).UpdateUser(ctx, req.(*UpdateUserRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _UserService_ListUsers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListUsersRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(UserServiceServer).ListUsers(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: UserService_ListUsers_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(UserServiceServer).ListUsers(ctx, req.(*ListUsersRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// UserService_ServiceDesc is the grpc.ServiceDesc for UserService service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var UserService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "user.v1.UserService", - HandlerType: (*UserServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "GetUser", - Handler: _UserService_GetUser_Handler, - }, - { - MethodName: "UpdateUser", - Handler: _UserService_UpdateUser_Handler, - }, - { - MethodName: "ListUsers", - Handler: _UserService_ListUsers_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "user/v1/user.proto", -}